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

#include <glib-object.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gee.h>
#include <glib/gstdio.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 TYPE_PHP_TO_VALA_RUNTIME_BINDINGS (php_to_vala_runtime_bindings_get_type ())
#define PHP_TO_VALA_RUNTIME_BINDINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PHP_TO_VALA_RUNTIME_BINDINGS, PhpToValaRuntimeBindings))
#define PHP_TO_VALA_RUNTIME_BINDINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PHP_TO_VALA_RUNTIME_BINDINGS, PhpToValaRuntimeBindingsClass))
#define IS_PHP_TO_VALA_RUNTIME_BINDINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PHP_TO_VALA_RUNTIME_BINDINGS))
#define IS_PHP_TO_VALA_RUNTIME_BINDINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PHP_TO_VALA_RUNTIME_BINDINGS))
#define PHP_TO_VALA_RUNTIME_BINDINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PHP_TO_VALA_RUNTIME_BINDINGS, PhpToValaRuntimeBindingsClass))

typedef struct _PhpToValaRuntimeBindings PhpToValaRuntimeBindings;
typedef struct _PhpToValaRuntimeBindingsClass PhpToValaRuntimeBindingsClass;
typedef struct _PhpToValaRuntimeBindingsPrivate PhpToValaRuntimeBindingsPrivate;
enum  {
	PHP_TO_VALA_RUNTIME_BINDINGS_0_PROPERTY,
	PHP_TO_VALA_RUNTIME_BINDINGS_NUM_PROPERTIES
};
static GParamSpec* php_to_vala_runtime_bindings_properties[PHP_TO_VALA_RUNTIME_BINDINGS_NUM_PROPERTIES];

#define TYPE_FUNCTION_BINDING (function_binding_get_type ())
#define FUNCTION_BINDING(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FUNCTION_BINDING, FunctionBinding))
#define FUNCTION_BINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FUNCTION_BINDING, FunctionBindingClass))
#define IS_FUNCTION_BINDING(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FUNCTION_BINDING))
#define IS_FUNCTION_BINDING_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FUNCTION_BINDING))
#define FUNCTION_BINDING_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FUNCTION_BINDING, FunctionBindingClass))

typedef struct _FunctionBinding FunctionBinding;
typedef struct _FunctionBindingClass FunctionBindingClass;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _FunctionBindingPrivate FunctionBindingPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_dir_close0(var) ((var == NULL) ? NULL : (var = (g_dir_close (var), NULL)))

struct _PhpToValaRuntimeBindings {
	GObject parent_instance;
	PhpToValaRuntimeBindingsPrivate * priv;
};

struct _PhpToValaRuntimeBindingsClass {
	GObjectClass parent_class;
};

struct _FunctionBinding {
	GObject parent_instance;
	FunctionBindingPrivate * priv;
	gchar* namespace_name;
	gchar* package_name;
	gchar* return_type;
	gboolean source_location_args;
	gchar* mapped_function_name;
};

struct _FunctionBindingClass {
	GObjectClass parent_class;
};

static gpointer php_to_vala_runtime_bindings_parent_class = NULL;

VALA_EXTERN GType php_to_vala_runtime_bindings_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhpToValaRuntimeBindings, g_object_unref)
VALA_EXTERN gboolean php_to_vala_runtime_bindings_has_embed_runtime_binding (const gchar* function_name);
VALA_EXTERN GType function_binding_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (FunctionBinding, g_object_unref)
VALA_EXTERN GeeHashMap* php_to_vala_runtime_bindings_load (const gchar* runtime_name);
static GeeArrayList* php_to_vala_runtime_bindings_find_valaphp_vapis (void);
static void php_to_vala_runtime_bindings_load_vapi_functions (GeeHashMap* bindings,
                                                       const gchar* vapi_path,
                                                       const gchar* expected_namespace,
                                                       const gchar* package_name,
                                                       gboolean overwrite_existing);
static gchar* php_to_vala_runtime_bindings_package_name_from_vapi_path (const gchar* vapi_path);
static void php_to_vala_runtime_bindings_add_core_static_aliases (GeeHashMap* bindings);
static void php_to_vala_runtime_bindings_add_native_static_aliases (GeeHashMap* bindings);
static void php_to_vala_runtime_bindings_add_embed_fallback_mapped (GeeHashMap* bindings,
                                                             const gchar* function_name,
                                                             const gchar* mapped_function_name,
                                                             const gchar* return_type);
static void php_to_vala_runtime_bindings_add_embed_fallback (GeeHashMap* bindings,
                                                      const gchar* function_name);
static void php_to_vala_runtime_bindings_add_core_alias (GeeHashMap* bindings,
                                                  const gchar* function_name,
                                                  const gchar* mapped_function_name,
                                                  const gchar* return_type);
VALA_EXTERN FunctionBinding* function_binding_new (const gchar* namespace_name,
                                       const gchar* package_name,
                                       const gchar* return_type,
                                       gboolean source_location_args,
                                       const gchar* mapped_function_name);
VALA_EXTERN FunctionBinding* function_binding_construct (GType object_type,
                                             const gchar* namespace_name,
                                             const gchar* package_name,
                                             const gchar* return_type,
                                             gboolean source_location_args,
                                             const gchar* mapped_function_name);
static gboolean php_to_vala_runtime_bindings_should_set_embed_fallback (GeeHashMap* bindings,
                                                                 const gchar* function_name);
static void php_to_vala_runtime_bindings_add_native_alias (GeeHashMap* bindings,
                                                    const gchar* function_name,
                                                    const gchar* mapped_function_name);
static void php_to_vala_runtime_bindings_add_vapis_from_vala_flags (GeeArrayList* paths);
static void php_to_vala_runtime_bindings_add_vapis_from_pkg_config_path (GeeArrayList* paths);
static void php_to_vala_runtime_bindings_add_valaphp_build_vapis (GeeArrayList* paths,
                                                           const gchar* root);
static void php_to_vala_runtime_bindings_add_vapis_from_dir (GeeArrayList* paths,
                                                      const gchar* dir_path);
VALA_EXTERN PhpToValaRuntimeBindings* php_to_vala_runtime_bindings_new (void);
VALA_EXTERN PhpToValaRuntimeBindings* php_to_vala_runtime_bindings_construct (GType object_type);
static GType php_to_vala_runtime_bindings_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static gssize _vala_array_length (gpointer array);

gboolean
php_to_vala_runtime_bindings_has_embed_runtime_binding (const gchar* function_name)
{
	FunctionBinding* binding = NULL;
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gpointer _tmp2_;
	FunctionBinding* _tmp3_;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	FunctionBinding* _tmp6_;
	gboolean result;
#line 4 "../src/runtime_bindings.vala"
	g_return_val_if_fail (function_name != NULL, FALSE);
#line 5 "../src/runtime_bindings.vala"
	_tmp0_ = php_to_vala_runtime_bindings_load ("embed-runtime");
#line 5 "../src/runtime_bindings.vala"
	_tmp1_ = _tmp0_;
#line 5 "../src/runtime_bindings.vala"
	_tmp2_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp1_, function_name);
#line 5 "../src/runtime_bindings.vala"
	_tmp3_ = (FunctionBinding*) _tmp2_;
#line 5 "../src/runtime_bindings.vala"
	_g_object_unref0 (_tmp1_);
#line 5 "../src/runtime_bindings.vala"
	binding = _tmp3_;
#line 6 "../src/runtime_bindings.vala"
	_tmp6_ = binding;
#line 6 "../src/runtime_bindings.vala"
	if (_tmp6_ != NULL) {
#line 173 "runtime_bindings.c"
		FunctionBinding* _tmp7_;
		const gchar* _tmp8_;
#line 7 "../src/runtime_bindings.vala"
		_tmp7_ = binding;
#line 7 "../src/runtime_bindings.vala"
		_tmp8_ = _tmp7_->namespace_name;
#line 7 "../src/runtime_bindings.vala"
		_tmp5_ = g_strcmp0 (_tmp8_, "PhpEmbed") == 0;
#line 182 "runtime_bindings.c"
	} else {
#line 6 "../src/runtime_bindings.vala"
		_tmp5_ = FALSE;
#line 186 "runtime_bindings.c"
	}
#line 6 "../src/runtime_bindings.vala"
	if (_tmp5_) {
#line 190 "runtime_bindings.c"
		FunctionBinding* _tmp9_;
		const gchar* _tmp10_;
#line 8 "../src/runtime_bindings.vala"
		_tmp9_ = binding;
#line 8 "../src/runtime_bindings.vala"
		_tmp10_ = _tmp9_->package_name;
#line 8 "../src/runtime_bindings.vala"
		_tmp4_ = g_strcmp0 (_tmp10_, "valaphp-runtime-embed-0.01") == 0;
#line 199 "runtime_bindings.c"
	} else {
#line 6 "../src/runtime_bindings.vala"
		_tmp4_ = FALSE;
#line 203 "runtime_bindings.c"
	}
#line 6 "../src/runtime_bindings.vala"
	result = _tmp4_;
#line 6 "../src/runtime_bindings.vala"
	_g_object_unref0 (binding);
#line 6 "../src/runtime_bindings.vala"
	return result;
#line 211 "runtime_bindings.c"
}

GeeHashMap*
php_to_vala_runtime_bindings_load (const gchar* runtime_name)
{
	GeeHashMap* bindings = NULL;
	GeeHashMap* _tmp0_;
	gboolean _tmp1_ = FALSE;
	gboolean allow_native = FALSE;
	gboolean _tmp2_ = FALSE;
	gboolean allow_embed = FALSE;
	GeeHashMap* _tmp20_;
	GeeHashMap* result;
#line 11 "../src/runtime_bindings.vala"
	g_return_val_if_fail (runtime_name != NULL, NULL);
#line 12 "../src/runtime_bindings.vala"
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TYPE_FUNCTION_BINDING, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
#line 12 "../src/runtime_bindings.vala"
	bindings = _tmp0_;
#line 13 "../src/runtime_bindings.vala"
	if (g_strcmp0 (runtime_name, "native-runtime") == 0) {
#line 13 "../src/runtime_bindings.vala"
		_tmp1_ = TRUE;
#line 235 "runtime_bindings.c"
	} else {
#line 13 "../src/runtime_bindings.vala"
		_tmp1_ = g_strcmp0 (runtime_name, "both-runtimes") == 0;
#line 239 "runtime_bindings.c"
	}
#line 13 "../src/runtime_bindings.vala"
	allow_native = _tmp1_;
#line 14 "../src/runtime_bindings.vala"
	if (g_strcmp0 (runtime_name, "embed-runtime") == 0) {
#line 14 "../src/runtime_bindings.vala"
		_tmp2_ = TRUE;
#line 247 "runtime_bindings.c"
	} else {
#line 14 "../src/runtime_bindings.vala"
		_tmp2_ = g_strcmp0 (runtime_name, "both-runtimes") == 0;
#line 251 "runtime_bindings.c"
	}
#line 14 "../src/runtime_bindings.vala"
	allow_embed = _tmp2_;
#line 255 "runtime_bindings.c"
	{
		GeeArrayList* _vapi_path_list = NULL;
		GeeArrayList* _tmp3_;
		gint _vapi_path_size = 0;
		GeeArrayList* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _vapi_path_index = 0;
#line 25 "../src/runtime_bindings.vala"
		_tmp3_ = php_to_vala_runtime_bindings_find_valaphp_vapis ();
#line 25 "../src/runtime_bindings.vala"
		_vapi_path_list = _tmp3_;
#line 25 "../src/runtime_bindings.vala"
		_tmp4_ = _vapi_path_list;
#line 25 "../src/runtime_bindings.vala"
		_tmp5_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp4_);
#line 25 "../src/runtime_bindings.vala"
		_tmp6_ = _tmp5_;
#line 25 "../src/runtime_bindings.vala"
		_vapi_path_size = _tmp6_;
#line 25 "../src/runtime_bindings.vala"
		_vapi_path_index = -1;
#line 25 "../src/runtime_bindings.vala"
		while (TRUE) {
#line 280 "runtime_bindings.c"
			gint _tmp7_;
			gint _tmp8_;
			gchar* vapi_path = NULL;
			GeeArrayList* _tmp9_;
			gpointer _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			gboolean _tmp14_;
#line 25 "../src/runtime_bindings.vala"
			_vapi_path_index = _vapi_path_index + 1;
#line 25 "../src/runtime_bindings.vala"
			_tmp7_ = _vapi_path_index;
#line 25 "../src/runtime_bindings.vala"
			_tmp8_ = _vapi_path_size;
#line 25 "../src/runtime_bindings.vala"
			if (!(_tmp7_ < _tmp8_)) {
#line 25 "../src/runtime_bindings.vala"
				break;
#line 300 "runtime_bindings.c"
			}
#line 25 "../src/runtime_bindings.vala"
			_tmp9_ = _vapi_path_list;
#line 25 "../src/runtime_bindings.vala"
			_tmp10_ = gee_abstract_list_get ((GeeAbstractList*) _tmp9_, _vapi_path_index);
#line 25 "../src/runtime_bindings.vala"
			vapi_path = (gchar*) _tmp10_;
#line 26 "../src/runtime_bindings.vala"
			_tmp11_ = vapi_path;
#line 26 "../src/runtime_bindings.vala"
			_tmp12_ = g_path_get_basename (_tmp11_);
#line 26 "../src/runtime_bindings.vala"
			_tmp13_ = _tmp12_;
#line 26 "../src/runtime_bindings.vala"
			_tmp14_ = g_str_has_prefix (_tmp13_, "valaphp-runtime-core-");
#line 26 "../src/runtime_bindings.vala"
			_g_free0 (_tmp13_);
#line 26 "../src/runtime_bindings.vala"
			if (_tmp14_) {
#line 320 "runtime_bindings.c"
				GeeHashMap* _tmp15_;
				const gchar* _tmp16_;
				const gchar* _tmp17_;
				gchar* _tmp18_;
				gchar* _tmp19_;
#line 27 "../src/runtime_bindings.vala"
				_tmp15_ = bindings;
#line 27 "../src/runtime_bindings.vala"
				_tmp16_ = vapi_path;
#line 27 "../src/runtime_bindings.vala"
				_tmp17_ = vapi_path;
#line 27 "../src/runtime_bindings.vala"
				_tmp18_ = php_to_vala_runtime_bindings_package_name_from_vapi_path (_tmp17_);
#line 27 "../src/runtime_bindings.vala"
				_tmp19_ = _tmp18_;
#line 27 "../src/runtime_bindings.vala"
				php_to_vala_runtime_bindings_load_vapi_functions (_tmp15_, _tmp16_, "Php", _tmp19_, FALSE);
#line 27 "../src/runtime_bindings.vala"
				_g_free0 (_tmp19_);
#line 340 "runtime_bindings.c"
			}
#line 25 "../src/runtime_bindings.vala"
			_g_free0 (vapi_path);
#line 344 "runtime_bindings.c"
		}
#line 25 "../src/runtime_bindings.vala"
		_g_object_unref0 (_vapi_path_list);
#line 348 "runtime_bindings.c"
	}
