Logo Search packages:      
Sourcecode: vala-0.12 version File versions  Download package

valaccodecontrolflowmodule.c

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

/* valaccodecontrolflowmodule.vala
 *
 * Copyright (C) 2006-2011  Jürg Billeter
 * Copyright (C) 2006-2008  Raffaele Sandrini
 *
 * 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>
 *    Raffaele Sandrini <raffaele@sandrini.ch>
 */

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


#define VALA_TYPE_CCODE_BASE_MODULE (vala_ccode_base_module_get_type ())
#define VALA_CCODE_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModule))
#define VALA_CCODE_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModuleClass))
#define VALA_IS_CCODE_BASE_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_BASE_MODULE))
#define VALA_IS_CCODE_BASE_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_BASE_MODULE))
#define VALA_CCODE_BASE_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_BASE_MODULE, ValaCCodeBaseModuleClass))

typedef struct _ValaCCodeBaseModule ValaCCodeBaseModule;
typedef struct _ValaCCodeBaseModuleClass ValaCCodeBaseModuleClass;
typedef struct _ValaCCodeBaseModulePrivate ValaCCodeBaseModulePrivate;

#define VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT (vala_ccode_base_module_emit_context_get_type ())
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContext))
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContextClass))
#define VALA_CCODE_BASE_MODULE_IS_EMIT_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_CCODE_BASE_MODULE_IS_EMIT_CONTEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT))
#define VALA_CCODE_BASE_MODULE_EMIT_CONTEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_CCODE_BASE_MODULE_TYPE_EMIT_CONTEXT, ValaCCodeBaseModuleEmitContextClass))

typedef struct _ValaCCodeBaseModuleEmitContext ValaCCodeBaseModuleEmitContext;
typedef struct _ValaCCodeBaseModuleEmitContextClass ValaCCodeBaseModuleEmitContextClass;

#define VALA_TYPE_CCODE_STRUCT_MODULE (vala_ccode_struct_module_get_type ())
#define VALA_CCODE_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModule))
#define VALA_CCODE_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModuleClass))
#define VALA_IS_CCODE_STRUCT_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_STRUCT_MODULE))
#define VALA_IS_CCODE_STRUCT_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_STRUCT_MODULE))
#define VALA_CCODE_STRUCT_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_STRUCT_MODULE, ValaCCodeStructModuleClass))

typedef struct _ValaCCodeStructModule ValaCCodeStructModule;
typedef struct _ValaCCodeStructModuleClass ValaCCodeStructModuleClass;
typedef struct _ValaCCodeStructModulePrivate ValaCCodeStructModulePrivate;

#define VALA_TYPE_CCODE_METHOD_MODULE (vala_ccode_method_module_get_type ())
#define VALA_CCODE_METHOD_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModule))
#define VALA_CCODE_METHOD_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModuleClass))
#define VALA_IS_CCODE_METHOD_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_METHOD_MODULE))
#define VALA_IS_CCODE_METHOD_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_METHOD_MODULE))
#define VALA_CCODE_METHOD_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_METHOD_MODULE, ValaCCodeMethodModuleClass))

typedef struct _ValaCCodeMethodModule ValaCCodeMethodModule;
typedef struct _ValaCCodeMethodModuleClass ValaCCodeMethodModuleClass;
typedef struct _ValaCCodeMethodModulePrivate ValaCCodeMethodModulePrivate;

#define VALA_TYPE_CCODE_CONTROL_FLOW_MODULE (vala_ccode_control_flow_module_get_type ())
#define VALA_CCODE_CONTROL_FLOW_MODULE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModule))
#define VALA_CCODE_CONTROL_FLOW_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModuleClass))
#define VALA_IS_CCODE_CONTROL_FLOW_MODULE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE))
#define VALA_IS_CCODE_CONTROL_FLOW_MODULE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE))
#define VALA_CCODE_CONTROL_FLOW_MODULE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CCODE_CONTROL_FLOW_MODULE, ValaCCodeControlFlowModuleClass))

typedef struct _ValaCCodeControlFlowModule ValaCCodeControlFlowModule;
typedef struct _ValaCCodeControlFlowModuleClass ValaCCodeControlFlowModuleClass;
typedef struct _ValaCCodeControlFlowModulePrivate ValaCCodeControlFlowModulePrivate;
#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 _g_free0(var) (var = (g_free (var), NULL))
#define _vala_iterable_unref0(var) ((var == NULL) ? NULL : (var = (vala_iterable_unref (var), NULL)))

struct _ValaCCodeBaseModule {
      ValaCodeGenerator parent_instance;
      ValaCCodeBaseModulePrivate * priv;
      ValaSymbol* root_symbol;
      ValaCCodeBaseModuleEmitContext* emit_context;
      ValaCCodeFile* header_file;
      ValaCCodeFile* internal_header_file;
      ValaCCodeFile* cfile;
      ValaCCodeBaseModuleEmitContext* class_init_context;
      ValaCCodeBaseModuleEmitContext* base_init_context;
      ValaCCodeBaseModuleEmitContext* class_finalize_context;
      ValaCCodeBaseModuleEmitContext* base_finalize_context;
      ValaCCodeBaseModuleEmitContext* instance_init_context;
      ValaCCodeBaseModuleEmitContext* instance_finalize_context;
      ValaCCodeStruct* param_spec_struct;
      ValaCCodeStruct* closure_struct;
      ValaCCodeEnum* prop_enum;
      ValaSet* user_marshal_set;
      ValaSet* predefined_marshal_set;
      gint next_regex_id;
      gboolean in_constructor;
      gboolean in_static_or_class_context;
      gint next_coroutine_state;
      ValaDataType* void_type;
      ValaDataType* bool_type;
      ValaDataType* char_type;
      ValaDataType* uchar_type;
      ValaDataType* unichar_type;
      ValaDataType* short_type;
      ValaDataType* ushort_type;
      ValaDataType* int_type;
      ValaDataType* uint_type;
      ValaDataType* long_type;
      ValaDataType* ulong_type;
      ValaDataType* int8_type;
      ValaDataType* uint8_type;
      ValaDataType* int16_type;
      ValaDataType* uint16_type;
      ValaDataType* int32_type;
      ValaDataType* uint32_type;
      ValaDataType* int64_type;
      ValaDataType* uint64_type;
      ValaDataType* string_type;
      ValaDataType* regex_type;
      ValaDataType* float_type;
      ValaDataType* double_type;
      ValaTypeSymbol* gtype_type;
      ValaTypeSymbol* gobject_type;
      ValaErrorType* gerror_type;
      ValaClass* glist_type;
      ValaClass* gslist_type;
      ValaClass* gnode_type;
      ValaClass* gvaluearray_type;
      ValaTypeSymbol* gstringbuilder_type;
      ValaTypeSymbol* garray_type;
      ValaTypeSymbol* gbytearray_type;
      ValaTypeSymbol* gptrarray_type;
      ValaTypeSymbol* gthreadpool_type;
      ValaDataType* gdestroynotify_type;
      ValaDataType* gquark_type;
      ValaStruct* gvalue_type;
      ValaClass* gvariant_type;
      ValaStruct* mutex_type;
      ValaTypeSymbol* type_module_type;
      ValaTypeSymbol* dbus_proxy_type;
      ValaTypeSymbol* dbus_object_type;
      gboolean in_plugin;
      gchar* module_init_param_name;
      gboolean gvaluecollector_h_needed;
      gboolean requires_array_free;
      gboolean requires_array_move;
      gboolean requires_array_length;
      ValaSet* wrappers;
};

