/* preprocessor.c generated by valac 0.44.9, the Vala compiler
 * generated from preprocessor.vala, do not modify */

#include <glib-object.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <libcommon.h>
#include <stdio.h>
#include <libxml/xmlreader.h>
#include <libxml/xmlwriter.h>
#include <glib/gstdio.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <gobject/gvaluecollector.h>

#define WIXL_TYPE_PREPROCESSOR (wixl_preprocessor_get_type ())
#define WIXL_PREPROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIXL_TYPE_PREPROCESSOR, WixlPreprocessor))
#define WIXL_PREPROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIXL_TYPE_PREPROCESSOR, WixlPreprocessorClass))
#define WIXL_IS_PREPROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIXL_TYPE_PREPROCESSOR))
#define WIXL_IS_PREPROCESSOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIXL_TYPE_PREPROCESSOR))
#define WIXL_PREPROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIXL_TYPE_PREPROCESSOR, WixlPreprocessorClass))

typedef struct _WixlPreprocessor WixlPreprocessor;
typedef struct _WixlPreprocessorClass WixlPreprocessorClass;
typedef struct _WixlPreprocessorPrivate WixlPreprocessorPrivate;
enum  {
	WIXL_PREPROCESSOR_0_PROPERTY,
	WIXL_PREPROCESSOR_NUM_PROPERTIES
};
static GParamSpec* wixl_preprocessor_properties[WIXL_PREPROCESSOR_NUM_PROPERTIES];
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION (wixl_preprocessor_eval_condition_get_type ())
#define WIXL_PREPROCESSOR_EVAL_CONDITION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION, WixlPreprocessorEvalCondition))
#define WIXL_PREPROCESSOR_EVAL_CONDITION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION, WixlPreprocessorEvalConditionClass))
#define WIXL_PREPROCESSOR_IS_EVAL_CONDITION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION))
#define WIXL_PREPROCESSOR_IS_EVAL_CONDITION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION))
#define WIXL_PREPROCESSOR_EVAL_CONDITION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION, WixlPreprocessorEvalConditionClass))

typedef struct _WixlPreprocessorEvalCondition WixlPreprocessorEvalCondition;
typedef struct _WixlPreprocessorEvalConditionClass WixlPreprocessorEvalConditionClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define WIXL_PREPROCESSOR_TYPE_LOCATION (wixl_preprocessor_location_get_type ())
#define WIXL_PREPROCESSOR_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIXL_PREPROCESSOR_TYPE_LOCATION, WixlPreprocessorLocation))
#define WIXL_PREPROCESSOR_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIXL_PREPROCESSOR_TYPE_LOCATION, WixlPreprocessorLocationClass))
#define WIXL_PREPROCESSOR_IS_LOCATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIXL_PREPROCESSOR_TYPE_LOCATION))
#define WIXL_PREPROCESSOR_IS_LOCATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIXL_PREPROCESSOR_TYPE_LOCATION))
#define WIXL_PREPROCESSOR_LOCATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIXL_PREPROCESSOR_TYPE_LOCATION, WixlPreprocessorLocationClass))

typedef struct _WixlPreprocessorLocation WixlPreprocessorLocation;
typedef struct _WixlPreprocessorLocationClass WixlPreprocessorLocationClass;

#define WIXL_PREPROCESSOR_TYPE_IF_CONTEXT (wixl_preprocessor_if_context_get_type ())
#define WIXL_PREPROCESSOR_IF_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIXL_PREPROCESSOR_TYPE_IF_CONTEXT, WixlPreprocessorIfContext))
#define WIXL_PREPROCESSOR_IF_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIXL_PREPROCESSOR_TYPE_IF_CONTEXT, WixlPreprocessorIfContextClass))
#define WIXL_PREPROCESSOR_IS_IF_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIXL_PREPROCESSOR_TYPE_IF_CONTEXT))
#define WIXL_PREPROCESSOR_IS_IF_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIXL_PREPROCESSOR_TYPE_IF_CONTEXT))
#define WIXL_PREPROCESSOR_IF_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIXL_PREPROCESSOR_TYPE_IF_CONTEXT, WixlPreprocessorIfContextClass))

typedef struct _WixlPreprocessorIfContext WixlPreprocessorIfContext;
typedef struct _WixlPreprocessorIfContextClass WixlPreprocessorIfContextClass;
typedef enum  {
	WIXL_PREPROCESSOR_IF_CONTEXT_STATE_UNKNOWN,
	WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF,
	WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSE,
	WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSEIF
} WixlPreprocessorIfContextState;

#define WIXL_PREPROCESSOR_IF_CONTEXT_TYPE_STATE (wixl_preprocessor_if_context_state_get_type ())
typedef struct _WixlPreprocessorIfContextPrivate WixlPreprocessorIfContextPrivate;
#define _wixl_preprocessor_if_context_unref0(var) ((var == NULL) ? NULL : (var = (wixl_preprocessor_if_context_unref (var), NULL)))
#define _g_match_info_unref0(var) ((var == NULL) ? NULL : (var = (g_match_info_unref (var), NULL)))
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
#define _xmlFreeTextReader0(var) ((var == NULL) ? NULL : (var = (xmlFreeTextReader (var), NULL)))
typedef struct _WixlPreprocessorLocationPrivate WixlPreprocessorLocationPrivate;
#define _xmlFreeTextWriter0(var) ((var == NULL) ? NULL : (var = (xmlFreeTextWriter (var), NULL)))
#define _xmlFreeDoc0(var) ((var == NULL) ? NULL : (var = (xmlFreeDoc (var), NULL)))
typedef struct _WixlPreprocessorEvalConditionPrivate WixlPreprocessorEvalConditionPrivate;
enum  {
	WIXL_PREPROCESSOR_EVAL_CONDITION_0_PROPERTY,
	WIXL_PREPROCESSOR_EVAL_CONDITION_NUM_PROPERTIES
};
static GParamSpec* wixl_preprocessor_eval_condition_properties[WIXL_PREPROCESSOR_EVAL_CONDITION_NUM_PROPERTIES];
typedef enum  {
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NONE,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EQUAL,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OPEN_VAR,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EQ,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EC,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NE,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LT,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LTE,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GT,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GTE,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_AND,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OR,
	WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NOT
} WixlPreprocessorEvalConditionOp;

#define WIXL_PREPROCESSOR_EVAL_CONDITION_TYPE_OP (wixl_preprocessor_eval_condition_op_get_type ())
#define _g_scanner_destroy0(var) ((var == NULL) ? NULL : (var = (g_scanner_destroy (var), NULL)))
enum  {
	WIXL_PREPROCESSOR_LOCATION_0_PROPERTY,
	WIXL_PREPROCESSOR_LOCATION_NUM_PROPERTIES
};
static GParamSpec* wixl_preprocessor_location_properties[WIXL_PREPROCESSOR_LOCATION_NUM_PROPERTIES];
typedef struct _WixlPreprocessorParamSpecIfContext WixlPreprocessorParamSpecIfContext;

struct _WixlPreprocessor {
	GObject parent_instance;
	WixlPreprocessorPrivate * priv;
};

struct _WixlPreprocessorClass {
	GObjectClass parent_class;
};

struct _WixlPreprocessorPrivate {
	GList* includedirs;
	GHashTable* variables;
	GHashTable* requires;
};

struct _WixlPreprocessorIfContext {
	GTypeInstance parent_instance;
	volatile int ref_count;
	WixlPreprocessorIfContextPrivate * priv;
	gboolean never_true;
	gboolean enabled;
	WixlPreprocessorIfContextState state;
};

struct _WixlPreprocessorIfContextClass {
	GTypeClass parent_class;
	void (*finalize) (WixlPreprocessorIfContext *self);
};

struct _WixlPreprocessorLocation {
	GObject parent_instance;
	WixlPreprocessorLocationPrivate * priv;
	GFile* file;
	gint line;
};

struct _WixlPreprocessorLocationClass {
	GObjectClass parent_class;
};

struct _WixlPreprocessorEvalCondition {
	GObject parent_instance;
	WixlPreprocessorEvalConditionPrivate * priv;
};

struct _WixlPreprocessorEvalConditionClass {
	GObjectClass parent_class;
};

struct _WixlPreprocessorEvalConditionPrivate {
	GFile* file;
	WixlPreprocessor* preprocessor;
	GScanner* scanner;
};

struct _WixlPreprocessorIfContextPrivate {
	gboolean _is_true;
};

struct _WixlPreprocessorParamSpecIfContext {
	GParamSpec parent_instance;
};

static gint WixlPreprocessor_private_offset;
static gpointer wixl_preprocessor_parent_class = NULL;
static gint WixlPreprocessorEvalCondition_private_offset;
static gpointer wixl_preprocessor_eval_condition_parent_class = NULL;
static gpointer wixl_preprocessor_location_parent_class = NULL;
static gint WixlPreprocessorIfContext_private_offset;
static gpointer wixl_preprocessor_if_context_parent_class = NULL;

GType wixl_preprocessor_get_type (void) G_GNUC_CONST;
static void _g_free0_ (gpointer var);
WixlPreprocessor* wixl_preprocessor_new (GHashTable* globals,
                                         GList* includedirs);
WixlPreprocessor* wixl_preprocessor_construct (GType object_type,
                                               GHashTable* globals,
                                               GList* includedirs);
void wixl_preprocessor_define_variable (WixlPreprocessor* self,
                                        const gchar* name,
                                        const gchar* value);
void wixl_preprocessor_undefine_variable (WixlPreprocessor* self,
                                          const gchar* name);
gchar* wixl_preprocessor_lookup_variable (WixlPreprocessor* self,
                                          const gchar* name);
gchar* wixl_preprocessor_eval_variable (WixlPreprocessor* self,
                                        const gchar* str,
                                        GFile* file,
                                        GError** error);
gchar* wixl_preprocessor_eval (WixlPreprocessor* self,
                               const gchar* str,
                               GFile* file,
                               GError** error);
gboolean wixl_preprocessor_eval_condition (WixlPreprocessor* self,
                                           const gchar* str,
                                           GFile* file,
                                           GError** error);
static GType wixl_preprocessor_eval_condition_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static WixlPreprocessorEvalCondition* wixl_preprocessor_eval_condition_new (WixlPreprocessor* pp,
                                                                     GFile* file);
static WixlPreprocessorEvalCondition* wixl_preprocessor_eval_condition_construct (GType object_type,
                                                                           WixlPreprocessor* pp,
                                                                           GFile* file);
static gboolean wixl_preprocessor_eval_condition_eval (WixlPreprocessorEvalCondition* self,
                                                const gchar* str,
                                                GError** error);
static GType wixl_preprocessor_location_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static void wixl_preprocessor_print (WixlPreprocessor* self,
                              const gchar* prefix,
                              WixlPreprocessorLocation* loc,
                              const gchar* msg);
static gchar* wixl_preprocessor_location_to_string (WixlPreprocessorLocation* self);
static void wixl_preprocessor_preprocess_xml (WixlPreprocessor* self,
                                       xmlTextReader* reader,
                                       xmlTextWriter* writer,
                                       GFile* file,
                                       gboolean is_include,
                                       GError** error);
static gpointer wixl_preprocessor_if_context_ref (gpointer instance);
static void wixl_preprocessor_if_context_unref (gpointer instance);
static GParamSpec* wixl_preprocessor_param_spec_if_context (const gchar* name,
                                                     const gchar* nick,
                                                     const gchar* blurb,
                                                     GType object_type,
                                                     GParamFlags flags) G_GNUC_UNUSED;
static void wixl_preprocessor_value_set_if_context (GValue* value,
                                             gpointer v_object) G_GNUC_UNUSED;
static void wixl_preprocessor_value_take_if_context (GValue* value,
                                              gpointer v_object) G_GNUC_UNUSED;
static gpointer wixl_preprocessor_value_get_if_context (const GValue* value) G_GNUC_UNUSED;
static GType wixl_preprocessor_if_context_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType wixl_preprocessor_if_context_state_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static WixlPreprocessorIfContext* wixl_preprocessor_if_context_new (gboolean enabled,
                                                             gboolean is_true,
                                                             WixlPreprocessorIfContextState state);
static WixlPreprocessorIfContext* wixl_preprocessor_if_context_construct (GType object_type,
                                                                   gboolean enabled,
                                                                   gboolean is_true,
                                                                   WixlPreprocessorIfContextState state);
static WixlPreprocessorLocation* wixl_preprocessor_location_new (xmlTextReader* reader,
                                                          GFile* file);
static WixlPreprocessorLocation* wixl_preprocessor_location_construct (GType object_type,
                                                                xmlTextReader* reader,
                                                                GFile* file);
static gboolean wixl_preprocessor_if_context_get_is_true (WixlPreprocessorIfContext* self);
static void _wixl_preprocessor_if_context_unref0_ (gpointer var);
static inline void _g_queue_free__wixl_preprocessor_if_context_unref0_ (GQueue* self);
static gboolean wixl_preprocessor_if_context_state_in_if (WixlPreprocessorIfContextState self);
static void wixl_preprocessor_if_context_set_is_true (WixlPreprocessorIfContext* self,
                                               gboolean value);
