monoeg_g_string_new_len (const gchar * init, gssize len)
{
  long unsigned int iftmp.0;
  long unsigned int D.5005;
  long unsigned int D.5006;
  long unsigned int D.5007;
  long unsigned int D.5008;
  void * D.5009;
  char * D.5012;
  char * D.5013;
  struct GString * D.5014;
  struct GString * ret;

  ret = monoeg_malloc (24);
  if (init == 0B) goto <D.4998>; else goto <D.4999>;
  <D.4998>:
  ret->len = 0;
  goto <D.5000>;
  <D.4999>:
  if (len < 0) goto <D.5002>; else goto <D.5003>;
  <D.5002>:
  iftmp.0 = strlen (init);
  goto <D.5004>;
  <D.5003>:
  iftmp.0 = (long unsigned int) len;
  <D.5004>:
  ret->len = iftmp.0;
  <D.5000>:
  D.5005 = ret->len;
  D.5006 = D.5005 + 1;
  D.5007 = MAX_EXPR <D.5006, 16>;
  ret->allocated_len = D.5007;
  D.5008 = ret->allocated_len;
  D.5009 = monoeg_malloc (D.5008);
  ret->str = D.5009;
  if (init != 0B) goto <D.5010>; else goto <D.5011>;
  <D.5010>:
  D.5005 = ret->len;
  D.5012 = ret->str;
  memcpy (D.5012, init, D.5005);
  <D.5011>:
  D.5012 = ret->str;
  D.5005 = ret->len;
  D.5013 = D.5012 + D.5005;
  *D.5013 = 0;
  D.5014 = ret;
  return D.5014;
}


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

  D.5017 = __builtin_object_size (__dest, 0);
  D.5016 = __builtin___memcpy_chk (__dest, __src, __len, D.5017);
  return D.5016;
}


monoeg_g_string_new (const gchar * init)
{
  struct GString * D.5019;

  D.5019 = monoeg_g_string_new_len (init, -1);
  return D.5019;
}


monoeg_g_string_sized_new (gsize default_size)
{
  void * D.5021;
  char * D.5022;
  struct GString * D.5023;
  struct GString * ret;

  ret = monoeg_malloc (24);
  D.5021 = monoeg_malloc (default_size);
  ret->str = D.5021;
  D.5022 = ret->str;
  *D.5022 = 0;
  ret->len = 0;
  ret->allocated_len = default_size;
  D.5023 = ret;
  return D.5023;
}


monoeg_g_string_free (struct GString * string, gboolean free_segment)
{
  gchar * D.5027;
  gchar * data;

  if (string == 0B) goto <D.5025>; else goto <D.5026>;
  <D.5025>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 81, "string != NULL");
  D.5027 = 0B;
  return D.5027;
  <D.5026>:
  data = string->str;
  monoeg_g_free (string);
  if (free_segment == 0) goto <D.5028>; else goto <D.5029>;
  <D.5028>:
  D.5027 = data;
  return D.5027;
  <D.5029>:
  monoeg_g_free (data);
  D.5027 = 0B;
  return D.5027;
}


