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



#include <glib.h>
#include <glib-object.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)
{
	gchar* result = NULL;
	GHashTable* _tmp0_;
	gconstpointer _tmp1_;
	gchar* _tmp2_;
	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* result = NULL;
	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_error_ = 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_error_ = _tmp3_;
		g_propagate_error (error, _inner_error_);
		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_error_ = _tmp24_;
	g_propagate_error (error, _inner_error_);
	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)
{
	gint result = 0;
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	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)
{
	gchar* result = NULL;
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp6_ = FALSE;
	gchar* _tmp8_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		glong _tmp2_;
		_tmp2_ = string_length;
		start = _tmp2_ + start;
	}
	if (end < ((glong) 0)) {
		glong _tmp3_;
		_tmp3_ = string_length;
		end = _tmp3_ + end;
	}
	if (start >= ((glong) 0)) {
		glong _tmp5_;
		_tmp5_ = string_length;
		_tmp4_ = start <= _tmp5_;
	} else {
		_tmp4_ = FALSE;
	}
	g_return_val_if_fail (_tmp4_, NULL);
	if (end >= ((glong) 0)) {
		glong _tmp7_;
		_tmp7_ = string_length;
		_tmp6_ = end <= _tmp7_;
	} else {
		_tmp6_ = FALSE;
	}
	g_return_val_if_fail (_tmp6_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp8_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp8_;
	return result;
}


gchar*
wixl_preprocessor_eval (WixlPreprocessor* self,
                        const gchar* str,
                        GFile* file,
                        GError** error)
{
	gchar* result = NULL;
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gint end = 0;
	gint pos = 0;
	const gchar* _tmp38_;
	gint _tmp39_;
	gint _tmp40_;
	gint _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	gchar* _tmp44_;
	gchar* _tmp45_;
	GError * _inner_error_ = 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) {
		gint _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _tmp4_;
		gint _tmp11_;
		gchar* remainder = NULL;
		gint _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		gchar* _tmp15_;
		const gchar* _tmp16_;
		_tmp1_ = end;
		pos = string_index_of (str, "$", _tmp1_);
		_tmp2_ = pos;
		if (!(_tmp2_ != -1)) {
			break;
		}
		_tmp3_ = end;
		_tmp4_ = pos;
		if (_tmp3_ < _tmp4_) {
			const gchar* _tmp5_;
			gint _tmp6_;
			gint _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			gchar* _tmp10_;
			_tmp5_ = _result_;
			_tmp6_ = end;
			_tmp7_ = pos;
			_tmp8_ = string_slice (str, (glong) _tmp6_, (glong) _tmp7_);
			_tmp9_ = _tmp8_;
			_tmp10_ = g_strconcat (_tmp5_, _tmp9_, NULL);
			_g_free0 (_result_);
			_result_ = _tmp10_;
			_g_free0 (_tmp9_);
		}
		_tmp11_ = pos;
		end = _tmp11_ + 1;
		_tmp12_ = end;
		_tmp13_ = strlen (str);
		_tmp14_ = _tmp13_;
		_tmp15_ = string_slice (str, (glong) _tmp12_, (glong) _tmp14_);
		remainder = _tmp15_;
		_tmp16_ = remainder;
		if (g_str_has_prefix (_tmp16_, "$")) {
			const gchar* _tmp17_;
			gchar* _tmp18_;
			_tmp17_ = _result_;
			_tmp18_ = g_strconcat (_tmp17_, "$", NULL);
			_g_free0 (_result_);
			_result_ = _tmp18_;
		} else {
			const gchar* _tmp19_;
			_tmp19_ = remainder;
			if (g_str_has_prefix (_tmp19_, "(")) {
				gint closing = 0;
				const gchar* _tmp20_;
				gint _tmp21_;
				gchar* substring = NULL;
				const gchar* _tmp23_;
				gint _tmp24_;
				gchar* _tmp25_;
				const gchar* _tmp26_;
				gchar* val = NULL;
				const gchar* _tmp28_;
				gchar* _tmp29_;
				const gchar* _tmp30_;
				const gchar* _tmp33_;
				const gchar* _tmp34_;
				gchar* _tmp35_;
				gint _tmp36_;
				gint _tmp37_;
				_tmp20_ = remainder;
				closing = wixl_find_closing_paren (_tmp20_);
				_tmp21_ = closing;
				if (_tmp21_ == -1) {
					GError* _tmp22_;
					_tmp22_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "no matching closing parenthesis");
					_inner_error_ = _tmp22_;
					g_propagate_error (error, _inner_error_);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp23_ = remainder;
				_tmp24_ = closing;
				_tmp25_ = string_slice (_tmp23_, (glong) 1, (glong) _tmp24_);
				substring = _tmp25_;
				_tmp26_ = substring;
				if (string_index_of (_tmp26_, "(", 0) != -1) {
					GError* _tmp27_;
					_tmp27_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FIXME, "unsupported function");
					_inner_error_ = _tmp27_;
					g_propagate_error (error, _inner_error_);
					_g_free0 (substring);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp28_ = substring;
				_tmp29_ = wixl_preprocessor_eval_variable (self, _tmp28_, file, &_inner_error_);
				val = _tmp29_;
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					g_propagate_error (error, _inner_error_);
					_g_free0 (substring);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp30_ = val;
				if (_tmp30_ == NULL) {
					const gchar* _tmp31_;
					GError* _tmp32_;
					_tmp31_ = substring;
					_tmp32_ = g_error_new (WIXL_ERROR, WIXL_ERROR_FAILED, "Undefined variable %s", _tmp31_);
					_inner_error_ = _tmp32_;
					g_propagate_error (error, _inner_error_);
					_g_free0 (val);
					_g_free0 (substring);
					_g_free0 (remainder);
					_g_free0 (_result_);
					return NULL;
				}
				_tmp33_ = _result_;
				_tmp34_ = val;
				_tmp35_ = g_strconcat (_tmp33_, _tmp34_, NULL);
				_g_free0 (_result_);
				_result_ = _tmp35_;
				_tmp36_ = end;
				_tmp37_ = closing;
				end = _tmp36_ + (_tmp37_ + 1);
				_g_free0 (val);
				_g_free0 (substring);
			}
		}
		_g_free0 (remainder);
	}
	_tmp38_ = _result_;
	_tmp39_ = end;
	_tmp40_ = strlen (str);
	_tmp41_ = _tmp40_;
	_tmp42_ = string_slice (str, (glong) _tmp39_, (glong) _tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = g_strconcat (_tmp38_, _tmp43_, NULL);
	_tmp45_ = _tmp44_;
	_g_free0 (_tmp43_);
	result = _tmp45_;
	_g_free0 (_result_);
	return result;
}


