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

#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <stdio.h>
#include <gee.h>
#include <glib-object.h>
#include <glib/gstdio.h>
#include <valaphp-runtime-embed-0.01.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
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TYPE_PHP_TO_VALA_COMPOSER_LIBRARY (php_to_vala_composer_library_get_type ())
#define PHP_TO_VALA_COMPOSER_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHP_TO_VALA_COMPOSER_LIBRARY, PhpToValaComposerLibrary))
#define PHP_TO_VALA_COMPOSER_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHP_TO_VALA_COMPOSER_LIBRARY, PhpToValaComposerLibraryClass))
#define IS_PHP_TO_VALA_COMPOSER_LIBRARY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHP_TO_VALA_COMPOSER_LIBRARY))
#define IS_PHP_TO_VALA_COMPOSER_LIBRARY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHP_TO_VALA_COMPOSER_LIBRARY))
#define PHP_TO_VALA_COMPOSER_LIBRARY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHP_TO_VALA_COMPOSER_LIBRARY, PhpToValaComposerLibraryClass))

typedef struct _PhpToValaComposerLibrary PhpToValaComposerLibrary;
typedef struct _PhpToValaComposerLibraryClass PhpToValaComposerLibraryClass;
typedef struct _PhpToValaComposerLibraryPrivate PhpToValaComposerLibraryPrivate;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TYPE_PHP_TO_VALA_ERROR (php_to_vala_error_get_type ())

#define TYPE_PHP_TO_VALA_TRANSPILER (php_to_vala_transpiler_get_type ())
#define PHP_TO_VALA_TRANSPILER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHP_TO_VALA_TRANSPILER, PhpToValaTranspiler))
#define PHP_TO_VALA_TRANSPILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHP_TO_VALA_TRANSPILER, PhpToValaTranspilerClass))
#define IS_PHP_TO_VALA_TRANSPILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHP_TO_VALA_TRANSPILER))
#define IS_PHP_TO_VALA_TRANSPILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHP_TO_VALA_TRANSPILER))
#define PHP_TO_VALA_TRANSPILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHP_TO_VALA_TRANSPILER, PhpToValaTranspilerClass))

typedef struct _PhpToValaTranspiler PhpToValaTranspiler;
typedef struct _PhpToValaTranspilerClass PhpToValaTranspilerClass;

struct _PhpToValaComposerLibrary {
	GObject parent_instance;
	PhpToValaComposerLibraryPrivate * priv;
	gchar* vala_source;
	gchar* stub_source;
};

struct _PhpToValaComposerLibraryClass {
	GObjectClass parent_class;
};

typedef enum  {
	PHP_TO_VALA_ERROR_UNSUPPORTED
} PhpToValaError;
#define PHP_TO_VALA_ERROR php_to_vala_error_quark ()

VALA_EXTERN gchar* default_output_path (const gchar* input_path);
VALA_EXTERN void print_usage (const gchar* program_name,
                  FILE* stream);
static gint _vala_main (gchar** args,
                 gint args_length1);
VALA_EXTERN GType php_to_vala_composer_library_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhpToValaComposerLibrary, g_object_unref)
VALA_EXTERN PhpToValaComposerLibrary* php_to_vala_composer_library_generate (const gchar* composer_json_path,
                                                                 GError** error);
VALA_EXTERN GQuark php_to_vala_error_quark (void);
VALA_EXTERN GType php_to_vala_error_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType php_to_vala_transpiler_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhpToValaTranspiler, g_object_unref)
VALA_EXTERN PhpToValaTranspiler* php_to_vala_transpiler_new (const gchar* source_path,
                                                 gboolean optimize_local_vars,
                                                 gboolean optimize_file_func_vars,
                                                 const gchar* runtime_name,
                                                 const gchar* output_mode,
                                                 GError** error);
VALA_EXTERN PhpToValaTranspiler* php_to_vala_transpiler_construct (GType object_type,
                                                       const gchar* source_path,
                                                       gboolean optimize_local_vars,
                                                       gboolean optimize_file_func_vars,
                                                       const gchar* runtime_name,
                                                       const gchar* output_mode,
                                                       GError** error);
VALA_EXTERN void php_to_vala_transpiler_load_php_stub_file (PhpToValaTranspiler* self,
                                                const gchar* stub_path,
                                                GError** error);
VALA_EXTERN gchar* php_to_vala_transpiler_transpile (PhpToValaTranspiler* self,
                                         const gchar* php_source,
                                         GError** error);
VALA_EXTERN gchar* php_to_vala_transpiler_build_php_stub (PhpToValaTranspiler* self,
                                              GError** error);

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
#line 1501 "glib-2.0.vapi"
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
#line 1501 "glib-2.0.vapi"
	end = _tmp0_;
#line 1502 "glib-2.0.vapi"
	_tmp1_ = end;
#line 1502 "glib-2.0.vapi"
	if (_tmp1_ == NULL) {
#line 1503 "glib-2.0.vapi"
		result = maxlen;
#line 1503 "glib-2.0.vapi"
		return result;
#line 130 "cli.c"
	} else {
		gchar* _tmp2_;
#line 1505 "glib-2.0.vapi"
		_tmp2_ = end;
#line 1505 "glib-2.0.vapi"
		result = (glong) (_tmp2_ - str);
#line 1505 "glib-2.0.vapi"
		return result;
#line 139 "cli.c"
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
#line 1512 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1514 "glib-2.0.vapi"
	if (offset >= ((glong) 0)) {
#line 1514 "glib-2.0.vapi"
		_tmp0_ = len >= ((glong) 0);
#line 158 "cli.c"
	} else {
#line 1514 "glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 162 "cli.c"
	}
#line 1514 "glib-2.0.vapi"
	if (_tmp0_) {
#line 1516 "glib-2.0.vapi"
		string_length = string_strnlen ((gchar*) self, offset + len);
#line 168 "cli.c"
	} else {
		gint _tmp1_;
		gint _tmp2_;
#line 1518 "glib-2.0.vapi"
		_tmp1_ = strlen (self);
#line 1518 "glib-2.0.vapi"
		_tmp2_ = _tmp1_;
#line 1518 "glib-2.0.vapi"
		string_length = (glong) _tmp2_;
#line 178 "cli.c"
	}
#line 1521 "glib-2.0.vapi"
	if (offset < ((glong) 0)) {
#line 1522 "glib-2.0.vapi"
		offset = string_length + offset;
#line 1523 "glib-2.0.vapi"
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
#line 186 "cli.c"
	} else {
#line 1525 "glib-2.0.vapi"
		g_return_val_if_fail (offset <= string_length, NULL);
#line 190 "cli.c"
	}
#line 1527 "glib-2.0.vapi"
	if (len < ((glong) 0)) {
#line 1528 "glib-2.0.vapi"
		len = string_length - offset;
#line 196 "cli.c"
	}
#line 1530 "glib-2.0.vapi"
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
#line 1531 "glib-2.0.vapi"
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
#line 1531 "glib-2.0.vapi"
	result = _tmp3_;
#line 1531 "glib-2.0.vapi"
	return result;
#line 206 "cli.c"
}

