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

  D.23772 = acfg->use_bin_writer;
  if (D.23772 != 0) goto <D.23773>; else goto <D.23774>;
  <D.23773>:
  bin_writer_emit_start (acfg);
  goto <D.23775>;
  <D.23774>:
  asm_writer_emit_start (acfg);
  <D.23775>:
}


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

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


asm_writer_emit_start (struct MonoImageWriter * acfg)
{

}


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

  D.23777 = acfg->use_bin_writer;
  if (D.23777 != 0) goto <D.23778>; else goto <D.23779>;
  <D.23778>:
  bin_writer_emit_section_change (acfg, section_name, subsection_index);
  goto <D.23780>;
  <D.23779>:
  asm_writer_emit_section_change (acfg, section_name, subsection_index);
  <D.23780>:
  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.23781;
  int D.23784;
  int D.23075;
  char * D.23787;
  int D.23790;
  int D.23084;
  char * D.23793;
  gchar * D.23798;
  struct BinSection * D.23799;
  struct BinSection * section;

  D.23781 = acfg->cur_section;
  if (D.23781 != 0B) goto <D.23782>; else goto <D.23783>;
  <D.23782>:
  D.23781 = acfg->cur_section;
  D.23784 = D.23781->subsection;
  if (D.23784 == subsection_index) goto <D.23785>; else goto <D.23786>;
  <D.23785>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.23781 = acfg->cur_section;
    D.23787 = D.23781->name;
    D.23075 = __builtin_strcmp (D.23787, section_name);
  }
  if (D.23075 == 0) goto <D.23788>; else goto <D.23789>;
  <D.23788>:
  return;
  <D.23789>:
  <D.23786>:
  <D.23783>:
  section = acfg->sections;
  goto <D.23086>;
  <D.23085>:
  D.23790 = section->subsection;
  if (D.23790 == subsection_index) goto <D.23791>; else goto <D.23792>;
  <D.23791>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.23793 = section->name;
    D.23084 = __builtin_strcmp (D.23793, section_name);
  }
  if (D.23084 == 0) goto <D.23794>; else goto <D.23795>;
  <D.23794>:
  acfg->cur_section = section;
  return;
  <D.23795>:
  <D.23792>:
  section = section->next;
  <D.23086>:
  if (section != 0B) goto <D.23085>; else goto <D.23087>;
  <D.23087>:
  if (section == 0B) goto <D.23796>; else goto <D.23797>;
  <D.23796>:
  section = monoeg_malloc0 (80);
  D.23798 = monoeg_strdup (section_name);
  section->name = D.23798;
  section->subsection = subsection_index;
  D.23799 = acfg->sections;
  section->next = D.23799;
  acfg->sections = section;
  acfg->cur_section = section;
  <D.23797>:
}


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

  if (str != 0B) goto <D.23801>; else goto <D.23802>;
  <D.23801>:
  D.23803 = __strdup (str);
  return D.23803;
  <D.23802>:
  D.23803 = 0B;
  return D.23803;
}


asm_writer_emit_section_change (struct MonoImageWriter * acfg, const char * section_name, int subsection_index)
{
  int D.23540;
  int iftmp.0;
  int D.23539;
  const char[6] * D.23811;
  unsigned char D.23812;
  int D.23813;
  unsigned char D.23814;
  int D.23815;
  _Bool D.23816;
  _Bool D.23817;
  _Bool D.23818;
  const unsigned char * D.23821;
  unsigned char D.23822;
  int D.23823;
  const unsigned char * D.23824;
  unsigned char D.23825;
  int D.23826;
  _Bool D.23827;
  _Bool D.23828;
  const unsigned char * D.23831;
  unsigned char D.23832;
  int D.23833;
  const unsigned char * D.23834;
  unsigned char D.23835;
  int D.23836;
  _Bool D.23837;
  _Bool D.23838;
  const unsigned char * D.23841;
  unsigned char D.23842;
  int D.23843;
  const unsigned char * D.23844;
  unsigned char D.23845;
  int D.23846;
  int D.23549;
  int iftmp.1;
  int D.23548;
  const char[6] * D.23852;
  unsigned char D.23853;
  int D.23854;
  unsigned char D.23855;
  int D.23856;
  _Bool D.23857;
  _Bool D.23858;
  _Bool D.23859;
  const unsigned char * D.23862;
  unsigned char D.23863;
  int D.23864;
  const unsigned char * D.23865;
  unsigned char D.23866;
  int D.23867;
  _Bool D.23868;
  _Bool D.23869;
  const unsigned char * D.23872;
  unsigned char D.23873;
  int D.23874;
  const unsigned char * D.23875;
  unsigned char D.23876;
  int D.23877;
  _Bool D.23878;
  _Bool D.23879;
  const unsigned char * D.23882;
  unsigned char D.23883;
  int D.23884;
  const unsigned char * D.23885;
  unsigned char D.23886;
  int D.23887;
  int D.23558;
  int iftmp.2;
  int D.23557;
  const char[5] * D.23893;
  unsigned char D.23894;
  int D.23895;
  unsigned char D.23896;
  int D.23897;
  _Bool D.23898;
  _Bool D.23899;
  _Bool D.23900;
  const unsigned char * D.23903;
  unsigned char D.23904;
  int D.23905;
  const unsigned char * D.23906;
  unsigned char D.23907;
  int D.23908;
  _Bool D.23909;
  _Bool D.23910;
  const unsigned char * D.23913;
  unsigned char D.23914;
  int D.23915;
  const unsigned char * D.23916;
  unsigned char D.23917;
  int D.23918;
  _Bool D.23919;
  _Bool D.23920;
  const unsigned char * D.23923;
  unsigned char D.23924;
  int D.23925;
  const unsigned char * D.23926;
  unsigned char D.23927;
  int D.23928;
  struct FILE * D.23930;

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

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

      __s2 = section_name;
      D.23811 = ".text";
      D.23812 = MEM[(const unsigned char *)D.23811];
      D.23813 = (int) D.23812;
      D.23814 = *__s2;
      D.23815 = (int) D.23814;
      __result = D.23813 - D.23815;
      {
        D.23816 = __s2_len != 0;
        D.23817 = __result == 0;
        D.23818 = D.23816 & D.23817;
        if (D.23818 != 0) goto <D.23819>; else goto <D.23820>;
        <D.23819>:
        D.23821 = &MEM[(void *)".text" + 1B];
        D.23822 = *D.23821;
        D.23823 = (int) D.23822;
        D.23824 = __s2 + 1;
        D.23825 = *D.23824;
        D.23826 = (int) D.23825;
        __result = D.23823 - D.23826;
        D.23827 = __s2_len > 1;
        D.23817 = __result == 0;
        D.23828 = D.23827 & D.23817;
        if (D.23828 != 0) goto <D.23829>; else goto <D.23830>;
        <D.23829>:
        D.23831 = &MEM[(void *)".text" + 2B];
        D.23832 = *D.23831;
        D.23833 = (int) D.23832;
        D.23834 = __s2 + 2;
        D.23835 = *D.23834;
        D.23836 = (int) D.23835;
        __result = D.23833 - D.23836;
        D.23837 = __s2_len > 2;
        D.23817 = __result == 0;
        D.23838 = D.23837 & D.23817;
        if (D.23838 != 0) goto <D.23839>; else goto <D.23840>;
        <D.23839>:
        D.23841 = &MEM[(void *)".text" + 3B];
        D.23842 = *D.23841;
        D.23843 = (int) D.23842;
        D.23844 = __s2 + 3;
        D.23845 = *D.23844;
        D.23846 = (int) D.23845;
        __result = D.23843 - D.23846;
        <D.23840>:
        <D.23830>:
        <D.23820>:
      }
      D.23539 = __result;
    }
    iftmp.0 = -D.23539;
    goto <D.23847>;
    <D.23810>:
    iftmp.0 = __builtin_strcmp (section_name, ".text");
    <D.23847>:
    D.23540 = iftmp.0;
  }
  if (D.23540 == 0) goto <D.23805>; else goto <D.23848>;
  <D.23848>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = section_name;
      D.23852 = ".data";
      D.23853 = MEM[(const unsigned char *)D.23852];
      D.23854 = (int) D.23853;
      D.23855 = *__s2;
      D.23856 = (int) D.23855;
      __result = D.23854 - D.23856;
      {
        D.23857 = __s2_len != 0;
        D.23858 = __result == 0;
        D.23859 = D.23857 & D.23858;
        if (D.23859 != 0) goto <D.23860>; else goto <D.23861>;
        <D.23860>:
        D.23862 = &MEM[(void *)".data" + 1B];
        D.23863 = *D.23862;
        D.23864 = (int) D.23863;
        D.23865 = __s2 + 1;
        D.23866 = *D.23865;
        D.23867 = (int) D.23866;
        __result = D.23864 - D.23867;
        D.23868 = __s2_len > 1;
        D.23858 = __result == 0;
        D.23869 = D.23868 & D.23858;
        if (D.23869 != 0) goto <D.23870>; else goto <D.23871>;
        <D.23870>:
        D.23872 = &MEM[(void *)".data" + 2B];
        D.23873 = *D.23872;
        D.23874 = (int) D.23873;
        D.23875 = __s2 + 2;
        D.23876 = *D.23875;
        D.23877 = (int) D.23876;
        __result = D.23874 - D.23877;
        D.23878 = __s2_len > 2;
        D.23858 = __result == 0;
        D.23879 = D.23878 & D.23858;
        if (D.23879 != 0) goto <D.23880>; else goto <D.23881>;
        <D.23880>:
        D.23882 = &MEM[(void *)".data" + 3B];
        D.23883 = *D.23882;
        D.23884 = (int) D.23883;
        D.23885 = __s2 + 3;
        D.23886 = *D.23885;
        D.23887 = (int) D.23886;
        __result = D.23884 - D.23887;
        <D.23881>:
        <D.23871>:
        <D.23861>:
      }
      D.23548 = __result;
    }
    iftmp.1 = -D.23548;
    goto <D.23888>;
    <D.23851>:
    iftmp.1 = __builtin_strcmp (section_name, ".data");
    <D.23888>:
    D.23549 = iftmp.1;
  }
  if (D.23549 == 0) goto <D.23805>; else goto <D.23889>;
  <D.23889>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = section_name;
      D.23893 = ".bss";
      D.23894 = MEM[(const unsigned char *)D.23893];
      D.23895 = (int) D.23894;
      D.23896 = *__s2;
      D.23897 = (int) D.23896;
      __result = D.23895 - D.23897;
      {
        D.23898 = __s2_len != 0;
        D.23899 = __result == 0;
        D.23900 = D.23898 & D.23899;
        if (D.23900 != 0) goto <D.23901>; else goto <D.23902>;
        <D.23901>:
        D.23903 = &MEM[(void *)".bss" + 1B];
        D.23904 = *D.23903;
        D.23905 = (int) D.23904;
        D.23906 = __s2 + 1;
        D.23907 = *D.23906;
        D.23908 = (int) D.23907;
        __result = D.23905 - D.23908;
        D.23909 = __s2_len > 1;
        D.23899 = __result == 0;
        D.23910 = D.23909 & D.23899;
        if (D.23910 != 0) goto <D.23911>; else goto <D.23912>;
        <D.23911>:
        D.23913 = &MEM[(void *)".bss" + 2B];
        D.23914 = *D.23913;
        D.23915 = (int) D.23914;
        D.23916 = __s2 + 2;
        D.23917 = *D.23916;
        D.23918 = (int) D.23917;
        __result = D.23915 - D.23918;
        D.23919 = __s2_len > 2;
        D.23899 = __result == 0;
        D.23920 = D.23919 & D.23899;
        if (D.23920 != 0) goto <D.23921>; else goto <D.23922>;
        <D.23921>:
        D.23923 = &MEM[(void *)".bss" + 3B];
        D.23924 = *D.23923;
        D.23925 = (int) D.23924;
        D.23926 = __s2 + 3;
        D.23927 = *D.23926;
        D.23928 = (int) D.23927;
        __result = D.23925 - D.23928;
        <D.23922>:
        <D.23912>:
        <D.23902>:
      }
      D.23557 = __result;
    }
    iftmp.2 = -D.23557;
    goto <D.23929>;
    <D.23892>:
    iftmp.2 = __builtin_strcmp (section_name, ".bss");
    <D.23929>:
    D.23558 = iftmp.2;
  }
  if (D.23558 == 0) goto <D.23805>; else goto <D.23806>;
  <D.23805>:
  D.23930 = acfg->fp;
  fprintf (D.23930, "%s %d\n", section_name, subsection_index);
  goto <D.23807>;
  <D.23806>:
  D.23930 = acfg->fp;
  fprintf (D.23930, ".section \"%s\"\n", section_name);
  D.23930 = acfg->fp;
  fprintf (D.23930, ".subsection %d\n", subsection_index);
  <D.23807>:
}


asm_writer_emit_unset_mode (struct MonoImageWriter * acfg)
{
  int D.23931;
  struct FILE * D.23934;

  D.23931 = acfg->mode;
  if (D.23931 == 0) goto <D.23932>; else goto <D.23933>;
  <D.23932>:
  return;
  <D.23933>:
  D.23934 = acfg->fp;
  fprintf (D.23934, "\n");
  acfg->mode = 0;
}


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

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


img_writer_emit_push_section (struct MonoImageWriter * acfg, const char * section_name, int subsection)
{
  int D.23938;
  _Bool D.23939;
  long int D.23940;
  long int D.23941;
  const char * D.23944;
  int D.23945;
  int D.23946;

  D.23938 = acfg->stack_pos;
  D.23939 = D.23938 > 14;
  D.23940 = (long int) D.23939;
  D.23941 = __builtin_expect (D.23940, 0);
  if (D.23941 != 0) goto <D.23942>; else goto <D.23943>;
  <D.23942>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2018, "acfg->stack_pos < 16 - 1");
  <D.23943>:
  D.23938 = acfg->stack_pos;
  D.23944 = acfg->current_section;
  acfg->section_stack[D.23938] = D.23944;
  D.23938 = acfg->stack_pos;
  D.23945 = acfg->current_subsection;
  acfg->subsection_stack[D.23938] = D.23945;
  D.23938 = acfg->stack_pos;
  D.23946 = D.23938 + 1;
  acfg->stack_pos = D.23946;
  img_writer_emit_section_change (acfg, section_name, subsection);
}


img_writer_emit_pop_section (struct MonoImageWriter * acfg)
{
  int D.23947;
  _Bool D.23948;
  long int D.23949;
  long int D.23950;
  int D.23953;
  int D.23954;
  const char * D.23955;

  D.23947 = acfg->stack_pos;
  D.23948 = D.23947 <= 0;
  D.23949 = (long int) D.23948;
  D.23950 = __builtin_expect (D.23949, 0);
  if (D.23950 != 0) goto <D.23951>; else goto <D.23952>;
  <D.23951>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2029, "acfg->stack_pos > 0");
  <D.23952>:
  D.23947 = acfg->stack_pos;
  D.23953 = D.23947 + -1;
  acfg->stack_pos = D.23953;
  D.23947 = acfg->stack_pos;
  D.23954 = acfg->subsection_stack[D.23947];
  D.23947 = acfg->stack_pos;
  D.23955 = acfg->section_stack[D.23947];
  img_writer_emit_section_change (acfg, D.23955, D.23954);
}


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

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


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

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


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

  D.23960 = acfg->use_bin_writer;
  if (D.23960 != 0) goto <D.23961>; else goto <D.23962>;
  <D.23961>:
  bin_writer_emit_global (acfg, name, func);
  goto <D.23963>;
  <D.23962>:
  asm_writer_emit_global (acfg, name, func);
  <D.23963>:
}


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.23964;
  gchar * D.23967;
  struct BinSection * D.23968;
  struct BinSection * D.23969;
  int D.23970;
  struct BinSymbol * D.23971;
  struct BinSymbol * symbol;

  symbol = monoeg_malloc0 (48);
  D.23964 = monoeg_strdup (name);
  symbol->name = D.23964;
  if (end_label != 0B) goto <D.23965>; else goto <D.23966>;
  <D.23965>:
  D.23967 = monoeg_strdup (end_label);
  symbol->end_label = D.23967;
  <D.23966>:
  symbol->is_function = func;
  symbol->is_global = is_global;
  D.23968 = acfg->cur_section;
  symbol->section = D.23968;
  D.23969 = symbol->section;
  D.23970 = D.23969->cur_offset;
  symbol->offset = D.23970;
  D.23971 = acfg->symbols;
  symbol->next = D.23971;
  acfg->symbols = symbol;
}


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

  asm_writer_emit_unset_mode (acfg);
  D.23972 = acfg->fp;
  fprintf (D.23972, "\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.23976;
  const char * stype;

  if (func != 0) goto <D.23973>; else goto <D.23974>;
  <D.23973>:
  stype = "function";
  goto <D.23975>;
  <D.23974>:
  stype = "object";
  <D.23975>:
  asm_writer_emit_unset_mode (acfg);
  D.23976 = acfg->fp;
  fprintf (D.23976, "\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.23977;

  D.23977 = acfg->use_bin_writer;
  if (D.23977 != 0) goto <D.23978>; else goto <D.23979>;
  <D.23978>:
  bin_writer_emit_local_symbol (acfg, name, end_label, func);
  goto <D.23980>;
  <D.23979>:
  asm_writer_emit_local_symbol (acfg, name, end_label, func);
  <D.23980>:
}


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.23981;

  asm_writer_emit_unset_mode (acfg);
  D.23981 = acfg->fp;
  fprintf (D.23981, "\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.23982;

  D.23982 = acfg->use_bin_writer;
  if (D.23982 == 0) goto <D.23983>; else goto <D.23984>;
  <D.23983>:
  asm_writer_emit_symbol_size (acfg, name, end_label);
  <D.23984>:
}


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

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


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

  D.23986 = acfg->use_bin_writer;
  if (D.23986 != 0) goto <D.23987>; else goto <D.23988>;
  <D.23987>:
  bin_writer_emit_label (acfg, name);
  goto <D.23989>;
  <D.23988>:
  asm_writer_emit_label (acfg, name);
  <D.23989>:
}


