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

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

#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;
typedef enum  {
	WIXL_ARCH_X86 = 0,
	WIXL_ARCH_INTEL = 0,
	WIXL_ARCH_IA64 = 1,
	WIXL_ARCH_INTEL64 = 1,
	WIXL_ARCH_X64
} WixlArch;

#define WIXL_TYPE_ARCH (wixl_arch_get_type ())
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 _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;
	WixlArch arch;
	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;

VALA_EXTERN GType wixl_preprocessor_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType wixl_arch_get_type (void) G_GNUC_CONST ;
static void _g_free0_ (gpointer var);
VALA_EXTERN WixlPreprocessor* wixl_preprocessor_new (GHashTable* globals,
                                         GList* includedirs,
                                         WixlArch arch);
VALA_EXTERN WixlPreprocessor* wixl_preprocessor_construct (GType object_type,
                                               GHashTable* globals,
                                               GList* includedirs,
                                               WixlArch arch);
VALA_EXTERN void wixl_preprocessor_define_variable (WixlPreprocessor* self,
                                        const gchar* name,
                                        const gchar* value);
VALA_EXTERN void wixl_preprocessor_undefine_variable (WixlPreprocessor* self,
                                          const gchar* name);
VALA_EXTERN gchar* wixl_preprocessor_lookup_variable (WixlPreprocessor* self,
                                          const gchar* name);
VALA_EXTERN gchar* wixl_preprocessor_eval_variable (WixlPreprocessor* self,
                                        const gchar* str,
                                        GFile* file,
                                        GError** error);
VALA_EXTERN gchar* wixl_arch_to_string (WixlArch self);
VALA_EXTERN gchar* wixl_preprocessor_eval (WixlPreprocessor* self,
                               const gchar* str,
                               GFile* file,
                               GError** error);
VALA_EXTERN 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_add5 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add6 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add7 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
VALA_EXTERN xmlDoc* wixl_preprocessor_preprocess (WixlPreprocessor* self,
                                      const gchar* data,
                                      GFile* file,
                                      GError** error);
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 GType wixl_preprocessor_eval_condition_get_type_once (void);
static void wixl_preprocessor_location_finalize (GObject * obj);
static GType wixl_preprocessor_location_get_type_once (void);
static void wixl_preprocessor_if_context_finalize (WixlPreprocessorIfContext * obj);
static GType wixl_preprocessor_if_context_get_type_once (void);
static GObject * wixl_preprocessor_constructor (GType type,
                                         guint n_construct_properties,
                                         GObjectConstructParam * construct_properties);
static void wixl_preprocessor_finalize (GObject * obj);
static GType wixl_preprocessor_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

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,
                             WixlArch arch)
{
	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 ((const gchar*) _tmp0_);
		name = _tmp3_;
		_g_free0 (value);
		_tmp4_ = g_strdup ((const gchar*) _tmp1_);
		value = _tmp4_;
		if (!_tmp2_) {
			break;
		}
		_tmp5_ = name;
		_tmp6_ = value;
		wixl_preprocessor_define_variable (self, _tmp5_, _tmp6_);
	}
	self->priv->includedirs = includedirs;
	self->priv->arch = arch;
	_g_free0 (value);
	_g_free0 (name);
	return self;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static 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_once (void)
{
	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);
	return wixl_preprocessor_eval_condition_op_type_id;
}

static GType
wixl_preprocessor_eval_condition_op_get_type (void)
{
	static volatile gsize wixl_preprocessor_eval_condition_op_type_id__once = 0;
	if (g_once_init_enter (&wixl_preprocessor_eval_condition_op_type_id__once)) {
		GType wixl_preprocessor_eval_condition_op_type_id;
		wixl_preprocessor_eval_condition_op_type_id = wixl_preprocessor_eval_condition_op_get_type_once ();
		g_once_init_leave (&wixl_preprocessor_eval_condition_op_type_id__once, wixl_preprocessor_eval_condition_op_type_id);
	}
	return wixl_preprocessor_eval_condition_op_type_id__once;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static GType
wixl_preprocessor_eval_condition_get_type_once (void)
{
	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));
	return wixl_preprocessor_eval_condition_type_id;
}