gchar*
default_output_path (const gchar* input_path)
{
	gchar* _tmp6_;
	gchar* result;
#line 3 "../src/cli.vala"
	g_return_val_if_fail (input_path != NULL, NULL);
#line 4 "../src/cli.vala"
	if (g_str_has_suffix (input_path, ".php")) {
#line 218 "cli.c"
		gint _tmp0_;
		gint _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
#line 5 "../src/cli.vala"
		_tmp0_ = strlen (input_path);
#line 5 "../src/cli.vala"
		_tmp1_ = _tmp0_;
#line 5 "../src/cli.vala"
		_tmp2_ = string_substring (input_path, (glong) 0, (glong) (_tmp1_ - 4));
#line 5 "../src/cli.vala"
		_tmp3_ = _tmp2_;
#line 5 "../src/cli.vala"
		_tmp4_ = g_strconcat (_tmp3_, ".vala", NULL);
#line 5 "../src/cli.vala"
		_tmp5_ = _tmp4_;
#line 5 "../src/cli.vala"
		_g_free0 (_tmp3_);
#line 5 "../src/cli.vala"
		result = _tmp5_;
#line 5 "../src/cli.vala"
		return result;
#line 243 "cli.c"
	}
#line 7 "../src/cli.vala"
	_tmp6_ = g_strconcat (input_path, ".vala", NULL);
#line 7 "../src/cli.vala"
	result = _tmp6_;
#line 7 "../src/cli.vala"
	return result;
#line 251 "cli.c"
}

void
print_usage (const gchar* program_name,
             FILE* stream)
{
#line 10 "../src/cli.vala"
	g_return_if_fail (program_name != NULL);
#line 10 "../src/cli.vala"
	g_return_if_fail (stream != NULL);
#line 11 "../src/cli.vala"
	fprintf (stream, "Usage: %s [--composer-library composer.json|--executable|--library] [-" \
"-php-stub path.stub.php] [--php-stub-out path.stub.php] [--embed-runti" \
"me|--native-runtime|--both-runtimes] [--optimize-local-vars|--optimize" \
"-file-func-vars] [--no-syntax-check] input.php [output.vala]\n", program_name);
#line 12 "../src/cli.vala"
	fprintf (stream, "\n");
#line 13 "../src/cli.vala"
	fprintf (stream, "Output options:\n");
#line 14 "../src/cli.vala"
	fprintf (stream, "  --executable       Generate executable output with public main() (de" \
"fault); requires top-level main commands\n");
#line 15 "../src/cli.vala"
	fprintf (stream, "  --library          Generate library output without public main(); re" \
"jects top-level main commands\n");
#line 16 "../src/cli.vala"
	fprintf (stream, "  --php-stub FILE    Load declarative PHP stub for external classes/fu" \
"nctions\n");
#line 17 "../src/cli.vala"
	fprintf (stream, "  --php-stub-out FILE  Write declarative PHP stub beside generated Val" \
"a output\n");
#line 18 "../src/cli.vala"
	fprintf (stream, "  --composer-library FILE  Generate a Composer PSR-4 library skeleton " \
"from composer.json\n");
#line 19 "../src/cli.vala"
	fprintf (stream, "\n");
#line 20 "../src/cli.vala"
	fprintf (stream, "Runtime options:\n");
#line 21 "../src/cli.vala"
	fprintf (stream, "  --embed-runtime     Use only valaphp-runtime-embed for PHP helpers\n");
#line 22 "../src/cli.vala"
	fprintf (stream, "  --native-runtime    Use only native runtime modules; missing native " \
"helpers are errors\n");
#line 23 "../src/cli.vala"
	fprintf (stream, "  --both-runtimes     Prefer native runtime modules, then use embed fa" \
"llback for missing helpers (default)\n");
#line 24 "../src/cli.vala"
	fprintf (stream, "\n");
#line 25 "../src/cli.vala"
	fprintf (stream, "Optimizer options:\n");
#line 26 "../src/cli.vala"
	fprintf (stream, "  --no-optimize-local-vars       Disable local/file function variable " \
"typing\n");
#line 27 "../src/cli.vala"
	fprintf (stream, "  --optimize-local-vars          Enable per-function local variable ty" \
"ping only\n");
#line 28 "../src/cli.vala"
	fprintf (stream, "  --optimize-file-func-vars      Enable whole-file local function typi" \
"ng; also enables local vars (default)\n");
#line 298 "cli.c"
}