#line 30 "../src/runtime_bindings.vala"
	_tmp20_ = bindings;
#line 30 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_core_static_aliases (_tmp20_);
#line 32 "../src/runtime_bindings.vala"
	if (allow_native) {
#line 356 "runtime_bindings.c"
		GeeHashMap* _tmp41_;
		{
			GeeArrayList* _vapi_path_list = NULL;
			GeeArrayList* _tmp21_;
			gint _vapi_path_size = 0;
			GeeArrayList* _tmp22_;
			gint _tmp23_;
			gint _tmp24_;
			gint _vapi_path_index = 0;
#line 33 "../src/runtime_bindings.vala"
			_tmp21_ = php_to_vala_runtime_bindings_find_valaphp_vapis ();
#line 33 "../src/runtime_bindings.vala"
			_vapi_path_list = _tmp21_;
#line 33 "../src/runtime_bindings.vala"
			_tmp22_ = _vapi_path_list;
#line 33 "../src/runtime_bindings.vala"
			_tmp23_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp22_);
#line 33 "../src/runtime_bindings.vala"
			_tmp24_ = _tmp23_;
#line 33 "../src/runtime_bindings.vala"
			_vapi_path_size = _tmp24_;
#line 33 "../src/runtime_bindings.vala"
			_vapi_path_index = -1;
#line 33 "../src/runtime_bindings.vala"
			while (TRUE) {
#line 382 "runtime_bindings.c"
				gint _tmp25_;
				gint _tmp26_;
				gchar* vapi_path = NULL;
				GeeArrayList* _tmp27_;
				gpointer _tmp28_;
				gchar* basename = NULL;
				const gchar* _tmp29_;
				gchar* _tmp30_;
				gboolean _tmp31_ = FALSE;
				gboolean _tmp32_ = FALSE;
				const gchar* _tmp33_;
				GeeHashMap* _tmp36_;
				const gchar* _tmp37_;
				const gchar* _tmp38_;
				gchar* _tmp39_;
				gchar* _tmp40_;
#line 33 "../src/runtime_bindings.vala"
				_vapi_path_index = _vapi_path_index + 1;
#line 33 "../src/runtime_bindings.vala"
				_tmp25_ = _vapi_path_index;
#line 33 "../src/runtime_bindings.vala"
				_tmp26_ = _vapi_path_size;
#line 33 "../src/runtime_bindings.vala"
				if (!(_tmp25_ < _tmp26_)) {
#line 33 "../src/runtime_bindings.vala"
					break;
#line 409 "runtime_bindings.c"
				}
#line 33 "../src/runtime_bindings.vala"
				_tmp27_ = _vapi_path_list;
#line 33 "../src/runtime_bindings.vala"
				_tmp28_ = gee_abstract_list_get ((GeeAbstractList*) _tmp27_, _vapi_path_index);
#line 33 "../src/runtime_bindings.vala"
				vapi_path = (gchar*) _tmp28_;
#line 34 "../src/runtime_bindings.vala"
				_tmp29_ = vapi_path;
#line 34 "../src/runtime_bindings.vala"
				_tmp30_ = g_path_get_basename (_tmp29_);
#line 34 "../src/runtime_bindings.vala"
				basename = _tmp30_;
#line 35 "../src/runtime_bindings.vala"
				_tmp33_ = basename;
#line 35 "../src/runtime_bindings.vala"
				if (!g_str_has_prefix (_tmp33_, "valaphp-runtime-")) {
#line 35 "../src/runtime_bindings.vala"
					_tmp32_ = TRUE;
#line 429 "runtime_bindings.c"
				} else {
					const gchar* _tmp34_;
#line 36 "../src/runtime_bindings.vala"
					_tmp34_ = basename;
#line 36 "../src/runtime_bindings.vala"
					_tmp32_ = g_str_has_prefix (_tmp34_, "valaphp-runtime-core-");
#line 436 "runtime_bindings.c"
				}
#line 35 "../src/runtime_bindings.vala"
				if (_tmp32_) {
#line 35 "../src/runtime_bindings.vala"
					_tmp31_ = TRUE;
#line 442 "runtime_bindings.c"
				} else {
					const gchar* _tmp35_;
#line 37 "../src/runtime_bindings.vala"
					_tmp35_ = basename;
#line 37 "../src/runtime_bindings.vala"
					_tmp31_ = g_str_has_prefix (_tmp35_, "valaphp-runtime-embed-");
#line 449 "runtime_bindings.c"
				}
#line 35 "../src/runtime_bindings.vala"
				if (_tmp31_) {
#line 38 "../src/runtime_bindings.vala"
					_g_free0 (basename);
#line 38 "../src/runtime_bindings.vala"
					_g_free0 (vapi_path);
#line 38 "../src/runtime_bindings.vala"
					continue;
#line 459 "runtime_bindings.c"
				}
#line 41 "../src/runtime_bindings.vala"
				_tmp36_ = bindings;
#line 41 "../src/runtime_bindings.vala"
				_tmp37_ = vapi_path;
#line 41 "../src/runtime_bindings.vala"
				_tmp38_ = vapi_path;
#line 41 "../src/runtime_bindings.vala"
				_tmp39_ = php_to_vala_runtime_bindings_package_name_from_vapi_path (_tmp38_);
#line 41 "../src/runtime_bindings.vala"
				_tmp40_ = _tmp39_;
#line 41 "../src/runtime_bindings.vala"
				php_to_vala_runtime_bindings_load_vapi_functions (_tmp36_, _tmp37_, "PhpNative", _tmp40_, FALSE);
#line 41 "../src/runtime_bindings.vala"
				_g_free0 (_tmp40_);
#line 33 "../src/runtime_bindings.vala"
				_g_free0 (basename);
#line 33 "../src/runtime_bindings.vala"
				_g_free0 (vapi_path);
#line 479 "runtime_bindings.c"
			}
#line 33 "../src/runtime_bindings.vala"
			_g_object_unref0 (_vapi_path_list);
#line 483 "runtime_bindings.c"
		}
#line 44 "../src/runtime_bindings.vala"
		_tmp41_ = bindings;
#line 44 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_native_static_aliases (_tmp41_);
#line 489 "runtime_bindings.c"
	}
#line 47 "../src/runtime_bindings.vala"
	if (allow_embed) {
#line 493 "runtime_bindings.c"
		GeeHashMap* _tmp59_;
		GeeHashMap* _tmp60_;
		GeeHashMap* _tmp61_;
		GeeHashMap* _tmp62_;
		GeeHashMap* _tmp63_;
		GeeHashMap* _tmp64_;
		GeeHashMap* _tmp65_;
		GeeHashMap* _tmp66_;
		GeeHashMap* _tmp67_;
		GeeHashMap* _tmp68_;
		GeeHashMap* _tmp69_;
		GeeHashMap* _tmp70_;
		GeeHashMap* _tmp71_;
		GeeHashMap* _tmp72_;
		GeeHashMap* _tmp73_;
		GeeHashMap* _tmp74_;
		GeeHashMap* _tmp75_;
		GeeHashMap* _tmp76_;
		GeeHashMap* _tmp77_;
		GeeHashMap* _tmp78_;
		GeeHashMap* _tmp79_;
		GeeHashMap* _tmp80_;
		GeeHashMap* _tmp81_;
		GeeHashMap* _tmp82_;
		GeeHashMap* _tmp83_;
		GeeHashMap* _tmp84_;
		GeeHashMap* _tmp85_;
		GeeHashMap* _tmp86_;
		GeeHashMap* _tmp87_;
		GeeHashMap* _tmp88_;
		GeeHashMap* _tmp89_;
		GeeHashMap* _tmp90_;
		GeeHashMap* _tmp91_;
		GeeHashMap* _tmp92_;
		GeeHashMap* _tmp93_;
		GeeHashMap* _tmp94_;
		GeeHashMap* _tmp95_;
		GeeHashMap* _tmp96_;
		GeeHashMap* _tmp97_;
		GeeHashMap* _tmp98_;
		GeeHashMap* _tmp99_;
		GeeHashMap* _tmp100_;
		GeeHashMap* _tmp101_;
		GeeHashMap* _tmp102_;
		GeeHashMap* _tmp103_;
		GeeHashMap* _tmp104_;
		GeeHashMap* _tmp105_;
		GeeHashMap* _tmp106_;
		GeeHashMap* _tmp107_;
		GeeHashMap* _tmp108_;
		GeeHashMap* _tmp109_;
		GeeHashMap* _tmp110_;
		GeeHashMap* _tmp111_;
		GeeHashMap* _tmp112_;
		GeeHashMap* _tmp113_;
		{
			GeeArrayList* _vapi_path_list = NULL;
			GeeArrayList* _tmp42_;
			gint _vapi_path_size = 0;
			GeeArrayList* _tmp43_;
			gint _tmp44_;
			gint _tmp45_;
			gint _vapi_path_index = 0;
#line 48 "../src/runtime_bindings.vala"
			_tmp42_ = php_to_vala_runtime_bindings_find_valaphp_vapis ();
#line 48 "../src/runtime_bindings.vala"
			_vapi_path_list = _tmp42_;
#line 48 "../src/runtime_bindings.vala"
			_tmp43_ = _vapi_path_list;
#line 48 "../src/runtime_bindings.vala"
			_tmp44_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp43_);
#line 48 "../src/runtime_bindings.vala"
			_tmp45_ = _tmp44_;
#line 48 "../src/runtime_bindings.vala"
			_vapi_path_size = _tmp45_;
#line 48 "../src/runtime_bindings.vala"
			_vapi_path_index = -1;
#line 48 "../src/runtime_bindings.vala"
			while (TRUE) {
#line 573 "runtime_bindings.c"
				gint _tmp46_;
				gint _tmp47_;
				gchar* vapi_path = NULL;
				GeeArrayList* _tmp48_;
				gpointer _tmp49_;
				const gchar* _tmp50_;
				gchar* _tmp51_;
				gchar* _tmp52_;
				gboolean _tmp53_;
#line 48 "../src/runtime_bindings.vala"
				_vapi_path_index = _vapi_path_index + 1;
#line 48 "../src/runtime_bindings.vala"
				_tmp46_ = _vapi_path_index;
#line 48 "../src/runtime_bindings.vala"
				_tmp47_ = _vapi_path_size;
#line 48 "../src/runtime_bindings.vala"
				if (!(_tmp46_ < _tmp47_)) {
#line 48 "../src/runtime_bindings.vala"
					break;
#line 593 "runtime_bindings.c"
				}
#line 48 "../src/runtime_bindings.vala"
				_tmp48_ = _vapi_path_list;
#line 48 "../src/runtime_bindings.vala"
				_tmp49_ = gee_abstract_list_get ((GeeAbstractList*) _tmp48_, _vapi_path_index);
#line 48 "../src/runtime_bindings.vala"
				vapi_path = (gchar*) _tmp49_;
#line 49 "../src/runtime_bindings.vala"
				_tmp50_ = vapi_path;
#line 49 "../src/runtime_bindings.vala"
				_tmp51_ = g_path_get_basename (_tmp50_);
#line 49 "../src/runtime_bindings.vala"
				_tmp52_ = _tmp51_;
#line 49 "../src/runtime_bindings.vala"
				_tmp53_ = g_str_has_prefix (_tmp52_, "valaphp-runtime-embed-");
#line 49 "../src/runtime_bindings.vala"
				_g_free0 (_tmp52_);
#line 49 "../src/runtime_bindings.vala"
				if (_tmp53_) {
#line 613 "runtime_bindings.c"
					GeeHashMap* _tmp54_;
					const gchar* _tmp55_;
					const gchar* _tmp56_;
					gchar* _tmp57_;
					gchar* _tmp58_;
#line 50 "../src/runtime_bindings.vala"
					_tmp54_ = bindings;
#line 50 "../src/runtime_bindings.vala"
					_tmp55_ = vapi_path;
#line 50 "../src/runtime_bindings.vala"
					_tmp56_ = vapi_path;
#line 50 "../src/runtime_bindings.vala"
					_tmp57_ = php_to_vala_runtime_bindings_package_name_from_vapi_path (_tmp56_);
#line 50 "../src/runtime_bindings.vala"
					_tmp58_ = _tmp57_;
#line 50 "../src/runtime_bindings.vala"
					php_to_vala_runtime_bindings_load_vapi_functions (_tmp54_, _tmp55_, "PhpEmbed", _tmp58_, FALSE);
#line 50 "../src/runtime_bindings.vala"
					_g_free0 (_tmp58_);
#line 633 "runtime_bindings.c"
				}
#line 48 "../src/runtime_bindings.vala"
				_g_free0 (vapi_path);
#line 637 "runtime_bindings.c"
			}
#line 48 "../src/runtime_bindings.vala"
			_g_object_unref0 (_vapi_path_list);
#line 641 "runtime_bindings.c"
		}
