/* valaoptionparser.c generated by valac 0.28.0.11-bbdd, the Vala compiler
 * generated from valaoptionparser.vala, do not modify */

/* valaoptionparser.vala
 *
 * Copyright (C) 2013  Jesse van den Kieboom
 * Copyright (C) 2006-2012  Jürg Billeter
 * Copyright (C) 1996-2002, 2004, 2005, 2006 Free Software Foundation, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 * 	Jürg Billeter <j@bitron.ch>
 */

#include <glib.h>
#include <glib-object.h>
#include <vala.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <gio/gio.h>
#include <gobject/gvaluecollector.h>


#define TYPE_PARSER_OPTIONS (parser_options_get_type ())
typedef struct _ParserOptions ParserOptions;
#define _vala_code_context_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_context_unref (var), NULL)))

#define TYPE_OPTION_PARSER (option_parser_get_type ())
#define OPTION_PARSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_OPTION_PARSER, OptionParser))
#define OPTION_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_OPTION_PARSER, OptionParserClass))
#define IS_OPTION_PARSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_OPTION_PARSER))
#define IS_OPTION_PARSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_OPTION_PARSER))
#define OPTION_PARSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_OPTION_PARSER, OptionParserClass))

typedef struct _OptionParser OptionParser;
typedef struct _OptionParserClass OptionParserClass;
typedef struct _OptionParserPrivate OptionParserPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_source_file_unref0(var) ((var == NULL) ? NULL : (var = (vala_source_file_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_DIAGNOSTICS (diagnostics_get_type ())
#define DIAGNOSTICS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DIAGNOSTICS, Diagnostics))
#define DIAGNOSTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DIAGNOSTICS, DiagnosticsClass))
#define IS_DIAGNOSTICS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DIAGNOSTICS))
#define IS_DIAGNOSTICS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DIAGNOSTICS))
#define DIAGNOSTICS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DIAGNOSTICS, DiagnosticsClass))

typedef struct _Diagnostics Diagnostics;
typedef struct _DiagnosticsClass DiagnosticsClass;
typedef struct _ParamSpecOptionParser ParamSpecOptionParser;

struct _ParserOptions {
	ValaCodeContext* context;
	gboolean fatal_warnings;
};

struct _OptionParser {
	GTypeInstance parent_instance;
	volatile int ref_count;
	OptionParserPrivate * priv;
};

struct _OptionParserClass {
	GTypeClass parent_class;
	void (*finalize) (OptionParser *self);
};

struct _ParamSpecOptionParser {
	GParamSpec parent_instance;
};


static gpointer option_parser_parent_class = NULL;
static gchar* option_parser_basedir;
static gchar* option_parser_basedir = NULL;
static gchar* option_parser_directory;
static gchar* option_parser_directory = NULL;
static gboolean option_parser_version;
static gboolean option_parser_version = FALSE;
static gboolean option_parser_api_version;
static gboolean option_parser_api_version = FALSE;
static gchar** option_parser_sources;
static gchar** option_parser_sources = NULL;
static gchar** option_parser_vapi_directories;
static gchar** option_parser_vapi_directories = NULL;
static gchar** option_parser_gir_directories;
static gchar** option_parser_gir_directories = NULL;
static gchar** option_parser_metadata_directories;
static gchar** option_parser_metadata_directories = NULL;
static gchar* option_parser_vapi_filename;
static gchar* option_parser_vapi_filename = NULL;
static gchar* option_parser_library;
static gchar* option_parser_library = NULL;
static gchar* option_parser_gir;
static gchar* option_parser_gir = NULL;
static gchar** option_parser_packages;
static gchar** option_parser_packages = NULL;
static gchar** option_parser_fast_vapis;
static gchar** option_parser_fast_vapis = NULL;
static gchar* option_parser_target_glib;
static gchar* option_parser_target_glib = NULL;
static gchar** option_parser_gresources;
static gchar** option_parser_gresources = NULL;
static gboolean option_parser_ccode_only;
static gboolean option_parser_ccode_only = FALSE;
static gchar* option_parser_header_filename;
static gchar* option_parser_header_filename = NULL;
static gboolean option_parser_use_header;
static gboolean option_parser_use_header = FALSE;
static gchar* option_parser_internal_header_filename;
static gchar* option_parser_internal_header_filename = NULL;
static gchar* option_parser_internal_vapi_filename;
static gchar* option_parser_internal_vapi_filename = NULL;
static gchar* option_parser_fast_vapi_filename;
static gchar* option_parser_fast_vapi_filename = NULL;
static gchar* option_parser_symbols_filename;
static gchar* option_parser_symbols_filename = NULL;
static gchar* option_parser_includedir;
static gchar* option_parser_includedir = NULL;
static gboolean option_parser_compile_only;
static gboolean option_parser_compile_only = FALSE;
static gchar* option_parser_output;
static gchar* option_parser_output = NULL;
static gboolean option_parser_debug;
static gboolean option_parser_debug = FALSE;
static gboolean option_parser_thread;
static gboolean option_parser_thread = FALSE;
static gboolean option_parser_mem_profiler;
static gboolean option_parser_mem_profiler = FALSE;
static gboolean option_parser_disable_assert;
static gboolean option_parser_disable_assert = FALSE;
static gboolean option_parser_enable_checking;
static gboolean option_parser_enable_checking = FALSE;
static gboolean option_parser_deprecated;
static gboolean option_parser_deprecated = FALSE;
static gboolean option_parser_experimental;
static gboolean option_parser_experimental = FALSE;
static gboolean option_parser_experimental_non_null;
static gboolean option_parser_experimental_non_null = FALSE;
static gboolean option_parser_gobject_tracing;
static gboolean option_parser_gobject_tracing = FALSE;
static gboolean option_parser_disable_warnings;
static gboolean option_parser_disable_warnings = FALSE;
static gchar* option_parser_cc_command;
static gchar* option_parser_cc_command = NULL;
static gchar** option_parser_cc_options;
static gchar** option_parser_cc_options = NULL;
static gchar* option_parser_dump_tree;
static gchar* option_parser_dump_tree = NULL;
static gboolean option_parser_save_temps;
static gboolean option_parser_save_temps = FALSE;
static gchar** option_parser_defines;
static gchar** option_parser_defines = NULL;
static gboolean option_parser_quiet_mode;
static gboolean option_parser_quiet_mode = FALSE;
static gboolean option_parser_verbose_mode;
static gboolean option_parser_verbose_mode = FALSE;
static gchar* option_parser_profile;
static gchar* option_parser_profile = NULL;
static gboolean option_parser_nostdpkg;
static gboolean option_parser_nostdpkg = FALSE;
static gboolean option_parser_enable_version_header;
static gboolean option_parser_enable_version_header = FALSE;
static gboolean option_parser_disable_version_header;
static gboolean option_parser_disable_version_header = FALSE;
static gboolean option_parser_fatal_warnings;
static gboolean option_parser_fatal_warnings = FALSE;
static gchar* option_parser_dependencies;
static gchar* option_parser_dependencies = NULL;
static gchar* option_parser_entry_point;
static gchar* option_parser_entry_point = NULL;
static gboolean option_parser_run_output;
static gboolean option_parser_run_output = FALSE;

GType parser_options_get_type (void) G_GNUC_CONST;
ParserOptions* parser_options_dup (const ParserOptions* self);
void parser_options_free (ParserOptions* self);
void parser_options_copy (const ParserOptions* self, ParserOptions* dest);
void parser_options_destroy (ParserOptions* self);
gpointer option_parser_ref (gpointer instance);
void option_parser_unref (gpointer instance);
GParamSpec* param_spec_option_parser (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void value_set_option_parser (GValue* value, gpointer v_object);
void value_take_option_parser (GValue* value, gpointer v_object);
gpointer value_get_option_parser (const GValue* value);
GType option_parser_get_type (void) G_GNUC_CONST;
enum  {
	OPTION_PARSER_DUMMY_PROPERTY
};
static void option_parser_apply (ValaCodeContext* context, gchar** args, int args_length1, const gchar* wd, ParserOptions* result);
static gchar* option_parser_realpath (const gchar* wd, const gchar* path);
static gchar** option_parser_realpaths (const gchar* wd, gchar** paths, int paths_length1, int* result_length1);
gchar** option_parser_real_sources (const gchar* wd, int* result_length1);
static void option_parser_clear (void);
gboolean option_parser_parse (gchar** args, int args_length1);
static gchar** _vala_array_dup1 (gchar** self, int length);
void option_parser_parse_and_apply (const gchar* wd, gchar** args, int args_length1, ParserOptions* result);
Diagnostics* diagnostics_new (void);
Diagnostics* diagnostics_construct (GType object_type);
GType diagnostics_get_type (void) G_GNUC_CONST;
OptionParser* option_parser_new (void);
OptionParser* option_parser_construct (GType object_type);
static void option_parser_finalize (OptionParser* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

static const GOptionEntry OPTION_PARSER_options[50] = {{"vapidir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &option_parser_vapi_directories, "Look for package bindings in DIRECTORY", "DIRECTORY..."}, {"girdir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &option_parser_gir_directories, "Look for .gir files in DIRECTORY", "DIRECTORY..."}, {"metadatadir", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &option_parser_metadata_directories, "Look for GIR .metadata files in DIRECTORY", "DIRECTORY..."}, {"pkg", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &option_parser_packages, "Include binding for PACKAGE", "PACKAGE..."}, {"vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &option_parser_vapi_filename, "Output VAPI file name", "FILE"}, {"library", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_library, "Library name", "NAME"}, {"gir", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_gir, "GObject-Introspection repository file name", "NAME-VERSION.gir"}, {"basedir", 'b', 0, G_OPTION_ARG_FILENAME, &option_parser_basedir, "Base source directory", "DIRECTORY"}, {"directory", 'd', 0, G_OPTION_ARG_FILENAME, &option_parser_directory, "Output directory", "DIRECTORY"}, {"version", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_version, "Display version number", NULL}, {"api-version", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_api_version, "Display API version number", NULL}, {"ccode", 'C', 0, G_OPTION_ARG_NONE, &option_parser_ccode_only, "Output C code", NULL}, {"header", 'H', 0, G_OPTION_ARG_FILENAME, &option_parser_header_filename, "Output C header file", "FILE"}, {"use-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_use_header, "Use C header file", NULL}, {"includedir", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &option_parser_includedir, "Directory used to include the C header file", "DIRECTORY"}, {"internal-header", 'h', 0, G_OPTION_ARG_FILENAME, &option_parser_internal_header_filename, "Output internal C header file", "FILE"}, {"internal-vapi", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &option_parser_internal_vapi_filename, "Output vapi with internal api", "FILE"}, {"fast-vapi", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_fast_vapi_filename, "Output vapi without performing symbol resolution", NULL}, {"use-fast-vapi", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &option_parser_fast_vapis, "Use --fast-vapi output during this compile", NULL}, {"deps", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_dependencies, "Write make-style dependency information to this file", NULL}, {"symbols", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &option_parser_symbols_filename, "Output symbols file", "FILE"}, {"compile", 'c', 0, G_OPTION_ARG_NONE, &option_parser_compile_only, "Compile but do not link", NULL}, {"output", 'o', 0, G_OPTION_ARG_FILENAME, &option_parser_output, "Place output in file FILE", "FILE"}, {"debug", 'g', 0, G_OPTION_ARG_NONE, &option_parser_debug, "Produce debug information", NULL}, {"thread", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_thread, "Enable multithreading support", NULL}, {"enable-mem-profiler", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_mem_profiler, "Enable GLib memory profiler", NULL}, {"define", 'D', 0, G_OPTION_ARG_STRING_ARRAY, &option_parser_defines, "Define SYMBOL", "SYMBOL..."}, {"main", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_entry_point, "Use SYMBOL as entry point", "SYMBOL..."}, {"nostdpkg", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_nostdpkg, "Do not include standard packages", NULL}, {"disable-assert", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_disable_assert, "Disable assertions", NULL}, {"enable-checking", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_enable_checking, "Enable additional run-time checks", NULL}, {"enable-deprecated", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_deprecated, "Enable deprecated features", NULL}, {"enable-experimental", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_experimental, "Enable experimental features", NULL}, {"disable-warnings", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_disable_warnings, "Disable warnings", NULL}, {"fatal-warnings", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_fatal_warnings, "Treat warnings as fatal", NULL}, {"enable-experimental-non-null", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_experimental_non_null, "Enable experimental enhancements for non-null types", NULL}, {"enable-gobject-tracing", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_gobject_tracing, "Enable GObject creation tracing", NULL}, {"cc", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_cc_command, "Use COMMAND as C compiler command", "COMMAND"}, {"Xcc", 'X', 0, G_OPTION_ARG_STRING_ARRAY, &option_parser_cc_options, "Pass OPTION to the C compiler", "OPTION..."}, {"dump-tree", (gchar) 0, 0, G_OPTION_ARG_FILENAME, &option_parser_dump_tree, "Write code tree to FILE", "FILE"}, {"save-temps", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_save_temps, "Keep temporary files", NULL}, {"profile", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_profile, "Use the given profile instead of the default", "PROFILE"}, {"quiet", 'q', 0, G_OPTION_ARG_NONE, &option_parser_quiet_mode, "Do not print messages to the console", NULL}, {"verbose", 'v', 0, G_OPTION_ARG_NONE, &option_parser_verbose_mode, "Print additional messages to the console", NULL}, {"target-glib", (gchar) 0, 0, G_OPTION_ARG_STRING, &option_parser_target_glib, "Target version of glib for code generation", "MAJOR.MINOR"}, {"gresources", (gchar) 0, 0, G_OPTION_ARG_STRING_ARRAY, &option_parser_gresources, "XML of gresources", "FILE..."}, {"enable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_enable_version_header, "Write vala build version in generated files", NULL}, {"disable-version-header", (gchar) 0, 0, G_OPTION_ARG_NONE, &option_parser_disable_version_header, "Do not write vala build version in generated files", NULL}, {"", (gchar) 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &option_parser_sources, NULL, "FILE..."}, {NULL}};

static gpointer _vala_code_context_ref0 (gpointer self) {
	return self ? vala_code_context_ref (self) : NULL;
}


void parser_options_copy (const ParserOptions* self, ParserOptions* dest) {
	ValaCodeContext* _tmp0_ = NULL;
	ValaCodeContext* _tmp1_ = NULL;
	gboolean _tmp2_ = FALSE;
	_tmp0_ = (*self).context;
	_tmp1_ = _vala_code_context_ref0 (_tmp0_);
	_vala_code_context_unref0 ((*dest).context);
	(*dest).context = _tmp1_;
	_tmp2_ = (*self).fatal_warnings;
	(*dest).fatal_warnings = _tmp2_;
}


void parser_options_destroy (ParserOptions* self) {
	_vala_code_context_unref0 ((*self).context);
}


ParserOptions* parser_options_dup (const ParserOptions* self) {
	ParserOptions* dup;
	dup = g_new0 (ParserOptions, 1);
	parser_options_copy (self, dup);
	return dup;
}


void parser_options_free (ParserOptions* self) {
	parser_options_destroy (self);
	g_free (self);
}


GType parser_options_get_type (void) {
	static volatile gsize parser_options_type_id__volatile = 0;
	if (g_once_init_enter (&parser_options_type_id__volatile)) {
		GType parser_options_type_id;
		parser_options_type_id = g_boxed_type_register_static ("ParserOptions", (GBoxedCopyFunc) parser_options_dup, (GBoxedFreeFunc) parser_options_free);
		g_once_init_leave (&parser_options_type_id__volatile, parser_options_type_id);
	}
	return parser_options_type_id__volatile;
}


static void option_parser_apply (ValaCodeContext* context, gchar** args, int args_length1, const gchar* wd, ParserOptions* result) {
	ValaCodeContext* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	ValaCodeContext* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	ValaCodeContext* _tmp4_ = NULL;
	gboolean _tmp5_ = FALSE;
	ValaCodeContext* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	ValaCodeContext* _tmp8_ = NULL;
	gboolean _tmp9_ = FALSE;
	ValaCodeContext* _tmp10_ = NULL;
	gboolean _tmp11_ = FALSE;
	ValaCodeContext* _tmp12_ = NULL;
	ValaReport* _tmp13_ = NULL;
	ValaReport* _tmp14_ = NULL;
	gboolean _tmp15_ = FALSE;
	ValaCodeContext* _tmp16_ = NULL;
	ValaReport* _tmp17_ = NULL;
	ValaReport* _tmp18_ = NULL;
	gboolean _tmp19_ = FALSE;
	ValaCodeContext* _tmp20_ = NULL;
	gboolean _tmp21_ = FALSE;
	ValaCodeContext* _tmp22_ = NULL;
	gboolean _tmp23_ = FALSE;
	ValaCodeContext* _tmp24_ = NULL;
	gboolean _tmp25_ = FALSE;
	ValaCodeContext* _tmp26_ = NULL;
	gboolean _tmp27_ = FALSE;
	ValaCodeContext* _tmp28_ = NULL;
	const gchar* _tmp29_ = NULL;
	gboolean _tmp30_ = FALSE;
	const gchar* _tmp31_ = NULL;
	ValaCodeContext* _tmp33_ = NULL;
	gboolean _tmp34_ = FALSE;
	ValaCodeContext* _tmp35_ = NULL;
	const gchar* _tmp36_ = NULL;
	ValaCodeContext* _tmp37_ = NULL;
	const gchar* _tmp38_ = NULL;
	ValaCodeContext* _tmp39_ = NULL;
	const gchar* _tmp40_ = NULL;
	ValaCodeContext* _tmp41_ = NULL;
	const gchar* _tmp42_ = NULL;
	const gchar* _tmp43_ = NULL;
	const gchar* _tmp51_ = NULL;
	ValaCodeContext* _tmp61_ = NULL;
	const gchar* _tmp62_ = NULL;
	gchar** _tmp63_ = NULL;
	gint _tmp63__length1 = 0;
	gint _tmp64_ = 0;
	gchar** _tmp65_ = NULL;
	ValaCodeContext* _tmp66_ = NULL;
	const gchar* _tmp67_ = NULL;
	gchar** _tmp68_ = NULL;
	gint _tmp68__length1 = 0;
	gint _tmp69_ = 0;
	gchar** _tmp70_ = NULL;
	ValaCodeContext* _tmp71_ = NULL;
	const gchar* _tmp72_ = NULL;
	gchar** _tmp73_ = NULL;
	gint _tmp73__length1 = 0;
	gint _tmp74_ = 0;
	gchar** _tmp75_ = NULL;
	ValaCodeContext* _tmp76_ = NULL;
	gboolean _tmp77_ = FALSE;
	ValaCodeContext* _tmp78_ = NULL;
	gboolean _tmp79_ = FALSE;
	ValaCodeContext* _tmp80_ = NULL;
	gboolean _tmp81_ = FALSE;
	ValaCodeContext* _tmp82_ = NULL;
	gboolean _tmp83_ = FALSE;
	gboolean _tmp84_ = FALSE;
	gboolean _tmp85_ = FALSE;
	const gchar* _tmp86_ = NULL;
	gboolean _tmp94_ = FALSE;
	const gchar* _tmp95_ = NULL;
	ValaCodeContext* _tmp96_ = NULL;
	gboolean _tmp97_ = FALSE;
	ValaCodeContext* _tmp98_ = NULL;
	const gchar* _tmp99_ = NULL;
	ValaCodeContext* _tmp100_ = NULL;
	gboolean _tmp101_ = FALSE;
	gchar** _tmp102_ = NULL;
	gint _tmp102__length1 = 0;
	gint glib_major = 0;
	gint glib_minor = 0;
	gboolean _tmp114_ = FALSE;
	const gchar* _tmp115_ = NULL;
	ValaCodeContext* _tmp118_ = NULL;
	gint _tmp119_ = 0;
	ValaCodeContext* _tmp120_ = NULL;
	gint _tmp121_ = 0;
	ValaCodeContext* _tmp122_ = NULL;
	gint _tmp123_ = 0;
	gint _tmp124_ = 0;
	gboolean _tmp133_ = FALSE;
	gchar** _tmp136_ = NULL;
	gint _tmp136__length1 = 0;
	gchar** _tmp141_ = NULL;
	gint _tmp141__length1 = 0;
	gboolean _tmp153_ = FALSE;
	ValaCodeContext* _tmp154_ = NULL;
	ValaCodeContext* _tmp155_ = NULL;
	ParserOptions _tmp156_ = {0};
	g_return_if_fail (context != NULL);
	g_return_if_fail (wd != NULL);
	_tmp0_ = context;
	_tmp1_ = option_parser_disable_assert;
	vala_code_context_set_assert (_tmp0_, !_tmp1_);
	_tmp2_ = context;
	_tmp3_ = option_parser_enable_checking;
	vala_code_context_set_checking (_tmp2_, _tmp3_);
	_tmp4_ = context;
	_tmp5_ = option_parser_deprecated;
	vala_code_context_set_deprecated (_tmp4_, _tmp5_);
	_tmp6_ = context;
	_tmp7_ = option_parser_experimental;
	vala_code_context_set_experimental (_tmp6_, _tmp7_);
	_tmp8_ = context;
	_tmp9_ = option_parser_experimental_non_null;
	vala_code_context_set_experimental_non_null (_tmp8_, _tmp9_);
	_tmp10_ = context;
	_tmp11_ = option_parser_gobject_tracing;
	vala_code_context_set_gobject_tracing (_tmp10_, _tmp11_);
	_tmp12_ = context;
	_tmp13_ = vala_code_context_get_report (_tmp12_);
	_tmp14_ = _tmp13_;
	_tmp15_ = option_parser_disable_warnings;
	vala_report_set_enable_warnings (_tmp14_, !_tmp15_);
	_tmp16_ = context;
	_tmp17_ = vala_code_context_get_report (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = option_parser_quiet_mode;
	vala_report_set_verbose_errors (_tmp18_, !_tmp19_);
	_tmp20_ = context;
	_tmp21_ = option_parser_verbose_mode;
	vala_code_context_set_verbose_mode (_tmp20_, _tmp21_);
	_tmp22_ = context;
	_tmp23_ = option_parser_disable_version_header;
	vala_code_context_set_version_header (_tmp22_, !_tmp23_);
	_tmp24_ = context;
	_tmp25_ = option_parser_ccode_only;
	vala_code_context_set_ccode_only (_tmp24_, _tmp25_);
	_tmp26_ = context;
	_tmp27_ = option_parser_compile_only;
	vala_code_context_set_compile_only (_tmp26_, _tmp27_);
	_tmp28_ = context;
	_tmp29_ = option_parser_header_filename;
	vala_code_context_set_header_filename (_tmp28_, _tmp29_);
	_tmp31_ = option_parser_header_filename;
	if (_tmp31_ == NULL) {
		gboolean _tmp32_ = FALSE;
		_tmp32_ = option_parser_use_header;
		_tmp30_ = _tmp32_;
	} else {
		_tmp30_ = FALSE;
	}
	if (_tmp30_) {
		vala_report_error (NULL, "--use-header may only be used in combination with --header");
	}
	_tmp33_ = context;
	_tmp34_ = option_parser_use_header;
	vala_code_context_set_use_header (_tmp33_, _tmp34_);
	_tmp35_ = context;
	_tmp36_ = option_parser_internal_header_filename;
	vala_code_context_set_internal_header_filename (_tmp35_, _tmp36_);
	_tmp37_ = context;
	_tmp38_ = option_parser_symbols_filename;
	vala_code_context_set_symbols_filename (_tmp37_, _tmp38_);
	_tmp39_ = context;
	_tmp40_ = option_parser_includedir;
	vala_code_context_set_includedir (_tmp39_, _tmp40_);
	_tmp41_ = context;
	_tmp42_ = option_parser_output;
	vala_code_context_set_output (_tmp41_, _tmp42_);
	_tmp43_ = option_parser_basedir;
	if (_tmp43_ == NULL) {
		ValaCodeContext* _tmp44_ = NULL;
		const gchar* _tmp45_ = NULL;
		_tmp44_ = context;
		_tmp45_ = wd;
		vala_code_context_set_basedir (_tmp44_, _tmp45_);
	} else {
		ValaCodeContext* _tmp46_ = NULL;
		const gchar* _tmp47_ = NULL;
		const gchar* _tmp48_ = NULL;
		gchar* _tmp49_ = NULL;
		gchar* _tmp50_ = NULL;
		_tmp46_ = context;
		_tmp47_ = wd;
		_tmp48_ = option_parser_basedir;
		_tmp49_ = option_parser_realpath (_tmp47_, _tmp48_);
		_tmp50_ = _tmp49_;
		vala_code_context_set_basedir (_tmp46_, _tmp50_);
		_g_free0 (_tmp50_);
	}
	_tmp51_ = option_parser_directory;
	if (_tmp51_ != NULL) {
		ValaCodeContext* _tmp52_ = NULL;
		const gchar* _tmp53_ = NULL;
		const gchar* _tmp54_ = NULL;
		gchar* _tmp55_ = NULL;
		gchar* _tmp56_ = NULL;
		_tmp52_ = context;
		_tmp53_ = wd;
		_tmp54_ = option_parser_directory;
		_tmp55_ = option_parser_realpath (_tmp53_, _tmp54_);
		_tmp56_ = _tmp55_;
		vala_code_context_set_directory (_tmp52_, _tmp56_);
		_g_free0 (_tmp56_);
	} else {
		ValaCodeContext* _tmp57_ = NULL;
		ValaCodeContext* _tmp58_ = NULL;
		const gchar* _tmp59_ = NULL;
		const gchar* _tmp60_ = NULL;
		_tmp57_ = context;
		_tmp58_ = context;
		_tmp59_ = vala_code_context_get_basedir (_tmp58_);
		_tmp60_ = _tmp59_;
		vala_code_context_set_directory (_tmp57_, _tmp60_);
	}
	_tmp61_ = context;
	_tmp62_ = wd;
	_tmp63_ = option_parser_vapi_directories;
	_tmp63__length1 = _vala_array_length (option_parser_vapi_directories);
	_tmp65_ = option_parser_realpaths (_tmp62_, _tmp63_, _tmp63__length1, &_tmp64_);
	_tmp61_->vapi_directories = (_vala_array_free (_tmp61_->vapi_directories, _tmp61_->vapi_directories_length1, (GDestroyNotify) g_free), NULL);
	_tmp61_->vapi_directories = _tmp65_;
	_tmp61_->vapi_directories_length1 = _tmp64_;
	_tmp66_ = context;
	_tmp67_ = wd;
	_tmp68_ = option_parser_gir_directories;
	_tmp68__length1 = _vala_array_length (option_parser_gir_directories);
	_tmp70_ = option_parser_realpaths (_tmp67_, _tmp68_, _tmp68__length1, &_tmp69_);
	_tmp66_->gir_directories = (_vala_array_free (_tmp66_->gir_directories, _tmp66_->gir_directories_length1, (GDestroyNotify) g_free), NULL);
	_tmp66_->gir_directories = _tmp70_;
	_tmp66_->gir_directories_length1 = _tmp69_;
	_tmp71_ = context;
	_tmp72_ = wd;
	_tmp73_ = option_parser_metadata_directories;
	_tmp73__length1 = _vala_array_length (option_parser_metadata_directories);
	_tmp75_ = option_parser_realpaths (_tmp72_, _tmp73_, _tmp73__length1, &_tmp74_);
	_tmp71_->metadata_directories = (_vala_array_free (_tmp71_->metadata_directories, _tmp71_->metadata_directories_length1, (GDestroyNotify) g_free), NULL);
	_tmp71_->metadata_directories = _tmp75_;
	_tmp71_->metadata_directories_length1 = _tmp74_;
	_tmp76_ = context;
	_tmp77_ = option_parser_debug;
	vala_code_context_set_debug (_tmp76_, _tmp77_);
	_tmp78_ = context;
	_tmp79_ = option_parser_thread;
	vala_code_context_set_thread (_tmp78_, _tmp79_);
	_tmp80_ = context;
	_tmp81_ = option_parser_mem_profiler;
	vala_code_context_set_mem_profiler (_tmp80_, _tmp81_);
	_tmp82_ = context;
	_tmp83_ = option_parser_save_temps;
	vala_code_context_set_save_temps (_tmp82_, _tmp83_);
	_tmp86_ = option_parser_profile;
	if (g_strcmp0 (_tmp86_, "gobject-2.0") == 0) {
		_tmp85_ = TRUE;
	} else {
		const gchar* _tmp87_ = NULL;
		_tmp87_ = option_parser_profile;
		_tmp85_ = g_strcmp0 (_tmp87_, "gobject") == 0;
	}
	if (_tmp85_) {
		_tmp84_ = TRUE;
	} else {
		const gchar* _tmp88_ = NULL;
		_tmp88_ = option_parser_profile;
		_tmp84_ = _tmp88_ == NULL;
	}
	if (_tmp84_) {
		ValaCodeContext* _tmp89_ = NULL;
		ValaCodeContext* _tmp90_ = NULL;
		_tmp89_ = context;
		vala_code_context_set_profile (_tmp89_, VALA_PROFILE_GOBJECT);
		_tmp90_ = context;
		vala_code_context_add_define (_tmp90_, "GOBJECT");
	} else {
		const gchar* _tmp91_ = NULL;
		gchar* _tmp92_ = NULL;
		gchar* _tmp93_ = NULL;
		_tmp91_ = option_parser_profile;
		_tmp92_ = g_strdup_printf ("Unknown profile %s", _tmp91_);
		_tmp93_ = _tmp92_;
		vala_report_error (NULL, _tmp93_);
		_g_free0 (_tmp93_);
	}
	_tmp94_ = option_parser_nostdpkg;
	_tmp95_ = option_parser_fast_vapi_filename;
	option_parser_nostdpkg = _tmp94_ | (_tmp95_ != NULL);
	_tmp96_ = context;
	_tmp97_ = option_parser_nostdpkg;
	vala_code_context_set_nostdpkg (_tmp96_, _tmp97_);
	_tmp98_ = context;
	_tmp99_ = option_parser_entry_point;
	vala_code_context_set_entry_point_name (_tmp98_, _tmp99_);
	_tmp100_ = context;
	_tmp101_ = option_parser_run_output;
	vala_code_context_set_run_output (_tmp100_, _tmp101_);
	_tmp102_ = option_parser_defines;
	_tmp102__length1 = _vala_array_length (option_parser_defines);
	if (_tmp102_ != NULL) {
		gchar** _tmp103_ = NULL;
		gint _tmp103__length1 = 0;
		_tmp103_ = option_parser_defines;
		_tmp103__length1 = _vala_array_length (option_parser_defines);
		{
			gchar** define_collection = NULL;
			gint define_collection_length1 = 0;
			gint _define_collection_size_ = 0;
			gint define_it = 0;
			define_collection = _tmp103_;
			define_collection_length1 = _tmp103__length1;
			for (define_it = 0; define_it < _tmp103__length1; define_it = define_it + 1) {
				gchar* _tmp104_ = NULL;
				gchar* define = NULL;
				_tmp104_ = g_strdup (define_collection[define_it]);
				define = _tmp104_;
				{
					ValaCodeContext* _tmp105_ = NULL;
					const gchar* _tmp106_ = NULL;
					_tmp105_ = context;
					_tmp106_ = define;
					vala_code_context_add_define (_tmp105_, _tmp106_);
					_g_free0 (define);
				}
			}
		}
	}
	{
		gint i = 0;
		i = 2;
		{
			gboolean _tmp107_ = FALSE;
			_tmp107_ = TRUE;
			while (TRUE) {
				gint _tmp109_ = 0;
				ValaCodeContext* _tmp110_ = NULL;
				gint _tmp111_ = 0;
				gchar* _tmp112_ = NULL;
				gchar* _tmp113_ = NULL;
				if (!_tmp107_) {
					gint _tmp108_ = 0;
					_tmp108_ = i;
					i = _tmp108_ + 2;
				}
				_tmp107_ = FALSE;
				_tmp109_ = i;
				if (!(_tmp109_ <= 24)) {
					break;
				}
				_tmp110_ = context;
				_tmp111_ = i;
				_tmp112_ = g_strdup_printf ("VALA_0_%d", _tmp111_);
				_tmp113_ = _tmp112_;
				vala_code_context_add_define (_tmp110_, _tmp113_);
				_g_free0 (_tmp113_);
			}
		}
	}
	glib_major = 2;
	glib_minor = 18;
	_tmp115_ = option_parser_target_glib;
	if (_tmp115_ != NULL) {
		const gchar* _tmp116_ = NULL;
		gint _tmp117_ = 0;
		_tmp116_ = option_parser_target_glib;
		_tmp117_ = sscanf (_tmp116_, "%d.%d", &glib_major, &glib_minor);
		_tmp114_ = _tmp117_ != 2;
	} else {
		_tmp114_ = FALSE;
	}
	if (_tmp114_) {
		vala_report_error (NULL, "Invalid format for --target-glib");
	}
	_tmp118_ = context;
	_tmp119_ = glib_major;
	vala_code_context_set_target_glib_major (_tmp118_, _tmp119_);
	_tmp120_ = context;
	_tmp121_ = glib_minor;
	vala_code_context_set_target_glib_minor (_tmp120_, _tmp121_);
	_tmp122_ = context;
	_tmp123_ = vala_code_context_get_target_glib_major (_tmp122_);
	_tmp124_ = _tmp123_;
	if (_tmp124_ != 2) {
		vala_report_error (NULL, "This version of valac only supports GLib 2");
	}
	{
		gint i = 0;
		i = 16;
		{
			gboolean _tmp125_ = FALSE;
			_tmp125_ = TRUE;
			while (TRUE) {
				gint _tmp127_ = 0;
				gint _tmp128_ = 0;
				ValaCodeContext* _tmp129_ = NULL;
				gint _tmp130_ = 0;
				gchar* _tmp131_ = NULL;
				gchar* _tmp132_ = NULL;
				if (!_tmp125_) {
					gint _tmp126_ = 0;
					_tmp126_ = i;
					i = _tmp126_ + 2;
				}
				_tmp125_ = FALSE;
				_tmp127_ = i;
				_tmp128_ = glib_minor;
				if (!(_tmp127_ <= _tmp128_)) {
					break;
				}
				_tmp129_ = context;
				_tmp130_ = i;
				_tmp131_ = g_strdup_printf ("GLIB_2_%d", _tmp130_);
				_tmp132_ = _tmp131_;
				vala_code_context_add_define (_tmp129_, _tmp132_);
				_g_free0 (_tmp132_);
			}
		}
	}
	_tmp133_ = option_parser_nostdpkg;
	if (!_tmp133_) {
		ValaCodeContext* _tmp134_ = NULL;
		ValaCodeContext* _tmp135_ = NULL;
		_tmp134_ = context;
		vala_code_context_add_external_package (_tmp134_, "glib-2.0");
		_tmp135_ = context;
		vala_code_context_add_external_package (_tmp135_, "gobject-2.0");
	}
	_tmp136_ = option_parser_packages;
	_tmp136__length1 = _vala_array_length (option_parser_packages);
	if (_tmp136_ != NULL) {
		gchar** _tmp137_ = NULL;
		gint _tmp137__length1 = 0;
		_tmp137_ = option_parser_packages;
		_tmp137__length1 = _vala_array_length (option_parser_packages);
		{
			gchar** package_collection = NULL;
			gint package_collection_length1 = 0;
			gint _package_collection_size_ = 0;
			gint package_it = 0;
			package_collection = _tmp137_;
			package_collection_length1 = _tmp137__length1;
			for (package_it = 0; package_it < _tmp137__length1; package_it = package_it + 1) {
				gchar* _tmp138_ = NULL;
				gchar* package = NULL;
				_tmp138_ = g_strdup (package_collection[package_it]);
				package = _tmp138_;
				{
					ValaCodeContext* _tmp139_ = NULL;
					const gchar* _tmp140_ = NULL;
					_tmp139_ = context;
					_tmp140_ = package;
					vala_code_context_add_external_package (_tmp139_, _tmp140_);
					_g_free0 (package);
				}
			}
		}
		option_parser_packages = (_vala_array_free (option_parser_packages, _vala_array_length (option_parser_packages), (GDestroyNotify) g_free), NULL);
		option_parser_packages = NULL;
	}
	_tmp141_ = option_parser_fast_vapis;
	_tmp141__length1 = _vala_array_length (option_parser_fast_vapis);
	if (_tmp141_ != NULL) {
		gchar** _tmp142_ = NULL;
		gint _tmp142__length1 = 0;
		ValaCodeContext* _tmp152_ = NULL;
		_tmp142_ = option_parser_fast_vapis;
		_tmp142__length1 = _vala_array_length (option_parser_fast_vapis);
		{
			gchar** vapi_collection = NULL;
			gint vapi_collection_length1 = 0;
			gint _vapi_collection_size_ = 0;
			gint vapi_it = 0;
			vapi_collection = _tmp142_;
			vapi_collection_length1 = _tmp142__length1;
			for (vapi_it = 0; vapi_it < _tmp142__length1; vapi_it = vapi_it + 1) {
				gchar* _tmp143_ = NULL;
				gchar* vapi = NULL;
				_tmp143_ = g_strdup (vapi_collection[vapi_it]);
				vapi = _tmp143_;
				{
					gchar* rpath = NULL;
					const gchar* _tmp144_ = NULL;
					const gchar* _tmp145_ = NULL;
					gchar* _tmp146_ = NULL;
					ValaSourceFile* source_file = NULL;
					ValaCodeContext* _tmp147_ = NULL;
					const gchar* _tmp148_ = NULL;
					ValaSourceFile* _tmp149_ = NULL;
					ValaCodeContext* _tmp150_ = NULL;
					ValaSourceFile* _tmp151_ = NULL;
					_tmp144_ = wd;
					_tmp145_ = vapi;
					_tmp146_ = option_parser_realpath (_tmp144_, _tmp145_);
					rpath = _tmp146_;
					_tmp147_ = context;
					_tmp148_ = rpath;
					_tmp149_ = vala_source_file_new (_tmp147_, VALA_SOURCE_FILE_TYPE_FAST, _tmp148_, NULL, FALSE);
					source_file = _tmp149_;
					_tmp150_ = context;
					_tmp151_ = source_file;
					vala_code_context_add_source_file (_tmp150_, _tmp151_);
					_vala_source_file_unref0 (source_file);
					_g_free0 (rpath);
					_g_free0 (vapi);
				}
			}
		}
		_tmp152_ = context;
		vala_code_context_set_use_fast_vapi (_tmp152_, TRUE);
	}
	_tmp153_ = option_parser_fatal_warnings;
	_tmp154_ = context;
	_tmp155_ = _vala_code_context_ref0 (_tmp154_);
	memset (&_tmp156_, 0, sizeof (ParserOptions));
	_tmp156_.fatal_warnings = _tmp153_;
	_vala_code_context_unref0 (_tmp156_.context);
	_tmp156_.context = _tmp155_;
	*result = _tmp156_;
	return;
}


gchar** option_parser_real_sources (const gchar* wd, int* result_length1) {
	gchar** result = NULL;
	const gchar* _tmp0_ = NULL;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gint _tmp2_ = 0;
	gchar** _tmp3_ = NULL;
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	g_return_val_if_fail (wd != NULL, NULL);
	_tmp0_ = wd;
	_tmp1_ = option_parser_sources;
	_tmp1__length1 = _vala_array_length (option_parser_sources);
	_tmp3_ = option_parser_realpaths (_tmp0_, _tmp1_, _tmp1__length1, &_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp4__length1 = _tmp2_;
	if (result_length1) {
		*result_length1 = _tmp4__length1;
	}
	result = _tmp4_;
	return result;
}


static gchar** option_parser_realpaths (const gchar* wd, gchar** paths, int paths_length1, int* result_length1) {
	gchar** result = NULL;
	gchar** ret = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint ret_length1 = 0;
	gint _ret_size_ = 0;
	gchar** _tmp14_ = NULL;
	gint _tmp14__length1 = 0;
	g_return_val_if_fail (wd != NULL, NULL);
	_tmp0_ = paths;
	_tmp0__length1 = paths_length1;
	_tmp1_ = g_new0 (gchar*, _tmp0__length1 + 1);
	ret = _tmp1_;
	ret_length1 = _tmp0__length1;
	_ret_size_ = ret_length1;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_ = 0;
				gchar** _tmp5_ = NULL;
				gint _tmp5__length1 = 0;
				gchar** _tmp6_ = NULL;
				gint _tmp6__length1 = 0;
				gint _tmp7_ = 0;
				const gchar* _tmp8_ = NULL;
				gchar** _tmp9_ = NULL;
				gint _tmp9__length1 = 0;
				gint _tmp10_ = 0;
				const gchar* _tmp11_ = NULL;
				gchar* _tmp12_ = NULL;
				gchar* _tmp13_ = NULL;
				if (!_tmp2_) {
					gint _tmp3_ = 0;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				_tmp5_ = paths;
				_tmp5__length1 = paths_length1;
				if (!(_tmp4_ < _tmp5__length1)) {
					break;
				}
				_tmp6_ = ret;
				_tmp6__length1 = ret_length1;
				_tmp7_ = i;
				_tmp8_ = wd;
				_tmp9_ = paths;
				_tmp9__length1 = paths_length1;
				_tmp10_ = i;
				_tmp11_ = _tmp9_[_tmp10_];
				_tmp12_ = option_parser_realpath (_tmp8_, _tmp11_);
				_g_free0 (_tmp6_[_tmp7_]);
				_tmp6_[_tmp7_] = _tmp12_;
				_tmp13_ = _tmp6_[_tmp7_];
			}
		}
	}
	_tmp14_ = ret;
	_tmp14__length1 = ret_length1;
	if (result_length1) {
		*result_length1 = _tmp14__length1;
	}
	result = _tmp14_;
	return result;
}


static gchar* option_parser_realpath (const gchar* wd, const gchar* path) {
	gchar* result = NULL;
	gchar* rpath = NULL;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp7_ = NULL;
	GFile* _tmp8_ = NULL;
	GFile* _tmp9_ = NULL;
	gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	g_return_val_if_fail (wd != NULL, NULL);
	g_return_val_if_fail (path != NULL, NULL);
	_tmp0_ = path;
	_tmp1_ = g_strdup (_tmp0_);
	rpath = _tmp1_;
	_tmp2_ = path;
	_tmp3_ = g_path_is_absolute (_tmp2_);
	if (!_tmp3_) {
		const gchar* _tmp4_ = NULL;
		const gchar* _tmp5_ = NULL;
		gchar* _tmp6_ = NULL;
		_tmp4_ = wd;
		_tmp5_ = rpath;
		_tmp6_ = g_build_filename (_tmp4_, _tmp5_, NULL);
		_g_free0 (rpath);
		rpath = _tmp6_;
	}
	_tmp7_ = rpath;
	_tmp8_ = g_file_new_for_path (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_file_get_path (_tmp9_);
	_tmp11_ = _tmp10_;
	_g_object_unref0 (_tmp9_);
	result = _tmp11_;
	_g_free0 (rpath);
	return result;
}


static void option_parser_clear (void) {
	_g_free0 (option_parser_basedir);
	option_parser_basedir = NULL;
	_g_free0 (option_parser_directory);
	option_parser_directory = NULL;
	option_parser_version = FALSE;
	option_parser_api_version = FALSE;
	option_parser_sources = (_vala_array_free (option_parser_sources, _vala_array_length (option_parser_sources), (GDestroyNotify) g_free), NULL);
	option_parser_sources = NULL;
	option_parser_vapi_directories = (_vala_array_free (option_parser_vapi_directories, _vala_array_length (option_parser_vapi_directories), (GDestroyNotify) g_free), NULL);
	option_parser_vapi_directories = NULL;
	option_parser_gir_directories = (_vala_array_free (option_parser_gir_directories, _vala_array_length (option_parser_gir_directories), (GDestroyNotify) g_free), NULL);
	option_parser_gir_directories = NULL;
	option_parser_metadata_directories = (_vala_array_free (option_parser_metadata_directories, _vala_array_length (option_parser_metadata_directories), (GDestroyNotify) g_free), NULL);
	option_parser_metadata_directories = NULL;
	_g_free0 (option_parser_vapi_filename);
	option_parser_vapi_filename = NULL;
	_g_free0 (option_parser_library);
	option_parser_library = NULL;
	_g_free0 (option_parser_gir);
	option_parser_gir = NULL;
	option_parser_packages = (_vala_array_free (option_parser_packages, _vala_array_length (option_parser_packages), (GDestroyNotify) g_free), NULL);
	option_parser_packages = NULL;
	option_parser_fast_vapis = (_vala_array_free (option_parser_fast_vapis, _vala_array_length (option_parser_fast_vapis), (GDestroyNotify) g_free), NULL);
	option_parser_fast_vapis = NULL;
	_g_free0 (option_parser_target_glib);
	option_parser_target_glib = NULL;
	option_parser_gresources = (_vala_array_free (option_parser_gresources, _vala_array_length (option_parser_gresources), (GDestroyNotify) g_free), NULL);
	option_parser_gresources = NULL;
	option_parser_ccode_only = FALSE;
	_g_free0 (option_parser_header_filename);
	option_parser_header_filename = NULL;
	option_parser_use_header = FALSE;
	_g_free0 (option_parser_internal_header_filename);
	option_parser_internal_header_filename = NULL;
	_g_free0 (option_parser_internal_vapi_filename);
	option_parser_internal_vapi_filename = NULL;
	_g_free0 (option_parser_fast_vapi_filename);
	option_parser_fast_vapi_filename = NULL;
	_g_free0 (option_parser_symbols_filename);
	option_parser_symbols_filename = NULL;
	_g_free0 (option_parser_includedir);
	option_parser_includedir = NULL;
	option_parser_compile_only = FALSE;
	_g_free0 (option_parser_output);
	option_parser_output = NULL;
	option_parser_debug = FALSE;
	option_parser_thread = FALSE;
	option_parser_mem_profiler = FALSE;
	option_parser_disable_assert = FALSE;
	option_parser_enable_checking = FALSE;
	option_parser_deprecated = FALSE;
	option_parser_experimental = FALSE;
	option_parser_experimental_non_null = FALSE;
	option_parser_gobject_tracing = FALSE;
	option_parser_disable_warnings = FALSE;
	_g_free0 (option_parser_cc_command);
	option_parser_cc_command = NULL;
	option_parser_cc_options = (_vala_array_free (option_parser_cc_options, _vala_array_length (option_parser_cc_options), (GDestroyNotify) g_free), NULL);
	option_parser_cc_options = NULL;
	_g_free0 (option_parser_dump_tree);
	option_parser_dump_tree = NULL;
	option_parser_save_temps = FALSE;
	option_parser_defines = (_vala_array_free (option_parser_defines, _vala_array_length (option_parser_defines), (GDestroyNotify) g_free), NULL);
	option_parser_defines = NULL;
	option_parser_quiet_mode = FALSE;
	option_parser_verbose_mode = FALSE;
	_g_free0 (option_parser_profile);
	option_parser_profile = NULL;
	option_parser_nostdpkg = FALSE;
	option_parser_enable_version_header = FALSE;
	option_parser_disable_version_header = FALSE;
	option_parser_fatal_warnings = FALSE;
	_g_free0 (option_parser_dependencies);
	option_parser_dependencies = NULL;
	_g_free0 (option_parser_entry_point);
	option_parser_entry_point = NULL;
	option_parser_run_output = FALSE;
}


static gchar** _vala_array_dup1 (gchar** self, int length) {
	gchar** result;
	int i;
	result = g_new0 (gchar*, length + 1);
	for (i = 0; i < length; i++) {
		gchar* _tmp0_ = NULL;
		_tmp0_ = g_strdup (self[i]);
		result[i] = _tmp0_;
	}
	return result;
}


static gchar* _vala_g_strjoinv (const gchar* separator, gchar** str_array, int str_array_length1) {
	gchar* result = NULL;
	const gchar* _tmp0_ = NULL;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	gchar** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	_tmp0_ = separator;
	if (_tmp0_ == NULL) {
		separator = "";
	}
	_tmp3_ = str_array;
	_tmp3__length1 = str_array_length1;
	if (_tmp3_ != NULL) {
		_tmp2_ = TRUE;
	} else {
		gchar** _tmp4_ = NULL;
		gint _tmp4__length1 = 0;
		_tmp4_ = str_array;
		_tmp4__length1 = str_array_length1;
		_tmp2_ = _tmp4__length1 > 0;
	}
	if (_tmp2_) {
		_tmp1_ = TRUE;
	} else {
		gboolean _tmp5_ = FALSE;
		gchar** _tmp6_ = NULL;
		gint _tmp6__length1 = 0;
		_tmp6_ = str_array;
		_tmp6__length1 = str_array_length1;
		if (_tmp6__length1 == (-1)) {
			gchar** _tmp7_ = NULL;
			gint _tmp7__length1 = 0;
			const gchar* _tmp8_ = NULL;
			_tmp7_ = str_array;
			_tmp7__length1 = str_array_length1;
			_tmp8_ = _tmp7_[0];
			_tmp5_ = _tmp8_ != NULL;
		} else {
			_tmp5_ = FALSE;
		}
		_tmp1_ = _tmp5_;
	}
	if (_tmp1_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp31_ = 0;
		gint _tmp33_ = 0;
		gint _tmp34_ = 0;
		gsize _tmp35_ = 0UL;
		const gchar* _tmp36_ = NULL;
		gint _tmp37_ = 0;
		gint _tmp38_ = 0;
		gint _tmp39_ = 0;
		const gchar* res = NULL;
		gsize _tmp40_ = 0UL;
		void* _tmp41_ = NULL;
		void* ptr = NULL;
		const gchar* _tmp42_ = NULL;
		gchar** _tmp43_ = NULL;
		gint _tmp43__length1 = 0;
		const gchar* _tmp44_ = NULL;
		void* _tmp45_ = NULL;
		const gchar* _tmp62_ = NULL;
		len = (gsize) 1;
		{
			gboolean _tmp9_ = FALSE;
			i = 0;
			_tmp9_ = TRUE;
			while (TRUE) {
				gboolean _tmp11_ = FALSE;
				gboolean _tmp12_ = FALSE;
				gchar** _tmp13_ = NULL;
				gint _tmp13__length1 = 0;
				gint _tmp21_ = 0;
				gchar** _tmp22_ = NULL;
				gint _tmp22__length1 = 0;
				gint _tmp23_ = 0;
				const gchar* _tmp24_ = NULL;
				gsize _tmp30_ = 0UL;
				if (!_tmp9_) {
					gint _tmp10_ = 0;
					_tmp10_ = i;
					i = _tmp10_ + 1;
				}
				_tmp9_ = FALSE;
				_tmp13_ = str_array;
				_tmp13__length1 = str_array_length1;
				if (_tmp13__length1 != (-1)) {
					gint _tmp14_ = 0;
					gchar** _tmp15_ = NULL;
					gint _tmp15__length1 = 0;
					_tmp14_ = i;
					_tmp15_ = str_array;
					_tmp15__length1 = str_array_length1;
					_tmp12_ = _tmp14_ < _tmp15__length1;
				} else {
					_tmp12_ = FALSE;
				}
				if (_tmp12_) {
					_tmp11_ = TRUE;
				} else {
					gboolean _tmp16_ = FALSE;
					gchar** _tmp17_ = NULL;
					gint _tmp17__length1 = 0;
					_tmp17_ = str_array;
					_tmp17__length1 = str_array_length1;
					if (_tmp17__length1 == (-1)) {
						gchar** _tmp18_ = NULL;
						gint _tmp18__length1 = 0;
						gint _tmp19_ = 0;
						const gchar* _tmp20_ = NULL;
						_tmp18_ = str_array;
						_tmp18__length1 = str_array_length1;
						_tmp19_ = i;
						_tmp20_ = _tmp18_[_tmp19_];
						_tmp16_ = _tmp20_ != NULL;
					} else {
						_tmp16_ = FALSE;
					}
					_tmp11_ = _tmp16_;
				}
				if (!_tmp11_) {
					break;
				}
				_tmp22_ = str_array;
				_tmp22__length1 = str_array_length1;
				_tmp23_ = i;
				_tmp24_ = _tmp22_[_tmp23_];
				if (_tmp24_ != NULL) {
					gchar** _tmp25_ = NULL;
					gint _tmp25__length1 = 0;
					gint _tmp26_ = 0;
					const gchar* _tmp27_ = NULL;
					gint _tmp28_ = 0;
					gint _tmp29_ = 0;
					_tmp25_ = str_array;
					_tmp25__length1 = str_array_length1;
					_tmp26_ = i;
					_tmp27_ = _tmp25_[_tmp26_];
					_tmp28_ = strlen ((const gchar*) _tmp27_);
					_tmp29_ = _tmp28_;
					_tmp21_ = _tmp29_;
				} else {
					_tmp21_ = 0;
				}
				_tmp30_ = len;
				len = _tmp30_ + _tmp21_;
			}
		}
		_tmp31_ = i;
		if (_tmp31_ == 0) {
			gchar* _tmp32_ = NULL;
			_tmp32_ = g_strdup ("");
			result = _tmp32_;
			return result;
		}
		_tmp33_ = i;
		str_array_length1 = _tmp33_;
		_tmp34_ = str_array_length1;
		_tmp35_ = len;
		_tmp36_ = separator;
		_tmp37_ = strlen ((const gchar*) _tmp36_);
		_tmp38_ = _tmp37_;
		_tmp39_ = i;
		len = _tmp35_ + (_tmp38_ * (_tmp39_ - 1));
		_tmp40_ = len;
		_tmp41_ = g_malloc (_tmp40_);
		res = _tmp41_;
		_tmp42_ = res;
		_tmp43_ = str_array;
		_tmp43__length1 = str_array_length1;
		_tmp44_ = _tmp43_[0];
		_tmp45_ = g_stpcpy ((void*) _tmp42_, (const gchar*) _tmp44_);
		ptr = _tmp45_;
		{
			gboolean _tmp46_ = FALSE;
			i = 1;
			_tmp46_ = TRUE;
			while (TRUE) {
				gint _tmp48_ = 0;
				gchar** _tmp49_ = NULL;
				gint _tmp49__length1 = 0;
				void* _tmp50_ = NULL;
				const gchar* _tmp51_ = NULL;
				void* _tmp52_ = NULL;
				const gchar* _tmp53_ = NULL;
				gchar** _tmp54_ = NULL;
				gint _tmp54__length1 = 0;
				gint _tmp55_ = 0;
				const gchar* _tmp56_ = NULL;
				void* _tmp60_ = NULL;
				void* _tmp61_ = NULL;
				if (!_tmp46_) {
					gint _tmp47_ = 0;
					_tmp47_ = i;
					i = _tmp47_ + 1;
				}
				_tmp46_ = FALSE;
				_tmp48_ = i;
				_tmp49_ = str_array;
				_tmp49__length1 = str_array_length1;
				if (!(_tmp48_ < _tmp49__length1)) {
					break;
				}
				_tmp50_ = ptr;
				_tmp51_ = separator;
				_tmp52_ = g_stpcpy (_tmp50_, (const gchar*) _tmp51_);
				ptr = _tmp52_;
				_tmp54_ = str_array;
				_tmp54__length1 = str_array_length1;
				_tmp55_ = i;
				_tmp56_ = _tmp54_[_tmp55_];
				if (_tmp56_ != NULL) {
					gchar** _tmp57_ = NULL;
					gint _tmp57__length1 = 0;
					gint _tmp58_ = 0;
					const gchar* _tmp59_ = NULL;
					_tmp57_ = str_array;
					_tmp57__length1 = str_array_length1;
					_tmp58_ = i;
					_tmp59_ = _tmp57_[_tmp58_];
					_tmp53_ = (const gchar*) _tmp59_;
				} else {
					_tmp53_ = "";
				}
				_tmp60_ = ptr;
				_tmp61_ = g_stpcpy (_tmp60_, _tmp53_);
				ptr = _tmp61_;
			}
		}
		_tmp62_ = res;
		res = NULL;
		result = (gchar*) _tmp62_;
		return result;
	} else {
		gchar* _tmp63_ = NULL;
		_tmp63_ = g_strdup ("");
		result = _tmp63_;
		return result;
	}
}


gboolean option_parser_parse (gchar** args, int args_length1) {
	gboolean result = FALSE;
	gchar** myargs = NULL;
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	gchar** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	gint myargs_length1 = 0;
	gint _myargs_size_ = 0;
	GError * _inner_error_ = NULL;
	_tmp0_ = args;
	_tmp0__length1 = args_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup1 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	myargs = _tmp1_;
	myargs_length1 = _tmp1__length1;
	_myargs_size_ = myargs_length1;
	{
		gchar** unargs = NULL;
		gchar** _tmp2_ = NULL;
		gint _tmp2__length1 = 0;
		gint unargs_length1 = 0;
		gint _unargs_size_ = 0;
		GOptionContext* opt_context = NULL;
		GOptionContext* _tmp3_ = NULL;
		GOptionContext* _tmp4_ = NULL;
		GOptionContext* _tmp5_ = NULL;
		GOptionContext* _tmp6_ = NULL;
		GOptionContext* _tmp7_ = NULL;
		_tmp2_ = myargs;
		_tmp2__length1 = myargs_length1;
		unargs = _tmp2_;
		unargs_length1 = _tmp2__length1;
		_unargs_size_ = unargs_length1;
		option_parser_clear ();
		_tmp3_ = g_option_context_new ("- Vala Compiler");
		opt_context = _tmp3_;
		_tmp4_ = opt_context;
		g_option_context_set_help_enabled (_tmp4_, FALSE);
		_tmp5_ = opt_context;
		g_option_context_add_main_entries (_tmp5_, OPTION_PARSER_options, NULL);
		_tmp6_ = opt_context;
		g_option_context_set_ignore_unknown_options (_tmp6_, TRUE);
		_tmp7_ = opt_context;
		g_option_context_parse (_tmp7_, &unargs_length1, &unargs, &_inner_error_);
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_option_context_free0 (opt_context);
			goto __catch0_g_error;
		}
		_g_option_context_free0 (opt_context);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		gchar** _tmp8_ = NULL;
		gint _tmp8__length1 = 0;
		gchar* _tmp9_ = NULL;
		gchar* _tmp10_ = NULL;
		GError* _tmp11_ = NULL;
		const gchar* _tmp12_ = NULL;
		e = _inner_error_;
		_inner_error_ = NULL;
		_tmp8_ = args;
		_tmp8__length1 = args_length1;
		_tmp9_ = _vala_g_strjoinv (", ", _tmp8_, _tmp8__length1);
		_tmp10_ = _tmp9_;
		_tmp11_ = e;
		_tmp12_ = _tmp11_->message;
		g_log ("GcaVala", G_LOG_LEVEL_WARNING, "valaoptionparser.vala:359: Failed to parse flags `%s': %s", _tmp10_, _tmp12_);
		_g_free0 (_tmp10_);
		option_parser_clear ();
		result = FALSE;
		_g_error_free0 (e);
		myargs = (_vala_array_free (myargs, myargs_length1, (GDestroyNotify) g_free), NULL);
		return result;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		myargs = (_vala_array_free (myargs, myargs_length1, (GDestroyNotify) g_free), NULL);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return FALSE;
	}
	result = TRUE;
	myargs = (_vala_array_free (myargs, myargs_length1, (GDestroyNotify) g_free), NULL);
	return result;
}


void option_parser_parse_and_apply (const gchar* wd, gchar** args, int args_length1, ParserOptions* result) {
	gchar** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	ValaCodeContext* context = NULL;
	ValaCodeContext* _tmp1_ = NULL;
	Diagnostics* _tmp2_ = NULL;
	Diagnostics* _tmp3_ = NULL;
	ParserOptions ret = {0};
	gchar** _tmp4_ = NULL;
	gint _tmp4__length1 = 0;
	const gchar* _tmp5_ = NULL;
	ParserOptions _tmp6_ = {0};
	g_return_if_fail (wd != NULL);
	_tmp0_ = args;
	_tmp0__length1 = args_length1;
	option_parser_parse (_tmp0_, _tmp0__length1);
	_tmp1_ = vala_code_context_new ();
	context = _tmp1_;
	_tmp2_ = diagnostics_new ();
	_tmp3_ = _tmp2_;
	vala_code_context_set_report (context, (ValaReport*) _tmp3_);
	_g_object_unref0 (_tmp3_);
	vala_code_context_push (context);
	_tmp4_ = args;
	_tmp4__length1 = args_length1;
	_tmp5_ = wd;
	option_parser_apply (context, _tmp4_, _tmp4__length1, _tmp5_, &_tmp6_);
	ret = _tmp6_;
	vala_code_context_pop ();
	*result = ret;
	_vala_code_context_unref0 (context);
	return;
}


OptionParser* option_parser_construct (GType object_type) {
	OptionParser* self = NULL;
	self = (OptionParser*) g_type_create_instance (object_type);
	return self;
}


OptionParser* option_parser_new (void) {
	return option_parser_construct (TYPE_OPTION_PARSER);
}


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


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


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


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


static gchar* value_option_parser_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	if (collect_values[0].v_pointer) {
		OptionParser* 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 = option_parser_ref (object);
	} else {
		value->data[0].v_pointer = NULL;
	}
	return NULL;
}


static gchar* value_option_parser_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
	OptionParser** 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 = option_parser_ref (value->data[0].v_pointer);
	}
	return NULL;
}


GParamSpec* param_spec_option_parser (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
	ParamSpecOptionParser* spec;
	g_return_val_if_fail (g_type_is_a (object_type, TYPE_OPTION_PARSER), 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);
}


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


void value_set_option_parser (GValue* value, gpointer v_object) {
	OptionParser* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OPTION_PARSER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_OPTION_PARSER));
		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;
		option_parser_ref (value->data[0].v_pointer);
	} else {
		value->data[0].v_pointer = NULL;
	}
	if (old) {
		option_parser_unref (old);
	}
}


void value_take_option_parser (GValue* value, gpointer v_object) {
	OptionParser* old;
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_OPTION_PARSER));
	old = value->data[0].v_pointer;
	if (v_object) {
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_OPTION_PARSER));
		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) {
		option_parser_unref (old);
	}
}