static GType
wixl_preprocessor_eval_condition_get_type (void)
{
	static volatile gsize wixl_preprocessor_eval_condition_type_id__once = 0;
	if (g_once_init_enter (&wixl_preprocessor_eval_condition_type_id__once)) {
		GType wixl_preprocessor_eval_condition_type_id;
		wixl_preprocessor_eval_condition_type_id = wixl_preprocessor_eval_condition_get_type_once ();
		g_once_init_leave (&wixl_preprocessor_eval_condition_type_id__once, wixl_preprocessor_eval_condition_type_id);
	}
	return wixl_preprocessor_eval_condition_type_id__once;
}

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

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

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

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

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

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

static GType
wixl_preprocessor_location_get_type_once (void)
{
	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);
	return wixl_preprocessor_location_type_id;
}

static GType
wixl_preprocessor_location_get_type (void)
{
	static volatile gsize wixl_preprocessor_location_type_id__once = 0;
	if (g_once_init_enter (&wixl_preprocessor_location_type_id__once)) {
		GType wixl_preprocessor_location_type_id;
		wixl_preprocessor_location_type_id = wixl_preprocessor_location_get_type_once ();
		g_once_init_leave (&wixl_preprocessor_location_type_id__once, wixl_preprocessor_location_type_id);
	}
	return wixl_preprocessor_location_type_id__once;
}

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

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

static GType
wixl_preprocessor_if_context_state_get_type_once (void)
{
	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);
	return wixl_preprocessor_if_context_state_type_id;
}

GType
wixl_preprocessor_if_context_state_get_type (void)
{
	static volatile gsize wixl_preprocessor_if_context_state_type_id__once = 0;
	if (g_once_init_enter (&wixl_preprocessor_if_context_state_type_id__once)) {
		GType wixl_preprocessor_if_context_state_type_id;
		wixl_preprocessor_if_context_state_type_id = wixl_preprocessor_if_context_state_get_type_once ();
		g_once_init_leave (&wixl_preprocessor_if_context_state_type_id__once, wixl_preprocessor_if_context_state_type_id);
	}
	return wixl_preprocessor_if_context_state_type_id__once;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static GType
wixl_preprocessor_if_context_get_type_once (void)
{
	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));
	return wixl_preprocessor_if_context_type_id;
}

static GType
wixl_preprocessor_if_context_get_type (void)
{
	static volatile gsize wixl_preprocessor_if_context_type_id__once = 0;
	if (g_once_init_enter (&wixl_preprocessor_if_context_type_id__once)) {
		GType wixl_preprocessor_if_context_type_id;
		wixl_preprocessor_if_context_type_id = wixl_preprocessor_if_context_get_type_once ();
		g_once_init_leave (&wixl_preprocessor_if_context_type_id__once, wixl_preprocessor_if_context_type_id);
	}
	return wixl_preprocessor_if_context_type_id__once;
}

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 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 void
wixl_preprocessor_class_init (WixlPreprocessorClass * klass,
                              gpointer klass_data)
{
	wixl_preprocessor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WixlPreprocessor_private_offset);
	G_OBJECT_CLASS (klass)->constructor = wixl_preprocessor_constructor;
	G_OBJECT_CLASS (klass)->finalize = wixl_preprocessor_finalize;
}

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

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

static GType
wixl_preprocessor_get_type_once (void)
{
	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));
	return wixl_preprocessor_type_id;
}

GType
wixl_preprocessor_get_type (void)
{
	static volatile gsize wixl_preprocessor_type_id__once = 0;
	if (g_once_init_enter (&wixl_preprocessor_type_id__once)) {
		GType wixl_preprocessor_type_id;
		wixl_preprocessor_type_id = wixl_preprocessor_get_type_once ();
		g_once_init_leave (&wixl_preprocessor_type_id__once, wixl_preprocessor_type_id);
	}
	return wixl_preprocessor_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize 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,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

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

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