gboolean
wixl_preprocessor_eval_condition (WixlPreprocessor* self,
                                  const gchar* str,
                                  GFile* file,
                                  GError** error)
{
	gboolean result = FALSE;
	WixlPreprocessorEvalCondition* evaluator = NULL;
	WixlPreprocessorEvalCondition* _tmp0_;
	gboolean _tmp1_ = FALSE;
	GError * _inner_error_ = NULL;
	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_error_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		gboolean _tmp2_ = FALSE;
		g_propagate_error (error, _inner_error_);
		_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* _result_ = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	_tmp1_ = _result_;
	g_strstrip (_tmp1_);
	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* _tmp136_;
	GError * _inner_error_ = 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 _tmp64_ = FALSE;
		gboolean _tmp65_ = FALSE;
		gboolean _tmp66_;
		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_;
						gboolean _tmp14_;
						gchar* _tmp18_ = NULL;
						const gchar* _tmp19_;
						gchar* _tmp20_;
						WixlPreprocessorIfContext* _tmp21_;
						_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;
						_tmp14_ = _tmp13_->enabled;
						if (_tmp14_) {
							WixlPreprocessorIfContext* _tmp15_;
							gboolean _tmp16_;
							gboolean _tmp17_;
							_tmp15_ = context;
							_tmp16_ = wixl_preprocessor_if_context_get_is_true (_tmp15_);
							_tmp17_ = _tmp16_;
							_tmp12_ = _tmp17_;
						} else {
							_tmp12_ = FALSE;
						}
						_tmp19_ = value;
						_tmp20_ = wixl_preprocessor_eval_variable (self, _tmp19_, file, &_inner_error_);
						_tmp18_ = _tmp20_;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							g_propagate_error (error, _inner_error_);
							_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;
						}
						_tmp21_ = wixl_preprocessor_if_context_new (_tmp12_, _tmp18_ != NULL, WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF);
						_wixl_preprocessor_if_context_unref0 (context);
						context = _tmp21_;
						_g_free0 (_tmp18_);
						_g_free0 (value);
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label1) ? _tmp5_label1 : (_tmp5_label1 = g_quark_from_static_string ("ifndef")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp22_;
						WixlPreprocessorIfContext* _tmp23_;
						WixlPreprocessorIfContext* _tmp24_;
						gchar* value = NULL;
						const gchar* _tmp25_;
						gchar* _tmp26_;
						gboolean _tmp27_ = FALSE;
						WixlPreprocessorIfContext* _tmp28_;
						gboolean _tmp29_;
						gchar* _tmp33_ = NULL;
						const gchar* _tmp34_;
						gchar* _tmp35_;
						WixlPreprocessorIfContext* _tmp36_;
						_tmp22_ = ifstack;
						_tmp23_ = context;
						_tmp24_ = _wixl_preprocessor_if_context_ref0 (_tmp23_);
						g_queue_push_head (_tmp22_, _tmp24_);
						_tmp25_ = xmlTextReaderConstValue (reader);
						_tmp26_ = string_strip (_tmp25_);
						value = _tmp26_;
						_tmp28_ = context;
						_tmp29_ = _tmp28_->enabled;
						if (_tmp29_) {
							WixlPreprocessorIfContext* _tmp30_;
							gboolean _tmp31_;
							gboolean _tmp32_;
							_tmp30_ = context;
							_tmp31_ = wixl_preprocessor_if_context_get_is_true (_tmp30_);
							_tmp32_ = _tmp31_;
							_tmp27_ = _tmp32_;
						} else {
							_tmp27_ = FALSE;
						}
						_tmp34_ = value;
						_tmp35_ = wixl_preprocessor_eval_variable (self, _tmp34_, file, &_inner_error_);
						_tmp33_ = _tmp35_;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							g_propagate_error (error, _inner_error_);
							_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;
						}
						_tmp36_ = wixl_preprocessor_if_context_new (_tmp27_, _tmp33_ == NULL, WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF);
						_wixl_preprocessor_if_context_unref0 (context);
						context = _tmp36_;
						_g_free0 (_tmp33_);
						_g_free0 (value);
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label2) ? _tmp5_label2 : (_tmp5_label2 = g_quark_from_static_string ("else")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp37_;
						WixlPreprocessorIfContext* _tmp39_;
						WixlPreprocessorIfContextState _tmp40_;
						WixlPreprocessorIfContext* _tmp42_;
						WixlPreprocessorIfContext* _tmp43_;
						WixlPreprocessorIfContext* _tmp44_;
						gboolean _tmp45_;
						_tmp37_ = ifstack;
						if (g_queue_is_empty (_tmp37_)) {
							GError* _tmp38_;
							_tmp38_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Unmatched else");
							_inner_error_ = _tmp38_;
							g_propagate_error (error, _inner_error_);
							_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;
						}
						_tmp39_ = context;
						_tmp40_ = _tmp39_->state;
						if (!wixl_preprocessor_if_context_state_in_if (_tmp40_)) {
							GError* _tmp41_;
							_tmp41_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Unmatched else");
							_inner_error_ = _tmp41_;
							g_propagate_error (error, _inner_error_);
							_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;
						}
						_tmp42_ = context;
						_tmp42_->state = WIXL_PREPROCESSOR_IF_CONTEXT_STATE_ELSE;
						_tmp43_ = context;
						_tmp44_ = context;
						_tmp45_ = _tmp44_->never_true;
						wixl_preprocessor_if_context_set_is_true (_tmp43_, _tmp45_);
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label3) ? _tmp5_label3 : (_tmp5_label3 = g_quark_from_static_string ("endif")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp46_;
						GQueue* _tmp48_;
						gpointer _tmp49_;
						_tmp46_ = ifstack;
						if (g_queue_is_empty (_tmp46_)) {
							GError* _tmp47_;
							_tmp47_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Unmatched endif");
							_inner_error_ = _tmp47_;
							g_propagate_error (error, _inner_error_);
							_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;
						}
						_tmp48_ = ifstack;
						_tmp49_ = g_queue_pop_head (_tmp48_);
						_wixl_preprocessor_if_context_unref0 (context);
						context = (WixlPreprocessorIfContext*) _tmp49_;
						break;
					}
				}
			} else if (_tmp6_ == ((0 != _tmp5_label4) ? _tmp5_label4 : (_tmp5_label4 = g_quark_from_static_string ("if")))) {
				switch (0) {
					default:
					{
						GQueue* _tmp50_;
						WixlPreprocessorIfContext* _tmp51_;
						WixlPreprocessorIfContext* _tmp52_;
						gchar* value = NULL;
						const gchar* _tmp53_;
						gchar* _tmp54_;
						gboolean _tmp55_ = FALSE;
						WixlPreprocessorIfContext* _tmp56_;
						gboolean _tmp57_;
						gboolean _tmp61_ = FALSE;
						const gchar* _tmp62_;
						WixlPreprocessorIfContext* _tmp63_;
						_tmp50_ = ifstack;
						_tmp51_ = context;
						_tmp52_ = _wixl_preprocessor_if_context_ref0 (_tmp51_);
						g_queue_push_head (_tmp50_, _tmp52_);
						_tmp53_ = xmlTextReaderConstValue (reader);
						_tmp54_ = string_strip (_tmp53_);
						value = _tmp54_;
						_tmp56_ = context;
						_tmp57_ = _tmp56_->enabled;
						if (_tmp57_) {
							WixlPreprocessorIfContext* _tmp58_;
							gboolean _tmp59_;
							gboolean _tmp60_;
							_tmp58_ = context;
							_tmp59_ = wixl_preprocessor_if_context_get_is_true (_tmp58_);
							_tmp60_ = _tmp59_;
							_tmp55_ = _tmp60_;
						} else {
							_tmp55_ = FALSE;
						}
						_tmp62_ = value;
						_tmp61_ = wixl_preprocessor_eval_condition (self, _tmp62_, file, &_inner_error_);
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							g_propagate_error (error, _inner_error_);
							_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;
						}
						_tmp63_ = wixl_preprocessor_if_context_new (_tmp55_, _tmp61_, WIXL_PREPROCESSOR_IF_CONTEXT_STATE_IF);
						_wixl_preprocessor_if_context_unref0 (context);
						context = _tmp63_;
						_g_free0 (value);
						break;
					}
				}
			} else {
				switch (0) {
					default:
					{
						handled = FALSE;
						break;
					}
				}
			}
		}
		_tmp66_ = handled;
		if (_tmp66_) {
			_tmp65_ = TRUE;
		} else {
			WixlPreprocessorIfContext* _tmp67_;
			gboolean _tmp68_;
			_tmp67_ = context;
			_tmp68_ = _tmp67_->enabled;
			_tmp65_ = !_tmp68_;
		}
		if (_tmp65_) {
			_tmp64_ = TRUE;
		} else {
			WixlPreprocessorIfContext* _tmp69_;
			gboolean _tmp70_;
			gboolean _tmp71_;
			_tmp69_ = context;
			_tmp70_ = wixl_preprocessor_if_context_get_is_true (_tmp69_);
			_tmp71_ = _tmp70_;
			_tmp64_ = !_tmp71_;
		}
		if (_tmp64_) {
			_g_object_unref0 (loc);
			continue;
		}
		switch (xmlTextReaderNodeType (reader)) {
			case XML_READER_TYPE_PROCESSING_INSTRUCTION:
			{
				const gchar* _tmp72_;
				const gchar* _tmp73_;
				GQuark _tmp75_ = 0U;
				static GQuark _tmp74_label0 = 0;
				static GQuark _tmp74_label1 = 0;
				static GQuark _tmp74_label2 = 0;
				static GQuark _tmp74_label3 = 0;
				static GQuark _tmp74_label4 = 0;
				static GQuark _tmp74_label5 = 0;
				_tmp72_ = xmlTextReaderConstLocalName (reader);
				_tmp73_ = _tmp72_;
				_tmp75_ = (NULL == _tmp73_) ? 0 : g_quark_from_string (_tmp73_);
				if (_tmp75_ == ((0 != _tmp74_label0) ? _tmp74_label0 : (_tmp74_label0 = g_quark_from_static_string ("define")))) {
					switch (0) {
						default:
						{
							GMatchInfo* info = NULL;
							GRegex* r = NULL;
							GRegex* _tmp76_;
							GRegex* _tmp77_;
							const gchar* _tmp78_;
							GMatchInfo* _tmp79_ = NULL;
							gboolean _tmp80_;
							_tmp76_ = _g_regex_ref0 (_thread_safe_regex_init (&_tmp_regex_0, "^\\s*(?P<name>.+?)\\s*=\\s*(?P<value>.+?)\\s*$", 0));
							r = _tmp76_;
							_tmp77_ = r;
							_tmp78_ = xmlTextReaderConstValue (reader);
							_tmp80_ = g_regex_match (_tmp77_, _tmp78_, 0, &_tmp79_);
							_g_match_info_unref0 (info);
							info = _tmp79_;
							if (_tmp80_) {
								gchar* name = NULL;
								GMatchInfo* _tmp81_;
								gchar* _tmp82_;
								gchar* _tmp83_;
								gchar* _tmp84_;
								gchar* _tmp85_;
								gchar* value = NULL;
								GMatchInfo* _tmp86_;
								gchar* _tmp87_;
								gchar* _tmp88_;
								gchar* _tmp89_;
								gchar* _tmp90_;
								const gchar* _tmp91_;
								const gchar* _tmp92_;
								_tmp81_ = info;
								_tmp82_ = g_match_info_fetch_named (_tmp81_, "name");
								_tmp83_ = _tmp82_;
								_tmp84_ = wixl_remove_prefix ("var.", _tmp83_);
								_tmp85_ = _tmp84_;
								_g_free0 (_tmp83_);
								name = _tmp85_;
								_tmp86_ = info;
								_tmp87_ = g_match_info_fetch_named (_tmp86_, "value");
								_tmp88_ = _tmp87_;
								_tmp89_ = wixl_unquote (_tmp88_);
								_tmp90_ = _tmp89_;
								_g_free0 (_tmp88_);
								value = _tmp90_;
								_tmp91_ = name;
								_tmp92_ = value;
								wixl_preprocessor_define_variable (self, _tmp91_, _tmp92_);
								_g_free0 (value);
								_g_free0 (name);
							} else {
								GError* _tmp93_;
								_tmp93_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "invalid define");
								_inner_error_ = _tmp93_;
								g_propagate_error (error, _inner_error_);
								_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 (_tmp75_ == ((0 != _tmp74_label1) ? _tmp74_label1 : (_tmp74_label1 = g_quark_from_static_string ("undef")))) {
					switch (0) {
						default:
						{
							gchar* value = NULL;
							const gchar* _tmp94_;
							gchar* _tmp95_;
							const gchar* _tmp96_;
							_tmp94_ = xmlTextReaderConstValue (reader);
							_tmp95_ = string_strip (_tmp94_);
							value = _tmp95_;
							_tmp96_ = value;
							wixl_preprocessor_undefine_variable (self, _tmp96_);
							_g_free0 (value);
							break;
						}
					}
				} else if (_tmp75_ == ((0 != _tmp74_label2) ? _tmp74_label2 : (_tmp74_label2 = g_quark_from_static_string ("require")))) {
					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_error_);
							_tmp97_ = _tmp99_;
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								_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, TRUE, &_inner_error_);
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								_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 (_tmp75_ == ((0 != _tmp74_label3) ? _tmp74_label3 : (_tmp74_label3 = g_quark_from_static_string ("include")))) {
					switch (0) {
						default:
						{
							gchar* _tmp103_ = NULL;
							const gchar* _tmp104_;
							gchar* _tmp105_;
							gchar* value = NULL;
							gchar* _tmp106_;
							const gchar* _tmp107_;
							WixlPreprocessorLocation* _tmp108_;
							_tmp104_ = xmlTextReaderConstValue (reader);
							_tmp105_ = wixl_preprocessor_eval (self, _tmp104_, file, &_inner_error_);
							_tmp103_ = _tmp105_;
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								_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_ = string_strip (_tmp103_);
							value = _tmp106_;
							_tmp107_ = value;
							_tmp108_ = loc;
							wixl_preprocessor_include (self, _tmp107_, _tmp108_, writer, FALSE, &_inner_error_);
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								_g_free0 (value);
								_g_free0 (_tmp103_);
								_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 (_tmp103_);
							break;
						}
					}
				} else if (_tmp75_ == ((0 != _tmp74_label4) ? _tmp74_label4 : (_tmp74_label4 = g_quark_from_static_string ("warning")))) {
					switch (0) {
						default:
						{
							gchar* _tmp109_ = NULL;
							const gchar* _tmp110_;
							gchar* _tmp111_;
							WixlPreprocessorLocation* _tmp112_;
							_tmp110_ = xmlTextReaderConstValue (reader);
							_tmp111_ = wixl_preprocessor_eval (self, _tmp110_, file, &_inner_error_);
							_tmp109_ = _tmp111_;
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								_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;
							}
							_tmp112_ = loc;
							wixl_preprocessor_print (self, "warning", _tmp112_, _tmp109_);
							_g_free0 (_tmp109_);
							break;
						}
					}
				} else if (_tmp75_ == ((0 != _tmp74_label5) ? _tmp74_label5 : (_tmp74_label5 = g_quark_from_static_string ("error")))) {
					switch (0) {
						default:
						{
							gchar* _tmp113_ = NULL;
							const gchar* _tmp114_;
							gchar* _tmp115_;
							WixlPreprocessorLocation* _tmp116_;
							_tmp114_ = xmlTextReaderConstValue (reader);
							_tmp115_ = wixl_preprocessor_eval (self, _tmp114_, file, &_inner_error_);
							_tmp113_ = _tmp115_;
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								_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;
							}
							_tmp116_ = loc;
							wixl_preprocessor_print (self, "error", _tmp116_, _tmp113_);
							exit (1);
							_g_free0 (_tmp113_);
							break;
						}
					}
				} else {
					switch (0) {
						default:
						{
							const gchar* _tmp117_;
							_tmp117_ = xmlTextReaderConstLocalName (reader);
							g_warning ("preprocessor.vala:455: unhandled preprocessor instruction %s", _tmp117_);
							break;
						}
					}
				}
				break;
			}
			case XML_READER_TYPE_ELEMENT:
			{
				gboolean empty = FALSE;
				gboolean _tmp118_ = FALSE;
				gboolean _tmp119_ = FALSE;
				const gchar* _tmp121_;
				gboolean _tmp126_;
				empty = xmlTextReaderIsEmptyElement (reader) > 0;
				if (is_include) {
					_tmp119_ = xmlTextReaderDepth (reader) == 0;
				} else {
					_tmp119_ = FALSE;
				}
				if (_tmp119_) {
					const gchar* _tmp120_;
					_tmp120_ = xmlTextReaderConstName (reader);
					_tmp118_ = g_strcmp0 (_tmp120_, "Include") == 0;
				} else {
					_tmp118_ = FALSE;
				}
				if (_tmp118_) {
					break;
				}
				_tmp121_ = xmlTextReaderConstName (reader);
				xmlTextWriterStartElement (writer, _tmp121_);
				while (TRUE) {
					gchar* value = NULL;
					const gchar* _tmp122_;
					gchar* _tmp123_;
					const gchar* _tmp124_;
					const gchar* _tmp125_;
					if (!(xmlTextReaderMoveToNextAttribute (reader) > 0)) {
						break;
					}
					_tmp122_ = xmlTextReaderConstValue (reader);
					_tmp123_ = wixl_preprocessor_eval (self, _tmp122_, file, &_inner_error_);
					value = _tmp123_;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						g_propagate_error (error, _inner_error_);
						_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;
					}
					_tmp124_ = xmlTextReaderConstName (reader);
					_tmp125_ = value;
					xmlTextWriterWriteAttribute (writer, _tmp124_, _tmp125_);
					_g_free0 (value);
				}
				_tmp126_ = empty;
				if (_tmp126_) {
					xmlTextWriterEndElement (writer);
				}
				break;
			}
			case XML_READER_TYPE_END_ELEMENT:
			{
				gboolean _tmp127_ = FALSE;
				gboolean _tmp128_ = FALSE;
				if (is_include) {
					_tmp128_ = xmlTextReaderDepth (reader) == 0;
				} else {
					_tmp128_ = FALSE;
				}
				if (_tmp128_) {
					const gchar* _tmp129_;
					_tmp129_ = xmlTextReaderConstName (reader);
					_tmp127_ = g_strcmp0 (_tmp129_, "Include") == 0;
				} else {
					_tmp127_ = FALSE;
				}
				if (_tmp127_) {
					break;
				}
				xmlTextWriterEndElement (writer);
				break;
			}
			case XML_READER_TYPE_TEXT:
			{
				gchar* _tmp130_ = NULL;
				const gchar* _tmp131_;
				gchar* _tmp132_;
				_tmp131_ = xmlTextReaderConstValue (reader);
				_tmp132_ = wixl_preprocessor_eval (self, _tmp131_, file, &_inner_error_);
				_tmp130_ = _tmp132_;
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					g_propagate_error (error, _inner_error_);
					_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, _tmp130_);
				_g_free0 (_tmp130_);
				break;
			}
			case XML_READER_TYPE_CDATA:
			{
				gchar* _tmp133_ = NULL;
				const gchar* _tmp134_;
				gchar* _tmp135_;
				_tmp134_ = xmlTextReaderConstValue (reader);
				_tmp135_ = wixl_preprocessor_eval (self, _tmp134_, file, &_inner_error_);
				_tmp133_ = _tmp135_;
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					g_propagate_error (error, _inner_error_);
					_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, _tmp133_);
				_g_free0 (_tmp133_);
				break;
			}
			default:
			break;
		}
		_g_object_unref0 (loc);
	}
	_tmp136_ = ifstack;
	if (!g_queue_is_empty (_tmp136_)) {
		GError* _tmp137_;
		_tmp137_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Missing endif");
		_inner_error_ = _tmp137_;
		g_propagate_error (error, _inner_error_);
		(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)
{
	gboolean result = FALSE;
	gchar* data = NULL;
	GFile* file = NULL;
	GFile* _tmp0_;
	xmlTextReader* reader = NULL;
	const gchar* _tmp4_;
	xmlTextReader* _tmp5_;
	xmlTextReader* _tmp6_;
	GFile* _tmp7_;
	GError * _inner_error_ = NULL;
	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_error_);
		_g_free0 (data);
		data = _tmp1_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			gboolean _tmp2_ = FALSE;
			if (_inner_error_->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_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
			g_clear_error (&_inner_error_);
			return _tmp2_;
		}
	}
	goto __finally7;
	__catch7_g_file_error:
	{
		GError* _error_ = NULL;
		_error_ = _inner_error_;
		_inner_error_ = NULL;
		result = FALSE;
		_g_error_free0 (_error_);
		_g_object_unref0 (file);
		_g_free0 (data);
		return result;
	}
	__finally7:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		g_propagate_error (error, _inner_error_);
		_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_error_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		gboolean _tmp8_ = FALSE;
		g_propagate_error (error, _inner_error_);
		_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;
	gboolean _tmp24_;
	GError * _inner_error_ = 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 < _tmp19__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_;
				gboolean _tmp23_;
				_tmp22_ = inc;
				_tmp21_ = wixl_preprocessor_include_try (self, _tmp22_, writer, &_inner_error_);
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					g_propagate_error (error, _inner_error_);
					_g_free0 (inc);
					dirs = (_vala_array_free (dirs, dirs_length1, (GDestroyNotify) g_free), NULL);
					return;
				}
				success = _tmp21_;
				_tmp23_ = success;
				if (_tmp23_) {
					_g_free0 (inc);
					break;
				}
				_g_free0 (inc);
			}
		}
	}
	_tmp24_ = success;
	if (!_tmp24_) {
		gchar* _tmp25_;
		gchar* _tmp26_;
		_tmp25_ = g_strdup_printf ("Failed to include %s", name);
		_tmp26_ = _tmp25_;
		wixl_preprocessor_print (self, "error", loc, _tmp26_);
		_g_free0 (_tmp26_);
		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* result = NULL;
	xmlDoc* doc = NULL;
	xmlTextWriter* writer = NULL;
	xmlTextWriter* _tmp0_;
	xmlTextReader* reader = NULL;
	xmlTextReader* _tmp1_;
	GError * _inner_error_ = 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_error_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		g_propagate_error (error, _inner_error_);
		_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)
{
	gboolean result = FALSE;
	GValue _result_ = {0};
	GValue _tmp0_ = {0};
	GValue _tmp1_;
	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 result = FALSE;
	gboolean accepted = FALSE;
	GScanner* _tmp0_;
	gboolean _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->scanner;
	accepted = ((gint) g_scanner_peek_next_token (_tmp0_)) == type;
	_tmp1_ = accepted;
	if (_tmp1_) {
		GScanner* _tmp2_;
		_tmp2_ = self->priv->scanner;
		g_scanner_get_next_token (_tmp2_);
	}
	result = accepted;
	return result;
}