bin_writer_emit_label (struct MonoImageWriter * acfg, const char * name)
{
  gchar * D.23990;
  struct BinSection * D.23991;
  int D.23992;
  char * D.23993;
  struct GHashTable * D.23994;
  struct BinLabel * label;

  label = monoeg_malloc0 (24);
  D.23990 = monoeg_strdup (name);
  label->name = D.23990;
  D.23991 = acfg->cur_section;
  label->section = D.23991;
  D.23991 = acfg->cur_section;
  D.23992 = D.23991->cur_offset;
  label->offset = D.23992;
  D.23993 = label->name;
  D.23994 = acfg->labels;
  monoeg_g_hash_table_insert_replace (D.23994, D.23993, label, 0);
}


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

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


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

  D.23997 = s;
  return D.23997;
}


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

  D.23999 = acfg->use_bin_writer;
  if (D.23999 != 0) goto <D.24000>; else goto <D.24001>;
  <D.24000>:
  bin_writer_emit_bytes (acfg, buf, size);
  goto <D.24002>;
  <D.24001>:
  asm_writer_emit_bytes (acfg, buf, size);
  <D.24002>:
}


bin_writer_emit_bytes (struct MonoImageWriter * acfg, const guint8 * buf, int size)
{
  struct BinSection * D.24003;
  long unsigned int D.24004;
  guint8 * D.24005;
  int D.24006;
  sizetype D.24007;
  guint8 * D.24008;
  int D.24009;

  D.24003 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.24003, size);
  D.24004 = (long unsigned int) size;
  D.24003 = acfg->cur_section;
  D.24005 = D.24003->data;
  D.24003 = acfg->cur_section;
  D.24006 = D.24003->cur_offset;
  D.24007 = (sizetype) D.24006;
  D.24008 = D.24005 + D.24007;
  memcpy (D.24008, buf, D.24004);
  D.24003 = acfg->cur_section;
  D.24003 = acfg->cur_section;
  D.24006 = D.24003->cur_offset;
  D.24009 = D.24006 + size;
  D.24003->cur_offset = D.24009;
}


bin_writer_emit_ensure_buffer (struct BinSection * section, int size)
{
  int D.24010;
  int D.24011;
  int iftmp.3;
  long unsigned int D.24018;
  long unsigned int D.24019;
  guint8 * D.24020;
  int new_offset;

  D.24010 = section->cur_offset;
  new_offset = D.24010 + size;
  D.24011 = section->data_len;
  if (D.24011 <= new_offset) goto <D.24012>; else goto <D.24013>;
  <D.24012>:
  {
    int new_size;
    guint8 * data;

    D.24011 = section->data_len;
    if (D.24011 != 0) goto <D.24015>; else goto <D.24016>;
    <D.24015>:
    D.24011 = section->data_len;
    iftmp.3 = D.24011 * 2;
    goto <D.24017>;
    <D.24016>:
    iftmp.3 = 256;
    <D.24017>:
    new_size = iftmp.3;
    goto <D.23124>;
    <D.23123>:
    new_size = new_size * 2;
    <D.23124>:
    if (new_size <= new_offset) goto <D.23123>; else goto <D.23125>;
    <D.23125>:
    D.24018 = (long unsigned int) new_size;
    data = monoeg_malloc0 (D.24018);
    D.24011 = section->data_len;
    D.24019 = (long unsigned int) D.24011;
    D.24020 = section->data;
    memcpy (data, D.24020, D.24019);
    D.24020 = section->data;
    monoeg_g_free (D.24020);
    section->data = data;
    section->data_len = new_size;
  }
  <D.24013>:
}


memcpy (void * restrict __dest, const void * restrict __src, size_t __len)
{
  void * D.24021;
  long unsigned int D.24022;

  D.24022 = __builtin_object_size (__dest, 0);
  D.24021 = __builtin___memcpy_chk (__dest, __src, __len, D.24022);
  return D.24021;
}


asm_writer_emit_bytes (struct MonoImageWriter * acfg, const guint8 * buf, int size)
{
  int D.24024;
  char * byte_to_str.4;
  void * byte_to_str.5;
  int D.24031;
  sizetype D.24032;
  char * D.24033;
  int D.24034;
  unsigned int D.24035;
  unsigned int D.24036;
  sizetype D.24039;
  const guint8 * D.24040;
  unsigned char D.24041;
  int D.24042;
  struct FILE * D.24043;
  int D.24045;
  sizetype D.24046;
  char * D.24047;
  int D.24048;
  int i;

  D.24024 = acfg->mode;
  if (D.24024 != 1) goto <D.24025>; else goto <D.24026>;
  <D.24025>:
  acfg->mode = 1;
  acfg->col_count = 0;
  <D.24026>:
  byte_to_str.4 = byte_to_str;
  if (byte_to_str.4 == 0B) goto <D.24028>; else goto <D.24029>;
  <D.24028>:
  byte_to_str.5 = monoeg_malloc0 (2048);
  byte_to_str = byte_to_str.5;
  i = 0;
  goto <D.23615>;
  <D.23614>:
  byte_to_str.4 = byte_to_str;
  D.24031 = i * 8;
  D.24032 = (sizetype) D.24031;
  D.24033 = byte_to_str.4 + D.24032;
  sprintf (D.24033, ",%d", i);
  i = i + 1;
  <D.23615>:
  if (i <= 255) goto <D.23614>; else goto <D.23616>;
  <D.23616>:
  <D.24029>:
  i = 0;
  goto <D.23618>;
  <D.23617>:
  D.24034 = acfg->col_count;
  D.24035 = (unsigned int) D.24034;
  D.24036 = D.24035 & 31;
  if (D.24036 == 0) goto <D.24037>; else goto <D.24038>;
  <D.24037>:
  D.24039 = (sizetype) i;
  D.24040 = buf + D.24039;
  D.24041 = *D.24040;
  D.24042 = (int) D.24041;
  D.24043 = acfg->fp;
  fprintf (D.24043, "\n\t.byte %d", D.24042);
  goto <D.24044>;
  <D.24038>:
  D.24043 = acfg->fp;
  byte_to_str.4 = byte_to_str;
  D.24039 = (sizetype) i;
  D.24040 = buf + D.24039;
  D.24041 = *D.24040;
  D.24042 = (int) D.24041;
  D.24045 = D.24042 * 8;
  D.24046 = (sizetype) D.24045;
  D.24047 = byte_to_str.4 + D.24046;
  fputs (D.24047, D.24043);
  <D.24044>:
  i = i + 1;
  D.24034 = acfg->col_count;
  D.24048 = D.24034 + 1;
  acfg->col_count = D.24048;
  <D.23618>:
  if (i < size) goto <D.23617>; else goto <D.23619>;
  <D.23619>:
}


sprintf (char * restrict __s, const char * restrict __fmt)
{
  int D.24049;
  long unsigned int D.24050;

  D.24050 = __builtin_object_size (__s, 1);
  D.24049 = __builtin___sprintf_chk (__s, 1, D.24050, __fmt, __builtin_va_arg_pack ());
  return D.24049;
}


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

  D.24052 = acfg->use_bin_writer;
  if (D.24052 != 0) goto <D.24053>; else goto <D.24054>;
  <D.24053>:
  bin_writer_emit_string (acfg, value);
  goto <D.24055>;
  <D.24054>:
  asm_writer_emit_string (acfg, value);
  <D.24055>:
}


bin_writer_emit_string (struct MonoImageWriter * acfg, const char * value)
{
  long unsigned int D.24056;
  unsigned int D.24057;
  unsigned int D.24058;
  int size;

  D.24056 = strlen (value);
  D.24057 = (unsigned int) D.24056;
  D.24058 = D.24057 + 1;
  size = (int) D.24058;
  bin_writer_emit_bytes (acfg, value, size);
}


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

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


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

  D.24060 = acfg->use_bin_writer;
  if (D.24060 != 0) goto <D.24061>; else goto <D.24062>;
  <D.24061>:
  bin_writer_emit_line (acfg);
  goto <D.24063>;
  <D.24062>:
  asm_writer_emit_line (acfg);
  <D.24063>:
}


bin_writer_emit_line (struct MonoImageWriter * acfg)
{

}


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

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


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

  D.24065 = acfg->use_bin_writer;
  if (D.24065 != 0) goto <D.24066>; else goto <D.24067>;
  <D.24066>:
  bin_writer_emit_alignment (acfg, size);
  goto <D.24068>;
  <D.24067>:
  asm_writer_emit_alignment (acfg, size);
  <D.24068>:
}


bin_writer_emit_alignment (struct MonoImageWriter * acfg, int size)
{
  struct BinSection * D.24069;
  int D.24070;
  int D.24071;
  int D.24072;
  int D.24075;
  int offset;
  int add;

  D.24069 = acfg->cur_section;
  offset = D.24069->cur_offset;
  D.24070 = size + -1;
  offset = D.24070 + offset;
  D.24071 = -size;
  offset = D.24071 & offset;
  D.24069 = acfg->cur_section;
  D.24072 = D.24069->cur_offset;
  add = offset - D.24072;
  if (add != 0) goto <D.24073>; else goto <D.24074>;
  <D.24073>:
  D.24069 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.24069, add);
  D.24069 = acfg->cur_section;
  D.24069 = acfg->cur_section;
  D.24072 = D.24069->cur_offset;
  D.24075 = D.24072 + add;
  D.24069->cur_offset = D.24075;
  <D.24074>:
}


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

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


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

  D.24077 = acfg->use_bin_writer;
  if (D.24077 != 0) goto <D.24078>; else goto <D.24079>;
  <D.24078>:
  bin_writer_emit_pointer_unaligned (acfg, target);
  goto <D.24080>;
  <D.24079>:
  asm_writer_emit_pointer_unaligned (acfg, target);
  <D.24080>:
}


bin_writer_emit_pointer_unaligned (struct MonoImageWriter * acfg, const char * target)
{
  struct BinSection * D.24083;
  int D.24084;
  unsigned int D.24085;
  unsigned int D.24086;
  int D.24087;
  gchar * D.24088;
  struct BinReloc * D.24089;
  int D.23158;
  int iftmp.6;
  int D.23157;
  struct BinSection * D.24093;
  const char[6] * D.24094;
  unsigned char D.24095;
  int D.24096;
  unsigned char D.24097;
  int D.24098;
  _Bool D.24099;
  _Bool D.24100;
  _Bool D.24101;
  const unsigned char * D.24104;
  unsigned char D.24105;
  int D.24106;
  const unsigned char * D.24107;
  unsigned char D.24108;
  int D.24109;
  _Bool D.24110;
  _Bool D.24111;
  const unsigned char * D.24114;
  unsigned char D.24115;
  int D.24116;
  const unsigned char * D.24117;
  unsigned char D.24118;
  int D.24119;
  _Bool D.24120;
  _Bool D.24121;
  const unsigned char * D.24124;
  unsigned char D.24125;
  int D.24126;
  const unsigned char * D.24127;
  unsigned char D.24128;
  int D.24129;
  char * D.24131;
  int D.24134;
  int D.24135;
  struct BinReloc * reloc;

  if (target == 0B) goto <D.24081>; else goto <D.24082>;
  <D.24081>:
  D.24083 = acfg->cur_section;
  D.24083 = acfg->cur_section;
  D.24084 = D.24083->cur_offset;
  D.24085 = (unsigned int) D.24084;
  D.24086 = D.24085 + 8;
  D.24087 = (int) D.24086;
  D.24083->cur_offset = D.24087;
  return;
  <D.24082>:
  reloc = monoeg_malloc0 (56);
  D.24088 = monoeg_strdup (target);
  reloc->val1 = D.24088;
  D.24083 = acfg->cur_section;
  reloc->section = D.24083;
  D.24083 = acfg->cur_section;
  D.24084 = D.24083->cur_offset;
  reloc->section_offset = D.24084;
  D.24089 = acfg->relocations;
  reloc->next = D.24089;
  acfg->relocations = reloc;
  {
    size_t __s1_len;
    size_t __s2_len;

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

      D.24093 = reloc->section;
      __s2 = D.24093->name;
      D.24094 = ".data";
      D.24095 = MEM[(const unsigned char *)D.24094];
      D.24096 = (int) D.24095;
      D.24097 = *__s2;
      D.24098 = (int) D.24097;
      __result = D.24096 - D.24098;
      {
        D.24099 = __s2_len != 0;
        D.24100 = __result == 0;
        D.24101 = D.24099 & D.24100;
        if (D.24101 != 0) goto <D.24102>; else goto <D.24103>;
        <D.24102>:
        D.24104 = &MEM[(void *)".data" + 1B];
        D.24105 = *D.24104;
        D.24106 = (int) D.24105;
        D.24107 = __s2 + 1;
        D.24108 = *D.24107;
        D.24109 = (int) D.24108;
        __result = D.24106 - D.24109;
        D.24110 = __s2_len > 1;
        D.24100 = __result == 0;
        D.24111 = D.24110 & D.24100;
        if (D.24111 != 0) goto <D.24112>; else goto <D.24113>;
        <D.24112>:
        D.24114 = &MEM[(void *)".data" + 2B];
        D.24115 = *D.24114;
        D.24116 = (int) D.24115;
        D.24117 = __s2 + 2;
        D.24118 = *D.24117;
        D.24119 = (int) D.24118;
        __result = D.24116 - D.24119;
        D.24120 = __s2_len > 2;
        D.24100 = __result == 0;
        D.24121 = D.24120 & D.24100;
        if (D.24121 != 0) goto <D.24122>; else goto <D.24123>;
        <D.24122>:
        D.24124 = &MEM[(void *)".data" + 3B];
        D.24125 = *D.24124;
        D.24126 = (int) D.24125;
        D.24127 = __s2 + 3;
        D.24128 = *D.24127;
        D.24129 = (int) D.24128;
        __result = D.24126 - D.24129;
        <D.24123>:
        <D.24113>:
        <D.24103>:
      }
      D.23157 = __result;
    }
    iftmp.6 = -D.23157;
    goto <D.24130>;
    <D.24092>:
    D.24093 = reloc->section;
    D.24131 = D.24093->name;
    iftmp.6 = __builtin_strcmp (D.24131, ".data");
    <D.24130>:
    D.23158 = iftmp.6;
  }
  if (D.23158 == 0) goto <D.24132>; else goto <D.24133>;
  <D.24132>:
  D.24134 = acfg->num_relocs;
  D.24135 = D.24134 + 1;
  acfg->num_relocs = D.24135;
  <D.24133>:
  D.24083 = acfg->cur_section;
  D.24083 = acfg->cur_section;
  D.24084 = D.24083->cur_offset;
  D.24085 = (unsigned int) D.24084;
  D.24086 = D.24085 + 8;
  D.24087 = (int) D.24086;
  D.24083->cur_offset = D.24087;
}


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

  asm_writer_emit_unset_mode (acfg);
  if (target != 0B) goto <D.24138>; else goto <D.24139>;
  <D.24138>:
  iftmp.7 = target;
  goto <D.24140>;
  <D.24139>:
  iftmp.7 = "0";
  <D.24140>:
  D.24141 = acfg->fp;
  fprintf (D.24141, "\t%s %s\n", ".quad", iftmp.7);
}


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

  D.24142 = acfg->use_bin_writer;
  if (D.24142 != 0) goto <D.24143>; else goto <D.24144>;
  <D.24143>:
  bin_writer_emit_pointer (acfg, target);
  goto <D.24145>;
  <D.24144>:
  asm_writer_emit_pointer (acfg, target);
  <D.24145>:
}


bin_writer_emit_pointer (struct MonoImageWriter * acfg, const char * target)
{
  bin_writer_emit_alignment (acfg, 8);
  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, 8);
  asm_writer_emit_pointer_unaligned (acfg, target);
}


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

  D.24146 = acfg->use_bin_writer;
  if (D.24146 != 0) goto <D.24147>; else goto <D.24148>;
  <D.24147>:
  bin_writer_emit_int16 (acfg, value);
  goto <D.24149>;
  <D.24148>:
  asm_writer_emit_int16 (acfg, value);
  <D.24149>:
}


bin_writer_emit_int16 (struct MonoImageWriter * acfg, int value)
{
  struct BinSection * D.24150;
  guint8 * D.24151;
  int D.24152;
  sizetype D.24153;
  int D.24154;
  unsigned char D.24155;
  guint8 * D.24156;
  int D.24157;
  unsigned char D.24158;
  guint8 * data;

  D.24150 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.24150, 2);
  D.24150 = acfg->cur_section;
  D.24151 = D.24150->data;
  D.24150 = acfg->cur_section;
  D.24152 = D.24150->cur_offset;
  D.24153 = (sizetype) D.24152;
  data = D.24151 + D.24153;
  D.24150 = acfg->cur_section;
  D.24150 = acfg->cur_section;
  D.24152 = D.24150->cur_offset;
  D.24154 = D.24152 + 2;
  D.24150->cur_offset = D.24154;
  D.24155 = (unsigned char) value;
  *data = D.24155;
  D.24156 = data + 1;
  D.24157 = value >> 8;
  D.24158 = (unsigned char) D.24157;
  *D.24156 = D.24158;
}


asm_writer_emit_int16 (struct MonoImageWriter * acfg, int value)
{
  int D.24159;
  int D.24162;
  int D.24163;
  int D.24164;
  unsigned int D.24165;
  unsigned int D.24166;
  struct FILE * D.24169;

  D.24159 = acfg->mode;
  if (D.24159 != 2) goto <D.24160>; else goto <D.24161>;
  <D.24160>:
  acfg->mode = 2;
  acfg->col_count = 0;
  <D.24161>:
  D.24162 = acfg->col_count;
  D.24163 = D.24162;
  D.24164 = D.24163 + 1;
  acfg->col_count = D.24164;
  D.24165 = (unsigned int) D.24163;
  D.24166 = D.24165 & 7;
  if (D.24166 == 0) goto <D.24167>; else goto <D.24168>;
  <D.24167>:
  D.24169 = acfg->fp;
  fprintf (D.24169, "\n\t%s ", ".hword");
  goto <D.24170>;
  <D.24168>:
  D.24169 = acfg->fp;
  fprintf (D.24169, ", ");
  <D.24170>:
  D.24169 = acfg->fp;
  fprintf (D.24169, "%d", value);
}


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

  D.24171 = acfg->use_bin_writer;
  if (D.24171 != 0) goto <D.24172>; else goto <D.24173>;
  <D.24172>:
  bin_writer_emit_int32 (acfg, value);
  goto <D.24174>;
  <D.24173>:
  asm_writer_emit_int32 (acfg, value);
  <D.24174>:
}