struct _ValaCCodeBaseModuleClass {
      ValaCodeGeneratorClass parent_class;
      void (*append_vala_array_free) (ValaCCodeBaseModule* self);
      void (*append_vala_array_move) (ValaCCodeBaseModule* self);
      void (*append_vala_array_length) (ValaCCodeBaseModule* self);
      gboolean (*generate_enum_declaration) (ValaCCodeBaseModule* self, ValaEnum* en, ValaCCodeFile* decl_space);
      void (*generate_class_struct_declaration) (ValaCCodeBaseModule* self, ValaClass* cl, ValaCCodeFile* decl_space);
      void (*generate_struct_declaration) (ValaCCodeBaseModule* self, ValaStruct* st, ValaCCodeFile* decl_space);
      void (*generate_delegate_declaration) (ValaCCodeBaseModule* self, ValaDelegate* d, ValaCCodeFile* decl_space);
      void (*generate_cparameters) (ValaCCodeBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaCCodeFunction* func, ValaCCodeFunctionDeclarator* vdeclarator, ValaMap* carg_map, ValaCCodeFunctionCall* vcall, gint direction);
      ValaCCodeExpression* (*get_dup_func_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaSourceReference* source_reference, gboolean is_chainup);
      gchar* (*append_struct_array_free) (ValaCCodeBaseModule* self, ValaStruct* st);
      ValaCCodeExpression* (*destroy_variable) (ValaCCodeBaseModule* self, ValaVariable* variable, ValaTargetValue* target_lvalue);
      ValaCCodeExpression* (*destroy_value) (ValaCCodeBaseModule* self, ValaTargetValue* value, gboolean is_macro_definition);
      void (*append_local_free) (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
      ValaTargetValue* (*get_local_cvalue) (ValaCCodeBaseModule* self, ValaLocalVariable* local);
      ValaTargetValue* (*get_parameter_cvalue) (ValaCCodeBaseModule* self, ValaParameter* param);
      ValaTargetValue* (*get_field_cvalue) (ValaCCodeBaseModule* self, ValaField* field, ValaTargetValue* instance);
      ValaTargetValue* (*load_this_parameter) (ValaCCodeBaseModule* self, ValaTypeSymbol* sym);
      gchar* (*get_delegate_target_cname) (ValaCCodeBaseModule* self, const gchar* delegate_cname);
      ValaCCodeExpression* (*get_delegate_target_cexpression) (ValaCCodeBaseModule* self, ValaExpression* delegate_expr, ValaCCodeExpression** delegate_target_destroy_notify);
      ValaCCodeExpression* (*get_delegate_target_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value);
      ValaCCodeExpression* (*get_delegate_target_destroy_notify_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value);
      gchar* (*get_delegate_target_destroy_notify_cname) (ValaCCodeBaseModule* self, const gchar* delegate_cname);
      ValaCCodeExpression* (*get_ref_cexpression) (ValaCCodeBaseModule* self, ValaDataType* expression_type, ValaCCodeExpression* cexpr, ValaExpression* expr, ValaCodeNode* node);
      void (*generate_class_declaration) (ValaCCodeBaseModule* self, ValaClass* cl, ValaCCodeFile* decl_space);
      void (*generate_interface_declaration) (ValaCCodeBaseModule* self, ValaInterface* iface, ValaCCodeFile* decl_space);
      void (*generate_method_declaration) (ValaCCodeBaseModule* self, ValaMethod* m, ValaCCodeFile* decl_space);
      void (*generate_error_domain_declaration) (ValaCCodeBaseModule* self, ValaErrorDomain* edomain, ValaCCodeFile* decl_space);
      ValaCCodeExpression* (*deserialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* variant_expr, ValaCCodeExpression* expr, ValaCCodeExpression* error_expr, gboolean* may_fail);
      ValaCCodeExpression* (*serialize_expression) (ValaCCodeBaseModule* self, ValaDataType* type, ValaCCodeExpression* expr);
      ValaCCodeExpression* (*get_implicit_cast_expression) (ValaCCodeBaseModule* self, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaExpression* expr);
      gboolean (*is_gobject_property) (ValaCCodeBaseModule* self, ValaProperty* prop);
      gchar* (*get_custom_creturn_type) (ValaCCodeBaseModule* self, ValaMethod* m);
      void (*generate_dynamic_method_wrapper) (ValaCCodeBaseModule* self, ValaDynamicMethod* method);
      gboolean (*method_has_wrapper) (ValaCCodeBaseModule* self, ValaMethod* method);
      ValaCCodeFunctionCall* (*get_param_spec) (ValaCCodeBaseModule* self, ValaProperty* prop);
      ValaCCodeFunctionCall* (*get_signal_creation) (ValaCCodeBaseModule* self, ValaSignal* sig, ValaTypeSymbol* type);
      void (*register_dbus_info) (ValaCCodeBaseModule* self, ValaCCodeBlock* block, ValaObjectTypeSymbol* bindable);
      gchar* (*get_dynamic_property_getter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
      gchar* (*get_dynamic_property_setter_cname) (ValaCCodeBaseModule* self, ValaDynamicProperty* node);
      gchar* (*get_dynamic_signal_cname) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_connect_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_connect_after_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      gchar* (*get_dynamic_signal_disconnect_wrapper_name) (ValaCCodeBaseModule* self, ValaDynamicSignal* node);
      void (*generate_marshaller) (ValaCCodeBaseModule* self, ValaList* params, ValaDataType* return_type, gboolean dbus);
      gchar* (*get_marshaller_function) (ValaCCodeBaseModule* self, ValaList* params, ValaDataType* return_type, const gchar* prefix, gboolean dbus);
      gchar* (*get_array_length_cname) (ValaCCodeBaseModule* self, const gchar* array_cname, gint dim);
      gchar* (*get_parameter_array_length_cname) (ValaCCodeBaseModule* self, ValaParameter* param, gint dim);
      ValaCCodeExpression* (*get_array_length_cexpression) (ValaCCodeBaseModule* self, ValaExpression* array_expr, gint dim);
      ValaCCodeExpression* (*get_array_length_cvalue) (ValaCCodeBaseModule* self, ValaTargetValue* value, gint dim);
      gchar* (*get_array_size_cname) (ValaCCodeBaseModule* self, const gchar* array_cname);
      void (*add_simple_check) (ValaCCodeBaseModule* self, ValaCodeNode* node, gboolean always_fails);
      gchar* (*generate_ready_function) (ValaCCodeBaseModule* self, ValaMethod* m);
};

struct _ValaCCodeStructModule {
      ValaCCodeBaseModule parent_instance;
      ValaCCodeStructModulePrivate * priv;
};

struct _ValaCCodeStructModuleClass {
      ValaCCodeBaseModuleClass parent_class;
};

struct _ValaCCodeMethodModule {
      ValaCCodeStructModule parent_instance;
      ValaCCodeMethodModulePrivate * priv;
};

struct _ValaCCodeMethodModuleClass {
      ValaCCodeStructModuleClass parent_class;
      void (*generate_method_result_declaration) (ValaCCodeMethodModule* self, ValaMethod* m, ValaCCodeFile* decl_space, ValaCCodeFunction* cfunc, ValaMap* cparam_map, ValaMap* carg_map);
      ValaCCodeParameter* (*generate_parameter) (ValaCCodeMethodModule* self, ValaParameter* param, ValaCCodeFile* decl_space, ValaMap* cparam_map, ValaMap* carg_map);
};

struct _ValaCCodeControlFlowModule {
      ValaCCodeMethodModule parent_instance;
      ValaCCodeControlFlowModulePrivate * priv;
};

struct _ValaCCodeControlFlowModuleClass {
      ValaCCodeMethodModuleClass parent_class;
};


static gpointer vala_ccode_control_flow_module_parent_class = NULL;

GType vala_ccode_base_module_get_type (void) G_GNUC_CONST;
gpointer vala_ccode_base_module_emit_context_ref (gpointer instance);
void vala_ccode_base_module_emit_context_unref (gpointer instance);
GParamSpec* vala_ccode_base_module_param_spec_emit_context (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
void vala_ccode_base_module_value_set_emit_context (GValue* value, gpointer v_object);
void vala_ccode_base_module_value_take_emit_context (GValue* value, gpointer v_object);
gpointer vala_ccode_base_module_value_get_emit_context (const GValue* value);
GType vala_ccode_base_module_emit_context_get_type (void) G_GNUC_CONST;
GType vala_ccode_struct_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_method_module_get_type (void) G_GNUC_CONST;
GType vala_ccode_control_flow_module_get_type (void) G_GNUC_CONST;
enum  {
      VALA_CCODE_CONTROL_FLOW_MODULE_DUMMY_PROPERTY
};
static void vala_ccode_control_flow_module_real_visit_if_statement (ValaCodeVisitor* base, ValaIfStatement* stmt);
ValaCCodeFunction* vala_ccode_base_module_get_ccode (ValaCCodeBaseModule* self);
ValaCCodeExpression* vala_ccode_base_module_get_cvalue (ValaCCodeBaseModule* self, ValaExpression* expr);
static void vala_ccode_control_flow_module_visit_string_switch_statement (ValaCCodeControlFlowModule* self, ValaSwitchStatement* stmt);
ValaLocalVariable* vala_ccode_base_module_get_temp_variable (ValaCCodeBaseModule* self, ValaDataType* type, gboolean value_owned, ValaCodeNode* node_reference, gboolean init);
void vala_ccode_base_module_emit_temp_var (ValaCCodeBaseModule* self, ValaLocalVariable* local, gboolean always_init);
ValaCCodeExpression* vala_ccode_base_module_get_variable_cexpression (ValaCCodeBaseModule* self, const gchar* name);
gboolean vala_ccode_base_module_is_constant_ccode_expression (ValaCCodeBaseModule* self, ValaCCodeExpression* cexpr);
static void vala_ccode_control_flow_module_real_visit_switch_statement (ValaCodeVisitor* base, ValaSwitchStatement* stmt);
static void vala_ccode_control_flow_module_real_visit_switch_label (ValaCodeVisitor* base, ValaSwitchLabel* label);
static void vala_ccode_control_flow_module_real_visit_loop (ValaCodeVisitor* base, ValaLoop* stmt);
ValaCodeContext* vala_ccode_base_module_get_context (ValaCCodeBaseModule* self);
static void vala_ccode_control_flow_module_real_visit_foreach_statement (ValaCodeVisitor* base, ValaForeachStatement* stmt);
gboolean vala_ccode_base_module_is_in_coroutine (ValaCCodeBaseModule* self);
void vala_ccode_base_module_add_simple_check (ValaCCodeBaseModule* self, ValaCodeNode* node, gboolean always_fails);
ValaCCodeExpression* vala_ccode_base_module_get_array_length_cexpression (ValaCCodeBaseModule* self, ValaExpression* array_expr, gint dim);
gchar* vala_ccode_base_module_get_array_length_cname (ValaCCodeBaseModule* self, const gchar* array_cname, gint dim);
ValaCCodeExpression* vala_ccode_base_module_transform_expression (ValaCCodeBaseModule* self, ValaCCodeExpression* source_cexpr, ValaDataType* expression_type, ValaDataType* target_type, ValaExpression* expr);
ValaCCodeExpression* vala_ccode_base_module_convert_from_generic_pointer (ValaCCodeBaseModule* self, ValaCCodeExpression* cexpr, ValaDataType* actual_type);
ValaCCodeExpression* vala_ccode_base_module_get_ref_cexpression (ValaCCodeBaseModule* self, ValaDataType* expression_type, ValaCCodeExpression* cexpr, ValaExpression* expr, ValaCodeNode* node);
gboolean vala_ccode_base_module_requires_destroy (ValaCCodeBaseModule* self, ValaDataType* type);
ValaCCodeExpression* vala_ccode_base_module_destroy_local (ValaCCodeBaseModule* self, ValaLocalVariable* local);
static void vala_ccode_control_flow_module_real_visit_break_statement (ValaCodeVisitor* base, ValaBreakStatement* stmt);
void vala_ccode_base_module_append_local_free (ValaCCodeBaseModule* self, ValaSymbol* sym, gboolean stop_at_loop, ValaCodeNode* stop_at);
ValaSymbol* vala_ccode_base_module_get_current_symbol (ValaCCodeBaseModule* self);
static void vala_ccode_control_flow_module_real_visit_continue_statement (ValaCodeVisitor* base, ValaContinueStatement* stmt);
ValaCCodeControlFlowModule* vala_ccode_control_flow_module_construct (GType object_type);
ValaCCodeMethodModule* vala_ccode_method_module_construct (GType object_type);


static void vala_ccode_control_flow_module_real_visit_if_statement (ValaCodeVisitor* base, ValaIfStatement* stmt) {
      ValaCCodeControlFlowModule * self;
      ValaCCodeFunction* _tmp0_ = NULL;
      ValaExpression* _tmp1_ = NULL;
      ValaCCodeExpression* _tmp2_ = NULL;
      ValaCCodeExpression* _tmp3_;
      ValaBlock* _tmp4_ = NULL;
      ValaBlock* _tmp5_ = NULL;
      ValaCCodeFunction* _tmp8_ = NULL;
      self = (ValaCCodeControlFlowModule*) base;
      g_return_if_fail (stmt != NULL);
      _tmp0_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      _tmp1_ = vala_if_statement_get_condition (stmt);
      _tmp2_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp1_);
      _tmp3_ = _tmp2_;
      vala_ccode_function_open_if (_tmp0_, _tmp3_);
      _vala_ccode_node_unref0 (_tmp3_);
      _tmp4_ = vala_if_statement_get_true_statement (stmt);
      vala_code_node_emit ((ValaCodeNode*) _tmp4_, (ValaCodeGenerator*) self);
      _tmp5_ = vala_if_statement_get_false_statement (stmt);
      if (_tmp5_ != NULL) {
            ValaCCodeFunction* _tmp6_ = NULL;
            ValaBlock* _tmp7_ = NULL;
            _tmp6_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_else (_tmp6_);
            _tmp7_ = vala_if_statement_get_false_statement (stmt);
            vala_code_node_emit ((ValaCodeNode*) _tmp7_, (ValaCodeGenerator*) self);
      }
      _tmp8_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_close (_tmp8_);
}


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


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


static void vala_ccode_control_flow_module_visit_string_switch_statement (ValaCCodeControlFlowModule* self, ValaSwitchStatement* stmt) {
      ValaExpression* _tmp0_ = NULL;
      ValaDataType* _tmp1_ = NULL;
      ValaExpression* _tmp2_ = NULL;
      ValaDataType* _tmp3_ = NULL;
      gboolean _tmp4_;
      ValaLocalVariable* _tmp5_ = NULL;
      ValaLocalVariable* temp_var;
      const gchar* _tmp6_ = NULL;
      ValaCCodeExpression* _tmp7_ = NULL;
      ValaCCodeExpression* ctemp;
      ValaExpression* _tmp8_ = NULL;
      ValaCCodeExpression* _tmp9_ = NULL;
      ValaCCodeExpression* _tmp10_;
      ValaCCodeAssignment* _tmp11_ = NULL;
      ValaCCodeAssignment* _tmp12_;
      ValaCCodeAssignment* cinit;
      ValaCCodeConstant* _tmp13_ = NULL;
      ValaCCodeConstant* czero;
      ValaCCodeIdentifier* _tmp14_ = NULL;
      ValaCCodeIdentifier* _tmp15_;
      ValaCCodeFunctionCall* _tmp16_ = NULL;
      ValaCCodeFunctionCall* _tmp17_;
      ValaCCodeFunctionCall* free_call;
      ValaCCodeConstant* _tmp18_ = NULL;
      ValaCCodeConstant* _tmp19_;
      ValaCCodeBinaryExpression* _tmp20_ = NULL;
      ValaCCodeBinaryExpression* _tmp21_;
      ValaCCodeBinaryExpression* cisnull;
      ValaCCodeIdentifier* _tmp22_ = NULL;
      ValaCCodeIdentifier* _tmp23_;
      ValaCCodeFunctionCall* _tmp24_ = NULL;
      ValaCCodeFunctionCall* _tmp25_;
      ValaCCodeFunctionCall* cquark;
      ValaCCodeConstant* _tmp26_ = NULL;
      ValaCCodeConstant* _tmp27_;
      ValaCCodeConditionalExpression* _tmp28_ = NULL;
      ValaCCodeConditionalExpression* _tmp29_;
      ValaCCodeConditionalExpression* ccond;
      ValaLocalVariable* _tmp30_ = NULL;
      gint label_count;
      ValaCCodeFunction* _tmp50_ = NULL;
      const gchar* _tmp51_ = NULL;
      ValaCCodeExpression* _tmp52_ = NULL;
      ValaCCodeAssignment* _tmp53_ = NULL;
      ValaCCodeFunction* _tmp54_ = NULL;
      ValaExpression* _tmp55_ = NULL;
      ValaDataType* _tmp56_ = NULL;
      gboolean _tmp57_;
      ValaSwitchSection* default_section;
      gint n;
      ValaCCodeFunction* _tmp105_ = NULL;
      g_return_if_fail (self != NULL);
      g_return_if_fail (stmt != NULL);
      _tmp0_ = vala_switch_statement_get_expression (stmt);
      _tmp1_ = vala_expression_get_value_type (_tmp0_);
      _tmp2_ = vala_switch_statement_get_expression (stmt);
      _tmp3_ = vala_expression_get_value_type (_tmp2_);
      _tmp4_ = vala_data_type_get_value_owned (_tmp3_);
      _tmp5_ = vala_ccode_base_module_get_temp_variable ((ValaCCodeBaseModule*) self, _tmp1_, _tmp4_, (ValaCodeNode*) stmt, FALSE);
      temp_var = _tmp5_;
      vala_ccode_base_module_emit_temp_var ((ValaCCodeBaseModule*) self, temp_var, FALSE);
      _tmp6_ = vala_symbol_get_name ((ValaSymbol*) temp_var);
      _tmp7_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp6_);
      ctemp = _tmp7_;
      _tmp8_ = vala_switch_statement_get_expression (stmt);
      _tmp9_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp8_);
      _tmp10_ = _tmp9_;
      _tmp11_ = vala_ccode_assignment_new (ctemp, _tmp10_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
      _tmp12_ = _tmp11_;
      _vala_ccode_node_unref0 (_tmp10_);
      cinit = _tmp12_;
      _tmp13_ = vala_ccode_constant_new ("0");
      czero = _tmp13_;
      _tmp14_ = vala_ccode_identifier_new ("g_free");
      _tmp15_ = _tmp14_;
      _tmp16_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp15_);
      _tmp17_ = _tmp16_;
      _vala_ccode_node_unref0 (_tmp15_);
      free_call = _tmp17_;
      vala_ccode_function_call_add_argument (free_call, ctemp);
      _tmp18_ = vala_ccode_constant_new ("NULL");
      _tmp19_ = _tmp18_;
      _tmp20_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_EQUALITY, (ValaCCodeExpression*) _tmp19_, ctemp);
      _tmp21_ = _tmp20_;
      _vala_ccode_node_unref0 (_tmp19_);
      cisnull = _tmp21_;
      _tmp22_ = vala_ccode_identifier_new ("g_quark_from_string");
      _tmp23_ = _tmp22_;
      _tmp24_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp23_);
      _tmp25_ = _tmp24_;
      _vala_ccode_node_unref0 (_tmp23_);
      cquark = _tmp25_;
      vala_ccode_function_call_add_argument (cquark, ctemp);
      _tmp26_ = vala_ccode_constant_new ("0");
      _tmp27_ = _tmp26_;
      _tmp28_ = vala_ccode_conditional_expression_new ((ValaCCodeExpression*) cisnull, (ValaCCodeExpression*) _tmp27_, (ValaCCodeExpression*) cquark);
      _tmp29_ = _tmp28_;
      _vala_ccode_node_unref0 (_tmp27_);
      ccond = _tmp29_;
      _tmp30_ = vala_ccode_base_module_get_temp_variable ((ValaCCodeBaseModule*) self, ((ValaCCodeBaseModule*) self)->gquark_type, TRUE, NULL, TRUE);
      _vala_code_node_unref0 (temp_var);
      temp_var = _tmp30_;
      vala_ccode_base_module_emit_temp_var ((ValaCCodeBaseModule*) self, temp_var, FALSE);
      label_count = 0;
      {
            ValaList* _tmp31_ = NULL;
            ValaList* _section_list;
            gint _tmp32_;
            gint _section_size;
            gint _section_index;
            _tmp31_ = vala_switch_statement_get_sections (stmt);
            _section_list = _tmp31_;
            _tmp32_ = vala_collection_get_size ((ValaCollection*) _section_list);
            _section_size = _tmp32_;
            _section_index = -1;
            while (TRUE) {
                  gpointer _tmp33_ = NULL;
                  ValaSwitchSection* section;
                  gboolean _tmp34_;
                  _section_index = _section_index + 1;
                  if (!(_section_index < _section_size)) {
                        break;
                  }
                  _tmp33_ = vala_list_get (_section_list, _section_index);
                  section = (ValaSwitchSection*) _tmp33_;
                  _tmp34_ = vala_switch_section_has_default_label (section);
                  if (_tmp34_) {
                        _vala_code_node_unref0 (section);
                        continue;
                  }
                  {
                        ValaList* _tmp35_ = NULL;
                        ValaList* _label_list;
                        gint _tmp36_;
                        gint _label_size;
                        gint _label_index;
                        _tmp35_ = vala_switch_section_get_labels (section);
                        _label_list = _tmp35_;
                        _tmp36_ = vala_collection_get_size ((ValaCollection*) _label_list);
                        _label_size = _tmp36_;
                        _label_index = -1;
                        while (TRUE) {
                              gpointer _tmp37_ = NULL;
                              ValaSwitchLabel* label;
                              ValaExpression* _tmp38_ = NULL;
                              ValaExpression* _tmp39_ = NULL;
                              ValaCCodeExpression* _tmp40_ = NULL;
                              ValaCCodeExpression* cexpr;
                              gboolean _tmp41_;
                              _label_index = _label_index + 1;
                              if (!(_label_index < _label_size)) {
                                    break;
                              }
                              _tmp37_ = vala_list_get (_label_list, _label_index);
                              label = (ValaSwitchLabel*) _tmp37_;
                              _tmp38_ = vala_switch_label_get_expression (label);
                              vala_code_node_emit ((ValaCodeNode*) _tmp38_, (ValaCodeGenerator*) self);
                              _tmp39_ = vala_switch_label_get_expression (label);
                              _tmp40_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp39_);
                              cexpr = _tmp40_;
                              _tmp41_ = vala_ccode_base_module_is_constant_ccode_expression ((ValaCCodeBaseModule*) self, cexpr);
                              if (_tmp41_) {
                                    const gchar* _tmp42_ = NULL;
                                    gint _tmp43_;
                                    gchar* _tmp44_ = NULL;
                                    gchar* cname;
                                    ValaCCodeFunction* _tmp45_ = NULL;
                                    gchar* _tmp46_ = NULL;
                                    gchar* _tmp47_;
                                    ValaCCodeVariableDeclarator* _tmp48_ = NULL;
                                    ValaCCodeVariableDeclarator* _tmp49_;
                                    _tmp42_ = vala_symbol_get_name ((ValaSymbol*) temp_var);
                                    _tmp43_ = label_count;
                                    label_count = _tmp43_ + 1;
                                    _tmp44_ = g_strdup_printf ("%s_label%d", _tmp42_, _tmp43_);
                                    cname = _tmp44_;
                                    _tmp45_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                    _tmp46_ = vala_data_type_get_cname (((ValaCCodeBaseModule*) self)->gquark_type);
                                    _tmp47_ = _tmp46_;
                                    _tmp48_ = vala_ccode_variable_declarator_new (cname, (ValaCCodeExpression*) czero, NULL);
                                    _tmp49_ = _tmp48_;
                                    vala_ccode_function_add_declaration (_tmp45_, _tmp47_, (ValaCCodeDeclarator*) _tmp49_, VALA_CCODE_MODIFIERS_STATIC);
                                    _vala_ccode_node_unref0 (_tmp49_);
                                    _g_free0 (_tmp47_);
                                    _g_free0 (cname);
                              }
                              _vala_ccode_node_unref0 (cexpr);
                              _vala_code_node_unref0 (label);
                        }
                        _vala_iterable_unref0 (_label_list);
                  }
                  _vala_code_node_unref0 (section);
            }
            _vala_iterable_unref0 (_section_list);
      }
      _tmp50_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_add_expression (_tmp50_, (ValaCCodeExpression*) cinit);
      _tmp51_ = vala_symbol_get_name ((ValaSymbol*) temp_var);
      _tmp52_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp51_);
      _vala_ccode_node_unref0 (ctemp);
      ctemp = _tmp52_;
      _tmp53_ = vala_ccode_assignment_new (ctemp, (ValaCCodeExpression*) ccond, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
      _vala_ccode_node_unref0 (cinit);
      cinit = _tmp53_;
      _tmp54_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_add_expression (_tmp54_, (ValaCCodeExpression*) cinit);
      _tmp55_ = vala_switch_statement_get_expression (stmt);
      _tmp56_ = vala_expression_get_value_type (_tmp55_);
      _tmp57_ = vala_data_type_get_value_owned (_tmp56_);
      if (_tmp57_) {
            ValaCCodeFunction* _tmp58_ = NULL;
            _tmp58_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_expression (_tmp58_, (ValaCCodeExpression*) free_call);
      }
      default_section = NULL;
      label_count = 0;
      n = 0;
      {
            ValaList* _tmp59_ = NULL;
            ValaList* _section_list;
            gint _tmp60_;
            gint _section_size;
            gint _section_index;
            _tmp59_ = vala_switch_statement_get_sections (stmt);
            _section_list = _tmp59_;
            _tmp60_ = vala_collection_get_size ((ValaCollection*) _section_list);
            _section_size = _tmp60_;
            _section_index = -1;
            while (TRUE) {
                  gpointer _tmp61_ = NULL;
                  ValaSwitchSection* section;
                  gboolean _tmp62_;
                  ValaCCodeBinaryExpression* cor;
                  ValaCCodeFunction* _tmp94_ = NULL;
                  ValaCCodeConstant* _tmp95_ = NULL;
                  ValaCCodeConstant* _tmp96_;
                  ValaCCodeFunction* _tmp97_ = NULL;
                  ValaCCodeFunction* _tmp98_ = NULL;
                  _section_index = _section_index + 1;
                  if (!(_section_index < _section_size)) {
                        break;
                  }
                  _tmp61_ = vala_list_get (_section_list, _section_index);
                  section = (ValaSwitchSection*) _tmp61_;
                  _tmp62_ = vala_switch_section_has_default_label (section);
                  if (_tmp62_) {
                        ValaSwitchSection* _tmp63_;
                        _tmp63_ = _vala_code_node_ref0 (section);
                        _vala_code_node_unref0 (default_section);
                        default_section = _tmp63_;
                        _vala_code_node_unref0 (section);
                        continue;
                  }
                  cor = NULL;
                  {
                        ValaList* _tmp64_ = NULL;
                        ValaList* _label_list;
                        gint _tmp65_;
                        gint _label_size;
                        gint _label_index;
                        _tmp64_ = vala_switch_section_get_labels (section);
                        _label_list = _tmp64_;
                        _tmp65_ = vala_collection_get_size ((ValaCollection*) _label_list);
                        _label_size = _tmp65_;
                        _label_index = -1;
                        while (TRUE) {
                              gpointer _tmp66_ = NULL;
                              ValaSwitchLabel* label;
                              ValaExpression* _tmp67_ = NULL;
                              ValaExpression* _tmp68_ = NULL;
                              ValaCCodeExpression* _tmp69_ = NULL;
                              ValaCCodeExpression* cexpr;
                              gboolean _tmp70_;
                              ValaCCodeBinaryExpression* _tmp89_ = NULL;
                              ValaCCodeBinaryExpression* ccmp;
                              _label_index = _label_index + 1;
                              if (!(_label_index < _label_size)) {
                                    break;
                              }
                              _tmp66_ = vala_list_get (_label_list, _label_index);
                              label = (ValaSwitchLabel*) _tmp66_;
                              _tmp67_ = vala_switch_label_get_expression (label);
                              vala_code_node_emit ((ValaCodeNode*) _tmp67_, (ValaCodeGenerator*) self);
                              _tmp68_ = vala_switch_label_get_expression (label);
                              _tmp69_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp68_);
                              cexpr = _tmp69_;
                              _tmp70_ = vala_ccode_base_module_is_constant_ccode_expression ((ValaCCodeBaseModule*) self, cexpr);
                              if (_tmp70_) {
                                    const gchar* _tmp71_ = NULL;
                                    gint _tmp72_;
                                    gchar* _tmp73_ = NULL;
                                    gchar* _tmp74_;
                                    ValaCCodeIdentifier* _tmp75_ = NULL;
                                    ValaCCodeIdentifier* _tmp76_;
                                    ValaCCodeIdentifier* cname;
                                    ValaCCodeBinaryExpression* _tmp77_ = NULL;
                                    ValaCCodeBinaryExpression* ccondition;
                                    ValaCCodeIdentifier* _tmp78_ = NULL;
                                    ValaCCodeIdentifier* _tmp79_;
                                    ValaCCodeFunctionCall* _tmp80_ = NULL;
                                    ValaCCodeFunctionCall* _tmp81_;
                                    ValaCCodeFunctionCall* ccall;
                                    ValaCCodeAssignment* _tmp82_ = NULL;
                                    ValaCCodeConditionalExpression* _tmp83_ = NULL;
                                    _tmp71_ = vala_symbol_get_name ((ValaSymbol*) temp_var);
                                    _tmp72_ = label_count;
                                    label_count = _tmp72_ + 1;
                                    _tmp73_ = g_strdup_printf ("%s_label%d", _tmp71_, _tmp72_);
                                    _tmp74_ = _tmp73_;
                                    _tmp75_ = vala_ccode_identifier_new (_tmp74_);
                                    _tmp76_ = _tmp75_;
                                    _g_free0 (_tmp74_);
                                    cname = _tmp76_;
                                    _tmp77_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_INEQUALITY, (ValaCCodeExpression*) czero, (ValaCCodeExpression*) cname);
                                    ccondition = _tmp77_;
                                    _tmp78_ = vala_ccode_identifier_new ("g_quark_from_static_string");
                                    _tmp79_ = _tmp78_;
                                    _tmp80_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp79_);
                                    _tmp81_ = _tmp80_;
                                    _vala_ccode_node_unref0 (_tmp79_);
                                    ccall = _tmp81_;
                                    _tmp82_ = vala_ccode_assignment_new ((ValaCCodeExpression*) cname, (ValaCCodeExpression*) ccall, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
                                    _vala_ccode_node_unref0 (cinit);
                                    cinit = _tmp82_;
                                    vala_ccode_function_call_add_argument (ccall, cexpr);
                                    _tmp83_ = vala_ccode_conditional_expression_new ((ValaCCodeExpression*) ccondition, (ValaCCodeExpression*) cname, (ValaCCodeExpression*) cinit);
                                    _vala_ccode_node_unref0 (cexpr);
                                    cexpr = (ValaCCodeExpression*) _tmp83_;
                                    _vala_ccode_node_unref0 (ccall);
                                    _vala_ccode_node_unref0 (ccondition);
                                    _vala_ccode_node_unref0 (cname);
                              } else {
                                    ValaCCodeIdentifier* _tmp84_ = NULL;
                                    ValaCCodeIdentifier* _tmp85_;
                                    ValaCCodeFunctionCall* _tmp86_ = NULL;
                                    ValaCCodeFunctionCall* _tmp87_;
                                    ValaCCodeFunctionCall* ccall;
                                    ValaCCodeExpression* _tmp88_;
                                    _tmp84_ = vala_ccode_identifier_new ("g_quark_from_string");
                                    _tmp85_ = _tmp84_;
                                    _tmp86_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp85_);
                                    _tmp87_ = _tmp86_;
                                    _vala_ccode_node_unref0 (_tmp85_);
                                    ccall = _tmp87_;
                                    vala_ccode_function_call_add_argument (ccall, cexpr);
                                    _tmp88_ = _vala_ccode_node_ref0 ((ValaCCodeExpression*) ccall);
                                    _vala_ccode_node_unref0 (cexpr);
                                    cexpr = _tmp88_;
                                    _vala_ccode_node_unref0 (ccall);
                              }
                              _tmp89_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_EQUALITY, ctemp, cexpr);
                              ccmp = _tmp89_;
                              if (cor == NULL) {
                                    ValaCCodeBinaryExpression* _tmp90_;
                                    _tmp90_ = _vala_ccode_node_ref0 (ccmp);
                                    _vala_ccode_node_unref0 (cor);
                                    cor = _tmp90_;
                              } else {
                                    ValaCCodeBinaryExpression* _tmp91_ = NULL;
                                    _tmp91_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_OR, (ValaCCodeExpression*) cor, (ValaCCodeExpression*) ccmp);
                                    _vala_ccode_node_unref0 (cor);
                                    cor = _tmp91_;
                              }
                              _vala_ccode_node_unref0 (ccmp);
                              _vala_ccode_node_unref0 (cexpr);
                              _vala_code_node_unref0 (label);
                        }
                        _vala_iterable_unref0 (_label_list);
                  }
                  if (n > 0) {
                        ValaCCodeFunction* _tmp92_ = NULL;
                        _tmp92_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_else_if (_tmp92_, (ValaCCodeExpression*) cor);
                  } else {
                        ValaCCodeFunction* _tmp93_ = NULL;
                        _tmp93_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_open_if (_tmp93_, (ValaCCodeExpression*) cor);
                  }
                  _tmp94_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp95_ = vala_ccode_constant_new ("0");
                  _tmp96_ = _tmp95_;
                  vala_ccode_function_open_switch (_tmp94_, (ValaCCodeExpression*) _tmp96_);
                  _vala_ccode_node_unref0 (_tmp96_);
                  _tmp97_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  vala_ccode_function_add_default (_tmp97_);
                  vala_code_node_emit ((ValaCodeNode*) section, (ValaCodeGenerator*) self);
                  _tmp98_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  vala_ccode_function_close (_tmp98_);
                  n++;
                  _vala_ccode_node_unref0 (cor);
                  _vala_code_node_unref0 (section);
            }
            _vala_iterable_unref0 (_section_list);
      }
      if (default_section != NULL) {
            ValaCCodeFunction* _tmp100_ = NULL;
            ValaCCodeConstant* _tmp101_ = NULL;
            ValaCCodeConstant* _tmp102_;
            ValaCCodeFunction* _tmp103_ = NULL;
            if (n > 0) {
                  ValaCCodeFunction* _tmp99_ = NULL;
                  _tmp99_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  vala_ccode_function_add_else (_tmp99_);
            }
            _tmp100_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp101_ = vala_ccode_constant_new ("0");
            _tmp102_ = _tmp101_;
            vala_ccode_function_open_switch (_tmp100_, (ValaCCodeExpression*) _tmp102_);
            _vala_ccode_node_unref0 (_tmp102_);
            _tmp103_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_default (_tmp103_);
            vala_code_node_emit ((ValaCodeNode*) default_section, (ValaCodeGenerator*) self);
            if (n > 0) {
                  ValaCCodeFunction* _tmp104_ = NULL;
                  _tmp104_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  vala_ccode_function_close (_tmp104_);
            }
      }
      _tmp105_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_close (_tmp105_);
      _vala_code_node_unref0 (default_section);
      _vala_ccode_node_unref0 (ccond);
      _vala_ccode_node_unref0 (cquark);
      _vala_ccode_node_unref0 (cisnull);
      _vala_ccode_node_unref0 (free_call);
      _vala_ccode_node_unref0 (czero);
      _vala_ccode_node_unref0 (cinit);
      _vala_ccode_node_unref0 (ctemp);
      _vala_code_node_unref0 (temp_var);
}