#line 54 "../src/runtime_bindings.vala"
		_tmp59_ = bindings;
#line 54 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp59_, "json_decode", "json_decode_zval", "Php.zval");
#line 55 "../src/runtime_bindings.vala"
		_tmp60_ = bindings;
#line 55 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp60_, "token_get_all", "token_get_all_zval", "Php.zval");
#line 56 "../src/runtime_bindings.vala"
		_tmp61_ = bindings;
#line 56 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp61_, "token_name", "token_name_static", "string");
#line 57 "../src/runtime_bindings.vala"
		_tmp62_ = bindings;
#line 57 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp62_, "json_encode", "json_encode_zval", "Php.zval");
#line 58 "../src/runtime_bindings.vala"
		_tmp63_ = bindings;
#line 58 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp63_, "json_last_error_msg");
#line 59 "../src/runtime_bindings.vala"
		_tmp64_ = bindings;
#line 59 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp64_, "phpinfo");
#line 60 "../src/runtime_bindings.vala"
		_tmp65_ = bindings;
#line 60 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp65_, "print_r", "print_r_zval", "Php.zval");
#line 61 "../src/runtime_bindings.vala"
		_tmp66_ = bindings;
#line 61 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp66_, "round");
#line 62 "../src/runtime_bindings.vala"
		_tmp67_ = bindings;
#line 62 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp67_, "serialize", "serialize_zval", "Php.zval");
#line 63 "../src/runtime_bindings.vala"
		_tmp68_ = bindings;
#line 63 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp68_, "var_dump", "var_dump_zval", "Php.zval");
#line 64 "../src/runtime_bindings.vala"
		_tmp69_ = bindings;
#line 64 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp69_, "var_export", "var_export_zval", "Php.zval");
#line 65 "../src/runtime_bindings.vala"
		_tmp70_ = bindings;
#line 65 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp70_, "unserialize", "unserialize_zval", "Php.zval");
#line 66 "../src/runtime_bindings.vala"
		_tmp71_ = bindings;
#line 66 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp71_, "strlen");
#line 67 "../src/runtime_bindings.vala"
		_tmp72_ = bindings;
#line 67 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp72_, "trim");
#line 68 "../src/runtime_bindings.vala"
		_tmp73_ = bindings;
#line 68 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp73_, "ltrim");
#line 69 "../src/runtime_bindings.vala"
		_tmp74_ = bindings;
#line 69 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp74_, "rtrim");
#line 70 "../src/runtime_bindings.vala"
		_tmp75_ = bindings;
#line 70 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp75_, "strval", "strval_zval", "Php.zval");
#line 71 "../src/runtime_bindings.vala"
		_tmp76_ = bindings;
#line 71 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp76_, "intval", "intval_zval", "Php.zval");
#line 72 "../src/runtime_bindings.vala"
		_tmp77_ = bindings;
#line 72 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp77_, "boolval", "boolval_zval", "Php.zval");
#line 73 "../src/runtime_bindings.vala"
		_tmp78_ = bindings;
#line 73 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp78_, "count", "count_zval", "Php.zval");
#line 74 "../src/runtime_bindings.vala"
		_tmp79_ = bindings;
#line 74 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp79_, "flush");
#line 75 "../src/runtime_bindings.vala"
		_tmp80_ = bindings;
#line 75 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp80_, "number_format");
#line 76 "../src/runtime_bindings.vala"
		_tmp81_ = bindings;
#line 76 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp81_, "explode");
#line 77 "../src/runtime_bindings.vala"
		_tmp82_ = bindings;
#line 77 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp82_, "str_replace");
#line 78 "../src/runtime_bindings.vala"
		_tmp83_ = bindings;
#line 78 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp83_, "stripos");
#line 79 "../src/runtime_bindings.vala"
		_tmp84_ = bindings;
#line 79 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp84_, "class_exists");
#line 80 "../src/runtime_bindings.vala"
		_tmp85_ = bindings;
#line 80 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp85_, "gettype", "gettype_zval", "Php.zval");
#line 81 "../src/runtime_bindings.vala"
		_tmp86_ = bindings;
#line 81 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp86_, "is_array", "is_array_zval", "Php.zval");
#line 82 "../src/runtime_bindings.vala"
		_tmp87_ = bindings;
#line 82 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp87_, "is_object", "is_object_zval", "Php.zval");
#line 83 "../src/runtime_bindings.vala"
		_tmp88_ = bindings;
#line 83 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp88_, "is_null", "is_null_zval", "Php.zval");
#line 84 "../src/runtime_bindings.vala"
		_tmp89_ = bindings;
#line 84 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp89_, "is_string", "is_string_zval", "Php.zval");
#line 85 "../src/runtime_bindings.vala"
		_tmp90_ = bindings;
#line 85 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp90_, "is_int", "is_int_zval", "Php.zval");
#line 86 "../src/runtime_bindings.vala"
		_tmp91_ = bindings;
#line 86 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp91_, "is_integer", "is_integer_zval", "Php.zval");
#line 87 "../src/runtime_bindings.vala"
		_tmp92_ = bindings;
#line 87 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp92_, "is_long", "is_long_zval", "Php.zval");
#line 88 "../src/runtime_bindings.vala"
		_tmp93_ = bindings;
#line 88 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp93_, "is_float", "is_float_zval", "Php.zval");
#line 89 "../src/runtime_bindings.vala"
		_tmp94_ = bindings;
#line 89 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp94_, "is_double", "is_double_zval", "Php.zval");
#line 90 "../src/runtime_bindings.vala"
		_tmp95_ = bindings;
#line 90 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp95_, "is_real", "is_real_zval", "Php.zval");
#line 91 "../src/runtime_bindings.vala"
		_tmp96_ = bindings;
#line 91 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp96_, "is_bool", "is_bool_zval", "Php.zval");
#line 92 "../src/runtime_bindings.vala"
		_tmp97_ = bindings;
#line 92 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp97_, "is_numeric", "is_numeric_zval", "Php.zval");
#line 93 "../src/runtime_bindings.vala"
		_tmp98_ = bindings;
#line 93 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp98_, "echo", "echo_zval", "Php.zval");
#line 94 "../src/runtime_bindings.vala"
		_tmp99_ = bindings;
#line 94 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp99_, "substr");
#line 95 "../src/runtime_bindings.vala"
		_tmp100_ = bindings;
#line 95 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp100_, "exec");
#line 96 "../src/runtime_bindings.vala"
		_tmp101_ = bindings;
#line 96 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp101_, "shell_exec");
#line 97 "../src/runtime_bindings.vala"
		_tmp102_ = bindings;
#line 97 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp102_, "file_get_contents");
#line 98 "../src/runtime_bindings.vala"
		_tmp103_ = bindings;
#line 98 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp103_, "microtime", "microtime_zval", "Php.zval");
#line 99 "../src/runtime_bindings.vala"
		_tmp104_ = bindings;
#line 99 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp104_, "floor");
#line 100 "../src/runtime_bindings.vala"
		_tmp105_ = bindings;
#line 100 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback (_tmp105_, "div");
#line 101 "../src/runtime_bindings.vala"
		_tmp106_ = bindings;
#line 101 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp106_, "exit", "exit_zval", "Php.zval");
#line 102 "../src/runtime_bindings.vala"
		_tmp107_ = bindings;
#line 102 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp107_, "die", "die_zval", "Php.zval");
#line 103 "../src/runtime_bindings.vala"
		_tmp108_ = bindings;
#line 103 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp108_, "exit_no_args", "exit_no_args_static", "int");
#line 104 "../src/runtime_bindings.vala"
		_tmp109_ = bindings;
#line 104 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp109_, "exit_int", "exit_int_static", "int");
#line 105 "../src/runtime_bindings.vala"
		_tmp110_ = bindings;
#line 105 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp110_, "exit_string", "exit_string_static", "int");
#line 106 "../src/runtime_bindings.vala"
		_tmp111_ = bindings;
#line 106 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp111_, "die_no_args", "die_no_args_static", "int");
#line 107 "../src/runtime_bindings.vala"
		_tmp112_ = bindings;
#line 107 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp112_, "die_int", "die_int_static", "int");
#line 108 "../src/runtime_bindings.vala"
		_tmp113_ = bindings;
#line 108 "../src/runtime_bindings.vala"
		php_to_vala_runtime_bindings_add_embed_fallback_mapped (_tmp113_, "die_string", "die_string_static", "int");
#line 863 "runtime_bindings.c"
	}
#line 111 "../src/runtime_bindings.vala"
	result = bindings;
#line 111 "../src/runtime_bindings.vala"
	return result;