bin_writer_emit_int32 (struct MonoImageWriter * acfg, int value)
{
  struct BinSection * D.24175;
  guint8 * D.24176;
  int D.24177;
  sizetype D.24178;
  int D.24179;
  unsigned char D.24180;
  guint8 * D.24181;
  int D.24182;
  unsigned char D.24183;
  guint8 * D.24184;
  int D.24185;
  unsigned char D.24186;
  guint8 * D.24187;
  int D.24188;
  unsigned char D.24189;
  guint8 * data;

  D.24175 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.24175, 4);
  D.24175 = acfg->cur_section;
  D.24176 = D.24175->data;
  D.24175 = acfg->cur_section;
  D.24177 = D.24175->cur_offset;
  D.24178 = (sizetype) D.24177;
  data = D.24176 + D.24178;
  D.24175 = acfg->cur_section;
  D.24175 = acfg->cur_section;
  D.24177 = D.24175->cur_offset;
  D.24179 = D.24177 + 4;
  D.24175->cur_offset = D.24179;
  D.24180 = (unsigned char) value;
  *data = D.24180;
  D.24181 = data + 1;
  D.24182 = value >> 8;
  D.24183 = (unsigned char) D.24182;
  *D.24181 = D.24183;
  D.24184 = data + 2;
  D.24185 = value >> 16;
  D.24186 = (unsigned char) D.24185;
  *D.24184 = D.24186;
  D.24187 = data + 3;
  D.24188 = value >> 24;
  D.24189 = (unsigned char) D.24188;
  *D.24187 = D.24189;
}


asm_writer_emit_int32 (struct MonoImageWriter * acfg, int value)
{
  int D.24190;
  int D.24193;
  int D.24194;
  int D.24195;
  unsigned int D.24196;
  unsigned int D.24197;
  struct FILE * D.24200;

  D.24190 = acfg->mode;
  if (D.24190 != 3) goto <D.24191>; else goto <D.24192>;
  <D.24191>:
  acfg->mode = 3;
  acfg->col_count = 0;
  <D.24192>:
  D.24193 = acfg->col_count;
  D.24194 = D.24193;
  D.24195 = D.24194 + 1;
  acfg->col_count = D.24195;
  D.24196 = (unsigned int) D.24194;
  D.24197 = D.24196 & 7;
  if (D.24197 == 0) goto <D.24198>; else goto <D.24199>;
  <D.24198>:
  D.24200 = acfg->fp;
  fprintf (D.24200, "\n\t%s ", ".long");
  goto <D.24201>;
  <D.24199>:
  D.24200 = acfg->fp;
  fprintf (D.24200, ",");
  <D.24201>:
  D.24200 = acfg->fp;
  fprintf (D.24200, "%d", value);
}


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

  D.24202 = acfg->use_bin_writer;
  if (D.24202 != 0) goto <D.24203>; else goto <D.24204>;
  <D.24203>:
  bin_writer_emit_symbol_diff (acfg, end, start, offset);
  goto <D.24205>;
  <D.24204>:
  asm_writer_emit_symbol_diff (acfg, end, start, offset);
  <D.24205>:
}


bin_writer_emit_symbol_diff (struct MonoImageWriter * acfg, const char * end, const char * start, int offset)
{
  struct BinSection * D.24206;
  int D.24207;
  int D.24208;

  create_reloc (acfg, end, start, offset);
  D.24206 = acfg->cur_section;
  D.24206 = acfg->cur_section;
  D.24207 = D.24206->cur_offset;
  D.24208 = D.24207 + 4;
  D.24206->cur_offset = D.24208;
}


create_reloc (struct MonoImageWriter * acfg, const char * end, const char * start, int offset)
{
  struct MonoMemPool * D.24209;
  char * D.24210;
  int D.23188;
  int iftmp.8;
  int D.23187;
  const char[2] * D.24214;
  unsigned char D.24215;
  int D.24216;
  unsigned char D.24217;
  int D.24218;
  _Bool D.24219;
  _Bool D.24220;
  _Bool D.24221;
  const unsigned char * D.24224;
  unsigned char D.24225;
  int D.24226;
  const unsigned char * D.24227;
  unsigned char D.24228;
  int D.24229;
  _Bool D.24230;
  _Bool D.24231;
  const unsigned char * D.24234;
  unsigned char D.24235;
  int D.24236;
  const unsigned char * D.24237;
  unsigned char D.24238;
  int D.24239;
  _Bool D.24240;
  _Bool D.24241;
  const unsigned char * D.24244;
  unsigned char D.24245;
  int D.24246;
  const unsigned char * D.24247;
  unsigned char D.24248;
  int D.24249;
  struct BinSection * D.24253;
  int D.24254;
  char * D.24256;
  struct BinReloc * D.24257;
  struct BinReloc * D.24258;
  struct BinReloc * reloc;

  D.24209 = acfg->mempool;
  reloc = mono_mempool_alloc0 (D.24209, 56);
  D.24209 = acfg->mempool;
  D.24210 = mono_mempool_strdup (D.24209, end);
  reloc->val1 = D.24210;
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = start;
      D.24214 = ".";
      D.24215 = MEM[(const unsigned char *)D.24214];
      D.24216 = (int) D.24215;
      D.24217 = *__s2;
      D.24218 = (int) D.24217;
      __result = D.24216 - D.24218;
      {
        D.24219 = __s2_len != 0;
        D.24220 = __result == 0;
        D.24221 = D.24219 & D.24220;
        if (D.24221 != 0) goto <D.24222>; else goto <D.24223>;
        <D.24222>:
        D.24224 = &MEM[(void *)"." + 1B];
        D.24225 = *D.24224;
        D.24226 = (int) D.24225;
        D.24227 = __s2 + 1;
        D.24228 = *D.24227;
        D.24229 = (int) D.24228;
        __result = D.24226 - D.24229;
        D.24230 = __s2_len > 1;
        D.24220 = __result == 0;
        D.24231 = D.24230 & D.24220;
        if (D.24231 != 0) goto <D.24232>; else goto <D.24233>;
        <D.24232>:
        D.24234 = &MEM[(void *)"." + 2B];
        D.24235 = *D.24234;
        D.24236 = (int) D.24235;
        D.24237 = __s2 + 2;
        D.24238 = *D.24237;
        D.24239 = (int) D.24238;
        __result = D.24236 - D.24239;
        D.24240 = __s2_len > 2;
        D.24220 = __result == 0;
        D.24241 = D.24240 & D.24220;
        if (D.24241 != 0) goto <D.24242>; else goto <D.24243>;
        <D.24242>:
        D.24244 = &MEM[(void *)"." + 3B];
        D.24245 = *D.24244;
        D.24246 = (int) D.24245;
        D.24247 = __s2 + 3;
        D.24248 = *D.24247;
        D.24249 = (int) D.24248;
        __result = D.24246 - D.24249;
        <D.24243>:
        <D.24233>:
        <D.24223>:
      }
      D.23187 = __result;
    }
    iftmp.8 = -D.23187;
    goto <D.24250>;
    <D.24213>:
    iftmp.8 = __builtin_strcmp (start, ".");
    <D.24250>:
    D.23188 = iftmp.8;
  }
  if (D.23188 == 0) goto <D.24251>; else goto <D.24252>;
  <D.24251>:
  D.24253 = acfg->cur_section;
  reloc->val2_section = D.24253;
  D.24253 = acfg->cur_section;
  D.24254 = D.24253->cur_offset;
  reloc->val2_offset = D.24254;
  goto <D.24255>;
  <D.24252>:
  D.24209 = acfg->mempool;
  D.24256 = mono_mempool_strdup (D.24209, start);
  reloc->val2 = D.24256;
  <D.24255>:
  reloc->offset = offset;
  D.24253 = acfg->cur_section;
  reloc->section = D.24253;
  D.24253 = acfg->cur_section;
  D.24254 = D.24253->cur_offset;
  reloc->section_offset = D.24254;
  D.24257 = acfg->relocations;
  reloc->next = D.24257;
  acfg->relocations = reloc;
  D.24258 = reloc;
  return D.24258;
}


asm_writer_emit_symbol_diff (struct MonoImageWriter * acfg, const char * end, const char * start, int offset)
{
  int D.24260;
  int D.23642;
  int iftmp.9;
  int D.23641;
  const char[2] * D.24268;
  unsigned char D.24269;
  int D.24270;
  unsigned char D.24271;
  int D.24272;
  _Bool D.24273;
  _Bool D.24274;
  _Bool D.24275;
  const unsigned char * D.24278;
  unsigned char D.24279;
  int D.24280;
  const unsigned char * D.24281;
  unsigned char D.24282;
  int D.24283;
  _Bool D.24284;
  _Bool D.24285;
  const unsigned char * D.24288;
  unsigned char D.24289;
  int D.24290;
  const unsigned char * D.24291;
  unsigned char D.24292;
  int D.24293;
  _Bool D.24294;
  _Bool D.24295;
  const unsigned char * D.24298;
  unsigned char D.24299;
  int D.24300;
  const unsigned char * D.24301;
  unsigned char D.24302;
  int D.24303;
  int D.24307;
  int D.24308;
  struct FILE * D.24309;
  int D.24310;
  int D.24311;
  int D.24312;
  unsigned int D.24313;
  unsigned int D.24314;

  D.24260 = acfg->mode;
  if (D.24260 != 3) goto <D.24261>; else goto <D.24262>;
  <D.24261>:
  acfg->mode = 3;
  acfg->col_count = 0;
  <D.24262>:
  start = get_label (start);
  end = get_label (end);
  if (offset == 0) goto <D.24263>; else goto <D.24264>;
  <D.24263>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = start;
      D.24268 = ".";
      D.24269 = MEM[(const unsigned char *)D.24268];
      D.24270 = (int) D.24269;
      D.24271 = *__s2;
      D.24272 = (int) D.24271;
      __result = D.24270 - D.24272;
      {
        D.24273 = __s2_len != 0;
        D.24274 = __result == 0;
        D.24275 = D.24273 & D.24274;
        if (D.24275 != 0) goto <D.24276>; else goto <D.24277>;
        <D.24276>:
        D.24278 = &MEM[(void *)"." + 1B];
        D.24279 = *D.24278;
        D.24280 = (int) D.24279;
        D.24281 = __s2 + 1;
        D.24282 = *D.24281;
        D.24283 = (int) D.24282;
        __result = D.24280 - D.24283;
        D.24284 = __s2_len > 1;
        D.24274 = __result == 0;
        D.24285 = D.24284 & D.24274;
        if (D.24285 != 0) goto <D.24286>; else goto <D.24287>;
        <D.24286>:
        D.24288 = &MEM[(void *)"." + 2B];
        D.24289 = *D.24288;
        D.24290 = (int) D.24289;
        D.24291 = __s2 + 2;
        D.24292 = *D.24291;
        D.24293 = (int) D.24292;
        __result = D.24290 - D.24293;
        D.24294 = __s2_len > 2;
        D.24274 = __result == 0;
        D.24295 = D.24294 & D.24274;
        if (D.24295 != 0) goto <D.24296>; else goto <D.24297>;
        <D.24296>:
        D.24298 = &MEM[(void *)"." + 3B];
        D.24299 = *D.24298;
        D.24300 = (int) D.24299;
        D.24301 = __s2 + 3;
        D.24302 = *D.24301;
        D.24303 = (int) D.24302;
        __result = D.24300 - D.24303;
        <D.24297>:
        <D.24287>:
        <D.24277>:
      }
      D.23641 = __result;
    }
    iftmp.9 = -D.23641;
    goto <D.24304>;
    <D.24267>:
    iftmp.9 = __builtin_strcmp (start, ".");
    <D.24304>:
    D.23642 = iftmp.9;
  }
  if (D.23642 != 0) goto <D.24305>; else goto <D.24306>;
  <D.24305>:
  {
    char symbol[128];

    try
      {
        D.24307 = acfg->label_gen;
        sprintf (&symbol, "%sDIFF_SYM%d", ".L", D.24307);
        D.24307 = acfg->label_gen;
        D.24308 = D.24307 + 1;
        acfg->label_gen = D.24308;
        D.24309 = acfg->fp;
        fprintf (D.24309, "\n%s=%s - %s", &symbol, end, start);
        D.24309 = acfg->fp;
        fprintf (D.24309, "\n\t%s ", ".long");
        D.24309 = acfg->fp;
        fprintf (D.24309, "%s", &symbol);
        return;
      }
    finally
      {
        symbol = {CLOBBER};
      }
  }
  <D.24306>:
  <D.24264>:
  D.24310 = acfg->col_count;
  D.24311 = D.24310;
  D.24312 = D.24311 + 1;
  acfg->col_count = D.24312;
  D.24313 = (unsigned int) D.24311;
  D.24314 = D.24313 & 7;
  if (D.24314 == 0) goto <D.24315>; else goto <D.24316>;
  <D.24315>:
  D.24309 = acfg->fp;
  fprintf (D.24309, "\n\t%s ", ".long");
  goto <D.24317>;
  <D.24316>:
  D.24309 = acfg->fp;
  fprintf (D.24309, ",");
  <D.24317>:
  if (offset > 0) goto <D.24318>; else goto <D.24319>;
  <D.24318>:
  D.24309 = acfg->fp;
  fprintf (D.24309, "%s - %s + %d", end, start, offset);
  goto <D.24320>;
  <D.24319>:
  if (offset < 0) goto <D.24321>; else goto <D.24322>;
  <D.24321>:
  D.24309 = acfg->fp;
  fprintf (D.24309, "%s - %s %d", end, start, offset);
  goto <D.24323>;
  <D.24322>:
  D.24309 = acfg->fp;
  fprintf (D.24309, "%s - %s", end, start);
  <D.24323>:
  <D.24320>:
}


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

  D.24326 = acfg->use_bin_writer;
  if (D.24326 != 0) goto <D.24327>; else goto <D.24328>;
  <D.24327>:
  bin_writer_emit_zero_bytes (acfg, num);
  goto <D.24329>;
  <D.24328>:
  asm_writer_emit_zero_bytes (acfg, num);
  <D.24329>:
}


bin_writer_emit_zero_bytes (struct MonoImageWriter * acfg, int num)
{
  struct BinSection * D.24330;
  int D.24331;
  int D.24332;

  D.24330 = acfg->cur_section;
  bin_writer_emit_ensure_buffer (D.24330, num);
  D.24330 = acfg->cur_section;
  D.24330 = acfg->cur_section;
  D.24331 = D.24330->cur_offset;
  D.24332 = D.24331 + num;
  D.24330->cur_offset = D.24332;
}


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

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


img_writer_emit_writeout (struct MonoImageWriter * acfg)
{
  int D.24334;
  int D.24337;

  D.24334 = acfg->use_bin_writer;
  if (D.24334 != 0) goto <D.24335>; else goto <D.24336>;
  <D.24335>:
  D.24337 = bin_writer_emit_writeout (acfg);
  return D.24337;
  <D.24336>:
  D.24337 = asm_writer_emit_writeout (acfg);
  return D.24337;
}