static gint
_vala_main (gchar** args,
            gint args_length1)
{
	gchar* runtime_name = NULL;
	gchar* _tmp2_;
	gchar* output_mode = NULL;
	gchar* _tmp3_;
	GeeArrayList* php_stub_paths = NULL;
	GeeArrayList* _tmp4_;
	gchar* php_stub_out_path = NULL;
	gchar* composer_library_path = NULL;
	gboolean optimize_local_vars = FALSE;
	gboolean optimize_file_func_vars = FALSE;
	gboolean syntax_check = FALSE;
	gint arg_index = 0;
	const gchar* _tmp47_;
	gboolean _tmp66_ = FALSE;
	gchar* input_path = NULL;
	const gchar* _tmp69_;
	gchar* _tmp70_;
	gchar* _tmp71_ = NULL;
	gchar* output_path = NULL;
	gchar* _tmp76_;
	GError* _inner_error0_ = NULL;
	gint result;
#line 32 "../src/cli.vala"
	if (args_length1 < 2) {
#line 329 "cli.c"
		const gchar* _tmp0_;
		FILE* _tmp1_;
#line 33 "../src/cli.vala"
		_tmp0_ = args[0];
#line 33 "../src/cli.vala"
		_tmp1_ = stderr;
#line 33 "../src/cli.vala"
		print_usage (_tmp0_, _tmp1_);
#line 34 "../src/cli.vala"
		result = 1;
#line 34 "../src/cli.vala"
		return result;
#line 342 "cli.c"
	}
#line 37 "../src/cli.vala"
	_tmp2_ = g_strdup ("both-runtimes");
#line 37 "../src/cli.vala"
	runtime_name = _tmp2_;
#line 38 "../src/cli.vala"
	_tmp3_ = g_strdup ("executable");
#line 38 "../src/cli.vala"
	output_mode = _tmp3_;
#line 39 "../src/cli.vala"
	_tmp4_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
#line 39 "../src/cli.vala"
	php_stub_paths = _tmp4_;
#line 40 "../src/cli.vala"
	php_stub_out_path = NULL;
#line 41 "../src/cli.vala"
	composer_library_path = NULL;
#line 42 "../src/cli.vala"
	optimize_local_vars = FALSE;
#line 43 "../src/cli.vala"
	optimize_file_func_vars = TRUE;
#line 44 "../src/cli.vala"
	syntax_check = TRUE;
#line 45 "../src/cli.vala"
	arg_index = 1;
#line 46 "../src/cli.vala"
	while (TRUE) {
#line 370 "cli.c"
		gboolean _tmp5_ = FALSE;
		gboolean _tmp7_ = FALSE;
		const gchar* _tmp8_;
		gint _tmp46_;
#line 46 "../src/cli.vala"
		if (arg_index < args_length1) {
#line 377 "cli.c"
			const gchar* _tmp6_;
#line 46 "../src/cli.vala"
			_tmp6_ = args[arg_index];
#line 46 "../src/cli.vala"
			_tmp5_ = g_str_has_prefix (_tmp6_, "-");
#line 383 "cli.c"
		} else {
#line 46 "../src/cli.vala"
			_tmp5_ = FALSE;
#line 387 "cli.c"
		}
#line 46 "../src/cli.vala"
		if (!_tmp5_) {
#line 46 "../src/cli.vala"
			break;
#line 393 "cli.c"
		}
#line 47 "../src/cli.vala"
		_tmp8_ = args[arg_index];
#line 47 "../src/cli.vala"
		if (g_strcmp0 (_tmp8_, "--help") == 0) {
#line 47 "../src/cli.vala"
			_tmp7_ = TRUE;
#line 401 "cli.c"
		} else {
			const gchar* _tmp9_;
#line 47 "../src/cli.vala"
			_tmp9_ = args[arg_index];
#line 47 "../src/cli.vala"
			_tmp7_ = g_strcmp0 (_tmp9_, "-h") == 0;
#line 408 "cli.c"
		}
#line 47 "../src/cli.vala"
		if (_tmp7_) {
#line 412 "cli.c"
			const gchar* _tmp10_;
			FILE* _tmp11_;
#line 48 "../src/cli.vala"
			_tmp10_ = args[0];
#line 48 "../src/cli.vala"
			_tmp11_ = stdout;
#line 48 "../src/cli.vala"
			print_usage (_tmp10_, _tmp11_);
#line 49 "../src/cli.vala"
			result = 0;
#line 49 "../src/cli.vala"
			_g_free0 (composer_library_path);
#line 49 "../src/cli.vala"
			_g_free0 (php_stub_out_path);
#line 49 "../src/cli.vala"
			_g_object_unref0 (php_stub_paths);
#line 49 "../src/cli.vala"
			_g_free0 (output_mode);
#line 49 "../src/cli.vala"
			_g_free0 (runtime_name);
#line 49 "../src/cli.vala"
			return result;
#line 435 "cli.c"
		} else {
			const gchar* _tmp12_;
#line 50 "../src/cli.vala"
			_tmp12_ = args[arg_index];
#line 50 "../src/cli.vala"
			if (g_strcmp0 (_tmp12_, "--embed-runtime") == 0) {
#line 442 "cli.c"
				gchar* _tmp13_;
#line 51 "../src/cli.vala"
				_tmp13_ = g_strdup ("embed-runtime");
#line 51 "../src/cli.vala"
				_g_free0 (runtime_name);
#line 51 "../src/cli.vala"
				runtime_name = _tmp13_;
#line 450 "cli.c"
			} else {
				const gchar* _tmp14_;
#line 52 "../src/cli.vala"
				_tmp14_ = args[arg_index];
#line 52 "../src/cli.vala"
				if (g_strcmp0 (_tmp14_, "--native-runtime") == 0) {
#line 457 "cli.c"
					gchar* _tmp15_;
#line 53 "../src/cli.vala"
					_tmp15_ = g_strdup ("native-runtime");
#line 53 "../src/cli.vala"
					_g_free0 (runtime_name);
#line 53 "../src/cli.vala"
					runtime_name = _tmp15_;
#line 465 "cli.c"
				} else {
					const gchar* _tmp16_;
#line 54 "../src/cli.vala"
					_tmp16_ = args[arg_index];
#line 54 "../src/cli.vala"
					if (g_strcmp0 (_tmp16_, "--both-runtimes") == 0) {
#line 472 "cli.c"
						gchar* _tmp17_;
#line 55 "../src/cli.vala"
						_tmp17_ = g_strdup ("both-runtimes");
#line 55 "../src/cli.vala"
						_g_free0 (runtime_name);
#line 55 "../src/cli.vala"
						runtime_name = _tmp17_;
#line 480 "cli.c"
					} else {
						const gchar* _tmp18_;
#line 56 "../src/cli.vala"
						_tmp18_ = args[arg_index];
#line 56 "../src/cli.vala"
						if (g_strcmp0 (_tmp18_, "--executable") == 0) {
#line 487 "cli.c"
							gchar* _tmp19_;
#line 57 "../src/cli.vala"
							_tmp19_ = g_strdup ("executable");
#line 57 "../src/cli.vala"
							_g_free0 (output_mode);
#line 57 "../src/cli.vala"
							output_mode = _tmp19_;
#line 495 "cli.c"
						} else {
							const gchar* _tmp20_;
#line 58 "../src/cli.vala"
							_tmp20_ = args[arg_index];
#line 58 "../src/cli.vala"
							if (g_strcmp0 (_tmp20_, "--library") == 0) {
#line 502 "cli.c"
								gchar* _tmp21_;
#line 59 "../src/cli.vala"
								_tmp21_ = g_strdup ("library");
#line 59 "../src/cli.vala"
								_g_free0 (output_mode);
#line 59 "../src/cli.vala"
								output_mode = _tmp21_;
#line 510 "cli.c"
							} else {
								const gchar* _tmp22_;
#line 60 "../src/cli.vala"
								_tmp22_ = args[arg_index];
#line 60 "../src/cli.vala"
								if (g_strcmp0 (_tmp22_, "--php-stub") == 0) {
#line 517 "cli.c"
									GeeArrayList* _tmp24_;
									gint _tmp25_;
									const gchar* _tmp26_;
#line 61 "../src/cli.vala"
									if ((arg_index + 1) >= args_length1) {
#line 523 "cli.c"
										FILE* _tmp23_;
#line 62 "../src/cli.vala"
										_tmp23_ = stderr;
#line 62 "../src/cli.vala"
										fprintf (_tmp23_, "Missing argument for --php-stub\n");
#line 63 "../src/cli.vala"
										result = 1;
#line 63 "../src/cli.vala"
										_g_free0 (composer_library_path);
#line 63 "../src/cli.vala"
										_g_free0 (php_stub_out_path);
#line 63 "../src/cli.vala"
										_g_object_unref0 (php_stub_paths);
#line 63 "../src/cli.vala"
										_g_free0 (output_mode);
#line 63 "../src/cli.vala"
										_g_free0 (runtime_name);
#line 63 "../src/cli.vala"
										return result;
#line 543 "cli.c"
									}
#line 65 "../src/cli.vala"
									_tmp24_ = php_stub_paths;
#line 65 "../src/cli.vala"
									arg_index = arg_index + 1;
#line 65 "../src/cli.vala"
									_tmp25_ = arg_index;
#line 65 "../src/cli.vala"
									_tmp26_ = args[_tmp25_];
#line 65 "../src/cli.vala"
									gee_abstract_collection_add ((GeeAbstractCollection*) _tmp24_, _tmp26_);
#line 555 "cli.c"
								} else {
									const gchar* _tmp27_;
#line 66 "../src/cli.vala"
									_tmp27_ = args[arg_index];
#line 66 "../src/cli.vala"
									if (g_strcmp0 (_tmp27_, "--php-stub-out") == 0) {
#line 562 "cli.c"
										gint _tmp29_;
										const gchar* _tmp30_;
										gchar* _tmp31_;
#line 67 "../src/cli.vala"
										if ((arg_index + 1) >= args_length1) {
#line 568 "cli.c"
											FILE* _tmp28_;
#line 68 "../src/cli.vala"
											_tmp28_ = stderr;
#line 68 "../src/cli.vala"
											fprintf (_tmp28_, "Missing argument for --php-stub-out\n");
#line 69 "../src/cli.vala"
											result = 1;
#line 69 "../src/cli.vala"
											_g_free0 (composer_library_path);
#line 69 "../src/cli.vala"
											_g_free0 (php_stub_out_path);
#line 69 "../src/cli.vala"
											_g_object_unref0 (php_stub_paths);
#line 69 "../src/cli.vala"
											_g_free0 (output_mode);
#line 69 "../src/cli.vala"
											_g_free0 (runtime_name);
#line 69 "../src/cli.vala"
											return result;
#line 588 "cli.c"
										}
#line 71 "../src/cli.vala"
										arg_index = arg_index + 1;
#line 71 "../src/cli.vala"
										_tmp29_ = arg_index;
#line 71 "../src/cli.vala"
										_tmp30_ = args[_tmp29_];
#line 71 "../src/cli.vala"
										_tmp31_ = g_strdup (_tmp30_);
#line 71 "../src/cli.vala"
										_g_free0 (php_stub_out_path);
#line 71 "../src/cli.vala"
										php_stub_out_path = _tmp31_;
#line 602 "cli.c"
									} else {
										const gchar* _tmp32_;
#line 72 "../src/cli.vala"
										_tmp32_ = args[arg_index];
#line 72 "../src/cli.vala"
										if (g_strcmp0 (_tmp32_, "--composer-library") == 0) {
#line 609 "cli.c"
											gint _tmp34_;
											const gchar* _tmp35_;
											gchar* _tmp36_;
#line 73 "../src/cli.vala"
											if ((arg_index + 1) >= args_length1) {
#line 615 "cli.c"
												FILE* _tmp33_;
#line 74 "../src/cli.vala"
												_tmp33_ = stderr;
#line 74 "../src/cli.vala"
												fprintf (_tmp33_, "Missing argument for --composer-library\n");
#line 75 "../src/cli.vala"
												result = 1;
#line 75 "../src/cli.vala"
												_g_free0 (composer_library_path);
#line 75 "../src/cli.vala"
												_g_free0 (php_stub_out_path);
#line 75 "../src/cli.vala"
												_g_object_unref0 (php_stub_paths);
#line 75 "../src/cli.vala"
												_g_free0 (output_mode);
#line 75 "../src/cli.vala"
												_g_free0 (runtime_name);
#line 75 "../src/cli.vala"
												return result;
#line 635 "cli.c"
											}
#line 77 "../src/cli.vala"
											arg_index = arg_index + 1;
#line 77 "../src/cli.vala"
											_tmp34_ = arg_index;
#line 77 "../src/cli.vala"
											_tmp35_ = args[_tmp34_];
#line 77 "../src/cli.vala"
											_tmp36_ = g_strdup (_tmp35_);
#line 77 "../src/cli.vala"
											_g_free0 (composer_library_path);
#line 77 "../src/cli.vala"
											composer_library_path = _tmp36_;
#line 649 "cli.c"
										} else {
											const gchar* _tmp37_;
#line 78 "../src/cli.vala"
											_tmp37_ = args[arg_index];
#line 78 "../src/cli.vala"
											if (g_strcmp0 (_tmp37_, "--optimize-local-vars") == 0) {
#line 79 "../src/cli.vala"
												optimize_local_vars = TRUE;
#line 80 "../src/cli.vala"
												optimize_file_func_vars = FALSE;
#line 660 "cli.c"
											} else {
												const gchar* _tmp38_;
#line 81 "../src/cli.vala"
												_tmp38_ = args[arg_index];
#line 81 "../src/cli.vala"
												if (g_strcmp0 (_tmp38_, "--no-optimize-local-vars") == 0) {
#line 82 "../src/cli.vala"
													optimize_local_vars = FALSE;
#line 83 "../src/cli.vala"
													optimize_file_func_vars = FALSE;
#line 671 "cli.c"
												} else {
													const gchar* _tmp39_;
#line 84 "../src/cli.vala"
													_tmp39_ = args[arg_index];
#line 84 "../src/cli.vala"
													if (g_strcmp0 (_tmp39_, "--optimize-file-func-vars") == 0) {
#line 85 "../src/cli.vala"
														optimize_file_func_vars = TRUE;
#line 680 "cli.c"
													} else {
														const gchar* _tmp40_;
#line 86 "../src/cli.vala"
														_tmp40_ = args[arg_index];
#line 86 "../src/cli.vala"
														if (g_strcmp0 (_tmp40_, "--no-optimize-file-func-vars") == 0) {
#line 87 "../src/cli.vala"
															optimize_file_func_vars = FALSE;
#line 689 "cli.c"
														} else {
															const gchar* _tmp41_;
#line 88 "../src/cli.vala"
															_tmp41_ = args[arg_index];
#line 88 "../src/cli.vala"
															if (g_strcmp0 (_tmp41_, "--no-syntax-check") == 0) {
#line 89 "../src/cli.vala"
																syntax_check = FALSE;
#line 698 "cli.c"
															} else {
																FILE* _tmp42_;
																const gchar* _tmp43_;
																const gchar* _tmp44_;
																FILE* _tmp45_;
#line 91 "../src/cli.vala"
																_tmp42_ = stderr;
#line 91 "../src/cli.vala"
																_tmp43_ = args[arg_index];
#line 91 "../src/cli.vala"
																fprintf (_tmp42_, "Unknown option: %s\n", _tmp43_);
#line 92 "../src/cli.vala"
																_tmp44_ = args[0];
#line 92 "../src/cli.vala"
																_tmp45_ = stderr;
#line 92 "../src/cli.vala"
																print_usage (_tmp44_, _tmp45_);
#line 93 "../src/cli.vala"
																result = 1;
#line 93 "../src/cli.vala"
																_g_free0 (composer_library_path);
#line 93 "../src/cli.vala"
																_g_free0 (php_stub_out_path);
#line 93 "../src/cli.vala"
																_g_object_unref0 (php_stub_paths);
#line 93 "../src/cli.vala"
																_g_free0 (output_mode);
#line 93 "../src/cli.vala"
																_g_free0 (runtime_name);
#line 93 "../src/cli.vala"
																return result;
#line 730 "cli.c"
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
#line 95 "../src/cli.vala"
		_tmp46_ = arg_index;
#line 95 "../src/cli.vala"
		arg_index = _tmp46_ + 1;
#line 749 "cli.c"
	}
#line 98 "../src/cli.vala"
	_tmp47_ = composer_library_path;
#line 98 "../src/cli.vala"
	if (_tmp47_ != NULL) {
#line 755 "cli.c"
		const gchar* _tmp50_ = NULL;
		gchar* output_path = NULL;
		gchar* _tmp52_;
#line 99 "../src/cli.vala"
		if ((args_length1 - arg_index) > 1) {
#line 761 "cli.c"
			const gchar* _tmp48_;
			FILE* _tmp49_;
#line 100 "../src/cli.vala"
			_tmp48_ = args[0];
#line 100 "../src/cli.vala"
			_tmp49_ = stderr;
#line 100 "../src/cli.vala"
			print_usage (_tmp48_, _tmp49_);
#line 101 "../src/cli.vala"
			result = 1;
#line 101 "../src/cli.vala"
			_g_free0 (composer_library_path);
#line 101 "../src/cli.vala"
			_g_free0 (php_stub_out_path);
#line 101 "../src/cli.vala"
			_g_object_unref0 (php_stub_paths);
#line 101 "../src/cli.vala"
			_g_free0 (output_mode);
#line 101 "../src/cli.vala"
			_g_free0 (runtime_name);
#line 101 "../src/cli.vala"
			return result;
#line 784 "cli.c"
		}
#line 103 "../src/cli.vala"
		if ((args_length1 - arg_index) == 1) {
#line 788 "cli.c"
			const gchar* _tmp51_;
#line 103 "../src/cli.vala"
			_tmp51_ = args[arg_index];
#line 103 "../src/cli.vala"
			_tmp50_ = _tmp51_;
#line 794 "cli.c"
		} else {
#line 103 "../src/cli.vala"
			_tmp50_ = "composer-library.vala";
#line 798 "cli.c"
		}
#line 103 "../src/cli.vala"
		_tmp52_ = g_strdup (_tmp50_);
#line 103 "../src/cli.vala"
		output_path = _tmp52_;
#line 804 "cli.c"
		{
			PhpToValaComposerLibrary* composer_library = NULL;
			const gchar* _tmp53_;
			PhpToValaComposerLibrary* _tmp54_;
			const gchar* _tmp55_;
			PhpToValaComposerLibrary* _tmp56_;
			const gchar* _tmp57_;
			const gchar* _tmp58_;
#line 105 "../src/cli.vala"
			_tmp53_ = composer_library_path;
#line 105 "../src/cli.vala"
			_tmp54_ = php_to_vala_composer_library_generate ((const gchar*) _tmp53_, &_inner_error0_);
#line 105 "../src/cli.vala"
			composer_library = _tmp54_;
#line 105 "../src/cli.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 821 "cli.c"
				goto __catch0_g_error;
			}
#line 106 "../src/cli.vala"
			_tmp55_ = output_path;
#line 106 "../src/cli.vala"
			_tmp56_ = composer_library;
#line 106 "../src/cli.vala"
			_tmp57_ = _tmp56_->vala_source;
#line 106 "../src/cli.vala"
			g_file_set_contents (_tmp55_, _tmp57_, (gssize) -1, &_inner_error0_);
#line 106 "../src/cli.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 106 "../src/cli.vala"
				_g_object_unref0 (composer_library);
#line 836 "cli.c"
				goto __catch0_g_error;
			}
#line 107 "../src/cli.vala"
			_tmp58_ = php_stub_out_path;
#line 107 "../src/cli.vala"
			if (_tmp58_ != NULL) {
#line 843 "cli.c"
				const gchar* _tmp59_;
				PhpToValaComposerLibrary* _tmp60_;
				const gchar* _tmp61_;
#line 108 "../src/cli.vala"
				_tmp59_ = php_stub_out_path;
#line 108 "../src/cli.vala"
				_tmp60_ = composer_library;
#line 108 "../src/cli.vala"
				_tmp61_ = _tmp60_->stub_source;
#line 108 "../src/cli.vala"
				g_file_set_contents ((const gchar*) _tmp59_, _tmp61_, (gssize) -1, &_inner_error0_);
#line 108 "../src/cli.vala"
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 108 "../src/cli.vala"
					_g_object_unref0 (composer_library);
#line 859 "cli.c"
					goto __catch0_g_error;
				}
			}
#line 104 "../src/cli.vala"
			_g_object_unref0 (composer_library);
#line 865 "cli.c"
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			FILE* _tmp62_;
			GError* _tmp63_;
			const gchar* _tmp64_;
#line 104 "../src/cli.vala"
			e = _inner_error0_;
#line 104 "../src/cli.vala"
			_inner_error0_ = NULL;
#line 111 "../src/cli.vala"
			_tmp62_ = stderr;
#line 111 "../src/cli.vala"
			_tmp63_ = e;
#line 111 "../src/cli.vala"
			_tmp64_ = _tmp63_->message;
#line 111 "../src/cli.vala"
			fprintf (_tmp62_, "php2vala: %s\n", _tmp64_);
#line 112 "../src/cli.vala"
			result = 1;
#line 112 "../src/cli.vala"
			_g_error_free0 (e);
#line 112 "../src/cli.vala"
			_g_free0 (output_path);
#line 112 "../src/cli.vala"
			_g_free0 (composer_library_path);
#line 112 "../src/cli.vala"
			_g_free0 (php_stub_out_path);
#line 112 "../src/cli.vala"
			_g_object_unref0 (php_stub_paths);
#line 112 "../src/cli.vala"
			_g_free0 (output_mode);
#line 112 "../src/cli.vala"
			_g_free0 (runtime_name);
#line 112 "../src/cli.vala"
			return result;
#line 904 "cli.c"
		}
		__finally0:
#line 104 "../src/cli.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 909 "cli.c"
			gint _tmp65_ = -1;
#line 104 "../src/cli.vala"
			_g_free0 (output_path);
#line 104 "../src/cli.vala"
			_g_free0 (composer_library_path);
#line 104 "../src/cli.vala"
			_g_free0 (php_stub_out_path);
#line 104 "../src/cli.vala"
			_g_object_unref0 (php_stub_paths);
#line 104 "../src/cli.vala"
			_g_free0 (output_mode);
#line 104 "../src/cli.vala"
			_g_free0 (runtime_name);
#line 104 "../src/cli.vala"
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 104 "../src/cli.vala"
			g_clear_error (&_inner_error0_);
#line 104 "../src/cli.vala"
			return _tmp65_;
#line 929 "cli.c"
		}
#line 114 "../src/cli.vala"
		result = 0;
#line 114 "../src/cli.vala"
		_g_free0 (output_path);
#line 114 "../src/cli.vala"
		_g_free0 (composer_library_path);
#line 114 "../src/cli.vala"
		_g_free0 (php_stub_out_path);
#line 114 "../src/cli.vala"
		_g_object_unref0 (php_stub_paths);
#line 114 "../src/cli.vala"
		_g_free0 (output_mode);
#line 114 "../src/cli.vala"
		_g_free0 (runtime_name);
#line 114 "../src/cli.vala"
		return result;
#line 947 "cli.c"
	}
#line 117 "../src/cli.vala"
	if (arg_index >= args_length1) {
#line 117 "../src/cli.vala"
		_tmp66_ = TRUE;
#line 953 "cli.c"
	} else {
#line 117 "../src/cli.vala"
		_tmp66_ = (args_length1 - arg_index) > 2;
#line 957 "cli.c"
	}
#line 117 "../src/cli.vala"
	if (_tmp66_) {
#line 961 "cli.c"
		const gchar* _tmp67_;
		FILE* _tmp68_;
#line 118 "../src/cli.vala"
		_tmp67_ = args[0];
#line 118 "../src/cli.vala"
		_tmp68_ = stderr;
#line 118 "../src/cli.vala"
		print_usage (_tmp67_, _tmp68_);
#line 119 "../src/cli.vala"
		result = 1;
#line 119 "../src/cli.vala"
		_g_free0 (composer_library_path);
#line 119 "../src/cli.vala"
		_g_free0 (php_stub_out_path);
#line 119 "../src/cli.vala"
		_g_object_unref0 (php_stub_paths);
#line 119 "../src/cli.vala"
		_g_free0 (output_mode);
#line 119 "../src/cli.vala"
		_g_free0 (runtime_name);
#line 119 "../src/cli.vala"
		return result;
#line 984 "cli.c"
	}
#line 122 "../src/cli.vala"
	_tmp69_ = args[arg_index];
#line 122 "../src/cli.vala"
	_tmp70_ = g_strdup (_tmp69_);
#line 122 "../src/cli.vala"
	input_path = _tmp70_;
#line 123 "../src/cli.vala"
	if ((args_length1 - arg_index) == 2) {
#line 994 "cli.c"
		const gchar* _tmp72_;
		gchar* _tmp73_;
#line 123 "../src/cli.vala"
		_tmp72_ = args[arg_index + 1];
#line 123 "../src/cli.vala"
		_tmp73_ = g_strdup (_tmp72_);
#line 123 "../src/cli.vala"
		_g_free0 (_tmp71_);
#line 123 "../src/cli.vala"
		_tmp71_ = _tmp73_;
#line 1005 "cli.c"
	} else {
		const gchar* _tmp74_;
		gchar* _tmp75_;
#line 123 "../src/cli.vala"
		_tmp74_ = input_path;
#line 123 "../src/cli.vala"
		_tmp75_ = default_output_path (_tmp74_);
#line 123 "../src/cli.vala"
		_g_free0 (_tmp71_);
#line 123 "../src/cli.vala"
		_tmp71_ = _tmp75_;
#line 1017 "cli.c"
	}
#line 123 "../src/cli.vala"
	_tmp76_ = _tmp71_;
#line 123 "../src/cli.vala"
	_tmp71_ = NULL;
#line 123 "../src/cli.vala"
	output_path = _tmp76_;
#line 1025 "cli.c"
	{
		gchar* php_source = NULL;
		const gchar* _tmp77_;
		gchar* _tmp78_ = NULL;
		PhpToValaTranspiler* transpiler = NULL;
		const gchar* _tmp86_;
		const gchar* _tmp87_;
		const gchar* _tmp88_;
		PhpToValaTranspiler* _tmp89_;
		gchar* vala_source = NULL;
		PhpToValaTranspiler* _tmp100_;
		const gchar* _tmp101_;
		gchar* _tmp102_;
		const gchar* _tmp103_;
		const gchar* _tmp104_;
		const gchar* _tmp105_;
#line 127 "../src/cli.vala"
		_tmp77_ = input_path;
#line 127 "../src/cli.vala"
		g_file_get_contents (_tmp77_, &_tmp78_, NULL, &_inner_error0_);
#line 127 "../src/cli.vala"
		_g_free0 (php_source);
#line 127 "../src/cli.vala"
		php_source = _tmp78_;
#line 127 "../src/cli.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 127 "../src/cli.vala"
			_g_free0 (php_source);
#line 1054 "cli.c"
			goto __catch1_g_error;
		}
#line 129 "../src/cli.vala"
		if (syntax_check) {
#line 1059 "cli.c"
			gchar* syntax_error = NULL;
			const gchar* _tmp79_;
			gchar* _tmp80_ = NULL;
			gboolean _tmp81_;
#line 130 "../src/cli.vala"
			syntax_error = NULL;
#line 131 "../src/cli.vala"
			_tmp79_ = input_path;
#line 131 "../src/cli.vala"
			_tmp81_ = php_embed_syntax_check_file_static (_tmp79_, &_tmp80_);
#line 131 "../src/cli.vala"
			_g_free0 (syntax_error);
#line 131 "../src/cli.vala"
			syntax_error = _tmp80_;
#line 131 "../src/cli.vala"
			if (!_tmp81_) {
#line 1076 "cli.c"
				const gchar* _tmp82_ = NULL;
				const gchar* _tmp83_;
				const gchar* _tmp84_;
				GError* _tmp85_;
#line 135 "../src/cli.vala"
				_tmp83_ = syntax_error;
#line 135 "../src/cli.vala"
				_tmp82_ = _tmp83_;
#line 135 "../src/cli.vala"
				if (_tmp82_ == NULL) {
#line 135 "../src/cli.vala"
					_tmp82_ = "unknown PHP syntax error";
#line 1089 "cli.c"
				}
#line 132 "../src/cli.vala"
				_tmp84_ = input_path;
#line 132 "../src/cli.vala"
				_tmp85_ = g_error_new (PHP_TO_VALA_ERROR, PHP_TO_VALA_ERROR_UNSUPPORTED, "PHP syntax check failed for %s: %s", _tmp84_, _tmp82_);
#line 132 "../src/cli.vala"
				_inner_error0_ = _tmp85_;
#line 132 "../src/cli.vala"
				_g_free0 (syntax_error);
#line 132 "../src/cli.vala"
				_g_free0 (php_source);
#line 1101 "cli.c"
				goto __catch1_g_error;
			}
#line 129 "../src/cli.vala"
			_g_free0 (syntax_error);
#line 1106 "cli.c"
		}
#line 140 "../src/cli.vala"
		_tmp86_ = input_path;
#line 140 "../src/cli.vala"
		_tmp87_ = runtime_name;
#line 140 "../src/cli.vala"
		_tmp88_ = output_mode;
#line 140 "../src/cli.vala"
		_tmp89_ = php_to_vala_transpiler_new (_tmp86_, optimize_local_vars, optimize_file_func_vars, _tmp87_, _tmp88_, &_inner_error0_);
#line 140 "../src/cli.vala"
		transpiler = _tmp89_;
#line 140 "../src/cli.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 140 "../src/cli.vala"
			_g_free0 (php_source);
#line 1122 "cli.c"
			goto __catch1_g_error;
		}
		{
			GeeArrayList* _php_stub_path_list = NULL;
			GeeArrayList* _tmp90_;
			gint _php_stub_path_size = 0;
			GeeArrayList* _tmp91_;
			gint _tmp92_;
			gint _tmp93_;
			gint _php_stub_path_index = 0;
#line 141 "../src/cli.vala"
			_tmp90_ = php_stub_paths;
#line 141 "../src/cli.vala"
			_php_stub_path_list = _tmp90_;
#line 141 "../src/cli.vala"
			_tmp91_ = _php_stub_path_list;
#line 141 "../src/cli.vala"
			_tmp92_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp91_);
#line 141 "../src/cli.vala"
			_tmp93_ = _tmp92_;
#line 141 "../src/cli.vala"
			_php_stub_path_size = _tmp93_;
#line 141 "../src/cli.vala"
			_php_stub_path_index = -1;
#line 141 "../src/cli.vala"
			while (TRUE) {
#line 1149 "cli.c"
				gint _tmp94_;
				gint _tmp95_;
				gchar* php_stub_path = NULL;
				GeeArrayList* _tmp96_;
				gpointer _tmp97_;
				PhpToValaTranspiler* _tmp98_;
				const gchar* _tmp99_;
#line 141 "../src/cli.vala"
				_php_stub_path_index = _php_stub_path_index + 1;
#line 141 "../src/cli.vala"
				_tmp94_ = _php_stub_path_index;
#line 141 "../src/cli.vala"
				_tmp95_ = _php_stub_path_size;
#line 141 "../src/cli.vala"
				if (!(_tmp94_ < _tmp95_)) {
#line 141 "../src/cli.vala"
					break;
#line 1167 "cli.c"
				}
#line 141 "../src/cli.vala"
				_tmp96_ = _php_stub_path_list;
#line 141 "../src/cli.vala"
				_tmp97_ = gee_abstract_list_get ((GeeAbstractList*) _tmp96_, _php_stub_path_index);
#line 141 "../src/cli.vala"
				php_stub_path = (gchar*) _tmp97_;
#line 142 "../src/cli.vala"
				_tmp98_ = transpiler;
#line 142 "../src/cli.vala"
				_tmp99_ = php_stub_path;
#line 142 "../src/cli.vala"
				php_to_vala_transpiler_load_php_stub_file (_tmp98_, _tmp99_, &_inner_error0_);
#line 142 "../src/cli.vala"
				if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 142 "../src/cli.vala"
					_g_free0 (php_stub_path);
#line 142 "../src/cli.vala"
					_g_object_unref0 (transpiler);
#line 142 "../src/cli.vala"
					_g_free0 (php_source);
#line 1189 "cli.c"
					goto __catch1_g_error;
				}
#line 141 "../src/cli.vala"
				_g_free0 (php_stub_path);
#line 1194 "cli.c"
			}
		}
#line 144 "../src/cli.vala"
		_tmp100_ = transpiler;
#line 144 "../src/cli.vala"
		_tmp101_ = php_source;
#line 144 "../src/cli.vala"
		_tmp102_ = php_to_vala_transpiler_transpile (_tmp100_, _tmp101_, &_inner_error0_);
#line 144 "../src/cli.vala"
		vala_source = _tmp102_;
#line 144 "../src/cli.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 144 "../src/cli.vala"
			_g_object_unref0 (transpiler);
#line 144 "../src/cli.vala"
			_g_free0 (php_source);
#line 1211 "cli.c"
			goto __catch1_g_error;
		}
#line 146 "../src/cli.vala"
		_tmp103_ = output_path;
#line 146 "../src/cli.vala"
		_tmp104_ = vala_source;
#line 146 "../src/cli.vala"
		g_file_set_contents (_tmp103_, _tmp104_, (gssize) -1, &_inner_error0_);
#line 146 "../src/cli.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 146 "../src/cli.vala"
			_g_free0 (vala_source);
#line 146 "../src/cli.vala"
			_g_object_unref0 (transpiler);
#line 146 "../src/cli.vala"
			_g_free0 (php_source);
#line 1228 "cli.c"
			goto __catch1_g_error;
		}
#line 147 "../src/cli.vala"
		_tmp105_ = php_stub_out_path;
#line 147 "../src/cli.vala"
		if (_tmp105_ != NULL) {
#line 1235 "cli.c"
			gchar* _tmp106_ = NULL;
			PhpToValaTranspiler* _tmp107_;
			gchar* _tmp108_;
			const gchar* _tmp109_;
#line 148 "../src/cli.vala"
			_tmp107_ = transpiler;
#line 148 "../src/cli.vala"
			_tmp108_ = php_to_vala_transpiler_build_php_stub (_tmp107_, &_inner_error0_);
#line 148 "../src/cli.vala"
			_tmp106_ = _tmp108_;
#line 148 "../src/cli.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 148 "../src/cli.vala"
				_g_free0 (vala_source);
#line 148 "../src/cli.vala"
				_g_object_unref0 (transpiler);
#line 148 "../src/cli.vala"
				_g_free0 (php_source);
#line 1254 "cli.c"
				goto __catch1_g_error;
			}
#line 148 "../src/cli.vala"
			_tmp109_ = php_stub_out_path;
#line 148 "../src/cli.vala"
			g_file_set_contents ((const gchar*) _tmp109_, _tmp106_, (gssize) -1, &_inner_error0_);
#line 148 "../src/cli.vala"
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 148 "../src/cli.vala"
				_g_free0 (_tmp106_);
#line 148 "../src/cli.vala"
				_g_free0 (vala_source);
#line 148 "../src/cli.vala"
				_g_object_unref0 (transpiler);
#line 148 "../src/cli.vala"
				_g_free0 (php_source);
#line 1271 "cli.c"
				goto __catch1_g_error;
			}
#line 147 "../src/cli.vala"
			_g_free0 (_tmp106_);
#line 1276 "cli.c"
		}
#line 125 "../src/cli.vala"
		_g_free0 (vala_source);
#line 125 "../src/cli.vala"
		_g_object_unref0 (transpiler);
#line 125 "../src/cli.vala"
		_g_free0 (php_source);
#line 1284 "cli.c"
	}
	goto __finally1;
	__catch1_g_error:
	{
		GError* e = NULL;
		FILE* _tmp110_;
		GError* _tmp111_;
		const gchar* _tmp112_;
#line 125 "../src/cli.vala"
		e = _inner_error0_;
#line 125 "../src/cli.vala"
		_inner_error0_ = NULL;
#line 151 "../src/cli.vala"
		_tmp110_ = stderr;
#line 151 "../src/cli.vala"
		_tmp111_ = e;
#line 151 "../src/cli.vala"
		_tmp112_ = _tmp111_->message;
#line 151 "../src/cli.vala"
		fprintf (_tmp110_, "php2vala: %s\n", _tmp112_);
#line 152 "../src/cli.vala"
		result = 1;
#line 152 "../src/cli.vala"
		_g_error_free0 (e);
#line 152 "../src/cli.vala"
		_g_free0 (output_path);
#line 152 "../src/cli.vala"
		_g_free0 (_tmp71_);
#line 152 "../src/cli.vala"
		_g_free0 (input_path);
#line 152 "../src/cli.vala"
		_g_free0 (composer_library_path);
#line 152 "../src/cli.vala"
		_g_free0 (php_stub_out_path);
#line 152 "../src/cli.vala"
		_g_object_unref0 (php_stub_paths);
#line 152 "../src/cli.vala"
		_g_free0 (output_mode);
#line 152 "../src/cli.vala"
		_g_free0 (runtime_name);
#line 152 "../src/cli.vala"
		return result;
#line 1327 "cli.c"
	}
	__finally1:
#line 125 "../src/cli.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 1332 "cli.c"
		gint _tmp113_ = -1;
#line 125 "../src/cli.vala"
		_g_free0 (output_path);
#line 125 "../src/cli.vala"
		_g_free0 (_tmp71_);
#line 125 "../src/cli.vala"
		_g_free0 (input_path);
#line 125 "../src/cli.vala"
		_g_free0 (composer_library_path);
#line 125 "../src/cli.vala"
		_g_free0 (php_stub_out_path);
#line 125 "../src/cli.vala"
		_g_object_unref0 (php_stub_paths);
#line 125 "../src/cli.vala"
		_g_free0 (output_mode);
#line 125 "../src/cli.vala"
		_g_free0 (runtime_name);
#line 125 "../src/cli.vala"
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
#line 125 "../src/cli.vala"
		g_clear_error (&_inner_error0_);
#line 125 "../src/cli.vala"
		return _tmp113_;
#line 1356 "cli.c"
	}
#line 155 "../src/cli.vala"
	result = 0;
#line 155 "../src/cli.vala"
	_g_free0 (output_path);
#line 155 "../src/cli.vala"
	_g_free0 (_tmp71_);
#line 155 "../src/cli.vala"
	_g_free0 (input_path);
#line 155 "../src/cli.vala"
	_g_free0 (composer_library_path);
#line 155 "../src/cli.vala"
	_g_free0 (php_stub_out_path);
#line 155 "../src/cli.vala"
	_g_object_unref0 (php_stub_paths);
#line 155 "../src/cli.vala"
	_g_free0 (output_mode);
#line 155 "../src/cli.vala"
	_g_free0 (runtime_name);
#line 155 "../src/cli.vala"
	return result;
#line 1378 "cli.c"
}

int
main (int argc,
      char ** argv)
{
#line 31 "../src/cli.vala"
	return _vala_main (argv, argc);
#line 1387 "cli.c"
}