#line 869 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_add_core_static_aliases (GeeHashMap* bindings)
{
#line 114 "../src/runtime_bindings.vala"
	g_return_if_fail (bindings != NULL);
#line 115 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_core_alias (bindings, "isset", "isset_value_static", "bool");
#line 116 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_core_alias (bindings, "empty", "empty_value_static", "bool");
#line 117 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_core_alias (bindings, "div", "div_static", "double");
#line 883 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_add_core_alias (GeeHashMap* bindings,
                                             const gchar* function_name,
                                             const gchar* mapped_function_name,
                                             const gchar* return_type)
{
	FunctionBinding* mapped = NULL;
	gpointer _tmp0_;
	gboolean _tmp1_ = FALSE;
	FunctionBinding* _tmp2_;
	FunctionBinding* _tmp7_;
	const gchar* _tmp8_;
	FunctionBinding* _tmp9_;
	const gchar* _tmp10_;
	FunctionBinding* _tmp11_;
	const gchar* _tmp12_;
	FunctionBinding* _tmp13_;
	FunctionBinding* _tmp14_;
	FunctionBinding* _tmp15_;
#line 120 "../src/runtime_bindings.vala"
	g_return_if_fail (bindings != NULL);
#line 120 "../src/runtime_bindings.vala"
	g_return_if_fail (function_name != NULL);
#line 120 "../src/runtime_bindings.vala"
	g_return_if_fail (mapped_function_name != NULL);
#line 120 "../src/runtime_bindings.vala"
	g_return_if_fail (return_type != NULL);
#line 121 "../src/runtime_bindings.vala"
	_tmp0_ = gee_abstract_map_get ((GeeAbstractMap*) bindings, mapped_function_name);
#line 121 "../src/runtime_bindings.vala"
	mapped = (FunctionBinding*) _tmp0_;
#line 122 "../src/runtime_bindings.vala"
	_tmp2_ = mapped;
#line 122 "../src/runtime_bindings.vala"
	if (_tmp2_ == NULL) {
#line 122 "../src/runtime_bindings.vala"
		_tmp1_ = TRUE;
#line 923 "runtime_bindings.c"
	} else {
		FunctionBinding* _tmp3_;
		const gchar* _tmp4_;
#line 122 "../src/runtime_bindings.vala"
		_tmp3_ = mapped;
#line 122 "../src/runtime_bindings.vala"
		_tmp4_ = _tmp3_->namespace_name;
#line 122 "../src/runtime_bindings.vala"
		_tmp1_ = g_strcmp0 (_tmp4_, "Php") != 0;
#line 933 "runtime_bindings.c"
	}
#line 122 "../src/runtime_bindings.vala"
	if (_tmp1_) {
#line 937 "runtime_bindings.c"
		FunctionBinding* _tmp5_;
		FunctionBinding* _tmp6_;
#line 123 "../src/runtime_bindings.vala"
		_tmp5_ = function_binding_new ("Php", "valaphp-runtime-core-0.01", return_type, TRUE, mapped_function_name);
#line 123 "../src/runtime_bindings.vala"
		_tmp6_ = _tmp5_;
#line 123 "../src/runtime_bindings.vala"
		gee_abstract_map_set ((GeeAbstractMap*) bindings, function_name, _tmp6_);
#line 123 "../src/runtime_bindings.vala"
		_g_object_unref0 (_tmp6_);
#line 130 "../src/runtime_bindings.vala"
		_g_object_unref0 (mapped);
#line 130 "../src/runtime_bindings.vala"
		return;
#line 952 "runtime_bindings.c"
	}
#line 133 "../src/runtime_bindings.vala"
	_tmp7_ = mapped;
#line 133 "../src/runtime_bindings.vala"
	_tmp8_ = _tmp7_->namespace_name;
#line 133 "../src/runtime_bindings.vala"
	_tmp9_ = mapped;
#line 133 "../src/runtime_bindings.vala"
	_tmp10_ = _tmp9_->package_name;
#line 133 "../src/runtime_bindings.vala"
	_tmp11_ = mapped;
#line 133 "../src/runtime_bindings.vala"
	_tmp12_ = _tmp11_->return_type;
#line 133 "../src/runtime_bindings.vala"
	_tmp13_ = mapped;
#line 133 "../src/runtime_bindings.vala"
	_tmp14_ = function_binding_new (_tmp8_, _tmp10_, _tmp12_, _tmp13_->source_location_args, mapped_function_name);
#line 133 "../src/runtime_bindings.vala"
	_tmp15_ = _tmp14_;
#line 133 "../src/runtime_bindings.vala"
	gee_abstract_map_set ((GeeAbstractMap*) bindings, function_name, _tmp15_);
#line 133 "../src/runtime_bindings.vala"
	_g_object_unref0 (_tmp15_);
#line 120 "../src/runtime_bindings.vala"
	_g_object_unref0 (mapped);
#line 978 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_add_embed_fallback (GeeHashMap* bindings,
                                                 const gchar* function_name)
{
#line 142 "../src/runtime_bindings.vala"
	g_return_if_fail (bindings != NULL);
#line 142 "../src/runtime_bindings.vala"
	g_return_if_fail (function_name != NULL);
#line 143 "../src/runtime_bindings.vala"
	if (php_to_vala_runtime_bindings_should_set_embed_fallback (bindings, function_name)) {
#line 991 "runtime_bindings.c"
		gchar* return_type = NULL;
		gchar* _tmp0_;
		const gchar* _tmp1_;
		GQuark _tmp3_ = 0U;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label0 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label1 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label2 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label3 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label4 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label5 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label6 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label7 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label8 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label9 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label10 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label11 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label12 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label13 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label14 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label15 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label16 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label17 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label18 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label19 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label20 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label21 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label22 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label23 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label24 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label25 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label26 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label27 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label28 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label29 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label30 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label31 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label32 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label33 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label34 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label35 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label36 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label37 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label38 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label39 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label40 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label41 = 0;
#line 145 "../src/runtime_bindings.vala"
		static GQuark _tmp2_label42 = 0;
#line 1082 "runtime_bindings.c"
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		FunctionBinding* _tmp13_;
		FunctionBinding* _tmp14_;
#line 144 "../src/runtime_bindings.vala"
		_tmp0_ = g_strdup ("var");
#line 144 "../src/runtime_bindings.vala"
		return_type = _tmp0_;
#line 145 "../src/runtime_bindings.vala"
		_tmp1_ = function_name;
#line 145 "../src/runtime_bindings.vala"
		_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
#line 145 "../src/runtime_bindings.vala"
		if (((_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("json_decode")))) || (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("unserialize"))))) || (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("microtime"))))) {
#line 145 "../src/runtime_bindings.vala"
			switch (0) {
#line 1100 "runtime_bindings.c"
				default:
				{
					gchar* _tmp4_;
#line 149 "../src/runtime_bindings.vala"
					_tmp4_ = g_strdup ("Php.zval");
#line 149 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 149 "../src/runtime_bindings.vala"
					return_type = _tmp4_;
#line 150 "../src/runtime_bindings.vala"
					break;
#line 1112 "runtime_bindings.c"
				}
			}
		} else if ((((((((((((((((((_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("json_last_error_msg")))) || (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("json_encode"))))) || (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("phpinfo"))))) || (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("print_r"))))) || (_tmp3_ == ((0 != _tmp2_label7) ? _tmp2_label7 : (_tmp2_label7 = g_quark_from_static_string ("serialize"))))) || (_tmp3_ == ((0 != _tmp2_label8) ? _tmp2_label8 : (_tmp2_label8 = g_quark_from_static_string ("var_dump"))))) || (_tmp3_ == ((0 != _tmp2_label9) ? _tmp2_label9 : (_tmp2_label9 = g_quark_from_static_string ("var_export"))))) || (_tmp3_ == ((0 != _tmp2_label10) ? _tmp2_label10 : (_tmp2_label10 = g_quark_from_static_string ("gettype"))))) || (_tmp3_ == ((0 != _tmp2_label11) ? _tmp2_label11 : (_tmp2_label11 = g_quark_from_static_string ("trim"))))) || (_tmp3_ == ((0 != _tmp2_label12) ? _tmp2_label12 : (_tmp2_label12 = g_quark_from_static_string ("substr"))))) || (_tmp3_ == ((0 != _tmp2_label13) ? _tmp2_label13 : (_tmp2_label13 = g_quark_from_static_string ("exec"))))) || (_tmp3_ == ((0 != _tmp2_label14) ? _tmp2_label14 : (_tmp2_label14 = g_quark_from_static_string ("shell_exec"))))) || (_tmp3_ == ((0 != _tmp2_label15) ? _tmp2_label15 : (_tmp2_label15 = g_quark_from_static_string ("file_get_contents"))))) || (_tmp3_ == ((0 != _tmp2_label16) ? _tmp2_label16 : (_tmp2_label16 = g_quark_from_static_string ("strval"))))) || (_tmp3_ == ((0 != _tmp2_label17) ? _tmp2_label17 : (_tmp2_label17 = g_quark_from_static_string ("ltrim"))))) || (_tmp3_ == ((0 != _tmp2_label18) ? _tmp2_label18 : (_tmp2_label18 = g_quark_from_static_string ("rtrim"))))) || (_tmp3_ == ((0 != _tmp2_label19) ? _tmp2_label19 : (_tmp2_label19 = g_quark_from_static_string ("number_format"))))) || (_tmp3_ == ((0 != _tmp2_label20) ? _tmp2_label20 : (_tmp2_label20 = g_quark_from_static_string ("str_replace"))))) {
#line 145 "../src/runtime_bindings.vala"
			switch (0) {
#line 1118 "runtime_bindings.c"
				default:
				{
					gchar* _tmp5_;
#line 169 "../src/runtime_bindings.vala"
					_tmp5_ = g_strdup ("string");
#line 169 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 169 "../src/runtime_bindings.vala"
					return_type = _tmp5_;
#line 170 "../src/runtime_bindings.vala"
					break;
#line 1130 "runtime_bindings.c"
				}
			}
		} else if (_tmp3_ == ((0 != _tmp2_label21) ? _tmp2_label21 : (_tmp2_label21 = g_quark_from_static_string ("explode")))) {
#line 145 "../src/runtime_bindings.vala"
			switch (0) {
#line 1136 "runtime_bindings.c"
				default:
				{
					gchar* _tmp6_;
#line 172 "../src/runtime_bindings.vala"
					_tmp6_ = g_strdup ("Gee.ArrayList<string>");
#line 172 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 172 "../src/runtime_bindings.vala"
					return_type = _tmp6_;
#line 173 "../src/runtime_bindings.vala"
					break;
#line 1148 "runtime_bindings.c"
				}
			}
		} else if (((_tmp3_ == ((0 != _tmp2_label22) ? _tmp2_label22 : (_tmp2_label22 = g_quark_from_static_string ("strlen")))) || (_tmp3_ == ((0 != _tmp2_label23) ? _tmp2_label23 : (_tmp2_label23 = g_quark_from_static_string ("count"))))) || (_tmp3_ == ((0 != _tmp2_label24) ? _tmp2_label24 : (_tmp2_label24 = g_quark_from_static_string ("intval"))))) {
#line 145 "../src/runtime_bindings.vala"
			switch (0) {
#line 1154 "runtime_bindings.c"
				default:
				{
					gchar* _tmp7_;
#line 177 "../src/runtime_bindings.vala"
					_tmp7_ = g_strdup ("int");
#line 177 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 177 "../src/runtime_bindings.vala"
					return_type = _tmp7_;
#line 178 "../src/runtime_bindings.vala"
					break;
#line 1166 "runtime_bindings.c"
				}
			}
		} else if (((((((((((((((_tmp3_ == ((0 != _tmp2_label25) ? _tmp2_label25 : (_tmp2_label25 = g_quark_from_static_string ("boolval")))) || (_tmp3_ == ((0 != _tmp2_label26) ? _tmp2_label26 : (_tmp2_label26 = g_quark_from_static_string ("is_array"))))) || (_tmp3_ == ((0 != _tmp2_label27) ? _tmp2_label27 : (_tmp2_label27 = g_quark_from_static_string ("is_object"))))) || (_tmp3_ == ((0 != _tmp2_label28) ? _tmp2_label28 : (_tmp2_label28 = g_quark_from_static_string ("is_null"))))) || (_tmp3_ == ((0 != _tmp2_label29) ? _tmp2_label29 : (_tmp2_label29 = g_quark_from_static_string ("is_string"))))) || (_tmp3_ == ((0 != _tmp2_label30) ? _tmp2_label30 : (_tmp2_label30 = g_quark_from_static_string ("is_int"))))) || (_tmp3_ == ((0 != _tmp2_label31) ? _tmp2_label31 : (_tmp2_label31 = g_quark_from_static_string ("is_integer"))))) || (_tmp3_ == ((0 != _tmp2_label32) ? _tmp2_label32 : (_tmp2_label32 = g_quark_from_static_string ("is_long"))))) || (_tmp3_ == ((0 != _tmp2_label33) ? _tmp2_label33 : (_tmp2_label33 = g_quark_from_static_string ("is_float"))))) || (_tmp3_ == ((0 != _tmp2_label34) ? _tmp2_label34 : (_tmp2_label34 = g_quark_from_static_string ("is_double"))))) || (_tmp3_ == ((0 != _tmp2_label35) ? _tmp2_label35 : (_tmp2_label35 = g_quark_from_static_string ("is_real"))))) || (_tmp3_ == ((0 != _tmp2_label36) ? _tmp2_label36 : (_tmp2_label36 = g_quark_from_static_string ("is_bool"))))) || (_tmp3_ == ((0 != _tmp2_label37) ? _tmp2_label37 : (_tmp2_label37 = g_quark_from_static_string ("is_numeric"))))) || (_tmp3_ == ((0 != _tmp2_label38) ? _tmp2_label38 : (_tmp2_label38 = g_quark_from_static_string ("flush"))))) || (_tmp3_ == ((0 != _tmp2_label39) ? _tmp2_label39 : (_tmp2_label39 = g_quark_from_static_string ("class_exists"))))) {
#line 145 "../src/runtime_bindings.vala"
			switch (0) {
#line 1172 "runtime_bindings.c"
				default:
				{
					gchar* _tmp8_;
#line 194 "../src/runtime_bindings.vala"
					_tmp8_ = g_strdup ("bool");
#line 194 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 194 "../src/runtime_bindings.vala"
					return_type = _tmp8_;
#line 195 "../src/runtime_bindings.vala"
					break;
#line 1184 "runtime_bindings.c"
				}
			}
		} else if (((_tmp3_ == ((0 != _tmp2_label40) ? _tmp2_label40 : (_tmp2_label40 = g_quark_from_static_string ("round")))) || (_tmp3_ == ((0 != _tmp2_label41) ? _tmp2_label41 : (_tmp2_label41 = g_quark_from_static_string ("div"))))) || (_tmp3_ == ((0 != _tmp2_label42) ? _tmp2_label42 : (_tmp2_label42 = g_quark_from_static_string ("floor"))))) {
#line 145 "../src/runtime_bindings.vala"
			switch (0) {
#line 1190 "runtime_bindings.c"
				default:
				{
					gchar* _tmp9_;
#line 199 "../src/runtime_bindings.vala"
					_tmp9_ = g_strdup ("double");
#line 199 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 199 "../src/runtime_bindings.vala"
					return_type = _tmp9_;
#line 200 "../src/runtime_bindings.vala"
					break;
#line 1202 "runtime_bindings.c"
				}
			}
		}
#line 202 "../src/runtime_bindings.vala"
		_tmp10_ = return_type;
#line 202 "../src/runtime_bindings.vala"
		_tmp11_ = g_strconcat (function_name, "_static", NULL);
#line 202 "../src/runtime_bindings.vala"
		_tmp12_ = _tmp11_;
#line 202 "../src/runtime_bindings.vala"
		_tmp13_ = function_binding_new ("PhpEmbed", "valaphp-runtime-embed-0.01", _tmp10_, TRUE, _tmp12_);
#line 202 "../src/runtime_bindings.vala"
		_tmp14_ = _tmp13_;
#line 202 "../src/runtime_bindings.vala"
		gee_abstract_map_set ((GeeAbstractMap*) bindings, function_name, _tmp14_);
#line 202 "../src/runtime_bindings.vala"
		_g_object_unref0 (_tmp14_);
#line 202 "../src/runtime_bindings.vala"
		_g_free0 (_tmp12_);
#line 143 "../src/runtime_bindings.vala"
		_g_free0 (return_type);
#line 1224 "runtime_bindings.c"
	}
}

static void
php_to_vala_runtime_bindings_add_embed_fallback_mapped (GeeHashMap* bindings,
                                                        const gchar* function_name,
                                                        const gchar* mapped_function_name,
                                                        const gchar* return_type)
{
#line 206 "../src/runtime_bindings.vala"
	g_return_if_fail (bindings != NULL);
#line 206 "../src/runtime_bindings.vala"
	g_return_if_fail (function_name != NULL);
#line 206 "../src/runtime_bindings.vala"
	g_return_if_fail (mapped_function_name != NULL);
#line 206 "../src/runtime_bindings.vala"
	g_return_if_fail (return_type != NULL);
#line 207 "../src/runtime_bindings.vala"
	if (php_to_vala_runtime_bindings_should_set_embed_fallback (bindings, function_name)) {
#line 1244 "runtime_bindings.c"
		FunctionBinding* _tmp0_;
		FunctionBinding* _tmp1_;
#line 208 "../src/runtime_bindings.vala"
		_tmp0_ = function_binding_new ("PhpEmbed", "valaphp-runtime-embed-0.01", return_type, TRUE, mapped_function_name);
#line 208 "../src/runtime_bindings.vala"
		_tmp1_ = _tmp0_;
#line 208 "../src/runtime_bindings.vala"
		gee_abstract_map_set ((GeeAbstractMap*) bindings, function_name, _tmp1_);
#line 208 "../src/runtime_bindings.vala"
		_g_object_unref0 (_tmp1_);
#line 1255 "runtime_bindings.c"
	}
}