static gboolean
wixl_preprocessor_eval_condition_expect (WixlPreprocessorEvalCondition* self,
                                         gint type,
                                         GError** error)
{
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
	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_error_ = _tmp0_;
		g_propagate_error (error, _inner_error_);
		return _tmp1_;
	}
	result = TRUE;
	return result;
}


static gboolean
wixl_preprocessor_eval_condition_accept_symbol (WixlPreprocessorEvalCondition* self,
                                                WixlPreprocessorEvalConditionOp symbol)
{
	gboolean result = FALSE;
	gboolean accepted = FALSE;
	GScanner* _tmp0_;
	gboolean _tmp4_;
	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_;
		GTokenValue _tmp2_;
		void* _tmp3_;
		_tmp1_ = self->priv->scanner;
		_tmp2_ = _tmp1_->next_value;
		_tmp3_ = _tmp2_.v_symbol;
		accepted = ((gint) _tmp3_) == ((gint) symbol);
	}
	_tmp4_ = accepted;
	if (_tmp4_) {
		GScanner* _tmp5_;
		_tmp5_ = self->priv->scanner;
		g_scanner_get_next_token (_tmp5_);
	}
	result = accepted;
	return result;
}


static void
wixl_preprocessor_eval_condition_term (WixlPreprocessorEvalCondition* self,
                                       GValue* result,
                                       GError** error)
{
	GError* _tmp16_;
	GError * _inner_error_ = 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_error_));
		val = _tmp0_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			g_propagate_error (error, _inner_error_);
			return;
		}
		wixl_preprocessor_eval_condition_expect (self, (gint) G_TOKEN_RIGHT_PAREN, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			g_propagate_error (error, _inner_error_);
			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_;
			gulong _tmp2_;
			GValue _tmp3_ = {0};
			_tmp1_ = self->priv->scanner;
			_tmp2_ = g_scanner_cur_value (_tmp1_).v_int;
			g_value_init (&_tmp3_, G_TYPE_ULONG);
			g_value_set_ulong (&_tmp3_, _tmp2_);
			*result = _tmp3_;
			return;
		} else {
			if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_STRING)) {
				GScanner* _tmp4_;
				const gchar* _tmp5_;
				GValue _tmp6_ = {0};
				_tmp4_ = self->priv->scanner;
				_tmp5_ = g_scanner_cur_value (_tmp4_).v_string;
				g_value_init (&_tmp6_, G_TYPE_STRING);
				g_value_set_string (&_tmp6_, _tmp5_);
				*result = _tmp6_;
				return;
			} else {
				if (wixl_preprocessor_eval_condition_accept (self, (gint) G_TOKEN_IDENTIFIER)) {
					GScanner* _tmp7_;
					const gchar* _tmp8_;
					GValue _tmp9_ = {0};
					_tmp7_ = self->priv->scanner;
					_tmp8_ = g_scanner_cur_value (_tmp7_).v_identifier;
					g_value_init (&_tmp9_, G_TYPE_STRING);
					g_value_set_string (&_tmp9_, _tmp8_);
					*result = _tmp9_;
					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* _tmp10_;
							GScanner* _tmp11_;
							const gchar* _tmp12_;
							GFile* _tmp13_;
							gchar* _tmp14_;
							GValue _tmp15_ = {0};
							wixl_preprocessor_eval_condition_expect (self, (gint) G_TOKEN_IDENTIFIER, &_inner_error_);
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								return;
							}
							_tmp10_ = self->priv->preprocessor;
							_tmp11_ = self->priv->scanner;
							_tmp12_ = g_scanner_cur_value (_tmp11_).v_identifier;
							_tmp13_ = self->priv->file;
							_tmp14_ = wixl_preprocessor_eval_variable (_tmp10_, _tmp12_, _tmp13_, &_inner_error_);
							val = _tmp14_;
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								return;
							}
							wixl_preprocessor_eval_condition_expect (self, (gint) G_TOKEN_RIGHT_PAREN, &_inner_error_);
							if (G_UNLIKELY (_inner_error_ != NULL)) {
								g_propagate_error (error, _inner_error_);
								_g_free0 (val);
								return;
							}
							g_value_init (&_tmp15_, G_TYPE_STRING);
							g_value_take_string (&_tmp15_, val);
							*result = _tmp15_;
							return;
						}
					}
				}
			}
		}
	}
	_tmp16_ = g_error_new_literal (WIXL_ERROR, WIXL_ERROR_FAILED, "Invalid term");
	_inner_error_ = _tmp16_;
	g_propagate_error (error, _inner_error_);
	return;
}