static void vala_ccode_control_flow_module_real_visit_switch_statement (ValaCodeVisitor* base, ValaSwitchStatement* stmt) {
      ValaCCodeControlFlowModule * self;
      ValaExpression* _tmp0_ = NULL;
      ValaDataType* _tmp1_ = NULL;
      gboolean _tmp2_;
      ValaCCodeFunction* _tmp3_ = NULL;
      ValaExpression* _tmp4_ = NULL;
      ValaCCodeExpression* _tmp5_ = NULL;
      ValaCCodeExpression* _tmp6_;
      gboolean has_default;
      ValaCCodeFunction* _tmp14_ = NULL;
      self = (ValaCCodeControlFlowModule*) base;
      g_return_if_fail (stmt != NULL);
      _tmp0_ = vala_switch_statement_get_expression (stmt);
      _tmp1_ = vala_expression_get_value_type (_tmp0_);
      _tmp2_ = vala_data_type_compatible (_tmp1_, ((ValaCCodeBaseModule*) self)->string_type);
      if (_tmp2_) {
            vala_ccode_control_flow_module_visit_string_switch_statement (self, stmt);
            return;
      }
      _tmp3_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      _tmp4_ = vala_switch_statement_get_expression (stmt);
      _tmp5_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp4_);
      _tmp6_ = _tmp5_;
      vala_ccode_function_open_switch (_tmp3_, _tmp6_);
      _vala_ccode_node_unref0 (_tmp6_);
      has_default = FALSE;
      {
            ValaList* _tmp7_ = NULL;
            ValaList* _section_list;
            gint _tmp8_;
            gint _section_size;
            gint _section_index;
            _tmp7_ = vala_switch_statement_get_sections (stmt);
            _section_list = _tmp7_;
            _tmp8_ = vala_collection_get_size ((ValaCollection*) _section_list);
            _section_size = _tmp8_;
            _section_index = -1;
            while (TRUE) {
                  gpointer _tmp9_ = NULL;
                  ValaSwitchSection* section;
                  gboolean _tmp10_;
                  _section_index = _section_index + 1;
                  if (!(_section_index < _section_size)) {
                        break;
                  }
                  _tmp9_ = vala_list_get (_section_list, _section_index);
                  section = (ValaSwitchSection*) _tmp9_;
                  _tmp10_ = vala_switch_section_has_default_label (section);
                  if (_tmp10_) {
                        ValaCCodeFunction* _tmp11_ = NULL;
                        _tmp11_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_add_default (_tmp11_);
                        has_default = TRUE;
                  }
                  vala_code_node_emit ((ValaCodeNode*) section, (ValaCodeGenerator*) self);
                  _vala_code_node_unref0 (section);
            }
            _vala_iterable_unref0 (_section_list);
      }
      if (!has_default) {
            ValaCCodeFunction* _tmp12_ = NULL;
            ValaCCodeFunction* _tmp13_ = NULL;
            _tmp12_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_default (_tmp12_);
            _tmp13_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_add_break (_tmp13_);
      }
      _tmp14_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_close (_tmp14_);
}