static void
php_to_vala_runtime_bindings_add_native_static_aliases (GeeHashMap* bindings)
{
#line 212 "../src/runtime_bindings.vala"
	g_return_if_fail (bindings != NULL);
#line 216 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "echo", "echo_static");
#line 217 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "number_format", "number_format_static");
#line 218 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "var_dump", "var_dump_static");
#line 219 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "flush", "flush_static");
#line 220 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "round", "round_static");
#line 221 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "floor", "floor_static");
#line 222 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "div", "div_static");
#line 223 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "microtime", "microtime_zval");
#line 224 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "exit", "exit_zval");
#line 225 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "die", "die_zval");
#line 226 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "exit_no_args", "exit_no_args_static");
#line 227 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "exit_int", "exit_int_static");
#line 228 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "exit_string", "exit_string_static");
#line 229 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "die_no_args", "die_no_args_static");
#line 230 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "die_int", "die_int_static");
#line 231 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_native_alias (bindings, "die_string", "die_string_static");
#line 1296 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_add_native_alias (GeeHashMap* bindings,
                                               const gchar* function_name,
                                               const gchar* mapped_function_name)
{
	FunctionBinding* mapped = NULL;
	gpointer _tmp0_;
	gboolean _tmp1_ = FALSE;
	FunctionBinding* _tmp2_;
	FunctionBinding* _tmp5_;
	const gchar* _tmp6_;
	FunctionBinding* _tmp7_;
	const gchar* _tmp8_;
	FunctionBinding* _tmp9_;
	const gchar* _tmp10_;
	FunctionBinding* _tmp11_;
	FunctionBinding* _tmp12_;
	FunctionBinding* _tmp13_;
#line 234 "../src/runtime_bindings.vala"
	g_return_if_fail (bindings != NULL);
#line 234 "../src/runtime_bindings.vala"
	g_return_if_fail (function_name != NULL);
#line 234 "../src/runtime_bindings.vala"
	g_return_if_fail (mapped_function_name != NULL);
#line 235 "../src/runtime_bindings.vala"
	_tmp0_ = gee_abstract_map_get ((GeeAbstractMap*) bindings, mapped_function_name);
#line 235 "../src/runtime_bindings.vala"
	mapped = (FunctionBinding*) _tmp0_;
#line 236 "../src/runtime_bindings.vala"
	_tmp2_ = mapped;
#line 236 "../src/runtime_bindings.vala"
	if (_tmp2_ == NULL) {
#line 236 "../src/runtime_bindings.vala"
		_tmp1_ = TRUE;
#line 1333 "runtime_bindings.c"
	} else {
		FunctionBinding* _tmp3_;
		const gchar* _tmp4_;
#line 236 "../src/runtime_bindings.vala"
		_tmp3_ = mapped;
#line 236 "../src/runtime_bindings.vala"
		_tmp4_ = _tmp3_->namespace_name;
#line 236 "../src/runtime_bindings.vala"
		_tmp1_ = g_strcmp0 (_tmp4_, "PhpNative") != 0;
#line 1343 "runtime_bindings.c"
	}
#line 236 "../src/runtime_bindings.vala"
	if (_tmp1_) {
#line 237 "../src/runtime_bindings.vala"
		_g_object_unref0 (mapped);
#line 237 "../src/runtime_bindings.vala"
		return;
#line 1351 "runtime_bindings.c"
	}
#line 240 "../src/runtime_bindings.vala"
	_tmp5_ = mapped;
#line 240 "../src/runtime_bindings.vala"
	_tmp6_ = _tmp5_->namespace_name;
#line 240 "../src/runtime_bindings.vala"
	_tmp7_ = mapped;
#line 240 "../src/runtime_bindings.vala"
	_tmp8_ = _tmp7_->package_name;
#line 240 "../src/runtime_bindings.vala"
	_tmp9_ = mapped;
#line 240 "../src/runtime_bindings.vala"
	_tmp10_ = _tmp9_->return_type;
#line 240 "../src/runtime_bindings.vala"
	_tmp11_ = mapped;
#line 240 "../src/runtime_bindings.vala"
	_tmp12_ = function_binding_new (_tmp6_, _tmp8_, _tmp10_, _tmp11_->source_location_args, mapped_function_name);
#line 240 "../src/runtime_bindings.vala"
	_tmp13_ = _tmp12_;
#line 240 "../src/runtime_bindings.vala"
	gee_abstract_map_set ((GeeAbstractMap*) bindings, function_name, _tmp13_);
#line 240 "../src/runtime_bindings.vala"
	_g_object_unref0 (_tmp13_);
#line 234 "../src/runtime_bindings.vala"
	_g_object_unref0 (mapped);
#line 1377 "runtime_bindings.c"
}

static gboolean
php_to_vala_runtime_bindings_should_set_embed_fallback (GeeHashMap* bindings,
                                                        const gchar* function_name)
{
	FunctionBinding* binding = NULL;
	gpointer _tmp0_;
	FunctionBinding* _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	gboolean _tmp5_ = FALSE;
	FunctionBinding* _tmp6_;
	const gchar* _tmp7_;
	gboolean result;
#line 249 "../src/runtime_bindings.vala"
	g_return_val_if_fail (bindings != NULL, FALSE);
#line 249 "../src/runtime_bindings.vala"
	g_return_val_if_fail (function_name != NULL, FALSE);
#line 250 "../src/runtime_bindings.vala"
	_tmp0_ = gee_abstract_map_get ((GeeAbstractMap*) bindings, function_name);
#line 250 "../src/runtime_bindings.vala"
	binding = (FunctionBinding*) _tmp0_;
#line 251 "../src/runtime_bindings.vala"
	_tmp1_ = binding;
#line 251 "../src/runtime_bindings.vala"
	if (_tmp1_ == NULL) {
#line 252 "../src/runtime_bindings.vala"
		result = TRUE;
#line 252 "../src/runtime_bindings.vala"
		_g_object_unref0 (binding);
#line 252 "../src/runtime_bindings.vala"
		return result;
#line 1412 "runtime_bindings.c"
	}
#line 255 "../src/runtime_bindings.vala"
	_tmp6_ = binding;
#line 255 "../src/runtime_bindings.vala"
	_tmp7_ = _tmp6_->namespace_name;
#line 255 "../src/runtime_bindings.vala"
	if (g_strcmp0 (_tmp7_, "PhpEmbed") == 0) {
#line 1420 "runtime_bindings.c"
		FunctionBinding* _tmp8_;
		const gchar* _tmp9_;
#line 256 "../src/runtime_bindings.vala"
		_tmp8_ = binding;
#line 256 "../src/runtime_bindings.vala"
		_tmp9_ = _tmp8_->package_name;
#line 256 "../src/runtime_bindings.vala"
		_tmp5_ = g_strcmp0 (_tmp9_, "valaphp-runtime-embed-0.01") == 0;
#line 1429 "runtime_bindings.c"
	} else {
#line 255 "../src/runtime_bindings.vala"
		_tmp5_ = FALSE;
#line 1433 "runtime_bindings.c"
	}
#line 255 "../src/runtime_bindings.vala"
	if (_tmp5_) {
#line 1437 "runtime_bindings.c"
		FunctionBinding* _tmp10_;
		const gchar* _tmp11_;
#line 257 "../src/runtime_bindings.vala"
		_tmp10_ = binding;
#line 257 "../src/runtime_bindings.vala"
		_tmp11_ = _tmp10_->mapped_function_name;
#line 257 "../src/runtime_bindings.vala"
		_tmp4_ = _tmp11_ == NULL;
#line 1446 "runtime_bindings.c"
	} else {
#line 255 "../src/runtime_bindings.vala"
		_tmp4_ = FALSE;
#line 1450 "runtime_bindings.c"
	}
#line 255 "../src/runtime_bindings.vala"
	if (_tmp4_) {
#line 258 "../src/runtime_bindings.vala"
		_tmp3_ = !g_str_has_suffix (function_name, "_static");
#line 1456 "runtime_bindings.c"
	} else {
#line 255 "../src/runtime_bindings.vala"
		_tmp3_ = FALSE;
#line 1460 "runtime_bindings.c"
	}
#line 255 "../src/runtime_bindings.vala"
	if (_tmp3_) {
#line 259 "../src/runtime_bindings.vala"
		_tmp2_ = !g_str_has_suffix (function_name, "_zval");
#line 1466 "runtime_bindings.c"
	} else {
#line 255 "../src/runtime_bindings.vala"
		_tmp2_ = FALSE;
#line 1470 "runtime_bindings.c"
	}
#line 255 "../src/runtime_bindings.vala"
	result = _tmp2_;
#line 255 "../src/runtime_bindings.vala"
	_g_object_unref0 (binding);
#line 255 "../src/runtime_bindings.vala"
	return result;
#line 1478 "runtime_bindings.c"
}

static gchar*
string_strip (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
#line 1413 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, NULL);
#line 1414 "glib-2.0.vapi"
	_tmp0_ = g_strdup (self);
#line 1414 "glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1415 "glib-2.0.vapi"
	g_strstrip (_result_);
#line 1416 "glib-2.0.vapi"
	result = _result_;
#line 1416 "glib-2.0.vapi"
	return result;
#line 1499 "runtime_bindings.c"
}

static gint
string_index_of (const gchar* self,
                 const gchar* needle,
                 gint start_index)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gint result;
#line 1184 "glib-2.0.vapi"
	g_return_val_if_fail (self != NULL, -1);
#line 1184 "glib-2.0.vapi"
	g_return_val_if_fail (needle != NULL, -1);
#line 1185 "glib-2.0.vapi"
	_tmp0_ = strstr (((gchar*) self) + start_index, (gchar*) needle);
#line 1185 "glib-2.0.vapi"
	_result_ = _tmp0_;
#line 1187 "glib-2.0.vapi"
	_tmp1_ = _result_;
#line 1187 "glib-2.0.vapi"
	if (_tmp1_ != NULL) {
#line 1523 "runtime_bindings.c"
		gchar* _tmp2_;
#line 1188 "glib-2.0.vapi"
		_tmp2_ = _result_;
#line 1188 "glib-2.0.vapi"
		result = (gint) (_tmp2_ - ((gchar*) self));
#line 1188 "glib-2.0.vapi"
		return result;
#line 1531 "runtime_bindings.c"
	} else {
#line 1190 "glib-2.0.vapi"
		result = -1;
#line 1190 "glib-2.0.vapi"
		return result;
#line 1537 "runtime_bindings.c"
	}
}

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 1561 "runtime_bindings.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 1570 "runtime_bindings.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 1589 "runtime_bindings.c"
	} else {
#line 1514 "glib-2.0.vapi"
		_tmp0_ = FALSE;
#line 1593 "runtime_bindings.c"
	}
#line 1514 "glib-2.0.vapi"
	if (_tmp0_) {
#line 1516 "glib-2.0.vapi"
		string_length = string_strnlen ((gchar*) self, offset + len);
#line 1599 "runtime_bindings.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 1609 "runtime_bindings.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 1617 "runtime_bindings.c"
	} else {
#line 1525 "glib-2.0.vapi"
		g_return_val_if_fail (offset <= string_length, NULL);
#line 1621 "runtime_bindings.c"
	}
#line 1527 "glib-2.0.vapi"
	if (len < ((glong) 0)) {
#line 1528 "glib-2.0.vapi"
		len = string_length - offset;
#line 1627 "runtime_bindings.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 1637 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_load_vapi_functions (GeeHashMap* bindings,
                                                  const gchar* vapi_path,
                                                  const gchar* expected_namespace,
                                                  const gchar* package_name,
                                                  gboolean overwrite_existing)
{
	gchar* contents = NULL;
	gchar* current_namespace = NULL;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar** _tmp3_;
	gchar** _tmp4_;
	GError* _inner_error0_ = NULL;
#line 262 "../src/runtime_bindings.vala"
	g_return_if_fail (bindings != NULL);
#line 262 "../src/runtime_bindings.vala"
	g_return_if_fail (vapi_path != NULL);
#line 262 "../src/runtime_bindings.vala"
	g_return_if_fail (expected_namespace != NULL);
#line 262 "../src/runtime_bindings.vala"
	g_return_if_fail (package_name != NULL);
#line 1662 "runtime_bindings.c"
	{
		gchar* _tmp0_ = NULL;
#line 265 "../src/runtime_bindings.vala"
		g_file_get_contents (vapi_path, &_tmp0_, NULL, &_inner_error0_);
#line 265 "../src/runtime_bindings.vala"
		_g_free0 (contents);
#line 265 "../src/runtime_bindings.vala"
		contents = _tmp0_;
#line 265 "../src/runtime_bindings.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 1673 "runtime_bindings.c"
			goto __catch0_g_error;
		}
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 264 "../src/runtime_bindings.vala"
		g_clear_error (&_inner_error0_);
#line 267 "../src/runtime_bindings.vala"
		_g_free0 (contents);
#line 267 "../src/runtime_bindings.vala"
		return;
#line 1686 "runtime_bindings.c"
	}
	__finally0:
#line 264 "../src/runtime_bindings.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 264 "../src/runtime_bindings.vala"
		_g_free0 (contents);
#line 264 "../src/runtime_bindings.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 264 "../src/runtime_bindings.vala"
		g_clear_error (&_inner_error0_);
#line 264 "../src/runtime_bindings.vala"
		return;
#line 1699 "runtime_bindings.c"
	}
#line 270 "../src/runtime_bindings.vala"
	_tmp1_ = g_strdup ("");
#line 270 "../src/runtime_bindings.vala"
	current_namespace = _tmp1_;
#line 271 "../src/runtime_bindings.vala"
	_tmp2_ = contents;
#line 271 "../src/runtime_bindings.vala"
	_tmp4_ = _tmp3_ = g_strsplit (_tmp2_, "\n", 0);