static void wixl_preprocessor_include (WixlPreprocessor* self,
                                const gchar* name,
                                WixlPreprocessorLocation* loc,
                                xmlTextWriter* writer,
                                gboolean is_req,
                                GError** error);
static gboolean wixl_preprocessor_include_try (WixlPreprocessor* self,
                                        const gchar* filename,
                                        xmlTextWriter* writer,
                                        GError** error);
static void _vala_array_add4 (gchar** * array,
                       int* length,
                       int* size,
                       gchar* value);
static void _vala_array_add5 (gchar** * array,
                       int* length,
                       int* size,
                       gchar* value);
static void _vala_array_add6 (gchar** * array,
                       int* length,
                       int* size,
                       gchar* value);
xmlDoc* wixl_preprocessor_preprocess (WixlPreprocessor* self,
                                      const gchar* data,
                                      GFile* file,
                                      GError** error);
static GObject * wixl_preprocessor_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties);
static GType wixl_preprocessor_eval_condition_op_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static gboolean wixl_preprocessor_eval_condition_to_bool (WixlPreprocessorEvalCondition* self,
                                                   GValue* val);
static gboolean wixl_preprocessor_eval_condition_accept (WixlPreprocessorEvalCondition* self,
                                                  gint type);
static gboolean wixl_preprocessor_eval_condition_expect (WixlPreprocessorEvalCondition* self,
                                                  gint type,
                                                  GError** error);
static gboolean wixl_preprocessor_eval_condition_accept_symbol (WixlPreprocessorEvalCondition* self,
                                                         WixlPreprocessorEvalConditionOp symbol);
static void wixl_preprocessor_eval_condition_term (WixlPreprocessorEvalCondition* self,
                                            GValue* result,
                                            GError** error);
static gboolean wixl_preprocessor_eval_condition_expr (WixlPreprocessorEvalCondition* self,
                                                GError** error);
static gint wixl_preprocessor_eval_condition_to_int (WixlPreprocessorEvalCondition* self,
                                              GValue* val);
static gchar* wixl_preprocessor_eval_condition_to_string (WixlPreprocessorEvalCondition* self,
                                                   GValue* val);
static gboolean wixl_preprocessor_eval_condition_cmp_term (WixlPreprocessorEvalCondition* self,
                                                    GError** error);
static gboolean wixl_preprocessor_eval_condition_not_term (WixlPreprocessorEvalCondition* self,
                                                    GError** error);
static GObject * wixl_preprocessor_eval_condition_constructor (GType type,
                                                        guint n_construct_properties,
                                                        GObjectConstructParam * construct_properties);