monoeg_g_string_append_len (struct GString * string, const gchar * val, gssize len)
{
  struct GString * D.5033;
  long unsigned int D.5038;
  long unsigned int D.5039;
  long unsigned int len.1;
  long unsigned int D.5041;
  long unsigned int D.5042;
  long unsigned int D.5045;
  long unsigned int D.5046;
  long unsigned int D.5047;
  char * D.5048;
  void * D.5049;
  long unsigned int len.2;
  char * D.5051;

  if (string == 0B) goto <D.5031>; else goto <D.5032>;
  <D.5031>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 97, "string != NULL");
  D.5033 = 0B;
  return D.5033;
  <D.5032>:
  if (val == 0B) goto <D.5034>; else goto <D.5035>;
  <D.5034>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 98, "val != NULL");
  D.5033 = string;
  return D.5033;
  <D.5035>:
  if (len < 0) goto <D.5036>; else goto <D.5037>;
  <D.5036>:
  D.5038 = strlen (val);
  len = (gssize) D.5038;
  <D.5037>:
  D.5039 = string->len;
  len.1 = (long unsigned int) len;
  D.5041 = D.5039 + len.1;
  D.5042 = string->allocated_len;
  if (D.5041 >= D.5042) goto <D.5043>; else goto <D.5044>;
  <D.5043>:
  D.5042 = string->allocated_len;
  len.1 = (long unsigned int) len;
  D.5045 = D.5042 + len.1;
  D.5046 = D.5045 + 16;
  D.5047 = D.5046 * 2;
  string->allocated_len = D.5047;
  D.5042 = string->allocated_len;
  D.5048 = string->str;
  D.5049 = monoeg_realloc (D.5048, D.5042);
  string->str = D.5049;
  <D.5044>:
  len.2 = (long unsigned int) len;
  D.5048 = string->str;
  D.5039 = string->len;
  D.5051 = D.5048 + D.5039;
  memcpy (D.5051, val, len.2);
  D.5039 = string->len;
  len.1 = (long unsigned int) len;
  D.5041 = D.5039 + len.1;
  string->len = D.5041;
  D.5048 = string->str;
  D.5039 = string->len;
  D.5051 = D.5048 + D.5039;
  *D.5051 = 0;
  D.5033 = string;
  return D.5033;
}


monoeg_g_string_append (struct GString * string, const gchar * val)
{
  struct GString * D.5055;

  if (string == 0B) goto <D.5053>; else goto <D.5054>;
  <D.5053>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 115, "string != NULL");
  D.5055 = 0B;
  return D.5055;
  <D.5054>:
  if (val == 0B) goto <D.5056>; else goto <D.5057>;
  <D.5056>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 116, "val != NULL");
  D.5055 = string;
  return D.5055;
  <D.5057>:
  D.5055 = monoeg_g_string_append_len (string, val, -1);
  return D.5055;
}


monoeg_g_string_append_c (struct GString * string, gchar c)
{
  struct GString * D.5061;
  long unsigned int D.5062;
  long unsigned int D.5063;
  long unsigned int D.5064;
  long unsigned int D.5067;
  long unsigned int D.5068;
  char * D.5069;
  void * D.5070;
  char * D.5071;
  sizetype D.5072;
  char * D.5073;

  if (string == 0B) goto <D.5059>; else goto <D.5060>;
  <D.5059>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 124, "string != NULL");
  D.5061 = 0B;
  return D.5061;
  <D.5060>:
  D.5062 = string->len;
  D.5063 = D.5062 + 1;
  D.5064 = string->allocated_len;
  if (D.5063 >= D.5064) goto <D.5065>; else goto <D.5066>;
  <D.5065>:
  D.5064 = string->allocated_len;
  D.5067 = D.5064 + 17;
  D.5068 = D.5067 * 2;
  string->allocated_len = D.5068;
  D.5064 = string->allocated_len;
  D.5069 = string->str;
  D.5070 = monoeg_realloc (D.5069, D.5064);
  string->str = D.5070;
  <D.5066>:
  D.5069 = string->str;
  D.5062 = string->len;
  D.5071 = D.5069 + D.5062;
  *D.5071 = c;
  D.5069 = string->str;
  D.5062 = string->len;
  D.5072 = D.5062 + 1;
  D.5073 = D.5069 + D.5072;
  *D.5073 = 0;
  D.5062 = string->len;
  D.5063 = D.5062 + 1;
  string->len = D.5063;
  D.5061 = string;
  return D.5061;
}


monoeg_g_string_append_unichar (struct GString * string, gunichar c)
{
  struct GString * D.5077;
  long int D.5080;
  gchar utf8[6];
  gint len;

  try
    {
      if (string == 0B) goto <D.5075>; else goto <D.5076>;
      <D.5075>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 141, "string != NULL");
      D.5077 = 0B;
      return D.5077;
      <D.5076>:
      len = monoeg_g_unichar_to_utf8 (c, &utf8);
      if (len <= 0) goto <D.5078>; else goto <D.5079>;
      <D.5078>:
      D.5077 = string;
      return D.5077;
      <D.5079>:
      D.5080 = (long int) len;
      D.5077 = monoeg_g_string_append_len (string, &utf8, D.5080);
      return D.5077;
    }
  finally
    {
      utf8 = {CLOBBER};
    }
}


