img_writer_emit_start (struct MonoImageWriter * acfg)
{
  int D.23024;

  D.23024 = acfg->use_bin_writer;
  if (D.23024 != 0) goto <D.23025>; else goto <D.23026>;
  <D.23025>:
  bin_writer_emit_start (acfg);
  goto <D.23027>;
  <D.23026>:
  asm_writer_emit_start (acfg);
  <D.23027>:
}


bin_writer_emit_start (struct MonoImageWriter * acfg)
{
  struct GHashTable * D.23028;

  D.23028 = monoeg_g_hash_table_new (monoeg_g_str_hash, monoeg_g_str_equal);
  acfg->labels = D.23028;
}


asm_writer_emit_start (struct MonoImageWriter * acfg)
{

}


img_writer_emit_section_change (struct MonoImageWriter * acfg, const char * section_name, int subsection_index)
{
  int D.23029;

  D.23029 = acfg->use_bin_writer;
  if (D.23029 != 0) goto <D.23030>; else goto <D.23031>;
  <D.23030>:
  bin_writer_emit_section_change (acfg, section_name, subsection_index);
  goto <D.23032>;
  <D.23031>:
  asm_writer_emit_section_change (acfg, section_name, subsection_index);
  <D.23032>:
  acfg->current_section = section_name;
  acfg->current_subsection = subsection_index;
}


bin_writer_emit_section_change (struct MonoImageWriter * acfg, const char * section_name, int subsection_index)
{
  struct BinSection * D.23033;
  int D.23036;
  int D.22321;
  char * D.23039;
  int D.23042;
  int D.22330;
  char * D.23045;
  gchar * D.23050;
  struct BinSection * D.23051;
  struct BinSection * section;

  D.23033 = acfg->cur_section;
  if (D.23033 != 0B) goto <D.23034>; else goto <D.23035>;
  <D.23034>:
  D.23033 = acfg->cur_section;
  D.23036 = D.23033->subsection;
  if (D.23036 == subsection_index) goto <D.23037>; else goto <D.23038>;
  <D.23037>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.23033 = acfg->cur_section;
    D.23039 = D.23033->name;
    D.22321 = __builtin_strcmp (D.23039, section_name);
  }
  if (D.22321 == 0) goto <D.23040>; else goto <D.23041>;
  <D.23040>:
  return;
  <D.23041>:
  <D.23038>:
  <D.23035>:
  section = acfg->sections;
  goto <D.22332>;
  <D.22331>:
  D.23042 = section->subsection;
  if (D.23042 == subsection_index) goto <D.23043>; else goto <D.23044>;
  <D.23043>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.23045 = section->name;
    D.22330 = __builtin_strcmp (D.23045, section_name);
  }
  if (D.22330 == 0) goto <D.23046>; else goto <D.23047>;
  <D.23046>:
  acfg->cur_section = section;
  return;
  <D.23047>:
  <D.23044>:
  section = section->next;
  <D.22332>:
  if (section != 0B) goto <D.22331>; else goto <D.22333>;
  <D.22333>:
  if (section == 0B) goto <D.23048>; else goto <D.23049>;
  <D.23048>:
  section = monoeg_malloc0 (56);
  D.23050 = monoeg_strdup (section_name);
  section->name = D.23050;
  section->subsection = subsection_index;
  D.23051 = acfg->sections;
  section->next = D.23051;
  acfg->sections = section;
  acfg->cur_section = section;
  <D.23049>:
}


monoeg_strdup (const gchar * str)
{
  gchar * D.23055;

  if (str != 0B) goto <D.23053>; else goto <D.23054>;
  <D.23053>:
  D.23055 = __strdup (str);
  return D.23055;
  <D.23054>:
  D.23055 = 0B;
  return D.23055;
}


asm_writer_emit_section_change (struct MonoImageWriter * acfg, const char * section_name, int subsection_index)
{
  int D.22792;
  int iftmp.0;
  int D.22791;
  const char[6] * D.23063;
  unsigned char D.23064;
  int D.23065;
  unsigned char D.23066;
  int D.23067;
  const unsigned char * D.23072;
  unsigned char D.23073;
  int D.23074;
  const unsigned char * D.23075;
  unsigned char D.23076;
  int D.23077;
  const unsigned char * D.23082;
  unsigned char D.23083;
  int D.23084;
  const unsigned char * D.23085;
  unsigned char D.23086;
  int D.23087;
  const unsigned char * D.23092;
  unsigned char D.23093;
  int D.23094;
  const unsigned char * D.23095;
  unsigned char D.23096;
  int D.23097;
  int D.22801;
  int iftmp.1;
  int D.22800;
  const char[6] * D.23103;
  unsigned char D.23104;
  int D.23105;
  unsigned char D.23106;
  int D.23107;
  const unsigned char * D.23112;
  unsigned char D.23113;
  int D.23114;
  const unsigned char * D.23115;
  unsigned char D.23116;
  int D.23117;
  const unsigned char * D.23122;
  unsigned char D.23123;
  int D.23124;
  const unsigned char * D.23125;
  unsigned char D.23126;
  int D.23127;
  const unsigned char * D.23132;
  unsigned char D.23133;
  int D.23134;
  const unsigned char * D.23135;
  unsigned char D.23136;
  int D.23137;
  int D.22810;
  int iftmp.2;
  int D.22809;
  const char[5] * D.23143;
  unsigned char D.23144;
  int D.23145;
  unsigned char D.23146;
  int D.23147;
  const unsigned char * D.23152;
  unsigned char D.23153;
  int D.23154;
  const unsigned char * D.23155;
  unsigned char D.23156;
  int D.23157;
  const unsigned char * D.23162;
  unsigned char D.23163;
  int D.23164;
  const unsigned char * D.23165;
  unsigned char D.23166;
  int D.23167;
  const unsigned char * D.23172;
  unsigned char D.23173;
  int D.23174;
  const unsigned char * D.23175;
  unsigned char D.23176;
  int D.23177;
  struct FILE * D.23179;

  asm_writer_emit_unset_mode (acfg);
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.23061>; else goto <D.23062>;
    <D.23061>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = section_name;
      D.23063 = ".text";
      D.23064 = MEM[(const unsigned char *)D.23063];
      D.23065 = (int) D.23064;
      D.23066 = *__s2;
      D.23067 = (int) D.23066;
      __result = D.23065 - D.23067;
      {
        if (__s2_len != 0) goto <D.23068>; else goto <D.23069>;
        <D.23068>:
        if (__result == 0) goto <D.23070>; else goto <D.23071>;
        <D.23070>:
        D.23072 = &MEM[(void *)".text" + 1B];
        D.23073 = *D.23072;
        D.23074 = (int) D.23073;
        D.23075 = __s2 + 1;
        D.23076 = *D.23075;
        D.23077 = (int) D.23076;
        __result = D.23074 - D.23077;
        if (__s2_len > 1) goto <D.23078>; else goto <D.23079>;
        <D.23078>:
        if (__result == 0) goto <D.23080>; else goto <D.23081>;
        <D.23080>:
        D.23082 = &MEM[(void *)".text" + 2B];
        D.23083 = *D.23082;
        D.23084 = (int) D.23083;
        D.23085 = __s2 + 2;
        D.23086 = *D.23085;
        D.23087 = (int) D.23086;
        __result = D.23084 - D.23087;
        if (__s2_len > 2) goto <D.23088>; else goto <D.23089>;
        <D.23088>:
        if (__result == 0) goto <D.23090>; else goto <D.23091>;
        <D.23090>:
        D.23092 = &MEM[(void *)".text" + 3B];
        D.23093 = *D.23092;
        D.23094 = (int) D.23093;
        D.23095 = __s2 + 3;
        D.23096 = *D.23095;
        D.23097 = (int) D.23096;
        __result = D.23094 - D.23097;
        <D.23091>:
        <D.23089>:
        <D.23081>:
        <D.23079>:
        <D.23071>:
        <D.23069>:
      }
      D.22791 = __result;
    }
    iftmp.0 = -D.22791;
    goto <D.23098>;
    <D.23062>:
    iftmp.0 = __builtin_strcmp (section_name, ".text");
    <D.23098>:
    D.22792 = iftmp.0;
  }
  if (D.22792 == 0) goto <D.23057>; else goto <D.23099>;
  <D.23099>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.23101>; else goto <D.23102>;
    <D.23101>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = section_name;
      D.23103 = ".data";
      D.23104 = MEM[(const unsigned char *)D.23103];
      D.23105 = (int) D.23104;
      D.23106 = *__s2;
      D.23107 = (int) D.23106;
      __result = D.23105 - D.23107;
      {
        if (__s2_len != 0) goto <D.23108>; else goto <D.23109>;
        <D.23108>:
        if (__result == 0) goto <D.23110>; else goto <D.23111>;
        <D.23110>:
        D.23112 = &MEM[(void *)".data" + 1B];
        D.23113 = *D.23112;
        D.23114 = (int) D.23113;
        D.23115 = __s2 + 1;
        D.23116 = *D.23115;
        D.23117 = (int) D.23116;
        __result = D.23114 - D.23117;
        if (__s2_len > 1) goto <D.23118>; else goto <D.23119>;
        <D.23118>:
        if (__result == 0) goto <D.23120>; else goto <D.23121>;
        <D.23120>:
        D.23122 = &MEM[(void *)".data" + 2B];
        D.23123 = *D.23122;
        D.23124 = (int) D.23123;
        D.23125 = __s2 + 2;
        D.23126 = *D.23125;
        D.23127 = (int) D.23126;
        __result = D.23124 - D.23127;
        if (__s2_len > 2) goto <D.23128>; else goto <D.23129>;
        <D.23128>:
        if (__result == 0) goto <D.23130>; else goto <D.23131>;
        <D.23130>:
        D.23132 = &MEM[(void *)".data" + 3B];
        D.23133 = *D.23132;
        D.23134 = (int) D.23133;
        D.23135 = __s2 + 3;
        D.23136 = *D.23135;
        D.23137 = (int) D.23136;
        __result = D.23134 - D.23137;
        <D.23131>:
        <D.23129>:
        <D.23121>:
        <D.23119>:
        <D.23111>:
        <D.23109>:
      }
      D.22800 = __result;
    }
    iftmp.1 = -D.22800;
    goto <D.23138>;
    <D.23102>:
    iftmp.1 = __builtin_strcmp (section_name, ".data");
    <D.23138>:
    D.22801 = iftmp.1;
  }
  if (D.22801 == 0) goto <D.23057>; else goto <D.23139>;
  <D.23139>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 4;
    if (__s2_len <= 3) goto <D.23141>; else goto <D.23142>;
    <D.23141>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = section_name;
      D.23143 = ".bss";
      D.23144 = MEM[(const unsigned char *)D.23143];
      D.23145 = (int) D.23144;
      D.23146 = *__s2;
      D.23147 = (int) D.23146;
      __result = D.23145 - D.23147;
      {
        if (__s2_len != 0) goto <D.23148>; else goto <D.23149>;
        <D.23148>:
        if (__result == 0) goto <D.23150>; else goto <D.23151>;
        <D.23150>:
        D.23152 = &MEM[(void *)".bss" + 1B];
        D.23153 = *D.23152;
        D.23154 = (int) D.23153;
        D.23155 = __s2 + 1;
        D.23156 = *D.23155;
        D.23157 = (int) D.23156;
        __result = D.23154 - D.23157;
        if (__s2_len > 1) goto <D.23158>; else goto <D.23159>;
        <D.23158>:
        if (__result == 0) goto <D.23160>; else goto <D.23161>;
        <D.23160>:
        D.23162 = &MEM[(void *)".bss" + 2B];
        D.23163 = *D.23162;
        D.23164 = (int) D.23163;
        D.23165 = __s2 + 2;
        D.23166 = *D.23165;
        D.23167 = (int) D.23166;
        __result = D.23164 - D.23167;
        if (__s2_len > 2) goto <D.23168>; else goto <D.23169>;
        <D.23168>:
        if (__result == 0) goto <D.23170>; else goto <D.23171>;
        <D.23170>:
        D.23172 = &MEM[(void *)".bss" + 3B];
        D.23173 = *D.23172;
        D.23174 = (int) D.23173;
        D.23175 = __s2 + 3;
        D.23176 = *D.23175;
        D.23177 = (int) D.23176;
        __result = D.23174 - D.23177;
        <D.23171>:
        <D.23169>:
        <D.23161>:
        <D.23159>:
        <D.23151>:
        <D.23149>:
      }
      D.22809 = __result;
    }
    iftmp.2 = -D.22809;
    goto <D.23178>;
    <D.23142>:
    iftmp.2 = __builtin_strcmp (section_name, ".bss");
    <D.23178>:
    D.22810 = iftmp.2;
  }
  if (D.22810 == 0) goto <D.23057>; else goto <D.23058>;
  <D.23057>:
  D.23179 = acfg->fp;
  fprintf (D.23179, "%s %d\n", section_name, subsection_index);
  goto <D.23059>;
  <D.23058>:
  D.23179 = acfg->fp;
  fprintf (D.23179, ".section \"%s\"\n", section_name);
  D.23179 = acfg->fp;
  fprintf (D.23179, ".subsection %d\n", subsection_index);
  <D.23059>:
}


asm_writer_emit_unset_mode (struct MonoImageWriter * acfg)
{
  int D.23180;
  struct FILE * D.23183;

  D.23180 = acfg->mode;
  if (D.23180 == 0) goto <D.23181>; else goto <D.23182>;
  <D.23181>:
  return;
  <D.23182>:
  D.23183 = acfg->fp;
  fprintf (D.23183, "\n");
  acfg->mode = 0;
}


fprintf (struct FILE * restrict __stream, const char * restrict __fmt)
{
  int D.23185;

  D.23185 = __fprintf_chk (__stream, 1, __fmt, __builtin_va_arg_pack ());
  return D.23185;
}


img_writer_emit_push_section (struct MonoImageWriter * acfg, const char * section_name, int subsection)
{
  int D.23187;
  _Bool D.23188;
  long int D.23189;
  long int D.23190;
  const char * D.23193;
  int D.23194;
  int D.23195;

  D.23187 = acfg->stack_pos;
  D.23188 = D.23187 > 14;
  D.23189 = (long int) D.23188;
  D.23190 = __builtin_expect (D.23189, 0);
  if (D.23190 != 0) goto <D.23191>; else goto <D.23192>;
  <D.23191>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2018, "acfg->stack_pos < 16 - 1");
  <D.23192>:
  D.23187 = acfg->stack_pos;
  D.23193 = acfg->current_section;
  acfg->section_stack[D.23187] = D.23193;
  D.23187 = acfg->stack_pos;
  D.23194 = acfg->current_subsection;
  acfg->subsection_stack[D.23187] = D.23194;
  D.23187 = acfg->stack_pos;
  D.23195 = D.23187 + 1;
  acfg->stack_pos = D.23195;
  img_writer_emit_section_change (acfg, section_name, subsection);
}


img_writer_emit_pop_section (struct MonoImageWriter * acfg)
{
  int D.23196;
  _Bool D.23197;
  long int D.23198;
  long int D.23199;
  int D.23202;
  const char * D.23203;
  int D.23204;

  D.23196 = acfg->stack_pos;
  D.23197 = D.23196 <= 0;
  D.23198 = (long int) D.23197;
  D.23199 = __builtin_expect (D.23198, 0);
  if (D.23199 != 0) goto <D.23200>; else goto <D.23201>;
  <D.23200>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2029, "acfg->stack_pos > 0");
  <D.23201>:
  D.23196 = acfg->stack_pos;
  D.23202 = D.23196 + -1;
  acfg->stack_pos = D.23202;
  D.23196 = acfg->stack_pos;
  D.23203 = acfg->section_stack[D.23196];
  D.23196 = acfg->stack_pos;
  D.23204 = acfg->subsection_stack[D.23196];
  img_writer_emit_section_change (acfg, D.23203, D.23204);
}


img_writer_set_section_addr (struct MonoImageWriter * acfg, guint64 addr)
{
  int D.23205;

  D.23205 = acfg->use_bin_writer;
  if (D.23205 == 0) goto <D.23206>; else goto <D.23207>;
  <D.23206>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "image-writer.c", 2039);
  <D.23207>:
  bin_writer_set_section_addr (acfg, addr);
}


bin_writer_set_section_addr (struct MonoImageWriter * acfg, guint64 addr)
{
  struct BinSection * D.23208;

  D.23208 = acfg->cur_section;
  D.23208->addr = addr;
  D.23208 = acfg->cur_section;
  D.23208->has_addr = 1;
}


img_writer_emit_global (struct MonoImageWriter * acfg, const char * name, gboolean func)
{
  int D.23209;

  D.23209 = acfg->use_bin_writer;
  if (D.23209 != 0) goto <D.23210>; else goto <D.23211>;
  <D.23210>:
  bin_writer_emit_global (acfg, name, func);
  goto <D.23212>;
  <D.23211>:
  asm_writer_emit_global (acfg, name, func);
  <D.23212>:
}