static void wixl_preprocessor_eval_condition_finalize (GObject * obj);
static void wixl_preprocessor_location_finalize (GObject * obj);
static void wixl_preprocessor_if_context_finalize (WixlPreprocessorIfContext * obj);
static void wixl_preprocessor_finalize (GObject * obj);
static void _vala_array_destroy (gpointer array,
                          gint array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gint array_length,
                       GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

static GRegex* _tmp_regex_0 = NULL;

static inline gpointer
wixl_preprocessor_get_instance_private (WixlPreprocessor* self)
{
	return G_STRUCT_MEMBER_P (self, WixlPreprocessor_private_offset);
}

static void
_g_free0_ (gpointer var)
{
	var = (g_free (var), NULL);
}

WixlPreprocessor*
wixl_preprocessor_construct (GType object_type,
                             GHashTable* globals,
                             GList* includedirs)
{
	WixlPreprocessor * self = NULL;
	gchar* name = NULL;
	gchar* value = NULL;
	GHashTableIter it = {0};
	g_return_val_if_fail (globals != NULL, NULL);
	self = (WixlPreprocessor*) g_object_new (object_type, NULL);
	g_hash_table_iter_init (&it, globals);
	while (TRUE) {
		gconstpointer _tmp0_ = NULL;
		gconstpointer _tmp1_ = NULL;
		gboolean _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		const gchar* _tmp5_;
		const gchar* _tmp6_;
		_tmp2_ = g_hash_table_iter_next (&it, (gpointer*) (&_tmp0_), (gpointer*) (&_tmp1_));
		_g_free0 (name);
		_tmp3_ = g_strdup (_tmp0_);
		name = _tmp3_;
		_g_free0 (value);
		_tmp4_ = g_strdup (_tmp1_);
		value = _tmp4_;
		if (!_tmp2_) {
			break;
		}
		_tmp5_ = name;
		_tmp6_ = value;
		wixl_preprocessor_define_variable (self, _tmp5_, _tmp6_);
	}
	self->priv->includedirs = includedirs;
	_g_free0 (value);
	_g_free0 (name);
	return self;
}

WixlPreprocessor*
wixl_preprocessor_new (GHashTable* globals,
                       GList* includedirs)
{
	return wixl_preprocessor_construct (WIXL_TYPE_PREPROCESSOR, globals, includedirs);
}

void
wixl_preprocessor_define_variable (WixlPreprocessor* self,
                                   const gchar* name,
                                   const gchar* value)
{
	GHashTable* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (value != NULL);
	_tmp0_ = self->priv->variables;
	_tmp1_ = g_strdup (name);
	_tmp2_ = g_strdup (value);
	g_hash_table_insert (_tmp0_, _tmp1_, _tmp2_);
}

void
wixl_preprocessor_undefine_variable (WixlPreprocessor* self,
                                     const gchar* name)
{
	GHashTable* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	_tmp0_ = self->priv->variables;
	g_hash_table_remove (_tmp0_, name);
}

gchar*
wixl_preprocessor_lookup_variable (WixlPreprocessor* self,
                                   const gchar* name)
{
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	gchar* _tmp2_;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (name != NULL, NULL);
	_tmp0_ = self->priv->variables;
	_tmp1_ = g_hash_table_lookup (_tmp0_, name);
	_tmp2_ = g_strdup ((const gchar*) _tmp1_);
	result = _tmp2_;
	return result;
}

gchar*
wixl_preprocessor_eval_variable (WixlPreprocessor* self,
                                 const gchar* str,
                                 GFile* file,
                                 GError** error)
{
	gchar** var = NULL;
	gchar** _tmp0_;
	gchar** _tmp1_;
	gint var_length1;
	gint _var_size_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gchar** _tmp4_;
	gint _tmp4__length1;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	GQuark _tmp8_ = 0U;
	static GQuark _tmp7_label0 = 0;
	static GQuark _tmp7_label1 = 0;
	static GQuark _tmp7_label2 = 0;
	GError* _tmp24_;
	GError* _inner_error0_ = NULL;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (str != NULL, NULL);
	_tmp1_ = _tmp0_ = g_strsplit (str, ".", 2);
	var = _tmp1_;
	var_length1 = _vala_array_length (_tmp0_);
	_var_size_ = var_length1;
	_tmp2_ = var;
	_tmp2__length1 = var_length1;
	if (_tmp2__length1 != 2) {
		GError* _tmp3_;
		_tmp3_ = g_error_new (WIXL_ERROR, WIXL_ERROR_FAILED, "invalid variable %s", str);
		_inner_error0_ = _tmp3_;
		g_propagate_error (error, _inner_error0_);
		var = (_vala_array_free (var, var_length1, (GDestroyNotify) g_free), NULL);
		return NULL;
	}
	_tmp4_ = var;
	_tmp4__length1 = var_length1;
	_tmp5_ = _tmp4_[0];
	_tmp6_ = _tmp5_;
	_tmp8_ = (NULL == _tmp6_) ? 0 : g_quark_from_string (_tmp6_);
	if (_tmp8_ == ((0 != _tmp7_label0) ? _tmp7_label0 : (_tmp7_label0 = g_quark_from_static_string ("var")))) {
		switch (0) {
			default:
			{
				gchar** _tmp9_;
				gint _tmp9__length1;
				const gchar* _tmp10_;
				gchar* _tmp11_;
				_tmp9_ = var;
				_tmp9__length1 = var_length1;
				_tmp10_ = _tmp9_[1];
				_tmp11_ = wixl_preprocessor_lookup_variable (self, _tmp10_);
				result = _tmp11_;
				var = (_vala_array_free (var, var_length1, (GDestroyNotify) g_free), NULL);
				return result;
			}
		}
	} else if (_tmp8_ == ((0 != _tmp7_label1) ? _tmp7_label1 : (_tmp7_label1 = g_quark_from_static_string ("env")))) {
		switch (0) {
			default:
			{
				gchar** _tmp12_;
				gint _tmp12__length1;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				_tmp12_ = var;
				_tmp12__length1 = var_length1;
				_tmp13_ = _tmp12_[1];
				_tmp14_ = g_getenv (_tmp13_);
				_tmp15_ = g_strdup (_tmp14_);
				result = _tmp15_;
				var = (_vala_array_free (var, var_length1, (GDestroyNotify) g_free), NULL);
				return result;
			}
		}
	} else if (_tmp8_ == ((0 != _tmp7_label2) ? _tmp7_label2 : (_tmp7_label2 = g_quark_from_static_string ("sys")))) {
		switch (0) {
			default:
			{
				gchar** _tmp16_;
				gint _tmp16__length1;
				const gchar* _tmp17_;
				const gchar* _tmp18_;
				GQuark _tmp20_ = 0U;
				static GQuark _tmp19_label0 = 0;
				static GQuark _tmp19_label1 = 0;
				static GQuark _tmp19_label2 = 0;
				_tmp16_ = var;
				_tmp16__length1 = var_length1;
				_tmp17_ = _tmp16_[1];
				_tmp18_ = _tmp17_;
				_tmp20_ = (NULL == _tmp18_) ? 0 : g_quark_from_string (_tmp18_);
				if (_tmp20_ == ((0 != _tmp19_label0) ? _tmp19_label0 : (_tmp19_label0 = g_quark_from_static_string ("CURRENTDIR")))) {
					switch (0) {
						default:
						{
							gchar* _tmp21_;
							_tmp21_ = g_get_current_dir ();
							result = _tmp21_;
							var = (_vala_array_free (var, var_length1, (GDestroyNotify) g_free), NULL);
							return result;
						}
					}
				} else if (_tmp20_ == ((0 != _tmp19_label1) ? _tmp19_label1 : (_tmp19_label1 = g_quark_from_static_string ("SOURCEFILEDIR")))) {
					switch (0) {
						default:
						{
							gchar* _tmp22_;
							_tmp22_ = g_file_get_basename (file);
							result = _tmp22_;
							var = (_vala_array_free (var, var_length1, (GDestroyNotify) g_free), NULL);
							return result;
						}
					}
				} else if (_tmp20_ == ((0 != _tmp19_label2) ? _tmp19_label2 : (_tmp19_label2 = g_quark_from_static_string ("SOURCEFILEPATH")))) {
					switch (0) {
						default:
						{
							gchar* _tmp23_;
							_tmp23_ = g_file_get_path (file);
							result = _tmp23_;
							var = (_vala_array_free (var, var_length1, (GDestroyNotify) g_free), NULL);
							return result;
						}
					}
				}
				break;
			}
		}
	}
	_tmp24_ = g_error_new (WIXL_ERROR, WIXL_ERROR_FIXME, "unhandled variable type %s", str);
	_inner_error0_ = _tmp24_;
	g_propagate_error (error, _inner_error0_);
	var = (_vala_array_free (var, var_length1, (GDestroyNotify) g_free), NULL);
	return NULL;
}

static gint
string_index_of (const gchar* self,
                 const gchar* needle,
                 gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result = 0;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (needle != NULL, 0);
	_tmp0_ = strstr (((gchar*) self) + start_index, (gchar*) needle);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	if (_tmp1_ != NULL) {
		gchar* _tmp2_;
		_tmp2_ = _result_;
		result = (gint) (_tmp2_ - ((gchar*) self));
		return result;
	} else {
		result = -1;
		return result;
	}
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

gchar*
wixl_preprocessor_eval (WixlPreprocessor* self,
                        const gchar* str,
                        GFile* file,
                        GError** error)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gint end = 0;
	gint pos = 0;
	const gchar* _tmp26_;
	gint _tmp27_;
	gint _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	GError* _inner_error0_ = NULL;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (str != NULL, NULL);
	_tmp0_ = g_strdup ("");
	_result_ = _tmp0_;
	end = 0;
	pos = 0;
	while (TRUE) {
		gchar* remainder = NULL;
		gint _tmp5_;
		gint _tmp6_;
		gchar* _tmp7_;
		const gchar* _tmp8_;
		pos = string_index_of (str, "$", end);
		if (!(pos != -1)) {
			break;
		}
		if (end < pos) {
			const gchar* _tmp1_;
			gchar* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			_tmp1_ = _result_;
			_tmp2_ = string_slice (str, (glong) end, (glong) pos);
			_tmp3_ = _tmp2_;
			_tmp4_ = g_strconcat (_tmp1_, _tmp3_, NULL);
			_g_free0 (_result_);
			_result_ = _tmp4_;
			_g_free0 (_tmp3_);
		}
		end = pos + 1;
		_tmp5_ = strlen (str);
		_tmp6_ = _tmp5_;
		_tmp7_ = string_slice (str, (glong) end, (glong) _tmp6_);
		remainder = _tmp7_;
		_tmp8_ = remainder;
		if (g_str_has_prefix (_tmp8_, "$")) {
			const gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp9_ = _result_;
			_tmp10_ = g_strconcat (_tmp9_, "$", NULL);
			_g_free0 (_result_);
			_result_ = _tmp10_;
		} else {
			const gchar* _tmp11_;
			_tmp11_ = remainder;
			if (g_str_has_prefix (_tmp11_, "(")) {
				gint closing = 0;
				const gchar* _tmp12_;
				gchar* substring = NULL;
				const gchar* _tmp14_;
				gchar* _tmp15_;
				const gchar* _tmp16_;
				gchar* val = NULL;
				const gchar* _tmp18_;
				gchar* _tmp19_;
				const gchar* _tmp20_;
				const gchar* _tmp23_;
				const gchar* _tmp24_;
				gchar* _tmp25_;
				_tmp12_ = remainder;
				closing = wixl_find_closing_paren (_tmp12_);
				if (closing == -1) {
					GError* _tmp13_;
					_tmp13_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "no matching closing parenthesis");
					_inner_error0_ = _tmp13_;
					g_propagate_error (error, _inner_error0_);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp14_ = remainder;
				_tmp15_ = string_slice (_tmp14_, (glong) 1, (glong) closing);
				substring = _tmp15_;
				_tmp16_ = substring;
				if (string_index_of (_tmp16_, "(", 0) != -1) {
					GError* _tmp17_;
					_tmp17_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FIXME, "unsupported function");
					_inner_error0_ = _tmp17_;
					g_propagate_error (error, _inner_error0_);
					_g_free0 (substring);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp18_ = substring;
				_tmp19_ = wixl_preprocessor_eval_variable (self, _tmp18_, file, &_inner_error0_);
				val = _tmp19_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_free0 (substring);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp20_ = val;
				if (_tmp20_ == NULL) {
					const gchar* _tmp21_;
					GError* _tmp22_;
					_tmp21_ = substring;
					_tmp22_ = g_error_new (WIXL_ERROR, WIXL_ERROR_FAILED, "Undefined variable %s", _tmp21_);
					_inner_error0_ = _tmp22_;
					g_propagate_error (error, _inner_error0_);
					_g_free0 (val);
					_g_free0 (substring);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp23_ = _result_;
				_tmp24_ = val;
				_tmp25_ = g_strconcat (_tmp23_, _tmp24_, NULL);
				_g_free0 (_result_);
				_result_ = _tmp25_;
				end = end + (closing + 1);
				_g_free0 (val);
				_g_free0 (substring);
			}
		}
		_g_free0 (remainder);
	}
	_tmp26_ = _result_;
	_tmp27_ = strlen (str);
	_tmp28_ = _tmp27_;
	_tmp29_ = string_slice (str, (glong) end, (glong) _tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = g_strconcat (_tmp26_, _tmp30_, NULL);
	_tmp32_ = _tmp31_;
	_g_free0 (_tmp30_);
	result = _tmp32_;
	_g_free0 (_result_);
	return result;
}

gboolean
wixl_preprocessor_eval_condition (WixlPreprocessor* self,
                                  const gchar* str,
                                  GFile* file,
                                  GError** error)
{
	WixlPreprocessorEvalCondition* evaluator = NULL;
	WixlPreprocessorEvalCondition* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (str != NULL, FALSE);
	_tmp0_ = wixl_preprocessor_eval_condition_new (self, file);
	evaluator = _tmp0_;
	_tmp1_ = wixl_preprocessor_eval_condition_eval (evaluator, str, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp2_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (evaluator);
		return _tmp2_;
	}
	result = _tmp1_;
	_g_object_unref0 (evaluator);
	return result;
}

static void
wixl_preprocessor_print (WixlPreprocessor* self,
                         const gchar* prefix,
                         WixlPreprocessorLocation* loc,
                         const gchar* msg)
{
	FILE* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (prefix != NULL);
	g_return_if_fail (loc != NULL);
	g_return_if_fail (msg != NULL);
	_tmp0_ = stderr;
	_tmp1_ = wixl_preprocessor_location_to_string (loc);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (_tmp2_, ": ", NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = g_strconcat (_tmp4_, prefix, NULL);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strconcat (_tmp6_, ": ", NULL);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_strconcat (_tmp8_, msg, NULL);
	_tmp10_ = _tmp9_;
	_tmp11_ = g_strconcat (_tmp10_, "\n", NULL);
	_tmp12_ = _tmp11_;
	fprintf (_tmp0_, "%s", _tmp12_);
	_g_free0 (_tmp12_);
	_g_free0 (_tmp10_);
	_g_free0 (_tmp8_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
}

static gpointer
_wixl_preprocessor_if_context_ref0 (gpointer self)
{
	return self ? wixl_preprocessor_if_context_ref (self) : NULL;
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strstrip (_result_);
	result = _result_;
	return result;
}

static void
_wixl_preprocessor_if_context_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (wixl_preprocessor_if_context_unref (var), NULL));
}

static inline void
_g_queue_free__wixl_preprocessor_if_context_unref0_ (GQueue* self)
{
	g_queue_free_full (self, (GDestroyNotify) _wixl_preprocessor_if_context_unref0_);
}

static inline GRegex*
_thread_safe_regex_init (GRegex** re,
                         const gchar * pattern,
                         GRegexCompileFlags compile_flags)
{
	if (g_once_init_enter ((volatile gsize*) re)) {
		GRegex* val = g_regex_new (pattern, compile_flags, 0, NULL);
		g_once_init_leave ((volatile gsize*) re, (gsize) val);
	}
	return *re;
}

static gpointer
_g_regex_ref0 (gpointer self)
{
	return self ? g_regex_ref (self) : NULL;
}

static void
wixl_preprocessor_preprocess_xml (WixlPreprocessor* self,
                                  xmlTextReader* reader,
                                  xmlTextWriter* writer,
                                  GFile* file,
                                  gboolean is_include,
                                  GError** error)
{
	WixlPreprocessorIfContext* context = NULL;
	WixlPreprocessorIfContext* _tmp0_;
	GQueue* ifstack = NULL;
	GQueue* _tmp1_;
	GQueue* _tmp129_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (reader != NULL);
	g_return_if_fail (writer != NULL);
	_tmp0_ = wixl_preprocessor_if_context_new (TRUE, TRUE, WIXL_PREPROCESSOR_IF_CONTEXT_STATE_UNKNOWN);
	context = _tmp0_;
	_tmp1_ = g_queue_new ();
	ifstack = _tmp1_;
	while (TRUE) {
		WixlPreprocessorLocation* loc = NULL;
		WixlPreprocessorLocation* _tmp2_;
		gboolean handled = FALSE;
		gboolean _tmp60_ = FALSE;
		gboolean _tmp61_ = FALSE;
		if (!(xmlTextReaderRead (reader) > 0)) {
			break;
		}
		_tmp2_ = wixl_preprocessor_location_new (reader, file);
		loc = _tmp2_;
		handled = FALSE;
		if (xmlTextReaderNodeType (reader) == ((gint) XML_READER_TYPE_PROCESSING_INSTRUCTION)) {
			const gchar* _tmp3_;
			const gchar* _tmp4_;
			GQuark _tmp6_ = 0U;
			static GQuark _tmp5_label0 = 0;
			static GQuark _tmp5_label1 = 0;
			static GQuark _tmp5_label2 = 0;
			static GQuark _tmp5_label3 = 0;
			static GQuark _tmp5_label4 = 0;
			handled = TRUE;
			_tmp3_ = xmlTextReaderConstLocalName (reader);
			_tmp4_ = _tmp3_;
			_tmp6_ = (NULL == _tmp4_) ? 0 : g_quark_from_string (_tmp4_);
			if (_tmp6_ == ((0 != _tmp5_label0) ? _tmp5_label0 : (_tmp5_label0 = g_quark_from_static_string ("ifdef")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp7_;
						WixlPreprocessorIfContext* _tmp8_;
						WixlPreprocessorIfContext* _tmp9_;
						gchar* value = NULL;
						const gchar* _tmp10_;
						gchar* _tmp11_;
						gboolean _tmp12_ = FALSE;
						WixlPreprocessorIfContext* _tmp13_;
						gchar* _tmp17_ = NULL;
						const gchar* _tmp18_;
						gchar* _tmp19_;
						WixlPreprocessorIfContext* _tmp20_;
						_tmp7_ = ifstack;
						_tmp8_ = context;
						_tmp9_ = _wixl_preprocessor_if_context_ref0 (_tmp8_);
						g_queue_push_head (_tmp7_, _tmp9_);
						_tmp10_ = xmlTextReaderConstValue (reader);
						_tmp11_ = string_strip (_tmp10_);
						value = _tmp11_;
						_tmp13_ = context;
						if (_tmp13_->enabled) {
							WixlPreprocessorIfContext* _tmp14_;
							gboolean _tmp15_;
							gboolean _tmp16_;
							_tmp14_ = context;
							_tmp15_ = wixl_preprocessor_if_context_get_is_true (_tmp14_);
							_tmp16_ = _tmp15_;
							_tmp12_ = _tmp16_;
						} else {
							_tmp12_ = FALSE;
						}
						_tmp18_ = value;
						_tmp19_ = wixl_preprocessor_eval_variable (self, _tmp18_, file, &_inner_error0_);
						_tmp17_ = _tmp19_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							g_propagate_error (error, _inner_error0_);
							_g_free0 (value);
							_g_object_unref0 (loc);
							(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
							_wixl_preprocessor_if_context_unref0 (context);
							return;
						}
						_tmp20_ = wixl_preprocessor_if_context_new (_tmp12_, _tmp17_ != NULL, WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF);
						_wixl_preprocessor_if_context_unref0 (context);
						context = _tmp20_;
						_g_free0 (_tmp17_);
						_g_free0 (value);
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label1) ? _tmp5_label1 : (_tmp5_label1 = g_quark_from_static_string ("ifndef")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp21_;
						WixlPreprocessorIfContext* _tmp22_;
						WixlPreprocessorIfContext* _tmp23_;
						gchar* value = NULL;
						const gchar* _tmp24_;
						gchar* _tmp25_;
						gboolean _tmp26_ = FALSE;
						WixlPreprocessorIfContext* _tmp27_;
						gchar* _tmp31_ = NULL;
						const gchar* _tmp32_;
						gchar* _tmp33_;
						WixlPreprocessorIfContext* _tmp34_;
						_tmp21_ = ifstack;
						_tmp22_ = context;
						_tmp23_ = _wixl_preprocessor_if_context_ref0 (_tmp22_);
						g_queue_push_head (_tmp21_, _tmp23_);
						_tmp24_ = xmlTextReaderConstValue (reader);
						_tmp25_ = string_strip (_tmp24_);
						value = _tmp25_;
						_tmp27_ = context;
						if (_tmp27_->enabled) {
							WixlPreprocessorIfContext* _tmp28_;
							gboolean _tmp29_;
							gboolean _tmp30_;
							_tmp28_ = context;
							_tmp29_ = wixl_preprocessor_if_context_get_is_true (_tmp28_);
							_tmp30_ = _tmp29_;
							_tmp26_ = _tmp30_;
						} else {
							_tmp26_ = FALSE;
						}
						_tmp32_ = value;
						_tmp33_ = wixl_preprocessor_eval_variable (self, _tmp32_, file, &_inner_error0_);
						_tmp31_ = _tmp33_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							g_propagate_error (error, _inner_error0_);
							_g_free0 (value);
							_g_object_unref0 (loc);
							(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
							_wixl_preprocessor_if_context_unref0 (context);
							return;
						}
						_tmp34_ = wixl_preprocessor_if_context_new (_tmp26_, _tmp31_ == NULL, WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF);
						_wixl_preprocessor_if_context_unref0 (context);
						context = _tmp34_;
						_g_free0 (_tmp31_);
						_g_free0 (value);
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label2) ? _tmp5_label2 : (_tmp5_label2 = g_quark_from_static_string ("else")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp35_;
						WixlPreprocessorIfContext* _tmp37_;
						WixlPreprocessorIfContextState _tmp38_;
						WixlPreprocessorIfContext* _tmp40_;
						WixlPreprocessorIfContext* _tmp41_;
						WixlPreprocessorIfContext* _tmp42_;
						_tmp35_ = ifstack;
						if (g_queue_is_empty (_tmp35_)) {
							GError* _tmp36_;
							_tmp36_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Unmatched else");
							_inner_error0_ = _tmp36_;
							g_propagate_error (error, _inner_error0_);
							_g_object_unref0 (loc);
							(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
							_wixl_preprocessor_if_context_unref0 (context);
							return;
						}
						_tmp37_ = context;
						_tmp38_ = _tmp37_->state;
						if (!wixl_preprocessor_if_context_state_in_if (_tmp38_)) {
							GError* _tmp39_;
							_tmp39_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Unmatched else");
							_inner_error0_ = _tmp39_;
							g_propagate_error (error, _inner_error0_);
							_g_object_unref0 (loc);
							(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
							_wixl_preprocessor_if_context_unref0 (context);
							return;
						}
						_tmp40_ = context;
						_tmp40_->state = WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSE;
						_tmp41_ = context;
						_tmp42_ = context;
						wixl_preprocessor_if_context_set_is_true (_tmp41_, _tmp42_->never_true);
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label3) ? _tmp5_label3 : (_tmp5_label3 = g_quark_from_static_string ("endif")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp43_;
						GQueue* _tmp45_;
						gpointer _tmp46_;
						_tmp43_ = ifstack;
						if (g_queue_is_empty (_tmp43_)) {
							GError* _tmp44_;
							_tmp44_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Unmatched endif");
							_inner_error0_ = _tmp44_;
							g_propagate_error (error, _inner_error0_);
							_g_object_unref0 (loc);
							(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
							_wixl_preprocessor_if_context_unref0 (context);
							return;
						}
						_tmp45_ = ifstack;
						_tmp46_ = g_queue_pop_head (_tmp45_);
						_wixl_preprocessor_if_context_unref0 (context);
						context = (WixlPreprocessorIfContext*) _tmp46_;
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label4) ? _tmp5_label4 : (_tmp5_label4 = g_quark_from_static_string ("if")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp47_;
						WixlPreprocessorIfContext* _tmp48_;
						WixlPreprocessorIfContext* _tmp49_;
						gchar* value = NULL;
						const gchar* _tmp50_;
						gchar* _tmp51_;
						gboolean _tmp52_ = FALSE;
						WixlPreprocessorIfContext* _tmp53_;
						gboolean _tmp57_ = FALSE;
						const gchar* _tmp58_;
						WixlPreprocessorIfContext* _tmp59_;
						_tmp47_ = ifstack;
						_tmp48_ = context;
						_tmp49_ = _wixl_preprocessor_if_context_ref0 (_tmp48_);
						g_queue_push_head (_tmp47_, _tmp49_);
						_tmp50_ = xmlTextReaderConstValue (reader);
						_tmp51_ = string_strip (_tmp50_);
						value = _tmp51_;
						_tmp53_ = context;
						if (_tmp53_->enabled) {
							WixlPreprocessorIfContext* _tmp54_;
							gboolean _tmp55_;
							gboolean _tmp56_;
							_tmp54_ = context;
							_tmp55_ = wixl_preprocessor_if_context_get_is_true (_tmp54_);
							_tmp56_ = _tmp55_;
							_tmp52_ = _tmp56_;
						} else {
							_tmp52_ = FALSE;
						}
						_tmp58_ = value;
						_tmp57_ = wixl_preprocessor_eval_condition (self, _tmp58_, file, &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							g_propagate_error (error, _inner_error0_);
							_g_free0 (value);
							_g_object_unref0 (loc);
							(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
							_wixl_preprocessor_if_context_unref0 (context);
							return;
						}
						_tmp59_ = wixl_preprocessor_if_context_new (_tmp52_, _tmp57_, WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF);
						_wixl_preprocessor_if_context_unref0 (context);
						context = _tmp59_;
						_g_free0 (value);
						break;
					}
				}
			} else {
				switch (0) {
					default:
					{
						handled = FALSE;
						break;
					}
				}
			}
		}
		if (handled) {
			_tmp61_ = TRUE;
		} else {
			WixlPreprocessorIfContext* _tmp62_;
			_tmp62_ = context;
			_tmp61_ = !_tmp62_->enabled;
		}
		if (_tmp61_) {
			_tmp60_ = TRUE;
		} else {
			WixlPreprocessorIfContext* _tmp63_;
			gboolean _tmp64_;
			gboolean _tmp65_;
			_tmp63_ = context;
			_tmp64_ = wixl_preprocessor_if_context_get_is_true (_tmp63_);
			_tmp65_ = _tmp64_;
			_tmp60_ = !_tmp65_;
		}
		if (_tmp60_) {
			_g_object_unref0 (loc);
			continue;
		}
		switch (xmlTextReaderNodeType (reader)) {
			case XML_READER_TYPE_PROCESSING_INSTRUCTION:
			{
				const gchar* _tmp66_;
				const gchar* _tmp67_;
				GQuark _tmp69_ = 0U;
				static GQuark _tmp68_label0 = 0;
				static GQuark _tmp68_label1 = 0;
				static GQuark _tmp68_label2 = 0;
				static GQuark _tmp68_label3 = 0;
				static GQuark _tmp68_label4 = 0;
				static GQuark _tmp68_label5 = 0;
				_tmp66_ = xmlTextReaderConstLocalName (reader);
				_tmp67_ = _tmp66_;
				_tmp69_ = (NULL == _tmp67_) ? 0 : g_quark_from_string (_tmp67_);
				if (_tmp69_ == ((0 != _tmp68_label0) ? _tmp68_label0 : (_tmp68_label0 = g_quark_from_static_string ("define")))) {
					switch (0) {
						default:
						{
							GMatchInfo* info = NULL;
							GRegex* r = NULL;
							GRegex* _tmp70_;
							GRegex* _tmp71_;
							const gchar* _tmp72_;
							GMatchInfo* _tmp73_ = NULL;
							gboolean _tmp74_;
							_tmp70_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_0, "^\\s*(?P<name>.+?)\\s*=\\s*(?P<value>.+?)\\s*$", 0));
							r = _tmp70_;
							_tmp71_ = r;
							_tmp72_ = xmlTextReaderConstValue (reader);
							_tmp74_ = g_regex_match (_tmp71_, _tmp72_, 0, &_tmp73_);
							_g_match_info_unref0 (info);
							info = _tmp73_;
							if (_tmp74_) {
								gchar* name = NULL;
								GMatchInfo* _tmp75_;
								gchar* _tmp76_;
								gchar* _tmp77_;
								gchar* _tmp78_;
								gchar* _tmp79_;
								gchar* value = NULL;
								GMatchInfo* _tmp80_;
								gchar* _tmp81_;
								gchar* _tmp82_;
								gchar* _tmp83_;
								gchar* _tmp84_;
								const gchar* _tmp85_;
								const gchar* _tmp86_;
								_tmp75_ = info;
								_tmp76_ = g_match_info_fetch_named (_tmp75_, "name");
								_tmp77_ = _tmp76_;
								_tmp78_ = wixl_remove_prefix ("var.", _tmp77_);
								_tmp79_ = _tmp78_;
								_g_free0 (_tmp77_);
								name = _tmp79_;
								_tmp80_ = info;
								_tmp81_ = g_match_info_fetch_named (_tmp80_, "value");
								_tmp82_ = _tmp81_;
								_tmp83_ = wixl_unquote (_tmp82_);
								_tmp84_ = _tmp83_;
								_g_free0 (_tmp82_);
								value = _tmp84_;
								_tmp85_ = name;
								_tmp86_ = value;
								wixl_preprocessor_define_variable (self, _tmp85_, _tmp86_);
								_g_free0 (value);
								_g_free0 (name);
							} else {
								GError* _tmp87_;
								_tmp87_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "invalid define");
								_inner_error0_ = _tmp87_;
								g_propagate_error (error, _inner_error0_);
								_g_regex_unref0 (r);
								_g_match_info_unref0 (info);
								_g_object_unref0 (loc);
								(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
								_wixl_preprocessor_if_context_unref0 (context);
								return;
							}
							_g_regex_unref0 (r);
							_g_match_info_unref0 (info);
							break;
						}
					}
				} else if (_tmp69_ == ((0 != _tmp68_label1) ? _tmp68_label1 : (_tmp68_label1 = g_quark_from_static_string ("undef")))) {
					switch (0) {
						default:
						{
							gchar* value = NULL;
							const gchar* _tmp88_;
							gchar* _tmp89_;
							const gchar* _tmp90_;
							_tmp88_ = xmlTextReaderConstValue (reader);
							_tmp89_ = string_strip (_tmp88_);
							value = _tmp89_;
							_tmp90_ = value;
							wixl_preprocessor_undefine_variable (self, _tmp90_);
							_g_free0 (value);
							break;
						}
					}
				} else if (_tmp69_ == ((0 != _tmp68_label2) ? _tmp68_label2 : (_tmp68_label2 = g_quark_from_static_string ("require")))) {
					switch (0) {
						default:
						{
							gchar* _tmp91_ = NULL;
							const gchar* _tmp92_;
							gchar* _tmp93_;
							gchar* value = NULL;
							gchar* _tmp94_;
							const gchar* _tmp95_;
							WixlPreprocessorLocation* _tmp96_;
							_tmp92_ = xmlTextReaderConstValue (reader);
							_tmp93_ = wixl_preprocessor_eval (self, _tmp92_, file, &_inner_error0_);
							_tmp91_ = _tmp93_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								_g_object_unref0 (loc);
								(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
								_wixl_preprocessor_if_context_unref0 (context);
								return;
							}
							_tmp94_ = string_strip (_tmp91_);
							value = _tmp94_;
							_tmp95_ = value;
							_tmp96_ = loc;
							wixl_preprocessor_include (self, _tmp95_, _tmp96_, writer, TRUE, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								_g_free0 (value);
								_g_free0 (_tmp91_);
								_g_object_unref0 (loc);
								(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
								_wixl_preprocessor_if_context_unref0 (context);
								return;
							}
							_g_free0 (value);
							_g_free0 (_tmp91_);
							break;
						}
					}
				} else if (_tmp69_ == ((0 != _tmp68_label3) ? _tmp68_label3 : (_tmp68_label3 = g_quark_from_static_string ("include")))) {
					switch (0) {
						default:
						{
							gchar* _tmp97_ = NULL;
							const gchar* _tmp98_;
							gchar* _tmp99_;
							gchar* value = NULL;
							gchar* _tmp100_;
							const gchar* _tmp101_;
							WixlPreprocessorLocation* _tmp102_;
							_tmp98_ = xmlTextReaderConstValue (reader);
							_tmp99_ = wixl_preprocessor_eval (self, _tmp98_, file, &_inner_error0_);
							_tmp97_ = _tmp99_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								_g_object_unref0 (loc);
								(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
								_wixl_preprocessor_if_context_unref0 (context);
								return;
							}
							_tmp100_ = string_strip (_tmp97_);
							value = _tmp100_;
							_tmp101_ = value;
							_tmp102_ = loc;
							wixl_preprocessor_include (self, _tmp101_, _tmp102_, writer, FALSE, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								_g_free0 (value);
								_g_free0 (_tmp97_);
								_g_object_unref0 (loc);
								(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
								_wixl_preprocessor_if_context_unref0 (context);
								return;
							}
							_g_free0 (value);
							_g_free0 (_tmp97_);
							break;
						}
					}
				} else if (_tmp69_ == ((0 != _tmp68_label4) ? _tmp68_label4 : (_tmp68_label4 = g_quark_from_static_string ("warning")))) {
					switch (0) {
						default:
						{
							gchar* _tmp103_ = NULL;
							const gchar* _tmp104_;
							gchar* _tmp105_;
							WixlPreprocessorLocation* _tmp106_;
							_tmp104_ = xmlTextReaderConstValue (reader);
							_tmp105_ = wixl_preprocessor_eval (self, _tmp104_, file, &_inner_error0_);
							_tmp103_ = _tmp105_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								_g_object_unref0 (loc);
								(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
								_wixl_preprocessor_if_context_unref0 (context);
								return;
							}
							_tmp106_ = loc;
							wixl_preprocessor_print (self, "warning", _tmp106_, _tmp103_);
							_g_free0 (_tmp103_);
							break;
						}
					}
				} else if (_tmp69_ == ((0 != _tmp68_label5) ? _tmp68_label5 : (_tmp68_label5 = g_quark_from_static_string ("error")))) {
					switch (0) {
						default:
						{
							gchar* _tmp107_ = NULL;
							const gchar* _tmp108_;
							gchar* _tmp109_;
							WixlPreprocessorLocation* _tmp110_;
							_tmp108_ = xmlTextReaderConstValue (reader);
							_tmp109_ = wixl_preprocessor_eval (self, _tmp108_, file, &_inner_error0_);
							_tmp107_ = _tmp109_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								_g_object_unref0 (loc);
								(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
								_wixl_preprocessor_if_context_unref0 (context);
								return;
							}
							_tmp110_ = loc;
							wixl_preprocessor_print (self, "error", _tmp110_, _tmp107_);
							exit (1);
							_g_free0 (_tmp107_);
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							const gchar* _tmp111_;
							_tmp111_ = xmlTextReaderConstLocalName (reader);
							g_warning ("preprocessor.vala:455: unhandled preprocessor instruction %s", _tmp111_);
							break;
						}
					}
				}
				break;
			}
			case XML_READER_TYPE_ELEMENT:
			{
				gboolean empty = FALSE;
				gboolean _tmp112_ = FALSE;
				gboolean _tmp113_ = FALSE;
				const gchar* _tmp115_;
				empty = xmlTextReaderIsEmptyElement (reader) > 0;
				if (is_include) {
					_tmp113_ = xmlTextReaderDepth (reader) == 0;
				} else {
					_tmp113_ = FALSE;
				}
				if (_tmp113_) {
					const gchar* _tmp114_;
					_tmp114_ = xmlTextReaderConstName (reader);
					_tmp112_ = g_strcmp0 (_tmp114_, "Include") == 0;
				} else {
					_tmp112_ = FALSE;
				}
				if (_tmp112_) {
					break;
				}
				_tmp115_ = xmlTextReaderConstName (reader);
				xmlTextWriterStartElement (writer, _tmp115_);
				while (TRUE) {
					gchar* value = NULL;
					const gchar* _tmp116_;
					gchar* _tmp117_;
					const gchar* _tmp118_;
					const gchar* _tmp119_;
					if (!(xmlTextReaderMoveToNextAttribute (reader) > 0)) {
						break;
					}
					_tmp116_ = xmlTextReaderConstValue (reader);
					_tmp117_ = wixl_preprocessor_eval (self, _tmp116_, file, &_inner_error0_);
					value = _tmp117_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						g_propagate_error (error, _inner_error0_);
						_g_object_unref0 (loc);
						(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
						_wixl_preprocessor_if_context_unref0 (context);
						return;
					}
					_tmp118_ = xmlTextReaderConstName (reader);
					_tmp119_ = value;
					xmlTextWriterWriteAttribute (writer, _tmp118_, _tmp119_);
					_g_free0 (value);
				}
				if (empty) {
					xmlTextWriterEndElement (writer);
				}
				break;
			}
			case XML_READER_TYPE_END_ELEMENT:
			{
				gboolean _tmp120_ = FALSE;
				gboolean _tmp121_ = FALSE;
				if (is_include) {
					_tmp121_ = xmlTextReaderDepth (reader) == 0;
				} else {
					_tmp121_ = FALSE;
				}
				if (_tmp121_) {
					const gchar* _tmp122_;
					_tmp122_ = xmlTextReaderConstName (reader);
					_tmp120_ = g_strcmp0 (_tmp122_, "Include") == 0;
				} else {
					_tmp120_ = FALSE;
				}
				if (_tmp120_) {
					break;
				}
				xmlTextWriterEndElement (writer);
				break;
			}
			case XML_READER_TYPE_TEXT:
			{
				gchar* _tmp123_ = NULL;
				const gchar* _tmp124_;
				gchar* _tmp125_;
				_tmp124_ = xmlTextReaderConstValue (reader);
				_tmp125_ = wixl_preprocessor_eval (self, _tmp124_, file, &_inner_error0_);
				_tmp123_ = _tmp125_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_object_unref0 (loc);
					(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
					_wixl_preprocessor_if_context_unref0 (context);
					return;
				}
				xmlTextWriterWriteString (writer, _tmp123_);
				_g_free0 (_tmp123_);
				break;
			}
			case XML_READER_TYPE_CDATA:
			{
				gchar* _tmp126_ = NULL;
				const gchar* _tmp127_;
				gchar* _tmp128_;
				_tmp127_ = xmlTextReaderConstValue (reader);
				_tmp128_ = wixl_preprocessor_eval (self, _tmp127_, file, &_inner_error0_);
				_tmp126_ = _tmp128_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_object_unref0 (loc);
					(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
					_wixl_preprocessor_if_context_unref0 (context);
					return;
				}
				xmlTextWriterWriteCDATA (writer, _tmp126_);
				_g_free0 (_tmp126_);
				break;
			}
			default:
			break;
		}
		_g_object_unref0 (loc);
	}
	_tmp129_ = ifstack;
	if (!g_queue_is_empty (_tmp129_)) {
		GError* _tmp130_;
		_tmp130_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Missing endif");
		_inner_error0_ = _tmp130_;
		g_propagate_error (error, _inner_error0_);
		(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
		_wixl_preprocessor_if_context_unref0 (context);
		return;
	}
	(ifstack == NULL) ? NULL : (ifstack = (_g_queue_free__wixl_preprocessor_if_context_unref0_ (ifstack), NULL));
	_wixl_preprocessor_if_context_unref0 (context);
}

static gboolean
wixl_preprocessor_include_try (WixlPreprocessor* self,
                               const gchar* filename,
                               xmlTextWriter* writer,
                               GError** error)
{
	gchar* data = NULL;
	GFile* file = NULL;
	GFile* _tmp0_;
	xmlTextReader* reader = NULL;
	const gchar* _tmp4_;
	xmlTextReader* _tmp5_;
	xmlTextReader* _tmp6_;
	GFile* _tmp7_;
	GError* _inner_error0_ = NULL;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (filename != NULL, FALSE);
	g_return_val_if_fail (writer != NULL, FALSE);
	_tmp0_ = g_file_new_for_path (filename);
	file = _tmp0_;
	{
		gchar* _tmp1_ = NULL;
		g_file_get_contents (filename, &_tmp1_, NULL, &_inner_error0_);
		_g_free0 (data);
		data = _tmp1_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp2_ = FALSE;
			if (_inner_error0_->domain == G_FILE_ERROR) {
				goto __catch7_g_file_error;
			}
			_g_object_unref0 (file);
			_g_free0 (data);
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return _tmp2_;
		}
	}
	goto __finally7;
	__catch7_g_file_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error0_;
		_inner_error0_ = NULL;
		result = FALSE;
		_g_error_free0 (_error_);
		_g_object_unref0 (file);
		_g_free0 (data);
		return result;
	}
	__finally7:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_g_object_unref0 (file);
		_g_free0 (data);
		return _tmp3_;
	}
	_tmp4_ = data;
	_tmp5_ = xmlReaderForDoc (_tmp4_, "", NULL, 0);
	reader = _tmp5_;
	_tmp6_ = reader;
	_tmp7_ = file;
	wixl_preprocessor_preprocess_xml (self, _tmp6_, writer, _tmp7_, TRUE, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp8_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		_xmlFreeTextReader0 (reader);
		_g_object_unref0 (file);
		_g_free0 (data);
		return _tmp8_;
	}
	result = TRUE;
	_xmlFreeTextReader0 (reader);
	_g_object_unref0 (file);
	_g_free0 (data);
	return result;
}

static void
_vala_array_add4 (gchar** * array,
                  int* length,
                  int* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
_vala_array_add5 (gchar** * array,
                  int* length,
                  int* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add6 (gchar** * array,
                  int* length,
                  int* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
wixl_preprocessor_include (WixlPreprocessor* self,
                           const gchar* name,
                           WixlPreprocessorLocation* loc,
                           xmlTextWriter* writer,
                           gboolean is_req,
                           GError** error)
{
	gboolean success = FALSE;
	gchar** dirs = NULL;
	gchar** _tmp2_;
	gint dirs_length1;
	gint _dirs_size_;
	gchar** _tmp3_;
	gint _tmp3__length1;
	gchar* _tmp4_;
	GList* _tmp5_;
	gchar** _tmp12_;
	gint _tmp12__length1;
	GFile* _tmp13_;
	GFile* _tmp14_;
	GFile* _tmp15_;
	GFile* _tmp16_;
	GFile* _tmp17_;
	gchar* _tmp18_;
	gchar** _tmp19_;
	gint _tmp19__length1;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (name != NULL);
	g_return_if_fail (loc != NULL);
	g_return_if_fail (writer != NULL);
	success = FALSE;
	if (is_req) {
		GHashTable* _tmp0_;
		GHashTable* _tmp1_;
		_tmp0_ = self->priv->requires;
		if (g_hash_table_lookup_extended (_tmp0_, name, NULL, NULL)) {
			return;
		}
		_tmp1_ = self->priv->requires;
		wixl_hash_table_add (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, _tmp1_, name);
	}
	_tmp2_ = g_new0 (gchar*, 0 + 1);
	dirs = _tmp2_;
	dirs_length1 = 0;
	_dirs_size_ = dirs_length1;
	_tmp3_ = dirs;
	_tmp3__length1 = dirs_length1;
	_tmp4_ = g_strdup (name);
	_vala_array_add4 (&dirs, &dirs_length1, &_dirs_size_, _tmp4_);
	_tmp5_ = self->priv->includedirs;
	{
		GList* dir_collection = NULL;
		GList* dir_it = NULL;
		dir_collection = _tmp5_;
		for (dir_it = dir_collection; dir_it != NULL; dir_it = dir_it->next) {
			GFile* _tmp6_;
			GFile* dir = NULL;
			_tmp6_ = _g_object_ref0 ((GFile*) dir_it->data);
			dir = _tmp6_;
			{
				gchar** _tmp7_;
				gint _tmp7__length1;
				GFile* _tmp8_;
				GFile* _tmp9_;
				GFile* _tmp10_;
				gchar* _tmp11_;
				_tmp7_ = dirs;
				_tmp7__length1 = dirs_length1;
				_tmp8_ = dir;
				_tmp9_ = g_file_get_child (_tmp8_, name);
				_tmp10_ = _tmp9_;
				_tmp11_ = g_file_get_path (_tmp10_);
				_vala_array_add5 (&dirs, &dirs_length1, &_dirs_size_, _tmp11_);
				_g_object_unref0 (_tmp10_);
				_g_object_unref0 (dir);
			}
		}
	}
	_tmp12_ = dirs;
	_tmp12__length1 = dirs_length1;
	_tmp13_ = loc->file;
	_tmp14_ = g_file_get_parent (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_file_get_child (_tmp15_, name);
	_tmp17_ = _tmp16_;
	_tmp18_ = g_file_get_path (_tmp17_);
	_vala_array_add6 (&dirs, &dirs_length1, &_dirs_size_, _tmp18_);
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (_tmp15_);
	_tmp19_ = dirs;
	_tmp19__length1 = dirs_length1;
	{
		gchar** inc_collection = NULL;
		gint inc_collection_length1 = 0;
		gint _inc_collection_size_ = 0;
		gint inc_it = 0;
		inc_collection = _tmp19_;
		inc_collection_length1 = _tmp19__length1;
		for (inc_it = 0; inc_it < inc_collection_length1; inc_it = inc_it + 1) {
			gchar* _tmp20_;
			gchar* inc = NULL;
			_tmp20_ = g_strdup (inc_collection[inc_it]);
			inc = _tmp20_;
			{
				gboolean _tmp21_ = FALSE;
				const gchar* _tmp22_;
				_tmp22_ = inc;
				_tmp21_ = wixl_preprocessor_include_try (self, _tmp22_, writer, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					g_propagate_error (error, _inner_error0_);
					_g_free0 (inc);
					dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_free), NULL);
					return;
				}
				success = _tmp21_;
				if (success) {
					_g_free0 (inc);
					break;
				}
				_g_free0 (inc);
			}
		}
	}
	if (!success) {
		gchar* _tmp23_;
		gchar* _tmp24_;
		_tmp23_ = g_strdup_printf ("Failed to include %s", name);
		_tmp24_ = _tmp23_;
		wixl_preprocessor_print (self, "error", loc, _tmp24_);
		_g_free0 (_tmp24_);
		exit (1);
	}
	dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_free), NULL);
}

xmlDoc*
wixl_preprocessor_preprocess (WixlPreprocessor* self,
                              const gchar* data,
                              GFile* file,
                              GError** error)
{
	xmlDoc* doc = NULL;
	xmlTextWriter* writer = NULL;
	xmlTextWriter* _tmp0_;
	xmlTextReader* reader = NULL;
	xmlTextReader* _tmp1_;
	GError* _inner_error0_ = NULL;
	xmlDoc* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (data != NULL, NULL);
	_tmp0_ = xmlNewTextWriterDoc (&doc, FALSE);
	writer = _tmp0_;
	_tmp1_ = xmlReaderForDoc (data, "", NULL, 0);
	reader = _tmp1_;
	xmlTextWriterStartDocument (writer, NULL, NULL, NULL);
	wixl_preprocessor_preprocess_xml (self, reader, writer, file, FALSE, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_xmlFreeTextReader0 (reader);
		_xmlFreeTextWriter0 (writer);
		_xmlFreeDoc0 (doc);
		return NULL;
	}
	xmlTextWriterEndDocument (writer);
	result = doc;
	_xmlFreeTextReader0 (reader);
	_xmlFreeTextWriter0 (writer);
	return result;
}

static GObject *
wixl_preprocessor_constructor (GType type,
                               guint n_construct_properties,
                               GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WixlPreprocessor * self;
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	parent_class = G_OBJECT_CLASS (wixl_preprocessor_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIXL_TYPE_PREPROCESSOR, WixlPreprocessor);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, _g_free0_);
	_g_hash_table_unref0 (self->priv->variables);
	self->priv->variables = _tmp2_;
	return obj;
}

static inline gpointer
wixl_preprocessor_eval_condition_get_instance_private (WixlPreprocessorEvalCondition* self)
{
	return G_STRUCT_MEMBER_P (self, WixlPreprocessorEvalCondition_private_offset);
}

static GType
wixl_preprocessor_eval_condition_op_get_type (void)
{
	static volatile gsize wixl_preprocessor_eval_condition_op_type_id__volatile = 0;
	if (g_once_init_enter (&wixl_preprocessor_eval_condition_op_type_id__volatile)) {
		static const GEnumValue values[] = {{WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NONE, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NONE", "none"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EQUAL, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EQUAL", "equal"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OPEN_VAR, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OPEN_VAR", "open-var"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EQ, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EQ", "eq"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EC, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_EC", "ec"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NE, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NE", "ne"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LT, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LT", "lt"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LTE, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LTE", "lte"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GT, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GT", "gt"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GTE, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GTE", "gte"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_AND, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_AND", "and"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OR, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OR", "or"}, {WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NOT, "WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NOT", "not"}, {0, NULL, NULL}};
		GType wixl_preprocessor_eval_condition_op_type_id;
		wixl_preprocessor_eval_condition_op_type_id = g_enum_register_static ("WixlPreprocessorEvalConditionOp", values);
		g_once_init_leave (&wixl_preprocessor_eval_condition_op_type_id__volatile, wixl_preprocessor_eval_condition_op_type_id);
	}
	return wixl_preprocessor_eval_condition_op_type_id__volatile;
}

static WixlPreprocessorEvalCondition*
wixl_preprocessor_eval_condition_construct (GType object_type,
                                            WixlPreprocessor* pp,
                                            GFile* file)
{
	WixlPreprocessorEvalCondition * self = NULL;
	GFile* _tmp0_;
	WixlPreprocessor* _tmp1_;
	g_return_val_if_fail (pp != NULL, NULL);
	self = (WixlPreprocessorEvalCondition*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (file);
	_g_object_unref0 (self->priv->file);
	self->priv->file = _tmp0_;
	_tmp1_ = _g_object_ref0 (pp);
	_g_object_unref0 (self->priv->preprocessor);
	self->priv->preprocessor = _tmp1_;
	return self;
}

static WixlPreprocessorEvalCondition*
wixl_preprocessor_eval_condition_new (WixlPreprocessor* pp,
                                      GFile* file)
{
	return wixl_preprocessor_eval_condition_construct (WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION, pp, file);
}

static gboolean
wixl_preprocessor_eval_condition_to_bool (WixlPreprocessorEvalCondition* self,
                                          GValue* val)
{
	GValue _result_ = {0};
	GValue _tmp0_ = {0};
	GValue _tmp1_;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (val != NULL, FALSE);
	g_value_init (&_tmp0_, G_TYPE_BOOLEAN);
	g_value_set_boolean (&_tmp0_, FALSE);
	_result_ = _tmp0_;
	g_value_transform (val, &_result_);
	_tmp1_ = _result_;
	result = g_value_get_boolean (&_tmp1_);
	G_IS_VALUE (&_result_) ? (g_value_unset (&_result_), NULL) : NULL;
	return result;
}

static gboolean
wixl_preprocessor_eval_condition_accept (WixlPreprocessorEvalCondition* self,
                                         gint type)
{
	gboolean accepted = FALSE;
	GScanner* _tmp0_;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->scanner;
	accepted = ((gint) g_scanner_peek_next_token (_tmp0_)) == type;
	if (accepted) {
		GScanner* _tmp1_;
		_tmp1_ = self->priv->scanner;
		g_scanner_get_next_token (_tmp1_);
	}
	result = accepted;
	return result;
}

static gboolean
wixl_preprocessor_eval_condition_expect (WixlPreprocessorEvalCondition* self,
                                         gint type,
                                         GError** error)
{
	GError* _inner_error0_ = NULL;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (!wixl_preprocessor_eval_condition_accept (self, type)) {
		GError* _tmp0_;
		gboolean _tmp1_ = FALSE;
		_tmp0_ = g_error_new (WIXL_ERROR, WIXL_ERROR_FAILED, "Expected token %d", type);
		_inner_error0_ = _tmp0_;
		g_propagate_error (error, _inner_error0_);
		return _tmp1_;
	}
	result = TRUE;
	return result;
}

static gboolean
wixl_preprocessor_eval_condition_accept_symbol (WixlPreprocessorEvalCondition* self,
                                                WixlPreprocessorEvalConditionOp symbol)
{
	gboolean accepted = FALSE;
	GScanner* _tmp0_;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	accepted = FALSE;
	_tmp0_ = self->priv->scanner;
	if (g_scanner_peek_next_token (_tmp0_) == G_TOKEN_SYMBOL) {
		GScanner* _tmp1_;
		void* _tmp2_;
		_tmp1_ = self->priv->scanner;
		_tmp2_ = _tmp1_->next_value.v_symbol;
		accepted = ((gint) _tmp2_) == ((gint) symbol);
	}
	if (accepted) {
		GScanner* _tmp3_;
		_tmp3_ = self->priv->scanner;
		g_scanner_get_next_token (_tmp3_);
	}
	result = accepted;
	return result;
}

static void
wixl_preprocessor_eval_condition_term (WixlPreprocessorEvalCondition* self,
                                       GValue* result,
                                       GError** error)
{
	GError* _tmp15_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_LEFT_PAREN)) {
		GValue val = {0};
		GValue _tmp0_ = {0};
		g_value_init (&_tmp0_, G_TYPE_BOOLEAN);
		g_value_set_boolean (&_tmp0_, wixl_preprocessor_eval_condition_expr (self, &_inner_error0_));
		val = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
		wixl_preprocessor_eval_condition_expect (self, (gint) G_TOKEN_RIGHT_PAREN, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			G_IS_VALUE (&val) ? (g_value_unset (&val), NULL) : NULL;
			return;
		}
		*result = val;
		return;
	} else {
		if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_INT)) {
			GScanner* _tmp1_;
			GValue _tmp2_ = {0};
			_tmp1_ = self->priv->scanner;
			g_value_init (&_tmp2_, G_TYPE_ULONG);
			g_value_set_ulong (&_tmp2_, g_scanner_cur_value (_tmp1_).v_int);
			*result = _tmp2_;
			return;
		} else {
			if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_STRING)) {
				GScanner* _tmp3_;
				const gchar* _tmp4_;
				GValue _tmp5_ = {0};
				_tmp3_ = self->priv->scanner;
				_tmp4_ = g_scanner_cur_value (_tmp3_).v_string;
				g_value_init (&_tmp5_, G_TYPE_STRING);
				g_value_set_string (&_tmp5_, _tmp4_);
				*result = _tmp5_;
				return;
			} else {
				if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_IDENTIFIER)) {
					GScanner* _tmp6_;
					const gchar* _tmp7_;
					GValue _tmp8_ = {0};
					_tmp6_ = self->priv->scanner;
					_tmp7_ = g_scanner_cur_value (_tmp6_).v_identifier;
					g_value_init (&_tmp8_, G_TYPE_STRING);
					g_value_set_string (&_tmp8_, _tmp7_);
					*result = _tmp8_;
					return;
				} else {
					if (wixl_preprocessor_eval_condition_accept (self, (gint) '$')) {
						if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_LEFT_PAREN)) {
							gchar* val = NULL;
							WixlPreprocessor* _tmp9_;
							GScanner* _tmp10_;
							const gchar* _tmp11_;
							GFile* _tmp12_;
							gchar* _tmp13_;
							GValue _tmp14_ = {0};
							wixl_preprocessor_eval_condition_expect (self, (gint) G_TOKEN_IDENTIFIER, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								return;
							}
							_tmp9_ = self->priv->preprocessor;
							_tmp10_ = self->priv->scanner;
							_tmp11_ = g_scanner_cur_value (_tmp10_).v_identifier;
							_tmp12_ = self->priv->file;
							_tmp13_ = wixl_preprocessor_eval_variable (_tmp9_, _tmp11_, _tmp12_, &_inner_error0_);
							val = _tmp13_;
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								return;
							}
							wixl_preprocessor_eval_condition_expect (self, (gint) G_TOKEN_RIGHT_PAREN, &_inner_error0_);
							if (G_UNLIKELY (_inner_error0_ != NULL)) {
								g_propagate_error (error, _inner_error0_);
								_g_free0 (val);
								return;
							}
							g_value_init (&_tmp14_, G_TYPE_STRING);
							g_value_take_string (&_tmp14_, val);
							*result = _tmp14_;
							return;
						}
					}
				}
			}
		}
	}
	_tmp15_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Invalid term");
	_inner_error0_ = _tmp15_;
	g_propagate_error (error, _inner_error0_);
	return;
}