bin_writer_emit_writeout (struct MonoImageWriter * acfg)
{
  const char * D.24339;
  int D.24340;
  unsigned int D.24341;
  int D.24342;
  unsigned int D.24343;
  int D.24344;
  long unsigned int D.24345;
  int D.24346;
  long unsigned int D.24347;
  int D.24348;
  long unsigned int D.24349;
  int D.23498;
  const char * D.24350;
  char * D.24351;
  struct BinSection * D.24354;
  int D.24355;
  int num_local_syms.10;
  long unsigned int D.24357;
  long unsigned int D.24358;
  int D.24359;
  int D.24360;
  int * D.24361;
  int D.24362;
  int D.24363;
  unsigned int D.24364;
  unsigned int D.24365;
  int size.11;
  int size.12;
  long unsigned int D.24368;
  long unsigned int D.24369;
  unsigned int D.24370;
  unsigned int D.24371;
  int size.13;
  long unsigned int D.24373;
  struct GString * D.24374;
  long unsigned int D.24375;
  int size.14;
  long unsigned int D.24377;
  long unsigned int D.24378;
  int D.24379;
  unsigned int D.24380;
  unsigned int D.24381;
  int size.15;
  long unsigned int D.24383;
  unsigned int D.24384;
  unsigned int file_offset.16;
  unsigned int D.24386;
  unsigned int D.24387;
  unsigned int D.24388;
  unsigned int D.24389;
  long unsigned int D.24390;
  struct BinSection * D.24391;
  int D.24394;
  long unsigned int D.24397;
  long unsigned int D.24398;
  long unsigned int D.24399;
  int size.17;
  long unsigned int D.24401;
  unsigned int D.24402;
  unsigned int D.24403;
  unsigned int D.24404;
  unsigned int D.24405;
  unsigned int D.24406;
  long unsigned int D.24407;
  struct BinSection * D.24408;
  int size.18;
  long unsigned int D.24412;
  unsigned int D.24413;
  unsigned int D.24414;
  unsigned int D.24415;
  unsigned int D.24416;
  unsigned int D.24417;
  long unsigned int D.24418;
  unsigned int D.24419;
  unsigned int D.24420;
  unsigned int D.24421;
  unsigned int D.24422;
  unsigned int D.24423;
  unsigned int virt_offset.19;
  unsigned int D.24425;
  unsigned int D.24426;
  unsigned int D.24427;
  long unsigned int D.24428;
  unsigned int D.24429;
  unsigned int D.24430;
  unsigned int D.24431;
  unsigned int D.24432;
  unsigned int D.24433;
  unsigned int D.24434;
  unsigned int D.24435;
  unsigned int D.24436;
  struct BinSection * D.24437;
  int size.20;
  long unsigned int D.24441;
  unsigned int D.24442;
  unsigned int D.24443;
  unsigned int D.24444;
  unsigned int D.24445;
  unsigned int D.24446;
  unsigned int D.24447;
  unsigned int D.24448;
  unsigned int D.24449;
  struct BinSection * D.24450;
  int size.21;
  long unsigned int D.24454;
  unsigned int D.24455;
  unsigned int D.24456;
  unsigned int D.24457;
  unsigned int D.24458;
  unsigned int D.24459;
  struct BinSection * D.24460;
  int size.22;
  struct BinSection * D.24465;
  int size.23;
  struct BinSection * D.24470;
  int size.24;
  struct BinSection * D.24475;
  int size.25;
  struct BinSection * D.24480;
  int size.26;
  long unsigned int D.24485;
  unsigned int D.24486;
  unsigned int D.24487;
  unsigned int D.24488;
  unsigned int D.24489;
  unsigned int D.24490;
  struct GString * D.24491;
  long unsigned int D.24492;
  int size.27;
  long unsigned int D.24494;
  unsigned int D.24495;
  unsigned int D.24496;
  unsigned int D.24497;
  unsigned int D.24498;
  unsigned int D.24499;
  int num_local_syms.28;
  unsigned int num_local_syms.29;
  unsigned int D.24502;
  int size.30;
  long unsigned int D.24504;
  unsigned int D.24505;
  unsigned int D.24506;
  unsigned int D.24507;
  unsigned int D.24508;
  unsigned int D.24509;
  struct GString * D.24510;
  long unsigned int D.24511;
  int size.31;
  long unsigned int D.24515;
  long unsigned int D.24516;
  _Bool D.24517;
  long int D.24518;
  long int D.24519;
  long unsigned int D.24522;
  long unsigned int D.24523;
  long unsigned int D.24524;
  long unsigned int D.24525;
  long unsigned int D.24526;
  long unsigned int D.24527;
  long unsigned int D.24528;
  long unsigned int D.24529;
  long unsigned int D.24530;
  long unsigned int D.24531;
  long unsigned int D.24532;
  long unsigned int D.24533;
  long unsigned int D.24534;
  long unsigned int D.24535;
  long unsigned int D.24536;
  long unsigned int D.24537;
  long unsigned int D.24538;
  long unsigned int D.24539;
  struct BinSection * D.24540;
  long unsigned int D.24543;
  int D.24544;
  long unsigned int D.24545;
  int D.24546;
  struct FILE * D.24547;
  unsigned int D.24550;
  int D.24551;
  int D.24552;
  long unsigned int D.24553;
  void * D.24554;
  int D.24555;
  int D.24556;
  long unsigned int D.24557;
  long unsigned int D.24558;
  long unsigned int D.24559;
  long unsigned int D.24560;
  char * D.24561;
  int D.24562;
  long unsigned int D.24563;
  int D.24564;
  int D.24567;
  long unsigned int D.24568;
  guint8 * D.24569;
  long unsigned int D.24572;
  int D.24573;
  long unsigned int D.24574;
  guint8 * D.24575;
  int D.24576;
  int size.32;
  long unsigned int D.24578;
  int D.24579;
  struct BinSection * D.24580;
  long unsigned int D.24583;
  int D.24584;
  int D.24585;
  long unsigned int D.24586;
  guint8 * D.24587;
  unsigned int i.33;
  long unsigned int D.24589;
  int D.24590;
  char * D.24591;
  long unsigned int D.24592;
  int D.24593;
  long unsigned int D.24594;
  long unsigned int D.24595;
  long unsigned int D.24596;
  int D.24597;
  char * D.24598;
  int D.24601;
  struct FILE * file;
  struct ElfHeader header;
  struct ElfProgHeader progh[4];
  struct ElfSectHeader secth[20];
  struct ElfRelocA * 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, 1280);
      memset (&dynamic, 0, 224);
      memset (&header, 0, 64);
      i = 1;
      goto <D.23486>;
      <D.23485>:
      D.24339 = section_info[i].name;
      D.24340 = str_table_add (&sh_str_table, D.24339);
      D.24341 = (unsigned int) D.24340;
      secth[i].sh_name = D.24341;
      D.24342 = section_info[i].type;
      D.24343 = (unsigned int) D.24342;
      secth[i].sh_type = D.24343;
      D.24344 = section_info[i].align;
      D.24345 = (long unsigned int) D.24344;
      secth[i].sh_addralign = D.24345;
      D.24346 = section_info[i].flags;
      D.24347 = (long unsigned int) D.24346;
      secth[i].sh_flags = D.24347;
      D.24348 = section_info[i].esize;
      D.24349 = (long unsigned int) D.24348;
      secth[i].sh_entsize = D.24349;
      i = i + 1;
      <D.23486>:
      if (i <= 19) goto <D.23485>; else goto <D.23487>;
      <D.23487>:
      secth[2].sh_info = 2;
      secth[18].sh_info = 17;
      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, 160);
      i = 0;
      goto <D.23503>;
      <D.23502>:
      {
        struct BinSection * sect;
        int j;

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

          D.24350 = section_info[j].name;
          D.24351 = sect->name;
          D.23498 = __builtin_strcmp (D.24351, D.24350);
        }
        if (D.23498 == 0) goto <D.24352>; else goto <D.24353>;
        <D.24352>:
        sect->shidx = j;
        goto <D.23499>;
        <D.24353>:
        j = j + 1;
        <D.23501>:
        if (j <= 19) goto <D.23500>; else goto <D.23499>;
        <D.23499>:
        D.24354 = all_sections[i];
        D.24355 = D.24354->shidx;
        sections[D.24355] = sect;
      }
      i = i + 1;
      <D.23503>:
      if (i < num_sections) goto <D.23502>; else goto <D.23504>;
      <D.23504>:
      dynsym = collect_syms (acfg, hash, &dyn_str_table, 0B, 0B);
      num_local_syms.10 = MEM[(int *)hash + 4B];
      num_local_syms = num_local_syms.10;
      symtab = collect_syms (acfg, 0B, &str_table, &secth, &num_local_syms);
      virt_offset = 288;
      file_offset = virt_offset;
      D.24357 = (long unsigned int) file_offset;
      secth[1].sh_offset = D.24357;
      D.24358 = secth[1].sh_offset;
      secth[1].sh_addr = D.24358;
      D.24359 = *hash;
      D.24360 = D.24359 + 2;
      D.24361 = hash + 4;
      D.24362 = *D.24361;
      D.24363 = D.24360 + D.24362;
      D.24364 = (unsigned int) D.24363;
      D.24365 = D.24364 * 4;
      size.11 = (int) D.24365;
      size = size.11;
      size.12 = size;
      file_offset = file_offset + size.12;
      virt_offset = file_offset;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[1].sh_size = D.24368;
      D.24357 = (long unsigned int) file_offset;
      secth[2].sh_offset = D.24357;
      D.24369 = secth[2].sh_offset;
      secth[2].sh_addr = D.24369;
      D.24361 = hash + 4;
      D.24362 = *D.24361;
      D.24370 = (unsigned int) D.24362;
      D.24371 = D.24370 * 24;
      size.13 = (int) D.24371;
      size = size.13;
      size.12 = size;
      file_offset = file_offset + size.12;
      virt_offset = file_offset;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[2].sh_size = D.24368;
      D.24357 = (long unsigned int) file_offset;
      secth[3].sh_offset = D.24357;
      D.24373 = secth[3].sh_offset;
      secth[3].sh_addr = D.24373;
      D.24374 = dyn_str_table.data;
      D.24375 = D.24374->len;
      size.14 = (int) D.24375;
      size = size.14;
      size.12 = size;
      file_offset = file_offset + size.12;
      virt_offset = file_offset;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[3].sh_size = D.24368;
      file_offset = file_offset + 3;
      file_offset = file_offset & -4;
      D.24357 = (long unsigned int) file_offset;
      secth[4].sh_offset = D.24357;
      D.24377 = secth[4].sh_offset;
      secth[4].sh_addr = D.24377;
      size = 0;
      size.12 = size;
      file_offset = file_offset + size.12;
      virt_offset = file_offset;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[4].sh_size = D.24368;
      D.24357 = (long unsigned int) file_offset;
      secth[5].sh_offset = D.24357;
      D.24378 = secth[5].sh_offset;
      secth[5].sh_addr = D.24378;
      D.24379 = acfg->num_relocs;
      D.24380 = (unsigned int) D.24379;
      D.24381 = D.24380 * 24;
      size.15 = (int) D.24381;
      size = size.15;
      size.12 = size;
      file_offset = file_offset + size.12;
      virt_offset = file_offset;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[5].sh_size = D.24368;
      D.24383 = secth[6].sh_addralign;
      D.24384 = (unsigned int) D.24383;
      file_offset.16 = (unsigned int) file_offset;
      D.24386 = D.24384 + file_offset.16;
      D.24387 = D.24386 + 4294967295;
      D.24383 = secth[6].sh_addralign;
      D.24384 = (unsigned int) D.24383;
      D.24388 = -D.24384;
      D.24389 = D.24387 & D.24388;
      file_offset = (int) D.24389;
      virt_offset = file_offset;
      D.24357 = (long unsigned int) file_offset;
      secth[6].sh_offset = D.24357;
      D.24390 = secth[6].sh_offset;
      secth[6].sh_addr = D.24390;
      D.24391 = sections[6];
      if (D.24391 != 0B) goto <D.24392>; else goto <D.24393>;
      <D.24392>:
      D.24391 = sections[6];
      D.24394 = D.24391->has_addr;
      if (D.24394 != 0) goto <D.24395>; else goto <D.24396>;
      <D.24395>:
      D.24391 = sections[6];
      D.24397 = D.24391->addr;
      secth[6].sh_addr = D.24397;
      D.24398 = secth[6].sh_flags;
      D.24399 = D.24398 & 18446744073709551613;
      secth[6].sh_flags = D.24399;
      <D.24396>:
      D.24391 = sections[6];
      size.17 = D.24391->cur_offset;
      size = size.17;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[6].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      <D.24393>:
      D.24401 = secth[7].sh_addralign;
      D.24402 = (unsigned int) D.24401;
      file_offset.16 = (unsigned int) file_offset;
      D.24403 = D.24402 + file_offset.16;
      D.24404 = D.24403 + 4294967295;
      D.24401 = secth[7].sh_addralign;
      D.24402 = (unsigned int) D.24401;
      D.24405 = -D.24402;
      D.24406 = D.24404 & D.24405;
      file_offset = (int) D.24406;
      virt_offset = file_offset;
      D.24407 = (long unsigned int) virt_offset;
      secth[7].sh_addr = D.24407;
      D.24357 = (long unsigned int) file_offset;
      secth[7].sh_offset = D.24357;
      D.24408 = sections[7];
      if (D.24408 != 0B) goto <D.24409>; else goto <D.24410>;
      <D.24409>:
      D.24408 = sections[7];
      size.18 = D.24408->cur_offset;
      size = size.18;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[7].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      size.12 = size;
      virt_offset = virt_offset + size.12;
      <D.24410>:
      D.24412 = secth[8].sh_addralign;
      D.24413 = (unsigned int) D.24412;
      file_offset.16 = (unsigned int) file_offset;
      D.24414 = D.24413 + file_offset.16;
      D.24415 = D.24414 + 4294967295;
      D.24412 = secth[8].sh_addralign;
      D.24413 = (unsigned int) D.24412;
      D.24416 = -D.24413;
      D.24417 = D.24415 & D.24416;
      file_offset = (int) D.24417;
      virt_offset = file_offset;
      virt_offset = virt_offset + 4096;
      D.24407 = (long unsigned int) virt_offset;
      secth[8].sh_addr = D.24407;
      D.24357 = (long unsigned int) file_offset;
      secth[8].sh_offset = D.24357;
      size = 224;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[8].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      size.12 = size;
      virt_offset = virt_offset + size.12;
      D.24418 = secth[9].sh_addralign;
      D.24419 = (unsigned int) D.24418;
      file_offset.16 = (unsigned int) file_offset;
      D.24420 = D.24419 + file_offset.16;
      D.24421 = D.24420 + 4294967295;
      D.24418 = secth[9].sh_addralign;
      D.24419 = (unsigned int) D.24418;
      D.24422 = -D.24419;
      D.24423 = D.24421 & D.24422;
      file_offset = (int) D.24423;
      D.24418 = secth[9].sh_addralign;
      D.24419 = (unsigned int) D.24418;
      virt_offset.19 = (unsigned int) virt_offset;
      D.24425 = D.24419 + virt_offset.19;
      D.24426 = D.24425 + 4294967295;
      D.24418 = secth[9].sh_addralign;
      D.24419 = (unsigned int) D.24418;
      D.24422 = -D.24419;
      D.24427 = D.24426 & D.24422;
      virt_offset = (int) D.24427;
      D.24407 = (long unsigned int) virt_offset;
      secth[9].sh_addr = D.24407;
      D.24357 = (long unsigned int) file_offset;
      secth[9].sh_offset = D.24357;
      size = 24;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[9].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      size.12 = size;
      virt_offset = virt_offset + size.12;
      D.24428 = secth[10].sh_addralign;
      D.24429 = (unsigned int) D.24428;
      file_offset.16 = (unsigned int) file_offset;
      D.24430 = D.24429 + file_offset.16;
      D.24431 = D.24430 + 4294967295;
      D.24428 = secth[10].sh_addralign;
      D.24429 = (unsigned int) D.24428;
      D.24432 = -D.24429;
      D.24433 = D.24431 & D.24432;
      file_offset = (int) D.24433;
      D.24428 = secth[10].sh_addralign;
      D.24429 = (unsigned int) D.24428;
      virt_offset.19 = (unsigned int) virt_offset;
      D.24434 = D.24429 + virt_offset.19;
      D.24435 = D.24434 + 4294967295;
      D.24428 = secth[10].sh_addralign;
      D.24429 = (unsigned int) D.24428;
      D.24432 = -D.24429;
      D.24436 = D.24435 & D.24432;
      virt_offset = (int) D.24436;
      D.24407 = (long unsigned int) virt_offset;
      secth[10].sh_addr = D.24407;
      D.24357 = (long unsigned int) file_offset;
      secth[10].sh_offset = D.24357;
      D.24437 = sections[10];
      if (D.24437 != 0B) goto <D.24438>; else goto <D.24439>;
      <D.24438>:
      D.24437 = sections[10];
      size.20 = D.24437->cur_offset;
      size = size.20;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[10].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      size.12 = size;
      virt_offset = virt_offset + size.12;
      <D.24439>:
      D.24441 = secth[11].sh_addralign;
      D.24442 = (unsigned int) D.24441;
      file_offset.16 = (unsigned int) file_offset;
      D.24443 = D.24442 + file_offset.16;
      D.24444 = D.24443 + 4294967295;
      D.24441 = secth[11].sh_addralign;
      D.24442 = (unsigned int) D.24441;
      D.24445 = -D.24442;
      D.24446 = D.24444 & D.24445;
      file_offset = (int) D.24446;
      D.24441 = secth[11].sh_addralign;
      D.24442 = (unsigned int) D.24441;
      virt_offset.19 = (unsigned int) virt_offset;
      D.24447 = D.24442 + virt_offset.19;
      D.24448 = D.24447 + 4294967295;
      D.24441 = secth[11].sh_addralign;
      D.24442 = (unsigned int) D.24441;
      D.24445 = -D.24442;
      D.24449 = D.24448 & D.24445;
      virt_offset = (int) D.24449;
      D.24407 = (long unsigned int) virt_offset;
      secth[11].sh_addr = D.24407;
      D.24357 = (long unsigned int) file_offset;
      secth[11].sh_offset = D.24357;
      D.24450 = sections[11];
      if (D.24450 != 0B) goto <D.24451>; else goto <D.24452>;
      <D.24451>:
      D.24450 = sections[11];
      size.21 = D.24450->cur_offset;
      size = size.21;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[11].sh_size = D.24368;
      <D.24452>:
      D.24454 = secth[12].sh_addralign;
      D.24455 = (unsigned int) D.24454;
      file_offset.16 = (unsigned int) file_offset;
      D.24456 = D.24455 + file_offset.16;
      D.24457 = D.24456 + 4294967295;
      D.24454 = secth[12].sh_addralign;
      D.24455 = (unsigned int) D.24454;
      D.24458 = -D.24455;
      D.24459 = D.24457 & D.24458;
      file_offset = (int) D.24459;
      D.24357 = (long unsigned int) file_offset;
      secth[12].sh_offset = D.24357;
      D.24460 = sections[12];
      if (D.24460 != 0B) goto <D.24461>; else goto <D.24462>;
      <D.24461>:
      D.24460 = sections[12];
      size.22 = D.24460->cur_offset;
      size = size.22;
      goto <D.24464>;
      <D.24462>:
      size = 0;
      <D.24464>:
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[12].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      D.24357 = (long unsigned int) file_offset;
      secth[13].sh_offset = D.24357;
      D.24465 = sections[13];
      if (D.24465 != 0B) goto <D.24466>; else goto <D.24467>;
      <D.24466>:
      D.24465 = sections[13];
      size.23 = D.24465->cur_offset;
      size = size.23;
      goto <D.24469>;
      <D.24467>:
      size = 0;
      <D.24469>:
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[13].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      D.24357 = (long unsigned int) file_offset;
      secth[14].sh_offset = D.24357;
      D.24470 = sections[14];
      if (D.24470 != 0B) goto <D.24471>; else goto <D.24472>;
      <D.24471>:
      D.24470 = sections[14];
      size.24 = D.24470->cur_offset;
      size = size.24;
      goto <D.24474>;
      <D.24472>:
      size = 0;
      <D.24474>:
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[14].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      D.24357 = (long unsigned int) file_offset;
      secth[15].sh_offset = D.24357;
      D.24475 = sections[15];
      if (D.24475 != 0B) goto <D.24476>; else goto <D.24477>;
      <D.24476>:
      D.24475 = sections[15];
      size.25 = D.24475->cur_offset;
      size = size.25;
      goto <D.24479>;
      <D.24477>:
      size = 0;
      <D.24479>:
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[15].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      D.24357 = (long unsigned int) file_offset;
      secth[16].sh_offset = D.24357;
      D.24480 = sections[16];
      if (D.24480 != 0B) goto <D.24481>; else goto <D.24482>;
      <D.24481>:
      D.24480 = sections[16];
      size.26 = D.24480->cur_offset;
      size = size.26;
      goto <D.24484>;
      <D.24482>:
      size = 0;
      <D.24484>:
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[16].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      D.24485 = secth[17].sh_addralign;
      D.24486 = (unsigned int) D.24485;
      file_offset.16 = (unsigned int) file_offset;
      D.24487 = D.24486 + file_offset.16;
      D.24488 = D.24487 + 4294967295;
      D.24485 = secth[17].sh_addralign;
      D.24486 = (unsigned int) D.24485;
      D.24489 = -D.24486;
      D.24490 = D.24488 & D.24489;
      file_offset = (int) D.24490;
      D.24357 = (long unsigned int) file_offset;
      secth[17].sh_offset = D.24357;
      D.24491 = sh_str_table.data;
      D.24492 = D.24491->len;
      size.27 = (int) D.24492;
      size = size.27;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[17].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      D.24494 = secth[18].sh_addralign;
      D.24495 = (unsigned int) D.24494;
      file_offset.16 = (unsigned int) file_offset;
      D.24496 = D.24495 + file_offset.16;
      D.24497 = D.24496 + 4294967295;
      D.24494 = secth[18].sh_addralign;
      D.24495 = (unsigned int) D.24494;
      D.24498 = -D.24495;
      D.24499 = D.24497 & D.24498;
      file_offset = (int) D.24499;
      D.24357 = (long unsigned int) file_offset;
      secth[18].sh_offset = D.24357;
      num_local_syms.28 = num_local_syms;
      num_local_syms.29 = (unsigned int) num_local_syms.28;
      D.24502 = num_local_syms.29 * 24;
      size.30 = (int) D.24502;
      size = size.30;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[18].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      D.24504 = secth[19].sh_addralign;
      D.24505 = (unsigned int) D.24504;
      file_offset.16 = (unsigned int) file_offset;
      D.24506 = D.24505 + file_offset.16;
      D.24507 = D.24506 + 4294967295;
      D.24504 = secth[19].sh_addralign;
      D.24505 = (unsigned int) D.24504;
      D.24508 = -D.24505;
      D.24509 = D.24507 & D.24508;
      file_offset = (int) D.24509;
      D.24357 = (long unsigned int) file_offset;
      secth[19].sh_offset = D.24357;
      D.24510 = str_table.data;
      D.24511 = D.24510->len;
      size.31 = (int) D.24511;
      size = size.31;
      size.12 = size;
      D.24368 = (long unsigned int) size.12;
      secth[19].sh_size = D.24368;
      size.12 = size;
      file_offset = file_offset + size.12;
      i = 1;
      goto <D.23506>;
      <D.23505>:
      D.24348 = section_info[i].esize;
      if (D.24348 != 0) goto <D.24513>; else goto <D.24514>;
      <D.24513>:
      D.24515 = secth[i].sh_size;
      D.24348 = section_info[i].esize;
      D.24349 = (long unsigned int) D.24348;
      D.24516 = D.24515 % D.24349;
      D.24517 = D.24516 != 0;
      D.24518 = (long int) D.24517;
      D.24519 = __builtin_expect (D.24518, 0);
      if (D.24519 != 0) goto <D.24520>; else goto <D.24521>;
      <D.24520>:
      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.24521>:
      <D.24514>:
      i = i + 1;
      <D.23506>:
      if (i <= 19) goto <D.23505>; else goto <D.23507>;
      <D.23507>:
      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] = 2;
      header.e_ident[5] = 1;
      header.e_ident[6] = 1;
      header.e_ident[7] = 0;
      header.e_ident[8] = 0;
      i = 9;
      goto <D.23509>;
      <D.23508>:
      header.e_ident[i] = 0;
      i = i + 1;
      <D.23509>:
      if (i <= 15) goto <D.23508>; else goto <D.23510>;
      <D.23510>:
      header.e_type = 3;
      header.e_machine = 62;
      header.e_version = 1;
      header.e_phoff = 64;
      header.e_ehsize = 64;
      header.e_phentsize = 56;
      header.e_phnum = 4;
      D.24522 = secth[6].sh_addr;
      header.e_entry = D.24522;
      header.e_shstrndx = 17;
      header.e_shentsize = 64;
      header.e_shnum = 20;
      D.24357 = (long unsigned int) file_offset;
      header.e_shoff = D.24357;
      i = 0;
      dynamic[i].d_tag = 4;
      D.24358 = secth[1].sh_offset;
      dynamic[i].d_un.d_val = D.24358;
      i = i + 1;
      dynamic[i].d_tag = 5;
      D.24373 = secth[3].sh_offset;
      dynamic[i].d_un.d_val = D.24373;
      i = i + 1;
      dynamic[i].d_tag = 6;
      D.24369 = secth[2].sh_offset;
      dynamic[i].d_un.d_val = D.24369;
      i = i + 1;
      dynamic[i].d_tag = 10;
      D.24374 = dyn_str_table.data;
      D.24375 = D.24374->len;
      dynamic[i].d_un.d_val = D.24375;
      i = i + 1;
      dynamic[i].d_tag = 11;
      dynamic[i].d_un.d_val = 24;
      i = i + 1;
      dynamic[i].d_tag = 7;
      D.24378 = secth[5].sh_offset;
      dynamic[i].d_un.d_val = D.24378;
      i = i + 1;
      dynamic[i].d_tag = 8;
      D.24523 = secth[5].sh_size;
      dynamic[i].d_un.d_val = D.24523;
      i = i + 1;
      dynamic[i].d_tag = 9;
      dynamic[i].d_un.d_val = 24;
      i = i + 1;
      dynamic[i].d_tag = 1879048186;
      D.24379 = acfg->num_relocs;
      D.24524 = (long unsigned int) D.24379;
      dynamic[i].d_un.d_val = D.24524;
      i = i + 1;
      memset (&progh, 0, 224);
      progh[0].p_type = 1;
      D.24525 = secth[8].sh_offset;
      progh[0].p_memsz = D.24525;
      D.24526 = progh[0].p_memsz;
      progh[0].p_filesz = D.24526;
      progh[0].p_align = 4096;
      progh[0].p_flags = 5;
      progh[1].p_type = 1;
      D.24525 = secth[8].sh_offset;
      progh[1].p_offset = D.24525;
      D.24527 = secth[8].sh_addr;
      progh[1].p_paddr = D.24527;
      D.24528 = progh[1].p_paddr;
      progh[1].p_vaddr = D.24528;
      D.24529 = secth[11].sh_offset;
      D.24525 = secth[8].sh_offset;
      D.24530 = D.24529 - D.24525;
      progh[1].p_filesz = D.24530;
      D.24531 = secth[11].sh_addr;
      D.24532 = secth[11].sh_size;
      D.24533 = D.24531 + D.24532;
      D.24527 = secth[8].sh_addr;
      D.24534 = D.24533 - D.24527;
      progh[1].p_memsz = D.24534;
      progh[1].p_align = 4096;
      progh[1].p_flags = 6;
      progh[2].p_type = 2;
      D.24525 = secth[8].sh_offset;
      progh[2].p_offset = D.24525;
      D.24527 = secth[8].sh_addr;
      progh[2].p_paddr = D.24527;
      D.24535 = progh[2].p_paddr;
      progh[2].p_vaddr = D.24535;
      D.24536 = secth[8].sh_size;
      progh[2].p_memsz = D.24536;
      D.24537 = progh[2].p_memsz;
      progh[2].p_filesz = D.24537;
      progh[2].p_align = 8;
      progh[2].p_flags = 6;
      progh[3].p_type = 1685382481;
      D.24525 = secth[8].sh_offset;
      progh[3].p_offset = D.24525;
      D.24527 = secth[8].sh_addr;
      progh[3].p_paddr = D.24527;
      D.24538 = progh[3].p_paddr;
      progh[3].p_vaddr = D.24538;
      D.24536 = secth[8].sh_size;
      progh[3].p_memsz = D.24536;
      D.24539 = progh[3].p_memsz;
      progh[3].p_filesz = D.24539;
      progh[3].p_align = 8;
      progh[3].p_flags = 6;
      i = 0;
      goto <D.23512>;
      <D.23511>:
      D.24540 = sections[i];
      if (D.24540 != 0B) goto <D.24541>; else goto <D.24542>;
      <D.24541>:
      D.24540 = sections[i];
      D.24543 = secth[i].sh_offset;
      D.24544 = (int) D.24543;
      D.24540->file_offset = D.24544;
      D.24540 = sections[i];
      D.24545 = secth[i].sh_addr;
      D.24546 = (int) D.24545;
      D.24540->virt_offset = D.24546;
      <D.24542>:
      i = i + 1;
      <D.23512>:
      if (i <= 19) goto <D.23511>; else goto <D.23513>;
      <D.23513>:
      reloc_symbols (acfg, dynsym, &secth, &dyn_str_table, 1);
      reloc_symbols (acfg, symtab, &secth, &str_table, 0);
      relocs = resolve_relocations (acfg);
      D.24547 = acfg->fp;
      if (D.24547 == 0B) goto <D.24548>; else goto <D.24549>;
      <D.24548>:
      file_offset.16 = (unsigned int) file_offset;
      D.24550 = file_offset.16 + 1280;
      D.24551 = (int) D.24550;
      acfg->out_buf_size = D.24551;
      D.24552 = acfg->out_buf_size;
      D.24553 = (long unsigned int) D.24552;
      D.24554 = monoeg_malloc (D.24553);
      acfg->out_buf = D.24554;
      <D.24549>:
      bin_writer_fwrite (acfg, &header, 64, 1);
      bin_writer_fwrite (acfg, &progh, 224, 1);
      D.24359 = *hash;
      D.24361 = hash + 4;
      D.24362 = *D.24361;
      D.24555 = D.24359 + D.24362;
      D.24556 = D.24555 + 2;
      D.24557 = (long unsigned int) D.24556;
      D.24558 = D.24557 * 4;
      bin_writer_fwrite (acfg, hash, D.24558, 1);
      D.24361 = hash + 4;
      D.24362 = *D.24361;
      D.24559 = (long unsigned int) D.24362;
      D.24560 = D.24559 * 24;
      bin_writer_fwrite (acfg, dynsym, D.24560, 1);
      D.24374 = dyn_str_table.data;
      D.24375 = D.24374->len;
      D.24374 = dyn_str_table.data;
      D.24561 = D.24374->str;
      bin_writer_fwrite (acfg, D.24561, D.24375, 1);
      D.24377 = secth[4].sh_offset;
      D.24562 = (int) D.24377;
      bin_writer_fseek (acfg, D.24562);
      D.24379 = acfg->num_relocs;
      D.24563 = (long unsigned int) D.24379;
      bin_writer_fwrite (acfg, relocs, 16, D.24563);
      D.24378 = secth[5].sh_offset;
      D.24564 = (int) D.24378;
      bin_writer_fseek (acfg, D.24564);
      D.24523 = secth[5].sh_size;
      bin_writer_fwrite (acfg, relocs, D.24523, 1);
      D.24391 = sections[6];
      if (D.24391 != 0B) goto <D.24565>; else goto <D.24566>;
      <D.24565>:
      D.24390 = secth[6].sh_offset;
      D.24567 = (int) D.24390;
      bin_writer_fseek (acfg, D.24567);
      D.24391 = sections[6];
      size.17 = D.24391->cur_offset;
      D.24568 = (long unsigned int) size.17;
      D.24391 = sections[6];
      D.24569 = D.24391->data;
      bin_writer_fwrite (acfg, D.24569, D.24568, 1);
      <D.24566>:
      D.24408 = sections[7];
      if (D.24408 != 0B) goto <D.24570>; else goto <D.24571>;
      <D.24570>:
      D.24572 = secth[7].sh_offset;
      D.24573 = (int) D.24572;
      bin_writer_fseek (acfg, D.24573);
      D.24408 = sections[7];
      size.18 = D.24408->cur_offset;
      D.24574 = (long unsigned int) size.18;
      D.24408 = sections[7];
      D.24575 = D.24408->data;
      bin_writer_fwrite (acfg, D.24575, D.24574, 1);
      <D.24571>:
      D.24525 = secth[8].sh_offset;
      D.24576 = (int) D.24525;
      bin_writer_fseek (acfg, D.24576);
      bin_writer_fwrite (acfg, &dynamic, 224, 1);
      D.24527 = secth[8].sh_addr;
      size.32 = (int) D.24527;
      size = size.32;
      D.24578 = secth[9].sh_offset;
      D.24579 = (int) D.24578;
      bin_writer_fseek (acfg, D.24579);
      bin_writer_fwrite (acfg, &size, 4, 1);
      i = 0;
      goto <D.23516>;
      <D.23515>:
      {
        int sect;

        sect = normal_sections[i];
        D.24580 = sections[sect];
        if (D.24580 != 0B) goto <D.24581>; else goto <D.24582>;
        <D.24581>:
        D.24583 = secth[sect].sh_offset;
        D.24584 = (int) D.24583;
        bin_writer_fseek (acfg, D.24584);
        D.24580 = sections[sect];
        D.24585 = D.24580->cur_offset;
        D.24586 = (long unsigned int) D.24585;
        D.24580 = sections[sect];
        D.24587 = D.24580->data;
        bin_writer_fwrite (acfg, D.24587, D.24586, 1);
        <D.24582>:
      }
      i = i + 1;
      <D.23516>:
      i.33 = (unsigned int) i;
      if (i.33 <= 5) goto <D.23515>; else goto <D.23517>;
      <D.23517>:
      D.24589 = secth[17].sh_offset;
      D.24590 = (int) D.24589;
      bin_writer_fseek (acfg, D.24590);
      D.24491 = sh_str_table.data;
      D.24492 = D.24491->len;
      D.24491 = sh_str_table.data;
      D.24591 = D.24491->str;
      bin_writer_fwrite (acfg, D.24591, D.24492, 1);
      D.24592 = secth[18].sh_offset;
      D.24593 = (int) D.24592;
      bin_writer_fseek (acfg, D.24593);
      num_local_syms.28 = num_local_syms;
      D.24594 = (long unsigned int) num_local_syms.28;
      D.24595 = D.24594 * 24;
      bin_writer_fwrite (acfg, symtab, D.24595, 1);
      D.24596 = secth[19].sh_offset;
      D.24597 = (int) D.24596;
      bin_writer_fseek (acfg, D.24597);
      D.24510 = str_table.data;
      D.24511 = D.24510->len;
      D.24510 = str_table.data;
      D.24598 = D.24510->str;
      bin_writer_fwrite (acfg, D.24598, D.24511, 1);
      bin_writer_fseek (acfg, file_offset);
      bin_writer_fwrite (acfg, &secth, 1280, 1);
      D.24547 = acfg->fp;
      if (D.24547 != 0B) goto <D.24599>; else goto <D.24600>;
      <D.24599>:
      D.24547 = acfg->fp;
      fclose (D.24547);
      <D.24600>:
      D.24601 = 0;
      return D.24601;
    }
  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.24604;
  struct GString * D.24607;
  struct GHashTable * D.24608;
  struct GHashTable * D.24609;
  void * D.24610;
  long int D.24611;
  int D.24614;
  long unsigned int D.24615;
  long unsigned int D.24616;
  void * D.24617;
  int idx;

  D.24604 = table->data;
  if (D.24604 == 0B) goto <D.24605>; else goto <D.24606>;
  <D.24605>:
  D.24607 = monoeg_g_string_new_len ("", 1);
  table->data = D.24607;
  D.24608 = monoeg_g_hash_table_new (monoeg_g_str_hash, monoeg_g_str_equal);
  table->hash = D.24608;
  <D.24606>:
  D.24609 = table->hash;
  D.24610 = monoeg_g_hash_table_lookup (D.24609, value);
  D.24611 = (long int) D.24610;
  idx = (int) D.24611;
  if (idx != 0) goto <D.24612>; else goto <D.24613>;
  <D.24612>:
  D.24614 = idx;
  return D.24614;
  <D.24613>:
  D.24604 = table->data;
  D.24615 = D.24604->len;
  idx = (int) D.24615;
  D.24604 = table->data;
  monoeg_g_string_append (D.24604, value);
  D.24604 = table->data;
  monoeg_g_string_append_c (D.24604, 0);
  D.24616 = (long unsigned int) idx;
  D.24617 = (void *) D.24616;
  D.24609 = table->hash;
  monoeg_g_hash_table_insert_replace (D.24609, value, D.24617, 0);
  D.24614 = idx;
  return D.24614;
}