bin_writer_emit_global (struct MonoImageWriter * acfg, const char * name, gboolean func)
{
  bin_writer_emit_symbol_inner (acfg, name, 0B, 1, func);
}


bin_writer_emit_symbol_inner (struct MonoImageWriter * acfg, const char * name, const char * end_label, gboolean is_global, gboolean func)
{
  gchar * D.23213;
  gchar * D.23216;
  struct BinSection * D.23217;
  struct BinSection * D.23218;
  int D.23219;
  struct BinSymbol * D.23220;
  struct BinSymbol * symbol;

  symbol = monoeg_malloc0 (28);
  D.23213 = monoeg_strdup (name);
  symbol->name = D.23213;
  if (end_label != 0B) goto <D.23214>; else goto <D.23215>;
  <D.23214>:
  D.23216 = monoeg_strdup (end_label);
  symbol->end_label = D.23216;
  <D.23215>:
  symbol->is_function = func;
  symbol->is_global = is_global;
  D.23217 = acfg->cur_section;
  symbol->section = D.23217;
  D.23218 = symbol->section;
  D.23219 = D.23218->cur_offset;
  symbol->offset = D.23219;
  D.23220 = acfg->symbols;
  symbol->next = D.23220;
  acfg->symbols = symbol;
}


asm_writer_emit_global (struct MonoImageWriter * acfg, const char * name, gboolean func)
{
  struct FILE * D.23221;

  asm_writer_emit_unset_mode (acfg);
  D.23221 = acfg->fp;
  fprintf (D.23221, "\t.globl %s\n", name);
  asm_writer_emit_symbol_type (acfg, name, func);
}


asm_writer_emit_symbol_type (struct MonoImageWriter * acfg, const char * name, gboolean func)
{
  struct FILE * D.23225;
  const char * stype;

  if (func != 0) goto <D.23222>; else goto <D.23223>;
  <D.23222>:
  stype = "function";
  goto <D.23224>;
  <D.23223>:
  stype = "object";
  <D.23224>:
  asm_writer_emit_unset_mode (acfg);
  D.23225 = acfg->fp;
  fprintf (D.23225, "\t.type %s,@%s\n", name, stype);
}


img_writer_emit_local_symbol (struct MonoImageWriter * acfg, const char * name, const char * end_label, gboolean func)
{
  int D.23226;

  D.23226 = acfg->use_bin_writer;
  if (D.23226 != 0) goto <D.23227>; else goto <D.23228>;
  <D.23227>:
  bin_writer_emit_local_symbol (acfg, name, end_label, func);
  goto <D.23229>;
  <D.23228>:
  asm_writer_emit_local_symbol (acfg, name, end_label, func);
  <D.23229>:
}


bin_writer_emit_local_symbol (struct MonoImageWriter * acfg, const char * name, const char * end_label, gboolean func)
{
  bin_writer_emit_symbol_inner (acfg, name, end_label, 0, func);
}


asm_writer_emit_local_symbol (struct MonoImageWriter * acfg, const char * name, const char * end_label, gboolean func)
{
  struct FILE * D.23230;

  asm_writer_emit_unset_mode (acfg);
  D.23230 = acfg->fp;
  fprintf (D.23230, "\t.local %s\n", name);
  asm_writer_emit_symbol_type (acfg, name, func);
}


img_writer_emit_symbol_size (struct MonoImageWriter * acfg, const char * name, const char * end_label)
{
  int D.23231;

  D.23231 = acfg->use_bin_writer;
  if (D.23231 == 0) goto <D.23232>; else goto <D.23233>;
  <D.23232>:
  asm_writer_emit_symbol_size (acfg, name, end_label);
  <D.23233>:
}


asm_writer_emit_symbol_size (struct MonoImageWriter * acfg, const char * name, const char * end_label)
{
  struct FILE * D.23234;

  asm_writer_emit_unset_mode (acfg);
  D.23234 = acfg->fp;
  fprintf (D.23234, "\t.size %s,%s-%s\n", name, end_label, name);
}


img_writer_emit_label (struct MonoImageWriter * acfg, const char * name)
{
  int D.23235;

  D.23235 = acfg->use_bin_writer;
  if (D.23235 != 0) goto <D.23236>; else goto <D.23237>;
  <D.23236>:
  bin_writer_emit_label (acfg, name);
  goto <D.23238>;
  <D.23237>:
  asm_writer_emit_label (acfg, name);
  <D.23238>:
}


bin_writer_emit_label (struct MonoImageWriter * acfg, const char * name)
{
  gchar * D.23239;
  struct BinSection * D.23240;
  int D.23241;
  struct GHashTable * D.23242;
  char * D.23243;
  struct BinLabel * label;

  label = monoeg_malloc0 (12);
  D.23239 = monoeg_strdup (name);
  label->name = D.23239;
  D.23240 = acfg->cur_section;
  label->section = D.23240;
  D.23240 = acfg->cur_section;
  D.23241 = D.23240->cur_offset;
  label->offset = D.23241;
  D.23242 = acfg->labels;
  D.23243 = label->name;
  monoeg_g_hash_table_insert_replace (D.23242, D.23243, label, 0);
}


asm_writer_emit_label (struct MonoImageWriter * acfg, const char * name)
{
  struct FILE * D.23244;
  const char * D.23245;

  asm_writer_emit_unset_mode (acfg);
  D.23244 = acfg->fp;
  D.23245 = get_label (name);
  fprintf (D.23244, "%s:\n", D.23245);
}


get_label (const char * s)
{
  const char * D.23246;

  D.23246 = s;
  return D.23246;
}


img_writer_emit_bytes (struct MonoImageWriter * acfg, const guint8 * buf, int size)
{
  int D.23248;

  D.23248 = acfg->use_bin_writer;
  if (D.23248 != 0) goto <D.23249>; else goto <D.23250>;
  <D.23249>:
  bin_writer_emit_bytes (acfg, buf, size);
  goto <D.23251>;
  <D.23250>:
  asm_writer_emit_bytes (acfg, buf, size);
  <D.23251>:
}


bin_writer_emit_bytes (struct MonoImageWriter * acfg, const guint8 * buf, int size)
{
  struct BinSection * D.23252;
  guint8 * D.23253;
  int D.23254;
  sizetype D.23255;
  guint8 * D.23256;
  unsigned int size.3;
  int D.23258;

  D.23252 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.23252, size);
  D.23252 = acfg->cur_section;
  D.23253 = D.23252->data;
  D.23252 = acfg->cur_section;
  D.23254 = D.23252->cur_offset;
  D.23255 = (sizetype) D.23254;
  D.23256 = D.23253 + D.23255;
  size.3 = (unsigned int) size;
  memcpy (D.23256, buf, size.3);
  D.23252 = acfg->cur_section;
  D.23252 = acfg->cur_section;
  D.23254 = D.23252->cur_offset;
  D.23258 = D.23254 + size;
  D.23252->cur_offset = D.23258;
}


bin_writer_emit_ensure_buffer (struct BinSection * section, int size)
{
  int D.23259;
  int D.23260;
  int iftmp.4;
  unsigned int new_size.5;
  guint8 * D.23268;
  unsigned int D.23269;
  int new_offset;

  D.23259 = section->cur_offset;
  new_offset = D.23259 + size;
  D.23260 = section->data_len;
  if (D.23260 <= new_offset) goto <D.23261>; else goto <D.23262>;
  <D.23261>:
  {
    int new_size;
    guint8 * data;

    D.23260 = section->data_len;
    if (D.23260 != 0) goto <D.23264>; else goto <D.23265>;
    <D.23264>:
    D.23260 = section->data_len;
    iftmp.4 = D.23260 * 2;
    goto <D.23266>;
    <D.23265>:
    iftmp.4 = 256;
    <D.23266>:
    new_size = iftmp.4;
    goto <D.22370>;
    <D.22369>:
    new_size = new_size * 2;
    <D.22370>:
    if (new_size <= new_offset) goto <D.22369>; else goto <D.22371>;
    <D.22371>:
    new_size.5 = (unsigned int) new_size;
    data = monoeg_malloc0 (new_size.5);
    D.23268 = section->data;
    D.23260 = section->data_len;
    D.23269 = (unsigned int) D.23260;
    memcpy (data, D.23268, D.23269);
    D.23268 = section->data;
    monoeg_g_free (D.23268);
    section->data = data;
    section->data_len = new_size;
  }
  <D.23262>:
}


memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.23270;
  unsigned int D.23271;

  D.23271 = __builtin_object_size (__dest, 0);
  D.23270 = __builtin___memcpy_chk (__dest, __src, __len, D.23271);
  return D.23270;
}


asm_writer_emit_bytes (struct MonoImageWriter * acfg, const guint8 * buf, int size)
{
  int D.23273;
  char * byte_to_str.6;
  void * byte_to_str.7;
  int D.23280;
  sizetype D.23281;
  char * D.23282;
  int D.23283;
  unsigned int D.23284;
  unsigned int D.23285;
  struct FILE * D.23288;
  sizetype i.8;
  const guint8 * D.23290;
  unsigned char D.23291;
  int D.23292;
  int D.23294;
  sizetype D.23295;
  char * D.23296;
  int D.23297;
  int i;

  D.23273 = acfg->mode;
  if (D.23273 != 1) goto <D.23274>; else goto <D.23275>;
  <D.23274>:
  acfg->mode = 1;
  acfg->col_count = 0;
  <D.23275>:
  byte_to_str.6 = byte_to_str;
  if (byte_to_str.6 == 0B) goto <D.23277>; else goto <D.23278>;
  <D.23277>:
  byte_to_str.7 = monoeg_malloc0 (2048);
  byte_to_str = byte_to_str.7;
  i = 0;
  goto <D.22867>;
  <D.22866>:
  byte_to_str.6 = byte_to_str;
  D.23280 = i * 8;
  D.23281 = (sizetype) D.23280;
  D.23282 = byte_to_str.6 + D.23281;
  sprintf (D.23282, ",%d", i);
  i = i + 1;
  <D.22867>:
  if (i <= 255) goto <D.22866>; else goto <D.22868>;
  <D.22868>:
  <D.23278>:
  i = 0;
  goto <D.22870>;
  <D.22869>:
  D.23283 = acfg->col_count;
  D.23284 = (unsigned int) D.23283;
  D.23285 = D.23284 & 31;
  if (D.23285 == 0) goto <D.23286>; else goto <D.23287>;
  <D.23286>:
  D.23288 = acfg->fp;
  i.8 = (sizetype) i;
  D.23290 = buf + i.8;
  D.23291 = *D.23290;
  D.23292 = (int) D.23291;
  fprintf (D.23288, "\n\t.byte %d", D.23292);
  goto <D.23293>;
  <D.23287>:
  byte_to_str.6 = byte_to_str;
  i.8 = (sizetype) i;
  D.23290 = buf + i.8;
  D.23291 = *D.23290;
  D.23292 = (int) D.23291;
  D.23294 = D.23292 * 8;
  D.23295 = (sizetype) D.23294;
  D.23296 = byte_to_str.6 + D.23295;
  D.23288 = acfg->fp;
  fputs (D.23296, D.23288);
  <D.23293>:
  i = i + 1;
  D.23283 = acfg->col_count;
  D.23297 = D.23283 + 1;
  acfg->col_count = D.23297;
  <D.22870>:
  if (i < size) goto <D.22869>; else goto <D.22871>;
  <D.22871>:
}


sprintf (char * restrict __s, const char * restrict __fmt)
{
  int D.23298;
  unsigned int D.23299;

  D.23299 = __builtin_object_size (__s, 1);
  D.23298 = __builtin___sprintf_chk (__s, 1, D.23299, __fmt, __builtin_va_arg_pack ());
  return D.23298;
}


img_writer_emit_string (struct MonoImageWriter * acfg, const char * value)
{
  int D.23301;

  D.23301 = acfg->use_bin_writer;
  if (D.23301 != 0) goto <D.23302>; else goto <D.23303>;
  <D.23302>:
  bin_writer_emit_string (acfg, value);
  goto <D.23304>;
  <D.23303>:
  asm_writer_emit_string (acfg, value);
  <D.23304>:
}


bin_writer_emit_string (struct MonoImageWriter * acfg, const char * value)
{
  unsigned int D.23305;
  unsigned int D.23306;
  int size;

  D.23305 = strlen (value);
  D.23306 = D.23305 + 1;
  size = (int) D.23306;
  bin_writer_emit_bytes (acfg, value, size);
}


asm_writer_emit_string (struct MonoImageWriter * acfg, const char * value)
{
  struct FILE * D.23307;

  asm_writer_emit_unset_mode (acfg);
  D.23307 = acfg->fp;
  fprintf (D.23307, "\t%s \"%s\"\n", ".string", value);
}


img_writer_emit_line (struct MonoImageWriter * acfg)
{
  int D.23308;

  D.23308 = acfg->use_bin_writer;
  if (D.23308 != 0) goto <D.23309>; else goto <D.23310>;
  <D.23309>:
  bin_writer_emit_line (acfg);
  goto <D.23311>;
  <D.23310>:
  asm_writer_emit_line (acfg);
  <D.23311>:
}


bin_writer_emit_line (struct MonoImageWriter * acfg)
{

}


asm_writer_emit_line (struct MonoImageWriter * acfg)
{
  struct FILE * D.23312;

  asm_writer_emit_unset_mode (acfg);
  D.23312 = acfg->fp;
  fprintf (D.23312, "\n");
}


img_writer_emit_alignment (struct MonoImageWriter * acfg, int size)
{
  int D.23313;

  D.23313 = acfg->use_bin_writer;
  if (D.23313 != 0) goto <D.23314>; else goto <D.23315>;
  <D.23314>:
  bin_writer_emit_alignment (acfg, size);
  goto <D.23316>;
  <D.23315>:
  asm_writer_emit_alignment (acfg, size);
  <D.23316>:
}


bin_writer_emit_alignment (struct MonoImageWriter * acfg, int size)
{
  struct BinSection * D.23317;
  int D.23318;
  int D.23319;
  int D.23320;
  int D.23323;
  int offset;
  int add;

  D.23317 = acfg->cur_section;
  offset = D.23317->cur_offset;
  D.23318 = size + -1;
  offset = D.23318 + offset;
  D.23319 = -size;
  offset = D.23319 & offset;
  D.23317 = acfg->cur_section;
  D.23320 = D.23317->cur_offset;
  add = offset - D.23320;
  if (add != 0) goto <D.23321>; else goto <D.23322>;
  <D.23321>:
  D.23317 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.23317, add);
  D.23317 = acfg->cur_section;
  D.23317 = acfg->cur_section;
  D.23320 = D.23317->cur_offset;
  D.23323 = D.23320 + add;
  D.23317->cur_offset = D.23323;
  <D.23322>:
}


asm_writer_emit_alignment (struct MonoImageWriter * acfg, int size)
{
  struct FILE * D.23324;

  asm_writer_emit_unset_mode (acfg);
  D.23324 = acfg->fp;
  fprintf (D.23324, "\t.balign %d\n", size);
}


img_writer_emit_pointer_unaligned (struct MonoImageWriter * acfg, const char * target)
{
  int D.23325;

  D.23325 = acfg->use_bin_writer;
  if (D.23325 != 0) goto <D.23326>; else goto <D.23327>;
  <D.23326>:
  bin_writer_emit_pointer_unaligned (acfg, target);
  goto <D.23328>;
  <D.23327>:
  asm_writer_emit_pointer_unaligned (acfg, target);
  <D.23328>:
}