static gint
wixl_preprocessor_eval_condition_to_int (WixlPreprocessorEvalCondition* self,
                                         GValue* val)
{
	GValue _result_ = {0};
	GValue _tmp0_ = {0};
	gint result = 0;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (val != NULL, 0);
	g_value_init (&_tmp0_, G_TYPE_INT);
	g_value_set_int (&_tmp0_, 0);
	_result_ = _tmp0_;
	g_value_transform (val, &_result_);
	result = g_value_get_int (&_result_);
	G_IS_VALUE (&_result_) ? (g_value_unset (&_result_), NULL) : NULL;
	return result;
}

static gchar*
wixl_preprocessor_eval_condition_to_string (WixlPreprocessorEvalCondition* self,
                                            GValue* val)
{
	GValue _result_ = {0};
	GValue _tmp0_ = {0};
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (val != NULL, NULL);
	g_value_init (&_tmp0_, G_TYPE_STRING);
	g_value_set_string (&_tmp0_, "");
	_result_ = _tmp0_;
	g_value_transform (val, &_result_);
	_tmp1_ = g_value_get_string (&_result_);
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	G_IS_VALUE (&_result_) ? (g_value_unset (&_result_), NULL) : NULL;
	return result;
}

static gboolean
wixl_preprocessor_eval_condition_cmp_term (WixlPreprocessorEvalCondition* self,
                                           GError** error)
{
	WixlPreprocessorEvalConditionOp op = 0;
	GValue left = {0};
	GValue _tmp0_ = {0};
	WixlPreprocessorEvalConditionOp _tmp35_;
	GValue _tmp43_;
	GError* _inner_error0_ = NULL;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	op = WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NONE;
	wixl_preprocessor_eval_condition_term (self, &_tmp0_, &_inner_error0_);
	left = _tmp0_;
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp1_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp1_;
	}
	if (wixl_preprocessor_eval_condition_accept (self, (gint) '<')) {
		op = WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LT;
	} else {
		if (wixl_preprocessor_eval_condition_accept (self, (gint) '>')) {
			op = WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GT;
		} else {
			if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_EQUAL_SIGN)) {
				GValue _tmp2_ = {0};
				GValue _tmp3_ = {0};
				GValue _tmp5_;
				gchar* _tmp6_;
				gchar* _tmp7_;
				gchar* _tmp8_;
				gchar* _tmp9_;
				gboolean _tmp10_;
				wixl_preprocessor_eval_condition_term (self, &_tmp3_, &_inner_error0_);
				_tmp2_ = _tmp3_;
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					gboolean _tmp4_ = FALSE;
					g_propagate_error (error, _inner_error0_);
					G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
					return _tmp4_;
				}
				_tmp5_ = left;
				_tmp6_ = wixl_preprocessor_eval_condition_to_string (self, &_tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = wixl_preprocessor_eval_condition_to_string (self, &_tmp2_);
				_tmp9_ = _tmp8_;
				_tmp10_ = g_strcmp0 (_tmp7_, _tmp9_) == 0;
				_g_free0 (_tmp9_);
				_g_free0 (_tmp7_);
				result = _tmp10_;
				G_IS_VALUE (&_tmp2_) ? (g_value_unset (&_tmp2_), NULL) : NULL;
				G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
				return result;
			} else {
				gboolean _tmp11_ = FALSE;
				if (wixl_preprocessor_eval_condition_accept (self, (gint) '!')) {
					gboolean _tmp12_ = FALSE;
					_tmp12_ = wixl_preprocessor_eval_condition_expect (self, (gint) '=', &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						gboolean _tmp13_ = FALSE;
						g_propagate_error (error, _inner_error0_);
						G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
						return _tmp13_;
					}
					_tmp11_ = _tmp12_;
				} else {
					_tmp11_ = FALSE;
				}
				if (_tmp11_) {
					GValue _tmp14_ = {0};
					GValue _tmp15_ = {0};
					GValue _tmp17_;
					gchar* _tmp18_;
					gchar* _tmp19_;
					gchar* _tmp20_;
					gchar* _tmp21_;
					gboolean _tmp22_;
					wixl_preprocessor_eval_condition_term (self, &_tmp15_, &_inner_error0_);
					_tmp14_ = _tmp15_;
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						gboolean _tmp16_ = FALSE;
						g_propagate_error (error, _inner_error0_);
						G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
						return _tmp16_;
					}
					_tmp17_ = left;
					_tmp18_ = wixl_preprocessor_eval_condition_to_string (self, &_tmp17_);
					_tmp19_ = _tmp18_;
					_tmp20_ = wixl_preprocessor_eval_condition_to_string (self, &_tmp14_);
					_tmp21_ = _tmp20_;
					_tmp22_ = g_strcmp0 (_tmp19_, _tmp21_) != 0;
					_g_free0 (_tmp21_);
					_g_free0 (_tmp19_);
					result = _tmp22_;
					G_IS_VALUE (&_tmp14_) ? (g_value_unset (&_tmp14_), NULL) : NULL;
					G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
					return result;
				} else {
					gboolean _tmp23_ = FALSE;
					if (wixl_preprocessor_eval_condition_accept (self, (gint) '~')) {
						gboolean _tmp24_ = FALSE;
						_tmp24_ = wixl_preprocessor_eval_condition_expect (self, (gint) '=', &_inner_error0_);
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							gboolean _tmp25_ = FALSE;
							g_propagate_error (error, _inner_error0_);
							G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
							return _tmp25_;
						}
						_tmp23_ = _tmp24_;
					} else {
						_tmp23_ = FALSE;
					}
					if (_tmp23_) {
						GValue _tmp26_ = {0};
						GValue _tmp27_ = {0};
						GValue _tmp29_;
						gchar* _tmp30_;
						gchar* _tmp31_;
						gchar* _tmp32_;
						gchar* _tmp33_;
						gboolean _tmp34_;
						wixl_preprocessor_eval_condition_term (self, &_tmp27_, &_inner_error0_);
						_tmp26_ = _tmp27_;
						if (G_UNLIKELY (_inner_error0_ != NULL)) {
							gboolean _tmp28_ = FALSE;
							g_propagate_error (error, _inner_error0_);
							G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
							return _tmp28_;
						}
						_tmp29_ = left;
						_tmp30_ = wixl_preprocessor_eval_condition_to_string (self, &_tmp29_);
						_tmp31_ = _tmp30_;
						_tmp32_ = wixl_preprocessor_eval_condition_to_string (self, &_tmp26_);
						_tmp33_ = _tmp32_;
						_tmp34_ = g_ascii_strcasecmp (_tmp31_, _tmp33_) == 0;
						_g_free0 (_tmp33_);
						_g_free0 (_tmp31_);
						result = _tmp34_;
						G_IS_VALUE (&_tmp26_) ? (g_value_unset (&_tmp26_), NULL) : NULL;
						G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
						return result;
					}
				}
			}
		}
	}
	_tmp35_ = op;
	if (_tmp35_ != WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NONE) {
		gboolean eq = FALSE;
		gint a = 0;
		GValue _tmp36_;
		GValue _tmp37_ = {0};
		GValue _tmp38_ = {0};
		gint b = 0;
		gboolean _tmp40_ = FALSE;
		WixlPreprocessorEvalConditionOp _tmp41_;
		eq = FALSE;
		if (wixl_preprocessor_eval_condition_accept (self, (gint) '=')) {
			eq = TRUE;
		}
		_tmp36_ = left;
		a = wixl_preprocessor_eval_condition_to_int (self, &_tmp36_);
		wixl_preprocessor_eval_condition_term (self, &_tmp38_, &_inner_error0_);
		_tmp37_ = _tmp38_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp39_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
			return _tmp39_;
		}
		b = wixl_preprocessor_eval_condition_to_int (self, &_tmp37_);
		if (eq) {
			_tmp40_ = a == b;
		} else {
			_tmp40_ = FALSE;
		}
		if (_tmp40_) {
			result = TRUE;
			G_IS_VALUE (&_tmp37_) ? (g_value_unset (&_tmp37_), NULL) : NULL;
			G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
			return result;
		}
		_tmp41_ = op;
		if (_tmp41_ == WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GT) {
			result = a > b;
			G_IS_VALUE (&_tmp37_) ? (g_value_unset (&_tmp37_), NULL) : NULL;
			G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
			return result;
		} else {
			WixlPreprocessorEvalConditionOp _tmp42_;
			_tmp42_ = op;
			if (_tmp42_ == WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LT) {
				result = a < b;
				G_IS_VALUE (&_tmp37_) ? (g_value_unset (&_tmp37_), NULL) : NULL;
				G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
				return result;
			}
		}
		G_IS_VALUE (&_tmp37_) ? (g_value_unset (&_tmp37_), NULL) : NULL;
	}
	_tmp43_ = left;
	result = wixl_preprocessor_eval_condition_to_bool (self, &_tmp43_);
	G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
	return result;
}