static gint
wixl_preprocessor_eval_condition_to_int (WixlPreprocessorEvalCondition* self,
                                         GValue* val)
{
	gint result = 0;
	GValue _result_ = {0};
	GValue _tmp0_ = {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)
{
	gchar* result = NULL;
	GValue _result_ = {0};
	GValue _tmp0_ = {0};
	const gchar* _tmp1_;
	gchar* _tmp2_;
	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)
{
	gboolean result = FALSE;
	WixlPreprocessorEvalConditionOp op = 0;
	GValue left = {0};
	GValue _tmp0_ = {0};
	WixlPreprocessorEvalConditionOp _tmp35_;
	GValue _tmp50_;
	GError * _inner_error_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	op = WIXL_PREPROCESSOR_EVAL_CONDITION_OP_NONE;
	wixl_preprocessor_eval_condition_term (self, &_tmp0_, &_inner_error_);
	left = _tmp0_;
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		gboolean _tmp1_ = FALSE;
		g_propagate_error (error, _inner_error_);
		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_error_);
				_tmp2_ = _tmp3_;
				if (G_UNLIKELY (_inner_error_ != NULL)) {
					gboolean _tmp4_ = FALSE;
					g_propagate_error (error, _inner_error_);
					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_error_);
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						gboolean _tmp13_ = FALSE;
						g_propagate_error (error, _inner_error_);
						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_error_);
					_tmp14_ = _tmp15_;
					if (G_UNLIKELY (_inner_error_ != NULL)) {
						gboolean _tmp16_ = FALSE;
						g_propagate_error (error, _inner_error_);
						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_error_);
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							gboolean _tmp25_ = FALSE;
							g_propagate_error (error, _inner_error_);
							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_error_);
						_tmp26_ = _tmp27_;
						if (G_UNLIKELY (_inner_error_ != NULL)) {
							gboolean _tmp28_ = FALSE;
							g_propagate_error (error, _inner_error_);
							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;
		gboolean _tmp41_;
		WixlPreprocessorEvalConditionOp _tmp44_;
		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_error_);
		_tmp37_ = _tmp38_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			gboolean _tmp39_ = FALSE;
			g_propagate_error (error, _inner_error_);
			G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
			return _tmp39_;
		}
		b = wixl_preprocessor_eval_condition_to_int (self, &_tmp37_);
		_tmp41_ = eq;
		if (_tmp41_) {
			gint _tmp42_;
			gint _tmp43_;
			_tmp42_ = a;
			_tmp43_ = b;
			_tmp40_ = _tmp42_ == _tmp43_;
		} 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;
		}
		_tmp44_ = op;
		if (_tmp44_ == WIXL_PREPROCESSOR_EVAL_CONDITION_OP_GT) {
			gint _tmp45_;
			gint _tmp46_;
			_tmp45_ = a;
			_tmp46_ = b;
			result = _tmp45_ > _tmp46_;
			G_IS_VALUE (&_tmp37_) ? (g_value_unset (&_tmp37_), NULL) : NULL;
			G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
			return result;
		} else {
			WixlPreprocessorEvalConditionOp _tmp47_;
			_tmp47_ = op;
			if (_tmp47_ == WIXL_PREPROCESSOR_EVAL_CONDITION_OP_LT) {
				gint _tmp48_;
				gint _tmp49_;
				_tmp48_ = a;
				_tmp49_ = b;
				result = _tmp48_ < _tmp49_;
				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;
	}
	_tmp50_ = left;
	result = wixl_preprocessor_eval_condition_to_bool (self, &_tmp50_);
	G_IS_VALUE (&left) ? (g_value_unset (&left), NULL) : NULL;
	return result;
}