static void vala_ccode_control_flow_module_real_visit_switch_label (ValaCodeVisitor* base, ValaSwitchLabel* label) {
      ValaCCodeControlFlowModule * self;
      ValaSwitchSection* _tmp0_ = NULL;
      ValaCodeNode* _tmp1_ = NULL;
      ValaExpression* _tmp2_ = NULL;
      ValaDataType* _tmp3_ = NULL;
      gboolean _tmp4_;
      ValaExpression* _tmp5_ = NULL;
      self = (ValaCCodeControlFlowModule*) base;
      g_return_if_fail (label != NULL);
      _tmp0_ = vala_switch_label_get_section (label);
      _tmp1_ = vala_code_node_get_parent_node ((ValaCodeNode*) _tmp0_);
      _tmp2_ = vala_switch_statement_get_expression (VALA_SWITCH_STATEMENT (_tmp1_));
      _tmp3_ = vala_expression_get_value_type (_tmp2_);
      _tmp4_ = vala_data_type_compatible (_tmp3_, ((ValaCCodeBaseModule*) self)->string_type);
      if (_tmp4_) {
            return;
      }
      _tmp5_ = vala_switch_label_get_expression (label);
      if (_tmp5_ != NULL) {
            ValaExpression* _tmp6_ = NULL;
            ValaExpression* _tmp7_ = NULL;
            ValaCCodeFunction* _tmp8_ = NULL;
            ValaExpression* _tmp9_ = NULL;
            ValaCCodeExpression* _tmp10_ = NULL;
            ValaCCodeExpression* _tmp11_;
            _tmp6_ = vala_switch_label_get_expression (label);
            vala_code_node_emit ((ValaCodeNode*) _tmp6_, (ValaCodeGenerator*) self);
            _tmp7_ = vala_switch_label_get_expression (label);
            vala_code_visitor_visit_end_full_expression ((ValaCodeVisitor*) self, _tmp7_);
            _tmp8_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp9_ = vala_switch_label_get_expression (label);
            _tmp10_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp9_);
            _tmp11_ = _tmp10_;
            vala_ccode_function_add_case (_tmp8_, _tmp11_);
            _vala_ccode_node_unref0 (_tmp11_);
      }
}


static void vala_ccode_control_flow_module_real_visit_loop (ValaCodeVisitor* base, ValaLoop* stmt) {
      ValaCCodeControlFlowModule * self;
      ValaCodeContext* _tmp0_ = NULL;
      ValaProfile _tmp1_;
      ValaBlock* _tmp8_ = NULL;
      ValaCCodeFunction* _tmp9_ = NULL;
      self = (ValaCCodeControlFlowModule*) base;
      g_return_if_fail (stmt != NULL);
      _tmp0_ = vala_ccode_base_module_get_context ((ValaCCodeBaseModule*) self);
      _tmp1_ = vala_code_context_get_profile (_tmp0_);
      if (_tmp1_ == VALA_PROFILE_GOBJECT) {
            ValaCCodeFunction* _tmp2_ = NULL;
            ValaCCodeConstant* _tmp3_ = NULL;
            ValaCCodeConstant* _tmp4_;
            _tmp2_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp3_ = vala_ccode_constant_new ("TRUE");
            _tmp4_ = _tmp3_;
            vala_ccode_function_open_while (_tmp2_, (ValaCCodeExpression*) _tmp4_);
            _vala_ccode_node_unref0 (_tmp4_);
      } else {
            ValaCCodeFunction* _tmp5_ = NULL;
            ValaCCodeConstant* _tmp6_ = NULL;
            ValaCCodeConstant* _tmp7_;
            vala_ccode_file_add_include (((ValaCCodeBaseModule*) self)->cfile, "stdbool.h", FALSE);
            _tmp5_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp6_ = vala_ccode_constant_new ("true");
            _tmp7_ = _tmp6_;
            vala_ccode_function_open_while (_tmp5_, (ValaCCodeExpression*) _tmp7_);
            _vala_ccode_node_unref0 (_tmp7_);
      }
      _tmp8_ = vala_loop_get_body (stmt);
      vala_code_node_emit ((ValaCodeNode*) _tmp8_, (ValaCodeGenerator*) self);
      _tmp9_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_close (_tmp9_);
}