static gboolean
wixl_preprocessor_eval_condition_not_term (WixlPreprocessorEvalCondition* self,
                                           GError** error)
{
	GError* _inner_error0_ = NULL;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	if (wixl_preprocessor_eval_condition_accept_symbol (self, WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NOT)) {
		gboolean _tmp0_ = FALSE;
		_tmp0_ = wixl_preprocessor_eval_condition_not_term (self, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp1_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			return _tmp1_;
		}
		result = !_tmp0_;
		return result;
	} else {
		gboolean _tmp2_ = FALSE;
		_tmp2_ = wixl_preprocessor_eval_condition_cmp_term (self, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			gboolean _tmp3_ = FALSE;
			g_propagate_error (error, _inner_error0_);
			return _tmp3_;
		}
		result = _tmp2_;
		return result;
	}
}

static gboolean
wixl_preprocessor_eval_condition_expr (WixlPreprocessorEvalCondition* self,
                                       GError** error)
{
	gboolean handled = FALSE;
	gboolean _result_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	handled = FALSE;
	_result_ = wixl_preprocessor_eval_condition_not_term (self, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp0_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp0_;
	}
	{
		gboolean _tmp1_ = FALSE;
		_tmp1_ = TRUE;
		while (TRUE) {
			if (!_tmp1_) {
				if (!handled) {
					break;
				}
			}
			_tmp1_ = FALSE;
			handled = TRUE;
			if (wixl_preprocessor_eval_condition_accept_symbol (self, WIXL_PREPROCESSOR_EVAL_CONDITION_OP_AND)) {
				gboolean _tmp2_ = FALSE;
				gboolean _tmp3_ = FALSE;
				_tmp3_ = wixl_preprocessor_eval_condition_not_term (self, &_inner_error0_);
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
					gboolean _tmp4_ = FALSE;
					g_propagate_error (error, _inner_error0_);
					return _tmp4_;
				}
				if (_tmp3_) {
					_tmp2_ = _result_;
				} else {
					_tmp2_ = FALSE;
				}
				_result_ = _tmp2_;
			} else {
				if (wixl_preprocessor_eval_condition_accept_symbol (self, WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OR)) {
					gboolean _tmp5_ = FALSE;
					gboolean _tmp6_ = FALSE;
					_tmp6_ = wixl_preprocessor_eval_condition_not_term (self, &_inner_error0_);
					if (G_UNLIKELY (_inner_error0_ != NULL)) {
						gboolean _tmp7_ = FALSE;
						g_propagate_error (error, _inner_error0_);
						return _tmp7_;
					}
					if (_tmp6_) {
						_tmp5_ = TRUE;
					} else {
						_tmp5_ = _result_;
					}
					_result_ = _tmp5_;
				} else {
					handled = FALSE;
				}
			}
		}
	}
	result = _result_;
	return result;
}