#line 1709 "runtime_bindings.c"
	{
		gchar** raw_line_collection = NULL;
		gint raw_line_collection_length1 = 0;
		gint _raw_line_collection_size_ = 0;
		gint raw_line_it = 0;
#line 271 "../src/runtime_bindings.vala"
		raw_line_collection = _tmp4_;
#line 271 "../src/runtime_bindings.vala"
		raw_line_collection_length1 = _vala_array_length (_tmp3_);
#line 271 "../src/runtime_bindings.vala"
		for (raw_line_it = 0; raw_line_it < raw_line_collection_length1; raw_line_it = raw_line_it + 1) {
#line 1721 "runtime_bindings.c"
			gchar* _tmp5_;
			gchar* raw_line = NULL;
#line 271 "../src/runtime_bindings.vala"
			_tmp5_ = g_strdup (raw_line_collection[raw_line_it]);
#line 271 "../src/runtime_bindings.vala"
			raw_line = _tmp5_;
#line 1728 "runtime_bindings.c"
			{
				gchar* line = NULL;
				const gchar* _tmp6_;
				gchar* _tmp7_;
				const gchar* _tmp8_;
				gboolean _tmp17_ = FALSE;
				const gchar* _tmp18_;
				gint open_paren = 0;
				const gchar* _tmp20_;
				gchar* before_args = NULL;
				const gchar* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
				gchar** tokens = NULL;
				const gchar* _tmp26_;
				gchar** _tmp27_;
				gchar** _tmp28_;
				gint tokens_length1;
				gint _tokens_size_;
				gchar** _tmp29_;
				gint _tmp29__length1;
				gchar* function_name = NULL;
				gchar** _tmp30_;
				gint _tmp30__length1;
				gchar** _tmp31_;
				gint _tmp31__length1;
				const gchar* _tmp32_;
				gchar* _tmp33_;
				const gchar* _tmp34_ = NULL;
				gchar** _tmp35_;
				gint _tmp35__length1;
				gchar* return_type = NULL;
				gchar* _tmp39_;
				gboolean _tmp40_ = FALSE;
				const gchar* _tmp41_;
				gboolean _tmp43_ = FALSE;
				gboolean _tmp45_ = FALSE;
				const gchar* _tmp46_;
				gboolean has_source_location = FALSE;
				const gchar* _tmp48_;
				const gchar* _tmp49_;
				FunctionBinding* _tmp50_;
				FunctionBinding* _tmp51_;
#line 272 "../src/runtime_bindings.vala"
				_tmp6_ = raw_line;
#line 272 "../src/runtime_bindings.vala"
				_tmp7_ = string_strip (_tmp6_);
#line 272 "../src/runtime_bindings.vala"
				line = _tmp7_;
#line 274 "../src/runtime_bindings.vala"
				_tmp8_ = line;
#line 274 "../src/runtime_bindings.vala"
				if (g_str_has_prefix (_tmp8_, "namespace ")) {
#line 1784 "runtime_bindings.c"
					gchar** parts = NULL;
					const gchar* _tmp9_;
					gchar** _tmp10_;
					gchar** _tmp11_;
					gint parts_length1;
					gint _parts_size_;
					const gchar* _tmp12_ = NULL;
					gchar** _tmp13_;
					gint _tmp13__length1;
					gchar* _tmp16_;
#line 275 "../src/runtime_bindings.vala"
					_tmp9_ = line;
#line 275 "../src/runtime_bindings.vala"
					_tmp11_ = _tmp10_ = g_strsplit (_tmp9_, " ", 0);
#line 275 "../src/runtime_bindings.vala"
					parts = _tmp11_;
#line 275 "../src/runtime_bindings.vala"
					parts_length1 = _vala_array_length (_tmp10_);
#line 275 "../src/runtime_bindings.vala"
					_parts_size_ = parts_length1;
#line 276 "../src/runtime_bindings.vala"
					_tmp13_ = parts;
#line 276 "../src/runtime_bindings.vala"
					_tmp13__length1 = parts_length1;
#line 276 "../src/runtime_bindings.vala"
					if (_tmp13__length1 >= 2) {
#line 1811 "runtime_bindings.c"
						gchar** _tmp14_;
						gint _tmp14__length1;
						const gchar* _tmp15_;
#line 276 "../src/runtime_bindings.vala"
						_tmp14_ = parts;
#line 276 "../src/runtime_bindings.vala"
						_tmp14__length1 = parts_length1;
#line 276 "../src/runtime_bindings.vala"
						_tmp15_ = _tmp14_[1];
#line 276 "../src/runtime_bindings.vala"
						_tmp12_ = _tmp15_;
#line 1823 "runtime_bindings.c"
					} else {
#line 276 "../src/runtime_bindings.vala"
						_tmp12_ = "";
#line 1827 "runtime_bindings.c"
					}
#line 276 "../src/runtime_bindings.vala"
					_tmp16_ = g_strdup (_tmp12_);
#line 276 "../src/runtime_bindings.vala"
					_g_free0 (current_namespace);
#line 276 "../src/runtime_bindings.vala"
					current_namespace = _tmp16_;
#line 277 "../src/runtime_bindings.vala"
					parts = (_vala_array_free (parts, parts_length1, (GDestroyNotify) g_free), NULL);
#line 277 "../src/runtime_bindings.vala"
					_g_free0 (line);
#line 277 "../src/runtime_bindings.vala"
					_g_free0 (raw_line);
#line 277 "../src/runtime_bindings.vala"
					continue;
#line 1843 "runtime_bindings.c"
				}
#line 280 "../src/runtime_bindings.vala"
				_tmp18_ = current_namespace;
#line 280 "../src/runtime_bindings.vala"
				if (g_strcmp0 (_tmp18_, expected_namespace) != 0) {
#line 280 "../src/runtime_bindings.vala"
					_tmp17_ = TRUE;
#line 1851 "runtime_bindings.c"
				} else {
					const gchar* _tmp19_;
#line 280 "../src/runtime_bindings.vala"
					_tmp19_ = line;
#line 280 "../src/runtime_bindings.vala"
					_tmp17_ = !g_str_has_prefix (_tmp19_, "public static ");
#line 1858 "runtime_bindings.c"
				}
#line 280 "../src/runtime_bindings.vala"
				if (_tmp17_) {
#line 281 "../src/runtime_bindings.vala"
					_g_free0 (line);
#line 281 "../src/runtime_bindings.vala"
					_g_free0 (raw_line);
#line 281 "../src/runtime_bindings.vala"
					continue;
#line 1868 "runtime_bindings.c"
				}
#line 284 "../src/runtime_bindings.vala"
				_tmp20_ = line;
#line 284 "../src/runtime_bindings.vala"
				open_paren = string_index_of (_tmp20_, "(", 0);
#line 285 "../src/runtime_bindings.vala"
				if (open_paren < 0) {
#line 286 "../src/runtime_bindings.vala"
					_g_free0 (line);
#line 286 "../src/runtime_bindings.vala"
					_g_free0 (raw_line);
#line 286 "../src/runtime_bindings.vala"
					continue;
#line 1882 "runtime_bindings.c"
				}
#line 289 "../src/runtime_bindings.vala"
				_tmp21_ = line;
#line 289 "../src/runtime_bindings.vala"
				_tmp22_ = string_substring (_tmp21_, (glong) 0, (glong) open_paren);
#line 289 "../src/runtime_bindings.vala"
				_tmp23_ = _tmp22_;
#line 289 "../src/runtime_bindings.vala"
				_tmp24_ = string_strip (_tmp23_);
#line 289 "../src/runtime_bindings.vala"
				_tmp25_ = _tmp24_;
#line 289 "../src/runtime_bindings.vala"
				_g_free0 (_tmp23_);
#line 289 "../src/runtime_bindings.vala"
				before_args = _tmp25_;
#line 290 "../src/runtime_bindings.vala"
				_tmp26_ = before_args;
#line 290 "../src/runtime_bindings.vala"
				_tmp28_ = _tmp27_ = g_strsplit (_tmp26_, " ", 0);
#line 290 "../src/runtime_bindings.vala"
				tokens = _tmp28_;
#line 290 "../src/runtime_bindings.vala"
				tokens_length1 = _vala_array_length (_tmp27_);
#line 290 "../src/runtime_bindings.vala"
				_tokens_size_ = tokens_length1;
#line 291 "../src/runtime_bindings.vala"
				_tmp29_ = tokens;
#line 291 "../src/runtime_bindings.vala"
				_tmp29__length1 = tokens_length1;
#line 291 "../src/runtime_bindings.vala"
				if (_tmp29__length1 == 0) {
#line 292 "../src/runtime_bindings.vala"
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
#line 292 "../src/runtime_bindings.vala"
					_g_free0 (before_args);
#line 292 "../src/runtime_bindings.vala"
					_g_free0 (line);
#line 292 "../src/runtime_bindings.vala"
					_g_free0 (raw_line);
#line 292 "../src/runtime_bindings.vala"
					continue;
#line 1924 "runtime_bindings.c"
				}
#line 295 "../src/runtime_bindings.vala"
				_tmp30_ = tokens;
#line 295 "../src/runtime_bindings.vala"
				_tmp30__length1 = tokens_length1;
#line 295 "../src/runtime_bindings.vala"
				_tmp31_ = tokens;
#line 295 "../src/runtime_bindings.vala"
				_tmp31__length1 = tokens_length1;
#line 295 "../src/runtime_bindings.vala"
				_tmp32_ = _tmp30_[_tmp31__length1 - 1];
#line 295 "../src/runtime_bindings.vala"
				_tmp33_ = g_strdup (_tmp32_);
#line 295 "../src/runtime_bindings.vala"
				function_name = _tmp33_;
#line 296 "../src/runtime_bindings.vala"
				_tmp35_ = tokens;
#line 296 "../src/runtime_bindings.vala"
				_tmp35__length1 = tokens_length1;
#line 296 "../src/runtime_bindings.vala"
				if (_tmp35__length1 >= 2) {
#line 1946 "runtime_bindings.c"
					gchar** _tmp36_;
					gint _tmp36__length1;
					gchar** _tmp37_;
					gint _tmp37__length1;
					const gchar* _tmp38_;
#line 296 "../src/runtime_bindings.vala"
					_tmp36_ = tokens;
#line 296 "../src/runtime_bindings.vala"
					_tmp36__length1 = tokens_length1;
#line 296 "../src/runtime_bindings.vala"
					_tmp37_ = tokens;
#line 296 "../src/runtime_bindings.vala"
					_tmp37__length1 = tokens_length1;
#line 296 "../src/runtime_bindings.vala"
					_tmp38_ = _tmp36_[_tmp37__length1 - 2];
#line 296 "../src/runtime_bindings.vala"
					_tmp34_ = _tmp38_;
#line 1964 "runtime_bindings.c"
				} else {
#line 296 "../src/runtime_bindings.vala"
					_tmp34_ = "var";
#line 1968 "runtime_bindings.c"
				}
#line 296 "../src/runtime_bindings.vala"
				_tmp39_ = g_strdup (_tmp34_);
#line 296 "../src/runtime_bindings.vala"
				return_type = _tmp39_;
#line 297 "../src/runtime_bindings.vala"
				_tmp41_ = function_name;
#line 297 "../src/runtime_bindings.vala"
				if (g_strcmp0 (_tmp41_, "") == 0) {
#line 297 "../src/runtime_bindings.vala"
					_tmp40_ = TRUE;
#line 1980 "runtime_bindings.c"
				} else {
					const gchar* _tmp42_;
#line 297 "../src/runtime_bindings.vala"
					_tmp42_ = function_name;
#line 297 "../src/runtime_bindings.vala"
					_tmp40_ = g_str_has_prefix (_tmp42_, "@");
#line 1987 "runtime_bindings.c"
				}
#line 297 "../src/runtime_bindings.vala"
				if (_tmp40_) {
#line 298 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 298 "../src/runtime_bindings.vala"
					_g_free0 (function_name);
#line 298 "../src/runtime_bindings.vala"
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
#line 298 "../src/runtime_bindings.vala"
					_g_free0 (before_args);
#line 298 "../src/runtime_bindings.vala"
					_g_free0 (line);
#line 298 "../src/runtime_bindings.vala"
					_g_free0 (raw_line);
#line 298 "../src/runtime_bindings.vala"
					continue;
#line 2005 "runtime_bindings.c"
				}
#line 301 "../src/runtime_bindings.vala"
				if (!overwrite_existing) {
#line 2009 "runtime_bindings.c"
					const gchar* _tmp44_;
#line 301 "../src/runtime_bindings.vala"
					_tmp44_ = function_name;
#line 301 "../src/runtime_bindings.vala"
					_tmp43_ = gee_abstract_map_has_key ((GeeAbstractMap*) bindings, _tmp44_);
#line 2015 "runtime_bindings.c"
				} else {
#line 301 "../src/runtime_bindings.vala"
					_tmp43_ = FALSE;
#line 2019 "runtime_bindings.c"
				}
#line 301 "../src/runtime_bindings.vala"
				if (_tmp43_) {
#line 302 "../src/runtime_bindings.vala"
					_g_free0 (return_type);
#line 302 "../src/runtime_bindings.vala"
					_g_free0 (function_name);
#line 302 "../src/runtime_bindings.vala"
					tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
#line 302 "../src/runtime_bindings.vala"
					_g_free0 (before_args);
#line 302 "../src/runtime_bindings.vala"
					_g_free0 (line);
#line 302 "../src/runtime_bindings.vala"
					_g_free0 (raw_line);
#line 302 "../src/runtime_bindings.vala"
					continue;
#line 2037 "runtime_bindings.c"
				}
#line 305 "../src/runtime_bindings.vala"
				_tmp46_ = line;
#line 305 "../src/runtime_bindings.vala"
				if (string_index_of (_tmp46_, "string php_file", 0) >= 0) {
#line 2043 "runtime_bindings.c"
					const gchar* _tmp47_;
#line 306 "../src/runtime_bindings.vala"
					_tmp47_ = line;
#line 306 "../src/runtime_bindings.vala"
					_tmp45_ = string_index_of (_tmp47_, "int php_line", 0) >= 0;
#line 2049 "runtime_bindings.c"
				} else {
#line 305 "../src/runtime_bindings.vala"
					_tmp45_ = FALSE;
#line 2053 "runtime_bindings.c"
				}
#line 305 "../src/runtime_bindings.vala"
				has_source_location = _tmp45_;
#line 307 "../src/runtime_bindings.vala"
				_tmp48_ = function_name;
#line 307 "../src/runtime_bindings.vala"
				_tmp49_ = return_type;
#line 307 "../src/runtime_bindings.vala"
				_tmp50_ = function_binding_new (expected_namespace, package_name, _tmp49_, has_source_location, NULL);
#line 307 "../src/runtime_bindings.vala"
				_tmp51_ = _tmp50_;
#line 307 "../src/runtime_bindings.vala"
				gee_abstract_map_set ((GeeAbstractMap*) bindings, _tmp48_, _tmp51_);
#line 307 "../src/runtime_bindings.vala"
				_g_object_unref0 (_tmp51_);
#line 271 "../src/runtime_bindings.vala"
				_g_free0 (return_type);
#line 271 "../src/runtime_bindings.vala"
				_g_free0 (function_name);
#line 271 "../src/runtime_bindings.vala"
				tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
#line 271 "../src/runtime_bindings.vala"
				_g_free0 (before_args);
#line 271 "../src/runtime_bindings.vala"
				_g_free0 (line);
#line 271 "../src/runtime_bindings.vala"
				_g_free0 (raw_line);
#line 2081 "runtime_bindings.c"
			}
		}
#line 271 "../src/runtime_bindings.vala"
		raw_line_collection = (_vala_array_free (raw_line_collection, raw_line_collection_length1, (GDestroyNotify) g_free), NULL);
#line 2086 "runtime_bindings.c"
	}