static void vala_ccode_control_flow_module_real_visit_foreach_statement (ValaCodeVisitor* base, ValaForeachStatement* stmt) {
      ValaCCodeControlFlowModule * self;
      ValaCCodeFunction* _tmp0_ = NULL;
      ValaLocalVariable* _tmp1_ = NULL;
      ValaLocalVariable* _tmp2_;
      ValaLocalVariable* collection_backup;
      ValaDataType* _tmp3_ = NULL;
      ValaDataType* _tmp4_ = NULL;
      ValaDataType* collection_type;
      ValaDataType* _tmp5_;
      ValaArrayType* _tmp6_;
      ValaArrayType* array_type;
      gboolean _tmp7_;
      ValaCCodeFunction* _tmp16_ = NULL;
      const gchar* _tmp17_ = NULL;
      ValaCCodeExpression* _tmp18_ = NULL;
      ValaCCodeExpression* _tmp19_;
      ValaExpression* _tmp20_ = NULL;
      ValaCCodeExpression* _tmp21_ = NULL;
      ValaCCodeExpression* _tmp22_;
      gboolean _tmp23_ = FALSE;
      gboolean _tmp24_;
      ValaExpression* _tmp28_ = NULL;
      ValaDataType* _tmp29_ = NULL;
      ValaCCodeFunction* _tmp296_ = NULL;
      self = (ValaCCodeControlFlowModule*) base;
      g_return_if_fail (stmt != NULL);
      _tmp0_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_open_block (_tmp0_);
      _tmp1_ = vala_foreach_statement_get_collection_variable (stmt);
      _tmp2_ = _vala_code_node_ref0 (_tmp1_);
      collection_backup = _tmp2_;
      _tmp3_ = vala_variable_get_variable_type ((ValaVariable*) collection_backup);
      _tmp4_ = vala_data_type_copy (_tmp3_);
      collection_type = _tmp4_;
      _tmp5_ = collection_type;
      _tmp6_ = _vala_code_node_ref0 (VALA_IS_ARRAY_TYPE (_tmp5_) ? ((ValaArrayType*) _tmp5_) : NULL);
      array_type = _tmp6_;
      if (array_type != NULL) {
            vala_array_type_set_fixed_length (array_type, FALSE);
      }
      _tmp7_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
      if (_tmp7_) {
            gchar* _tmp8_ = NULL;
            gchar* _tmp9_;
            const gchar* _tmp10_ = NULL;
            _tmp8_ = vala_data_type_get_cname (collection_type);
            _tmp9_ = _tmp8_;
            _tmp10_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
            vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, _tmp9_, _tmp10_, NULL);
            _g_free0 (_tmp9_);
      } else {
            const gchar* _tmp11_ = NULL;
            ValaCCodeVariableDeclarator* _tmp12_ = NULL;
            ValaCCodeVariableDeclarator* ccolvardecl;
            ValaCCodeFunction* _tmp13_ = NULL;
            gchar* _tmp14_ = NULL;
            gchar* _tmp15_;
            _tmp11_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
            _tmp12_ = vala_ccode_variable_declarator_new (_tmp11_, NULL, NULL);
            ccolvardecl = _tmp12_;
            _tmp13_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp14_ = vala_data_type_get_cname (collection_type);
            _tmp15_ = _tmp14_;
            vala_ccode_function_add_declaration (_tmp13_, _tmp15_, (ValaCCodeDeclarator*) ccolvardecl, 0);
            _g_free0 (_tmp15_);
            _vala_ccode_node_unref0 (ccolvardecl);
      }
      _tmp16_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      _tmp17_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
      _tmp18_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp17_);
      _tmp19_ = _tmp18_;
      _tmp20_ = vala_foreach_statement_get_collection (stmt);
      _tmp21_ = vala_ccode_base_module_get_cvalue ((ValaCCodeBaseModule*) self, _tmp20_);
      _tmp22_ = _tmp21_;
      vala_ccode_function_add_assignment (_tmp16_, _tmp19_, _tmp22_);
      _vala_ccode_node_unref0 (_tmp22_);
      _vala_ccode_node_unref0 (_tmp19_);
      _tmp24_ = vala_code_node_get_tree_can_fail ((ValaCodeNode*) stmt);
      if (_tmp24_) {
            ValaExpression* _tmp25_ = NULL;
            gboolean _tmp26_;
            _tmp25_ = vala_foreach_statement_get_collection (stmt);
            _tmp26_ = vala_code_node_get_tree_can_fail ((ValaCodeNode*) _tmp25_);
            _tmp23_ = _tmp26_;
      } else {
            _tmp23_ = FALSE;
      }
      if (_tmp23_) {
            ValaExpression* _tmp27_ = NULL;
            _tmp27_ = vala_foreach_statement_get_collection (stmt);
            vala_ccode_base_module_add_simple_check ((ValaCCodeBaseModule*) self, (ValaCodeNode*) _tmp27_, FALSE);
      }
      _tmp28_ = vala_foreach_statement_get_collection (stmt);
      _tmp29_ = vala_expression_get_value_type (_tmp28_);
      if (VALA_IS_ARRAY_TYPE (_tmp29_)) {
            ValaExpression* _tmp30_ = NULL;
            ValaDataType* _tmp31_ = NULL;
            ValaArrayType* _tmp32_;
            ValaExpression* _tmp33_ = NULL;
            ValaCCodeExpression* _tmp34_ = NULL;
            ValaCCodeExpression* array_len;
            gboolean _tmp35_;
            ValaCCodeFunction* _tmp45_ = NULL;
            const gchar* _tmp46_ = NULL;
            gchar* _tmp47_ = NULL;
            gchar* _tmp48_;
            ValaCCodeExpression* _tmp49_ = NULL;
            ValaCCodeExpression* _tmp50_;
            const gchar* _tmp51_ = NULL;
            gchar* _tmp52_;
            gchar* it_name;
            gboolean _tmp53_;
            ValaCCodeExpression* _tmp57_ = NULL;
            ValaCCodeExpression* _tmp58_;
            ValaCCodeBinaryExpression* _tmp59_ = NULL;
            ValaCCodeBinaryExpression* _tmp60_;
            ValaCCodeBinaryExpression* ccond;
            ValaCCodeFunction* _tmp61_ = NULL;
            ValaCCodeExpression* _tmp62_ = NULL;
            ValaCCodeExpression* _tmp63_;
            ValaCCodeConstant* _tmp64_ = NULL;
            ValaCCodeConstant* _tmp65_;
            ValaCCodeAssignment* _tmp66_ = NULL;
            ValaCCodeAssignment* _tmp67_;
            ValaCCodeExpression* _tmp68_ = NULL;
            ValaCCodeExpression* _tmp69_;
            ValaCCodeExpression* _tmp70_ = NULL;
            ValaCCodeExpression* _tmp71_;
            ValaCCodeConstant* _tmp72_ = NULL;
            ValaCCodeConstant* _tmp73_;
            ValaCCodeBinaryExpression* _tmp74_ = NULL;
            ValaCCodeBinaryExpression* _tmp75_;
            ValaCCodeAssignment* _tmp76_ = NULL;
            ValaCCodeAssignment* _tmp77_;
            const gchar* _tmp78_ = NULL;
            ValaCCodeExpression* _tmp79_ = NULL;
            ValaCCodeExpression* _tmp80_;
            ValaCCodeExpression* _tmp81_ = NULL;
            ValaCCodeExpression* _tmp82_;
            ValaCCodeElementAccess* _tmp83_ = NULL;
            ValaCCodeExpression* _tmp84_;
            ValaCCodeExpression* element_expr;
            ValaDataType* _tmp85_ = NULL;
            ValaDataType* _tmp86_ = NULL;
            ValaDataType* element_type;
            ValaDataType* _tmp87_ = NULL;
            ValaCCodeExpression* _tmp88_ = NULL;
            gboolean _tmp89_;
            ValaCCodeFunction* _tmp101_ = NULL;
            const gchar* _tmp102_ = NULL;
            ValaCCodeExpression* _tmp103_ = NULL;
            ValaCCodeExpression* _tmp104_;
            ValaDataType* _tmp105_ = NULL;
            ValaBlock* _tmp130_ = NULL;
            ValaCCodeFunction* _tmp131_ = NULL;
            _tmp30_ = vala_foreach_statement_get_collection (stmt);
            _tmp31_ = vala_expression_get_value_type (_tmp30_);
            _tmp32_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp31_));
            _vala_code_node_unref0 (array_type);
            array_type = _tmp32_;
            _tmp33_ = vala_foreach_statement_get_collection (stmt);
            _tmp34_ = vala_ccode_base_module_get_array_length_cexpression ((ValaCCodeBaseModule*) self, _tmp33_, -1);
            array_len = _tmp34_;
            _tmp35_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
            if (_tmp35_) {
                  const gchar* _tmp36_ = NULL;
                  gchar* _tmp37_ = NULL;
                  gchar* _tmp38_;
                  _tmp36_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
                  _tmp37_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp36_, 1);
                  _tmp38_ = _tmp37_;
                  vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, "int", _tmp38_, NULL);
                  _g_free0 (_tmp38_);
            } else {
                  ValaCCodeFunction* _tmp39_ = NULL;
                  const gchar* _tmp40_ = NULL;
                  gchar* _tmp41_ = NULL;
                  gchar* _tmp42_;
                  ValaCCodeVariableDeclarator* _tmp43_ = NULL;
                  ValaCCodeVariableDeclarator* _tmp44_;
                  _tmp39_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp40_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
                  _tmp41_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp40_, 1);
                  _tmp42_ = _tmp41_;
                  _tmp43_ = vala_ccode_variable_declarator_new (_tmp42_, NULL, NULL);
                  _tmp44_ = _tmp43_;
                  vala_ccode_function_add_declaration (_tmp39_, "int", (ValaCCodeDeclarator*) _tmp44_, 0);
                  _vala_ccode_node_unref0 (_tmp44_);
                  _g_free0 (_tmp42_);
            }
            _tmp45_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp46_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
            _tmp47_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp46_, 1);
            _tmp48_ = _tmp47_;
            _tmp49_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp48_);
            _tmp50_ = _tmp49_;
            vala_ccode_function_add_assignment (_tmp45_, _tmp50_, array_len);
            _vala_ccode_node_unref0 (_tmp50_);
            _g_free0 (_tmp48_);
            _tmp51_ = vala_foreach_statement_get_variable_name (stmt);
            _tmp52_ = g_strconcat (_tmp51_, "_it", NULL);
            it_name = _tmp52_;
            _tmp53_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
            if (_tmp53_) {
                  vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, "int", it_name, NULL);
            } else {
                  ValaCCodeFunction* _tmp54_ = NULL;
                  ValaCCodeVariableDeclarator* _tmp55_ = NULL;
                  ValaCCodeVariableDeclarator* _tmp56_;
                  _tmp54_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp55_ = vala_ccode_variable_declarator_new (it_name, NULL, NULL);
                  _tmp56_ = _tmp55_;
                  vala_ccode_function_add_declaration (_tmp54_, "int", (ValaCCodeDeclarator*) _tmp56_, 0);
                  _vala_ccode_node_unref0 (_tmp56_);
            }
            _tmp57_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
            _tmp58_ = _tmp57_;
            _tmp59_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_LESS_THAN, _tmp58_, array_len);
            _tmp60_ = _tmp59_;
            _vala_ccode_node_unref0 (_tmp58_);
            ccond = _tmp60_;
            _tmp61_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp62_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
            _tmp63_ = _tmp62_;
            _tmp64_ = vala_ccode_constant_new ("0");
            _tmp65_ = _tmp64_;
            _tmp66_ = vala_ccode_assignment_new (_tmp63_, (ValaCCodeExpression*) _tmp65_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
            _tmp67_ = _tmp66_;
            _tmp68_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
            _tmp69_ = _tmp68_;
            _tmp70_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
            _tmp71_ = _tmp70_;
            _tmp72_ = vala_ccode_constant_new ("1");
            _tmp73_ = _tmp72_;
            _tmp74_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, _tmp71_, (ValaCCodeExpression*) _tmp73_);
            _tmp75_ = _tmp74_;
            _tmp76_ = vala_ccode_assignment_new (_tmp69_, (ValaCCodeExpression*) _tmp75_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
            _tmp77_ = _tmp76_;
            vala_ccode_function_open_for (_tmp61_, (ValaCCodeExpression*) _tmp67_, (ValaCCodeExpression*) ccond, (ValaCCodeExpression*) _tmp77_);
            _vala_ccode_node_unref0 (_tmp77_);
            _vala_ccode_node_unref0 (_tmp75_);
            _vala_ccode_node_unref0 (_tmp73_);
            _vala_ccode_node_unref0 (_tmp71_);
            _vala_ccode_node_unref0 (_tmp69_);
            _vala_ccode_node_unref0 (_tmp67_);
            _vala_ccode_node_unref0 (_tmp65_);
            _vala_ccode_node_unref0 (_tmp63_);
            _tmp78_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
            _tmp79_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp78_);
            _tmp80_ = _tmp79_;
            _tmp81_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
            _tmp82_ = _tmp81_;
            _tmp83_ = vala_ccode_element_access_new (_tmp80_, _tmp82_);
            _tmp84_ = (ValaCCodeExpression*) _tmp83_;
            _vala_ccode_node_unref0 (_tmp82_);
            _vala_ccode_node_unref0 (_tmp80_);
            element_expr = _tmp84_;
            _tmp85_ = vala_array_type_get_element_type (array_type);
            _tmp86_ = vala_data_type_copy (_tmp85_);
            element_type = _tmp86_;
            vala_data_type_set_value_owned (element_type, FALSE);
            _tmp87_ = vala_foreach_statement_get_type_reference (stmt);
            _tmp88_ = vala_ccode_base_module_transform_expression ((ValaCCodeBaseModule*) self, element_expr, element_type, _tmp87_, NULL);
            _vala_ccode_node_unref0 (element_expr);
            element_expr = _tmp88_;
            _tmp89_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
            if (_tmp89_) {
                  ValaDataType* _tmp90_ = NULL;
                  gchar* _tmp91_ = NULL;
                  gchar* _tmp92_;
                  const gchar* _tmp93_ = NULL;
                  _tmp90_ = vala_foreach_statement_get_type_reference (stmt);
                  _tmp91_ = vala_data_type_get_cname (_tmp90_);
                  _tmp92_ = _tmp91_;
                  _tmp93_ = vala_foreach_statement_get_variable_name (stmt);
                  vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, _tmp92_, _tmp93_, NULL);
                  _g_free0 (_tmp92_);
            } else {
                  ValaCCodeFunction* _tmp94_ = NULL;
                  ValaDataType* _tmp95_ = NULL;
                  gchar* _tmp96_ = NULL;
                  gchar* _tmp97_;
                  const gchar* _tmp98_ = NULL;
                  ValaCCodeVariableDeclarator* _tmp99_ = NULL;
                  ValaCCodeVariableDeclarator* _tmp100_;
                  _tmp94_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp95_ = vala_foreach_statement_get_type_reference (stmt);
                  _tmp96_ = vala_data_type_get_cname (_tmp95_);
                  _tmp97_ = _tmp96_;
                  _tmp98_ = vala_foreach_statement_get_variable_name (stmt);
                  _tmp99_ = vala_ccode_variable_declarator_new (_tmp98_, NULL, NULL);
                  _tmp100_ = _tmp99_;
                  vala_ccode_function_add_declaration (_tmp94_, _tmp97_, (ValaCCodeDeclarator*) _tmp100_, 0);
                  _vala_ccode_node_unref0 (_tmp100_);
                  _g_free0 (_tmp97_);
            }
            _tmp101_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            _tmp102_ = vala_foreach_statement_get_variable_name (stmt);
            _tmp103_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp102_);
            _tmp104_ = _tmp103_;
            vala_ccode_function_add_assignment (_tmp101_, _tmp104_, element_expr);
            _vala_ccode_node_unref0 (_tmp104_);
            _tmp105_ = vala_foreach_statement_get_type_reference (stmt);
            if (VALA_IS_ARRAY_TYPE (_tmp105_)) {
                  ValaDataType* _tmp106_ = NULL;
                  ValaArrayType* _tmp107_;
                  ValaArrayType* inner_array_type;
                  _tmp106_ = vala_foreach_statement_get_type_reference (stmt);
                  _tmp107_ = _vala_code_node_ref0 (VALA_ARRAY_TYPE (_tmp106_));
                  inner_array_type = _tmp107_;
                  {
                        gint dim;
                        dim = 1;
                        {
                              gboolean _tmp108_;
                              _tmp108_ = TRUE;
                              while (TRUE) {
                                    gint _tmp109_;
                                    gboolean _tmp110_;
                                    if (!_tmp108_) {
                                          dim++;
                                    }
                                    _tmp108_ = FALSE;
                                    _tmp109_ = vala_array_type_get_rank (inner_array_type);
                                    if (!(dim <= _tmp109_)) {
                                          break;
                                    }
                                    _tmp110_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
                                    if (_tmp110_) {
                                          const gchar* _tmp111_ = NULL;
                                          gchar* _tmp112_ = NULL;
                                          gchar* _tmp113_;
                                          ValaCCodeFunction* _tmp114_ = NULL;
                                          const gchar* _tmp115_ = NULL;
                                          gchar* _tmp116_ = NULL;
                                          gchar* _tmp117_;
                                          ValaCCodeExpression* _tmp118_ = NULL;
                                          ValaCCodeExpression* _tmp119_;
                                          ValaCCodeConstant* _tmp120_ = NULL;
                                          ValaCCodeConstant* _tmp121_;
                                          _tmp111_ = vala_foreach_statement_get_variable_name (stmt);
                                          _tmp112_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp111_, dim);
                                          _tmp113_ = _tmp112_;
                                          vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, "int", _tmp113_, NULL);
                                          _g_free0 (_tmp113_);
                                          _tmp114_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                          _tmp115_ = vala_foreach_statement_get_variable_name (stmt);
                                          _tmp116_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp115_, dim);
                                          _tmp117_ = _tmp116_;
                                          _tmp118_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp117_);
                                          _tmp119_ = _tmp118_;
                                          _tmp120_ = vala_ccode_constant_new ("-1");
                                          _tmp121_ = _tmp120_;
                                          vala_ccode_function_add_assignment (_tmp114_, _tmp119_, (ValaCCodeExpression*) _tmp121_);
                                          _vala_ccode_node_unref0 (_tmp121_);
                                          _vala_ccode_node_unref0 (_tmp119_);
                                          _g_free0 (_tmp117_);
                                    } else {
                                          ValaCCodeFunction* _tmp122_ = NULL;
                                          const gchar* _tmp123_ = NULL;
                                          gchar* _tmp124_ = NULL;
                                          gchar* _tmp125_;
                                          ValaCCodeConstant* _tmp126_ = NULL;
                                          ValaCCodeConstant* _tmp127_;
                                          ValaCCodeVariableDeclarator* _tmp128_ = NULL;
                                          ValaCCodeVariableDeclarator* _tmp129_;
                                          _tmp122_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                                          _tmp123_ = vala_foreach_statement_get_variable_name (stmt);
                                          _tmp124_ = vala_ccode_base_module_get_array_length_cname ((ValaCCodeBaseModule*) self, _tmp123_, dim);
                                          _tmp125_ = _tmp124_;
                                          _tmp126_ = vala_ccode_constant_new ("-1");
                                          _tmp127_ = _tmp126_;
                                          _tmp128_ = vala_ccode_variable_declarator_new (_tmp125_, (ValaCCodeExpression*) _tmp127_, NULL);
                                          _tmp129_ = _tmp128_;
                                          vala_ccode_function_add_declaration (_tmp122_, "int", (ValaCCodeDeclarator*) _tmp129_, 0);
                                          _vala_ccode_node_unref0 (_tmp129_);
                                          _vala_ccode_node_unref0 (_tmp127_);
                                          _g_free0 (_tmp125_);
                                    }
                              }
                        }
                  }
                  _vala_code_node_unref0 (inner_array_type);
            }
            _tmp130_ = vala_foreach_statement_get_body (stmt);
            vala_code_node_emit ((ValaCodeNode*) _tmp130_, (ValaCodeGenerator*) self);
            _tmp131_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
            vala_ccode_function_close (_tmp131_);
            _vala_code_node_unref0 (element_type);
            _vala_ccode_node_unref0 (element_expr);
            _vala_ccode_node_unref0 (ccond);
            _g_free0 (it_name);
            _vala_ccode_node_unref0 (array_len);
      } else {
            gboolean _tmp132_ = FALSE;
            ValaExpression* _tmp133_ = NULL;
            ValaDataType* _tmp134_ = NULL;
            ValaObjectType* _tmp135_ = NULL;
            ValaObjectType* _tmp136_;
            gboolean _tmp137_;
            gboolean _tmp138_;
            _tmp133_ = vala_foreach_statement_get_collection (stmt);
            _tmp134_ = vala_expression_get_value_type (_tmp133_);
            _tmp135_ = vala_object_type_new ((ValaObjectTypeSymbol*) ((ValaCCodeBaseModule*) self)->glist_type);
            _tmp136_ = _tmp135_;
            _tmp137_ = vala_data_type_compatible (_tmp134_, (ValaDataType*) _tmp136_);
            _tmp138_ = _tmp137_;
            _vala_code_node_unref0 (_tmp136_);
            if (_tmp138_) {
                  _tmp132_ = TRUE;
            } else {
                  ValaExpression* _tmp139_ = NULL;
                  ValaDataType* _tmp140_ = NULL;
                  ValaObjectType* _tmp141_ = NULL;
                  ValaObjectType* _tmp142_;
                  gboolean _tmp143_;
                  _tmp139_ = vala_foreach_statement_get_collection (stmt);
                  _tmp140_ = vala_expression_get_value_type (_tmp139_);
                  _tmp141_ = vala_object_type_new ((ValaObjectTypeSymbol*) ((ValaCCodeBaseModule*) self)->gslist_type);
                  _tmp142_ = _tmp141_;
                  _tmp143_ = vala_data_type_compatible (_tmp140_, (ValaDataType*) _tmp142_);
                  _tmp132_ = _tmp143_;
                  _vala_code_node_unref0 (_tmp142_);
            }
            if (_tmp132_) {
                  const gchar* _tmp144_ = NULL;
                  gchar* _tmp145_ = NULL;
                  gchar* it_name;
                  gboolean _tmp146_;
                  ValaCCodeExpression* _tmp154_ = NULL;
                  ValaCCodeExpression* _tmp155_;
                  ValaCCodeConstant* _tmp156_ = NULL;
                  ValaCCodeConstant* _tmp157_;
                  ValaCCodeBinaryExpression* _tmp158_ = NULL;
                  ValaCCodeBinaryExpression* _tmp159_;
                  ValaCCodeBinaryExpression* ccond;
                  ValaCCodeFunction* _tmp160_ = NULL;
                  ValaCCodeExpression* _tmp161_ = NULL;
                  ValaCCodeExpression* _tmp162_;
                  const gchar* _tmp163_ = NULL;
                  ValaCCodeExpression* _tmp164_ = NULL;
                  ValaCCodeExpression* _tmp165_;
                  ValaCCodeAssignment* _tmp166_ = NULL;
                  ValaCCodeAssignment* _tmp167_;
                  ValaCCodeExpression* _tmp168_ = NULL;
                  ValaCCodeExpression* _tmp169_;
                  ValaCCodeExpression* _tmp170_ = NULL;
                  ValaCCodeExpression* _tmp171_;
                  ValaCCodeMemberAccess* _tmp172_ = NULL;
                  ValaCCodeMemberAccess* _tmp173_;
                  ValaCCodeAssignment* _tmp174_ = NULL;
                  ValaCCodeAssignment* _tmp175_;
                  ValaCCodeExpression* _tmp176_ = NULL;
                  ValaCCodeExpression* _tmp177_;
                  ValaCCodeMemberAccess* _tmp178_ = NULL;
                  ValaCCodeExpression* _tmp179_;
                  ValaCCodeExpression* element_expr;
                  ValaList* _tmp180_ = NULL;
                  ValaList* _tmp181_;
                  gint _tmp182_;
                  gboolean _tmp183_;
                  ValaList* _tmp185_ = NULL;
                  ValaList* _tmp186_;
                  gpointer _tmp187_ = NULL;
                  ValaDataType* _tmp188_;
                  ValaDataType* _tmp189_ = NULL;
                  ValaDataType* _tmp190_;
                  ValaDataType* element_data_type;
                  ValaCCodeExpression* _tmp191_ = NULL;
                  ValaDataType* _tmp192_ = NULL;
                  ValaCCodeExpression* _tmp193_ = NULL;
                  gboolean _tmp194_;
                  ValaCCodeFunction* _tmp206_ = NULL;
                  const gchar* _tmp207_ = NULL;
                  ValaCCodeExpression* _tmp208_ = NULL;
                  ValaCCodeExpression* _tmp209_;
                  ValaBlock* _tmp210_ = NULL;
                  ValaCCodeFunction* _tmp211_ = NULL;
                  _tmp144_ = vala_foreach_statement_get_variable_name (stmt);
                  _tmp145_ = g_strdup_printf ("%s_it", _tmp144_);
                  it_name = _tmp145_;
                  _tmp146_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
                  if (_tmp146_) {
                        gchar* _tmp147_ = NULL;
                        gchar* _tmp148_;
                        _tmp147_ = vala_data_type_get_cname (collection_type);
                        _tmp148_ = _tmp147_;
                        vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, _tmp148_, it_name, NULL);
                        _g_free0 (_tmp148_);
                  } else {
                        ValaCCodeFunction* _tmp149_ = NULL;
                        gchar* _tmp150_ = NULL;
                        gchar* _tmp151_;
                        ValaCCodeVariableDeclarator* _tmp152_ = NULL;
                        ValaCCodeVariableDeclarator* _tmp153_;
                        _tmp149_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp150_ = vala_data_type_get_cname (collection_type);
                        _tmp151_ = _tmp150_;
                        _tmp152_ = vala_ccode_variable_declarator_new (it_name, NULL, NULL);
                        _tmp153_ = _tmp152_;
                        vala_ccode_function_add_declaration (_tmp149_, _tmp151_, (ValaCCodeDeclarator*) _tmp153_, 0);
                        _vala_ccode_node_unref0 (_tmp153_);
                        _g_free0 (_tmp151_);
                  }
                  _tmp154_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
                  _tmp155_ = _tmp154_;
                  _tmp156_ = vala_ccode_constant_new ("NULL");
                  _tmp157_ = _tmp156_;
                  _tmp158_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_INEQUALITY, _tmp155_, (ValaCCodeExpression*) _tmp157_);
                  _tmp159_ = _tmp158_;
                  _vala_ccode_node_unref0 (_tmp157_);
                  _vala_ccode_node_unref0 (_tmp155_);
                  ccond = _tmp159_;
                  _tmp160_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp161_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
                  _tmp162_ = _tmp161_;
                  _tmp163_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
                  _tmp164_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp163_);
                  _tmp165_ = _tmp164_;
                  _tmp166_ = vala_ccode_assignment_new (_tmp162_, _tmp165_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
                  _tmp167_ = _tmp166_;
                  _tmp168_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
                  _tmp169_ = _tmp168_;
                  _tmp170_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
                  _tmp171_ = _tmp170_;
                  _tmp172_ = vala_ccode_member_access_new_pointer (_tmp171_, "next");
                  _tmp173_ = _tmp172_;
                  _tmp174_ = vala_ccode_assignment_new (_tmp169_, (ValaCCodeExpression*) _tmp173_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
                  _tmp175_ = _tmp174_;
                  vala_ccode_function_open_for (_tmp160_, (ValaCCodeExpression*) _tmp167_, (ValaCCodeExpression*) ccond, (ValaCCodeExpression*) _tmp175_);
                  _vala_ccode_node_unref0 (_tmp175_);
                  _vala_ccode_node_unref0 (_tmp173_);
                  _vala_ccode_node_unref0 (_tmp171_);
                  _vala_ccode_node_unref0 (_tmp169_);
                  _vala_ccode_node_unref0 (_tmp167_);
                  _vala_ccode_node_unref0 (_tmp165_);
                  _vala_ccode_node_unref0 (_tmp162_);
                  _tmp176_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, it_name);
                  _tmp177_ = _tmp176_;
                  _tmp178_ = vala_ccode_member_access_new_pointer (_tmp177_, "data");
                  _tmp179_ = (ValaCCodeExpression*) _tmp178_;
                  _vala_ccode_node_unref0 (_tmp177_);
                  element_expr = _tmp179_;
                  _tmp180_ = vala_data_type_get_type_arguments (collection_type);
                  _tmp181_ = _tmp180_;
                  _tmp182_ = vala_collection_get_size ((ValaCollection*) _tmp181_);
                  _tmp183_ = _tmp182_ != 1;
                  _vala_iterable_unref0 (_tmp181_);
                  if (_tmp183_) {
                        ValaSourceReference* _tmp184_ = NULL;
                        _tmp184_ = vala_code_node_get_source_reference ((ValaCodeNode*) stmt);
                        vala_report_error (_tmp184_, "internal error: missing generic type argument");
                        vala_code_node_set_error ((ValaCodeNode*) stmt, TRUE);
                        _vala_ccode_node_unref0 (element_expr);
                        _vala_ccode_node_unref0 (ccond);
                        _g_free0 (it_name);
                        _vala_code_node_unref0 (array_type);
                        _vala_code_node_unref0 (collection_type);
                        _vala_code_node_unref0 (collection_backup);
                        return;
                  }
                  _tmp185_ = vala_data_type_get_type_arguments (collection_type);
                  _tmp186_ = _tmp185_;
                  _tmp187_ = vala_list_get (_tmp186_, 0);
                  _tmp188_ = (ValaDataType*) _tmp187_;
                  _tmp189_ = vala_data_type_copy (_tmp188_);
                  _tmp190_ = _tmp189_;
                  _vala_code_node_unref0 (_tmp188_);
                  _vala_iterable_unref0 (_tmp186_);
                  element_data_type = _tmp190_;
                  vala_data_type_set_value_owned (element_data_type, FALSE);
                  _tmp191_ = vala_ccode_base_module_convert_from_generic_pointer ((ValaCCodeBaseModule*) self, element_expr, element_data_type);
                  _vala_ccode_node_unref0 (element_expr);
                  element_expr = _tmp191_;
                  _tmp192_ = vala_foreach_statement_get_type_reference (stmt);
                  _tmp193_ = vala_ccode_base_module_transform_expression ((ValaCCodeBaseModule*) self, element_expr, element_data_type, _tmp192_, NULL);
                  _vala_ccode_node_unref0 (element_expr);
                  element_expr = _tmp193_;
                  _tmp194_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
                  if (_tmp194_) {
                        ValaDataType* _tmp195_ = NULL;
                        gchar* _tmp196_ = NULL;
                        gchar* _tmp197_;
                        const gchar* _tmp198_ = NULL;
                        _tmp195_ = vala_foreach_statement_get_type_reference (stmt);
                        _tmp196_ = vala_data_type_get_cname (_tmp195_);
                        _tmp197_ = _tmp196_;
                        _tmp198_ = vala_foreach_statement_get_variable_name (stmt);
                        vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, _tmp197_, _tmp198_, NULL);
                        _g_free0 (_tmp197_);
                  } else {
                        ValaCCodeFunction* _tmp199_ = NULL;
                        ValaDataType* _tmp200_ = NULL;
                        gchar* _tmp201_ = NULL;
                        gchar* _tmp202_;
                        const gchar* _tmp203_ = NULL;
                        ValaCCodeVariableDeclarator* _tmp204_ = NULL;
                        ValaCCodeVariableDeclarator* _tmp205_;
                        _tmp199_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp200_ = vala_foreach_statement_get_type_reference (stmt);
                        _tmp201_ = vala_data_type_get_cname (_tmp200_);
                        _tmp202_ = _tmp201_;
                        _tmp203_ = vala_foreach_statement_get_variable_name (stmt);
                        _tmp204_ = vala_ccode_variable_declarator_new (_tmp203_, NULL, NULL);
                        _tmp205_ = _tmp204_;
                        vala_ccode_function_add_declaration (_tmp199_, _tmp202_, (ValaCCodeDeclarator*) _tmp205_, 0);
                        _vala_ccode_node_unref0 (_tmp205_);
                        _g_free0 (_tmp202_);
                  }
                  _tmp206_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  _tmp207_ = vala_foreach_statement_get_variable_name (stmt);
                  _tmp208_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp207_);
                  _tmp209_ = _tmp208_;
                  vala_ccode_function_add_assignment (_tmp206_, _tmp209_, element_expr);
                  _vala_ccode_node_unref0 (_tmp209_);
                  _tmp210_ = vala_foreach_statement_get_body (stmt);
                  vala_code_node_emit ((ValaCodeNode*) _tmp210_, (ValaCodeGenerator*) self);
                  _tmp211_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                  vala_ccode_function_close (_tmp211_);
                  _vala_code_node_unref0 (element_data_type);
                  _vala_ccode_node_unref0 (element_expr);
                  _vala_ccode_node_unref0 (ccond);
                  _g_free0 (it_name);
            } else {
                  ValaExpression* _tmp212_ = NULL;
                  ValaDataType* _tmp213_ = NULL;
                  ValaObjectType* _tmp214_ = NULL;
                  ValaObjectType* _tmp215_;
                  gboolean _tmp216_;
                  gboolean _tmp217_;
                  _tmp212_ = vala_foreach_statement_get_collection (stmt);
                  _tmp213_ = vala_expression_get_value_type (_tmp212_);
                  _tmp214_ = vala_object_type_new ((ValaObjectTypeSymbol*) ((ValaCCodeBaseModule*) self)->gvaluearray_type);
                  _tmp215_ = _tmp214_;
                  _tmp216_ = vala_data_type_compatible (_tmp213_, (ValaDataType*) _tmp215_);
                  _tmp217_ = _tmp216_;
                  _vala_code_node_unref0 (_tmp215_);
                  if (_tmp217_) {
                        const gchar* _tmp218_ = NULL;
                        gchar* _tmp219_ = NULL;
                        gchar* arr_index;
                        gboolean _tmp220_;
                        ValaCCodeExpression* _tmp228_ = NULL;
                        ValaCCodeExpression* _tmp229_;
                        const gchar* _tmp230_ = NULL;
                        ValaCCodeExpression* _tmp231_ = NULL;
                        ValaCCodeExpression* _tmp232_;
                        ValaCCodeMemberAccess* _tmp233_ = NULL;
                        ValaCCodeMemberAccess* _tmp234_;
                        ValaCCodeBinaryExpression* _tmp235_ = NULL;
                        ValaCCodeBinaryExpression* _tmp236_;
                        ValaCCodeBinaryExpression* ccond;
                        ValaCCodeFunction* _tmp237_ = NULL;
                        ValaCCodeExpression* _tmp238_ = NULL;
                        ValaCCodeExpression* _tmp239_;
                        ValaCCodeConstant* _tmp240_ = NULL;
                        ValaCCodeConstant* _tmp241_;
                        ValaCCodeAssignment* _tmp242_ = NULL;
                        ValaCCodeAssignment* _tmp243_;
                        ValaCCodeExpression* _tmp244_ = NULL;
                        ValaCCodeExpression* _tmp245_;
                        ValaCCodeExpression* _tmp246_ = NULL;
                        ValaCCodeExpression* _tmp247_;
                        ValaCCodeConstant* _tmp248_ = NULL;
                        ValaCCodeConstant* _tmp249_;
                        ValaCCodeBinaryExpression* _tmp250_ = NULL;
                        ValaCCodeBinaryExpression* _tmp251_;
                        ValaCCodeAssignment* _tmp252_ = NULL;
                        ValaCCodeAssignment* _tmp253_;
                        ValaCCodeIdentifier* _tmp254_ = NULL;
                        ValaCCodeIdentifier* _tmp255_;
                        ValaCCodeFunctionCall* _tmp256_ = NULL;
                        ValaCCodeFunctionCall* _tmp257_;
                        ValaCCodeFunctionCall* get_item;
                        const gchar* _tmp258_ = NULL;
                        ValaCCodeExpression* _tmp259_ = NULL;
                        ValaCCodeExpression* _tmp260_;
                        ValaCCodeExpression* _tmp261_ = NULL;
                        ValaCCodeExpression* _tmp262_;
                        ValaCCodeUnaryExpression* _tmp263_ = NULL;
                        ValaCCodeExpression* element_expr;
                        ValaDataType* _tmp264_ = NULL;
                        gboolean _tmp265_;
                        gboolean _tmp270_;
                        ValaCCodeFunction* _tmp282_ = NULL;
                        const gchar* _tmp283_ = NULL;
                        ValaCCodeExpression* _tmp284_ = NULL;
                        ValaCCodeExpression* _tmp285_;
                        ValaBlock* _tmp286_ = NULL;
                        ValaCCodeFunction* _tmp287_ = NULL;
                        _tmp218_ = vala_foreach_statement_get_variable_name (stmt);
                        _tmp219_ = g_strdup_printf ("%s_index", _tmp218_);
                        arr_index = _tmp219_;
                        _tmp220_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
                        if (_tmp220_) {
                              gchar* _tmp221_ = NULL;
                              gchar* _tmp222_;
                              _tmp221_ = vala_data_type_get_cname (((ValaCCodeBaseModule*) self)->uint_type);
                              _tmp222_ = _tmp221_;
                              vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, _tmp222_, arr_index, NULL);
                              _g_free0 (_tmp222_);
                        } else {
                              ValaCCodeFunction* _tmp223_ = NULL;
                              gchar* _tmp224_ = NULL;
                              gchar* _tmp225_;
                              ValaCCodeVariableDeclarator* _tmp226_ = NULL;
                              ValaCCodeVariableDeclarator* _tmp227_;
                              _tmp223_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                              _tmp224_ = vala_data_type_get_cname (((ValaCCodeBaseModule*) self)->uint_type);
                              _tmp225_ = _tmp224_;
                              _tmp226_ = vala_ccode_variable_declarator_new (arr_index, NULL, NULL);
                              _tmp227_ = _tmp226_;
                              vala_ccode_function_add_declaration (_tmp223_, _tmp225_, (ValaCCodeDeclarator*) _tmp227_, 0);
                              _vala_ccode_node_unref0 (_tmp227_);
                              _g_free0 (_tmp225_);
                        }
                        _tmp228_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, arr_index);
                        _tmp229_ = _tmp228_;
                        _tmp230_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
                        _tmp231_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp230_);
                        _tmp232_ = _tmp231_;
                        _tmp233_ = vala_ccode_member_access_new_pointer (_tmp232_, "n_values");
                        _tmp234_ = _tmp233_;
                        _tmp235_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_LESS_THAN, _tmp229_, (ValaCCodeExpression*) _tmp234_);
                        _tmp236_ = _tmp235_;
                        _vala_ccode_node_unref0 (_tmp234_);
                        _vala_ccode_node_unref0 (_tmp232_);
                        _vala_ccode_node_unref0 (_tmp229_);
                        ccond = _tmp236_;
                        _tmp237_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp238_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, arr_index);
                        _tmp239_ = _tmp238_;
                        _tmp240_ = vala_ccode_constant_new ("0");
                        _tmp241_ = _tmp240_;
                        _tmp242_ = vala_ccode_assignment_new (_tmp239_, (ValaCCodeExpression*) _tmp241_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
                        _tmp243_ = _tmp242_;
                        _tmp244_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, arr_index);
                        _tmp245_ = _tmp244_;
                        _tmp246_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, arr_index);
                        _tmp247_ = _tmp246_;
                        _tmp248_ = vala_ccode_constant_new ("1");
                        _tmp249_ = _tmp248_;
                        _tmp250_ = vala_ccode_binary_expression_new (VALA_CCODE_BINARY_OPERATOR_PLUS, _tmp247_, (ValaCCodeExpression*) _tmp249_);
                        _tmp251_ = _tmp250_;
                        _tmp252_ = vala_ccode_assignment_new (_tmp245_, (ValaCCodeExpression*) _tmp251_, VALA_CCODE_ASSIGNMENT_OPERATOR_SIMPLE);
                        _tmp253_ = _tmp252_;
                        vala_ccode_function_open_for (_tmp237_, (ValaCCodeExpression*) _tmp243_, (ValaCCodeExpression*) ccond, (ValaCCodeExpression*) _tmp253_);
                        _vala_ccode_node_unref0 (_tmp253_);
                        _vala_ccode_node_unref0 (_tmp251_);
                        _vala_ccode_node_unref0 (_tmp249_);
                        _vala_ccode_node_unref0 (_tmp247_);
                        _vala_ccode_node_unref0 (_tmp245_);
                        _vala_ccode_node_unref0 (_tmp243_);
                        _vala_ccode_node_unref0 (_tmp241_);
                        _vala_ccode_node_unref0 (_tmp239_);
                        _tmp254_ = vala_ccode_identifier_new ("g_value_array_get_nth");
                        _tmp255_ = _tmp254_;
                        _tmp256_ = vala_ccode_function_call_new ((ValaCCodeExpression*) _tmp255_);
                        _tmp257_ = _tmp256_;
                        _vala_ccode_node_unref0 (_tmp255_);
                        get_item = _tmp257_;
                        _tmp258_ = vala_symbol_get_name ((ValaSymbol*) collection_backup);
                        _tmp259_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp258_);
                        _tmp260_ = _tmp259_;
                        vala_ccode_function_call_add_argument (get_item, _tmp260_);
                        _vala_ccode_node_unref0 (_tmp260_);
                        _tmp261_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, arr_index);
                        _tmp262_ = _tmp261_;
                        vala_ccode_function_call_add_argument (get_item, _tmp262_);
                        _vala_ccode_node_unref0 (_tmp262_);
                        _tmp263_ = vala_ccode_unary_expression_new (VALA_CCODE_UNARY_OPERATOR_POINTER_INDIRECTION, (ValaCCodeExpression*) get_item);
                        element_expr = (ValaCCodeExpression*) _tmp263_;
                        _tmp264_ = vala_foreach_statement_get_type_reference (stmt);
                        _tmp265_ = vala_data_type_get_value_owned (_tmp264_);
                        if (_tmp265_) {
                              ValaDataType* _tmp266_ = NULL;
                              ValaStructValueType* _tmp267_ = NULL;
                              ValaStructValueType* _tmp268_;
                              ValaCCodeExpression* _tmp269_ = NULL;
                              _tmp266_ = vala_foreach_statement_get_type_reference (stmt);
                              _tmp267_ = vala_struct_value_type_new (((ValaCCodeBaseModule*) self)->gvalue_type);
                              _tmp268_ = _tmp267_;
                              _tmp269_ = vala_ccode_base_module_get_ref_cexpression ((ValaCCodeBaseModule*) self, _tmp266_, element_expr, NULL, (ValaCodeNode*) _tmp268_);
                              _vala_ccode_node_unref0 (element_expr);
                              element_expr = _tmp269_;
                              _vala_code_node_unref0 (_tmp268_);
                        }
                        _tmp270_ = vala_ccode_base_module_is_in_coroutine ((ValaCCodeBaseModule*) self);
                        if (_tmp270_) {
                              ValaDataType* _tmp271_ = NULL;
                              gchar* _tmp272_ = NULL;
                              gchar* _tmp273_;
                              const gchar* _tmp274_ = NULL;
                              _tmp271_ = vala_foreach_statement_get_type_reference (stmt);
                              _tmp272_ = vala_data_type_get_cname (_tmp271_);
                              _tmp273_ = _tmp272_;
                              _tmp274_ = vala_foreach_statement_get_variable_name (stmt);
                              vala_ccode_struct_add_field (((ValaCCodeBaseModule*) self)->closure_struct, _tmp273_, _tmp274_, NULL);
                              _g_free0 (_tmp273_);
                        } else {
                              ValaCCodeFunction* _tmp275_ = NULL;
                              ValaDataType* _tmp276_ = NULL;
                              gchar* _tmp277_ = NULL;
                              gchar* _tmp278_;
                              const gchar* _tmp279_ = NULL;
                              ValaCCodeVariableDeclarator* _tmp280_ = NULL;
                              ValaCCodeVariableDeclarator* _tmp281_;
                              _tmp275_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                              _tmp276_ = vala_foreach_statement_get_type_reference (stmt);
                              _tmp277_ = vala_data_type_get_cname (_tmp276_);
                              _tmp278_ = _tmp277_;
                              _tmp279_ = vala_foreach_statement_get_variable_name (stmt);
                              _tmp280_ = vala_ccode_variable_declarator_new (_tmp279_, NULL, NULL);
                              _tmp281_ = _tmp280_;
                              vala_ccode_function_add_declaration (_tmp275_, _tmp278_, (ValaCCodeDeclarator*) _tmp281_, 0);
                              _vala_ccode_node_unref0 (_tmp281_);
                              _g_free0 (_tmp278_);
                        }
                        _tmp282_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp283_ = vala_foreach_statement_get_variable_name (stmt);
                        _tmp284_ = vala_ccode_base_module_get_variable_cexpression ((ValaCCodeBaseModule*) self, _tmp283_);
                        _tmp285_ = _tmp284_;
                        vala_ccode_function_add_assignment (_tmp282_, _tmp285_, element_expr);
                        _vala_ccode_node_unref0 (_tmp285_);
                        _tmp286_ = vala_foreach_statement_get_body (stmt);
                        vala_code_node_emit ((ValaCodeNode*) _tmp286_, (ValaCodeGenerator*) self);
                        _tmp287_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        vala_ccode_function_close (_tmp287_);
                        _vala_ccode_node_unref0 (element_expr);
                        _vala_ccode_node_unref0 (get_item);
                        _vala_ccode_node_unref0 (ccond);
                        _g_free0 (arr_index);
                  }
            }
      }
      {
            ValaList* _tmp288_ = NULL;
            ValaList* _local_list;
            gint _tmp289_;
            gint _local_size;
            gint _local_index;
            _tmp288_ = vala_block_get_local_variables ((ValaBlock*) stmt);
            _local_list = _tmp288_;
            _tmp289_ = vala_collection_get_size ((ValaCollection*) _local_list);
            _local_size = _tmp289_;
            _local_index = -1;
            while (TRUE) {
                  gpointer _tmp290_ = NULL;
                  ValaLocalVariable* local;
                  ValaDataType* _tmp291_ = NULL;
                  gboolean _tmp292_;
                  _local_index = _local_index + 1;
                  if (!(_local_index < _local_size)) {
                        break;
                  }
                  _tmp290_ = vala_list_get (_local_list, _local_index);
                  local = (ValaLocalVariable*) _tmp290_;
                  _tmp291_ = vala_variable_get_variable_type ((ValaVariable*) local);
                  _tmp292_ = vala_ccode_base_module_requires_destroy ((ValaCCodeBaseModule*) self, _tmp291_);
                  if (_tmp292_) {
                        ValaCCodeFunction* _tmp293_ = NULL;
                        ValaCCodeExpression* _tmp294_ = NULL;
                        ValaCCodeExpression* _tmp295_;
                        _tmp293_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
                        _tmp294_ = vala_ccode_base_module_destroy_local ((ValaCCodeBaseModule*) self, local);
                        _tmp295_ = _tmp294_;
                        vala_ccode_function_add_expression (_tmp293_, _tmp295_);
                        _vala_ccode_node_unref0 (_tmp295_);
                  }
                  _vala_code_node_unref0 (local);
            }
            _vala_iterable_unref0 (_local_list);
      }
      _tmp296_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_close (_tmp296_);
      _vala_code_node_unref0 (array_type);
      _vala_code_node_unref0 (collection_type);
      _vala_code_node_unref0 (collection_backup);
}