bin_writer_emit_pointer_unaligned (struct MonoImageWriter * acfg, const char * target)
{
  struct BinSection * D.23331;
  int D.23332;
  unsigned int D.23333;
  unsigned int D.23334;
  int D.23335;
  gchar * D.23336;
  struct BinReloc * D.23337;
  int D.22404;
  int iftmp.9;
  int D.22403;
  struct BinSection * D.23341;
  const char[6] * D.23342;
  unsigned char D.23343;
  int D.23344;
  unsigned char D.23345;
  int D.23346;
  const unsigned char * D.23351;
  unsigned char D.23352;
  int D.23353;
  const unsigned char * D.23354;
  unsigned char D.23355;
  int D.23356;
  const unsigned char * D.23361;
  unsigned char D.23362;
  int D.23363;
  const unsigned char * D.23364;
  unsigned char D.23365;
  int D.23366;
  const unsigned char * D.23371;
  unsigned char D.23372;
  int D.23373;
  const unsigned char * D.23374;
  unsigned char D.23375;
  int D.23376;
  char * D.23378;
  int D.23381;
  int D.23382;
  struct BinReloc * reloc;

  if (target == 0B) goto <D.23329>; else goto <D.23330>;
  <D.23329>:
  D.23331 = acfg->cur_section;
  D.23331 = acfg->cur_section;
  D.23332 = D.23331->cur_offset;
  D.23333 = (unsigned int) D.23332;
  D.23334 = D.23333 + 4;
  D.23335 = (int) D.23334;
  D.23331->cur_offset = D.23335;
  return;
  <D.23330>:
  reloc = monoeg_malloc0 (36);
  D.23336 = monoeg_strdup (target);
  reloc->val1 = D.23336;
  D.23331 = acfg->cur_section;
  reloc->section = D.23331;
  D.23331 = acfg->cur_section;
  D.23332 = D.23331->cur_offset;
  reloc->section_offset = D.23332;
  D.23337 = acfg->relocations;
  reloc->next = D.23337;
  acfg->relocations = reloc;
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.23339>; else goto <D.23340>;
    <D.23339>:
    {
      const unsigned char * __s2;
      int __result;

      D.23341 = reloc->section;
      __s2 = D.23341->name;
      D.23342 = ".data";
      D.23343 = MEM[(const unsigned char *)D.23342];
      D.23344 = (int) D.23343;
      D.23345 = *__s2;
      D.23346 = (int) D.23345;
      __result = D.23344 - D.23346;
      {
        if (__s2_len != 0) goto <D.23347>; else goto <D.23348>;
        <D.23347>:
        if (__result == 0) goto <D.23349>; else goto <D.23350>;
        <D.23349>:
        D.23351 = &MEM[(void *)".data" + 1B];
        D.23352 = *D.23351;
        D.23353 = (int) D.23352;
        D.23354 = __s2 + 1;
        D.23355 = *D.23354;
        D.23356 = (int) D.23355;
        __result = D.23353 - D.23356;
        if (__s2_len > 1) goto <D.23357>; else goto <D.23358>;
        <D.23357>:
        if (__result == 0) goto <D.23359>; else goto <D.23360>;
        <D.23359>:
        D.23361 = &MEM[(void *)".data" + 2B];
        D.23362 = *D.23361;
        D.23363 = (int) D.23362;
        D.23364 = __s2 + 2;
        D.23365 = *D.23364;
        D.23366 = (int) D.23365;
        __result = D.23363 - D.23366;
        if (__s2_len > 2) goto <D.23367>; else goto <D.23368>;
        <D.23367>:
        if (__result == 0) goto <D.23369>; else goto <D.23370>;
        <D.23369>:
        D.23371 = &MEM[(void *)".data" + 3B];
        D.23372 = *D.23371;
        D.23373 = (int) D.23372;
        D.23374 = __s2 + 3;
        D.23375 = *D.23374;
        D.23376 = (int) D.23375;
        __result = D.23373 - D.23376;
        <D.23370>:
        <D.23368>:
        <D.23360>:
        <D.23358>:
        <D.23350>:
        <D.23348>:
      }
      D.22403 = __result;
    }
    iftmp.9 = -D.22403;
    goto <D.23377>;
    <D.23340>:
    D.23341 = reloc->section;
    D.23378 = D.23341->name;
    iftmp.9 = __builtin_strcmp (D.23378, ".data");
    <D.23377>:
    D.22404 = iftmp.9;
  }
  if (D.22404 == 0) goto <D.23379>; else goto <D.23380>;
  <D.23379>:
  D.23381 = acfg->num_relocs;
  D.23382 = D.23381 + 1;
  acfg->num_relocs = D.23382;
  <D.23380>:
  D.23331 = acfg->cur_section;
  D.23331 = acfg->cur_section;
  D.23332 = D.23331->cur_offset;
  D.23333 = (unsigned int) D.23332;
  D.23334 = D.23333 + 4;
  D.23335 = (int) D.23334;
  D.23331->cur_offset = D.23335;
}


asm_writer_emit_pointer_unaligned (struct MonoImageWriter * acfg, const char * target)
{
  struct FILE * D.23384;
  const char * iftmp.10;

  asm_writer_emit_unset_mode (acfg);
  D.23384 = acfg->fp;
  if (target != 0B) goto <D.23386>; else goto <D.23387>;
  <D.23386>:
  iftmp.10 = target;
  goto <D.23388>;
  <D.23387>:
  iftmp.10 = "0";
  <D.23388>:
  fprintf (D.23384, "\t%s %s\n", ".long", iftmp.10);
}


img_writer_emit_pointer (struct MonoImageWriter * acfg, const char * target)
{
  int D.23389;

  D.23389 = acfg->use_bin_writer;
  if (D.23389 != 0) goto <D.23390>; else goto <D.23391>;
  <D.23390>:
  bin_writer_emit_pointer (acfg, target);
  goto <D.23392>;
  <D.23391>:
  asm_writer_emit_pointer (acfg, target);
  <D.23392>:
}


bin_writer_emit_pointer (struct MonoImageWriter * acfg, const char * target)
{
  bin_writer_emit_alignment (acfg, 4);
  bin_writer_emit_pointer_unaligned (acfg, target);
}


asm_writer_emit_pointer (struct MonoImageWriter * acfg, const char * target)
{
  asm_writer_emit_unset_mode (acfg);
  asm_writer_emit_alignment (acfg, 4);
  asm_writer_emit_pointer_unaligned (acfg, target);
}


img_writer_emit_int16 (struct MonoImageWriter * acfg, int value)
{
  int D.23393;

  D.23393 = acfg->use_bin_writer;
  if (D.23393 != 0) goto <D.23394>; else goto <D.23395>;
  <D.23394>:
  bin_writer_emit_int16 (acfg, value);
  goto <D.23396>;
  <D.23395>:
  asm_writer_emit_int16 (acfg, value);
  <D.23396>:
}


bin_writer_emit_int16 (struct MonoImageWriter * acfg, int value)
{
  struct BinSection * D.23397;
  guint8 * D.23398;
  int D.23399;
  sizetype D.23400;
  int D.23401;
  unsigned char D.23402;
  guint8 * D.23403;
  int D.23404;
  unsigned char D.23405;
  guint8 * data;

  D.23397 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.23397, 2);
  D.23397 = acfg->cur_section;
  D.23398 = D.23397->data;
  D.23397 = acfg->cur_section;
  D.23399 = D.23397->cur_offset;
  D.23400 = (sizetype) D.23399;
  data = D.23398 + D.23400;
  D.23397 = acfg->cur_section;
  D.23397 = acfg->cur_section;
  D.23399 = D.23397->cur_offset;
  D.23401 = D.23399 + 2;
  D.23397->cur_offset = D.23401;
  D.23402 = (unsigned char) value;
  *data = D.23402;
  D.23403 = data + 1;
  D.23404 = value >> 8;
  D.23405 = (unsigned char) D.23404;
  *D.23403 = D.23405;
}


asm_writer_emit_int16 (struct MonoImageWriter * acfg, int value)
{
  int D.23406;
  int D.23409;
  int D.23410;
  int D.23411;
  unsigned int D.23412;
  unsigned int D.23413;
  struct FILE * D.23416;

  D.23406 = acfg->mode;
  if (D.23406 != 2) goto <D.23407>; else goto <D.23408>;
  <D.23407>:
  acfg->mode = 2;
  acfg->col_count = 0;
  <D.23408>:
  D.23409 = acfg->col_count;
  D.23410 = D.23409;
  D.23411 = D.23410 + 1;
  acfg->col_count = D.23411;
  D.23412 = (unsigned int) D.23410;
  D.23413 = D.23412 & 7;
  if (D.23413 == 0) goto <D.23414>; else goto <D.23415>;
  <D.23414>:
  D.23416 = acfg->fp;
  fprintf (D.23416, "\n\t%s ", ".hword");
  goto <D.23417>;
  <D.23415>:
  D.23416 = acfg->fp;
  fprintf (D.23416, ", ");
  <D.23417>:
  D.23416 = acfg->fp;
  fprintf (D.23416, "%d", value);
}


img_writer_emit_int32 (struct MonoImageWriter * acfg, int value)
{
  int D.23418;

  D.23418 = acfg->use_bin_writer;
  if (D.23418 != 0) goto <D.23419>; else goto <D.23420>;
  <D.23419>:
  bin_writer_emit_int32 (acfg, value);
  goto <D.23421>;
  <D.23420>:
  asm_writer_emit_int32 (acfg, value);
  <D.23421>:
}


bin_writer_emit_int32 (struct MonoImageWriter * acfg, int value)
{
  struct BinSection * D.23422;
  guint8 * D.23423;
  int D.23424;
  sizetype D.23425;
  int D.23426;
  unsigned char D.23427;
  guint8 * D.23428;
  int D.23429;
  unsigned char D.23430;
  guint8 * D.23431;
  int D.23432;
  unsigned char D.23433;
  guint8 * D.23434;
  int D.23435;
  unsigned char D.23436;
  guint8 * data;

  D.23422 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.23422, 4);
  D.23422 = acfg->cur_section;
  D.23423 = D.23422->data;
  D.23422 = acfg->cur_section;
  D.23424 = D.23422->cur_offset;
  D.23425 = (sizetype) D.23424;
  data = D.23423 + D.23425;
  D.23422 = acfg->cur_section;
  D.23422 = acfg->cur_section;
  D.23424 = D.23422->cur_offset;
  D.23426 = D.23424 + 4;
  D.23422->cur_offset = D.23426;
  D.23427 = (unsigned char) value;
  *data = D.23427;
  D.23428 = data + 1;
  D.23429 = value >> 8;
  D.23430 = (unsigned char) D.23429;
  *D.23428 = D.23430;
  D.23431 = data + 2;
  D.23432 = value >> 16;
  D.23433 = (unsigned char) D.23432;
  *D.23431 = D.23433;
  D.23434 = data + 3;
  D.23435 = value >> 24;
  D.23436 = (unsigned char) D.23435;
  *D.23434 = D.23436;
}


asm_writer_emit_int32 (struct MonoImageWriter * acfg, int value)
{
  int D.23437;
  int D.23440;
  int D.23441;
  int D.23442;
  unsigned int D.23443;
  unsigned int D.23444;
  struct FILE * D.23447;

  D.23437 = acfg->mode;
  if (D.23437 != 3) goto <D.23438>; else goto <D.23439>;
  <D.23438>:
  acfg->mode = 3;
  acfg->col_count = 0;
  <D.23439>:
  D.23440 = acfg->col_count;
  D.23441 = D.23440;
  D.23442 = D.23441 + 1;
  acfg->col_count = D.23442;
  D.23443 = (unsigned int) D.23441;
  D.23444 = D.23443 & 7;
  if (D.23444 == 0) goto <D.23445>; else goto <D.23446>;
  <D.23445>:
  D.23447 = acfg->fp;
  fprintf (D.23447, "\n\t%s ", ".long");
  goto <D.23448>;
  <D.23446>:
  D.23447 = acfg->fp;
  fprintf (D.23447, ",");
  <D.23448>:
  D.23447 = acfg->fp;
  fprintf (D.23447, "%d", value);
}


img_writer_emit_symbol_diff (struct MonoImageWriter * acfg, const char * end, const char * start, int offset)
{
  int D.23449;

  D.23449 = acfg->use_bin_writer;
  if (D.23449 != 0) goto <D.23450>; else goto <D.23451>;
  <D.23450>:
  bin_writer_emit_symbol_diff (acfg, end, start, offset);
  goto <D.23452>;
  <D.23451>:
  asm_writer_emit_symbol_diff (acfg, end, start, offset);
  <D.23452>:
}


bin_writer_emit_symbol_diff (struct MonoImageWriter * acfg, const char * end, const char * start, int offset)
{
  struct BinSection * D.23453;
  int D.23454;
  int D.23455;

  create_reloc (acfg, end, start, offset);
  D.23453 = acfg->cur_section;
  D.23453 = acfg->cur_section;
  D.23454 = D.23453->cur_offset;
  D.23455 = D.23454 + 4;
  D.23453->cur_offset = D.23455;
}


create_reloc (struct MonoImageWriter * acfg, const char * end, const char * start, int offset)
{
  struct MonoMemPool * D.23456;
  char * D.23457;
  int D.22434;
  int iftmp.11;
  int D.22433;
  const char[2] * D.23461;
  unsigned char D.23462;
  int D.23463;
  unsigned char D.23464;
  int D.23465;
  const unsigned char * D.23470;
  unsigned char D.23471;
  int D.23472;
  const unsigned char * D.23473;
  unsigned char D.23474;
  int D.23475;
  const unsigned char * D.23480;
  unsigned char D.23481;
  int D.23482;
  const unsigned char * D.23483;
  unsigned char D.23484;
  int D.23485;
  const unsigned char * D.23490;
  unsigned char D.23491;
  int D.23492;
  const unsigned char * D.23493;
  unsigned char D.23494;
  int D.23495;
  struct BinSection * D.23499;
  int D.23500;
  char * D.23502;
  struct BinReloc * D.23503;
  struct BinReloc * D.23504;
  struct BinReloc * reloc;

  D.23456 = acfg->mempool;
  reloc = mono_mempool_alloc0 (D.23456, 36);
  D.23456 = acfg->mempool;
  D.23457 = mono_mempool_strdup (D.23456, end);
  reloc->val1 = D.23457;
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 1;
    if (__s2_len <= 3) goto <D.23459>; else goto <D.23460>;
    <D.23459>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = start;
      D.23461 = ".";
      D.23462 = MEM[(const unsigned char *)D.23461];
      D.23463 = (int) D.23462;
      D.23464 = *__s2;
      D.23465 = (int) D.23464;
      __result = D.23463 - D.23465;
      {
        if (__s2_len != 0) goto <D.23466>; else goto <D.23467>;
        <D.23466>:
        if (__result == 0) goto <D.23468>; else goto <D.23469>;
        <D.23468>:
        D.23470 = &MEM[(void *)"." + 1B];
        D.23471 = *D.23470;
        D.23472 = (int) D.23471;
        D.23473 = __s2 + 1;
        D.23474 = *D.23473;
        D.23475 = (int) D.23474;
        __result = D.23472 - D.23475;
        if (__s2_len > 1) goto <D.23476>; else goto <D.23477>;
        <D.23476>:
        if (__result == 0) goto <D.23478>; else goto <D.23479>;
        <D.23478>:
        D.23480 = &MEM[(void *)"." + 2B];
        D.23481 = *D.23480;
        D.23482 = (int) D.23481;
        D.23483 = __s2 + 2;
        D.23484 = *D.23483;
        D.23485 = (int) D.23484;
        __result = D.23482 - D.23485;
        if (__s2_len > 2) goto <D.23486>; else goto <D.23487>;
        <D.23486>:
        if (__result == 0) goto <D.23488>; else goto <D.23489>;
        <D.23488>:
        D.23490 = &MEM[(void *)"." + 3B];
        D.23491 = *D.23490;
        D.23492 = (int) D.23491;
        D.23493 = __s2 + 3;
        D.23494 = *D.23493;
        D.23495 = (int) D.23494;
        __result = D.23492 - D.23495;
        <D.23489>:
        <D.23487>:
        <D.23479>:
        <D.23477>:
        <D.23469>:
        <D.23467>:
      }
      D.22433 = __result;
    }
    iftmp.11 = -D.22433;
    goto <D.23496>;
    <D.23460>:
    iftmp.11 = __builtin_strcmp (start, ".");
    <D.23496>:
    D.22434 = iftmp.11;
  }
  if (D.22434 == 0) goto <D.23497>; else goto <D.23498>;
  <D.23497>:
  D.23499 = acfg->cur_section;
  reloc->val2_section = D.23499;
  D.23499 = acfg->cur_section;
  D.23500 = D.23499->cur_offset;
  reloc->val2_offset = D.23500;
  goto <D.23501>;
  <D.23498>:
  D.23456 = acfg->mempool;
  D.23502 = mono_mempool_strdup (D.23456, start);
  reloc->val2 = D.23502;
  <D.23501>:
  reloc->offset = offset;
  D.23499 = acfg->cur_section;
  reloc->section = D.23499;
  D.23499 = acfg->cur_section;
  D.23500 = D.23499->cur_offset;
  reloc->section_offset = D.23500;
  D.23503 = acfg->relocations;
  reloc->next = D.23503;
  acfg->relocations = reloc;
  D.23504 = reloc;
  return D.23504;
}