#line 262 "../src/runtime_bindings.vala"
	_g_free0 (current_namespace);
#line 262 "../src/runtime_bindings.vala"
	_g_free0 (contents);
#line 2092 "runtime_bindings.c"
}

static gchar*
php_to_vala_runtime_bindings_package_name_from_vapi_path (const gchar* vapi_path)
{
	gchar* basename = NULL;
	gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* result;
#line 311 "../src/runtime_bindings.vala"
	g_return_val_if_fail (vapi_path != NULL, NULL);
#line 312 "../src/runtime_bindings.vala"
	_tmp0_ = g_path_get_basename (vapi_path);
#line 312 "../src/runtime_bindings.vala"
	basename = _tmp0_;
#line 313 "../src/runtime_bindings.vala"
	_tmp1_ = basename;
#line 313 "../src/runtime_bindings.vala"
	if (g_str_has_suffix (_tmp1_, ".vapi")) {
#line 2112 "runtime_bindings.c"
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gint _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		gchar* _tmp8_;
#line 314 "../src/runtime_bindings.vala"
		_tmp2_ = basename;
#line 314 "../src/runtime_bindings.vala"
		_tmp3_ = basename;
#line 314 "../src/runtime_bindings.vala"
		_tmp4_ = strlen (_tmp3_);
#line 314 "../src/runtime_bindings.vala"
		_tmp5_ = _tmp4_;
#line 314 "../src/runtime_bindings.vala"
		_tmp6_ = strlen (".vapi");
#line 314 "../src/runtime_bindings.vala"
		_tmp7_ = _tmp6_;
#line 314 "../src/runtime_bindings.vala"
		_tmp8_ = string_substring (_tmp2_, (glong) 0, (glong) (_tmp5_ - _tmp7_));
#line 314 "../src/runtime_bindings.vala"
		result = _tmp8_;
#line 314 "../src/runtime_bindings.vala"
		_g_free0 (basename);
#line 314 "../src/runtime_bindings.vala"
		return result;
#line 2140 "runtime_bindings.c"
	}
#line 316 "../src/runtime_bindings.vala"
	result = basename;
#line 316 "../src/runtime_bindings.vala"
	return result;
#line 2146 "runtime_bindings.c"
}

static GeeArrayList*
php_to_vala_runtime_bindings_find_valaphp_vapis (void)
{
	GeeArrayList* paths = NULL;
	GeeArrayList* _tmp0_;
	gchar* root = NULL;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gboolean _tmp3_ = FALSE;
	const gchar* _tmp4_;
	GeeArrayList* _tmp7_;
	GeeArrayList* _tmp8_;
	GeeArrayList* _tmp9_;
	const gchar* _tmp10_;
	GeeArrayList* _tmp11_;
	GeeArrayList* _tmp12_;
	GeeArrayList* result;
#line 320 "../src/runtime_bindings.vala"
	_tmp0_ = gee_array_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL);
#line 320 "../src/runtime_bindings.vala"
	paths = _tmp0_;
#line 321 "../src/runtime_bindings.vala"
	_tmp1_ = g_getenv ("VALAPHPTEST");
#line 321 "../src/runtime_bindings.vala"
	_tmp2_ = g_strdup (_tmp1_);
#line 321 "../src/runtime_bindings.vala"
	root = _tmp2_;
#line 322 "../src/runtime_bindings.vala"
	_tmp4_ = root;
#line 322 "../src/runtime_bindings.vala"
	if (_tmp4_ == NULL) {
#line 322 "../src/runtime_bindings.vala"
		_tmp3_ = TRUE;
#line 2182 "runtime_bindings.c"
	} else {
		const gchar* _tmp5_;
#line 322 "../src/runtime_bindings.vala"
		_tmp5_ = root;
#line 322 "../src/runtime_bindings.vala"
		_tmp3_ = g_strcmp0 (_tmp5_, "") == 0;
#line 2189 "runtime_bindings.c"
	}
#line 322 "../src/runtime_bindings.vala"
	if (_tmp3_) {
#line 2193 "runtime_bindings.c"
		gchar* _tmp6_;
#line 323 "../src/runtime_bindings.vala"
		_tmp6_ = g_strdup ("/home/peters/VALAPHPTEST");
#line 323 "../src/runtime_bindings.vala"
		_g_free0 (root);
#line 323 "../src/runtime_bindings.vala"
		root = _tmp6_;
#line 2201 "runtime_bindings.c"
	}
#line 326 "../src/runtime_bindings.vala"
	_tmp7_ = paths;
#line 326 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_vapis_from_vala_flags (_tmp7_);
#line 327 "../src/runtime_bindings.vala"
	_tmp8_ = paths;
#line 327 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_vapis_from_pkg_config_path (_tmp8_);
#line 328 "../src/runtime_bindings.vala"
	_tmp9_ = paths;
#line 328 "../src/runtime_bindings.vala"
	_tmp10_ = root;
#line 328 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_valaphp_build_vapis (_tmp9_, _tmp10_);
#line 329 "../src/runtime_bindings.vala"
	_tmp11_ = paths;
#line 329 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_vapis_from_dir (_tmp11_, "/usr/local/share/vala/vapi");
#line 330 "../src/runtime_bindings.vala"
	_tmp12_ = paths;
#line 330 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_add_vapis_from_dir (_tmp12_, "/usr/share/vala/vapi");
#line 331 "../src/runtime_bindings.vala"
	result = paths;
#line 331 "../src/runtime_bindings.vala"
	_g_free0 (root);
#line 331 "../src/runtime_bindings.vala"
	return result;
#line 2231 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_add_vapis_from_vala_flags (GeeArrayList* paths)
{
	gchar* vala_flags = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	const gchar* _tmp5_;
	gchar** _tmp6_;
	gchar** _tmp7_;
#line 334 "../src/runtime_bindings.vala"
	g_return_if_fail (paths != NULL);
#line 335 "../src/runtime_bindings.vala"
	_tmp0_ = g_getenv ("VALAFLAGS");
#line 335 "../src/runtime_bindings.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 335 "../src/runtime_bindings.vala"
	vala_flags = _tmp1_;
#line 336 "../src/runtime_bindings.vala"
	_tmp3_ = vala_flags;
#line 336 "../src/runtime_bindings.vala"
	if (_tmp3_ == NULL) {
#line 336 "../src/runtime_bindings.vala"
		_tmp2_ = TRUE;
#line 2259 "runtime_bindings.c"
	} else {
		const gchar* _tmp4_;
#line 336 "../src/runtime_bindings.vala"
		_tmp4_ = vala_flags;
#line 336 "../src/runtime_bindings.vala"
		_tmp2_ = g_strcmp0 (_tmp4_, "") == 0;
#line 2266 "runtime_bindings.c"
	}
#line 336 "../src/runtime_bindings.vala"
	if (_tmp2_) {
#line 337 "../src/runtime_bindings.vala"
		_g_free0 (vala_flags);
#line 337 "../src/runtime_bindings.vala"
		return;
#line 2274 "runtime_bindings.c"
	}
#line 340 "../src/runtime_bindings.vala"
	_tmp5_ = vala_flags;
#line 340 "../src/runtime_bindings.vala"
	_tmp7_ = _tmp6_ = g_strsplit (_tmp5_, " ", 0);
#line 2280 "runtime_bindings.c"
	{
		gchar** token_collection = NULL;
		gint token_collection_length1 = 0;
		gint _token_collection_size_ = 0;
		gint token_it = 0;
#line 340 "../src/runtime_bindings.vala"
		token_collection = _tmp7_;
#line 340 "../src/runtime_bindings.vala"
		token_collection_length1 = _vala_array_length (_tmp6_);
#line 340 "../src/runtime_bindings.vala"
		for (token_it = 0; token_it < token_collection_length1; token_it = token_it + 1) {
#line 2292 "runtime_bindings.c"
			gchar* _tmp8_;
			gchar* token = NULL;
#line 340 "../src/runtime_bindings.vala"
			_tmp8_ = g_strdup (token_collection[token_it]);
#line 340 "../src/runtime_bindings.vala"
			token = _tmp8_;
#line 2299 "runtime_bindings.c"
			{
				const gchar* _tmp9_;
#line 341 "../src/runtime_bindings.vala"
				_tmp9_ = token;
#line 341 "../src/runtime_bindings.vala"
				if (g_str_has_prefix (_tmp9_, "--vapidir=")) {
#line 2306 "runtime_bindings.c"
					const gchar* _tmp10_;
					gint _tmp11_;
					gint _tmp12_;
					gchar* _tmp13_;
					gchar* _tmp14_;
#line 342 "../src/runtime_bindings.vala"
					_tmp10_ = token;
#line 342 "../src/runtime_bindings.vala"
					_tmp11_ = strlen ("--vapidir=");
#line 342 "../src/runtime_bindings.vala"
					_tmp12_ = _tmp11_;
#line 342 "../src/runtime_bindings.vala"
					_tmp13_ = string_substring (_tmp10_, (glong) _tmp12_, (glong) -1);
#line 342 "../src/runtime_bindings.vala"
					_tmp14_ = _tmp13_;
#line 342 "../src/runtime_bindings.vala"
					php_to_vala_runtime_bindings_add_vapis_from_dir (paths, _tmp14_);
#line 342 "../src/runtime_bindings.vala"
					_g_free0 (_tmp14_);
#line 2326 "runtime_bindings.c"
				}
#line 340 "../src/runtime_bindings.vala"
				_g_free0 (token);
#line 2330 "runtime_bindings.c"
			}
		}
#line 340 "../src/runtime_bindings.vala"
		token_collection = (_vala_array_free (token_collection, token_collection_length1, (GDestroyNotify) g_free), NULL);
#line 2335 "runtime_bindings.c"
	}
#line 334 "../src/runtime_bindings.vala"
	_g_free0 (vala_flags);
#line 2339 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_add_vapis_from_pkg_config_path (GeeArrayList* paths)
{
	gchar* pkg_config_path = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	const gchar* _tmp5_;
	gchar** _tmp6_;
	gchar** _tmp7_;
#line 347 "../src/runtime_bindings.vala"
	g_return_if_fail (paths != NULL);
#line 348 "../src/runtime_bindings.vala"
	_tmp0_ = g_getenv ("PKG_CONFIG_PATH");
#line 348 "../src/runtime_bindings.vala"
	_tmp1_ = g_strdup (_tmp0_);
#line 348 "../src/runtime_bindings.vala"
	pkg_config_path = _tmp1_;
#line 349 "../src/runtime_bindings.vala"
	_tmp3_ = pkg_config_path;
#line 349 "../src/runtime_bindings.vala"
	if (_tmp3_ == NULL) {
#line 349 "../src/runtime_bindings.vala"
		_tmp2_ = TRUE;
#line 2367 "runtime_bindings.c"
	} else {
		const gchar* _tmp4_;
#line 349 "../src/runtime_bindings.vala"
		_tmp4_ = pkg_config_path;
#line 349 "../src/runtime_bindings.vala"
		_tmp2_ = g_strcmp0 (_tmp4_, "") == 0;
#line 2374 "runtime_bindings.c"
	}
#line 349 "../src/runtime_bindings.vala"
	if (_tmp2_) {
#line 350 "../src/runtime_bindings.vala"
		_g_free0 (pkg_config_path);
#line 350 "../src/runtime_bindings.vala"
		return;
#line 2382 "runtime_bindings.c"
	}
#line 353 "../src/runtime_bindings.vala"
	_tmp5_ = pkg_config_path;
#line 353 "../src/runtime_bindings.vala"
	_tmp7_ = _tmp6_ = g_strsplit (_tmp5_, ":", 0);
#line 2388 "runtime_bindings.c"
	{
		gchar** dir_path_collection = NULL;
		gint dir_path_collection_length1 = 0;
		gint _dir_path_collection_size_ = 0;
		gint dir_path_it = 0;
#line 353 "../src/runtime_bindings.vala"
		dir_path_collection = _tmp7_;
#line 353 "../src/runtime_bindings.vala"
		dir_path_collection_length1 = _vala_array_length (_tmp6_);
#line 353 "../src/runtime_bindings.vala"
		for (dir_path_it = 0; dir_path_it < dir_path_collection_length1; dir_path_it = dir_path_it + 1) {
#line 2400 "runtime_bindings.c"
			gchar* _tmp8_;
			gchar* dir_path = NULL;
#line 353 "../src/runtime_bindings.vala"
			_tmp8_ = g_strdup (dir_path_collection[dir_path_it]);
#line 353 "../src/runtime_bindings.vala"
			dir_path = _tmp8_;
#line 2407 "runtime_bindings.c"
			{
				const gchar* _tmp9_;
				gchar* suffix = NULL;
				gchar* _tmp10_;
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				gchar* libdir = NULL;
				const gchar* _tmp13_;
				const gchar* _tmp14_;
				gint _tmp15_;
				gint _tmp16_;
				const gchar* _tmp17_;
				gint _tmp18_;
				gint _tmp19_;
				gchar* _tmp20_;
				gchar* prefix = NULL;
				const gchar* _tmp21_;
				gchar* _tmp22_;
				const gchar* _tmp23_;
				gchar* _tmp24_;
				gchar* _tmp25_;
#line 354 "../src/runtime_bindings.vala"
				_tmp9_ = dir_path;
#line 354 "../src/runtime_bindings.vala"
				if (g_strcmp0 (_tmp9_, "") == 0) {
#line 355 "../src/runtime_bindings.vala"
					_g_free0 (dir_path);
#line 355 "../src/runtime_bindings.vala"
					continue;
#line 2437 "runtime_bindings.c"
				}
#line 358 "../src/runtime_bindings.vala"
				_tmp10_ = g_strdup ("/pkgconfig");
#line 358 "../src/runtime_bindings.vala"
				suffix = _tmp10_;
#line 359 "../src/runtime_bindings.vala"
				_tmp11_ = dir_path;
#line 359 "../src/runtime_bindings.vala"
				_tmp12_ = suffix;
#line 359 "../src/runtime_bindings.vala"
				if (!g_str_has_suffix (_tmp11_, _tmp12_)) {
#line 360 "../src/runtime_bindings.vala"
					_g_free0 (suffix);
#line 360 "../src/runtime_bindings.vala"
					_g_free0 (dir_path);
#line 360 "../src/runtime_bindings.vala"
					continue;
#line 2455 "runtime_bindings.c"
				}
#line 363 "../src/runtime_bindings.vala"
				_tmp13_ = dir_path;
#line 363 "../src/runtime_bindings.vala"
				_tmp14_ = dir_path;
#line 363 "../src/runtime_bindings.vala"
				_tmp15_ = strlen (_tmp14_);
#line 363 "../src/runtime_bindings.vala"
				_tmp16_ = _tmp15_;
#line 363 "../src/runtime_bindings.vala"
				_tmp17_ = suffix;
#line 363 "../src/runtime_bindings.vala"
				_tmp18_ = strlen (_tmp17_);
#line 363 "../src/runtime_bindings.vala"
				_tmp19_ = _tmp18_;
#line 363 "../src/runtime_bindings.vala"
				_tmp20_ = string_substring (_tmp13_, (glong) 0, (glong) (_tmp16_ - _tmp19_));
#line 363 "../src/runtime_bindings.vala"
				libdir = _tmp20_;
#line 364 "../src/runtime_bindings.vala"
				_tmp21_ = libdir;
#line 364 "../src/runtime_bindings.vala"
				_tmp22_ = g_path_get_dirname (_tmp21_);
#line 364 "../src/runtime_bindings.vala"
				prefix = _tmp22_;
#line 365 "../src/runtime_bindings.vala"
				_tmp23_ = prefix;
#line 365 "../src/runtime_bindings.vala"
				_tmp24_ = g_build_filename (_tmp23_, "share", "vala", "vapi", NULL);
#line 365 "../src/runtime_bindings.vala"
				_tmp25_ = _tmp24_;
#line 365 "../src/runtime_bindings.vala"
				php_to_vala_runtime_bindings_add_vapis_from_dir (paths, _tmp25_);
#line 365 "../src/runtime_bindings.vala"
				_g_free0 (_tmp25_);
#line 353 "../src/runtime_bindings.vala"
				_g_free0 (prefix);
#line 353 "../src/runtime_bindings.vala"
				_g_free0 (libdir);
#line 353 "../src/runtime_bindings.vala"
				_g_free0 (suffix);
#line 353 "../src/runtime_bindings.vala"
				_g_free0 (dir_path);
#line 2499 "runtime_bindings.c"
			}
		}
#line 353 "../src/runtime_bindings.vala"
		dir_path_collection = (_vala_array_free (dir_path_collection, dir_path_collection_length1, (GDestroyNotify) g_free), NULL);
#line 2504 "runtime_bindings.c"
	}
#line 347 "../src/runtime_bindings.vala"
	_g_free0 (pkg_config_path);
#line 2508 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_add_valaphp_build_vapis (GeeArrayList* paths,
                                                      const gchar* root)
{
	GError* _inner_error0_ = NULL;
#line 369 "../src/runtime_bindings.vala"
	g_return_if_fail (paths != NULL);
#line 369 "../src/runtime_bindings.vala"
	g_return_if_fail (root != NULL);
#line 2520 "runtime_bindings.c"
	{
		GDir* dir = NULL;
		GDir* _tmp0_;
		gchar* name = NULL;
#line 371 "../src/runtime_bindings.vala"
		_tmp0_ = g_dir_open (root, (guint) 0, &_inner_error0_);
#line 371 "../src/runtime_bindings.vala"
		dir = _tmp0_;
#line 371 "../src/runtime_bindings.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 2531 "runtime_bindings.c"
			goto __catch0_g_error;
		}
#line 373 "../src/runtime_bindings.vala"
		while (TRUE) {
#line 2536 "runtime_bindings.c"
			GDir* _tmp1_;
			const gchar* _tmp2_;
			gchar* _tmp3_;
			const gchar* _tmp4_;
			const gchar* _tmp5_;
#line 373 "../src/runtime_bindings.vala"
			_tmp1_ = dir;
#line 373 "../src/runtime_bindings.vala"
			_tmp2_ = g_dir_read_name (_tmp1_);
#line 373 "../src/runtime_bindings.vala"
			_tmp3_ = g_strdup (_tmp2_);
#line 373 "../src/runtime_bindings.vala"
			_g_free0 (name);
#line 373 "../src/runtime_bindings.vala"
			name = _tmp3_;
#line 373 "../src/runtime_bindings.vala"
			_tmp4_ = name;
#line 373 "../src/runtime_bindings.vala"
			if (!(_tmp4_ != NULL)) {
#line 373 "../src/runtime_bindings.vala"
				break;
#line 2558 "runtime_bindings.c"
			}
#line 374 "../src/runtime_bindings.vala"
			_tmp5_ = name;
#line 374 "../src/runtime_bindings.vala"
			if (g_str_has_prefix (_tmp5_, "valaphp-runtime-")) {
#line 2564 "runtime_bindings.c"
				const gchar* _tmp6_;
				gchar* _tmp7_;
				gchar* _tmp8_;
#line 375 "../src/runtime_bindings.vala"
				_tmp6_ = name;
#line 375 "../src/runtime_bindings.vala"
				_tmp7_ = g_build_filename (root, _tmp6_, "build", NULL);
#line 375 "../src/runtime_bindings.vala"
				_tmp8_ = _tmp7_;
#line 375 "../src/runtime_bindings.vala"
				php_to_vala_runtime_bindings_add_vapis_from_dir (paths, _tmp8_);
#line 375 "../src/runtime_bindings.vala"
				_g_free0 (_tmp8_);
#line 2578 "runtime_bindings.c"
			}
		}
#line 370 "../src/runtime_bindings.vala"
		_g_free0 (name);
#line 370 "../src/runtime_bindings.vala"
		_g_dir_close0 (dir);
#line 2585 "runtime_bindings.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 370 "../src/runtime_bindings.vala"
		g_clear_error (&_inner_error0_);
#line 2592 "runtime_bindings.c"
	}
	__finally0:
#line 370 "../src/runtime_bindings.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 370 "../src/runtime_bindings.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 370 "../src/runtime_bindings.vala"
		g_clear_error (&_inner_error0_);
#line 370 "../src/runtime_bindings.vala"
		return;
#line 2603 "runtime_bindings.c"
	}
}