static void vala_ccode_control_flow_module_real_visit_break_statement (ValaCodeVisitor* base, ValaBreakStatement* stmt) {
      ValaCCodeControlFlowModule * self;
      ValaSymbol* _tmp0_ = NULL;
      ValaCCodeFunction* _tmp1_ = NULL;
      self = (ValaCCodeControlFlowModule*) base;
      g_return_if_fail (stmt != NULL);
      _tmp0_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
      vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp0_, TRUE, NULL);
      _tmp1_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_add_break (_tmp1_);
}


static void vala_ccode_control_flow_module_real_visit_continue_statement (ValaCodeVisitor* base, ValaContinueStatement* stmt) {
      ValaCCodeControlFlowModule * self;
      ValaSymbol* _tmp0_ = NULL;
      ValaCCodeFunction* _tmp1_ = NULL;
      self = (ValaCCodeControlFlowModule*) base;
      g_return_if_fail (stmt != NULL);
      _tmp0_ = vala_ccode_base_module_get_current_symbol ((ValaCCodeBaseModule*) self);
      vala_ccode_base_module_append_local_free ((ValaCCodeBaseModule*) self, _tmp0_, TRUE, NULL);
      _tmp1_ = vala_ccode_base_module_get_ccode ((ValaCCodeBaseModule*) self);
      vala_ccode_function_add_continue (_tmp1_);
}