monoeg_g_string_prepend (struct GString * string, const gchar * val)
{
  struct GString * D.5085;
  long unsigned int D.5088;
  long unsigned int D.5089;
  long unsigned int len.3;
  long unsigned int D.5091;
  long unsigned int D.5092;
  long unsigned int D.5095;
  long unsigned int D.5096;
  long unsigned int D.5097;
  char * D.5098;
  void * D.5099;
  long unsigned int D.5100;
  sizetype len.4;
  void * D.5102;
  long unsigned int len.5;
  gssize len;

  if (string == 0B) goto <D.5083>; else goto <D.5084>;
  <D.5083>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 154, "string != NULL");
  D.5085 = string;
  return D.5085;
  <D.5084>:
  if (val == 0B) goto <D.5086>; else goto <D.5087>;
  <D.5086>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 155, "val != NULL");
  D.5085 = string;
  return D.5085;
  <D.5087>:
  D.5088 = strlen (val);
  len = (gssize) D.5088;
  D.5089 = string->len;
  len.3 = (long unsigned int) len;
  D.5091 = D.5089 + len.3;
  D.5092 = string->allocated_len;
  if (D.5091 >= D.5092) goto <D.5093>; else goto <D.5094>;
  <D.5093>:
  D.5092 = string->allocated_len;
  len.3 = (long unsigned int) len;
  D.5095 = D.5092 + len.3;
  D.5096 = D.5095 + 16;
  D.5097 = D.5096 * 2;
  string->allocated_len = D.5097;
  D.5092 = string->allocated_len;
  D.5098 = string->str;
  D.5099 = monoeg_realloc (D.5098, D.5092);
  string->str = D.5099;
  <D.5094>:
  D.5089 = string->len;
  D.5100 = D.5089 + 1;
  D.5098 = string->str;
  D.5098 = string->str;
  len.4 = (sizetype) len;
  D.5102 = D.5098 + len.4;
  memmove (D.5102, D.5098, D.5100);
  len.5 = (long unsigned int) len;
  D.5098 = string->str;
  memcpy (D.5098, val, len.5);
  D.5085 = string;
  return D.5085;
}


memmove (void * __dest, const void * __src, size_t __len)
{
  void * D.5105;
  long unsigned int D.5106;

  D.5106 = __builtin_object_size (__dest, 0);
  D.5105 = __builtin___memmove_chk (__dest, __src, __len, D.5106);
  return D.5105;
}


monoeg_g_string_insert (struct GString * string, gssize pos, const gchar * val)
{
  struct GString * D.5110;
  long unsigned int pos.6;
  long unsigned int D.5114;
  long unsigned int D.5117;
  long unsigned int len.7;
  long unsigned int D.5119;
  long unsigned int D.5120;
  long unsigned int D.5123;
  long unsigned int D.5124;
  long unsigned int D.5125;
  char * D.5126;
  void * D.5127;
  long unsigned int D.5128;
  long unsigned int D.5129;
  long unsigned int D.5130;
  sizetype pos.8;
  const void * D.5132;
  sizetype len.9;
  sizetype D.5134;
  char * D.5135;
  long unsigned int len.10;
  char * D.5137;
  gssize len;

  if (string == 0B) goto <D.5108>; else goto <D.5109>;
  <D.5108>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 171, "string != NULL");
  D.5110 = string;
  return D.5110;
  <D.5109>:
  if (val == 0B) goto <D.5111>; else goto <D.5112>;
  <D.5111>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 172, "val != NULL");
  D.5110 = string;
  return D.5110;
  <D.5112>:
  pos.6 = (long unsigned int) pos;
  D.5114 = string->len;
  if (pos.6 > D.5114) goto <D.5115>; else goto <D.5116>;
  <D.5115>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 173, "pos <= string->len");
  D.5110 = string;
  return D.5110;
  <D.5116>:
  D.5117 = strlen (val);
  len = (gssize) D.5117;
  D.5114 = string->len;
  len.7 = (long unsigned int) len;
  D.5119 = D.5114 + len.7;
  D.5120 = string->allocated_len;
  if (D.5119 >= D.5120) goto <D.5121>; else goto <D.5122>;
  <D.5121>:
  D.5120 = string->allocated_len;
  len.7 = (long unsigned int) len;
  D.5123 = D.5120 + len.7;
  D.5124 = D.5123 + 16;
  D.5125 = D.5124 * 2;
  string->allocated_len = D.5125;
  D.5120 = string->allocated_len;
  D.5126 = string->str;
  D.5127 = monoeg_realloc (D.5126, D.5120);
  string->str = D.5127;
  <D.5122>:
  D.5114 = string->len;
  pos.6 = (long unsigned int) pos;
  D.5128 = D.5114 - pos.6;
  len.7 = (long unsigned int) len;
  D.5129 = D.5128 - len.7;
  D.5130 = D.5129 + 1;
  D.5126 = string->str;
  pos.8 = (sizetype) pos;
  D.5132 = D.5126 + pos.8;
  D.5126 = string->str;
  pos.8 = (sizetype) pos;
  len.9 = (sizetype) len;
  D.5134 = pos.8 + len.9;
  D.5135 = D.5126 + D.5134;
  memmove (D.5135, D.5132, D.5130);
  len.10 = (long unsigned int) len;
  D.5126 = string->str;
  pos.8 = (sizetype) pos;
  D.5137 = D.5126 + pos.8;
  memcpy (D.5137, val, len.10);
  D.5110 = string;
  return D.5110;
}


