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

/* valagerrormodule.vala
 *
 * Copyright (C) 2008-2010  Jürg Billeter
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

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

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

#include <glib.h>
#include <glib-object.h>
#include "valacodegen.h"
#include <vala.h>
#include <valaccode.h>
#include <valagee.h>
#include <stdlib.h>
#include <string.h>

#define _g_free0(var) (var = (g_free (var), NULL))
#define _vala_ccode_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_ccode_node_unref (var), NULL)))
#define _vala_code_node_unref0(var) ((var == NULL) ? NULL : (var = (vala_code_node_unref (var), NULL)))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))

#define VALA_TYPE_GLIB_VALUE (vala_glib_value_get_type ())
#define VALA_GLIB_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_GLIB_VALUE, ValaGLibValue))
#define VALA_GLIB_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_GLIB_VALUE, ValaGLibValueClass))
#define VALA_IS_GLIB_VALUE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_GLIB_VALUE))
#define VALA_IS_GLIB_VALUE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_GLIB_VALUE))
#define VALA_GLIB_VALUE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_GLIB_VALUE, ValaGLibValueClass))

typedef struct _ValaGLibValue ValaGLibValue;
typedef struct _ValaGLibValueClass ValaGLibValueClass;
#define _vala_target_value_unref0(var) ((var == NULL) ? NULL : (var = (vala_target_value_unref (var), NULL)))

struct _ValaGErrorModulePrivate {
	gint current_try_id;
	gint next_try_id;
	gboolean is_in_catch;
};


static gpointer vala_gerror_module_parent_class = NULL;

#define VALA_GERROR_MODULE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), VALA_TYPE_GERROR_MODULE, ValaGErrorModulePrivate))
static void vala_gerror_module_real_generate_error_domain_declaration (ValaCCodeBaseModule* base, ValaErrorDomain* edomain, ValaCCodeFile* decl_space);
static void vala_gerror_module_real_visit_error_domain (ValaCodeVisitor* base, ValaErrorDomain* edomain);
static void vala_gerror_module_real_visit_throw_statement (ValaCodeVisitor* base, ValaThrowStatement* stmt);
static void vala_gerror_module_real_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr);
G_GNUC_INTERNAL ValaGLibValue* vala_glib_value_new (ValaDataType* value_type, ValaCCodeExpression* cvalue, gboolean lvalue);
G_GNUC_INTERNAL ValaGLibValue* vala_glib_value_construct (GType object_type, ValaDataType* value_type, ValaCCodeExpression* cvalue, gboolean lvalue);
G_GNUC_INTERNAL GType vala_glib_value_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static void vala_gerror_module_uncaught_error_statement (ValaGErrorModule* self, ValaCCodeExpression* inner_error, gboolean unexpected);
static gboolean vala_gerror_module_in_finally_block (ValaGErrorModule* self, ValaCodeNode* node);
static void vala_gerror_module_real_add_simple_check (ValaCCodeBaseModule* base, ValaCodeNode* node, gboolean always_fails);
static void vala_gerror_module_real_visit_try_statement (ValaCodeVisitor* base, ValaTryStatement* stmt);
static void vala_gerror_module_real_visit_catch_clause (ValaCodeVisitor* base, ValaCatchClause* clause);
static void vala_gerror_module_real_append_scope_free (ValaCCodeBaseModule* base, ValaSymbol* sym, ValaCodeNode* stop_at);
static void vala_gerror_module_finalize (ValaCodeVisitor * obj);


static void vala_gerror_module_real_generate_error_domain_declaration (ValaCCodeBaseModule* base, ValaErrorDomain* edomain, ValaCCodeFile* decl_space) {
	ValaGErrorModule * self;
	ValaCCodeFile* _tmp0_;
	ValaErrorDomain* _tmp1_;
	ValaErrorDomain* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	ValaCCodeEnum* cenum = NULL;
	ValaErrorDomain* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	ValaCCodeEnum* _tmp10_;
	ValaCCodeEnum* _tmp11_;
	ValaCCodeFile* _tmp46_;
	ValaCCodeEnum* _tmp47_;
	gchar* quark_fun_name = NULL;
	ValaErrorDomain* _tmp48_;
	gchar* _tmp49_;
	gchar* _tmp50_;
	gchar* _tmp51_;
	gchar* _tmp52_;
	ValaCCodeMacroReplacement* error_domain_define = NULL;
	ValaErrorDomain* _tmp53_;
	gchar* _tmp54_;
	gchar* _tmp55_;
	const gchar* _tmp56_;
	gchar* _tmp57_;
	gchar* _tmp58_;
	ValaCCodeMacroReplacement* _tmp59_;
	ValaCCodeMacroReplacement* _tmp60_;
	ValaCCodeFile* _tmp61_;
	ValaCCodeMacroReplacement* _tmp62_;
	ValaCCodeFunction* cquark_fun = NULL;
	const gchar* _tmp63_;
	ValaDataType* _tmp64_;
	ValaTypeSymbol* _tmp65_;
	ValaTypeSymbol* _tmp66_;
	gchar* _tmp67_;
	gchar* _tmp68_;
	ValaCCodeFunction* _tmp69_;
	ValaCCodeFunction* _tmp70_;
	ValaCCodeFile* _tmp71_;
	ValaCCodeFunction* _tmp72_;
	self = (ValaGErrorModule*) base;
	g_return_if_fail (edomain != NULL);
	g_return_if_fail (decl_space != NULL);
	_tmp0_ = decl_space;
	_tmp1_ = edomain;
	_tmp2_ = edomain;
	_tmp3_ = vala_get_ccode_name ((ValaCodeNode*) _tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = vala_ccode_base_module_add_symbol_declaration ((ValaCCodeBaseModule*) self, _tmp0_, (ValaSymbol*) _tmp1_, _tmp4_);
	_tmp6_ = _tmp5_;
	_g_free0 (_tmp4_);
	if (_tmp6_) {
		return;
	}
	_tmp7_ = edomain;
	_tmp8_ = vala_get_ccode_name ((ValaCodeNode*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = vala_ccode_enum_new (_tmp9_);
	_tmp11_ = _tmp10_;
	_g_free0 (_tmp9_);
	cenum = _tmp11_;
	{
		ValaList* _ecode_list = NULL;
		ValaErrorDomain* _tmp12_;
		ValaList* _tmp13_;
		gint _ecode_size = 0;
		ValaList* _tmp14_;
		gint _tmp15_;
		gint _tmp16_;
		gint _ecode_index = 0;
		_tmp12_ = edomain;
		_tmp13_ = vala_error_domain_get_codes (_tmp12_);
		_ecode_list = _tmp13_;
		_tmp14_ = _ecode_list;
		_tmp15_ = vala_collection_get_size ((ValaCollection*) _tmp14_);
		_tmp16_ = _tmp15_;
		_ecode_size = _tmp16_;
		_ecode_index = -1;
		while (TRUE) {
			gint _tmp17_;
			gint _tmp18_;
			gint _tmp19_;
			ValaErrorCode* ecode = NULL;
			ValaList* _tmp20_;
			gint _tmp21_;
			gpointer _tmp22_;
			ValaErrorCode* _tmp23_;
			ValaExpression* _tmp24_;
			ValaExpression* _tmp25_;
			_tmp17_ = _ecode_index;
			_ecode_index = _tmp17_ + 1;
			_tmp18_ = _ecode_index;
			_tmp19_ = _ecode_size;
			if (!(_tmp18_ < _tmp19_)) {
				break;
			}
			_tmp20_ = _ecode_list;
			_tmp21_ = _ecode_index;
			_tmp22_ = vala_list_get (_tmp20_, _tmp21_);
			ecode = (ValaErrorCode*) _tmp22_;
			_tmp23_ = ecode;
			_tmp24_ = vala_error_code_get_value (_tmp23_);
			_tmp25_ = _tmp24_;
			if (_tmp25_ == NULL) {
				ValaCCodeEnum* _tmp26_;
				ValaErrorCode* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				ValaCCodeEnumValue* _tmp30_;
				ValaCCodeEnumValue* _tmp31_;
				_tmp26_ = cenum;
				_tmp27_ = ecode;
				_tmp28_ = vala_get_ccode_name ((ValaCodeNode*) _tmp27_);
				_tmp29_ = _tmp28_;
				_tmp30_ = vala_ccode_enum_value_new (_tmp29_, NULL);
				_tmp31_ = _tmp30_;
				vala_ccode_enum_add_value (_tmp26_, _tmp31_);
				_vala_ccode_node_unref0 (_tmp31_);
				_g_free0 (_tmp29_);
			} else {
				ValaErrorCode* _tmp32_;
				ValaExpression* _tmp33_;
				ValaExpression* _tmp34_;
				ValaCCodeEnum* _tmp35_;
				ValaErrorCode* _tmp36_;
				gchar* _tmp37_;
				gchar* _tmp38_;
				ValaErrorCode* _tmp39_;
				ValaExpression* _tmp40_;
				ValaExpression* _tmp41_;
				ValaCCodeExpression* _tmp42_;
				ValaCCodeExpression* _tmp43_;
				ValaCCodeEnumValue* _tmp44_;
				ValaCCodeEnumValue* _tmp45_;
				_tmp32_ = ecode;
				_tmp33_ = vala_error_code_get_value (_tmp32_);
				_tmp34_ = _tmp33_;
				vala_code_node_emit ((ValaCodeNode*) _tmp34_, (ValaCodeGenerator*) self);
				_tmp35_ = cenum;
				_tmp36_ = ecode;
				_tmp37_ = vala_get_ccode_name ((ValaCodeNode*) _tmp36_);
				_tmp38_ = _tmp37_;
				_tmp39_ = ecode;
				_tmp40_ = vala_error_code_get_value (_tmp39_);
				_tmp41_ = _tmp40_;
				_tmp42_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp41_);
				_tmp43_ = _tmp42_;
				_tmp44_ = vala_ccode_enum_value_new (_tmp38_, _tmp43_);
				_tmp45_ = _tmp44_;
				vala_ccode_enum_add_value (_tmp35_, _tmp45_);
				_vala_ccode_node_unref0 (_tmp45_);
				_vala_ccode_node_unref0 (_tmp43_);
				_g_free0 (_tmp38_);
			}
			_vala_code_node_unref0 (ecode);
		}
		_vala_iterable_unref0 (_ecode_list);
	}
	_tmp46_ = decl_space;
	_tmp47_ = cenum;
	vala_ccode_file_add_type_definition (_tmp46_, (ValaCCodeNode*) _tmp47_);
	_tmp48_ = edomain;
	_tmp49_ = vala_get_ccode_lower_case_prefix ((ValaSymbol*) _tmp48_);
	_tmp50_ = _tmp49_;
	_tmp51_ = g_strconcat (_tmp50_, "quark", NULL);
	_tmp52_ = _tmp51_;
	_g_free0 (_tmp50_);
	quark_fun_name = _tmp52_;
	_tmp53_ = edomain;
	_tmp54_ = vala_get_ccode_upper_case_name ((ValaSymbol*) _tmp53_, NULL);
	_tmp55_ = _tmp54_;
	_tmp56_ = quark_fun_name;
	_tmp57_ = g_strconcat (_tmp56_, " ()", NULL);
	_tmp58_ = _tmp57_;
	_tmp59_ = vala_ccode_macro_replacement_new (_tmp55_, _tmp58_);
	_tmp60_ = _tmp59_;
	_g_free0 (_tmp58_);
	_g_free0 (_tmp55_);
	error_domain_define = _tmp60_;
	_tmp61_ = decl_space;
	_tmp62_ = error_domain_define;
	vala_ccode_file_add_type_definition (_tmp61_, (ValaCCodeNode*) _tmp62_);
	_tmp63_ = quark_fun_name;
	_tmp64_ = ((ValaCCodeBaseModule*) self)->gquark_type;
	_tmp65_ = vala_data_type_get_data_type (_tmp64_);
	_tmp66_ = _tmp65_;
	_tmp67_ = vala_get_ccode_name ((ValaCodeNode*) _tmp66_);
	_tmp68_ = _tmp67_;
	_tmp69_ = vala_ccode_function_new (_tmp63_, _tmp68_);
	_tmp70_ = _tmp69_;
	_g_free0 (_tmp68_);
	cquark_fun = _tmp70_;
	_tmp71_ = decl_space;
	_tmp72_ = cquark_fun;
	vala_ccode_file_add_function_declaration (_tmp71_, _tmp72_);
	_vala_ccode_node_unref0 (cquark_fun);
	_vala_ccode_node_unref0 (error_domain_define);
	_g_free0 (quark_fun_name);
	_vala_ccode_node_unref0 (cenum);
}


static void vala_gerror_module_real_visit_error_domain (ValaCodeVisitor* base, ValaErrorDomain* edomain) {
	ValaGErrorModule * self;
	ValaErrorDomain* _tmp0_;
	ValaComment* _tmp1_;
	ValaComment* _tmp2_;
	ValaErrorDomain* _tmp11_;
	ValaCCodeFile* _tmp12_;
	ValaErrorDomain* _tmp13_;
	gboolean _tmp14_;
	ValaErrorDomain* _tmp17_;
	gboolean _tmp18_;
	gchar* quark_fun_name = NULL;
	ValaErrorDomain* _tmp21_;
	gchar* _tmp22_;
	gchar* _tmp23_;
	gchar* _tmp24_;
	gchar* _tmp25_;
	ValaCCodeFunction* cquark_fun = NULL;
	ValaDataType* _tmp26_;
	ValaTypeSymbol* _tmp27_;
	ValaTypeSymbol* _tmp28_;
	gchar* _tmp29_;
	gchar* _tmp30_;
	ValaCCodeFunction* _tmp31_;
	ValaCCodeFunction* _tmp32_;
	ValaCCodeFunctionCall* cquark_call = NULL;
	ValaCCodeIdentifier* _tmp33_;
	ValaCCodeIdentifier* _tmp34_;
	ValaCCodeFunctionCall* _tmp35_;
	ValaCCodeFunctionCall* _tmp36_;
	ValaErrorDomain* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	gchar* _tmp41_;
	gchar* _tmp42_;
	gchar* _tmp43_;
	ValaCCodeConstant* _tmp44_;
	ValaCCodeConstant* _tmp45_;
	ValaCCodeFunction* _tmp46_;
	ValaCCodeFunction* _tmp47_;
	ValaCCodeFile* _tmp48_;
	self = (ValaGErrorModule*) base;
	g_return_if_fail (edomain != NULL);
	_tmp0_ = edomain;
	_tmp1_ = vala_symbol_get_comment ((ValaSymbol*) _tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		ValaCCodeFile* _tmp3_;
		ValaErrorDomain* _tmp4_;
		ValaComment* _tmp5_;
		ValaComment* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		ValaCCodeComment* _tmp9_;
		ValaCCodeComment* _tmp10_;
		_tmp3_ = ((ValaCCodeBaseModule*) self)->cfile;
		_tmp4_ = edomain;
		_tmp5_ = vala_symbol_get_comment ((ValaSymbol*) _tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = vala_comment_get_content (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = vala_ccode_comment_new (_tmp8_);
		_tmp10_ = _tmp9_;
		vala_ccode_file_add_type_definition (_tmp3_, (ValaCCodeNode*) _tmp10_);
		_vala_ccode_node_unref0 (_tmp10_);
	}
	_tmp11_ = edomain;
	_tmp12_ = ((ValaCCodeBaseModule*) self)->cfile;
	vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, _tmp11_, _tmp12_);
	_tmp13_ = edomain;
	_tmp14_ = vala_symbol_is_internal_symbol ((ValaSymbol*) _tmp13_);
	if (!_tmp14_) {
		ValaErrorDomain* _tmp15_;
		ValaCCodeFile* _tmp16_;
		_tmp15_ = edomain;
		_tmp16_ = ((ValaCCodeBaseModule*) self)->header_file;
		vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, _tmp15_, _tmp16_);
	}
	_tmp17_ = edomain;
	_tmp18_ = vala_symbol_is_private_symbol ((ValaSymbol*) _tmp17_);
	if (!_tmp18_) {
		ValaErrorDomain* _tmp19_;
		ValaCCodeFile* _tmp20_;
		_tmp19_ = edomain;
		_tmp20_ = ((ValaCCodeBaseModule*) self)->internal_header_file;
		vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, _tmp19_, _tmp20_);
	}
	_tmp21_ = edomain;
	_tmp22_ = vala_get_ccode_lower_case_prefix ((ValaSymbol*) _tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = g_strconcat (_tmp23_, "quark", NULL);
	_tmp25_ = _tmp24_;
	_g_free0 (_tmp23_);
	quark_fun_name = _tmp25_;
	_tmp26_ = ((ValaCCodeBaseModule*) self)->gquark_type;
	_tmp27_ = vala_data_type_get_data_type (_tmp26_);
	_tmp28_ = _tmp27_;
	_tmp29_ = vala_get_ccode_name ((ValaCodeNode*) _tmp28_);
	_tmp30_ = _tmp29_;
	_tmp31_ = vala_ccode_function_new (quark_fun_name, _tmp30_);
	_tmp32_ = _tmp31_;
	_g_free0 (_tmp30_);
	cquark_fun = _tmp32_;
	vala_ccode_base_module_push_function ((ValaCCodeBaseModule*) self, cquark_fun);
	_tmp33_ = vala_ccode_identifier_new ("g_quark_from_static_string");
	_tmp34_ = _tmp33_;
	_tmp35_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp34_);
	_tmp36_ = _tmp35_;
	_vala_ccode_node_unref0 (_tmp34_);
	cquark_call = _tmp36_;
	_tmp37_ = edomain;
	_tmp38_ = vala_get_ccode_quark_name (_tmp37_);
	_tmp39_ = _tmp38_;
	_tmp40_ = g_strconcat ("\"", _tmp39_, NULL);
	_tmp41_ = _tmp40_;
	_tmp42_ = g_strconcat (_tmp41_, "\"", NULL);
	_tmp43_ = _tmp42_;
	_tmp44_ = vala_ccode_constant_new (_tmp43_);
	_tmp45_ = _tmp44_;
	vala_ccode_function_call_add_argument (cquark_call, (ValaCCodeExpression*) _tmp45_);
	_vala_ccode_node_unref0 (_tmp45_);
	_g_free0 (_tmp43_);
	_g_free0 (_tmp41_);
	_g_free0 (_tmp39_);
	_tmp46_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp47_ = _tmp46_;
	vala_ccode_function_add_return (_tmp47_, (ValaCCodeExpression*) cquark_call);
	vala_ccode_base_module_pop_function ((ValaCCodeBaseModule*) self);
	_tmp48_ = ((ValaCCodeBaseModule*) self)->cfile;
	vala_ccode_file_add_function (_tmp48_, cquark_fun);
	_vala_ccode_node_unref0 (cquark_call);
	_vala_ccode_node_unref0 (cquark_fun);
	_g_free0 (quark_fun_name);
}


static void vala_gerror_module_real_visit_throw_statement (ValaCodeVisitor* base, ValaThrowStatement* stmt) {
	ValaGErrorModule * self;
	ValaCCodeFunction* _tmp0_;
	ValaCCodeFunction* _tmp1_;
	ValaCCodeExpression* _tmp2_;
	ValaCCodeExpression* _tmp3_;
	ValaThrowStatement* _tmp4_;
	ValaExpression* _tmp5_;
	ValaExpression* _tmp6_;
	ValaCCodeExpression* _tmp7_;
	ValaCCodeExpression* _tmp8_;
	ValaThrowStatement* _tmp9_;
	self = (ValaGErrorModule*) base;
	g_return_if_fail (stmt != NULL);
	vala_ccode_base_module_set_current_method_inner_error ((ValaCCodeBaseModule*) self, TRUE);
	_tmp0_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
	_tmp3_ = _tmp2_;
	_tmp4_ = stmt;
	_tmp5_ = vala_throw_statement_get_error_expression (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp6_);
	_tmp8_ = _tmp7_;
	vala_ccode_function_add_assignment (_tmp1_, _tmp3_, _tmp8_);
	_vala_ccode_node_unref0 (_tmp8_);
	_vala_ccode_node_unref0 (_tmp3_);
	_tmp9_ = stmt;
	vala_ccode_base_module_add_simple_check ((ValaCCodeBaseModule*) self, (ValaCodeNode*) _tmp9_, TRUE);
}


static gpointer _vala_code_node_ref0 (gpointer self) {
	return self ? vala_code_node_ref (self) : NULL;
}


static void vala_gerror_module_real_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr) {
	ValaCCodeFunctionCall* cpropagate = NULL;
	ValaCCodeIdentifier* _tmp0_;
	ValaCCodeIdentifier* _tmp1_;
	ValaCCodeFunctionCall* _tmp2_;
	ValaCCodeFunctionCall* _tmp3_;
	ValaCCodeFunctionCall* _tmp4_;
	ValaCCodeIdentifier* _tmp5_;
	ValaCCodeIdentifier* _tmp6_;
	ValaCCodeFunctionCall* _tmp7_;
	ValaCCodeExpression* _tmp8_;
	ValaCCodeFunction* _tmp9_;
	ValaCCodeFunction* _tmp10_;
	ValaCCodeFunctionCall* _tmp11_;
	ValaSymbol* _tmp12_;
	ValaSymbol* _tmp13_;
	gboolean _tmp14_ = FALSE;
	ValaMethod* _tmp15_;
	ValaMethod* _tmp16_;
	g_return_if_fail (error_expr != NULL);
	_tmp0_ = vala_ccode_identifier_new ("g_propagate_error");
	_tmp1_ = _tmp0_;
	_tmp2_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp1_);
	_tmp3_ = _tmp2_;
	_vala_ccode_node_unref0 (_tmp1_);
	cpropagate = _tmp3_;
	_tmp4_ = cpropagate;
	_tmp5_ = vala_ccode_identifier_new ("error");
	_tmp6_ = _tmp5_;
	vala_ccode_function_call_add_argument (_tmp4_, (ValaCCodeExpression*) _tmp6_);
	_vala_ccode_node_unref0 (_tmp6_);
	_tmp7_ = cpropagate;
	_tmp8_ = error_expr;
	vala_ccode_function_call_add_argument (_tmp7_, _tmp8_);
	_tmp9_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp10_ = _tmp9_;
	_tmp11_ = cpropagate;
	vala_ccode_function_add_expression (_tmp10_, (ValaCCodeExpression*) _tmp11_);
	_tmp12_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
	_tmp13_ = _tmp12_;
	vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp13_, FALSE, NULL);
	_tmp15_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
	_tmp16_ = _tmp15_;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, VALA_TYPE_CREATION_METHOD)) {
		ValaMethod* _tmp17_;
		ValaMethod* _tmp18_;
		ValaSymbol* _tmp19_;
		ValaSymbol* _tmp20_;
		_tmp17_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
		_tmp18_ = _tmp17_;
		_tmp19_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp18_);
		_tmp20_ = _tmp19_;
		_tmp14_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, VALA_TYPE_CLASS);
	} else {
		_tmp14_ = FALSE;
	}
	if (_tmp14_) {
		ValaClass* cl = NULL;
		ValaMethod* _tmp21_;
		ValaMethod* _tmp22_;
		ValaSymbol* _tmp23_;
		ValaSymbol* _tmp24_;
		ValaClass* _tmp25_;
		ValaCCodeFunction* _tmp26_;
		ValaCCodeFunction* _tmp27_;
		ValaClass* _tmp28_;
		ValaObjectType* _tmp29_;
		ValaObjectType* _tmp30_;
		ValaCCodeIdentifier* _tmp31_;
		ValaCCodeIdentifier* _tmp32_;
		ValaGLibValue* _tmp33_;
		ValaGLibValue* _tmp34_;
		ValaCCodeExpression* _tmp35_;
		ValaCCodeExpression* _tmp36_;
		ValaCCodeFunction* _tmp37_;
		ValaCCodeFunction* _tmp38_;
		ValaCCodeConstant* _tmp39_;
		ValaCCodeConstant* _tmp40_;
		_tmp21_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
		_tmp22_ = _tmp21_;
		_tmp23_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp22_);
		_tmp24_ = _tmp23_;
		_tmp25_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp24_, VALA_TYPE_CLASS, ValaClass));
		cl = _tmp25_;
		_tmp26_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
		_tmp27_ = _tmp26_;
		_tmp28_ = cl;
		_tmp29_ = vala_object_type_new ((ValaObjectTypeSymbol*) _tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = vala_ccode_identifier_new ("self");
		_tmp32_ = _tmp31_;
		_tmp33_ = vala_glib_value_new ((ValaDataType*) _tmp30_, (ValaCCodeExpression*) _tmp32_, TRUE);
		_tmp34_ = _tmp33_;
		_tmp35_ = vala_ccode_base_module_destroy_value ((ValaCCodeBaseModule*) self, (ValaTargetValue*) _tmp34_, FALSE);
		_tmp36_ = _tmp35_;
		vala_ccode_function_add_expression (_tmp27_, _tmp36_);
		_vala_ccode_node_unref0 (_tmp36_);
		_vala_target_value_unref0 (_tmp34_);
		_vala_ccode_node_unref0 (_tmp32_);
		_vala_code_node_unref0 (_tmp30_);
		_tmp37_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
		_tmp38_ = _tmp37_;
		_tmp39_ = vala_ccode_constant_new ("NULL");
		_tmp40_ = _tmp39_;
		vala_ccode_function_add_return (_tmp38_, (ValaCCodeExpression*) _tmp40_);
		_vala_ccode_node_unref0 (_tmp40_);
		_vala_code_node_unref0 (cl);
	} else {
		gboolean _tmp41_;
		_tmp41_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
		if (_tmp41_) {
			ValaCCodeFunction* _tmp42_;
			ValaCCodeFunction* _tmp43_;
			ValaCCodeConstant* _tmp44_;
			ValaCCodeConstant* _tmp45_;
			_tmp42_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
			_tmp43_ = _tmp42_;
			_tmp44_ = vala_ccode_constant_new ("FALSE");
			_tmp45_ = _tmp44_;
			vala_ccode_function_add_return (_tmp43_, (ValaCCodeExpression*) _tmp45_);
			_vala_ccode_node_unref0 (_tmp45_);
		} else {
			ValaDataType* _tmp46_;
			ValaDataType* _tmp47_;
			_tmp46_ = vala_ccode_base_module_get_current_return_type ((ValaCCodeBaseModule*) self);
			_tmp47_ = _tmp46_;
			vala_ccode_base_module_return_default_value ((ValaCCodeBaseModule*) self, _tmp47_);
		}
	}
	_vala_ccode_node_unref0 (cpropagate);
}


void vala_gerror_module_return_with_exception (ValaGErrorModule* self, ValaCCodeExpression* error_expr) {
	g_return_if_fail (self != NULL);
	VALA_GERROR_MODULE_GET_CLASS (self)->return_with_exception (self, error_expr);
}


static void vala_gerror_module_uncaught_error_statement (ValaGErrorModule* self, ValaCCodeExpression* inner_error, gboolean unexpected) {
	ValaSymbol* _tmp0_;
	ValaSymbol* _tmp1_;
	ValaCCodeFunctionCall* ccritical = NULL;
	ValaCCodeIdentifier* _tmp2_;
	ValaCCodeIdentifier* _tmp3_;
	ValaCCodeFunctionCall* _tmp4_;
	ValaCCodeFunctionCall* _tmp5_;
	const gchar* _tmp6_ = NULL;
	gboolean _tmp7_;
	ValaCCodeFunctionCall* _tmp8_;
	ValaCCodeConstant* _tmp9_;
	ValaCCodeConstant* _tmp10_;
	ValaCCodeFunctionCall* _tmp11_;
	ValaCCodeConstant* _tmp12_;
	ValaCCodeConstant* _tmp13_;
	ValaCCodeFunctionCall* _tmp14_;
	ValaCCodeConstant* _tmp15_;
	ValaCCodeConstant* _tmp16_;
	ValaCCodeFunctionCall* _tmp17_;
	ValaCCodeExpression* _tmp18_;
	ValaCCodeMemberAccess* _tmp19_;
	ValaCCodeMemberAccess* _tmp20_;
	ValaCCodeFunctionCall* domain_name = NULL;
	ValaCCodeIdentifier* _tmp21_;
	ValaCCodeIdentifier* _tmp22_;
	ValaCCodeFunctionCall* _tmp23_;
	ValaCCodeFunctionCall* _tmp24_;
	ValaCCodeFunctionCall* _tmp25_;
	ValaCCodeExpression* _tmp26_;
	ValaCCodeMemberAccess* _tmp27_;
	ValaCCodeMemberAccess* _tmp28_;
	ValaCCodeFunctionCall* _tmp29_;
	ValaCCodeFunctionCall* _tmp30_;
	ValaCCodeFunctionCall* _tmp31_;
	ValaCCodeExpression* _tmp32_;
	ValaCCodeMemberAccess* _tmp33_;
	ValaCCodeMemberAccess* _tmp34_;
	ValaCCodeFunctionCall* cclear = NULL;
	ValaCCodeIdentifier* _tmp35_;
	ValaCCodeIdentifier* _tmp36_;
	ValaCCodeFunctionCall* _tmp37_;
	ValaCCodeFunctionCall* _tmp38_;
	ValaCCodeFunctionCall* _tmp39_;
	ValaCCodeExpression* _tmp40_;
	ValaCCodeUnaryExpression* _tmp41_;
	ValaCCodeUnaryExpression* _tmp42_;
	ValaCCodeFunction* _tmp43_;
	ValaCCodeFunction* _tmp44_;
	ValaCCodeFunctionCall* _tmp45_;
	ValaCCodeFunction* _tmp46_;
	ValaCCodeFunction* _tmp47_;
	ValaCCodeFunctionCall* _tmp48_;
	gboolean _tmp49_ = FALSE;
	gboolean _tmp50_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (inner_error != NULL);
	_tmp0_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
	_tmp1_ = _tmp0_;
	vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp1_, FALSE, NULL);
	_tmp2_ = vala_ccode_identifier_new ("g_critical");
	_tmp3_ = _tmp2_;
	_tmp4_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp3_);
	_tmp5_ = _tmp4_;
	_vala_ccode_node_unref0 (_tmp3_);
	ccritical = _tmp5_;
	_tmp7_ = unexpected;
	if (_tmp7_) {
		_tmp6_ = "\"file %s: line %d: unexpected error: %s (%s, %d)\"";
	} else {
		_tmp6_ = "\"file %s: line %d: uncaught error: %s (%s, %d)\"";
	}
	_tmp8_ = ccritical;
	_tmp9_ = vala_ccode_constant_new (_tmp6_);
	_tmp10_ = _tmp9_;
	vala_ccode_function_call_add_argument (_tmp8_, (ValaCCodeExpression*) _tmp10_);
	_vala_ccode_node_unref0 (_tmp10_);
	_tmp11_ = ccritical;
	_tmp12_ = vala_ccode_constant_new ("__FILE__");
	_tmp13_ = _tmp12_;
	vala_ccode_function_call_add_argument (_tmp11_, (ValaCCodeExpression*) _tmp13_);
	_vala_ccode_node_unref0 (_tmp13_);
	_tmp14_ = ccritical;
	_tmp15_ = vala_ccode_constant_new ("__LINE__");
	_tmp16_ = _tmp15_;
	vala_ccode_function_call_add_argument (_tmp14_, (ValaCCodeExpression*) _tmp16_);
	_vala_ccode_node_unref0 (_tmp16_);
	_tmp17_ = ccritical;
	_tmp18_ = inner_error;
	_tmp19_ = vala_ccode_member_access_new_pointer (_tmp18_, "message");
	_tmp20_ = _tmp19_;
	vala_ccode_function_call_add_argument (_tmp17_, (ValaCCodeExpression*) _tmp20_);
	_vala_ccode_node_unref0 (_tmp20_);
	_tmp21_ = vala_ccode_identifier_new ("g_quark_to_string");
	_tmp22_ = _tmp21_;
	_tmp23_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp22_);
	_tmp24_ = _tmp23_;
	_vala_ccode_node_unref0 (_tmp22_);
	domain_name = _tmp24_;
	_tmp25_ = domain_name;
	_tmp26_ = inner_error;
	_tmp27_ = vala_ccode_member_access_new_pointer (_tmp26_, "domain");
	_tmp28_ = _tmp27_;
	vala_ccode_function_call_add_argument (_tmp25_, (ValaCCodeExpression*) _tmp28_);
	_vala_ccode_node_unref0 (_tmp28_);
	_tmp29_ = ccritical;
	_tmp30_ = domain_name;
	vala_ccode_function_call_add_argument (_tmp29_, (ValaCCodeExpression*) _tmp30_);
	_tmp31_ = ccritical;
	_tmp32_ = inner_error;
	_tmp33_ = vala_ccode_member_access_new_pointer (_tmp32_, "code");
	_tmp34_ = _tmp33_;
	vala_ccode_function_call_add_argument (_tmp31_, (ValaCCodeExpression*) _tmp34_);
	_vala_ccode_node_unref0 (_tmp34_);
	_tmp35_ = vala_ccode_identifier_new ("g_clear_error");
	_tmp36_ = _tmp35_;
	_tmp37_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp36_);
	_tmp38_ = _tmp37_;
	_vala_ccode_node_unref0 (_tmp36_);
	cclear = _tmp38_;
	_tmp39_ = cclear;
	_tmp40_ = inner_error;
	_tmp41_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp40_);
	_tmp42_ = _tmp41_;
	vala_ccode_function_call_add_argument (_tmp39_, (ValaCCodeExpression*) _tmp42_);
	_vala_ccode_node_unref0 (_tmp42_);
	_tmp43_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp44_ = _tmp43_;
	_tmp45_ = ccritical;
	vala_ccode_function_add_expression (_tmp44_, (ValaCCodeExpression*) _tmp45_);
	_tmp46_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp47_ = _tmp46_;
	_tmp48_ = cclear;
	vala_ccode_function_add_expression (_tmp47_, (ValaCCodeExpression*) _tmp48_);
	_tmp50_ = vala_ccode_base_module_is_in_constructor ((ValaCCodeBaseModule*) self);
	if (_tmp50_) {
		_tmp49_ = TRUE;
	} else {
		gboolean _tmp51_;
		_tmp51_ = vala_ccode_base_module_is_in_destructor ((ValaCCodeBaseModule*) self);
		_tmp49_ = _tmp51_;
	}
	if (_tmp49_) {
	} else {
		ValaMethod* _tmp52_;
		ValaMethod* _tmp53_;
		_tmp52_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
		_tmp53_ = _tmp52_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp53_, VALA_TYPE_CREATION_METHOD)) {
			ValaMethod* _tmp54_;
			ValaMethod* _tmp55_;
			ValaSymbol* _tmp56_;
			ValaSymbol* _tmp57_;
			_tmp54_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
			_tmp55_ = _tmp54_;
			_tmp56_ = vala_symbol_get_parent_symbol ((ValaSymbol*) _tmp55_);
			_tmp57_ = _tmp56_;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp57_, VALA_TYPE_STRUCT)) {
				ValaCCodeFunction* _tmp58_;
				ValaCCodeFunction* _tmp59_;
				_tmp58_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp59_ = _tmp58_;
				vala_ccode_function_add_return (_tmp59_, NULL);
			} else {
				ValaCCodeFunction* _tmp60_;
				ValaCCodeFunction* _tmp61_;
				ValaCCodeConstant* _tmp62_;
				ValaCCodeConstant* _tmp63_;
				_tmp60_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp61_ = _tmp60_;
				_tmp62_ = vala_ccode_constant_new ("NULL");
				_tmp63_ = _tmp62_;
				vala_ccode_function_add_return (_tmp61_, (ValaCCodeExpression*) _tmp63_);
				_vala_ccode_node_unref0 (_tmp63_);
			}
		} else {
			gboolean _tmp64_;
			_tmp64_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
			if (_tmp64_) {
				ValaCCodeMemberAccess* async_result_expr = NULL;
				ValaCCodeIdentifier* _tmp65_;
				ValaCCodeIdentifier* _tmp66_;
				ValaCCodeMemberAccess* _tmp67_;
				ValaCCodeMemberAccess* _tmp68_;
				ValaCCodeFunctionCall* unref = NULL;
				ValaCCodeIdentifier* _tmp69_;
				ValaCCodeIdentifier* _tmp70_;
				ValaCCodeFunctionCall* _tmp71_;
				ValaCCodeFunctionCall* _tmp72_;
				ValaCCodeFunctionCall* _tmp73_;
				ValaCCodeMemberAccess* _tmp74_;
				ValaCCodeFunction* _tmp75_;
				ValaCCodeFunction* _tmp76_;
				ValaCCodeFunctionCall* _tmp77_;
				ValaCCodeFunction* _tmp78_;
				ValaCCodeFunction* _tmp79_;
				ValaCCodeConstant* _tmp80_;
				ValaCCodeConstant* _tmp81_;
				_tmp65_ = vala_ccode_identifier_new ("_data_");
				_tmp66_ = _tmp65_;
				_tmp67_ = vala_ccode_member_access_new_pointer ((ValaCCodeExpression*) _tmp66_, "_async_result");
				_tmp68_ = _tmp67_;
				_vala_ccode_node_unref0 (_tmp66_);
				async_result_expr = _tmp68_;
				_tmp69_ = vala_ccode_identifier_new ("g_object_unref");
				_tmp70_ = _tmp69_;
				_tmp71_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp70_);
				_tmp72_ = _tmp71_;
				_vala_ccode_node_unref0 (_tmp70_);
				unref = _tmp72_;
				_tmp73_ = unref;
				_tmp74_ = async_result_expr;
				vala_ccode_function_call_add_argument (_tmp73_, (ValaCCodeExpression*) _tmp74_);
				_tmp75_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp76_ = _tmp75_;
				_tmp77_ = unref;
				vala_ccode_function_add_expression (_tmp76_, (ValaCCodeExpression*) _tmp77_);
				_tmp78_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp79_ = _tmp78_;
				_tmp80_ = vala_ccode_constant_new ("FALSE");
				_tmp81_ = _tmp80_;
				vala_ccode_function_add_return (_tmp79_, (ValaCCodeExpression*) _tmp81_);
				_vala_ccode_node_unref0 (_tmp81_);
				_vala_ccode_node_unref0 (unref);
				_vala_ccode_node_unref0 (async_result_expr);
			} else {
				ValaDataType* _tmp82_;
				ValaDataType* _tmp83_;
				_tmp82_ = vala_ccode_base_module_get_current_return_type ((ValaCCodeBaseModule*) self);
				_tmp83_ = _tmp82_;
				if (_tmp83_ != NULL) {
					ValaDataType* _tmp84_;
					ValaDataType* _tmp85_;
					_tmp84_ = vala_ccode_base_module_get_current_return_type ((ValaCCodeBaseModule*) self);
					_tmp85_ = _tmp84_;
					vala_ccode_base_module_return_default_value ((ValaCCodeBaseModule*) self, _tmp85_);
				}
			}
		}
	}
	_vala_ccode_node_unref0 (cclear);
	_vala_ccode_node_unref0 (domain_name);
	_vala_ccode_node_unref0 (ccritical);
}


static gboolean vala_gerror_module_in_finally_block (ValaGErrorModule* self, ValaCodeNode* node) {
	gboolean result = FALSE;
	ValaCodeNode* current_node = NULL;
	ValaCodeNode* _tmp0_;
	ValaCodeNode* _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (node != NULL, FALSE);
	_tmp0_ = node;
	_tmp1_ = _vala_code_node_ref0 (_tmp0_);
	current_node = _tmp1_;
	while (TRUE) {
		ValaCodeNode* _tmp2_;
		ValaTryStatement* try_stmt = NULL;
		ValaCodeNode* _tmp3_;
		ValaCodeNode* _tmp4_;
		ValaCodeNode* _tmp5_;
		ValaTryStatement* _tmp6_;
		gboolean _tmp7_ = FALSE;
		ValaTryStatement* _tmp8_;
		ValaCodeNode* _tmp13_;
		ValaCodeNode* _tmp14_;
		ValaCodeNode* _tmp15_;
		ValaCodeNode* _tmp16_;
		_tmp2_ = current_node;
		if (!(_tmp2_ != NULL)) {
			break;
		}
		_tmp3_ = current_node;
		_tmp4_ = vala_code_node_get_parent_node (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, VALA_TYPE_TRY_STATEMENT) ? ((ValaTryStatement*) _tmp5_) : NULL);
		try_stmt = _tmp6_;
		_tmp8_ = try_stmt;
		if (_tmp8_ != NULL) {
			ValaTryStatement* _tmp9_;
			ValaBlock* _tmp10_;
			ValaBlock* _tmp11_;
			ValaCodeNode* _tmp12_;
			_tmp9_ = try_stmt;
			_tmp10_ = vala_try_statement_get_finally_body (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = current_node;
			_tmp7_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, VALA_TYPE_CODE_NODE, ValaCodeNode) == _tmp12_;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			result = TRUE;
			_vala_code_node_unref0 (try_stmt);
			_vala_code_node_unref0 (current_node);
			return result;
		}
		_tmp13_ = current_node;
		_tmp14_ = vala_code_node_get_parent_node (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = _vala_code_node_ref0 (_tmp15_);
		_vala_code_node_unref0 (current_node);
		current_node = _tmp16_;
		_vala_code_node_unref0 (try_stmt);
	}
	result = FALSE;
	_vala_code_node_unref0 (current_node);
	return result;
}


static gpointer _vala_iterable_ref0 (gpointer self) {
	return self ? vala_iterable_ref (self) : NULL;
}


static gpointer _vala_ccode_node_ref0 (gpointer self) {
	return self ? vala_ccode_node_ref (self) : NULL;
}


static void vala_gerror_module_real_add_simple_check (ValaCCodeBaseModule* base, ValaCodeNode* node, gboolean always_fails) {
	ValaGErrorModule * self;
	ValaCCodeExpression* inner_error = NULL;
	ValaCCodeExpression* _tmp0_;
	gboolean _tmp1_;
	ValaTryStatement* _tmp16_;
	ValaTryStatement* _tmp17_;
	gboolean _tmp225_;
	self = (ValaGErrorModule*) base;
	g_return_if_fail (node != NULL);
	vala_ccode_base_module_set_current_method_inner_error ((ValaCCodeBaseModule*) self, TRUE);
	_tmp0_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
	inner_error = _tmp0_;
	_tmp1_ = always_fails;
	if (_tmp1_) {
	} else {
		ValaCCodeBinaryExpression* ccond = NULL;
		ValaCCodeExpression* _tmp2_;
		ValaCCodeConstant* _tmp3_;
		ValaCCodeConstant* _tmp4_;
		ValaCCodeBinaryExpression* _tmp5_;
		ValaCCodeBinaryExpression* _tmp6_;
		ValaCCodeFunctionCall* unlikely = NULL;
		ValaCCodeIdentifier* _tmp7_;
		ValaCCodeIdentifier* _tmp8_;
		ValaCCodeFunctionCall* _tmp9_;
		ValaCCodeFunctionCall* _tmp10_;
		ValaCCodeFunctionCall* _tmp11_;
		ValaCCodeBinaryExpression* _tmp12_;
		ValaCCodeFunction* _tmp13_;
		ValaCCodeFunction* _tmp14_;
		ValaCCodeFunctionCall* _tmp15_;
		_tmp2_ = inner_error;
		_tmp3_ = vala_ccode_constant_new ("NULL");
		_tmp4_ = _tmp3_;
		_tmp5_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp2_, (ValaCCodeExpression*) _tmp4_);
		_tmp6_ = _tmp5_;
		_vala_ccode_node_unref0 (_tmp4_);
		ccond = _tmp6_;
		_tmp7_ = vala_ccode_identifier_new ("G_UNLIKELY");
		_tmp8_ = _tmp7_;
		_tmp9_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp8_);
		_tmp10_ = _tmp9_;
		_vala_ccode_node_unref0 (_tmp8_);
		unlikely = _tmp10_;
		_tmp11_ = unlikely;
		_tmp12_ = ccond;
		vala_ccode_function_call_add_argument (_tmp11_, (ValaCCodeExpression*) _tmp12_);
		_tmp13_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
		_tmp14_ = _tmp13_;
		_tmp15_ = unlikely;
		vala_ccode_function_open_if (_tmp14_, (ValaCCodeExpression*) _tmp15_);
		_vala_ccode_node_unref0 (unlikely);
		_vala_ccode_node_unref0 (ccond);
	}
	_tmp16_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
	_tmp17_ = _tmp16_;
	if (_tmp17_ != NULL) {
		gboolean _tmp18_;
		ValaArrayList* error_types = NULL;
		GEqualFunc _tmp27_;
		ValaArrayList* _tmp28_;
		gboolean has_general_catch_clause = FALSE;
		gboolean _tmp42_;
		gboolean _tmp159_;
		_tmp18_ = self->priv->is_in_catch;
		if (_tmp18_) {
			ValaSymbol* _tmp19_;
			ValaSymbol* _tmp20_;
			ValaCatchClause* _tmp21_;
			ValaCatchClause* _tmp22_;
			_tmp19_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
			_tmp20_ = _tmp19_;
			_tmp21_ = vala_ccode_base_module_get_current_catch ((ValaCCodeBaseModule*) self);
			_tmp22_ = _tmp21_;
			vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp20_, FALSE, (ValaCodeNode*) _tmp22_);
		} else {
			ValaSymbol* _tmp23_;
			ValaSymbol* _tmp24_;
			ValaTryStatement* _tmp25_;
			ValaTryStatement* _tmp26_;
			_tmp23_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
			_tmp24_ = _tmp23_;
			_tmp25_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
			_tmp26_ = _tmp25_;
			vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp24_, FALSE, (ValaCodeNode*) _tmp26_);
		}
		_tmp27_ = g_direct_equal;
		_tmp28_ = vala_array_list_new (VALA_TYPE_DATA_TYPE, (GBoxedCopyFunc) vala_code_node_ref, (GDestroyNotify) vala_code_node_unref, _tmp27_);
		error_types = _tmp28_;
		{
			ValaList* _node_error_type_list = NULL;
			ValaCodeNode* _tmp29_;
			ValaList* _tmp30_;
			gint _node_error_type_size = 0;
			ValaList* _tmp31_;
			gint _tmp32_;
			gint _tmp33_;
			gint _node_error_type_index = 0;
			_tmp29_ = node;
			_tmp30_ = vala_code_node_get_error_types (_tmp29_);
			_node_error_type_list = _tmp30_;
			_tmp31_ = _node_error_type_list;
			_tmp32_ = vala_collection_get_size ((ValaCollection*) _tmp31_);
			_tmp33_ = _tmp32_;
			_node_error_type_size = _tmp33_;
			_node_error_type_index = -1;
			while (TRUE) {
				gint _tmp34_;
				gint _tmp35_;
				gint _tmp36_;
				ValaDataType* node_error_type = NULL;
				ValaList* _tmp37_;
				gint _tmp38_;
				gpointer _tmp39_;
				ValaArrayList* _tmp40_;
				ValaDataType* _tmp41_;
				_tmp34_ = _node_error_type_index;
				_node_error_type_index = _tmp34_ + 1;
				_tmp35_ = _node_error_type_index;
				_tmp36_ = _node_error_type_size;
				if (!(_tmp35_ < _tmp36_)) {
					break;
				}
				_tmp37_ = _node_error_type_list;
				_tmp38_ = _node_error_type_index;
				_tmp39_ = vala_list_get (_tmp37_, _tmp38_);
				node_error_type = (ValaDataType*) _tmp39_;
				_tmp40_ = error_types;
				_tmp41_ = node_error_type;
				vala_collection_add ((ValaCollection*) _tmp40_, _tmp41_);
				_vala_code_node_unref0 (node_error_type);
			}
			_vala_iterable_unref0 (_node_error_type_list);
		}
		has_general_catch_clause = FALSE;
		_tmp42_ = self->priv->is_in_catch;
		if (!_tmp42_) {
			ValaArrayList* handled_error_types = NULL;
			GEqualFunc _tmp43_;
			ValaArrayList* _tmp44_;
			_tmp43_ = g_direct_equal;
			_tmp44_ = vala_array_list_new (VALA_TYPE_DATA_TYPE, (GBoxedCopyFunc) vala_code_node_ref, (GDestroyNotify) vala_code_node_unref, _tmp43_);
			handled_error_types = _tmp44_;
			{
				ValaList* _clause_list = NULL;
				ValaTryStatement* _tmp45_;
				ValaTryStatement* _tmp46_;
				ValaList* _tmp47_;
				gint _clause_size = 0;
				ValaList* _tmp48_;
				gint _tmp49_;
				gint _tmp50_;
				gint _clause_index = 0;
				_tmp45_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
				_tmp46_ = _tmp45_;
				_tmp47_ = vala_try_statement_get_catch_clauses (_tmp46_);
				_clause_list = _tmp47_;
				_tmp48_ = _clause_list;
				_tmp49_ = vala_collection_get_size ((ValaCollection*) _tmp48_);
				_tmp50_ = _tmp49_;
				_clause_size = _tmp50_;
				_clause_index = -1;
				while (TRUE) {
					gint _tmp51_;
					gint _tmp52_;
					gint _tmp53_;
					ValaCatchClause* clause = NULL;
					ValaList* _tmp54_;
					gint _tmp55_;
					gpointer _tmp56_;
					ValaArrayList* _tmp92_;
					ValaCatchClause* _tmp93_;
					ValaDataType* _tmp94_;
					ValaDataType* _tmp95_;
					ValaErrorType* _tmp96_;
					gboolean _tmp97_;
					_tmp51_ = _clause_index;
					_clause_index = _tmp51_ + 1;
					_tmp52_ = _clause_index;
					_tmp53_ = _clause_size;
					if (!(_tmp52_ < _tmp53_)) {
						break;
					}
					_tmp54_ = _clause_list;
					_tmp55_ = _clause_index;
					_tmp56_ = vala_list_get (_tmp54_, _tmp55_);
					clause = (ValaCatchClause*) _tmp56_;
					{
						ValaArrayList* _node_error_type_list = NULL;
						ValaArrayList* _tmp57_;
						ValaArrayList* _tmp58_;
						gint _node_error_type_size = 0;
						ValaArrayList* _tmp59_;
						gint _tmp60_;
						gint _tmp61_;
						gint _node_error_type_index = 0;
						_tmp57_ = error_types;
						_tmp58_ = _vala_iterable_ref0 (_tmp57_);
						_node_error_type_list = _tmp58_;
						_tmp59_ = _node_error_type_list;
						_tmp60_ = vala_collection_get_size ((ValaCollection*) _tmp59_);
						_tmp61_ = _tmp60_;
						_node_error_type_size = _tmp61_;
						_node_error_type_index = -1;
						while (TRUE) {
							gint _tmp62_;
							gint _tmp63_;
							gint _tmp64_;
							ValaDataType* node_error_type = NULL;
							ValaArrayList* _tmp65_;
							gint _tmp66_;
							gpointer _tmp67_;
							gboolean _tmp68_ = FALSE;
							ValaCatchClause* _tmp69_;
							ValaDataType* _tmp70_;
							ValaDataType* _tmp71_;
							_tmp62_ = _node_error_type_index;
							_node_error_type_index = _tmp62_ + 1;
							_tmp63_ = _node_error_type_index;
							_tmp64_ = _node_error_type_size;
							if (!(_tmp63_ < _tmp64_)) {
								break;
							}
							_tmp65_ = _node_error_type_list;
							_tmp66_ = _node_error_type_index;
							_tmp67_ = vala_list_get ((ValaList*) _tmp65_, _tmp66_);
							node_error_type = (ValaDataType*) _tmp67_;
							_tmp69_ = clause;
							_tmp70_ = vala_catch_clause_get_error_type (_tmp69_);
							_tmp71_ = _tmp70_;
							if (_tmp71_ == NULL) {
								_tmp68_ = TRUE;
							} else {
								ValaDataType* _tmp72_;
								ValaCatchClause* _tmp73_;
								ValaDataType* _tmp74_;
								ValaDataType* _tmp75_;
								gboolean _tmp76_;
								_tmp72_ = node_error_type;
								_tmp73_ = clause;
								_tmp74_ = vala_catch_clause_get_error_type (_tmp73_);
								_tmp75_ = _tmp74_;
								_tmp76_ = vala_data_type_compatible (_tmp72_, _tmp75_);
								_tmp68_ = _tmp76_;
							}
							if (_tmp68_) {
								ValaArrayList* _tmp77_;
								ValaDataType* _tmp78_;
								_tmp77_ = handled_error_types;
								_tmp78_ = node_error_type;
								vala_collection_add ((ValaCollection*) _tmp77_, _tmp78_);
							}
							_vala_code_node_unref0 (node_error_type);
						}
						_vala_iterable_unref0 (_node_error_type_list);
					}
					{
						ValaArrayList* _handled_error_type_list = NULL;
						ValaArrayList* _tmp79_;
						ValaArrayList* _tmp80_;
						gint _handled_error_type_size = 0;
						ValaArrayList* _tmp81_;
						gint _tmp82_;
						gint _tmp83_;
						gint _handled_error_type_index = 0;
						_tmp79_ = handled_error_types;
						_tmp80_ = _vala_iterable_ref0 (_tmp79_);
						_handled_error_type_list = _tmp80_;
						_tmp81_ = _handled_error_type_list;
						_tmp82_ = vala_collection_get_size ((ValaCollection*) _tmp81_);
						_tmp83_ = _tmp82_;
						_handled_error_type_size = _tmp83_;
						_handled_error_type_index = -1;
						while (TRUE) {
							gint _tmp84_;
							gint _tmp85_;
							gint _tmp86_;
							ValaDataType* handled_error_type = NULL;
							ValaArrayList* _tmp87_;
							gint _tmp88_;
							gpointer _tmp89_;
							ValaArrayList* _tmp90_;
							ValaDataType* _tmp91_;
							_tmp84_ = _handled_error_type_index;
							_handled_error_type_index = _tmp84_ + 1;
							_tmp85_ = _handled_error_type_index;
							_tmp86_ = _handled_error_type_size;
							if (!(_tmp85_ < _tmp86_)) {
								break;
							}
							_tmp87_ = _handled_error_type_list;
							_tmp88_ = _handled_error_type_index;
							_tmp89_ = vala_list_get ((ValaList*) _tmp87_, _tmp88_);
							handled_error_type = (ValaDataType*) _tmp89_;
							_tmp90_ = error_types;
							_tmp91_ = handled_error_type;
							vala_collection_remove ((ValaCollection*) _tmp90_, _tmp91_);
							_vala_code_node_unref0 (handled_error_type);
						}
						_vala_iterable_unref0 (_handled_error_type_list);
					}
					_tmp92_ = handled_error_types;
					vala_collection_clear ((ValaCollection*) _tmp92_);
					_tmp93_ = clause;
					_tmp94_ = vala_catch_clause_get_error_type (_tmp93_);
					_tmp95_ = _tmp94_;
					_tmp96_ = ((ValaCCodeBaseModule*) self)->gerror_type;
					_tmp97_ = vala_data_type_equals (_tmp95_, (ValaDataType*) _tmp96_);
					if (_tmp97_) {
						ValaCCodeFunction* _tmp98_;
						ValaCCodeFunction* _tmp99_;
						ValaCatchClause* _tmp100_;
						const gchar* _tmp101_;
						const gchar* _tmp102_;
						has_general_catch_clause = TRUE;
						_tmp98_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
						_tmp99_ = _tmp98_;
						_tmp100_ = clause;
						_tmp101_ = vala_catch_clause_get_clabel_name (_tmp100_);
						_tmp102_ = _tmp101_;
						vala_ccode_function_add_goto (_tmp99_, _tmp102_);
						_vala_code_node_unref0 (clause);
						break;
					} else {
						ValaErrorType* catch_type = NULL;
						ValaCatchClause* _tmp103_;
						ValaDataType* _tmp104_;
						ValaDataType* _tmp105_;
						ValaErrorType* _tmp106_;
						ValaErrorType* _tmp107_;
						ValaErrorCode* _tmp108_;
						ValaErrorCode* _tmp109_;
						ValaCCodeFunction* _tmp152_;
						ValaCCodeFunction* _tmp153_;
						ValaCatchClause* _tmp154_;
						const gchar* _tmp155_;
						const gchar* _tmp156_;
						ValaCCodeFunction* _tmp157_;
						ValaCCodeFunction* _tmp158_;
						_tmp103_ = clause;
						_tmp104_ = vala_catch_clause_get_error_type (_tmp103_);
						_tmp105_ = _tmp104_;
						_tmp106_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp105_, VALA_TYPE_ERROR_TYPE) ? ((ValaErrorType*) _tmp105_) : NULL);
						catch_type = _tmp106_;
						_tmp107_ = catch_type;
						_tmp108_ = vala_error_type_get_error_code (_tmp107_);
						_tmp109_ = _tmp108_;
						if (_tmp109_ != NULL) {
							ValaCCodeFunctionCall* error_match = NULL;
							ValaCCodeIdentifier* _tmp110_;
							ValaCCodeIdentifier* _tmp111_;
							ValaCCodeFunctionCall* _tmp112_;
							ValaCCodeFunctionCall* _tmp113_;
							ValaCCodeFunctionCall* _tmp114_;
							ValaCCodeExpression* _tmp115_;
							ValaCCodeFunctionCall* _tmp116_;
							ValaErrorType* _tmp117_;
							ValaTypeSymbol* _tmp118_;
							ValaTypeSymbol* _tmp119_;
							gchar* _tmp120_;
							gchar* _tmp121_;
							ValaCCodeIdentifier* _tmp122_;
							ValaCCodeIdentifier* _tmp123_;
							ValaCCodeFunctionCall* _tmp124_;
							ValaErrorType* _tmp125_;
							ValaErrorCode* _tmp126_;
							ValaErrorCode* _tmp127_;
							gchar* _tmp128_;
							gchar* _tmp129_;
							ValaCCodeIdentifier* _tmp130_;
							ValaCCodeIdentifier* _tmp131_;
							ValaCCodeFunction* _tmp132_;
							ValaCCodeFunction* _tmp133_;
							ValaCCodeFunctionCall* _tmp134_;
							_tmp110_ = vala_ccode_identifier_new ("g_error_matches");
							_tmp111_ = _tmp110_;
							_tmp112_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp111_);
							_tmp113_ = _tmp112_;
							_vala_ccode_node_unref0 (_tmp111_);
							error_match = _tmp113_;
							_tmp114_ = error_match;
							_tmp115_ = inner_error;
							vala_ccode_function_call_add_argument (_tmp114_, _tmp115_);
							_tmp116_ = error_match;
							_tmp117_ = catch_type;
							_tmp118_ = vala_data_type_get_data_type ((ValaDataType*) _tmp117_);
							_tmp119_ = _tmp118_;
							_tmp120_ = vala_get_ccode_upper_case_name ((ValaSymbol*) _tmp119_, NULL);
							_tmp121_ = _tmp120_;
							_tmp122_ = vala_ccode_identifier_new (_tmp121_);
							_tmp123_ = _tmp122_;
							vala_ccode_function_call_add_argument (_tmp116_, (ValaCCodeExpression*) _tmp123_);
							_vala_ccode_node_unref0 (_tmp123_);
							_g_free0 (_tmp121_);
							_tmp124_ = error_match;
							_tmp125_ = catch_type;
							_tmp126_ = vala_error_type_get_error_code (_tmp125_);
							_tmp127_ = _tmp126_;
							_tmp128_ = vala_get_ccode_name ((ValaCodeNode*) _tmp127_);
							_tmp129_ = _tmp128_;
							_tmp130_ = vala_ccode_identifier_new (_tmp129_);
							_tmp131_ = _tmp130_;
							vala_ccode_function_call_add_argument (_tmp124_, (ValaCCodeExpression*) _tmp131_);
							_vala_ccode_node_unref0 (_tmp131_);
							_g_free0 (_tmp129_);
							_tmp132_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
							_tmp133_ = _tmp132_;
							_tmp134_ = error_match;
							vala_ccode_function_open_if (_tmp133_, (ValaCCodeExpression*) _tmp134_);
							_vala_ccode_node_unref0 (error_match);
						} else {
							ValaCCodeBinaryExpression* ccond = NULL;
							ValaCCodeExpression* _tmp135_;
							ValaCCodeMemberAccess* _tmp136_;
							ValaCCodeMemberAccess* _tmp137_;
							ValaCatchClause* _tmp138_;
							ValaDataType* _tmp139_;
							ValaDataType* _tmp140_;
							ValaTypeSymbol* _tmp141_;
							ValaTypeSymbol* _tmp142_;
							gchar* _tmp143_;
							gchar* _tmp144_;
							ValaCCodeIdentifier* _tmp145_;
							ValaCCodeIdentifier* _tmp146_;
							ValaCCodeBinaryExpression* _tmp147_;
							ValaCCodeBinaryExpression* _tmp148_;
							ValaCCodeFunction* _tmp149_;
							ValaCCodeFunction* _tmp150_;
							ValaCCodeBinaryExpression* _tmp151_;
							_tmp135_ = inner_error;
							_tmp136_ = vala_ccode_member_access_new_pointer (_tmp135_, "domain");
							_tmp137_ = _tmp136_;
							_tmp138_ = clause;
							_tmp139_ = vala_catch_clause_get_error_type (_tmp138_);
							_tmp140_ = _tmp139_;
							_tmp141_ = vala_data_type_get_data_type (_tmp140_);
							_tmp142_ = _tmp141_;
							_tmp143_ = vala_get_ccode_upper_case_name ((ValaSymbol*) _tmp142_, NULL);
							_tmp144_ = _tmp143_;
							_tmp145_ = vala_ccode_identifier_new (_tmp144_);
							_tmp146_ = _tmp145_;
							_tmp147_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_EQUALITY, (ValaCCodeExpression*) _tmp137_, (ValaCCodeExpression*) _tmp146_);
							_tmp148_ = _tmp147_;
							_vala_ccode_node_unref0 (_tmp146_);
							_g_free0 (_tmp144_);
							_vala_ccode_node_unref0 (_tmp137_);
							ccond = _tmp148_;
							_tmp149_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
							_tmp150_ = _tmp149_;
							_tmp151_ = ccond;
							vala_ccode_function_open_if (_tmp150_, (ValaCCodeExpression*) _tmp151_);
							_vala_ccode_node_unref0 (ccond);
						}
						_tmp152_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
						_tmp153_ = _tmp152_;
						_tmp154_ = clause;
						_tmp155_ = vala_catch_clause_get_clabel_name (_tmp154_);
						_tmp156_ = _tmp155_;
						vala_ccode_function_add_goto (_tmp153_, _tmp156_);
						_tmp157_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
						_tmp158_ = _tmp157_;
						vala_ccode_function_close (_tmp158_);
						_vala_code_node_unref0 (catch_type);
					}
					_vala_code_node_unref0 (clause);
				}
				_vala_iterable_unref0 (_clause_list);
			}
			_vala_iterable_unref0 (handled_error_types);
		}
		_tmp159_ = has_general_catch_clause;
		if (_tmp159_) {
		} else {
			ValaArrayList* _tmp160_;
			gint _tmp161_;
			gint _tmp162_;
			_tmp160_ = error_types;
			_tmp161_ = vala_collection_get_size ((ValaCollection*) _tmp160_);
			_tmp162_ = _tmp161_;
			if (_tmp162_ > 0) {
				ValaCCodeFunction* _tmp163_;
				ValaCCodeFunction* _tmp164_;
				gint _tmp165_;
				gchar* _tmp166_;
				gchar* _tmp167_;
				_tmp163_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp164_ = _tmp163_;
				_tmp165_ = self->priv->current_try_id;
				_tmp166_ = g_strdup_printf ("__finally%d", _tmp165_);
				_tmp167_ = _tmp166_;
				vala_ccode_function_add_goto (_tmp164_, _tmp167_);
				_g_free0 (_tmp167_);
			} else {
				ValaCodeNode* _tmp168_;
				gboolean _tmp169_;
				_tmp168_ = node;
				_tmp169_ = vala_gerror_module_in_finally_block (self, _tmp168_);
				if (_tmp169_) {
				} else {
					ValaCCodeExpression* _tmp170_;
					_tmp170_ = inner_error;
					vala_gerror_module_uncaught_error_statement (self, _tmp170_, TRUE);
				}
			}
		}
		_vala_iterable_unref0 (error_types);
	} else {
		gboolean _tmp171_ = FALSE;
		ValaMethod* _tmp172_;
		ValaMethod* _tmp173_;
		_tmp172_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
		_tmp173_ = _tmp172_;
		if (_tmp173_ != NULL) {
			ValaMethod* _tmp174_;
			ValaMethod* _tmp175_;
			ValaList* _tmp176_;
			ValaList* _tmp177_;
			gint _tmp178_;
			gint _tmp179_;
			_tmp174_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
			_tmp175_ = _tmp174_;
			_tmp176_ = vala_code_node_get_error_types ((ValaCodeNode*) _tmp175_);
			_tmp177_ = _tmp176_;
			_tmp178_ = vala_collection_get_size ((ValaCollection*) _tmp177_);
			_tmp179_ = _tmp178_;
			_tmp171_ = _tmp179_ > 0;
			_vala_iterable_unref0 (_tmp177_);
		} else {
			_tmp171_ = FALSE;
		}
		if (_tmp171_) {
			ValaCCodeBinaryExpression* ccond = NULL;
			ValaCCodeBinaryExpression* _tmp213_;
			ccond = NULL;
			{
				ValaList* _error_type_list = NULL;
				ValaMethod* _tmp180_;
				ValaMethod* _tmp181_;
				ValaList* _tmp182_;
				gint _error_type_size = 0;
				ValaList* _tmp183_;
				gint _tmp184_;
				gint _tmp185_;
				gint _error_type_index = 0;
				_tmp180_ = vala_ccode_base_module_get_current_method ((ValaCCodeBaseModule*) self);
				_tmp181_ = _tmp180_;
				_tmp182_ = vala_code_node_get_error_types ((ValaCodeNode*) _tmp181_);
				_error_type_list = _tmp182_;
				_tmp183_ = _error_type_list;
				_tmp184_ = vala_collection_get_size ((ValaCollection*) _tmp183_);
				_tmp185_ = _tmp184_;
				_error_type_size = _tmp185_;
				_error_type_index = -1;
				while (TRUE) {
					gint _tmp186_;
					gint _tmp187_;
					gint _tmp188_;
					ValaDataType* error_type = NULL;
					ValaList* _tmp189_;
					gint _tmp190_;
					gpointer _tmp191_;
					ValaDataType* _tmp192_;
					ValaErrorType* _tmp193_;
					gboolean _tmp194_;
					ValaCCodeBinaryExpression* domain_check = NULL;
					ValaCCodeExpression* _tmp195_;
					ValaCCodeMemberAccess* _tmp196_;
					ValaCCodeMemberAccess* _tmp197_;
					ValaDataType* _tmp198_;
					ValaTypeSymbol* _tmp199_;
					ValaTypeSymbol* _tmp200_;
					gchar* _tmp201_;
					gchar* _tmp202_;
					ValaCCodeIdentifier* _tmp203_;
					ValaCCodeIdentifier* _tmp204_;
					ValaCCodeBinaryExpression* _tmp205_;
					ValaCCodeBinaryExpression* _tmp206_;
					ValaCCodeBinaryExpression* _tmp207_;
					_tmp186_ = _error_type_index;
					_error_type_index = _tmp186_ + 1;
					_tmp187_ = _error_type_index;
					_tmp188_ = _error_type_size;
					if (!(_tmp187_ < _tmp188_)) {
						break;
					}
					_tmp189_ = _error_type_list;
					_tmp190_ = _error_type_index;
					_tmp191_ = vala_list_get (_tmp189_, _tmp190_);
					error_type = (ValaDataType*) _tmp191_;
					_tmp192_ = error_type;
					_tmp193_ = ((ValaCCodeBaseModule*) self)->gerror_type;
					_tmp194_ = vala_data_type_equals (_tmp192_, (ValaDataType*) _tmp193_);
					if (_tmp194_) {
						_vala_ccode_node_unref0 (ccond);
						ccond = NULL;
						_vala_code_node_unref0 (error_type);
						break;
					}
					_tmp195_ = inner_error;
					_tmp196_ = vala_ccode_member_access_new_pointer (_tmp195_, "domain");
					_tmp197_ = _tmp196_;
					_tmp198_ = error_type;
					_tmp199_ = vala_data_type_get_data_type (_tmp198_);
					_tmp200_ = _tmp199_;
					_tmp201_ = vala_get_ccode_upper_case_name ((ValaSymbol*) _tmp200_, NULL);
					_tmp202_ = _tmp201_;
					_tmp203_ = vala_ccode_identifier_new (_tmp202_);
					_tmp204_ = _tmp203_;
					_tmp205_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_EQUALITY, (ValaCCodeExpression*) _tmp197_, (ValaCCodeExpression*) _tmp204_);
					_tmp206_ = _tmp205_;
					_vala_ccode_node_unref0 (_tmp204_);
					_g_free0 (_tmp202_);
					_vala_ccode_node_unref0 (_tmp197_);
					domain_check = _tmp206_;
					_tmp207_ = ccond;
					if (_tmp207_ == NULL) {
						ValaCCodeBinaryExpression* _tmp208_;
						ValaCCodeBinaryExpression* _tmp209_;
						_tmp208_ = domain_check;
						_tmp209_ = _vala_ccode_node_ref0 (_tmp208_);
						_vala_ccode_node_unref0 (ccond);
						ccond = _tmp209_;
					} else {
						ValaCCodeBinaryExpression* _tmp210_;
						ValaCCodeBinaryExpression* _tmp211_;
						ValaCCodeBinaryExpression* _tmp212_;
						_tmp210_ = ccond;
						_tmp211_ = domain_check;
						_tmp212_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_OR, (ValaCCodeExpression*) _tmp210_, (ValaCCodeExpression*) _tmp211_);
						_vala_ccode_node_unref0 (ccond);
						ccond = _tmp212_;
					}
					_vala_ccode_node_unref0 (domain_check);
					_vala_code_node_unref0 (error_type);
				}
				_vala_iterable_unref0 (_error_type_list);
			}
			_tmp213_ = ccond;
			if (_tmp213_ != NULL) {
				ValaCCodeFunction* _tmp214_;
				ValaCCodeFunction* _tmp215_;
				ValaCCodeBinaryExpression* _tmp216_;
				ValaCCodeExpression* _tmp217_;
				ValaCCodeFunction* _tmp218_;
				ValaCCodeFunction* _tmp219_;
				ValaCCodeExpression* _tmp220_;
				ValaCCodeFunction* _tmp221_;
				ValaCCodeFunction* _tmp222_;
				_tmp214_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp215_ = _tmp214_;
				_tmp216_ = ccond;
				vala_ccode_function_open_if (_tmp215_, (ValaCCodeExpression*) _tmp216_);
				_tmp217_ = inner_error;
				vala_gerror_module_return_with_exception (self, _tmp217_);
				_tmp218_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp219_ = _tmp218_;
				vala_ccode_function_add_else (_tmp219_);
				_tmp220_ = inner_error;
				vala_gerror_module_uncaught_error_statement (self, _tmp220_, FALSE);
				_tmp221_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
				_tmp222_ = _tmp221_;
				vala_ccode_function_close (_tmp222_);
			} else {
				ValaCCodeExpression* _tmp223_;
				_tmp223_ = inner_error;
				vala_gerror_module_return_with_exception (self, _tmp223_);
			}
			_vala_ccode_node_unref0 (ccond);
		} else {
			ValaCCodeExpression* _tmp224_;
			_tmp224_ = inner_error;
			vala_gerror_module_uncaught_error_statement (self, _tmp224_, FALSE);
		}
	}
	_tmp225_ = always_fails;
	if (!_tmp225_) {
		ValaCCodeFunction* _tmp226_;
		ValaCCodeFunction* _tmp227_;
		_tmp226_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
		_tmp227_ = _tmp226_;
		vala_ccode_function_close (_tmp227_);
	}
	_vala_ccode_node_unref0 (inner_error);
}


static void vala_gerror_module_real_visit_try_statement (ValaCodeVisitor* base, ValaTryStatement* stmt) {
	ValaGErrorModule * self;
	gint this_try_id = 0;
	gint _tmp0_;
	ValaTryStatement* old_try = NULL;
	ValaTryStatement* _tmp1_;
	ValaTryStatement* _tmp2_;
	ValaTryStatement* _tmp3_;
	gint old_try_id = 0;
	gint _tmp4_;
	gboolean old_is_in_catch = FALSE;
	gboolean _tmp5_;
	ValaCatchClause* old_catch = NULL;
	ValaCatchClause* _tmp6_;
	ValaCatchClause* _tmp7_;
	ValaCatchClause* _tmp8_;
	ValaTryStatement* _tmp9_;
	gint _tmp10_;
	ValaTryStatement* _tmp31_;
	ValaBlock* _tmp32_;
	ValaBlock* _tmp33_;
	ValaTryStatement* _tmp52_;
	gint _tmp53_;
	gboolean _tmp54_;
	ValaCatchClause* _tmp55_;
	ValaCCodeFunction* _tmp56_;
	ValaCCodeFunction* _tmp57_;
	gint _tmp58_;
	gchar* _tmp59_;
	gchar* _tmp60_;
	ValaTryStatement* _tmp61_;
	ValaBlock* _tmp62_;
	ValaBlock* _tmp63_;
	ValaTryStatement* _tmp67_;
	ValaTryStatement* _tmp68_;
	gboolean _tmp69_;
	gboolean _tmp70_;
	self = (ValaGErrorModule*) base;
	g_return_if_fail (stmt != NULL);
	_tmp0_ = self->priv->next_try_id;
	self->priv->next_try_id = _tmp0_ + 1;
	this_try_id = _tmp0_;
	_tmp1_ = vala_ccode_base_module_get_current_try ((ValaCCodeBaseModule*) self);
	_tmp2_ = _tmp1_;
	_tmp3_ = _vala_code_node_ref0 (_tmp2_);
	old_try = _tmp3_;
	_tmp4_ = self->priv->current_try_id;
	old_try_id = _tmp4_;
	_tmp5_ = self->priv->is_in_catch;
	old_is_in_catch = _tmp5_;
	_tmp6_ = vala_ccode_base_module_get_current_catch ((ValaCCodeBaseModule*) self);
	_tmp7_ = _tmp6_;
	_tmp8_ = _vala_code_node_ref0 (_tmp7_);
	old_catch = _tmp8_;
	_tmp9_ = stmt;
	vala_ccode_base_module_set_current_try ((ValaCCodeBaseModule*) self, _tmp9_);
	_tmp10_ = this_try_id;
	self->priv->current_try_id = _tmp10_;
	self->priv->is_in_catch = TRUE;
	{
		ValaList* _clause_list = NULL;
		ValaTryStatement* _tmp11_;
		ValaList* _tmp12_;
		gint _clause_size = 0;
		ValaList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _clause_index = 0;
		_tmp11_ = stmt;
		_tmp12_ = vala_try_statement_get_catch_clauses (_tmp11_);
		_clause_list = _tmp12_;
		_tmp13_ = _clause_list;
		_tmp14_ = vala_collection_get_size ((ValaCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_clause_size = _tmp15_;
		_clause_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			gint _tmp18_;
			ValaCatchClause* clause = NULL;
			ValaList* _tmp19_;
			gint _tmp20_;
			gpointer _tmp21_;
			ValaCatchClause* _tmp22_;
			gint _tmp23_;
			ValaCatchClause* _tmp24_;
			ValaDataType* _tmp25_;
			ValaDataType* _tmp26_;
			gchar* _tmp27_;
			gchar* _tmp28_;
			gchar* _tmp29_;
			gchar* _tmp30_;
			_tmp16_ = _clause_index;
			_clause_index = _tmp16_ + 1;
			_tmp17_ = _clause_index;
			_tmp18_ = _clause_size;
			if (!(_tmp17_ < _tmp18_)) {
				break;
			}
			_tmp19_ = _clause_list;
			_tmp20_ = _clause_index;
			_tmp21_ = vala_list_get (_tmp19_, _tmp20_);
			clause = (ValaCatchClause*) _tmp21_;
			_tmp22_ = clause;
			_tmp23_ = this_try_id;
			_tmp24_ = clause;
			_tmp25_ = vala_catch_clause_get_error_type (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = vala_get_ccode_lower_case_name ((ValaCodeNode*) _tmp26_, NULL);
			_tmp28_ = _tmp27_;
			_tmp29_ = g_strdup_printf ("__catch%d_%s", _tmp23_, _tmp28_);
			_tmp30_ = _tmp29_;
			vala_catch_clause_set_clabel_name (_tmp22_, _tmp30_);
			_g_free0 (_tmp30_);
			_g_free0 (_tmp28_);
			_vala_code_node_unref0 (clause);
		}
		_vala_iterable_unref0 (_clause_list);
	}
	self->priv->is_in_catch = FALSE;
	_tmp31_ = stmt;
	_tmp32_ = vala_try_statement_get_body (_tmp31_);
	_tmp33_ = _tmp32_;
	vala_code_node_emit ((ValaCodeNode*) _tmp33_, (ValaCodeGenerator*) self);
	self->priv->is_in_catch = TRUE;
	{
		ValaList* _clause_list = NULL;
		ValaTryStatement* _tmp34_;
		ValaList* _tmp35_;
		gint _clause_size = 0;
		ValaList* _tmp36_;
		gint _tmp37_;
		gint _tmp38_;
		gint _clause_index = 0;
		_tmp34_ = stmt;
		_tmp35_ = vala_try_statement_get_catch_clauses (_tmp34_);
		_clause_list = _tmp35_;
		_tmp36_ = _clause_list;
		_tmp37_ = vala_collection_get_size ((ValaCollection*) _tmp36_);
		_tmp38_ = _tmp37_;
		_clause_size = _tmp38_;
		_clause_index = -1;
		while (TRUE) {
			gint _tmp39_;
			gint _tmp40_;
			gint _tmp41_;
			ValaCatchClause* clause = NULL;
			ValaList* _tmp42_;
			gint _tmp43_;
			gpointer _tmp44_;
			ValaCatchClause* _tmp45_;
			ValaCCodeFunction* _tmp46_;
			ValaCCodeFunction* _tmp47_;
			gint _tmp48_;
			gchar* _tmp49_;
			gchar* _tmp50_;
			ValaCatchClause* _tmp51_;
			_tmp39_ = _clause_index;
			_clause_index = _tmp39_ + 1;
			_tmp40_ = _clause_index;
			_tmp41_ = _clause_size;
			if (!(_tmp40_ < _tmp41_)) {
				break;
			}
			_tmp42_ = _clause_list;
			_tmp43_ = _clause_index;
			_tmp44_ = vala_list_get (_tmp42_, _tmp43_);
			clause = (ValaCatchClause*) _tmp44_;
			_tmp45_ = clause;
			vala_ccode_base_module_set_current_catch ((ValaCCodeBaseModule*) self, _tmp45_);
			_tmp46_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
			_tmp47_ = _tmp46_;
			_tmp48_ = this_try_id;
			_tmp49_ = g_strdup_printf ("__finally%d", _tmp48_);
			_tmp50_ = _tmp49_;
			vala_ccode_function_add_goto (_tmp47_, _tmp50_);
			_g_free0 (_tmp50_);
			_tmp51_ = clause;
			vala_code_node_emit ((ValaCodeNode*) _tmp51_, (ValaCodeGenerator*) self);
			_vala_code_node_unref0 (clause);
		}
		_vala_iterable_unref0 (_clause_list);
	}
	_tmp52_ = old_try;
	vala_ccode_base_module_set_current_try ((ValaCCodeBaseModule*) self, _tmp52_);
	_tmp53_ = old_try_id;
	self->priv->current_try_id = _tmp53_;
	_tmp54_ = old_is_in_catch;
	self->priv->is_in_catch = _tmp54_;
	_tmp55_ = old_catch;
	vala_ccode_base_module_set_current_catch ((ValaCCodeBaseModule*) self, _tmp55_);
	_tmp56_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp57_ = _tmp56_;
	_tmp58_ = this_try_id;
	_tmp59_ = g_strdup_printf ("__finally%d", _tmp58_);
	_tmp60_ = _tmp59_;
	vala_ccode_function_add_label (_tmp57_, _tmp60_);
	_g_free0 (_tmp60_);
	_tmp61_ = stmt;
	_tmp62_ = vala_try_statement_get_finally_body (_tmp61_);
	_tmp63_ = _tmp62_;
	if (_tmp63_ != NULL) {
		ValaTryStatement* _tmp64_;
		ValaBlock* _tmp65_;
		ValaBlock* _tmp66_;
		_tmp64_ = stmt;
		_tmp65_ = vala_try_statement_get_finally_body (_tmp64_);
		_tmp66_ = _tmp65_;
		vala_code_node_emit ((ValaCodeNode*) _tmp66_, (ValaCodeGenerator*) self);
	}
	_tmp67_ = stmt;
	_tmp68_ = stmt;
	_tmp69_ = vala_try_statement_get_after_try_block_reachable (_tmp68_);
	_tmp70_ = _tmp69_;
	vala_ccode_base_module_add_simple_check ((ValaCCodeBaseModule*) self, (ValaCodeNode*) _tmp67_, !_tmp70_);
	_vala_code_node_unref0 (old_catch);
	_vala_code_node_unref0 (old_try);
}


static void vala_gerror_module_real_visit_catch_clause (ValaCodeVisitor* base, ValaCatchClause* clause) {
	ValaGErrorModule * self;
	ValaErrorType* error_type = NULL;
	ValaCatchClause* _tmp0_;
	ValaDataType* _tmp1_;
	ValaDataType* _tmp2_;
	ValaErrorType* _tmp3_;
	ValaErrorType* _tmp4_;
	ValaErrorDomain* _tmp5_;
	ValaErrorDomain* _tmp6_;
	ValaCCodeFunction* _tmp11_;
	ValaCCodeFunction* _tmp12_;
	ValaCatchClause* _tmp13_;
	const gchar* _tmp14_;
	const gchar* _tmp15_;
	ValaCCodeFunction* _tmp16_;
	ValaCCodeFunction* _tmp17_;
	ValaCatchClause* _tmp18_;
	ValaLocalVariable* _tmp19_;
	ValaLocalVariable* _tmp20_;
	ValaCCodeFunction* _tmp47_;
	ValaCCodeFunction* _tmp48_;
	ValaCCodeExpression* _tmp49_;
	ValaCCodeExpression* _tmp50_;
	ValaCCodeConstant* _tmp51_;
	ValaCCodeConstant* _tmp52_;
	ValaCatchClause* _tmp53_;
	ValaBlock* _tmp54_;
	ValaBlock* _tmp55_;
	ValaCCodeFunction* _tmp56_;
	ValaCCodeFunction* _tmp57_;
	self = (ValaGErrorModule*) base;
	g_return_if_fail (clause != NULL);
	vala_ccode_base_module_set_current_method_inner_error ((ValaCCodeBaseModule*) self, TRUE);
	_tmp0_ = clause;
	_tmp1_ = vala_catch_clause_get_error_type (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp2_, VALA_TYPE_ERROR_TYPE, ValaErrorType));
	error_type = _tmp3_;
	_tmp4_ = error_type;
	_tmp5_ = vala_error_type_get_error_domain (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ != NULL) {
		ValaErrorType* _tmp7_;
		ValaErrorDomain* _tmp8_;
		ValaErrorDomain* _tmp9_;
		ValaCCodeFile* _tmp10_;
		_tmp7_ = error_type;
		_tmp8_ = vala_error_type_get_error_domain (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = ((ValaCCodeBaseModule*) self)->cfile;
		vala_ccode_base_module_generate_error_domain_declaration ((ValaCCodeBaseModule*) self, _tmp9_, _tmp10_);
	}
	_tmp11_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp12_ = _tmp11_;
	_tmp13_ = clause;
	_tmp14_ = vala_catch_clause_get_clabel_name (_tmp13_);
	_tmp15_ = _tmp14_;
	vala_ccode_function_add_label (_tmp12_, _tmp15_);
	_tmp16_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp17_ = _tmp16_;
	vala_ccode_function_open_block (_tmp17_);
	_tmp18_ = clause;
	_tmp19_ = vala_catch_clause_get_error_variable (_tmp18_);
	_tmp20_ = _tmp19_;
	if (_tmp20_ != NULL) {
		ValaCatchClause* _tmp21_;
		ValaLocalVariable* _tmp22_;
		ValaLocalVariable* _tmp23_;
		ValaCCodeFunction* _tmp24_;
		ValaCCodeFunction* _tmp25_;
		ValaCatchClause* _tmp26_;
		ValaLocalVariable* _tmp27_;
		ValaLocalVariable* _tmp28_;
		gchar* _tmp29_;
		gchar* _tmp30_;
		ValaCCodeExpression* _tmp31_;
		ValaCCodeExpression* _tmp32_;
		ValaCCodeExpression* _tmp33_;
		ValaCCodeExpression* _tmp34_;
		_tmp21_ = clause;
		_tmp22_ = vala_catch_clause_get_error_variable (_tmp21_);
		_tmp23_ = _tmp22_;
		vala_code_visitor_visit_local_variable ((ValaCodeVisitor*) self, _tmp23_);
		_tmp24_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
		_tmp25_ = _tmp24_;
		_tmp26_ = clause;
		_tmp27_ = vala_catch_clause_get_error_variable (_tmp26_);
		_tmp28_ = _tmp27_;
		_tmp29_ = vala_ccode_base_module_get_local_cname ((ValaCCodeBaseModule*) self, _tmp28_);
		_tmp30_ = _tmp29_;
		_tmp31_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
		_tmp34_ = _tmp33_;
		vala_ccode_function_add_assignment (_tmp25_, _tmp32_, _tmp34_);
		_vala_ccode_node_unref0 (_tmp34_);
		_vala_ccode_node_unref0 (_tmp32_);
		_g_free0 (_tmp30_);
	} else {
		ValaCCodeFunctionCall* cclear = NULL;
		ValaCCodeIdentifier* _tmp35_;
		ValaCCodeIdentifier* _tmp36_;
		ValaCCodeFunctionCall* _tmp37_;
		ValaCCodeFunctionCall* _tmp38_;
		ValaCCodeFunctionCall* _tmp39_;
		ValaCCodeExpression* _tmp40_;
		ValaCCodeExpression* _tmp41_;
		ValaCCodeUnaryExpression* _tmp42_;
		ValaCCodeUnaryExpression* _tmp43_;
		ValaCCodeFunction* _tmp44_;
		ValaCCodeFunction* _tmp45_;
		ValaCCodeFunctionCall* _tmp46_;
		_tmp35_ = vala_ccode_identifier_new ("g_clear_error");
		_tmp36_ = _tmp35_;
		_tmp37_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp36_);
		_tmp38_ = _tmp37_;
		_vala_ccode_node_unref0 (_tmp36_);
		cclear = _tmp38_;
		_tmp39_ = cclear;
		_tmp40_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
		_tmp41_ = _tmp40_;
		_tmp42_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_ADDRESS_OF, _tmp41_);
		_tmp43_ = _tmp42_;
		vala_ccode_function_call_add_argument (_tmp39_, (ValaCCodeExpression*) _tmp43_);
		_vala_ccode_node_unref0 (_tmp43_);
		_vala_ccode_node_unref0 (_tmp41_);
		_tmp44_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
		_tmp45_ = _tmp44_;
		_tmp46_ = cclear;
		vala_ccode_function_add_expression (_tmp45_, (ValaCCodeExpression*) _tmp46_);
		_vala_ccode_node_unref0 (cclear);
	}
	_tmp47_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp48_ = _tmp47_;
	_tmp49_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, "_inner_error_");
	_tmp50_ = _tmp49_;
	_tmp51_ = vala_ccode_constant_new ("NULL");
	_tmp52_ = _tmp51_;
	vala_ccode_function_add_assignment (_tmp48_, _tmp50_, (ValaCCodeExpression*) _tmp52_);
	_vala_ccode_node_unref0 (_tmp52_);
	_vala_ccode_node_unref0 (_tmp50_);
	_tmp53_ = clause;
	_tmp54_ = vala_catch_clause_get_body (_tmp53_);
	_tmp55_ = _tmp54_;
	vala_code_node_emit ((ValaCodeNode*) _tmp55_, (ValaCodeGenerator*) self);
	_tmp56_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
	_tmp57_ = _tmp56_;
	vala_ccode_function_close (_tmp57_);
	_vala_code_node_unref0 (error_type);
}


static void vala_gerror_module_real_append_scope_free (ValaCCodeBaseModule* base, ValaSymbol* sym, ValaCodeNode* stop_at) {
	ValaGErrorModule * self;
	ValaSymbol* _tmp0_;
	ValaCodeNode* _tmp1_;
	gboolean _tmp2_ = FALSE;
	ValaCodeNode* _tmp3_;
	self = (ValaGErrorModule*) base;
	g_return_if_fail (sym != NULL);
	_tmp0_ = sym;
	_tmp1_ = stop_at;
	VALA_CCODE_BASE_MODULE_CLASS (vala_gerror_module_parent_class)->append_scope_free ((ValaCCodeBaseModule*) G_TYPE_CHECK_INSTANCE_CAST (self, VALA_TYPE_CCODE_DELEGATE_MODULE, ValaCCodeDelegateModule), _tmp0_, _tmp1_);
	_tmp3_ = stop_at;
	if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp3_, VALA_TYPE_TRY_STATEMENT)) {
		_tmp2_ = TRUE;
	} else {
		ValaCodeNode* _tmp4_;
		_tmp4_ = stop_at;
		_tmp2_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, VALA_TYPE_CATCH_CLAUSE);
	}
	if (!_tmp2_) {
		ValaBlock* finally_block = NULL;
		ValaBlock* _tmp5_;
		ValaSymbol* _tmp6_;
		ValaCodeNode* _tmp7_;
		ValaCodeNode* _tmp8_;
		gboolean _tmp26_ = FALSE;
		ValaBlock* _tmp27_;
		_tmp5_ = _vala_code_node_ref0 (G_TYPE_CHECK_INSTANCE_CAST (NULL, VALA_TYPE_BLOCK, ValaBlock));
		finally_block = _tmp5_;
		_tmp6_ = sym;
		_tmp7_ = vala_code_node_get_parent_node ((ValaCodeNode*) _tmp6_);
		_tmp8_ = _tmp7_;
		if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, VALA_TYPE_TRY_STATEMENT)) {
			ValaSymbol* _tmp9_;
			ValaCodeNode* _tmp10_;
			ValaCodeNode* _tmp11_;
			ValaBlock* _tmp12_;
			ValaBlock* _tmp13_;
			ValaBlock* _tmp14_;
			_tmp9_ = sym;
			_tmp10_ = vala_code_node_get_parent_node ((ValaCodeNode*) _tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = vala_try_statement_get_finally_body (G_TYPE_CHECK_INSTANCE_CAST (_tmp11_, VALA_TYPE_TRY_STATEMENT, ValaTryStatement));
			_tmp13_ = _tmp12_;
			_tmp14_ = _vala_code_node_ref0 (_tmp13_);
			_vala_code_node_unref0 (finally_block);
			finally_block = _tmp14_;
		} else {
			ValaSymbol* _tmp15_;
			ValaCodeNode* _tmp16_;
			ValaCodeNode* _tmp17_;
			_tmp15_ = sym;
			_tmp16_ = vala_code_node_get_parent_node ((ValaCodeNode*) _tmp15_);
			_tmp17_ = _tmp16_;
			if (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, VALA_TYPE_CATCH_CLAUSE)) {
				ValaSymbol* _tmp18_;
				ValaCodeNode* _tmp19_;
				ValaCodeNode* _tmp20_;
				ValaCodeNode* _tmp21_;
				ValaCodeNode* _tmp22_;
				ValaBlock* _tmp23_;
				ValaBlock* _tmp24_;
				ValaBlock* _tmp25_;
				_tmp18_ = sym;
				_tmp19_ = vala_code_node_get_parent_node ((ValaCodeNode*) _tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = vala_code_node_get_parent_node (_tmp20_);
				_tmp22_ = _tmp21_;
				_tmp23_ = vala_try_statement_get_finally_body (G_TYPE_CHECK_INSTANCE_CAST (_tmp22_, VALA_TYPE_TRY_STATEMENT, ValaTryStatement));
				_tmp24_ = _tmp23_;
				_tmp25_ = _vala_code_node_ref0 (_tmp24_);
				_vala_code_node_unref0 (finally_block);
				finally_block = _tmp25_;
			}
		}
		_tmp27_ = finally_block;
		if (_tmp27_ != NULL) {
			ValaBlock* _tmp28_;
			ValaSymbol* _tmp29_;
			_tmp28_ = finally_block;
			_tmp29_ = sym;
			_tmp26_ = G_TYPE_CHECK_INSTANCE_CAST (_tmp28_, VALA_TYPE_SYMBOL, ValaSymbol) != _tmp29_;
		} else {
			_tmp26_ = FALSE;
		}
		if (_tmp26_) {
			ValaBlock* _tmp30_;
			_tmp30_ = finally_block;
			vala_code_node_emit ((ValaCodeNode*) _tmp30_, (ValaCodeGenerator*) self);
		}
		_vala_code_node_unref0 (finally_block);
	}
}


ValaGErrorModule* vala_gerror_module_construct (GType object_type) {
	ValaGErrorModule* self = NULL;
	self = (ValaGErrorModule*) vala_ccode_delegate_module_construct (object_type);
	return self;
}


ValaGErrorModule* vala_gerror_module_new (void) {
	return vala_gerror_module_construct (VALA_TYPE_GERROR_MODULE);
}


static void vala_gerror_module_class_init (ValaGErrorModuleClass * klass) {
	vala_gerror_module_parent_class = g_type_class_peek_parent (klass);
	((ValaCodeVisitorClass *) klass)->finalize = vala_gerror_module_finalize;
	g_type_class_add_private (klass, sizeof (ValaGErrorModulePrivate));
	((ValaCCodeBaseModuleClass *) klass)->generate_error_domain_declaration = (void (*) (ValaCCodeBaseModule *, ValaErrorDomain*, ValaCCodeFile*)) vala_gerror_module_real_generate_error_domain_declaration;
	((ValaCodeVisitorClass *) klass)->visit_error_domain = (void (*) (ValaCodeVisitor *, ValaErrorDomain*)) vala_gerror_module_real_visit_error_domain;
	((ValaCodeVisitorClass *) klass)->visit_throw_statement = (void (*) (ValaCodeVisitor *, ValaThrowStatement*)) vala_gerror_module_real_visit_throw_statement;
	((ValaGErrorModuleClass *) klass)->return_with_exception = (void (*) (ValaGErrorModule *, ValaCCodeExpression*)) vala_gerror_module_real_return_with_exception;
	((ValaCCodeBaseModuleClass *) klass)->add_simple_check = (void (*) (ValaCCodeBaseModule *, ValaCodeNode*, gboolean)) vala_gerror_module_real_add_simple_check;
	((ValaCodeVisitorClass *) klass)->visit_try_statement = (void (*) (ValaCodeVisitor *, ValaTryStatement*)) vala_gerror_module_real_visit_try_statement;
	((ValaCodeVisitorClass *) klass)->visit_catch_clause = (void (*) (ValaCodeVisitor *, ValaCatchClause*)) vala_gerror_module_real_visit_catch_clause;
	((ValaCCodeBaseModuleClass *) klass)->append_scope_free = (void (*) (ValaCCodeBaseModule *, ValaSymbol*, ValaCodeNode*)) vala_gerror_module_real_append_scope_free;
}


static void vala_gerror_module_instance_init (ValaGErrorModule * self) {
	self->priv = VALA_GERROR_MODULE_GET_PRIVATE (self);
	self->priv->current_try_id = 0;
	self->priv->next_try_id = 0;
	self->priv->is_in_catch = FALSE;
}


static void vala_gerror_module_finalize (ValaCodeVisitor * obj) {
	ValaGErrorModule * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, VALA_TYPE_GERROR_MODULE, ValaGErrorModule);
	VALA_CODE_VISITOR_CLASS (vala_gerror_module_parent_class)->finalize (obj);
}


GType vala_gerror_module_get_type (void) {
	static volatile gsize vala_gerror_module_type_id__volatile = 0;
	if (g_once_init_enter (&vala_gerror_module_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ValaGErrorModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_gerror_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaGErrorModule), 0, (GInstanceInitFunc) vala_gerror_module_instance_init, NULL };
		GType vala_gerror_module_type_id;
		vala_gerror_module_type_id = g_type_register_static (VALA_TYPE_CCODE_DELEGATE_MODULE, "ValaGErrorModule", &g_define_type_info, 0);
		g_once_init_leave (&vala_gerror_module_type_id__volatile, vala_gerror_module_type_id);
	}
	return vala_gerror_module_type_id__volatile;
}