asm_writer_emit_symbol_diff (struct MonoImageWriter * acfg, const char * end, const char * start, int offset)
{
  int D.23506;
  int D.22894;
  int iftmp.12;
  int D.22893;
  const char[2] * D.23514;
  unsigned char D.23515;
  int D.23516;
  unsigned char D.23517;
  int D.23518;
  const unsigned char * D.23523;
  unsigned char D.23524;
  int D.23525;
  const unsigned char * D.23526;
  unsigned char D.23527;
  int D.23528;
  const unsigned char * D.23533;
  unsigned char D.23534;
  int D.23535;
  const unsigned char * D.23536;
  unsigned char D.23537;
  int D.23538;
  const unsigned char * D.23543;
  unsigned char D.23544;
  int D.23545;
  const unsigned char * D.23546;
  unsigned char D.23547;
  int D.23548;
  int D.23552;
  int D.23553;
  struct FILE * D.23554;
  int D.23555;
  int D.23556;
  int D.23557;
  unsigned int D.23558;
  unsigned int D.23559;

  D.23506 = acfg->mode;
  if (D.23506 != 3) goto <D.23507>; else goto <D.23508>;
  <D.23507>:
  acfg->mode = 3;
  acfg->col_count = 0;
  <D.23508>:
  start = get_label (start);
  end = get_label (end);
  if (offset == 0) goto <D.23509>; else goto <D.23510>;
  <D.23509>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 1;
    if (__s2_len <= 3) goto <D.23512>; else goto <D.23513>;
    <D.23512>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = start;
      D.23514 = ".";
      D.23515 = MEM[(const unsigned char *)D.23514];
      D.23516 = (int) D.23515;
      D.23517 = *__s2;
      D.23518 = (int) D.23517;
      __result = D.23516 - D.23518;
      {
        if (__s2_len != 0) goto <D.23519>; else goto <D.23520>;
        <D.23519>:
        if (__result == 0) goto <D.23521>; else goto <D.23522>;
        <D.23521>:
        D.23523 = &MEM[(void *)"." + 1B];
        D.23524 = *D.23523;
        D.23525 = (int) D.23524;
        D.23526 = __s2 + 1;
        D.23527 = *D.23526;
        D.23528 = (int) D.23527;
        __result = D.23525 - D.23528;
        if (__s2_len > 1) goto <D.23529>; else goto <D.23530>;
        <D.23529>:
        if (__result == 0) goto <D.23531>; else goto <D.23532>;
        <D.23531>:
        D.23533 = &MEM[(void *)"." + 2B];
        D.23534 = *D.23533;
        D.23535 = (int) D.23534;
        D.23536 = __s2 + 2;
        D.23537 = *D.23536;
        D.23538 = (int) D.23537;
        __result = D.23535 - D.23538;
        if (__s2_len > 2) goto <D.23539>; else goto <D.23540>;
        <D.23539>:
        if (__result == 0) goto <D.23541>; else goto <D.23542>;
        <D.23541>:
        D.23543 = &MEM[(void *)"." + 3B];
        D.23544 = *D.23543;
        D.23545 = (int) D.23544;
        D.23546 = __s2 + 3;
        D.23547 = *D.23546;
        D.23548 = (int) D.23547;
        __result = D.23545 - D.23548;
        <D.23542>:
        <D.23540>:
        <D.23532>:
        <D.23530>:
        <D.23522>:
        <D.23520>:
      }
      D.22893 = __result;
    }
    iftmp.12 = -D.22893;
    goto <D.23549>;
    <D.23513>:
    iftmp.12 = __builtin_strcmp (start, ".");
    <D.23549>:
    D.22894 = iftmp.12;
  }
  if (D.22894 != 0) goto <D.23550>; else goto <D.23551>;
  <D.23550>:
  {
    char symbol[128];

    try
      {
        D.23552 = acfg->label_gen;
        sprintf (&symbol, "%sDIFF_SYM%d", ".L", D.23552);
        D.23552 = acfg->label_gen;
        D.23553 = D.23552 + 1;
        acfg->label_gen = D.23553;
        D.23554 = acfg->fp;
        fprintf (D.23554, "\n%s=%s - %s", &symbol, end, start);
        D.23554 = acfg->fp;
        fprintf (D.23554, "\n\t%s ", ".long");
        D.23554 = acfg->fp;
        fprintf (D.23554, "%s", &symbol);
        return;
      }
    finally
      {
        symbol = {CLOBBER};
      }
  }
  <D.23551>:
  <D.23510>:
  D.23555 = acfg->col_count;
  D.23556 = D.23555;
  D.23557 = D.23556 + 1;
  acfg->col_count = D.23557;
  D.23558 = (unsigned int) D.23556;
  D.23559 = D.23558 & 7;
  if (D.23559 == 0) goto <D.23560>; else goto <D.23561>;
  <D.23560>:
  D.23554 = acfg->fp;
  fprintf (D.23554, "\n\t%s ", ".long");
  goto <D.23562>;
  <D.23561>:
  D.23554 = acfg->fp;
  fprintf (D.23554, ",");
  <D.23562>:
  if (offset > 0) goto <D.23563>; else goto <D.23564>;
  <D.23563>:
  D.23554 = acfg->fp;
  fprintf (D.23554, "%s - %s + %d", end, start, offset);
  goto <D.23565>;
  <D.23564>:
  if (offset < 0) goto <D.23566>; else goto <D.23567>;
  <D.23566>:
  D.23554 = acfg->fp;
  fprintf (D.23554, "%s - %s %d", end, start, offset);
  goto <D.23568>;
  <D.23567>:
  D.23554 = acfg->fp;
  fprintf (D.23554, "%s - %s", end, start);
  <D.23568>:
  <D.23565>:
}


img_writer_emit_zero_bytes (struct MonoImageWriter * acfg, int num)
{
  int D.23571;

  D.23571 = acfg->use_bin_writer;
  if (D.23571 != 0) goto <D.23572>; else goto <D.23573>;
  <D.23572>:
  bin_writer_emit_zero_bytes (acfg, num);
  goto <D.23574>;
  <D.23573>:
  asm_writer_emit_zero_bytes (acfg, num);
  <D.23574>:
}


bin_writer_emit_zero_bytes (struct MonoImageWriter * acfg, int num)
{
  struct BinSection * D.23575;
  int D.23576;
  int D.23577;

  D.23575 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.23575, num);
  D.23575 = acfg->cur_section;
  D.23575 = acfg->cur_section;
  D.23576 = D.23575->cur_offset;
  D.23577 = D.23576 + num;
  D.23575->cur_offset = D.23577;
}


asm_writer_emit_zero_bytes (struct MonoImageWriter * acfg, int num)
{
  struct FILE * D.23578;

  asm_writer_emit_unset_mode (acfg);
  D.23578 = acfg->fp;
  fprintf (D.23578, "\t%s %d\n", ".skip", num);
}


img_writer_emit_writeout (struct MonoImageWriter * acfg)
{
  int D.23579;
  int D.23582;

  D.23579 = acfg->use_bin_writer;
  if (D.23579 != 0) goto <D.23580>; else goto <D.23581>;
  <D.23580>:
  D.23582 = bin_writer_emit_writeout (acfg);
  return D.23582;
  <D.23581>:
  D.23582 = asm_writer_emit_writeout (acfg);
  return D.23582;
}