static gboolean
wixl_preprocessor_eval_condition_eval (WixlPreprocessorEvalCondition* self,
                                       const gchar* str,
                                       GError** error)
{
	GScanner* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gboolean _result_ = FALSE;
	GError* _inner_error0_ = NULL;
	gboolean result = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (str != NULL, FALSE);
	_tmp0_ = self->priv->scanner;
	_tmp1_ = strlen (str);
	_tmp2_ = _tmp1_;
	g_scanner_input_text (_tmp0_, str, (guint) _tmp2_);
	_result_ = wixl_preprocessor_eval_condition_expr (self, &_inner_error0_);
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		g_propagate_error (error, _inner_error0_);
		return _tmp3_;
	}
	if (!wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_EOF)) {
		GScanner* _tmp4_;
		_tmp4_ = self->priv->scanner;
		g_warning ("preprocessor.vala:262: condition invaluation incomplete, next token %d", (gint) g_scanner_peek_next_token (_tmp4_));
	}
	result = _result_;
	return result;
}

static GObject *
wixl_preprocessor_eval_condition_constructor (GType type,
                                              guint n_construct_properties,
                                              GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WixlPreprocessorEvalCondition * self;
	GScanner* _tmp0_;
	GScanner* _tmp1_;
	GScannerConfig* _tmp2_;
	GScanner* _tmp3_;
	GScannerConfig* _tmp4_;
	GScanner* _tmp5_;
	GScannerConfig* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	GScanner* _tmp9_;
	GScanner* _tmp10_;
	GScanner* _tmp11_;
	parent_class = G_OBJECT_CLASS (wixl_preprocessor_eval_condition_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION, WixlPreprocessorEvalCondition);
	_tmp0_ = g_scanner_new (NULL);
	_g_scanner_destroy0 (self->priv->scanner);
	self->priv->scanner = _tmp0_;
	_tmp1_ = self->priv->scanner;
	_tmp2_ = _tmp1_->config;
	(*_tmp2_).scan_identifier_1char = TRUE;
	_tmp3_ = self->priv->scanner;
	_tmp4_ = _tmp3_->config;
	_tmp5_ = self->priv->scanner;
	_tmp6_ = _tmp5_->config;
	_tmp7_ = (*_tmp6_).cset_identifier_nth;
	_tmp8_ = g_strconcat ((const gchar*) _tmp7_, ".", NULL);
	(*_tmp4_).cset_identifier_nth = _tmp8_;
	_tmp9_ = self->priv->scanner;
	g_scanner_scope_add_symbol (_tmp9_, (guint) 0, "and", (void*) WIXL_PREPROCESSOR_EVAL_CONDITION_OP_AND);
	_tmp10_ = self->priv->scanner;
	g_scanner_scope_add_symbol (_tmp10_, (guint) 0, "or", (void*) WIXL_PREPROCESSOR_EVAL_CONDITION_OP_OR);
	_tmp11_ = self->priv->scanner;
	g_scanner_scope_add_symbol (_tmp11_, (guint) 0, "not", (void*) WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NOT);
	return obj;
}