static gboolean
wixl_preprocessor_eval_condition_not_term (WixlPreprocessorEvalCondition* self,
                                           GError** error)
{
	gboolean result = FALSE;
	GError * _inner_error_ = NULL;
	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_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			gboolean _tmp1_ = FALSE;
			g_propagate_error (error, _inner_error_);
			return _tmp1_;
		}
		result = !_tmp0_;
		return result;
	} else {
		gboolean _tmp2_ = FALSE;
		_tmp2_ = wixl_preprocessor_eval_condition_cmp_term (self, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			gboolean _tmp3_ = FALSE;
			g_propagate_error (error, _inner_error_);
			return _tmp3_;
		}
		result = _tmp2_;
		return result;
	}
}


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


static gboolean
wixl_preprocessor_eval_condition_eval (WixlPreprocessorEvalCondition* self,
                                       const gchar* str,
                                       GError** error)
{
	gboolean result = FALSE;
	GScanner* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	gboolean _result_ = FALSE;
	GError * _inner_error_ = NULL;
	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_error_);
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		gboolean _tmp3_ = FALSE;
		g_propagate_error (error, _inner_error_);
		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)
{
	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)
{
	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_;
	gushort _tmp2_;
	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_;
	_tmp2_ = node->line;
	self->line = (gint) _tmp2_;
	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)
{
	gchar* result = NULL;
	GFile* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->file;
	_tmp1_ = g_file_get_basename (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = self->line;
	_tmp4_ = g_strdup_printf ("%s:%d", _tmp2_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp2_);
	result = _tmp5_;
	return result;
}


static void
wixl_preprocessor_location_class_init (WixlPreprocessorLocationClass * klass)
{
	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)
{
}


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 result = FALSE;
	gboolean _tmp0_ = 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;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_is_true;
	result = _tmp0_;
	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)
{
	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)
{
	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)
{
	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)
{
	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;
}