bin_writer_emit_writeout (struct MonoImageWriter * acfg)
{
  const char * D.23584;
  int D.23585;
  unsigned int D.23586;
  int D.23587;
  unsigned int D.23588;
  int D.23589;
  unsigned int D.23590;
  int D.23591;
  unsigned int D.23592;
  int D.23593;
  unsigned int D.23594;
  int D.22750;
  char * D.23595;
  const char * D.23596;
  struct BinSection * D.23599;
  int D.23600;
  int num_local_syms.13;
  unsigned int file_offset.14;
  unsigned int D.23603;
  int D.23604;
  int D.23605;
  int * D.23606;
  int D.23607;
  int D.23608;
  unsigned int D.23609;
  unsigned int D.23610;
  int size.15;
  int size.16;
  unsigned int size.17;
  unsigned int D.23614;
  unsigned int D.23615;
  unsigned int D.23616;
  int size.18;
  unsigned int D.23618;
  struct GString * D.23619;
  unsigned int D.23620;
  int size.19;
  unsigned int D.23622;
  int D.23623;
  unsigned int D.23624;
  unsigned int D.23625;
  int size.20;
  unsigned int D.23627;
  unsigned int D.23628;
  unsigned int file_offset.21;
  unsigned int D.23630;
  unsigned int D.23631;
  unsigned int D.23632;
  unsigned int D.23633;
  unsigned int D.23634;
  struct BinSection * D.23635;
  int D.23638;
  long long unsigned int D.23641;
  unsigned int D.23642;
  unsigned int D.23643;
  unsigned int D.23644;
  int size.22;
  unsigned int D.23646;
  unsigned int D.23647;
  unsigned int D.23648;
  unsigned int D.23649;
  unsigned int D.23650;
  unsigned int virt_offset.23;
  struct BinSection * D.23652;
  int size.24;
  unsigned int D.23656;
  unsigned int D.23657;
  unsigned int D.23658;
  unsigned int D.23659;
  unsigned int D.23660;
  unsigned int D.23661;
  unsigned int D.23662;
  unsigned int D.23663;
  unsigned int D.23664;
  unsigned int D.23665;
  unsigned int virt_offset.25;
  unsigned int D.23667;
  unsigned int D.23668;
  unsigned int D.23669;
  unsigned int D.23670;
  unsigned int D.23671;
  unsigned int D.23672;
  unsigned int D.23673;
  unsigned int D.23674;
  unsigned int D.23675;
  unsigned int D.23676;
  unsigned int D.23677;
  struct BinSection * D.23678;
  int size.26;
  unsigned int D.23682;
  unsigned int D.23683;
  unsigned int D.23684;
  unsigned int D.23685;
  unsigned int D.23686;
  unsigned int D.23687;
  unsigned int D.23688;
  unsigned int D.23689;
  struct BinSection * D.23690;
  int size.27;
  unsigned int D.23694;
  unsigned int D.23695;
  unsigned int D.23696;
  unsigned int D.23697;
  unsigned int D.23698;
  struct BinSection * D.23699;
  int size.28;
  struct BinSection * D.23704;
  int size.29;
  struct BinSection * D.23709;
  int size.30;
  struct BinSection * D.23714;
  int size.31;
  struct BinSection * D.23719;
  int size.32;
  unsigned int D.23724;
  unsigned int D.23725;
  unsigned int D.23726;
  unsigned int D.23727;
  unsigned int D.23728;
  struct GString * D.23729;
  unsigned int D.23730;
  int size.33;
  unsigned int D.23732;
  unsigned int D.23733;
  unsigned int D.23734;
  unsigned int D.23735;
  unsigned int D.23736;
  int num_local_syms.34;
  unsigned int num_local_syms.35;
  unsigned int D.23739;
  int size.36;
  unsigned int D.23741;
  unsigned int D.23742;
  unsigned int D.23743;
  unsigned int D.23744;
  unsigned int D.23745;
  struct GString * D.23746;
  unsigned int D.23747;
  int size.37;
  unsigned int D.23751;
  unsigned int D.23752;
  _Bool D.23753;
  long int D.23754;
  long int D.23755;
  unsigned int D.23758;
  unsigned int D.23759;
  unsigned int D.23760;
  unsigned int D.23761;
  unsigned int D.23762;
  unsigned int D.23763;
  unsigned int D.23764;
  unsigned int D.23765;
  unsigned int D.23766;
  unsigned int D.23767;
  unsigned int D.23768;
  unsigned int D.23769;
  unsigned int D.23770;
  unsigned int D.23771;
  unsigned int D.23772;
  unsigned int D.23773;
  unsigned int D.23774;
  unsigned int D.23775;
  struct BinSection * D.23776;
  unsigned int D.23779;
  int D.23780;
  unsigned int D.23781;
  int D.23782;
  struct FILE * D.23783;
  unsigned int file_offset.38;
  unsigned int D.23787;
  int D.23788;
  int D.23789;
  unsigned int D.23790;
  void * D.23791;
  int D.23792;
  int D.23793;
  unsigned int D.23794;
  unsigned int D.23795;
  char * D.23796;
  int D.23797;
  unsigned int D.23798;
  int D.23799;
  unsigned int D.23800;
  int D.23803;
  guint8 * D.23804;
  unsigned int size.39;
  unsigned int D.23808;
  int D.23809;
  guint8 * D.23810;
  unsigned int size.40;
  int D.23812;
  int size.41;
  unsigned int D.23814;
  int D.23815;
  struct BinSection * D.23816;
  unsigned int D.23819;
  int D.23820;
  guint8 * D.23821;
  int D.23822;
  unsigned int D.23823;
  unsigned int i.42;
  unsigned int D.23825;
  int D.23826;
  char * D.23827;
  unsigned int D.23828;
  int D.23829;
  unsigned int D.23830;
  int D.23831;
  char * D.23832;
  int D.23835;
  struct FILE * file;
  struct ElfHeader header;
  struct ElfProgHeader progh[4];
  struct ElfSectHeader secth[20];
  struct ElfReloc * relocs;
  struct ElfStrTable str_table;
  struct ElfStrTable sh_str_table;
  struct ElfStrTable dyn_str_table;
  struct BinSection * all_sections[32];
  struct BinSection * sections[20];
  struct ElfSymbol * dynsym;
  struct ElfSymbol * symtab;
  struct ElfDynamic dynamic[14];
  int * hash;
  int i;
  int num_sections;
  int file_offset;
  int virt_offset;
  int size;
  int num_symtab;
  int num_local_syms;

  try
    {
      str_table.data = 0B;
      str_table.hash = 0B;
      sh_str_table.data = 0B;
      sh_str_table.hash = 0B;
      dyn_str_table.data = 0B;
      dyn_str_table.hash = 0B;
      file = acfg->fp;
      memset (&secth, 0, 800);
      memset (&dynamic, 0, 112);
      memset (&header, 0, 52);
      i = 1;
      goto <D.22738>;
      <D.22737>:
      D.23584 = section_info[i].name;
      D.23585 = str_table_add (&sh_str_table, D.23584);
      D.23586 = (unsigned int) D.23585;
      secth[i].sh_name = D.23586;
      D.23587 = section_info[i].type;
      D.23588 = (unsigned int) D.23587;
      secth[i].sh_type = D.23588;
      D.23589 = section_info[i].align;
      D.23590 = (unsigned int) D.23589;
      secth[i].sh_addralign = D.23590;
      D.23591 = section_info[i].flags;
      D.23592 = (unsigned int) D.23591;
      secth[i].sh_flags = D.23592;
      D.23593 = section_info[i].esize;
      D.23594 = (unsigned int) D.23593;
      secth[i].sh_entsize = D.23594;
      i = i + 1;
      <D.22738>:
      if (i <= 19) goto <D.22737>; else goto <D.22739>;
      <D.22739>:
      secth[2].sh_info = 4;
      secth[18].sh_info = 20;
      secth[1].sh_link = 2;
      secth[2].sh_link = 3;
      secth[4].sh_link = 2;
      secth[5].sh_link = 2;
      secth[8].sh_link = 3;
      secth[18].sh_link = 19;
      num_sections = collect_sections (acfg, &secth, &all_sections, 16);
      hash = build_hash (acfg, num_sections, &dyn_str_table);
      num_symtab = MEM[(int *)hash + 4B];
      memset (&sections, 0, 80);
      i = 0;
      goto <D.22755>;
      <D.22754>:
      {
        struct BinSection * sect;
        int j;

        sect = all_sections[i];
        j = 0;
        goto <D.22753>;
        <D.22752>:
        {
          size_t __s1_len;
          size_t __s2_len;

          D.23595 = sect->name;
          D.23596 = section_info[j].name;
          D.22750 = __builtin_strcmp (D.23595, D.23596);
        }
        if (D.22750 == 0) goto <D.23597>; else goto <D.23598>;
        <D.23597>:
        sect->shidx = j;
        goto <D.22751>;
        <D.23598>:
        j = j + 1;
        <D.22753>:
        if (j <= 19) goto <D.22752>; else goto <D.22751>;
        <D.22751>:
        D.23599 = all_sections[i];
        D.23600 = D.23599->shidx;
        sections[D.23600] = sect;
      }
      i = i + 1;
      <D.22755>:
      if (i < num_sections) goto <D.22754>; else goto <D.22756>;
      <D.22756>:
      dynsym = collect_syms (acfg, hash, &dyn_str_table, 0B, 0B);
      num_local_syms.13 = MEM[(int *)hash + 4B];
      num_local_syms = num_local_syms.13;
      symtab = collect_syms (acfg, 0B, &str_table, &secth, &num_local_syms);
      virt_offset = 180;
      file_offset = virt_offset;
      file_offset.14 = (unsigned int) file_offset;
      secth[1].sh_offset = file_offset.14;
      D.23603 = secth[1].sh_offset;
      secth[1].sh_addr = D.23603;
      D.23604 = *hash;
      D.23605 = D.23604 + 2;
      D.23606 = hash + 4;
      D.23607 = *D.23606;
      D.23608 = D.23605 + D.23607;
      D.23609 = (unsigned int) D.23608;
      D.23610 = D.23609 * 4;
      size.15 = (int) D.23610;
      size = size.15;
      size.16 = size;
      file_offset = file_offset + size.16;
      virt_offset = file_offset;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[1].sh_size = size.17;
      file_offset.14 = (unsigned int) file_offset;
      secth[2].sh_offset = file_offset.14;
      D.23614 = secth[2].sh_offset;
      secth[2].sh_addr = D.23614;
      D.23606 = hash + 4;
      D.23607 = *D.23606;
      D.23615 = (unsigned int) D.23607;
      D.23616 = D.23615 * 16;
      size.18 = (int) D.23616;
      size = size.18;
      size.16 = size;
      file_offset = file_offset + size.16;
      virt_offset = file_offset;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[2].sh_size = size.17;
      file_offset.14 = (unsigned int) file_offset;
      secth[3].sh_offset = file_offset.14;
      D.23618 = secth[3].sh_offset;
      secth[3].sh_addr = D.23618;
      D.23619 = dyn_str_table.data;
      D.23620 = D.23619->len;
      size.19 = (int) D.23620;
      size = size.19;
      size.16 = size;
      file_offset = file_offset + size.16;
      virt_offset = file_offset;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[3].sh_size = size.17;
      file_offset = file_offset + 3;
      file_offset = file_offset & -4;
      file_offset.14 = (unsigned int) file_offset;
      secth[4].sh_offset = file_offset.14;
      D.23622 = secth[4].sh_offset;
      secth[4].sh_addr = D.23622;
      D.23623 = acfg->num_relocs;
      D.23624 = (unsigned int) D.23623;
      D.23625 = D.23624 * 8;
      size.20 = (int) D.23625;
      size = size.20;
      size.16 = size;
      file_offset = file_offset + size.16;
      virt_offset = file_offset;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[4].sh_size = size.17;
      file_offset.14 = (unsigned int) file_offset;
      secth[5].sh_offset = file_offset.14;
      D.23627 = secth[5].sh_offset;
      secth[5].sh_addr = D.23627;
      size = 0;
      size.16 = size;
      file_offset = file_offset + size.16;
      virt_offset = file_offset;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[5].sh_size = size.17;
      D.23628 = secth[6].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23630 = D.23628 + file_offset.21;
      D.23631 = D.23630 + 4294967295;
      D.23628 = secth[6].sh_addralign;
      D.23632 = -D.23628;
      D.23633 = D.23631 & D.23632;
      file_offset = (int) D.23633;
      virt_offset = file_offset;
      file_offset.14 = (unsigned int) file_offset;
      secth[6].sh_offset = file_offset.14;
      D.23634 = secth[6].sh_offset;
      secth[6].sh_addr = D.23634;
      D.23635 = sections[6];
      if (D.23635 != 0B) goto <D.23636>; else goto <D.23637>;
      <D.23636>:
      D.23635 = sections[6];
      D.23638 = D.23635->has_addr;
      if (D.23638 != 0) goto <D.23639>; else goto <D.23640>;
      <D.23639>:
      D.23635 = sections[6];
      D.23641 = D.23635->addr;
      D.23642 = (unsigned int) D.23641;
      secth[6].sh_addr = D.23642;
      D.23643 = secth[6].sh_flags;
      D.23644 = D.23643 & 4294967293;
      secth[6].sh_flags = D.23644;
      <D.23640>:
      D.23635 = sections[6];
      size.22 = D.23635->cur_offset;
      size = size.22;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[6].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      <D.23637>:
      D.23646 = secth[7].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23647 = D.23646 + file_offset.21;
      D.23648 = D.23647 + 4294967295;
      D.23646 = secth[7].sh_addralign;
      D.23649 = -D.23646;
      D.23650 = D.23648 & D.23649;
      file_offset = (int) D.23650;
      virt_offset = file_offset;
      virt_offset.23 = (unsigned int) virt_offset;
      secth[7].sh_addr = virt_offset.23;
      file_offset.14 = (unsigned int) file_offset;
      secth[7].sh_offset = file_offset.14;
      D.23652 = sections[7];
      if (D.23652 != 0B) goto <D.23653>; else goto <D.23654>;
      <D.23653>:
      D.23652 = sections[7];
      size.24 = D.23652->cur_offset;
      size = size.24;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[7].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      size.16 = size;
      virt_offset = virt_offset + size.16;
      <D.23654>:
      D.23656 = secth[8].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23657 = D.23656 + file_offset.21;
      D.23658 = D.23657 + 4294967295;
      D.23656 = secth[8].sh_addralign;
      D.23659 = -D.23656;
      D.23660 = D.23658 & D.23659;
      file_offset = (int) D.23660;
      virt_offset = file_offset;
      virt_offset = virt_offset + 4096;
      virt_offset.23 = (unsigned int) virt_offset;
      secth[8].sh_addr = virt_offset.23;
      file_offset.14 = (unsigned int) file_offset;
      secth[8].sh_offset = file_offset.14;
      size = 112;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[8].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      size.16 = size;
      virt_offset = virt_offset + size.16;
      D.23661 = secth[9].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23662 = D.23661 + file_offset.21;
      D.23663 = D.23662 + 4294967295;
      D.23661 = secth[9].sh_addralign;
      D.23664 = -D.23661;
      D.23665 = D.23663 & D.23664;
      file_offset = (int) D.23665;
      D.23661 = secth[9].sh_addralign;
      virt_offset.25 = (unsigned int) virt_offset;
      D.23667 = D.23661 + virt_offset.25;
      D.23668 = D.23667 + 4294967295;
      D.23661 = secth[9].sh_addralign;
      D.23664 = -D.23661;
      D.23669 = D.23668 & D.23664;
      virt_offset = (int) D.23669;
      virt_offset.23 = (unsigned int) virt_offset;
      secth[9].sh_addr = virt_offset.23;
      file_offset.14 = (unsigned int) file_offset;
      secth[9].sh_offset = file_offset.14;
      size = 12;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[9].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      size.16 = size;
      virt_offset = virt_offset + size.16;
      D.23670 = secth[10].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23671 = D.23670 + file_offset.21;
      D.23672 = D.23671 + 4294967295;
      D.23670 = secth[10].sh_addralign;
      D.23673 = -D.23670;
      D.23674 = D.23672 & D.23673;
      file_offset = (int) D.23674;
      D.23670 = secth[10].sh_addralign;
      virt_offset.25 = (unsigned int) virt_offset;
      D.23675 = D.23670 + virt_offset.25;
      D.23676 = D.23675 + 4294967295;
      D.23670 = secth[10].sh_addralign;
      D.23673 = -D.23670;
      D.23677 = D.23676 & D.23673;
      virt_offset = (int) D.23677;
      virt_offset.23 = (unsigned int) virt_offset;
      secth[10].sh_addr = virt_offset.23;
      file_offset.14 = (unsigned int) file_offset;
      secth[10].sh_offset = file_offset.14;
      D.23678 = sections[10];
      if (D.23678 != 0B) goto <D.23679>; else goto <D.23680>;
      <D.23679>:
      D.23678 = sections[10];
      size.26 = D.23678->cur_offset;
      size = size.26;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[10].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      size.16 = size;
      virt_offset = virt_offset + size.16;
      <D.23680>:
      D.23682 = secth[11].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23683 = D.23682 + file_offset.21;
      D.23684 = D.23683 + 4294967295;
      D.23682 = secth[11].sh_addralign;
      D.23685 = -D.23682;
      D.23686 = D.23684 & D.23685;
      file_offset = (int) D.23686;
      D.23682 = secth[11].sh_addralign;
      virt_offset.25 = (unsigned int) virt_offset;
      D.23687 = D.23682 + virt_offset.25;
      D.23688 = D.23687 + 4294967295;
      D.23682 = secth[11].sh_addralign;
      D.23685 = -D.23682;
      D.23689 = D.23688 & D.23685;
      virt_offset = (int) D.23689;
      virt_offset.23 = (unsigned int) virt_offset;
      secth[11].sh_addr = virt_offset.23;
      file_offset.14 = (unsigned int) file_offset;
      secth[11].sh_offset = file_offset.14;
      D.23690 = sections[11];
      if (D.23690 != 0B) goto <D.23691>; else goto <D.23692>;
      <D.23691>:
      D.23690 = sections[11];
      size.27 = D.23690->cur_offset;
      size = size.27;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[11].sh_size = size.17;
      <D.23692>:
      D.23694 = secth[12].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23695 = D.23694 + file_offset.21;
      D.23696 = D.23695 + 4294967295;
      D.23694 = secth[12].sh_addralign;
      D.23697 = -D.23694;
      D.23698 = D.23696 & D.23697;
      file_offset = (int) D.23698;
      file_offset.14 = (unsigned int) file_offset;
      secth[12].sh_offset = file_offset.14;
      D.23699 = sections[12];
      if (D.23699 != 0B) goto <D.23700>; else goto <D.23701>;
      <D.23700>:
      D.23699 = sections[12];
      size.28 = D.23699->cur_offset;
      size = size.28;
      goto <D.23703>;
      <D.23701>:
      size = 0;
      <D.23703>:
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[12].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      file_offset.14 = (unsigned int) file_offset;
      secth[13].sh_offset = file_offset.14;
      D.23704 = sections[13];
      if (D.23704 != 0B) goto <D.23705>; else goto <D.23706>;
      <D.23705>:
      D.23704 = sections[13];
      size.29 = D.23704->cur_offset;
      size = size.29;
      goto <D.23708>;
      <D.23706>:
      size = 0;
      <D.23708>:
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[13].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      file_offset.14 = (unsigned int) file_offset;
      secth[14].sh_offset = file_offset.14;
      D.23709 = sections[14];
      if (D.23709 != 0B) goto <D.23710>; else goto <D.23711>;
      <D.23710>:
      D.23709 = sections[14];
      size.30 = D.23709->cur_offset;
      size = size.30;
      goto <D.23713>;
      <D.23711>:
      size = 0;
      <D.23713>:
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[14].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      file_offset.14 = (unsigned int) file_offset;
      secth[15].sh_offset = file_offset.14;
      D.23714 = sections[15];
      if (D.23714 != 0B) goto <D.23715>; else goto <D.23716>;
      <D.23715>:
      D.23714 = sections[15];
      size.31 = D.23714->cur_offset;
      size = size.31;
      goto <D.23718>;
      <D.23716>:
      size = 0;
      <D.23718>:
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[15].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      file_offset.14 = (unsigned int) file_offset;
      secth[16].sh_offset = file_offset.14;
      D.23719 = sections[16];
      if (D.23719 != 0B) goto <D.23720>; else goto <D.23721>;
      <D.23720>:
      D.23719 = sections[16];
      size.32 = D.23719->cur_offset;
      size = size.32;
      goto <D.23723>;
      <D.23721>:
      size = 0;
      <D.23723>:
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[16].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      D.23724 = secth[17].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23725 = D.23724 + file_offset.21;
      D.23726 = D.23725 + 4294967295;
      D.23724 = secth[17].sh_addralign;
      D.23727 = -D.23724;
      D.23728 = D.23726 & D.23727;
      file_offset = (int) D.23728;
      file_offset.14 = (unsigned int) file_offset;
      secth[17].sh_offset = file_offset.14;
      D.23729 = sh_str_table.data;
      D.23730 = D.23729->len;
      size.33 = (int) D.23730;
      size = size.33;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[17].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      D.23732 = secth[18].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23733 = D.23732 + file_offset.21;
      D.23734 = D.23733 + 4294967295;
      D.23732 = secth[18].sh_addralign;
      D.23735 = -D.23732;
      D.23736 = D.23734 & D.23735;
      file_offset = (int) D.23736;
      file_offset.14 = (unsigned int) file_offset;
      secth[18].sh_offset = file_offset.14;
      num_local_syms.34 = num_local_syms;
      num_local_syms.35 = (unsigned int) num_local_syms.34;
      D.23739 = num_local_syms.35 * 16;
      size.36 = (int) D.23739;
      size = size.36;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[18].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      D.23741 = secth[19].sh_addralign;
      file_offset.21 = (unsigned int) file_offset;
      D.23742 = D.23741 + file_offset.21;
      D.23743 = D.23742 + 4294967295;
      D.23741 = secth[19].sh_addralign;
      D.23744 = -D.23741;
      D.23745 = D.23743 & D.23744;
      file_offset = (int) D.23745;
      file_offset.14 = (unsigned int) file_offset;
      secth[19].sh_offset = file_offset.14;
      D.23746 = str_table.data;
      D.23747 = D.23746->len;
      size.37 = (int) D.23747;
      size = size.37;
      size.16 = size;
      size.17 = (unsigned int) size.16;
      secth[19].sh_size = size.17;
      size.16 = size;
      file_offset = file_offset + size.16;
      i = 1;
      goto <D.22758>;
      <D.22757>:
      D.23593 = section_info[i].esize;
      if (D.23593 != 0) goto <D.23749>; else goto <D.23750>;
      <D.23749>:
      D.23751 = secth[i].sh_size;
      D.23593 = section_info[i].esize;
      D.23594 = (unsigned int) D.23593;
      D.23752 = D.23751 % D.23594;
      D.23753 = D.23752 != 0;
      D.23754 = (long int) D.23753;
      D.23755 = __builtin_expect (D.23754, 0);
      if (D.23755 != 0) goto <D.23756>; else goto <D.23757>;
      <D.23756>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 1489, "secth [i].sh_size % section_info [i].esize == 0");
      <D.23757>:
      <D.23750>:
      i = i + 1;
      <D.22758>:
      if (i <= 19) goto <D.22757>; else goto <D.22759>;
      <D.22759>:
      file_offset = file_offset + 3;
      file_offset = file_offset & -4;
      header.e_ident[0] = 127;
      header.e_ident[1] = 69;
      header.e_ident[2] = 76;
      header.e_ident[3] = 70;
      header.e_ident[4] = 1;
      header.e_ident[5] = 1;
      header.e_ident[6] = 1;
      header.e_ident[7] = 0;
      header.e_ident[8] = 0;
      i = 9;
      goto <D.22761>;
      <D.22760>:
      header.e_ident[i] = 0;
      i = i + 1;
      <D.22761>:
      if (i <= 15) goto <D.22760>; else goto <D.22762>;
      <D.22762>:
      header.e_type = 3;
      monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "image-writer.c", 1515);
      header.e_version = 1;
      header.e_phoff = 52;
      header.e_ehsize = 52;
      header.e_phentsize = 32;
      header.e_phnum = 4;
      D.23758 = secth[6].sh_addr;
      header.e_entry = D.23758;
      header.e_shstrndx = 17;
      header.e_shentsize = 40;
      header.e_shnum = 20;
      file_offset.14 = (unsigned int) file_offset;
      header.e_shoff = file_offset.14;
      i = 0;
      dynamic[i].d_tag = 4;
      D.23603 = secth[1].sh_offset;
      dynamic[i].d_un.d_val = D.23603;
      i = i + 1;
      dynamic[i].d_tag = 5;
      D.23618 = secth[3].sh_offset;
      dynamic[i].d_un.d_val = D.23618;
      i = i + 1;
      dynamic[i].d_tag = 6;
      D.23614 = secth[2].sh_offset;
      dynamic[i].d_un.d_val = D.23614;
      i = i + 1;
      dynamic[i].d_tag = 10;
      D.23619 = dyn_str_table.data;
      D.23620 = D.23619->len;
      dynamic[i].d_un.d_val = D.23620;
      i = i + 1;
      dynamic[i].d_tag = 11;
      dynamic[i].d_un.d_val = 16;
      i = i + 1;
      dynamic[i].d_tag = 17;
      D.23622 = secth[4].sh_offset;
      dynamic[i].d_un.d_val = D.23622;
      i = i + 1;
      dynamic[i].d_tag = 18;
      D.23759 = secth[4].sh_size;
      dynamic[i].d_un.d_val = D.23759;
      i = i + 1;
      dynamic[i].d_tag = 19;
      dynamic[i].d_un.d_val = 8;
      i = i + 1;
      dynamic[i].d_tag = 1879048186;
      D.23623 = acfg->num_relocs;
      D.23760 = (unsigned int) D.23623;
      dynamic[i].d_un.d_val = D.23760;
      i = i + 1;
      memset (&progh, 0, 128);
      progh[0].p_type = 1;
      D.23761 = secth[8].sh_offset;
      progh[0].p_memsz = D.23761;
      D.23762 = progh[0].p_memsz;
      progh[0].p_filesz = D.23762;
      progh[0].p_align = 4096;
      progh[0].p_flags = 5;
      progh[1].p_type = 1;
      D.23761 = secth[8].sh_offset;
      progh[1].p_offset = D.23761;
      D.23763 = secth[8].sh_addr;
      progh[1].p_paddr = D.23763;
      D.23764 = progh[1].p_paddr;
      progh[1].p_vaddr = D.23764;
      D.23765 = secth[11].sh_offset;
      D.23761 = secth[8].sh_offset;
      D.23766 = D.23765 - D.23761;
      progh[1].p_filesz = D.23766;
      D.23767 = secth[11].sh_addr;
      D.23768 = secth[11].sh_size;
      D.23769 = D.23767 + D.23768;
      D.23763 = secth[8].sh_addr;
      D.23770 = D.23769 - D.23763;
      progh[1].p_memsz = D.23770;
      progh[1].p_align = 4096;
      progh[1].p_flags = 6;
      progh[2].p_type = 2;
      D.23761 = secth[8].sh_offset;
      progh[2].p_offset = D.23761;
      D.23763 = secth[8].sh_addr;
      progh[2].p_paddr = D.23763;
      D.23771 = progh[2].p_paddr;
      progh[2].p_vaddr = D.23771;
      D.23772 = secth[8].sh_size;
      progh[2].p_memsz = D.23772;
      D.23773 = progh[2].p_memsz;
      progh[2].p_filesz = D.23773;
      progh[2].p_align = 4;
      progh[2].p_flags = 6;
      progh[3].p_type = 1685382481;
      D.23761 = secth[8].sh_offset;
      progh[3].p_offset = D.23761;
      D.23763 = secth[8].sh_addr;
      progh[3].p_paddr = D.23763;
      D.23774 = progh[3].p_paddr;
      progh[3].p_vaddr = D.23774;
      D.23772 = secth[8].sh_size;
      progh[3].p_memsz = D.23772;
      D.23775 = progh[3].p_memsz;
      progh[3].p_filesz = D.23775;
      progh[3].p_align = 4;
      progh[3].p_flags = 6;
      i = 0;
      goto <D.22764>;
      <D.22763>:
      D.23776 = sections[i];
      if (D.23776 != 0B) goto <D.23777>; else goto <D.23778>;
      <D.23777>:
      D.23776 = sections[i];
      D.23779 = secth[i].sh_offset;
      D.23780 = (int) D.23779;
      D.23776->file_offset = D.23780;
      D.23776 = sections[i];
      D.23781 = secth[i].sh_addr;
      D.23782 = (int) D.23781;
      D.23776->virt_offset = D.23782;
      <D.23778>:
      i = i + 1;
      <D.22764>:
      if (i <= 19) goto <D.22763>; else goto <D.22765>;
      <D.22765>:
      reloc_symbols (acfg, dynsym, &secth, &dyn_str_table, 1);
      reloc_symbols (acfg, symtab, &secth, &str_table, 0);
      relocs = resolve_relocations (acfg);
      D.23783 = acfg->fp;
      if (D.23783 == 0B) goto <D.23784>; else goto <D.23785>;
      <D.23784>:
      file_offset.38 = (unsigned int) file_offset;
      D.23787 = file_offset.38 + 800;
      D.23788 = (int) D.23787;
      acfg->out_buf_size = D.23788;
      D.23789 = acfg->out_buf_size;
      D.23790 = (unsigned int) D.23789;
      D.23791 = monoeg_malloc (D.23790);
      acfg->out_buf = D.23791;
      <D.23785>:
      bin_writer_fwrite (acfg, &header, 52, 1);
      bin_writer_fwrite (acfg, &progh, 128, 1);
      D.23604 = *hash;
      D.23606 = hash + 4;
      D.23607 = *D.23606;
      D.23792 = D.23604 + D.23607;
      D.23793 = D.23792 + 2;
      D.23794 = (unsigned int) D.23793;
      D.23795 = D.23794 * 4;
      bin_writer_fwrite (acfg, hash, D.23795, 1);
      D.23606 = hash + 4;
      D.23607 = *D.23606;
      D.23615 = (unsigned int) D.23607;
      D.23616 = D.23615 * 16;
      bin_writer_fwrite (acfg, dynsym, D.23616, 1);
      D.23619 = dyn_str_table.data;
      D.23796 = D.23619->str;
      D.23619 = dyn_str_table.data;
      D.23620 = D.23619->len;
      bin_writer_fwrite (acfg, D.23796, D.23620, 1);
      D.23622 = secth[4].sh_offset;
      D.23797 = (int) D.23622;
      bin_writer_fseek (acfg, D.23797);
      D.23623 = acfg->num_relocs;
      D.23798 = (unsigned int) D.23623;
      bin_writer_fwrite (acfg, relocs, 8, D.23798);
      D.23627 = secth[5].sh_offset;
      D.23799 = (int) D.23627;
      bin_writer_fseek (acfg, D.23799);
      D.23800 = secth[5].sh_size;
      bin_writer_fwrite (acfg, relocs, D.23800, 1);
      D.23635 = sections[6];
      if (D.23635 != 0B) goto <D.23801>; else goto <D.23802>;
      <D.23801>:
      D.23634 = secth[6].sh_offset;
      D.23803 = (int) D.23634;
      bin_writer_fseek (acfg, D.23803);
      D.23635 = sections[6];
      D.23804 = D.23635->data;
      D.23635 = sections[6];
      size.22 = D.23635->cur_offset;
      size.39 = (unsigned int) size.22;
      bin_writer_fwrite (acfg, D.23804, size.39, 1);
      <D.23802>:
      D.23652 = sections[7];
      if (D.23652 != 0B) goto <D.23806>; else goto <D.23807>;
      <D.23806>:
      D.23808 = secth[7].sh_offset;
      D.23809 = (int) D.23808;
      bin_writer_fseek (acfg, D.23809);
      D.23652 = sections[7];
      D.23810 = D.23652->data;
      D.23652 = sections[7];
      size.24 = D.23652->cur_offset;
      size.40 = (unsigned int) size.24;
      bin_writer_fwrite (acfg, D.23810, size.40, 1);
      <D.23807>:
      D.23761 = secth[8].sh_offset;
      D.23812 = (int) D.23761;
      bin_writer_fseek (acfg, D.23812);
      bin_writer_fwrite (acfg, &dynamic, 112, 1);
      D.23763 = secth[8].sh_addr;
      size.41 = (int) D.23763;
      size = size.41;
      D.23814 = secth[9].sh_offset;
      D.23815 = (int) D.23814;
      bin_writer_fseek (acfg, D.23815);
      bin_writer_fwrite (acfg, &size, 4, 1);
      i = 0;
      goto <D.22768>;
      <D.22767>:
      {
        int sect;

        sect = normal_sections[i];
        D.23816 = sections[sect];
        if (D.23816 != 0B) goto <D.23817>; else goto <D.23818>;
        <D.23817>:
        D.23819 = secth[sect].sh_offset;
        D.23820 = (int) D.23819;
        bin_writer_fseek (acfg, D.23820);
        D.23816 = sections[sect];
        D.23821 = D.23816->data;
        D.23816 = sections[sect];
        D.23822 = D.23816->cur_offset;
        D.23823 = (unsigned int) D.23822;
        bin_writer_fwrite (acfg, D.23821, D.23823, 1);
        <D.23818>:
      }
      i = i + 1;
      <D.22768>:
      i.42 = (unsigned int) i;
      if (i.42 <= 5) goto <D.22767>; else goto <D.22769>;
      <D.22769>:
      D.23825 = secth[17].sh_offset;
      D.23826 = (int) D.23825;
      bin_writer_fseek (acfg, D.23826);
      D.23729 = sh_str_table.data;
      D.23827 = D.23729->str;
      D.23729 = sh_str_table.data;
      D.23730 = D.23729->len;
      bin_writer_fwrite (acfg, D.23827, D.23730, 1);
      D.23828 = secth[18].sh_offset;
      D.23829 = (int) D.23828;
      bin_writer_fseek (acfg, D.23829);
      num_local_syms.34 = num_local_syms;
      num_local_syms.35 = (unsigned int) num_local_syms.34;
      D.23739 = num_local_syms.35 * 16;
      bin_writer_fwrite (acfg, symtab, D.23739, 1);
      D.23830 = secth[19].sh_offset;
      D.23831 = (int) D.23830;
      bin_writer_fseek (acfg, D.23831);
      D.23746 = str_table.data;
      D.23832 = D.23746->str;
      D.23746 = str_table.data;
      D.23747 = D.23746->len;
      bin_writer_fwrite (acfg, D.23832, D.23747, 1);
      bin_writer_fseek (acfg, file_offset);
      bin_writer_fwrite (acfg, &secth, 800, 1);
      D.23783 = acfg->fp;
      if (D.23783 != 0B) goto <D.23833>; else goto <D.23834>;
      <D.23833>:
      D.23783 = acfg->fp;
      fclose (D.23783);
      <D.23834>:
      D.23835 = 0;
      return D.23835;
    }
  finally
    {
      header = {CLOBBER};
      progh = {CLOBBER};
      secth = {CLOBBER};
      str_table = {CLOBBER};
      sh_str_table = {CLOBBER};
      dyn_str_table = {CLOBBER};
      all_sections = {CLOBBER};
      sections = {CLOBBER};
      dynamic = {CLOBBER};
      size = {CLOBBER};
      num_local_syms = {CLOBBER};
    }
}