collect_sections (struct MonoImageWriter * acfg, struct ElfSectHeader * sheaders, struct BinSection * * out, int num)
{
  int D.24619;
  int num_sections.34;
  long unsigned int D.24623;
  long unsigned int D.24624;
  struct BinSection * * D.24625;
  _Bool D.24626;
  long int D.24627;
  long int D.24628;
  int D.23300;
  char * D.24633;
  long unsigned int D.24634;
  long unsigned int D.24635;
  struct BinSection * * D.24636;
  struct BinSection * D.24637;
  char * D.24638;
  int D.24641;
  int i;
  int j;
  int maxs;
  int num_sections;
  struct BinSection * sect;

  num_sections = 0;
  maxs = 0;
  sect = acfg->sections;
  goto <D.23290>;
  <D.23289>:
  D.24619 = sect->subsection;
  if (D.24619 == 0) goto <D.24620>; else goto <D.24621>;
  <D.24620>:
  num_sections.34 = num_sections;
  num_sections = num_sections.34 + 1;
  D.24623 = (long unsigned int) num_sections.34;
  D.24624 = D.24623 * 8;
  D.24625 = out + D.24624;
  *D.24625 = sect;
  D.24626 = num_sections >= num;
  D.24627 = (long int) D.24626;
  D.24628 = __builtin_expect (D.24627, 0);
  if (D.24628 != 0) goto <D.24629>; else goto <D.24630>;
  <D.24629>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 830, "num_sections < num");
  <D.24630>:
  <D.24621>:
  D.24619 = sect->subsection;
  maxs = MAX_EXPR <D.24619, maxs>;
  sect = sect->next;
  <D.23290>:
  if (sect != 0B) goto <D.23289>; else goto <D.23291>;
  <D.23291>:
  i = 0;
  goto <D.23308>;
  <D.23307>:
  j = 1;
  goto <D.23305>;
  <D.23304>:
  sect = acfg->sections;
  goto <D.23302>;
  <D.23301>:
  D.24619 = sect->subsection;
  if (D.24619 == j) goto <D.24631>; else goto <D.24632>;
  <D.24631>:
  {
    size_t __s1_len;
    size_t __s2_len;

    D.24633 = sect->name;
    D.24634 = (long unsigned int) i;
    D.24635 = D.24634 * 8;
    D.24636 = out + D.24635;
    D.24637 = *D.24636;
    D.24638 = D.24637->name;
    D.23300 = __builtin_strcmp (D.24638, D.24633);
  }
  if (D.23300 == 0) goto <D.24639>; else goto <D.24640>;
  <D.24639>:
  D.24634 = (long unsigned int) i;
  D.24635 = D.24634 * 8;
  D.24636 = out + D.24635;
  D.24637 = *D.24636;
  append_subsection (acfg, sheaders, D.24637, sect);
  <D.24640>:
  <D.24632>:
  sect = sect->next;
  <D.23302>:
  if (sect != 0B) goto <D.23301>; else goto <D.23303>;
  <D.23303>:
  j = j + 1;
  <D.23305>:
  if (j <= maxs) goto <D.23304>; else goto <D.23306>;
  <D.23306>:
  i = i + 1;
  <D.23308>:
  if (i < num_sections) goto <D.23307>; else goto <D.23309>;
  <D.23309>:
  D.24641 = num_sections;
  return D.24641;
}