monoeg_g_string_append_printf (struct GString * string, const gchar * format)
{
  char * ret;
  struct  args[1];

  try
    {
      if (string == 0B) goto <D.5139>; else goto <D.5140>;
      <D.5139>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 190, "string != NULL");
      return;
      <D.5140>:
      if (format == 0B) goto <D.5141>; else goto <D.5142>;
      <D.5141>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 191, "format != NULL");
      return;
      <D.5142>:
      __builtin_va_start (&args, 0);
      ret = monoeg_g_strdup_vprintf (format, &args);
      __builtin_va_end (&args);
      monoeg_g_string_append (string, ret);
      monoeg_g_free (ret);
    }
  finally
    {
      args = {CLOBBER};
    }
}


monoeg_g_string_append_vprintf (struct GString * string, const gchar * format, struct  * args)
{
  char * ret;

  if (string == 0B) goto <D.5146>; else goto <D.5147>;
  <D.5146>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 206, "string != NULL");
  return;
  <D.5147>:
  if (format == 0B) goto <D.5148>; else goto <D.5149>;
  <D.5148>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 207, "format != NULL");
  return;
  <D.5149>:
  ret = monoeg_g_strdup_vprintf (format, args);
  monoeg_g_string_append (string, ret);
  monoeg_g_free (ret);
}


monoeg_g_string_printf (struct GString * string, const gchar * format)
{
  char * D.5155;
  gchar * D.5156;
  long unsigned int D.5157;
  long unsigned int D.5158;
  long unsigned int D.5159;
  struct  args[1];

  try
    {
      if (string == 0B) goto <D.5151>; else goto <D.5152>;
      <D.5151>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 219, "string != NULL");
      return;
      <D.5152>:
      if (format == 0B) goto <D.5153>; else goto <D.5154>;
      <D.5153>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 220, "format != NULL");
      return;
      <D.5154>:
      D.5155 = string->str;
      monoeg_g_free (D.5155);
      __builtin_va_start (&args, 0);
      D.5156 = monoeg_g_strdup_vprintf (format, &args);
      string->str = D.5156;
      __builtin_va_end (&args);
      D.5155 = string->str;
      D.5157 = strlen (D.5155);
      string->len = D.5157;
      D.5158 = string->len;
      D.5159 = D.5158 + 1;
      string->allocated_len = D.5159;
    }
  finally
    {
      args = {CLOBBER};
    }
}