str_table_add (struct ElfStrTable * table, const char * value)
{
  struct GString * D.23838;
  struct GString * D.23841;
  struct GHashTable * D.23842;
  struct GHashTable * D.23843;
  void * D.23844;
  int D.23847;
  unsigned int D.23848;
  void * idx.43;
  int idx;

  D.23838 = table->data;
  if (D.23838 == 0B) goto <D.23839>; else goto <D.23840>;
  <D.23839>:
  D.23841 = monoeg_g_string_new_len ("", 1);
  table->data = D.23841;
  D.23842 = monoeg_g_hash_table_new (monoeg_g_str_hash, monoeg_g_str_equal);
  table->hash = D.23842;
  <D.23840>:
  D.23843 = table->hash;
  D.23844 = monoeg_g_hash_table_lookup (D.23843, value);
  idx = (int) D.23844;
  if (idx != 0) goto <D.23845>; else goto <D.23846>;
  <D.23845>:
  D.23847 = idx;
  return D.23847;
  <D.23846>:
  D.23838 = table->data;
  D.23848 = D.23838->len;
  idx = (int) D.23848;
  D.23838 = table->data;
  monoeg_g_string_append (D.23838, value);
  D.23838 = table->data;
  monoeg_g_string_append_c (D.23838, 0);
  D.23843 = table->hash;
  idx.43 = (void *) idx;
  monoeg_g_hash_table_insert_replace (D.23843, value, idx.43, 0);
  D.23847 = idx;
  return D.23847;
}


collect_sections (struct MonoImageWriter * acfg, struct ElfSectHeader * sheaders, struct BinSection * * out, int num)
{
  int D.23851;
  int num_sections.44;
  unsigned int num_sections.45;
  unsigned int D.23856;
  struct BinSection * * D.23857;
  _Bool D.23858;
  long int D.23859;
  long int D.23860;
  int D.22546;
  unsigned int i.46;
  unsigned int D.23866;
  struct BinSection * * D.23867;
  struct BinSection * D.23868;
  char * D.23869;
  char * D.23870;
  int D.23873;
  int i;
  int j;
  int maxs;
  int num_sections;
  struct BinSection * sect;

  num_sections = 0;
  maxs = 0;
  sect = acfg->sections;
  goto <D.22536>;
  <D.22535>:
  D.23851 = sect->subsection;
  if (D.23851 == 0) goto <D.23852>; else goto <D.23853>;
  <D.23852>:
  num_sections.44 = num_sections;
  num_sections = num_sections.44 + 1;
  num_sections.45 = (unsigned int) num_sections.44;
  D.23856 = num_sections.45 * 4;
  D.23857 = out + D.23856;
  *D.23857 = sect;
  D.23858 = num_sections >= num;
  D.23859 = (long int) D.23858;
  D.23860 = __builtin_expect (D.23859, 0);
  if (D.23860 != 0) goto <D.23861>; else goto <D.23862>;
  <D.23861>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 830, "num_sections < num");
  <D.23862>:
  <D.23853>:
  D.23851 = sect->subsection;
  maxs = MAX_EXPR <D.23851, maxs>;
  sect = sect->next;
  <D.22536>:
  if (sect != 0B) goto <D.22535>; else goto <D.22537>;
  <D.22537>:
  i = 0;
  goto <D.22554>;
  <D.22553>:
  j = 1;
  goto <D.22551>;
  <D.22550>:
  sect = acfg->sections;
  goto <D.22548>;
  <D.22547>:
  D.23851 = sect->subsection;
  if (D.23851 == j) goto <D.23863>; else goto <D.23864>;
  <D.23863>:
  {
    size_t __s1_len;
    size_t __s2_len;

    i.46 = (unsigned int) i;
    D.23866 = i.46 * 4;
    D.23867 = out + D.23866;
    D.23868 = *D.23867;
    D.23869 = D.23868->name;
    D.23870 = sect->name;
    D.22546 = __builtin_strcmp (D.23869, D.23870);
  }
  if (D.22546 == 0) goto <D.23871>; else goto <D.23872>;
  <D.23871>:
  i.46 = (unsigned int) i;
  D.23866 = i.46 * 4;
  D.23867 = out + D.23866;
  D.23868 = *D.23867;
  append_subsection (acfg, sheaders, D.23868, sect);
  <D.23872>:
  <D.23864>:
  sect = sect->next;
  <D.22548>:
  if (sect != 0B) goto <D.22547>; else goto <D.22549>;
  <D.22549>:
  j = j + 1;
  <D.22551>:
  if (j <= maxs) goto <D.22550>; else goto <D.22552>;
  <D.22552>:
  i = i + 1;
  <D.22554>:
  if (i < num_sections) goto <D.22553>; else goto <D.22555>;
  <D.22555>:
  D.23873 = num_sections;
  return D.23873;
}


append_subsection (struct MonoImageWriter * acfg, struct ElfSectHeader * sheaders, struct BinSection * sect, struct BinSection * add)
{
  int D.22523;
  int iftmp.47;
  int D.22522;
  const char[12] * D.23878;
  unsigned char D.23879;
  int D.23880;
  unsigned char D.23881;
  int D.23882;
  const unsigned char * D.23887;
  unsigned char D.23888;
  int D.23889;
  const unsigned char * D.23890;
  unsigned char D.23891;
  int D.23892;
  const unsigned char * D.23897;
  unsigned char D.23898;
  int D.23899;
  const unsigned char * D.23900;
  unsigned char D.23901;
  int D.23902;
  const unsigned char * D.23907;
  unsigned char D.23908;
  int D.23909;
  const unsigned char * D.23910;
  unsigned char D.23911;
  int D.23912;
  char * D.23914;
  int D.23917;
  guint8 * D.23918;
  int D.23919;
  sizetype D.23920;
  guint8 * D.23921;
  guint8 * D.23922;
  unsigned int D.23923;
  int D.23924;
  int offset;

  offset = sect->cur_offset;
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 11;
    if (__s2_len <= 3) goto <D.23876>; else goto <D.23877>;
    <D.23876>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = sect->name;
      D.23878 = ".debug_line";
      D.23879 = MEM[(const unsigned char *)D.23878];
      D.23880 = (int) D.23879;
      D.23881 = *__s2;
      D.23882 = (int) D.23881;
      __result = D.23880 - D.23882;
      {
        if (__s2_len != 0) goto <D.23883>; else goto <D.23884>;
        <D.23883>:
        if (__result == 0) goto <D.23885>; else goto <D.23886>;
        <D.23885>:
        D.23887 = &MEM[(void *)".debug_line" + 1B];
        D.23888 = *D.23887;
        D.23889 = (int) D.23888;
        D.23890 = __s2 + 1;
        D.23891 = *D.23890;
        D.23892 = (int) D.23891;
        __result = D.23889 - D.23892;
        if (__s2_len > 1) goto <D.23893>; else goto <D.23894>;
        <D.23893>:
        if (__result == 0) goto <D.23895>; else goto <D.23896>;
        <D.23895>:
        D.23897 = &MEM[(void *)".debug_line" + 2B];
        D.23898 = *D.23897;
        D.23899 = (int) D.23898;
        D.23900 = __s2 + 2;
        D.23901 = *D.23900;
        D.23902 = (int) D.23901;
        __result = D.23899 - D.23902;
        if (__s2_len > 2) goto <D.23903>; else goto <D.23904>;
        <D.23903>:
        if (__result == 0) goto <D.23905>; else goto <D.23906>;
        <D.23905>:
        D.23907 = &MEM[(void *)".debug_line" + 3B];
        D.23908 = *D.23907;
        D.23909 = (int) D.23908;
        D.23910 = __s2 + 3;
        D.23911 = *D.23910;
        D.23912 = (int) D.23911;
        __result = D.23909 - D.23912;
        <D.23906>:
        <D.23904>:
        <D.23896>:
        <D.23894>:
        <D.23886>:
        <D.23884>:
      }
      D.22522 = __result;
    }
    iftmp.47 = -D.22522;
    goto <D.23913>;
    <D.23877>:
    D.23914 = sect->name;
    iftmp.47 = __builtin_strcmp (D.23914, ".debug_line");
    <D.23913>:
    D.22523 = iftmp.47;
  }
  if (D.22523 != 0) goto <D.23915>; else goto <D.23916>;
  <D.23915>:
  offset = offset + 7;
  offset = offset & -8;
  <D.23916>:
  bin_writer_emit_ensure_buffer (sect, offset);
  sect->cur_offset = offset;
  D.23917 = add->cur_offset;
  bin_writer_emit_ensure_buffer (sect, D.23917);
  D.23918 = sect->data;
  D.23919 = sect->cur_offset;
  D.23920 = (sizetype) D.23919;
  D.23921 = D.23918 + D.23920;
  D.23922 = add->data;
  D.23917 = add->cur_offset;
  D.23923 = (unsigned int) D.23917;
  memcpy (D.23921, D.23922, D.23923);
  add->parent = sect;
  D.23919 = sect->cur_offset;
  D.23917 = add->cur_offset;
  D.23924 = D.23919 + D.23917;
  sect->cur_offset = D.23924;
  add->cur_offset = offset;
  add->data = 0B;
  add->data_len = 0;
}