append_subsection (struct MonoImageWriter * acfg, struct ElfSectHeader * sheaders, struct BinSection * sect, struct BinSection * add)
{
  int D.23277;
  int iftmp.35;
  int D.23276;
  const char[12] * D.24646;
  unsigned char D.24647;
  int D.24648;
  unsigned char D.24649;
  int D.24650;
  _Bool D.24651;
  _Bool D.24652;
  _Bool D.24653;
  const unsigned char * D.24656;
  unsigned char D.24657;
  int D.24658;
  const unsigned char * D.24659;
  unsigned char D.24660;
  int D.24661;
  _Bool D.24662;
  _Bool D.24663;
  const unsigned char * D.24666;
  unsigned char D.24667;
  int D.24668;
  const unsigned char * D.24669;
  unsigned char D.24670;
  int D.24671;
  _Bool D.24672;
  _Bool D.24673;
  const unsigned char * D.24676;
  unsigned char D.24677;
  int D.24678;
  const unsigned char * D.24679;
  unsigned char D.24680;
  int D.24681;
  char * D.24683;
  int D.24686;
  long unsigned int D.24687;
  guint8 * D.24688;
  guint8 * D.24689;
  int D.24690;
  sizetype D.24691;
  guint8 * D.24692;
  int D.24693;
  int offset;

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

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

      __s2 = sect->name;
      D.24646 = ".debug_line";
      D.24647 = MEM[(const unsigned char *)D.24646];
      D.24648 = (int) D.24647;
      D.24649 = *__s2;
      D.24650 = (int) D.24649;
      __result = D.24648 - D.24650;
      {
        D.24651 = __s2_len != 0;
        D.24652 = __result == 0;
        D.24653 = D.24651 & D.24652;
        if (D.24653 != 0) goto <D.24654>; else goto <D.24655>;
        <D.24654>:
        D.24656 = &MEM[(void *)".debug_line" + 1B];
        D.24657 = *D.24656;
        D.24658 = (int) D.24657;
        D.24659 = __s2 + 1;
        D.24660 = *D.24659;
        D.24661 = (int) D.24660;
        __result = D.24658 - D.24661;
        D.24662 = __s2_len > 1;
        D.24652 = __result == 0;
        D.24663 = D.24662 & D.24652;
        if (D.24663 != 0) goto <D.24664>; else goto <D.24665>;
        <D.24664>:
        D.24666 = &MEM[(void *)".debug_line" + 2B];
        D.24667 = *D.24666;
        D.24668 = (int) D.24667;
        D.24669 = __s2 + 2;
        D.24670 = *D.24669;
        D.24671 = (int) D.24670;
        __result = D.24668 - D.24671;
        D.24672 = __s2_len > 2;
        D.24652 = __result == 0;
        D.24673 = D.24672 & D.24652;
        if (D.24673 != 0) goto <D.24674>; else goto <D.24675>;
        <D.24674>:
        D.24676 = &MEM[(void *)".debug_line" + 3B];
        D.24677 = *D.24676;
        D.24678 = (int) D.24677;
        D.24679 = __s2 + 3;
        D.24680 = *D.24679;
        D.24681 = (int) D.24680;
        __result = D.24678 - D.24681;
        <D.24675>:
        <D.24665>:
        <D.24655>:
      }
      D.23276 = __result;
    }
    iftmp.35 = -D.23276;
    goto <D.24682>;
    <D.24645>:
    D.24683 = sect->name;
    iftmp.35 = __builtin_strcmp (D.24683, ".debug_line");
    <D.24682>:
    D.23277 = iftmp.35;
  }
  if (D.23277 != 0) goto <D.24684>; else goto <D.24685>;
  <D.24684>:
  offset = offset + 7;
  offset = offset & -8;
  <D.24685>:
  bin_writer_emit_ensure_buffer (sect, offset);
  sect->cur_offset = offset;
  D.24686 = add->cur_offset;
  bin_writer_emit_ensure_buffer (sect, D.24686);
  D.24686 = add->cur_offset;
  D.24687 = (long unsigned int) D.24686;
  D.24688 = add->data;
  D.24689 = sect->data;
  D.24690 = sect->cur_offset;
  D.24691 = (sizetype) D.24690;
  D.24692 = D.24689 + D.24691;
  memcpy (D.24692, D.24688, D.24687);
  add->parent = sect;
  D.24690 = sect->cur_offset;
  D.24686 = add->cur_offset;
  D.24693 = D.24690 + D.24686;
  sect->cur_offset = D.24693;
  add->cur_offset = offset;
  add->data = 0B;
  add->data_len = 0;
}


build_hash (struct MonoImageWriter * acfg, int num_sections, struct ElfStrTable * dynstr)
{
  int D.24694;
  char * D.24697;
  int D.24698;
  long unsigned int D.24699;
  long unsigned int D.24700;
  int * D.24701;
  int * D.24702;
  int * data;
  int num_symbols;
  struct BinSymbol * symbol;

  num_symbols = num_sections + 4;
  symbol = acfg->symbols;
  goto <D.23328>;
  <D.23327>:
  D.24694 = symbol->is_global;
  if (D.24694 == 0) goto <D.24695>; else goto <D.24696>;
  <D.24695>:
  // predicted unlikely by continue predictor.
  goto <D.23326>;
  <D.24696>:
  num_symbols = num_symbols + 1;
  D.24697 = symbol->name;
  str_table_add (dynstr, D.24697);
  <D.23326>:
  symbol = symbol->next;
  <D.23328>:
  if (symbol != 0B) goto <D.23327>; else goto <D.23329>;
  <D.23329>:
  str_table_add (dynstr, "__bss_start");
  str_table_add (dynstr, "_edata");
  str_table_add (dynstr, "_end");
  D.24698 = num_symbols + 19;
  D.24699 = (long unsigned int) D.24698;
  D.24700 = D.24699 * 4;
  data = monoeg_malloc0 (D.24700);
  *data = 17;
  D.24701 = data + 4;
  *D.24701 = num_symbols;
  D.24702 = data;
  return D.24702;
}