monoeg_g_string_truncate (struct GString * string, gsize len)
{
  struct GString * D.5165;
  long unsigned int D.5166;
  char * D.5169;
  char * D.5170;

  if (string == 0B) goto <D.5163>; else goto <D.5164>;
  <D.5163>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 235, "string != NULL");
  D.5165 = string;
  return D.5165;
  <D.5164>:
  D.5166 = string->len;
  if (D.5166 <= len) goto <D.5167>; else goto <D.5168>;
  <D.5167>:
  D.5165 = string;
  return D.5165;
  <D.5168>:
  string->len = len;
  D.5169 = string->str;
  D.5170 = D.5169 + len;
  *D.5170 = 0;
  D.5165 = string;
  return D.5165;
}


monoeg_g_string_set_size (struct GString * string, gsize len)
{
  struct GString * D.5174;
  long unsigned int D.5175;
  long unsigned int D.5176;
  long unsigned int D.5177;
  long unsigned int D.5180;
  long unsigned int D.5181;
  long unsigned int D.5182;
  char * D.5183;
  void * D.5184;
  char * D.5185;

  if (string == 0B) goto <D.5172>; else goto <D.5173>;
  <D.5172>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 249, "string != NULL");
  D.5174 = string;
  return D.5174;
  <D.5173>:
  D.5175 = string->len;
  D.5176 = D.5175 + len;
  D.5177 = string->allocated_len;
  if (D.5176 >= D.5177) goto <D.5178>; else goto <D.5179>;
  <D.5178>:
  D.5177 = string->allocated_len;
  D.5180 = D.5177 + len;
  D.5181 = D.5180 + 16;
  D.5182 = D.5181 * 2;
  string->allocated_len = D.5182;
  D.5177 = string->allocated_len;
  D.5183 = string->str;
  D.5184 = monoeg_realloc (D.5183, D.5177);
  string->str = D.5184;
  <D.5179>:
  string->len = len;
  D.5183 = string->str;
  D.5185 = D.5183 + len;
  *D.5185 = 0;
  D.5174 = string;
  return D.5174;
}


monoeg_g_string_erase (struct GString * string, gssize pos, gssize len)
{
  struct GString * D.5189;
  long unsigned int pos.11;
  long unsigned int D.5191;
  long int D.5198;
  long unsigned int D.5199;
  char * D.5200;
  sizetype pos.12;
  char * D.5202;
  long unsigned int D.5203;
  long unsigned int D.5204;
  sizetype len.13;
  sizetype D.5206;
  char * D.5207;
  void * D.5208;
  long unsigned int len.14;
  long unsigned int D.5210;

  if (string == 0B) goto <D.5187>; else goto <D.5188>;
  <D.5187>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "gstring.c", 261, "string != NULL");
  D.5189 = string;
  return D.5189;
  <D.5188>:
  pos.11 = (long unsigned int) pos;
  D.5191 = string->len;
  if (pos.11 >= D.5191) goto <D.5192>; else goto <D.5193>;
  <D.5192>:
  D.5189 = string;
  return D.5189;
  <D.5193>:
  if (len == -1) goto <D.5194>; else goto <D.5197>;
  <D.5197>:
  D.5198 = pos + len;
  D.5199 = (long unsigned int) D.5198;
  D.5191 = string->len;
  if (D.5199 >= D.5191) goto <D.5194>; else goto <D.5195>;
  <D.5194>:
  D.5200 = string->str;
  pos.12 = (sizetype) pos;
  D.5202 = D.5200 + pos.12;
  *D.5202 = 0;
  goto <D.5196>;
  <D.5195>:
  D.5191 = string->len;
  D.5198 = pos + len;
  D.5199 = (long unsigned int) D.5198;
  D.5203 = D.5191 - D.5199;
  D.5204 = D.5203 + 1;
  D.5200 = string->str;
  pos.12 = (sizetype) pos;
  len.13 = (sizetype) len;
  D.5206 = pos.12 + len.13;
  D.5207 = D.5200 + D.5206;
  D.5200 = string->str;
  pos.12 = (sizetype) pos;
  D.5208 = D.5200 + pos.12;
  memmove (D.5208, D.5207, D.5204);
  D.5191 = string->len;
  len.14 = (long unsigned int) len;
  D.5210 = D.5191 - len.14;
  string->len = D.5210;
  <D.5196>:
  D.5189 = string;
  return D.5189;
}