build_hash (struct MonoImageWriter * acfg, int num_sections, struct ElfStrTable * dynstr)
{
  int D.23925;
  char * D.23928;
  int D.23929;
  unsigned int D.23930;
  unsigned int D.23931;
  int * D.23932;
  int * D.23933;
  int * data;
  int num_symbols;
  struct BinSymbol * symbol;

  num_symbols = num_sections + 4;
  symbol = acfg->symbols;
  goto <D.22574>;
  <D.22573>:
  D.23925 = symbol->is_global;
  if (D.23925 == 0) goto <D.23926>; else goto <D.23927>;
  <D.23926>:
  // predicted unlikely by continue predictor.
  goto <D.22572>;
  <D.23927>:
  num_symbols = num_symbols + 1;
  D.23928 = symbol->name;
  str_table_add (dynstr, D.23928);
  <D.22572>:
  symbol = symbol->next;
  <D.22574>:
  if (symbol != 0B) goto <D.22573>; else goto <D.22575>;
  <D.22575>:
  str_table_add (dynstr, "__bss_start");
  str_table_add (dynstr, "_edata");
  str_table_add (dynstr, "_end");
  D.23929 = num_symbols + 19;
  D.23930 = (unsigned int) D.23929;
  D.23931 = D.23930 * 4;
  data = monoeg_malloc0 (D.23931);
  *data = 17;
  D.23932 = data + 4;
  *D.23932 = num_symbols;
  D.23933 = data;
  return D.23933;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.23937;
  int D.23942;
  void * D.23944;
  unsigned int D.23945;

  D.23937 = __builtin_constant_p (__len);
  if (D.23937 != 0) goto <D.23938>; else goto <D.23939>;
  <D.23938>:
  if (__len == 0) goto <D.23940>; else goto <D.23941>;
  <D.23940>:
  D.23942 = __builtin_constant_p (__ch);
  if (D.23942 == 0) goto <D.23935>; else goto <D.23943>;
  <D.23943>:
  if (__ch != 0) goto <D.23935>; else goto <D.23936>;
  <D.23935>:
  __warn_memset_zero_len ();
  D.23944 = __dest;
  return D.23944;
  <D.23936>:
  <D.23941>:
  <D.23939>:
  D.23945 = __builtin_object_size (__dest, 0);
  D.23944 = __builtin___memset_chk (__dest, __ch, __len, D.23945);
  return D.23944;
}


collect_syms (struct MonoImageWriter * acfg, int * hash, struct ElfStrTable * strtab, struct ElfSectHeader * sheaders, int * num_syms)
{
  int * D.23949;
  int D.23950;
  unsigned int D.23951;
  unsigned int D.23952;
  int D.23954;
  unsigned int D.23955;
  unsigned int D.23956;
  unsigned int i.48;
  unsigned int D.23960;
  struct ElfSymbol * D.23961;
  short unsigned int D.23962;
  unsigned int j.49;
  unsigned int D.23964;
  struct ElfSectHeader * D.23965;
  unsigned int D.23966;
  struct BinSection * D.23968;
  int D.22615;
  int iftmp.50;
  int D.22614;
  const char[6] * D.23974;
  unsigned char D.23975;
  int D.23976;
  unsigned char D.23977;
  int D.23978;
  const unsigned char * D.23983;
  unsigned char D.23984;
  int D.23985;
  const unsigned char * D.23986;
  unsigned char D.23987;
  int D.23988;
  const unsigned char * D.23993;
  unsigned char D.23994;
  int D.23995;
  const unsigned char * D.23996;
  unsigned char D.23997;
  int D.23998;
  const unsigned char * D.24003;
  unsigned char D.24004;
  int D.24005;
  const unsigned char * D.24006;
  unsigned char D.24007;
  int D.24008;
  char * D.24010;
  int D.24013;
  unsigned int D.24014;
  int D.22624;
  int iftmp.51;
  int D.22623;
  const char[8] * D.24019;
  unsigned char D.24020;
  int D.24021;
  unsigned char D.24022;
  int D.24023;
  const unsigned char * D.24028;
  unsigned char D.24029;
  int D.24030;
  const unsigned char * D.24031;
  unsigned char D.24032;
  int D.24033;
  const unsigned char * D.24038;
  unsigned char D.24039;
  int D.24040;
  const unsigned char * D.24041;
  unsigned char D.24042;
  int D.24043;
  const unsigned char * D.24048;
  unsigned char D.24049;
  int D.24050;
  const unsigned char * D.24051;
  unsigned char D.24052;
  int D.24053;
  int D.22633;
  int iftmp.52;
  int D.22632;
  const char[6] * D.24061;
  unsigned char D.24062;
  int D.24063;
  unsigned char D.24064;
  int D.24065;
  const unsigned char * D.24070;
  unsigned char D.24071;
  int D.24072;
  const unsigned char * D.24073;
  unsigned char D.24074;
  int D.24075;
  const unsigned char * D.24080;
  unsigned char D.24081;
  int D.24082;
  const unsigned char * D.24083;
  unsigned char D.24084;
  int D.24085;
  const unsigned char * D.24090;
  unsigned char D.24091;
  int D.24092;
  const unsigned char * D.24093;
  unsigned char D.24094;
  int D.24095;
  int D.22642;
  int iftmp.53;
  int D.22641;
  const char[5] * D.24103;
  unsigned char D.24104;
  int D.24105;
  unsigned char D.24106;
  int D.24107;
  const unsigned char * D.24112;
  unsigned char D.24113;
  int D.24114;
  const unsigned char * D.24115;
  unsigned char D.24116;
  int D.24117;
  const unsigned char * D.24122;
  unsigned char D.24123;
  int D.24124;
  const unsigned char * D.24125;
  unsigned char D.24126;
  int D.24127;
  const unsigned char * D.24132;
  unsigned char D.24133;
  int D.24134;
  const unsigned char * D.24135;
  unsigned char D.24136;
  int D.24137;
  int D.24141;
  unsigned char iftmp.54;
  unsigned char iftmp.55;
  int D.24151;
  unsigned char D.24155;
  char * D.24156;
  int D.24157;
  unsigned int D.24158;
  Elf32_Half iftmp.56;
  int D.24162;
  int D.24164;
  struct GHashTable * D.24165;
  int D.24168;
  int D.24169;
  int D.24170;
  int D.24171;
  unsigned int D.24172;
  int D.24174;
  unsigned int D.24175;
  char * D.24176;
  _Bool D.24179;
  long int D.24180;
  long int D.24181;
  int D.24184;
  int D.24185;
  int D.24186;
  unsigned int D.24187;
  int D.24188;
  unsigned int D.24189;
  int D.24190;
  unsigned int D.24191;
  int D.24192;
  unsigned int D.24193;
  int D.24198;
  sizetype D.24199;
  sizetype D.24200;
  sizetype D.24201;
  unsigned int D.24202;
  struct GString * D.24205;
  char * D.24206;
  const unsigned char * D.24207;
  long unsigned int D.24208;
  long unsigned int D.24209;
  unsigned int slot.57;
  unsigned int D.24211;
  int * D.24212;
  int D.24213;
  unsigned int D.24216;
  int * D.24217;
  struct ElfSymbol * D.24219;
  struct ElfSymbol * symbols;
  struct BinSymbol * symbol;
  struct BinSection * section;
  int i;
  int * bucket;
  int * chain;
  long unsigned int hashc;

  if (hash != 0B) goto <D.23947>; else goto <D.23948>;
  <D.23947>:
  D.23949 = hash + 4;
  D.23950 = *D.23949;
  D.23951 = (unsigned int) D.23950;
  D.23952 = D.23951 * 16;
  symbols = monoeg_malloc0 (D.23952);
  goto <D.23953>;
  <D.23948>:
  i = 0;
  symbol = acfg->symbols;
  goto <D.22600>;
  <D.22599>:
  i = i + 1;
  symbol = symbol->next;
  <D.22600>:
  if (symbol != 0B) goto <D.22599>; else goto <D.22601>;
  <D.22601>:
  D.23954 = i + 30;
  D.23955 = (unsigned int) D.23954;
  D.23956 = D.23955 * 16;
  symbols = monoeg_malloc0 (D.23956);
  <D.23953>:
  i = 1;
  if (sheaders != 0B) goto <D.23957>; else goto <D.23958>;
  <D.23957>:
  {
    int j;

    j = 1;
    goto <D.22604>;
    <D.22603>:
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.23961->st_info = 3;
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.23962 = (short unsigned int) j;
    D.23961->st_shndx = D.23962;
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    j.49 = (unsigned int) j;
    D.23964 = j.49 * 40;
    D.23965 = sheaders + D.23964;
    D.23966 = D.23965->sh_addr;
    D.23961->st_value = D.23966;
    i = i + 1;
    j = j + 1;
    <D.22604>:
    if (j <= 19) goto <D.22603>; else goto <D.22605>;
    <D.22605>:
  }
  goto <D.23967>;
  <D.23958>:
  section = acfg->sections;
  goto <D.22644>;
  <D.22643>:
  D.23968 = section->parent;
  if (D.23968 != 0B) goto <D.23969>; else goto <D.23970>;
  <D.23969>:
  // predicted unlikely by continue predictor.
  goto <D.22606>;
  <D.23970>:
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_info = 3;
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.23972>; else goto <D.23973>;
    <D.23972>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = section->name;
      D.23974 = ".text";
      D.23975 = MEM[(const unsigned char *)D.23974];
      D.23976 = (int) D.23975;
      D.23977 = *__s2;
      D.23978 = (int) D.23977;
      __result = D.23976 - D.23978;
      {
        if (__s2_len != 0) goto <D.23979>; else goto <D.23980>;
        <D.23979>:
        if (__result == 0) goto <D.23981>; else goto <D.23982>;
        <D.23981>:
        D.23983 = &MEM[(void *)".text" + 1B];
        D.23984 = *D.23983;
        D.23985 = (int) D.23984;
        D.23986 = __s2 + 1;
        D.23987 = *D.23986;
        D.23988 = (int) D.23987;
        __result = D.23985 - D.23988;
        if (__s2_len > 1) goto <D.23989>; else goto <D.23990>;
        <D.23989>:
        if (__result == 0) goto <D.23991>; else goto <D.23992>;
        <D.23991>:
        D.23993 = &MEM[(void *)".text" + 2B];
        D.23994 = *D.23993;
        D.23995 = (int) D.23994;
        D.23996 = __s2 + 2;
        D.23997 = *D.23996;
        D.23998 = (int) D.23997;
        __result = D.23995 - D.23998;
        if (__s2_len > 2) goto <D.23999>; else goto <D.24000>;
        <D.23999>:
        if (__result == 0) goto <D.24001>; else goto <D.24002>;
        <D.24001>:
        D.24003 = &MEM[(void *)".text" + 3B];
        D.24004 = *D.24003;
        D.24005 = (int) D.24004;
        D.24006 = __s2 + 3;
        D.24007 = *D.24006;
        D.24008 = (int) D.24007;
        __result = D.24005 - D.24008;
        <D.24002>:
        <D.24000>:
        <D.23992>:
        <D.23990>:
        <D.23982>:
        <D.23980>:
      }
      D.22614 = __result;
    }
    iftmp.50 = -D.22614;
    goto <D.24009>;
    <D.23973>:
    D.24010 = section->name;
    iftmp.50 = __builtin_strcmp (D.24010, ".text");
    <D.24009>:
    D.22615 = iftmp.50;
  }
  if (D.22615 == 0) goto <D.24011>; else goto <D.24012>;
  <D.24011>:
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_shndx = 6;
  section->shidx = 6;
  section->file_offset = 4096;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.24013 = section->virt_offset;
  D.24014 = (unsigned int) D.24013;
  D.23961->st_value = D.24014;
  goto <D.24015>;
  <D.24012>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 7;
    if (__s2_len <= 3) goto <D.24017>; else goto <D.24018>;
    <D.24017>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = section->name;
      D.24019 = ".rodata";
      D.24020 = MEM[(const unsigned char *)D.24019];
      D.24021 = (int) D.24020;
      D.24022 = *__s2;
      D.24023 = (int) D.24022;
      __result = D.24021 - D.24023;
      {
        if (__s2_len != 0) goto <D.24024>; else goto <D.24025>;
        <D.24024>:
        if (__result == 0) goto <D.24026>; else goto <D.24027>;
        <D.24026>:
        D.24028 = &MEM[(void *)".rodata" + 1B];
        D.24029 = *D.24028;
        D.24030 = (int) D.24029;
        D.24031 = __s2 + 1;
        D.24032 = *D.24031;
        D.24033 = (int) D.24032;
        __result = D.24030 - D.24033;
        if (__s2_len > 1) goto <D.24034>; else goto <D.24035>;
        <D.24034>:
        if (__result == 0) goto <D.24036>; else goto <D.24037>;
        <D.24036>:
        D.24038 = &MEM[(void *)".rodata" + 2B];
        D.24039 = *D.24038;
        D.24040 = (int) D.24039;
        D.24041 = __s2 + 2;
        D.24042 = *D.24041;
        D.24043 = (int) D.24042;
        __result = D.24040 - D.24043;
        if (__s2_len > 2) goto <D.24044>; else goto <D.24045>;
        <D.24044>:
        if (__result == 0) goto <D.24046>; else goto <D.24047>;
        <D.24046>:
        D.24048 = &MEM[(void *)".rodata" + 3B];
        D.24049 = *D.24048;
        D.24050 = (int) D.24049;
        D.24051 = __s2 + 3;
        D.24052 = *D.24051;
        D.24053 = (int) D.24052;
        __result = D.24050 - D.24053;
        <D.24047>:
        <D.24045>:
        <D.24037>:
        <D.24035>:
        <D.24027>:
        <D.24025>:
      }
      D.22623 = __result;
    }
    iftmp.51 = -D.22623;
    goto <D.24054>;
    <D.24018>:
    D.24010 = section->name;
    iftmp.51 = __builtin_strcmp (D.24010, ".rodata");
    <D.24054>:
    D.22624 = iftmp.51;
  }
  if (D.22624 == 0) goto <D.24055>; else goto <D.24056>;
  <D.24055>:
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_shndx = 7;
  section->shidx = 7;
  section->file_offset = 4096;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.24013 = section->virt_offset;
  D.24014 = (unsigned int) D.24013;
  D.23961->st_value = D.24014;
  goto <D.24057>;
  <D.24056>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 5;
    if (__s2_len <= 3) goto <D.24059>; else goto <D.24060>;
    <D.24059>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = section->name;
      D.24061 = ".data";
      D.24062 = MEM[(const unsigned char *)D.24061];
      D.24063 = (int) D.24062;
      D.24064 = *__s2;
      D.24065 = (int) D.24064;
      __result = D.24063 - D.24065;
      {
        if (__s2_len != 0) goto <D.24066>; else goto <D.24067>;
        <D.24066>:
        if (__result == 0) goto <D.24068>; else goto <D.24069>;
        <D.24068>:
        D.24070 = &MEM[(void *)".data" + 1B];
        D.24071 = *D.24070;
        D.24072 = (int) D.24071;
        D.24073 = __s2 + 1;
        D.24074 = *D.24073;
        D.24075 = (int) D.24074;
        __result = D.24072 - D.24075;
        if (__s2_len > 1) goto <D.24076>; else goto <D.24077>;
        <D.24076>:
        if (__result == 0) goto <D.24078>; else goto <D.24079>;
        <D.24078>:
        D.24080 = &MEM[(void *)".data" + 2B];
        D.24081 = *D.24080;
        D.24082 = (int) D.24081;
        D.24083 = __s2 + 2;
        D.24084 = *D.24083;
        D.24085 = (int) D.24084;
        __result = D.24082 - D.24085;
        if (__s2_len > 2) goto <D.24086>; else goto <D.24087>;
        <D.24086>:
        if (__result == 0) goto <D.24088>; else goto <D.24089>;
        <D.24088>:
        D.24090 = &MEM[(void *)".data" + 3B];
        D.24091 = *D.24090;
        D.24092 = (int) D.24091;
        D.24093 = __s2 + 3;
        D.24094 = *D.24093;
        D.24095 = (int) D.24094;
        __result = D.24092 - D.24095;
        <D.24089>:
        <D.24087>:
        <D.24079>:
        <D.24077>:
        <D.24069>:
        <D.24067>:
      }
      D.22632 = __result;
    }
    iftmp.52 = -D.22632;
    goto <D.24096>;
    <D.24060>:
    D.24010 = section->name;
    iftmp.52 = __builtin_strcmp (D.24010, ".data");
    <D.24096>:
    D.22633 = iftmp.52;
  }
  if (D.22633 == 0) goto <D.24097>; else goto <D.24098>;
  <D.24097>:
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_shndx = 10;
  section->shidx = 10;
  section->file_offset = 4124;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.24013 = section->virt_offset;
  D.24014 = (unsigned int) D.24013;
  D.23961->st_value = D.24014;
  goto <D.24099>;
  <D.24098>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 4;
    if (__s2_len <= 3) goto <D.24101>; else goto <D.24102>;
    <D.24101>:
    {
      const unsigned char * __s2;
      int __result;

      __s2 = section->name;
      D.24103 = ".bss";
      D.24104 = MEM[(const unsigned char *)D.24103];
      D.24105 = (int) D.24104;
      D.24106 = *__s2;
      D.24107 = (int) D.24106;
      __result = D.24105 - D.24107;
      {
        if (__s2_len != 0) goto <D.24108>; else goto <D.24109>;
        <D.24108>:
        if (__result == 0) goto <D.24110>; else goto <D.24111>;
        <D.24110>:
        D.24112 = &MEM[(void *)".bss" + 1B];
        D.24113 = *D.24112;
        D.24114 = (int) D.24113;
        D.24115 = __s2 + 1;
        D.24116 = *D.24115;
        D.24117 = (int) D.24116;
        __result = D.24114 - D.24117;
        if (__s2_len > 1) goto <D.24118>; else goto <D.24119>;
        <D.24118>:
        if (__result == 0) goto <D.24120>; else goto <D.24121>;
        <D.24120>:
        D.24122 = &MEM[(void *)".bss" + 2B];
        D.24123 = *D.24122;
        D.24124 = (int) D.24123;
        D.24125 = __s2 + 2;
        D.24126 = *D.24125;
        D.24127 = (int) D.24126;
        __result = D.24124 - D.24127;
        if (__s2_len > 2) goto <D.24128>; else goto <D.24129>;
        <D.24128>:
        if (__result == 0) goto <D.24130>; else goto <D.24131>;
        <D.24130>:
        D.24132 = &MEM[(void *)".bss" + 3B];
        D.24133 = *D.24132;
        D.24134 = (int) D.24133;
        D.24135 = __s2 + 3;
        D.24136 = *D.24135;
        D.24137 = (int) D.24136;
        __result = D.24134 - D.24137;
        <D.24131>:
        <D.24129>:
        <D.24121>:
        <D.24119>:
        <D.24111>:
        <D.24109>:
      }
      D.22641 = __result;
    }
    iftmp.53 = -D.22641;
    goto <D.24138>;
    <D.24102>:
    D.24010 = section->name;
    iftmp.53 = __builtin_strcmp (D.24010, ".bss");
    <D.24138>:
    D.22642 = iftmp.53;
  }
  if (D.22642 == 0) goto <D.24139>; else goto <D.24140>;
  <D.24139>:
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_shndx = 11;
  section->shidx = 11;
  section->file_offset = 4132;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.24013 = section->virt_offset;
  D.24014 = (unsigned int) D.24013;
  D.23961->st_value = D.24014;
  <D.24140>:
  <D.24099>:
  <D.24057>:
  <D.24015>:
  i = i + 1;
  <D.22606>:
  section = section->next;
  <D.22644>:
  if (section != 0B) goto <D.22643>; else goto <D.22645>;
  <D.22645>:
  <D.23967>:
  symbol = acfg->symbols;
  goto <D.22651>;
  <D.22650>:
  {
    int offset;
    struct BinLabel * lab;

    D.24141 = symbol->is_global;
    if (D.24141 == 0) goto <D.24142>; else goto <D.24143>;
    <D.24142>:
    if (hash != 0B) goto <D.24144>; else goto <D.24145>;
    <D.24144>:
    // predicted unlikely by continue predictor.
    goto <D.22648>;
    <D.24145>:
    <D.24143>:
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.24141 = symbol->is_global;
    if (D.24141 != 0) goto <D.24147>; else goto <D.24148>;
    <D.24147>:
    iftmp.54 = 16;
    goto <D.24149>;
    <D.24148>:
    iftmp.54 = 0;
    <D.24149>:
    D.24151 = symbol->is_function;
    if (D.24151 != 0) goto <D.24152>; else goto <D.24153>;
    <D.24152>:
    iftmp.55 = 2;
    goto <D.24154>;
    <D.24153>:
    iftmp.55 = 1;
    <D.24154>:
    D.24155 = iftmp.54 + iftmp.55;
    D.23961->st_info = D.24155;
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.24156 = symbol->name;
    D.24157 = str_table_add (strtab, D.24156);
    D.24158 = (unsigned int) D.24157;
    D.23961->st_name = D.24158;
    section = symbol->section;
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.23968 = section->parent;
    if (D.23968 != 0B) goto <D.24160>; else goto <D.24161>;
    <D.24160>:
    D.23968 = section->parent;
    D.24162 = D.23968->shidx;
    iftmp.56 = (Elf32_Half) D.24162;
    goto <D.24163>;
    <D.24161>:
    D.24164 = section->shidx;
    iftmp.56 = (Elf32_Half) D.24164;
    <D.24163>:
    D.23961->st_shndx = iftmp.56;
    D.24165 = acfg->labels;
    D.24156 = symbol->name;
    lab = monoeg_g_hash_table_lookup (D.24165, D.24156);
    offset = lab->offset;
    D.23968 = section->parent;
    if (D.23968 != 0B) goto <D.24166>; else goto <D.24167>;
    <D.24166>:
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.23968 = section->parent;
    D.24168 = D.23968->virt_offset;
    D.24169 = section->cur_offset;
    D.24170 = D.24168 + D.24169;
    D.24171 = D.24170 + offset;
    D.24172 = (unsigned int) D.24171;
    D.23961->st_value = D.24172;
    goto <D.24173>;
    <D.24167>:
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.24013 = section->virt_offset;
    D.24174 = D.24013 + offset;
    D.24175 = (unsigned int) D.24174;
    D.23961->st_value = D.24175;
    <D.24173>:
    D.24176 = symbol->end_label;
    if (D.24176 != 0B) goto <D.24177>; else goto <D.24178>;
    <D.24177>:
    {
      struct BinLabel * elab;

      D.24165 = acfg->labels;
      D.24176 = symbol->end_label;
      elab = monoeg_g_hash_table_lookup (D.24165, D.24176);
      D.24179 = elab == 0B;
      D.24180 = (long int) D.24179;
      D.24181 = __builtin_expect (D.24180, 0);
      if (D.24181 != 0) goto <D.24182>; else goto <D.24183>;
      <D.24182>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 987, "elab");
      <D.24183>:
      i.48 = (unsigned int) i;
      D.23960 = i.48 * 16;
      D.23961 = symbols + D.23960;
      D.24184 = elab->offset;
      D.24185 = lab->offset;
      D.24186 = D.24184 - D.24185;
      D.24187 = (unsigned int) D.24186;
      D.23961->st_size = D.24187;
    }
    <D.24178>:
    i = i + 1;
  }
  <D.22648>:
  symbol = symbol->next;
  <D.22651>:
  if (symbol != 0B) goto <D.22650>; else goto <D.22652>;
  <D.22652>:
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.24188 = str_table_add (strtab, "__bss_start");
  D.24189 = (unsigned int) D.24188;
  D.23961->st_name = D.24189;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_shndx = 65521;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_info = 16;
  i = i + 1;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.24190 = str_table_add (strtab, "_edata");
  D.24191 = (unsigned int) D.24190;
  D.23961->st_name = D.24191;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_shndx = 65521;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_info = 16;
  i = i + 1;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.24192 = str_table_add (strtab, "_end");
  D.24193 = (unsigned int) D.24192;
  D.23961->st_name = D.24193;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_shndx = 65521;
  i.48 = (unsigned int) i;
  D.23960 = i.48 * 16;
  D.23961 = symbols + D.23960;
  D.23961->st_info = 16;
  i = i + 1;
  if (num_syms != 0B) goto <D.24194>; else goto <D.24195>;
  <D.24194>:
  *num_syms = i;
  <D.24195>:
  if (hash != 0B) goto <D.24196>; else goto <D.24197>;
  <D.24196>:
  bucket = hash + 8;
  D.24198 = *hash;
  D.24199 = (sizetype) D.24198;
  D.24200 = D.24199 + 2;
  D.24201 = D.24200 * 4;
  chain = hash + D.24201;
  i = 0;
  goto <D.22656>;
  <D.22655>:
  {
    int slot;

    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.24202 = D.23961->st_name;
    if (D.24202 == 0) goto <D.24203>; else goto <D.24204>;
    <D.24203>:
    // predicted unlikely by continue predictor.
    goto <D.22654>;
    <D.24204>:
    D.24205 = strtab->data;
    D.24206 = D.24205->str;
    i.48 = (unsigned int) i;
    D.23960 = i.48 * 16;
    D.23961 = symbols + D.23960;
    D.24202 = D.23961->st_name;
    D.24207 = D.24206 + D.24202;
    hashc = elf_hash (D.24207);
    D.24198 = *hash;
    D.24208 = (long unsigned int) D.24198;
    D.24209 = hashc % D.24208;
    slot = (int) D.24209;
    slot.57 = (unsigned int) slot;
    D.24211 = slot.57 * 4;
    D.24212 = bucket + D.24211;
    D.24213 = *D.24212;
    if (D.24213 != 0) goto <D.24214>; else goto <D.24215>;
    <D.24214>:
    i.48 = (unsigned int) i;
    D.24216 = i.48 * 4;
    D.24217 = chain + D.24216;
    slot.57 = (unsigned int) slot;
    D.24211 = slot.57 * 4;
    D.24212 = bucket + D.24211;
    D.24213 = *D.24212;
    *D.24217 = D.24213;
    slot.57 = (unsigned int) slot;
    D.24211 = slot.57 * 4;
    D.24212 = bucket + D.24211;
    *D.24212 = i;
    goto <D.24218>;
    <D.24215>:
    slot.57 = (unsigned int) slot;
    D.24211 = slot.57 * 4;
    D.24212 = bucket + D.24211;
    *D.24212 = i;
    <D.24218>:
  }
  <D.22654>:
  i = i + 1;
  <D.22656>:
  D.23949 = hash + 4;
  D.23950 = *D.23949;
  if (D.23950 > i) goto <D.22655>; else goto <D.22657>;
  <D.22657>:
  <D.24197>:
  D.24219 = symbols;
  return D.24219;
}