static void option_parser_class_init (OptionParserClass * klass) {
	option_parser_parent_class = g_type_class_peek_parent (klass);
	((OptionParserClass *) klass)->finalize = option_parser_finalize;
}


static void option_parser_instance_init (OptionParser * self) {
	self->ref_count = 1;
}


static void option_parser_finalize (OptionParser* obj) {
	OptionParser * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_OPTION_PARSER, OptionParser);
	g_signal_handlers_destroy (self);
}


GType option_parser_get_type (void) {
	static volatile gsize option_parser_type_id__volatile = 0;
	if (g_once_init_enter (&option_parser_type_id__volatile)) {
		static const GTypeValueTable g_define_type_value_table = { value_option_parser_init, value_option_parser_free_value, value_option_parser_copy_value, value_option_parser_peek_pointer, "p", value_option_parser_collect_value, "p", value_option_parser_lcopy_value };
		static const GTypeInfo g_define_type_info = { sizeof (OptionParserClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) option_parser_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (OptionParser), 0, (GInstanceInitFunc) option_parser_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 option_parser_type_id;
		option_parser_type_id = g_type_register_fundamental (g_type_fundamental_next (), "OptionParser", &g_define_type_info, &g_define_type_fundamental_info, 0);
		g_once_init_leave (&option_parser_type_id__volatile, option_parser_type_id);
	}
	return option_parser_type_id__volatile;
}


gpointer option_parser_ref (gpointer instance) {
	OptionParser* self;
	self = instance;
	g_atomic_int_inc (&self->ref_count);
	return instance;
}


void option_parser_unref (gpointer instance) {
	OptionParser* self;
	self = instance;
	if (g_atomic_int_dec_and_test (&self->ref_count)) {
		OPTION_PARSER_GET_CLASS (self)->finalize (self);
		g_type_free_instance ((GTypeInstance *) self);
	}
}


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


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


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