static void
wixl_preprocessor_eval_condition_class_init (WixlPreprocessorEvalConditionClass * klass,
                                             gpointer klass_data)
{
	wixl_preprocessor_eval_condition_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WixlPreprocessorEvalCondition_private_offset);
	G_OBJECT_CLASS (klass)->constructor = wixl_preprocessor_eval_condition_constructor;
	G_OBJECT_CLASS (klass)->finalize = wixl_preprocessor_eval_condition_finalize;
}

static void
wixl_preprocessor_eval_condition_instance_init (WixlPreprocessorEvalCondition * self,
                                                gpointer klass)
{
	self->priv = wixl_preprocessor_eval_condition_get_instance_private (self);
}

static void
wixl_preprocessor_eval_condition_finalize (GObject * obj)
{
	WixlPreprocessorEvalCondition * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIXL_PREPROCESSOR_TYPE_EVAL_CONDITION, WixlPreprocessorEvalCondition);
	_g_object_unref0 (self->priv->file);
	_g_object_unref0 (self->priv->preprocessor);
	_g_scanner_destroy0 (self->priv->scanner);
	G_OBJECT_CLASS (wixl_preprocessor_eval_condition_parent_class)->finalize (obj);
}

static GType
wixl_preprocessor_eval_condition_get_type (void)
{
	static volatile gsize wixl_preprocessor_eval_condition_type_id__volatile = 0;
	if (g_once_init_enter (&wixl_preprocessor_eval_condition_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (WixlPreprocessorEvalConditionClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wixl_preprocessor_eval_condition_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WixlPreprocessorEvalCondition), 0, (GInstanceInitFunc) wixl_preprocessor_eval_condition_instance_init, NULL };
		GType wixl_preprocessor_eval_condition_type_id;
		wixl_preprocessor_eval_condition_type_id = g_type_register_static (G_TYPE_OBJECT, "WixlPreprocessorEvalCondition", &g_define_type_info, 0);
		WixlPreprocessorEvalCondition_private_offset = g_type_add_instance_private (wixl_preprocessor_eval_condition_type_id, sizeof (WixlPreprocessorEvalConditionPrivate));
		g_once_init_leave (&wixl_preprocessor_eval_condition_type_id__volatile, wixl_preprocessor_eval_condition_type_id);
	}
	return wixl_preprocessor_eval_condition_type_id__volatile;
}

static WixlPreprocessorLocation*
wixl_preprocessor_location_construct (GType object_type,
                                      xmlTextReader* reader,
                                      GFile* file)
{
	WixlPreprocessorLocation * self = NULL;
	GFile* _tmp0_;
	xmlNode* node = NULL;
	xmlNode* _tmp1_;
	g_return_val_if_fail (reader != NULL, NULL);
	g_return_val_if_fail (file != NULL, NULL);
	self = (WixlPreprocessorLocation*) g_object_new (object_type, NULL);
	_tmp0_ = _g_object_ref0 (file);
	_g_object_unref0 (self->file);
	self->file = _tmp0_;
	_tmp1_ = xmlTextReaderCurrentNode (reader);
	node = _tmp1_;
	self->line = (gint) node->line;
	return self;
}

static WixlPreprocessorLocation*
wixl_preprocessor_location_new (xmlTextReader* reader,
                                GFile* file)
{
	return wixl_preprocessor_location_construct (WIXL_PREPROCESSOR_TYPE_LOCATION, reader, file);
}