ValaCCodeControlFlowModule* vala_ccode_control_flow_module_construct (GType object_type) {
      ValaCCodeControlFlowModule* self = NULL;
      self = (ValaCCodeControlFlowModule*) vala_ccode_method_module_construct (object_type);
      return self;
}


static void vala_ccode_control_flow_module_class_init (ValaCCodeControlFlowModuleClass * klass) {
      vala_ccode_control_flow_module_parent_class = g_type_class_peek_parent (klass);
      VALA_CODE_VISITOR_CLASS (klass)->visit_if_statement = vala_ccode_control_flow_module_real_visit_if_statement;
      VALA_CODE_VISITOR_CLASS (klass)->visit_switch_statement = vala_ccode_control_flow_module_real_visit_switch_statement;
      VALA_CODE_VISITOR_CLASS (klass)->visit_switch_label = vala_ccode_control_flow_module_real_visit_switch_label;
      VALA_CODE_VISITOR_CLASS (klass)->visit_loop = vala_ccode_control_flow_module_real_visit_loop;
      VALA_CODE_VISITOR_CLASS (klass)->visit_foreach_statement = vala_ccode_control_flow_module_real_visit_foreach_statement;
      VALA_CODE_VISITOR_CLASS (klass)->visit_break_statement = vala_ccode_control_flow_module_real_visit_break_statement;
      VALA_CODE_VISITOR_CLASS (klass)->visit_continue_statement = vala_ccode_control_flow_module_real_visit_continue_statement;
}


static void vala_ccode_control_flow_module_instance_init (ValaCCodeControlFlowModule * self) {
}


GType vala_ccode_control_flow_module_get_type (void) {
      static volatile gsize vala_ccode_control_flow_module_type_id__volatile = 0;
      if (g_once_init_enter (&vala_ccode_control_flow_module_type_id__volatile)) {
            static const GTypeInfo g_define_type_info = { sizeof (ValaCCodeControlFlowModuleClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) vala_ccode_control_flow_module_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ValaCCodeControlFlowModule), 0, (GInstanceInitFunc) vala_ccode_control_flow_module_instance_init, NULL };
            GType vala_ccode_control_flow_module_type_id;
            vala_ccode_control_flow_module_type_id = g_type_register_static (VALA_TYPE_CCODE_METHOD_MODULE, "ValaCCodeControlFlowModule", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
            g_once_init_leave (&vala_ccode_control_flow_module_type_id__volatile, vala_ccode_control_flow_module_type_id);
      }
      return vala_ccode_control_flow_module_type_id__volatile;
}




Generated by  Doxygen 1.6.0   Back to index