collect_syms (struct MonoImageWriter * acfg, int * hash, struct ElfStrTable * strtab, struct ElfSectHeader * sheaders, int * num_syms)
{
  int * D.24706;
  int D.24707;
  long unsigned int D.24708;
  long unsigned int D.24709;
  int D.24711;
  long unsigned int D.24712;
  long unsigned int D.24713;
  long unsigned int D.24716;
  long unsigned int D.24717;
  struct ElfSymbol * D.24718;
  short unsigned int D.24719;
  long unsigned int D.24720;
  long unsigned int D.24721;
  struct ElfSectHeader * D.24722;
  long unsigned int D.24723;
  struct BinSection * D.24725;
  int D.23369;
  int iftmp.36;
  int D.23368;
  const char[6] * D.24731;
  unsigned char D.24732;
  int D.24733;
  unsigned char D.24734;
  int D.24735;
  _Bool D.24736;
  _Bool D.24737;
  _Bool D.24738;
  const unsigned char * D.24741;
  unsigned char D.24742;
  int D.24743;
  const unsigned char * D.24744;
  unsigned char D.24745;
  int D.24746;
  _Bool D.24747;
  _Bool D.24748;
  const unsigned char * D.24751;
  unsigned char D.24752;
  int D.24753;
  const unsigned char * D.24754;
  unsigned char D.24755;
  int D.24756;
  _Bool D.24757;
  _Bool D.24758;
  const unsigned char * D.24761;
  unsigned char D.24762;
  int D.24763;
  const unsigned char * D.24764;
  unsigned char D.24765;
  int D.24766;
  char * D.24768;
  int D.24771;
  long unsigned int D.24772;
  int D.23378;
  int iftmp.37;
  int D.23377;
  const char[8] * D.24777;
  unsigned char D.24778;
  int D.24779;
  unsigned char D.24780;
  int D.24781;
  _Bool D.24782;
  _Bool D.24783;
  _Bool D.24784;
  const unsigned char * D.24787;
  unsigned char D.24788;
  int D.24789;
  const unsigned char * D.24790;
  unsigned char D.24791;
  int D.24792;
  _Bool D.24793;
  _Bool D.24794;
  const unsigned char * D.24797;
  unsigned char D.24798;
  int D.24799;
  const unsigned char * D.24800;
  unsigned char D.24801;
  int D.24802;
  _Bool D.24803;
  _Bool D.24804;
  const unsigned char * D.24807;
  unsigned char D.24808;
  int D.24809;
  const unsigned char * D.24810;
  unsigned char D.24811;
  int D.24812;
  int D.23387;
  int iftmp.38;
  int D.23386;
  const char[6] * D.24820;
  unsigned char D.24821;
  int D.24822;
  unsigned char D.24823;
  int D.24824;
  _Bool D.24825;
  _Bool D.24826;
  _Bool D.24827;
  const unsigned char * D.24830;
  unsigned char D.24831;
  int D.24832;
  const unsigned char * D.24833;
  unsigned char D.24834;
  int D.24835;
  _Bool D.24836;
  _Bool D.24837;
  const unsigned char * D.24840;
  unsigned char D.24841;
  int D.24842;
  const unsigned char * D.24843;
  unsigned char D.24844;
  int D.24845;
  _Bool D.24846;
  _Bool D.24847;
  const unsigned char * D.24850;
  unsigned char D.24851;
  int D.24852;
  const unsigned char * D.24853;
  unsigned char D.24854;
  int D.24855;
  int D.23396;
  int iftmp.39;
  int D.23395;
  const char[5] * D.24863;
  unsigned char D.24864;
  int D.24865;
  unsigned char D.24866;
  int D.24867;
  _Bool D.24868;
  _Bool D.24869;
  _Bool D.24870;
  const unsigned char * D.24873;
  unsigned char D.24874;
  int D.24875;
  const unsigned char * D.24876;
  unsigned char D.24877;
  int D.24878;
  _Bool D.24879;
  _Bool D.24880;
  const unsigned char * D.24883;
  unsigned char D.24884;
  int D.24885;
  const unsigned char * D.24886;
  unsigned char D.24887;
  int D.24888;
  _Bool D.24889;
  _Bool D.24890;
  const unsigned char * D.24893;
  unsigned char D.24894;
  int D.24895;
  const unsigned char * D.24896;
  unsigned char D.24897;
  int D.24898;
  int D.24902;
  unsigned char iftmp.40;
  unsigned char iftmp.41;
  int D.24912;
  unsigned char D.24916;
  char * D.24917;
  int D.24918;
  unsigned int D.24919;
  Elf64_Half iftmp.42;
  int D.24923;
  int D.24925;
  struct GHashTable * D.24926;
  int D.24929;
  int D.24930;
  int D.24931;
  int D.24932;
  long unsigned int D.24933;
  int D.24935;
  long unsigned int D.24936;
  char * D.24937;
  _Bool D.24940;
  long int D.24941;
  long int D.24942;
  int D.24945;
  int D.24946;
  int D.24947;
  long unsigned int D.24948;
  int D.24949;
  unsigned int D.24950;
  int D.24951;
  unsigned int D.24952;
  int D.24953;
  unsigned int D.24954;
  int D.24959;
  sizetype D.24960;
  sizetype D.24961;
  sizetype D.24962;
  unsigned int D.24963;
  struct GString * D.24966;
  char * D.24967;
  sizetype D.24968;
  const unsigned char * D.24969;
  long unsigned int D.24970;
  long unsigned int D.24971;
  long unsigned int D.24972;
  long unsigned int D.24973;
  int * D.24974;
  int D.24975;
  long unsigned int D.24978;
  int * D.24979;
  struct ElfSymbol * D.24981;
  struct ElfSymbol * symbols;
  struct BinSymbol * symbol;
  struct BinSection * section;
  int i;
  int * bucket;
  int * chain;
  long unsigned int hashc;

  if (hash != 0B) goto <D.24704>; else goto <D.24705>;
  <D.24704>:
  D.24706 = hash + 4;
  D.24707 = *D.24706;
  D.24708 = (long unsigned int) D.24707;
  D.24709 = D.24708 * 24;
  symbols = monoeg_malloc0 (D.24709);
  goto <D.24710>;
  <D.24705>:
  i = 0;
  symbol = acfg->symbols;
  goto <D.23354>;
  <D.23353>:
  i = i + 1;
  symbol = symbol->next;
  <D.23354>:
  if (symbol != 0B) goto <D.23353>; else goto <D.23355>;
  <D.23355>:
  D.24711 = i + 30;
  D.24712 = (long unsigned int) D.24711;
  D.24713 = D.24712 * 24;
  symbols = monoeg_malloc0 (D.24713);
  <D.24710>:
  i = 1;
  if (sheaders != 0B) goto <D.24714>; else goto <D.24715>;
  <D.24714>:
  {
    int j;

    j = 1;
    goto <D.23358>;
    <D.23357>:
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24718->st_info = 3;
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24719 = (short unsigned int) j;
    D.24718->st_shndx = D.24719;
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24720 = (long unsigned int) j;
    D.24721 = D.24720 * 64;
    D.24722 = sheaders + D.24721;
    D.24723 = D.24722->sh_addr;
    D.24718->st_value = D.24723;
    i = i + 1;
    j = j + 1;
    <D.23358>:
    if (j <= 19) goto <D.23357>; else goto <D.23359>;
    <D.23359>:
  }
  goto <D.24724>;
  <D.24715>:
  section = acfg->sections;
  goto <D.23398>;
  <D.23397>:
  D.24725 = section->parent;
  if (D.24725 != 0B) goto <D.24726>; else goto <D.24727>;
  <D.24726>:
  // predicted unlikely by continue predictor.
  goto <D.23360>;
  <D.24727>:
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_info = 3;
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = section->name;
      D.24731 = ".text";
      D.24732 = MEM[(const unsigned char *)D.24731];
      D.24733 = (int) D.24732;
      D.24734 = *__s2;
      D.24735 = (int) D.24734;
      __result = D.24733 - D.24735;
      {
        D.24736 = __s2_len != 0;
        D.24737 = __result == 0;
        D.24738 = D.24736 & D.24737;
        if (D.24738 != 0) goto <D.24739>; else goto <D.24740>;
        <D.24739>:
        D.24741 = &MEM[(void *)".text" + 1B];
        D.24742 = *D.24741;
        D.24743 = (int) D.24742;
        D.24744 = __s2 + 1;
        D.24745 = *D.24744;
        D.24746 = (int) D.24745;
        __result = D.24743 - D.24746;
        D.24747 = __s2_len > 1;
        D.24737 = __result == 0;
        D.24748 = D.24747 & D.24737;
        if (D.24748 != 0) goto <D.24749>; else goto <D.24750>;
        <D.24749>:
        D.24751 = &MEM[(void *)".text" + 2B];
        D.24752 = *D.24751;
        D.24753 = (int) D.24752;
        D.24754 = __s2 + 2;
        D.24755 = *D.24754;
        D.24756 = (int) D.24755;
        __result = D.24753 - D.24756;
        D.24757 = __s2_len > 2;
        D.24737 = __result == 0;
        D.24758 = D.24757 & D.24737;
        if (D.24758 != 0) goto <D.24759>; else goto <D.24760>;
        <D.24759>:
        D.24761 = &MEM[(void *)".text" + 3B];
        D.24762 = *D.24761;
        D.24763 = (int) D.24762;
        D.24764 = __s2 + 3;
        D.24765 = *D.24764;
        D.24766 = (int) D.24765;
        __result = D.24763 - D.24766;
        <D.24760>:
        <D.24750>:
        <D.24740>:
      }
      D.23368 = __result;
    }
    iftmp.36 = -D.23368;
    goto <D.24767>;
    <D.24730>:
    D.24768 = section->name;
    iftmp.36 = __builtin_strcmp (D.24768, ".text");
    <D.24767>:
    D.23369 = iftmp.36;
  }
  if (D.23369 == 0) goto <D.24769>; else goto <D.24770>;
  <D.24769>:
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_shndx = 6;
  section->shidx = 6;
  section->file_offset = 4096;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24771 = section->virt_offset;
  D.24772 = (long unsigned int) D.24771;
  D.24718->st_value = D.24772;
  goto <D.24773>;
  <D.24770>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = section->name;
      D.24777 = ".rodata";
      D.24778 = MEM[(const unsigned char *)D.24777];
      D.24779 = (int) D.24778;
      D.24780 = *__s2;
      D.24781 = (int) D.24780;
      __result = D.24779 - D.24781;
      {
        D.24782 = __s2_len != 0;
        D.24783 = __result == 0;
        D.24784 = D.24782 & D.24783;
        if (D.24784 != 0) goto <D.24785>; else goto <D.24786>;
        <D.24785>:
        D.24787 = &MEM[(void *)".rodata" + 1B];
        D.24788 = *D.24787;
        D.24789 = (int) D.24788;
        D.24790 = __s2 + 1;
        D.24791 = *D.24790;
        D.24792 = (int) D.24791;
        __result = D.24789 - D.24792;
        D.24793 = __s2_len > 1;
        D.24783 = __result == 0;
        D.24794 = D.24793 & D.24783;
        if (D.24794 != 0) goto <D.24795>; else goto <D.24796>;
        <D.24795>:
        D.24797 = &MEM[(void *)".rodata" + 2B];
        D.24798 = *D.24797;
        D.24799 = (int) D.24798;
        D.24800 = __s2 + 2;
        D.24801 = *D.24800;
        D.24802 = (int) D.24801;
        __result = D.24799 - D.24802;
        D.24803 = __s2_len > 2;
        D.24783 = __result == 0;
        D.24804 = D.24803 & D.24783;
        if (D.24804 != 0) goto <D.24805>; else goto <D.24806>;
        <D.24805>:
        D.24807 = &MEM[(void *)".rodata" + 3B];
        D.24808 = *D.24807;
        D.24809 = (int) D.24808;
        D.24810 = __s2 + 3;
        D.24811 = *D.24810;
        D.24812 = (int) D.24811;
        __result = D.24809 - D.24812;
        <D.24806>:
        <D.24796>:
        <D.24786>:
      }
      D.23377 = __result;
    }
    iftmp.37 = -D.23377;
    goto <D.24813>;
    <D.24776>:
    D.24768 = section->name;
    iftmp.37 = __builtin_strcmp (D.24768, ".rodata");
    <D.24813>:
    D.23378 = iftmp.37;
  }
  if (D.23378 == 0) goto <D.24814>; else goto <D.24815>;
  <D.24814>:
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_shndx = 7;
  section->shidx = 7;
  section->file_offset = 4096;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24771 = section->virt_offset;
  D.24772 = (long unsigned int) D.24771;
  D.24718->st_value = D.24772;
  goto <D.24816>;
  <D.24815>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = section->name;
      D.24820 = ".data";
      D.24821 = MEM[(const unsigned char *)D.24820];
      D.24822 = (int) D.24821;
      D.24823 = *__s2;
      D.24824 = (int) D.24823;
      __result = D.24822 - D.24824;
      {
        D.24825 = __s2_len != 0;
        D.24826 = __result == 0;
        D.24827 = D.24825 & D.24826;
        if (D.24827 != 0) goto <D.24828>; else goto <D.24829>;
        <D.24828>:
        D.24830 = &MEM[(void *)".data" + 1B];
        D.24831 = *D.24830;
        D.24832 = (int) D.24831;
        D.24833 = __s2 + 1;
        D.24834 = *D.24833;
        D.24835 = (int) D.24834;
        __result = D.24832 - D.24835;
        D.24836 = __s2_len > 1;
        D.24826 = __result == 0;
        D.24837 = D.24836 & D.24826;
        if (D.24837 != 0) goto <D.24838>; else goto <D.24839>;
        <D.24838>:
        D.24840 = &MEM[(void *)".data" + 2B];
        D.24841 = *D.24840;
        D.24842 = (int) D.24841;
        D.24843 = __s2 + 2;
        D.24844 = *D.24843;
        D.24845 = (int) D.24844;
        __result = D.24842 - D.24845;
        D.24846 = __s2_len > 2;
        D.24826 = __result == 0;
        D.24847 = D.24846 & D.24826;
        if (D.24847 != 0) goto <D.24848>; else goto <D.24849>;
        <D.24848>:
        D.24850 = &MEM[(void *)".data" + 3B];
        D.24851 = *D.24850;
        D.24852 = (int) D.24851;
        D.24853 = __s2 + 3;
        D.24854 = *D.24853;
        D.24855 = (int) D.24854;
        __result = D.24852 - D.24855;
        <D.24849>:
        <D.24839>:
        <D.24829>:
      }
      D.23386 = __result;
    }
    iftmp.38 = -D.23386;
    goto <D.24856>;
    <D.24819>:
    D.24768 = section->name;
    iftmp.38 = __builtin_strcmp (D.24768, ".data");
    <D.24856>:
    D.23387 = iftmp.38;
  }
  if (D.23387 == 0) goto <D.24857>; else goto <D.24858>;
  <D.24857>:
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_shndx = 10;
  section->shidx = 10;
  section->file_offset = 4124;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24771 = section->virt_offset;
  D.24772 = (long unsigned int) D.24771;
  D.24718->st_value = D.24772;
  goto <D.24859>;
  <D.24858>:
  {
    size_t __s1_len;
    size_t __s2_len;

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

      __s2 = section->name;
      D.24863 = ".bss";
      D.24864 = MEM[(const unsigned char *)D.24863];
      D.24865 = (int) D.24864;
      D.24866 = *__s2;
      D.24867 = (int) D.24866;
      __result = D.24865 - D.24867;
      {
        D.24868 = __s2_len != 0;
        D.24869 = __result == 0;
        D.24870 = D.24868 & D.24869;
        if (D.24870 != 0) goto <D.24871>; else goto <D.24872>;
        <D.24871>:
        D.24873 = &MEM[(void *)".bss" + 1B];
        D.24874 = *D.24873;
        D.24875 = (int) D.24874;
        D.24876 = __s2 + 1;
        D.24877 = *D.24876;
        D.24878 = (int) D.24877;
        __result = D.24875 - D.24878;
        D.24879 = __s2_len > 1;
        D.24869 = __result == 0;
        D.24880 = D.24879 & D.24869;
        if (D.24880 != 0) goto <D.24881>; else goto <D.24882>;
        <D.24881>:
        D.24883 = &MEM[(void *)".bss" + 2B];
        D.24884 = *D.24883;
        D.24885 = (int) D.24884;
        D.24886 = __s2 + 2;
        D.24887 = *D.24886;
        D.24888 = (int) D.24887;
        __result = D.24885 - D.24888;
        D.24889 = __s2_len > 2;
        D.24869 = __result == 0;
        D.24890 = D.24889 & D.24869;
        if (D.24890 != 0) goto <D.24891>; else goto <D.24892>;
        <D.24891>:
        D.24893 = &MEM[(void *)".bss" + 3B];
        D.24894 = *D.24893;
        D.24895 = (int) D.24894;
        D.24896 = __s2 + 3;
        D.24897 = *D.24896;
        D.24898 = (int) D.24897;
        __result = D.24895 - D.24898;
        <D.24892>:
        <D.24882>:
        <D.24872>:
      }
      D.23395 = __result;
    }
    iftmp.39 = -D.23395;
    goto <D.24899>;
    <D.24862>:
    D.24768 = section->name;
    iftmp.39 = __builtin_strcmp (D.24768, ".bss");
    <D.24899>:
    D.23396 = iftmp.39;
  }
  if (D.23396 == 0) goto <D.24900>; else goto <D.24901>;
  <D.24900>:
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_shndx = 11;
  section->shidx = 11;
  section->file_offset = 4132;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24771 = section->virt_offset;
  D.24772 = (long unsigned int) D.24771;
  D.24718->st_value = D.24772;
  <D.24901>:
  <D.24859>:
  <D.24816>:
  <D.24773>:
  i = i + 1;
  <D.23360>:
  section = section->next;
  <D.23398>:
  if (section != 0B) goto <D.23397>; else goto <D.23399>;
  <D.23399>:
  <D.24724>:
  symbol = acfg->symbols;
  goto <D.23405>;
  <D.23404>:
  {
    int offset;
    struct BinLabel * lab;

    D.24902 = symbol->is_global;
    if (D.24902 == 0) goto <D.24903>; else goto <D.24904>;
    <D.24903>:
    if (hash != 0B) goto <D.24905>; else goto <D.24906>;
    <D.24905>:
    // predicted unlikely by continue predictor.
    goto <D.23402>;
    <D.24906>:
    <D.24904>:
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24902 = symbol->is_global;
    if (D.24902 != 0) goto <D.24908>; else goto <D.24909>;
    <D.24908>:
    iftmp.40 = 16;
    goto <D.24910>;
    <D.24909>:
    iftmp.40 = 0;
    <D.24910>:
    D.24912 = symbol->is_function;
    if (D.24912 != 0) goto <D.24913>; else goto <D.24914>;
    <D.24913>:
    iftmp.41 = 2;
    goto <D.24915>;
    <D.24914>:
    iftmp.41 = 1;
    <D.24915>:
    D.24916 = iftmp.40 + iftmp.41;
    D.24718->st_info = D.24916;
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24917 = symbol->name;
    D.24918 = str_table_add (strtab, D.24917);
    D.24919 = (unsigned int) D.24918;
    D.24718->st_name = D.24919;
    section = symbol->section;
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24725 = section->parent;
    if (D.24725 != 0B) goto <D.24921>; else goto <D.24922>;
    <D.24921>:
    D.24725 = section->parent;
    D.24923 = D.24725->shidx;
    iftmp.42 = (Elf64_Half) D.24923;
    goto <D.24924>;
    <D.24922>:
    D.24925 = section->shidx;
    iftmp.42 = (Elf64_Half) D.24925;
    <D.24924>:
    D.24718->st_shndx = iftmp.42;
    D.24917 = symbol->name;
    D.24926 = acfg->labels;
    lab = monoeg_g_hash_table_lookup (D.24926, D.24917);
    offset = lab->offset;
    D.24725 = section->parent;
    if (D.24725 != 0B) goto <D.24927>; else goto <D.24928>;
    <D.24927>:
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24725 = section->parent;
    D.24929 = D.24725->virt_offset;
    D.24930 = section->cur_offset;
    D.24931 = D.24929 + D.24930;
    D.24932 = D.24931 + offset;
    D.24933 = (long unsigned int) D.24932;
    D.24718->st_value = D.24933;
    goto <D.24934>;
    <D.24928>:
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24771 = section->virt_offset;
    D.24935 = D.24771 + offset;
    D.24936 = (long unsigned int) D.24935;
    D.24718->st_value = D.24936;
    <D.24934>:
    D.24937 = symbol->end_label;
    if (D.24937 != 0B) goto <D.24938>; else goto <D.24939>;
    <D.24938>:
    {
      struct BinLabel * elab;

      D.24937 = symbol->end_label;
      D.24926 = acfg->labels;
      elab = monoeg_g_hash_table_lookup (D.24926, D.24937);
      D.24940 = elab == 0B;
      D.24941 = (long int) D.24940;
      D.24942 = __builtin_expect (D.24941, 0);
      if (D.24942 != 0) goto <D.24943>; else goto <D.24944>;
      <D.24943>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 987, "elab");
      <D.24944>:
      D.24716 = (long unsigned int) i;
      D.24717 = D.24716 * 24;
      D.24718 = symbols + D.24717;
      D.24945 = elab->offset;
      D.24946 = lab->offset;
      D.24947 = D.24945 - D.24946;
      D.24948 = (long unsigned int) D.24947;
      D.24718->st_size = D.24948;
    }
    <D.24939>:
    i = i + 1;
  }
  <D.23402>:
  symbol = symbol->next;
  <D.23405>:
  if (symbol != 0B) goto <D.23404>; else goto <D.23406>;
  <D.23406>:
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24949 = str_table_add (strtab, "__bss_start");
  D.24950 = (unsigned int) D.24949;
  D.24718->st_name = D.24950;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_shndx = 65521;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_info = 16;
  i = i + 1;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24951 = str_table_add (strtab, "_edata");
  D.24952 = (unsigned int) D.24951;
  D.24718->st_name = D.24952;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_shndx = 65521;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_info = 16;
  i = i + 1;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24953 = str_table_add (strtab, "_end");
  D.24954 = (unsigned int) D.24953;
  D.24718->st_name = D.24954;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_shndx = 65521;
  D.24716 = (long unsigned int) i;
  D.24717 = D.24716 * 24;
  D.24718 = symbols + D.24717;
  D.24718->st_info = 16;
  i = i + 1;
  if (num_syms != 0B) goto <D.24955>; else goto <D.24956>;
  <D.24955>:
  *num_syms = i;
  <D.24956>:
  if (hash != 0B) goto <D.24957>; else goto <D.24958>;
  <D.24957>:
  bucket = hash + 8;
  D.24959 = *hash;
  D.24960 = (sizetype) D.24959;
  D.24961 = D.24960 + 2;
  D.24962 = D.24961 * 4;
  chain = hash + D.24962;
  i = 0;
  goto <D.23410>;
  <D.23409>:
  {
    int slot;

    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24963 = D.24718->st_name;
    if (D.24963 == 0) goto <D.24964>; else goto <D.24965>;
    <D.24964>:
    // predicted unlikely by continue predictor.
    goto <D.23408>;
    <D.24965>:
    D.24966 = strtab->data;
    D.24967 = D.24966->str;
    D.24716 = (long unsigned int) i;
    D.24717 = D.24716 * 24;
    D.24718 = symbols + D.24717;
    D.24963 = D.24718->st_name;
    D.24968 = (sizetype) D.24963;
    D.24969 = D.24967 + D.24968;
    hashc = elf_hash (D.24969);
    D.24959 = *hash;
    D.24970 = (long unsigned int) D.24959;
    D.24971 = hashc % D.24970;
    slot = (int) D.24971;
    D.24972 = (long unsigned int) slot;
    D.24973 = D.24972 * 4;
    D.24974 = bucket + D.24973;
    D.24975 = *D.24974;
    if (D.24975 != 0) goto <D.24976>; else goto <D.24977>;
    <D.24976>:
    D.24716 = (long unsigned int) i;
    D.24978 = D.24716 * 4;
    D.24979 = chain + D.24978;
    D.24972 = (long unsigned int) slot;
    D.24973 = D.24972 * 4;
    D.24974 = bucket + D.24973;
    D.24975 = *D.24974;
    *D.24979 = D.24975;
    D.24972 = (long unsigned int) slot;
    D.24973 = D.24972 * 4;
    D.24974 = bucket + D.24973;
    *D.24974 = i;
    goto <D.24980>;
    <D.24977>:
    D.24972 = (long unsigned int) slot;
    D.24973 = D.24972 * 4;
    D.24974 = bucket + D.24973;
    *D.24974 = i;
    <D.24980>:
  }
  <D.23408>:
  i = i + 1;
  <D.23410>:
  D.24706 = hash + 4;
  D.24707 = *D.24706;
  if (D.24707 > i) goto <D.23409>; else goto <D.23411>;
  <D.23411>:
  <D.24958>:
  D.24981 = symbols;
  return D.24981;
}


elf_hash (const unsigned char * name)
{
  long unsigned int D.24983;
  const unsigned char * name.43;
  unsigned char D.24985;
  long unsigned int D.24986;
  long unsigned int D.24989;
  long unsigned int D.24990;
  unsigned char D.24991;
  long unsigned int D.24992;
  long unsigned int h;
  long unsigned int g;

  h = 0;
  goto <D.23316>;
  <D.23315>:
  D.24983 = h << 4;
  name.43 = name;
  name = name.43 + 1;
  D.24985 = *name.43;
  D.24986 = (long unsigned int) D.24985;
  h = D.24983 + D.24986;
  g = h & 4026531840;
  if (g != 0) goto <D.24987>; else goto <D.24988>;
  <D.24987>:
  D.24989 = g >> 24;
  h = D.24989 ^ h;
  <D.24988>:
  D.24990 = ~g;
  h = D.24990 & h;
  <D.23316>:
  D.24991 = *name;
  if (D.24991 != 0) goto <D.23315>; else goto <D.23317>;
  <D.23317>:
  D.24992 = h;
  return D.24992;
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.24996;
  int D.25001;
  void * D.25003;
  long unsigned int D.25004;

  D.24996 = __builtin_constant_p (__len);
  if (D.24996 != 0) goto <D.24997>; else goto <D.24998>;
  <D.24997>:
  if (__len == 0) goto <D.24999>; else goto <D.25000>;
  <D.24999>:
  D.25001 = __builtin_constant_p (__ch);
  if (D.25001 == 0) goto <D.24994>; else goto <D.25002>;
  <D.25002>:
  if (__ch != 0) goto <D.24994>; else goto <D.24995>;
  <D.24994>:
  __warn_memset_zero_len ();
  D.25003 = __dest;
  return D.25003;
  <D.24995>:
  <D.25000>:
  <D.24998>:
  D.25004 = __builtin_object_size (__dest, 0);
  D.25003 = __builtin___memset_chk (__dest, __ch, __len, D.25004);
  return D.25003;
}