static gchar*
wixl_preprocessor_location_to_string (WixlPreprocessorLocation* self)
{
	GFile* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* result = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->file;
	_tmp1_ = g_file_get_basename (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strdup_printf ("%s:%d", _tmp2_, self->line);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	result = _tmp4_;
	return result;
}

static void
wixl_preprocessor_location_class_init (WixlPreprocessorLocationClass * klass,
                                       gpointer klass_data)
{
	wixl_preprocessor_location_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = wixl_preprocessor_location_finalize;
}

static void
wixl_preprocessor_location_instance_init (WixlPreprocessorLocation * self,
                                          gpointer klass)
{
}

static void
wixl_preprocessor_location_finalize (GObject * obj)
{
	WixlPreprocessorLocation * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIXL_PREPROCESSOR_TYPE_LOCATION, WixlPreprocessorLocation);
	_g_object_unref0 (self->file);
	G_OBJECT_CLASS (wixl_preprocessor_location_parent_class)->finalize (obj);
}

static GType
wixl_preprocessor_location_get_type (void)
{
	static volatile gsize wixl_preprocessor_location_type_id__volatile = 0;
	if (g_once_init_enter (&wixl_preprocessor_location_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (WixlPreprocessorLocationClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wixl_preprocessor_location_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WixlPreprocessorLocation), 0, (GInstanceInitFunc) wixl_preprocessor_location_instance_init, NULL };
		GType wixl_preprocessor_location_type_id;
		wixl_preprocessor_location_type_id = g_type_register_static (G_TYPE_OBJECT, "WixlPreprocessorLocation", &g_define_type_info, 0);
		g_once_init_leave (&wixl_preprocessor_location_type_id__volatile, wixl_preprocessor_location_type_id);
	}
	return wixl_preprocessor_location_type_id__volatile;
}

static inline gpointer
wixl_preprocessor_if_context_get_instance_private (WixlPreprocessorIfContext* self)
{
	return G_STRUCT_MEMBER_P (self, WixlPreprocessorIfContext_private_offset);
}

static gboolean
wixl_preprocessor_if_context_state_in_if (WixlPreprocessorIfContextState self)
{
	gboolean _tmp0_ = FALSE;
	gboolean result = FALSE;
	if (self == WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = self == WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSEIF;
	}
	result = _tmp0_;
	return result;
}

GType
wixl_preprocessor_if_context_state_get_type (void)
{
	static volatile gsize wixl_preprocessor_if_context_state_type_id__volatile = 0;
	if (g_once_init_enter (&wixl_preprocessor_if_context_state_type_id__volatile)) {
		static const GEnumValue values[] = {{WIXL_PREPROCESSOR_IF_CONTEXT_STATE_UNKNOWN, "WIXL_PREPROCESSOR_IF_CONTEXT_STATE_UNKNOWN", "unknown"}, {WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF, "WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF", "if"}, {WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSE, "WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSE", "else"}, {WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSEIF, "WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSEIF", "elseif"}, {0, NULL, NULL}};
		GType wixl_preprocessor_if_context_state_type_id;
		wixl_preprocessor_if_context_state_type_id = g_enum_register_static ("WixlPreprocessorIfContextState", values);
		g_once_init_leave (&wixl_preprocessor_if_context_state_type_id__volatile, wixl_preprocessor_if_context_state_type_id);
	}
	return wixl_preprocessor_if_context_state_type_id__volatile;
}

static WixlPreprocessorIfContext*
wixl_preprocessor_if_context_construct (GType object_type,
                                        gboolean enabled,
                                        gboolean is_true,
                                        WixlPreprocessorIfContextState state)
{
	WixlPreprocessorIfContext* self = NULL;
	self = (WixlPreprocessorIfContext*) g_type_create_instance (object_type);
	self->enabled = enabled;
	wixl_preprocessor_if_context_set_is_true (self, is_true);
	self->state = state;
	return self;
}

static WixlPreprocessorIfContext*
wixl_preprocessor_if_context_new (gboolean enabled,
                                  gboolean is_true,
                                  WixlPreprocessorIfContextState state)
{
	return wixl_preprocessor_if_context_construct (WIXL_PREPROCESSOR_TYPE_IF_CONTEXT, enabled, is_true, state);
}

static gboolean
wixl_preprocessor_if_context_get_is_true (WixlPreprocessorIfContext* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_true;
	return result;
}

static void
wixl_preprocessor_if_context_set_is_true (WixlPreprocessorIfContext* self,
                                          gboolean value)
{
	g_return_if_fail (self != NULL);
	if (value) {
		self->never_true = FALSE;
	}
	self->priv->_is_true = value;
}

static void
wixl_preprocessor_value_if_context_init (GValue* value)
{
	value->data[0].v_pointer = NULL;
}

static void
wixl_preprocessor_value_if_context_free_value (GValue* value)
{
	if (value->data[0].v_pointer) {
		wixl_preprocessor_if_context_unref (value->data[0].v_pointer);
	}
}

static void
wixl_preprocessor_value_if_context_copy_value (const GValue* src_value,
                                               GValue* dest_value)
{
	if (src_value->data[0].v_pointer) {
		dest_value->data[0].v_pointer = wixl_preprocessor_if_context_ref (src_value->data[0].v_pointer);
	} else {
		dest_value->data[0].v_pointer = NULL;
	}
}

static gpointer
wixl_preprocessor_value_if_context_peek_pointer (const GValue* value)
{
	return value->data[0].v_pointer;
}

static gchar*
wixl_preprocessor_value_if_context_collect_value (GValue* value,
                                                  guint n_collect_values,
                                                  GTypeCValue* collect_values,
                                                  guint collect_flags)
{
	if (collect_values[0].v_pointer) {
		WixlPreprocessorIfContext * object;
		object = collect_values[0].v_pointer;
		if (object->parent_instance.g_class == NULL) {
			return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
			return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
		}
		value->data[0].v_pointer = wixl_preprocessor_if_context_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}

static gchar*
wixl_preprocessor_value_if_context_lcopy_value (const GValue* value,
                                                guint n_collect_values,
                                                GTypeCValue* collect_values,
                                                guint collect_flags)
{
	WixlPreprocessorIfContext ** object_p;
	object_p = collect_values[0].v_pointer;
	if (!object_p) {
		return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
	}
	if (!value->data[0].v_pointer) {
		*object_p = NULL;
	} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
		*object_p = value->data[0].v_pointer;
	} else {
		*object_p = wixl_preprocessor_if_context_ref (value->data[0].v_pointer);
	}
	return NULL;
}

static GParamSpec*
wixl_preprocessor_param_spec_if_context (const gchar* name,
                                         const gchar* nick,
                                         const gchar* blurb,
                                         GType object_type,
                                         GParamFlags flags)
{
	WixlPreprocessorParamSpecIfContext* spec;
	g_return_val_if_fail (g_type_is_a (object_type, WIXL_PREPROCESSOR_TYPE_IF_CONTEXT), NULL);
	spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
	G_PARAM_SPEC (spec)->value_type = object_type;
	return G_PARAM_SPEC (spec);
}

static gpointer
wixl_preprocessor_value_get_if_context (const GValue* value)
{
	g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, WIXL_PREPROCESSOR_TYPE_IF_CONTEXT), NULL);
	return value->data[0].v_pointer;
}

static void
wixl_preprocessor_value_set_if_context (GValue* value,
                                        gpointer v_object)
{
	WixlPreprocessorIfContext * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, WIXL_PREPROCESSOR_TYPE_IF_CONTEXT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, WIXL_PREPROCESSOR_TYPE_IF_CONTEXT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
		wixl_preprocessor_if_context_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		wixl_preprocessor_if_context_unref (old);
	}
}

static void
wixl_preprocessor_value_take_if_context (GValue* value,
                                         gpointer v_object)
{
	WixlPreprocessorIfContext * old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, WIXL_PREPROCESSOR_TYPE_IF_CONTEXT));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, WIXL_PREPROCESSOR_TYPE_IF_CONTEXT));
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
		value->data[0].v_pointer = v_object;
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		wixl_preprocessor_if_context_unref (old);
	}
}

static void
wixl_preprocessor_if_context_class_init (WixlPreprocessorIfContextClass * klass,
                                         gpointer klass_data)
{
	wixl_preprocessor_if_context_parent_class = g_type_class_peek_parent (klass);
	((WixlPreprocessorIfContextClass *) klass)->finalize = wixl_preprocessor_if_context_finalize;
	g_type_class_adjust_private_offset (klass, &WixlPreprocessorIfContext_private_offset);
}

static void
wixl_preprocessor_if_context_instance_init (WixlPreprocessorIfContext * self,
                                            gpointer klass)
{
	self->priv = wixl_preprocessor_if_context_get_instance_private (self);
	self->never_true = TRUE;
	self->ref_count = 1;
}

static void
wixl_preprocessor_if_context_finalize (WixlPreprocessorIfContext * obj)
{
	WixlPreprocessorIfContext * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIXL_PREPROCESSOR_TYPE_IF_CONTEXT, WixlPreprocessorIfContext);
	g_signal_handlers_destroy (self);
}

static GType
wixl_preprocessor_if_context_get_type (void)
{
	static volatile gsize wixl_preprocessor_if_context_type_id__volatile = 0;
	if (g_once_init_enter (&wixl_preprocessor_if_context_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { wixl_preprocessor_value_if_context_init, wixl_preprocessor_value_if_context_free_value, wixl_preprocessor_value_if_context_copy_value, wixl_preprocessor_value_if_context_peek_pointer, "p", wixl_preprocessor_value_if_context_collect_value, "p", wixl_preprocessor_value_if_context_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (WixlPreprocessorIfContextClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wixl_preprocessor_if_context_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WixlPreprocessorIfContext), 0, (GInstanceInitFunc) wixl_preprocessor_if_context_instance_init, &g_define_type_value_table };
		static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
		GType wixl_preprocessor_if_context_type_id;
		wixl_preprocessor_if_context_type_id = g_type_register_fundamental (g_type_fundamental_next (), "WixlPreprocessorIfContext", &g_define_type_info, &g_define_type_fundamental_info, 0);
		WixlPreprocessorIfContext_private_offset = g_type_add_instance_private (wixl_preprocessor_if_context_type_id, sizeof (WixlPreprocessorIfContextPrivate));
		g_once_init_leave (&wixl_preprocessor_if_context_type_id__volatile, wixl_preprocessor_if_context_type_id);
	}
	return wixl_preprocessor_if_context_type_id__volatile;
}

static gpointer
wixl_preprocessor_if_context_ref (gpointer instance)
{
	WixlPreprocessorIfContext * self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}

static void
wixl_preprocessor_if_context_unref (gpointer instance)
{
	WixlPreprocessorIfContext * self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		WIXL_PREPROCESSOR_IF_CONTEXT_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}

static void
wixl_preprocessor_class_init (WixlPreprocessorClass * klass,
                              gpointer klass_data)
{
	wixl_preprocessor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WixlPreprocessor_private_offset);
	G_OBJECT_CLASS (klass)->constructor = wixl_preprocessor_constructor;
	G_OBJECT_CLASS (klass)->finalize = wixl_preprocessor_finalize;
}

static void
wixl_preprocessor_instance_init (WixlPreprocessor * self,
                                 gpointer klass)
{
	GHashFunc _tmp0_;
	GEqualFunc _tmp1_;
	GHashTable* _tmp2_;
	self->priv = wixl_preprocessor_get_instance_private (self);
	_tmp0_ = g_str_hash;
	_tmp1_ = g_str_equal;
	_tmp2_ = g_hash_table_new_full (_tmp0_, _tmp1_, _g_free0_, NULL);
	self->priv->requires = _tmp2_;
}

static void
wixl_preprocessor_finalize (GObject * obj)
{
	WixlPreprocessor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIXL_TYPE_PREPROCESSOR, WixlPreprocessor);
	_g_hash_table_unref0 (self->priv->variables);
	_g_hash_table_unref0 (self->priv->requires);
	G_OBJECT_CLASS (wixl_preprocessor_parent_class)->finalize (obj);
}

GType
wixl_preprocessor_get_type (void)
{
	static volatile gsize wixl_preprocessor_type_id__volatile = 0;
	if (g_once_init_enter (&wixl_preprocessor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (WixlPreprocessorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) wixl_preprocessor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WixlPreprocessor), 0, (GInstanceInitFunc) wixl_preprocessor_instance_init, NULL };
		GType wixl_preprocessor_type_id;
		wixl_preprocessor_type_id = g_type_register_static (G_TYPE_OBJECT, "WixlPreprocessor", &g_define_type_info, 0);
		WixlPreprocessor_private_offset = g_type_add_instance_private (wixl_preprocessor_type_id, sizeof (WixlPreprocessorPrivate));
		g_once_init_leave (&wixl_preprocessor_type_id__volatile, wixl_preprocessor_type_id);
	}
	return wixl_preprocessor_type_id__volatile;
}

static void
_vala_array_destroy (gpointer array,
                     gint array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gint array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

static gint
_vala_array_length (gpointer array)
{
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}