elf_hash (const unsigned char * name)
{
  long unsigned int D.24221;
  const unsigned char * name.58;
  unsigned char D.24223;
  long unsigned int D.24224;
  long unsigned int D.24227;
  long unsigned int D.24228;
  unsigned char D.24229;
  long unsigned int D.24230;
  long unsigned int h;
  long unsigned int g;

  h = 0;
  goto <D.22562>;
  <D.22561>:
  D.24221 = h << 4;
  name.58 = name;
  name = name.58 + 1;
  D.24223 = *name.58;
  D.24224 = (long unsigned int) D.24223;
  h = D.24221 + D.24224;
  g = h & 4026531840;
  if (g != 0) goto <D.24225>; else goto <D.24226>;
  <D.24225>:
  D.24227 = g >> 24;
  h = D.24227 ^ h;
  <D.24226>:
  D.24228 = ~g;
  h = D.24228 & h;
  <D.22562>:
  D.24229 = *name;
  if (D.24229 != 0) goto <D.22561>; else goto <D.22563>;
  <D.22563>:
  D.24230 = h;
  return D.24230;
}


asm_writer_emit_writeout (struct MonoImageWriter * acfg)
{
  struct FILE * D.24232;
  int D.24233;

  D.24232 = acfg->fp;
  fclose (D.24232);
  D.24233 = 0;
  return D.24233;
}


img_writer_emit_byte (struct MonoImageWriter * acfg, guint8 val)
{
  img_writer_emit_bytes (acfg, &val, 1);
}


img_writer_emit_reloc (struct MonoImageWriter * acfg, int reloc_type, const char * symbol, int addend)
{
  int D.24235;

  D.24235 = acfg->use_bin_writer;
  if (D.24235 != 0) goto <D.24236>; else goto <D.24237>;
  <D.24236>:
  bin_writer_emit_reloc (acfg, reloc_type, symbol, addend);
  goto <D.24238>;
  <D.24237>:
  monoeg_assertion_message ("* Assertion: should not be reached at %s:%d\n", "image-writer.c", 2268);
  <D.24238>:
}


bin_writer_emit_reloc (struct MonoImageWriter * acfg, int reloc_type, const char * symbol, int addend)
{
  struct BinReloc * reloc;

  reloc = create_reloc (acfg, symbol, ".", addend);
  reloc->reloc_type = reloc_type;
}


img_writer_emit_unset_mode (struct MonoImageWriter * acfg)
{
  int D.24239;

  D.24239 = acfg->use_bin_writer;
  if (D.24239 == 0) goto <D.24240>; else goto <D.24241>;
  <D.24240>:
  asm_writer_emit_unset_mode (acfg);
  <D.24241>:
}


img_writer_get_output (struct MonoImageWriter * acfg, guint32 * size)
{
  int D.24242;
  _Bool D.24243;
  long int D.24244;
  long int D.24245;
  int D.24248;
  unsigned int D.24249;
  guint8 * D.24250;
  guint8 * buf;

  D.24242 = acfg->use_bin_writer;
  D.24243 = D.24242 == 0;
  D.24244 = (long int) D.24243;
  D.24245 = __builtin_expect (D.24244, 0);
  if (D.24245 != 0) goto <D.24246>; else goto <D.24247>;
  <D.24246>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2299, "acfg->use_bin_writer");
  <D.24247>:
  buf = acfg->out_buf;
  D.24248 = acfg->out_buf_size;
  D.24249 = (unsigned int) D.24248;
  *size = D.24249;
  acfg->out_buf = 0B;
  D.24250 = buf;
  return D.24250;
}


bin_writer_supported ()
{
  gboolean D.24252;

  D.24252 = 1;
  return D.24252;
}


img_writer_create (struct FILE * fp, gboolean use_bin_writer)
{
  _Bool D.24256;
  long int D.24257;
  long int D.24258;
  struct MonoMemPool * D.24261;
  struct MonoImageWriter * D.24262;
  struct MonoImageWriter * w;

  w = monoeg_malloc0 (208);
  if (use_bin_writer == 0) goto <D.24254>; else goto <D.24255>;
  <D.24254>:
  D.24256 = fp == 0B;
  D.24257 = (long int) D.24256;
  D.24258 = __builtin_expect (D.24257, 0);
  if (D.24258 != 0) goto <D.24259>; else goto <D.24260>;
  <D.24259>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2341, "fp");
  <D.24260>:
  <D.24255>:
  w->fp = fp;
  w->use_bin_writer = use_bin_writer;
  D.24261 = mono_mempool_new ();
  w->mempool = D.24261;
  D.24262 = w;
  return D.24262;
}


img_writer_destroy (struct MonoImageWriter * w)
{
  struct MonoMemPool * D.24264;

  D.24264 = w->mempool;
  mono_mempool_destroy (D.24264);
  monoeg_g_free (w);
}


img_writer_subsections_supported (struct MonoImageWriter * acfg)
{
  gboolean D.24265;

  D.24265 = 1;
  return D.24265;
}


img_writer_get_fp (struct MonoImageWriter * acfg)
{
  struct FILE * D.24267;

  D.24267 = acfg->fp;
  return D.24267;
}


img_writer_get_temp_label_prefix (struct MonoImageWriter * acfg)
{
  const char * D.24269;

  D.24269 = ".L";
  return D.24269;
}