reloc_symbols (struct MonoImageWriter * acfg, struct ElfSymbol * symbols, struct ElfSectHeader * sheaders, struct ElfStrTable * strtab, gboolean dynamic)
{
  struct BinSection * D.25008;
  long unsigned int D.25011;
  long unsigned int D.25012;
  struct ElfSymbol * D.25013;
  int D.25014;
  long unsigned int D.25015;
  long unsigned int D.25016;
  struct ElfSectHeader * D.25017;
  long unsigned int D.25018;
  long unsigned int D.25020;
  struct ElfSectHeader * D.25021;
  long unsigned int D.25022;
  int D.25025;
  char * D.25028;
  struct GHashTable * D.25029;
  int D.25032;
  long unsigned int D.25033;
  long unsigned int D.25034;
  struct ElfSectHeader * D.25035;
  long unsigned int D.25036;
  int D.25037;
  long unsigned int D.25038;
  long unsigned int D.25039;
  long unsigned int D.25040;
  long unsigned int D.25041;
  long unsigned int D.25043;
  struct ElfSectHeader * D.25044;
  long unsigned int D.25045;
  struct ElfSectHeader * D.25046;
  long unsigned int D.25047;
  long unsigned int D.25048;
  long unsigned int D.25049;
  long unsigned int D.25050;
  long unsigned int D.25051;
  struct BinSection * section;
  struct BinSymbol * symbol;
  int i;

  i = 1;
  if (dynamic != 0) goto <D.25006>; else goto <D.25007>;
  <D.25006>:
  section = acfg->sections;
  goto <D.23424>;
  <D.23423>:
  D.25008 = section->parent;
  if (D.25008 != 0B) goto <D.25009>; else goto <D.25010>;
  <D.25009>:
  // predicted unlikely by continue predictor.
  goto <D.23422>;
  <D.25010>:
  D.25011 = (long unsigned int) i;
  D.25012 = D.25011 * 24;
  D.25013 = symbols + D.25012;
  D.25014 = section->shidx;
  D.25015 = (long unsigned int) D.25014;
  D.25016 = D.25015 * 64;
  D.25017 = sheaders + D.25016;
  D.25018 = D.25017->sh_addr;
  D.25013->st_value = D.25018;
  i = i + 1;
  <D.23422>:
  section = section->next;
  <D.23424>:
  if (section != 0B) goto <D.23423>; else goto <D.23425>;
  <D.23425>:
  goto <D.25019>;
  <D.25007>:
  i = 1;
  goto <D.23427>;
  <D.23426>:
  D.25011 = (long unsigned int) i;
  D.25012 = D.25011 * 24;
  D.25013 = symbols + D.25012;
  D.25011 = (long unsigned int) i;
  D.25020 = D.25011 * 64;
  D.25021 = sheaders + D.25020;
  D.25022 = D.25021->sh_addr;
  D.25013->st_value = D.25022;
  i = i + 1;
  <D.23427>:
  if (i <= 19) goto <D.23426>; else goto <D.23428>;
  <D.23428>:
  <D.25019>:
  symbol = acfg->symbols;
  goto <D.23433>;
  <D.23432>:
  {
    int offset;
    struct BinLabel * lab;

    if (dynamic != 0) goto <D.25023>; else goto <D.25024>;
    <D.25023>:
    D.25025 = symbol->is_global;
    if (D.25025 == 0) goto <D.25026>; else goto <D.25027>;
    <D.25026>:
    // predicted unlikely by continue predictor.
    goto <D.23431>;
    <D.25027>:
    <D.25024>:
    section = symbol->section;
    D.25028 = symbol->name;
    D.25029 = acfg->labels;
    lab = monoeg_g_hash_table_lookup (D.25029, D.25028);
    offset = lab->offset;
    D.25008 = section->parent;
    if (D.25008 != 0B) goto <D.25030>; else goto <D.25031>;
    <D.25030>:
    D.25011 = (long unsigned int) i;
    D.25012 = D.25011 * 24;
    D.25013 = symbols + D.25012;
    D.25008 = section->parent;
    D.25032 = D.25008->shidx;
    D.25033 = (long unsigned int) D.25032;
    D.25034 = D.25033 * 64;
    D.25035 = sheaders + D.25034;
    D.25036 = D.25035->sh_addr;
    D.25037 = section->cur_offset;
    D.25038 = (long unsigned int) D.25037;
    D.25039 = D.25036 + D.25038;
    D.25040 = (long unsigned int) offset;
    D.25041 = D.25039 + D.25040;
    D.25013->st_value = D.25041;
    goto <D.25042>;
    <D.25031>:
    D.25011 = (long unsigned int) i;
    D.25012 = D.25011 * 24;
    D.25013 = symbols + D.25012;
    D.25014 = section->shidx;
    D.25015 = (long unsigned int) D.25014;
    D.25016 = D.25015 * 64;
    D.25017 = sheaders + D.25016;
    D.25018 = D.25017->sh_addr;
    D.25040 = (long unsigned int) offset;
    D.25043 = D.25018 + D.25040;
    D.25013->st_value = D.25043;
    <D.25042>:
    i = i + 1;
  }
  <D.23431>:
  symbol = symbol->next;
  <D.23433>:
  if (symbol != 0B) goto <D.23432>; else goto <D.23434>;
  <D.23434>:
  D.25011 = (long unsigned int) i;
  D.25012 = D.25011 * 24;
  D.25013 = symbols + D.25012;
  D.25044 = sheaders + 704;
  D.25045 = D.25044->sh_addr;
  D.25013->st_value = D.25045;
  i = i + 1;
  D.25011 = (long unsigned int) i;
  D.25012 = D.25011 * 24;
  D.25013 = symbols + D.25012;
  D.25046 = sheaders + 640;
  D.25047 = D.25046->sh_addr;
  D.25046 = sheaders + 640;
  D.25048 = D.25046->sh_size;
  D.25049 = D.25047 + D.25048;
  D.25013->st_value = D.25049;
  i = i + 1;
  D.25011 = (long unsigned int) i;
  D.25012 = D.25011 * 24;
  D.25013 = symbols + D.25012;
  D.25044 = sheaders + 704;
  D.25045 = D.25044->sh_addr;
  D.25044 = sheaders + 704;
  D.25050 = D.25044->sh_size;
  D.25051 = D.25045 + D.25050;
  D.25013->st_value = D.25051;
  i = i + 1;
}


resolve_relocations (struct MonoImageWriter * acfg)
{
  int D.25052;
  long unsigned int D.25053;
  long unsigned int D.25054;
  guint8 * data.44;
  long unsigned int end_val.45;
  unsigned char D.25057;
  guint8 * D.25058;
  long unsigned int D.25059;
  unsigned char D.25060;
  guint8 * D.25061;
  long unsigned int D.25062;
  unsigned char D.25063;
  guint8 * D.25064;
  long unsigned int D.25065;
  unsigned char D.25066;
  long unsigned int start_val.46;
  char * D.25070;
  char D.25071;
  long unsigned int D.25074;
  long unsigned int D.25075;
  struct ElfRelocA * D.25076;
  long unsigned int vaddr.47;
  long int end_val.48;
  _Bool D.25079;
  long int D.25080;
  long int D.25081;
  struct ElfRelocA * D.25084;
  struct BinReloc * reloc;
  guint8 * data;
  gsize end_val;
  gsize start_val;
  struct ElfRelocA * rr;
  int i;
  gsize vaddr;

  try
    {
      D.25052 = acfg->num_relocs;
      D.25053 = (long unsigned int) D.25052;
      D.25054 = D.25053 * 24;
      rr = monoeg_malloc0 (D.25054);
      i = 0;
      reloc = acfg->relocations;
      goto <D.23458>;
      <D.23457>:
      resolve_reloc (acfg, reloc, &data, &vaddr, &start_val, &end_val);
      data.44 = data;
      end_val.45 = end_val;
      D.25057 = (unsigned char) end_val.45;
      *data.44 = D.25057;
      data.44 = data;
      D.25058 = data.44 + 1;
      end_val.45 = end_val;
      D.25059 = end_val.45 >> 8;
      D.25060 = (unsigned char) D.25059;
      *D.25058 = D.25060;
      data.44 = data;
      D.25061 = data.44 + 2;
      end_val.45 = end_val;
      D.25062 = end_val.45 >> 16;
      D.25063 = (unsigned char) D.25062;
      *D.25061 = D.25063;
      data.44 = data;
      D.25064 = data.44 + 3;
      end_val.45 = end_val;
      D.25065 = end_val.45 >> 24;
      D.25066 = (unsigned char) D.25065;
      *D.25064 = D.25066;
      start_val.46 = start_val;
      if (start_val.46 == 0) goto <D.25068>; else goto <D.25069>;
      <D.25068>:
      D.25070 = reloc->val1;
      D.25071 = *D.25070;
      if (D.25071 != 46) goto <D.25072>; else goto <D.25073>;
      <D.25072>:
      D.25074 = (long unsigned int) i;
      D.25075 = D.25074 * 24;
      D.25076 = rr + D.25075;
      vaddr.47 = vaddr;
      D.25076->r_offset = vaddr.47;
      D.25074 = (long unsigned int) i;
      D.25075 = D.25074 * 24;
      D.25076 = rr + D.25075;
      D.25076->r_info = 8;
      D.25074 = (long unsigned int) i;
      D.25075 = D.25074 * 24;
      D.25076 = rr + D.25075;
      end_val.45 = end_val;
      end_val.48 = (long int) end_val.45;
      D.25076->r_addend = end_val.48;
      i = i + 1;
      D.25052 = acfg->num_relocs;
      D.25079 = D.25052 < i;
      D.25080 = (long int) D.25079;
      D.25081 = __builtin_expect (D.25080, 0);
      if (D.25081 != 0) goto <D.25082>; else goto <D.25083>;
      <D.25082>:
      monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 1146, "i <= acfg->num_relocs");
      <D.25083>:
      <D.25073>:
      <D.25069>:
      reloc = reloc->next;
      <D.23458>:
      if (reloc != 0B) goto <D.23457>; else goto <D.23459>;
      <D.23459>:
      D.25084 = rr;
      return D.25084;
    }
  finally
    {
      data = {CLOBBER};
      end_val = {CLOBBER};
      start_val = {CLOBBER};
      vaddr = {CLOBBER};
    }
}


resolve_reloc (struct MonoImageWriter * acfg, struct BinReloc * reloc, guint8 * * out_data, gsize * out_vaddr, gsize * out_start_val, gsize * out_end_val)
{
  char * D.25087;
  long unsigned int D.25088;
  char * D.25089;
  long unsigned int D.25092;
  struct BinSection * D.25094;
  int D.25097;
  struct BinSection * D.25098;
  int D.25101;
  int D.25102;
  int D.25103;
  long int D.25104;
  int D.25106;
  long int D.25107;
  long int D.25109;
  int D.25110;
  long int D.25111;
  struct BinSection * D.25112;
  struct BinSection * D.25113;
  int D.25116;
  sizetype D.25117;
  int D.25118;
  sizetype D.25119;
  int D.25120;
  long unsigned int D.25121;
  long unsigned int D.25122;
  int D.25124;
  long unsigned int start_val.49;
  long unsigned int end_val.50;
  guint8 * data;
  gssize end_val;
  gssize start_val;
  gsize vaddr;

  D.25087 = reloc->val1;
  D.25088 = get_label_addr (acfg, D.25087);
  end_val = (gssize) D.25088;
  D.25089 = reloc->val2;
  if (D.25089 != 0B) goto <D.25090>; else goto <D.25091>;
  <D.25090>:
  D.25089 = reloc->val2;
  D.25092 = get_label_addr (acfg, D.25089);
  start_val = (gssize) D.25092;
  goto <D.25093>;
  <D.25091>:
  D.25094 = reloc->val2_section;
  if (D.25094 != 0B) goto <D.25095>; else goto <D.25096>;
  <D.25095>:
  D.25097 = reloc->val2_offset;
  start_val = (gssize) D.25097;
  D.25094 = reloc->val2_section;
  D.25098 = D.25094->parent;
  if (D.25098 != 0B) goto <D.25099>; else goto <D.25100>;
  <D.25099>:
  D.25094 = reloc->val2_section;
  D.25098 = D.25094->parent;
  D.25101 = D.25098->virt_offset;
  D.25094 = reloc->val2_section;
  D.25102 = D.25094->cur_offset;
  D.25103 = D.25101 + D.25102;
  D.25104 = (long int) D.25103;
  start_val = D.25104 + start_val;
  goto <D.25105>;
  <D.25100>:
  D.25094 = reloc->val2_section;
  D.25106 = D.25094->virt_offset;
  D.25107 = (long int) D.25106;
  start_val = D.25107 + start_val;
  <D.25105>:
  goto <D.25108>;
  <D.25096>:
  start_val = 0;
  <D.25108>:
  <D.25093>:
  D.25109 = end_val - start_val;
  D.25110 = reloc->offset;
  D.25111 = (long int) D.25110;
  end_val = D.25109 + D.25111;
  D.25112 = reloc->section;
  D.25113 = D.25112->parent;
  if (D.25113 != 0B) goto <D.25114>; else goto <D.25115>;
  <D.25114>:
  D.25112 = reloc->section;
  D.25113 = D.25112->parent;
  data = D.25113->data;
  D.25112 = reloc->section;
  D.25116 = D.25112->cur_offset;
  D.25117 = (sizetype) D.25116;
  data = data + D.25117;
  D.25118 = reloc->section_offset;
  D.25119 = (sizetype) D.25118;
  data = data + D.25119;
  D.25112 = reloc->section;
  D.25113 = D.25112->parent;
  D.25120 = D.25113->virt_offset;
  vaddr = (gsize) D.25120;
  D.25112 = reloc->section;
  D.25116 = D.25112->cur_offset;
  D.25121 = (long unsigned int) D.25116;
  vaddr = D.25121 + vaddr;
  D.25118 = reloc->section_offset;
  D.25122 = (long unsigned int) D.25118;
  vaddr = D.25122 + vaddr;
  goto <D.25123>;
  <D.25115>:
  D.25112 = reloc->section;
  data = D.25112->data;
  D.25118 = reloc->section_offset;
  D.25119 = (sizetype) D.25118;
  data = data + D.25119;
  D.25112 = reloc->section;
  D.25124 = D.25112->virt_offset;
  vaddr = (gsize) D.25124;
  D.25118 = reloc->section_offset;
  D.25122 = (long unsigned int) D.25118;
  vaddr = D.25122 + vaddr;
  <D.25123>:
  start_val.49 = (long unsigned int) start_val;
  *out_start_val = start_val.49;
  end_val.50 = (long unsigned int) end_val;
  *out_end_val = end_val.50;
  *out_data = data;
  *out_vaddr = vaddr;
}


get_label_addr (struct MonoImageWriter * acfg, const char * name)
{
  struct GHashTable * D.25127;
  struct BinSection * D.25130;
  int D.25133;
  int D.25134;
  int D.25135;
  int D.25136;
  int D.25138;
  int D.25139;
  gsize D.25140;
  int offset;
  struct BinLabel * lab;
  struct BinSection * section;
  gsize value;

  D.25127 = acfg->labels;
  lab = monoeg_g_hash_table_lookup (D.25127, name);
  if (lab == 0B) goto <D.25128>; else goto <D.25129>;
  <D.25128>:
  monoeg_g_log (0B, 4, "Undefined label: \'%s\'.\n", name);
  <D.23338>:
  goto <D.23338>;
  <D.25129>:
  section = lab->section;
  offset = lab->offset;
  D.25130 = section->parent;
  if (D.25130 != 0B) goto <D.25131>; else goto <D.25132>;
  <D.25131>:
  D.25130 = section->parent;
  D.25133 = D.25130->virt_offset;
  D.25134 = section->cur_offset;
  D.25135 = D.25133 + D.25134;
  D.25136 = D.25135 + offset;
  value = (gsize) D.25136;
  goto <D.25137>;
  <D.25132>:
  D.25138 = section->virt_offset;
  D.25139 = D.25138 + offset;
  value = (gsize) D.25139;
  <D.25137>:
  D.25140 = value;
  return D.25140;
}


bin_writer_fseek (struct MonoImageWriter * acfg, int offset)
{
  struct FILE * D.25142;
  long int D.25145;

  D.25142 = acfg->fp;
  if (D.25142 != 0B) goto <D.25143>; else goto <D.25144>;
  <D.25143>:
  D.25145 = (long int) offset;
  D.25142 = acfg->fp;
  fseek (D.25142, D.25145, 0);
  goto <D.25146>;
  <D.25144>:
  acfg->out_buf_pos = offset;
  <D.25146>:
}


bin_writer_fwrite (struct MonoImageWriter * acfg, void * val, size_t size, size_t nmemb)
{
  struct FILE * D.25147;
  int D.25151;
  long unsigned int D.25152;
  long unsigned int D.25153;
  long unsigned int D.25154;
  int D.25155;
  long unsigned int D.25156;
  _Bool D.25157;
  long int D.25158;
  long int D.25159;
  guint8 * D.25162;
  sizetype D.25163;
  guint8 * D.25164;
  unsigned int D.25165;
  unsigned int D.25166;
  unsigned int D.25167;
  unsigned int D.25168;
  unsigned int D.25169;
  int D.25170;

  D.25147 = acfg->fp;
  if (D.25147 != 0B) goto <D.25148>; else goto <D.25149>;
  <D.25148>:
  D.25147 = acfg->fp;
  fwrite (val, size, nmemb, D.25147);
  goto <D.25150>;
  <D.25149>:
  D.25151 = acfg->out_buf_pos;
  D.25152 = (long unsigned int) D.25151;
  D.25153 = size * nmemb;
  D.25154 = D.25152 + D.25153;
  D.25155 = acfg->out_buf_size;
  D.25156 = (long unsigned int) D.25155;
  D.25157 = D.25154 > D.25156;
  D.25158 = (long int) D.25157;
  D.25159 = __builtin_expect (D.25158, 0);
  if (D.25159 != 0) goto <D.25160>; else goto <D.25161>;
  <D.25160>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 494, "acfg->out_buf_pos + (size * nmemb) <= acfg->out_buf_size");
  <D.25161>:
  D.25153 = size * nmemb;
  D.25162 = acfg->out_buf;
  D.25151 = acfg->out_buf_pos;
  D.25163 = (sizetype) D.25151;
  D.25164 = D.25162 + D.25163;
  memcpy (D.25164, val, D.25153);
  D.25151 = acfg->out_buf_pos;
  D.25165 = (unsigned int) D.25151;
  D.25166 = (unsigned int) size;
  D.25167 = (unsigned int) nmemb;
  D.25168 = D.25166 * D.25167;
  D.25169 = D.25165 + D.25168;
  D.25170 = (int) D.25169;
  acfg->out_buf_pos = D.25170;
  <D.25150>:
}


asm_writer_emit_writeout (struct MonoImageWriter * acfg)
{
  struct FILE * D.25171;
  int D.25172;

  D.25171 = acfg->fp;
  fclose (D.25171);
  D.25172 = 0;
  return D.25172;
}


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.25174;

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


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.25178;

  D.25178 = acfg->use_bin_writer;
  if (D.25178 == 0) goto <D.25179>; else goto <D.25180>;
  <D.25179>:
  asm_writer_emit_unset_mode (acfg);
  <D.25180>:
}


img_writer_get_output (struct MonoImageWriter * acfg, guint32 * size)
{
  int D.25181;
  _Bool D.25182;
  long int D.25183;
  long int D.25184;
  int D.25187;
  unsigned int D.25188;
  guint8 * D.25189;
  guint8 * buf;

  D.25181 = acfg->use_bin_writer;
  D.25182 = D.25181 == 0;
  D.25183 = (long int) D.25182;
  D.25184 = __builtin_expect (D.25183, 0);
  if (D.25184 != 0) goto <D.25185>; else goto <D.25186>;
  <D.25185>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2299, "acfg->use_bin_writer");
  <D.25186>:
  buf = acfg->out_buf;
  D.25187 = acfg->out_buf_size;
  D.25188 = (unsigned int) D.25187;
  *size = D.25188;
  acfg->out_buf = 0B;
  D.25189 = buf;
  return D.25189;
}


bin_writer_supported ()
{
  gboolean D.25191;

  D.25191 = 1;
  return D.25191;
}


img_writer_create (struct FILE * fp, gboolean use_bin_writer)
{
  _Bool D.25195;
  long int D.25196;
  long int D.25197;
  struct MonoMemPool * D.25200;
  struct MonoImageWriter * D.25201;
  struct MonoImageWriter * w;

  w = monoeg_malloc0 (336);
  if (use_bin_writer == 0) goto <D.25193>; else goto <D.25194>;
  <D.25193>:
  D.25195 = fp == 0B;
  D.25196 = (long int) D.25195;
  D.25197 = __builtin_expect (D.25196, 0);
  if (D.25197 != 0) goto <D.25198>; else goto <D.25199>;
  <D.25198>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "image-writer.c", 2341, "fp");
  <D.25199>:
  <D.25194>:
  w->fp = fp;
  w->use_bin_writer = use_bin_writer;
  D.25200 = mono_mempool_new ();
  w->mempool = D.25200;
  D.25201 = w;
  return D.25201;
}


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

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


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

  D.25204 = 1;
  return D.25204;
}


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

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


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

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