static void
php_to_vala_runtime_bindings_add_vapis_from_dir (GeeArrayList* paths,
                                                 const gchar* dir_path)
{
	GError* _inner_error0_ = NULL;
#line 382 "../src/runtime_bindings.vala"
	g_return_if_fail (paths != NULL);
#line 382 "../src/runtime_bindings.vala"
	g_return_if_fail (dir_path != NULL);
#line 2616 "runtime_bindings.c"
	{
		GDir* dir = NULL;
		GDir* _tmp0_;
		gchar* name = NULL;
#line 384 "../src/runtime_bindings.vala"
		_tmp0_ = g_dir_open (dir_path, (guint) 0, &_inner_error0_);
#line 384 "../src/runtime_bindings.vala"
		dir = _tmp0_;
#line 384 "../src/runtime_bindings.vala"
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 2627 "runtime_bindings.c"
			goto __catch0_g_error;
		}
#line 386 "../src/runtime_bindings.vala"
		while (TRUE) {
#line 2632 "runtime_bindings.c"
			GDir* _tmp1_;
			const gchar* _tmp2_;
			gchar* _tmp3_;
			const gchar* _tmp4_;
			gboolean _tmp5_ = FALSE;
			const gchar* _tmp6_;
#line 386 "../src/runtime_bindings.vala"
			_tmp1_ = dir;
#line 386 "../src/runtime_bindings.vala"
			_tmp2_ = g_dir_read_name (_tmp1_);
#line 386 "../src/runtime_bindings.vala"
			_tmp3_ = g_strdup (_tmp2_);
#line 386 "../src/runtime_bindings.vala"
			_g_free0 (name);
#line 386 "../src/runtime_bindings.vala"
			name = _tmp3_;
#line 386 "../src/runtime_bindings.vala"
			_tmp4_ = name;
#line 386 "../src/runtime_bindings.vala"
			if (!(_tmp4_ != NULL)) {
#line 386 "../src/runtime_bindings.vala"
				break;
#line 2655 "runtime_bindings.c"
			}
#line 387 "../src/runtime_bindings.vala"
			_tmp6_ = name;
#line 387 "../src/runtime_bindings.vala"
			if (g_str_has_prefix (_tmp6_, "valaphp-runtime-")) {
#line 2661 "runtime_bindings.c"
				const gchar* _tmp7_;
#line 387 "../src/runtime_bindings.vala"
				_tmp7_ = name;
#line 387 "../src/runtime_bindings.vala"
				_tmp5_ = g_str_has_suffix (_tmp7_, ".vapi");
#line 2667 "runtime_bindings.c"
			} else {
#line 387 "../src/runtime_bindings.vala"
				_tmp5_ = FALSE;
#line 2671 "runtime_bindings.c"
			}
#line 387 "../src/runtime_bindings.vala"
			if (_tmp5_) {
#line 2675 "runtime_bindings.c"
				gchar* path = NULL;
				const gchar* _tmp8_;
				gchar* _tmp9_;
				const gchar* _tmp10_;
#line 388 "../src/runtime_bindings.vala"
				_tmp8_ = name;
#line 388 "../src/runtime_bindings.vala"
				_tmp9_ = g_build_filename (dir_path, _tmp8_, NULL);
#line 388 "../src/runtime_bindings.vala"
				path = _tmp9_;
#line 389 "../src/runtime_bindings.vala"
				_tmp10_ = path;
#line 389 "../src/runtime_bindings.vala"
				if (!gee_abstract_collection_contains ((GeeAbstractCollection*) paths, _tmp10_)) {
#line 2690 "runtime_bindings.c"
					const gchar* _tmp11_;
#line 390 "../src/runtime_bindings.vala"
					_tmp11_ = path;
#line 390 "../src/runtime_bindings.vala"
					gee_abstract_collection_add ((GeeAbstractCollection*) paths, _tmp11_);
#line 2696 "runtime_bindings.c"
				}
#line 387 "../src/runtime_bindings.vala"
				_g_free0 (path);
#line 2700 "runtime_bindings.c"
			}
		}
#line 383 "../src/runtime_bindings.vala"
		_g_free0 (name);
#line 383 "../src/runtime_bindings.vala"
		_g_dir_close0 (dir);
#line 2707 "runtime_bindings.c"
	}
	goto __finally0;
	__catch0_g_error:
	{
#line 383 "../src/runtime_bindings.vala"
		g_clear_error (&_inner_error0_);
#line 2714 "runtime_bindings.c"
	}
	__finally0:
#line 383 "../src/runtime_bindings.vala"
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
#line 383 "../src/runtime_bindings.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 383 "../src/runtime_bindings.vala"
		g_clear_error (&_inner_error0_);
#line 383 "../src/runtime_bindings.vala"
		return;
#line 2725 "runtime_bindings.c"
	}
}

PhpToValaRuntimeBindings*
php_to_vala_runtime_bindings_construct (GType object_type)
{
	PhpToValaRuntimeBindings * self = NULL;
#line 3 "../src/runtime_bindings.vala"
	self = (PhpToValaRuntimeBindings*) g_object_new (object_type, NULL);
#line 3 "../src/runtime_bindings.vala"
	return self;
#line 2737 "runtime_bindings.c"
}

PhpToValaRuntimeBindings*
php_to_vala_runtime_bindings_new (void)
{
#line 3 "../src/runtime_bindings.vala"
	return php_to_vala_runtime_bindings_construct (TYPE_PHP_TO_VALA_RUNTIME_BINDINGS);
#line 2745 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_class_init (PhpToValaRuntimeBindingsClass * klass,
                                         gpointer klass_data)
{
#line 3 "../src/runtime_bindings.vala"
	php_to_vala_runtime_bindings_parent_class = g_type_class_peek_parent (klass);
#line 2754 "runtime_bindings.c"
}

static void
php_to_vala_runtime_bindings_instance_init (PhpToValaRuntimeBindings * self,
                                            gpointer klass)
{
}

static GType
php_to_vala_runtime_bindings_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (PhpToValaRuntimeBindingsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) php_to_vala_runtime_bindings_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (PhpToValaRuntimeBindings), 0, (GInstanceInitFunc) php_to_vala_runtime_bindings_instance_init, NULL };
	GType php_to_vala_runtime_bindings_type_id;
	php_to_vala_runtime_bindings_type_id = g_type_register_static (G_TYPE_OBJECT, "PhpToValaRuntimeBindings", &g_define_type_info, 0);
	return php_to_vala_runtime_bindings_type_id;
}

GType
php_to_vala_runtime_bindings_get_type (void)
{
	static volatile gsize php_to_vala_runtime_bindings_type_id__once = 0;
	if (g_once_init_enter (&php_to_vala_runtime_bindings_type_id__once)) {
		GType php_to_vala_runtime_bindings_type_id;
		php_to_vala_runtime_bindings_type_id = php_to_vala_runtime_bindings_get_type_once ();
		g_once_init_leave (&php_to_vala_runtime_bindings_type_id__once, php_to_vala_runtime_bindings_type_id);
	}
	return php_to_vala_runtime_bindings_type_id__once;
}

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

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

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

