monoeg_g_iconv_open (const char * to_charset, const char * from_charset)
{
  _Bool D.7597;
  _Bool D.7598;
  _Bool D.7599;
  char D.7601;
  char D.7603;
  int * D.7604;
  struct _GIConv * D.7605;
  const char * D.7606;
  int D.7607;
  int D.7610;
  _Bool D.7613;
  _Bool D.7614;
  _Bool D.7615;
  void * icd;
  int (*Decoder) (char *, size_t, gunichar *) decoder;
  int (*Encoder) (gunichar, char *, size_t) encoder;
  struct _GIConv * cd;
  guint i;

  icd = 4294967295B;
  decoder = 0B;
  encoder = 0B;
  D.7597 = to_charset == 0B;
  D.7598 = from_charset == 0B;
  D.7599 = D.7597 | D.7598;
  if (D.7599 != 0) goto <D.7595>; else goto <D.7600>;
  <D.7600>:
  D.7601 = *to_charset;
  if (D.7601 == 0) goto <D.7595>; else goto <D.7602>;
  <D.7602>:
  D.7603 = *from_charset;
  if (D.7603 == 0) goto <D.7595>; else goto <D.7596>;
  <D.7595>:
  D.7604 = __errno_location ();
  *D.7604 = 22;
  D.7605 = 4294967295B;
  return D.7605;
  <D.7596>:
  i = 0;
  goto <D.7269>;
  <D.7268>:
  D.7606 = charsets[i].name;
  D.7607 = monoeg_ascii_strcasecmp (D.7606, from_charset);
  if (D.7607 == 0) goto <D.7608>; else goto <D.7609>;
  <D.7608>:
  decoder = charsets[i].decoder;
  <D.7609>:
  D.7606 = charsets[i].name;
  D.7610 = monoeg_ascii_strcasecmp (D.7606, to_charset);
  if (D.7610 == 0) goto <D.7611>; else goto <D.7612>;
  <D.7611>:
  encoder = charsets[i].encoder;
  <D.7612>:
  i = i + 1;
  <D.7269>:
  if (i <= 14) goto <D.7268>; else goto <D.7270>;
  <D.7270>:
  D.7613 = encoder == 0B;
  D.7614 = decoder == 0B;
  D.7615 = D.7613 | D.7614;
  if (D.7615 != 0) goto <D.7616>; else goto <D.7617>;
  <D.7616>:
  icd = iconv_open (to_charset, from_charset);
  if (icd == 4294967295B) goto <D.7618>; else goto <D.7619>;
  <D.7618>:
  D.7605 = 4294967295B;
  return D.7605;
  <D.7619>:
  <D.7617>:
  cd = monoeg_malloc (16);
  cd->decode = decoder;
  cd->encode = encoder;
  cd->c = 4294967295;
  cd->cd = icd;
  D.7605 = cd;
  return D.7605;
}


encode_utf8 (gunichar c, char * outbuf, size_t outleft)
{
  unsigned char D.7623;
  int D.7624;
  unsigned int n.0;
  int * D.7640;
  sizetype i.1;
  unsigned char * D.7642;
  unsigned char D.7643;
  unsigned char D.7644;
  unsigned char D.7645;
  unsigned char D.7646;
  unsigned char * outptr;
  int base;
  int n;
  int i;

  outptr = outbuf;
  if (c <= 127) goto <D.7621>; else goto <D.7622>;
  <D.7621>:
  D.7623 = (unsigned char) c;
  *outptr = D.7623;
  D.7624 = 1;
  return D.7624;
  <D.7622>:
  if (c <= 2047) goto <D.7625>; else goto <D.7626>;
  <D.7625>:
  base = 192;
  n = 2;
  goto <D.7627>;
  <D.7626>:
  if (c <= 65535) goto <D.7628>; else goto <D.7629>;
  <D.7628>:
  base = 224;
  n = 3;
  goto <D.7630>;
  <D.7629>:
  if (c <= 2097151) goto <D.7631>; else goto <D.7632>;
  <D.7631>:
  base = 240;
  n = 4;
  goto <D.7633>;
  <D.7632>:
  if (c <= 67108863) goto <D.7634>; else goto <D.7635>;
  <D.7634>:
  base = 248;
  n = 5;
  goto <D.7636>;
  <D.7635>:
  base = 252;
  n = 6;
  <D.7636>:
  <D.7633>:
  <D.7630>:
  <D.7627>:
  n.0 = (unsigned int) n;
  if (n.0 > outleft) goto <D.7638>; else goto <D.7639>;
  <D.7638>:
  D.7640 = __errno_location ();
  *D.7640 = 7;
  D.7624 = -1;
  return D.7624;
  <D.7639>:
  i = n + -1;
  goto <D.7375>;
  <D.7374>:
  i.1 = (sizetype) i;
  D.7642 = outptr + i.1;
  D.7623 = (unsigned char) c;
  D.7643 = D.7623 & 63;
  D.7644 = D.7643 | 128;
  *D.7642 = D.7644;
  c = c >> 6;
  i = i + -1;
  <D.7375>:
  if (i > 0) goto <D.7374>; else goto <D.7376>;
  <D.7376>:
  D.7623 = (unsigned char) c;
  D.7645 = (unsigned char) base;
  D.7646 = D.7623 | D.7645;
  *outptr = D.7646;
  D.7624 = n;
  return D.7624;
}


decode_utf8 (char * inbuf, size_t inleft, gunichar * outchar)
{
  unsigned char D.7648;
  int D.7651;
  int * D.7654;
  unsigned int n.2;
  unsigned int D.7673;
  unsigned char D.7674;
  unsigned int D.7675;
  unsigned char * inptr;
  gunichar u;
  int n;
  int i;

  inptr = inbuf;
  D.7648 = *inptr;
  u = (gunichar) D.7648;
  if (u <= 127) goto <D.7649>; else goto <D.7650>;
  <D.7649>:
  *outchar = u;
  D.7651 = 1;
  return D.7651;
  <D.7650>:
  if (u <= 193) goto <D.7652>; else goto <D.7653>;
  <D.7652>:
  D.7654 = __errno_location ();
  *D.7654 = 84;
  D.7651 = -1;
  return D.7651;
  <D.7653>:
  if (u <= 223) goto <D.7655>; else goto <D.7656>;
  <D.7655>:
  u = u & 31;
  n = 2;
  goto <D.7657>;
  <D.7656>:
  if (u <= 239) goto <D.7658>; else goto <D.7659>;
  <D.7658>:
  u = u & 15;
  n = 3;
  goto <D.7660>;
  <D.7659>:
  if (u <= 247) goto <D.7661>; else goto <D.7662>;
  <D.7661>:
  u = u & 7;
  n = 4;
  goto <D.7663>;
  <D.7662>:
  if (u <= 251) goto <D.7664>; else goto <D.7665>;
  <D.7664>:
  u = u & 3;
  n = 5;
  goto <D.7666>;
  <D.7665>:
  if (u <= 253) goto <D.7667>; else goto <D.7668>;
  <D.7667>:
  u = u & 1;
  n = 6;
  goto <D.7669>;
  <D.7668>:
  D.7654 = __errno_location ();
  *D.7654 = 84;
  D.7651 = -1;
  return D.7651;
  <D.7669>:
  <D.7666>:
  <D.7663>:
  <D.7660>:
  <D.7657>:
  n.2 = (unsigned int) n;
  if (n.2 > inleft) goto <D.7671>; else goto <D.7672>;
  <D.7671>:
  D.7654 = __errno_location ();
  *D.7654 = 22;
  D.7651 = -1;
  return D.7651;
  <D.7672>:
  i = 1;
  goto <D.7363>;
  <D.7362>:
  D.7673 = u << 6;
  inptr = inptr + 1;
  D.7648 = *inptr;
  D.7674 = D.7648 ^ 128;
  D.7675 = (unsigned int) D.7674;
  u = D.7673 | D.7675;
  i = i + 1;
  <D.7363>:
  if (i < n) goto <D.7362>; else goto <D.7364>;
  <D.7364>:
  *outchar = u;
  D.7651 = n;
  return D.7651;
}


encode_utf16le (gunichar c, char * outbuf, size_t outleft)
{
  int * D.7681;
  int D.7682;
  unsigned char D.7683;
  unsigned char * D.7684;
  unsigned int D.7685;
  unsigned char D.7686;
  unsigned int D.7689;
  short unsigned int D.7690;
  unsigned char D.7691;
  short unsigned int D.7692;
  unsigned char D.7693;
  short unsigned int D.7694;
  short unsigned int D.7695;
  unsigned char * D.7696;
  unsigned char * D.7697;
  unsigned char * outptr;
  gunichar2 ch;
  gunichar c2;

  outptr = outbuf;
  if (c <= 65535) goto <D.7677>; else goto <D.7678>;
  <D.7677>:
  if (outleft <= 1) goto <D.7679>; else goto <D.7680>;
  <D.7679>:
  D.7681 = __errno_location ();
  *D.7681 = 7;
  D.7682 = -1;
  return D.7682;
  <D.7680>:
  D.7683 = (unsigned char) c;
  *outptr = D.7683;
  D.7684 = outptr + 1;
  D.7685 = c >> 8;
  D.7686 = (unsigned char) D.7685;
  *D.7684 = D.7686;
  D.7682 = 2;
  return D.7682;
  <D.7678>:
  if (outleft <= 3) goto <D.7687>; else goto <D.7688>;
  <D.7687>:
  D.7681 = __errno_location ();
  *D.7681 = 7;
  D.7682 = -1;
  return D.7682;
  <D.7688>:
  c2 = c + 4294901760;
  D.7689 = c2 >> 10;
  D.7690 = (short unsigned int) D.7689;
  ch = D.7690 + 55296;
  D.7691 = (unsigned char) ch;
  *outptr = D.7691;
  D.7684 = outptr + 1;
  D.7692 = ch >> 8;
  D.7693 = (unsigned char) D.7692;
  *D.7684 = D.7693;
  D.7694 = (short unsigned int) c2;
  D.7695 = D.7694 & 1023;
  ch = D.7695 + 56320;
  D.7696 = outptr + 2;
  D.7691 = (unsigned char) ch;
  *D.7696 = D.7691;
  D.7697 = outptr + 3;
  D.7692 = ch >> 8;
  D.7693 = (unsigned char) D.7692;
  *D.7697 = D.7693;
  D.7682 = 4;
  return D.7682;
}


decode_utf16le (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.7701;
  int D.7702;
  unsigned char * D.7703;
  unsigned char D.7704;
  int D.7705;
  int D.7706;
  unsigned char D.7707;
  int D.7708;
  int D.7709;
  unsigned char * D.7716;
  unsigned char D.7717;
  int D.7718;
  int D.7719;
  signed short D.7720;
  unsigned char * D.7721;
  unsigned char D.7722;
  signed short D.7723;
  signed short D.7724;
  short unsigned int D.7725;
  unsigned int D.7728;
  unsigned int D.7729;
  unsigned int D.7730;
  unsigned int D.7731;
  unsigned char * inptr;
  gunichar2 c;
  gunichar u;

  inptr = inbuf;
  if (inleft <= 1) goto <D.7699>; else goto <D.7700>;
  <D.7699>:
  D.7701 = __errno_location ();
  *D.7701 = 22;
  D.7702 = -1;
  return D.7702;
  <D.7700>:
  D.7703 = inptr + 1;
  D.7704 = *D.7703;
  D.7705 = (int) D.7704;
  D.7706 = D.7705 << 8;
  D.7707 = *inptr;
  D.7708 = (int) D.7707;
  D.7709 = D.7706 | D.7708;
  u = (gunichar) D.7709;
  if (u <= 55295) goto <D.7710>; else goto <D.7711>;
  <D.7710>:
  *outchar = u;
  D.7702 = 2;
  return D.7702;
  <D.7711>:
  if (u <= 56319) goto <D.7712>; else goto <D.7713>;
  <D.7712>:
  if (inleft <= 3) goto <D.7714>; else goto <D.7715>;
  <D.7714>:
  D.7701 = __errno_location ();
  *D.7701 = 22;
  D.7702 = -2;
  return D.7702;
  <D.7715>:
  D.7716 = inptr + 3;
  D.7717 = *D.7716;
  D.7718 = (int) D.7717;
  D.7719 = D.7718 << 8;
  D.7720 = (signed short) D.7719;
  D.7721 = inptr + 2;
  D.7722 = *D.7721;
  D.7723 = (signed short) D.7722;
  D.7724 = D.7720 | D.7723;
  c = (gunichar2) D.7724;
  D.7725 = c + 9216;
  if (D.7725 > 1023) goto <D.7726>; else goto <D.7727>;
  <D.7726>:
  D.7701 = __errno_location ();
  *D.7701 = 84;
  D.7702 = -2;
  return D.7702;
  <D.7727>:
  D.7728 = u + 4294912000;
  D.7729 = D.7728 << 10;
  D.7730 = (unsigned int) c;
  D.7731 = D.7729 + D.7730;
  u = D.7731 + 9216;
  *outchar = u;
  D.7702 = 4;
  return D.7702;
  <D.7713>:
  if (u <= 57343) goto <D.7732>; else goto <D.7733>;
  <D.7732>:
  D.7701 = __errno_location ();
  *D.7701 = 84;
  D.7702 = -1;
  return D.7702;
  <D.7733>:
  *outchar = u;
  D.7702 = 2;
  return D.7702;
}


encode_utf16be (gunichar c, char * outbuf, size_t outleft)
{
  int * D.7739;
  int D.7740;
  unsigned int D.7741;
  unsigned char D.7742;
  unsigned char * D.7743;
  unsigned char D.7744;
  unsigned int D.7747;
  short unsigned int D.7748;
  short unsigned int D.7749;
  unsigned char D.7750;
  unsigned char D.7751;
  short unsigned int D.7752;
  short unsigned int D.7753;
  unsigned char * D.7754;
  unsigned char * D.7755;
  unsigned char * outptr;
  gunichar2 ch;
  gunichar c2;

  outptr = outbuf;
  if (c <= 65535) goto <D.7735>; else goto <D.7736>;
  <D.7735>:
  if (outleft <= 1) goto <D.7737>; else goto <D.7738>;
  <D.7737>:
  D.7739 = __errno_location ();
  *D.7739 = 7;
  D.7740 = -1;
  return D.7740;
  <D.7738>:
  D.7741 = c >> 8;
  D.7742 = (unsigned char) D.7741;
  *outptr = D.7742;
  D.7743 = outptr + 1;
  D.7744 = (unsigned char) c;
  *D.7743 = D.7744;
  D.7740 = 2;
  return D.7740;
  <D.7736>:
  if (outleft <= 3) goto <D.7745>; else goto <D.7746>;
  <D.7745>:
  D.7739 = __errno_location ();
  *D.7739 = 7;
  D.7740 = -1;
  return D.7740;
  <D.7746>:
  c2 = c + 4294901760;
  D.7747 = c2 >> 10;
  D.7748 = (short unsigned int) D.7747;
  ch = D.7748 + 55296;
  D.7749 = ch >> 8;
  D.7750 = (unsigned char) D.7749;
  *outptr = D.7750;
  D.7743 = outptr + 1;
  D.7751 = (unsigned char) ch;
  *D.7743 = D.7751;
  D.7752 = (short unsigned int) c2;
  D.7753 = D.7752 & 1023;
  ch = D.7753 + 56320;
  D.7754 = outptr + 2;
  D.7749 = ch >> 8;
  D.7750 = (unsigned char) D.7749;
  *D.7754 = D.7750;
  D.7755 = outptr + 3;
  D.7751 = (unsigned char) ch;
  *D.7755 = D.7751;
  D.7740 = 4;
  return D.7740;
}


decode_utf16be (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.7759;
  int D.7760;
  unsigned char D.7761;
  int D.7762;
  int D.7763;
  unsigned char * D.7764;
  unsigned char D.7765;
  int D.7766;
  int D.7767;
  unsigned char * D.7774;
  unsigned char D.7775;
  int D.7776;
  int D.7777;
  signed short D.7778;
  unsigned char * D.7779;
  unsigned char D.7780;
  signed short D.7781;
  signed short D.7782;
  short unsigned int D.7783;
  unsigned int D.7786;
  unsigned int D.7787;
  unsigned int D.7788;
  unsigned int D.7789;
  unsigned char * inptr;
  gunichar2 c;
  gunichar u;

  inptr = inbuf;
  if (inleft <= 1) goto <D.7757>; else goto <D.7758>;
  <D.7757>:
  D.7759 = __errno_location ();
  *D.7759 = 22;
  D.7760 = -1;
  return D.7760;
  <D.7758>:
  D.7761 = *inptr;
  D.7762 = (int) D.7761;
  D.7763 = D.7762 << 8;
  D.7764 = inptr + 1;
  D.7765 = *D.7764;
  D.7766 = (int) D.7765;
  D.7767 = D.7763 | D.7766;
  u = (gunichar) D.7767;
  if (u <= 55295) goto <D.7768>; else goto <D.7769>;
  <D.7768>:
  *outchar = u;
  D.7760 = 2;
  return D.7760;
  <D.7769>:
  if (u <= 56319) goto <D.7770>; else goto <D.7771>;
  <D.7770>:
  if (inleft <= 3) goto <D.7772>; else goto <D.7773>;
  <D.7772>:
  D.7759 = __errno_location ();
  *D.7759 = 22;
  D.7760 = -2;
  return D.7760;
  <D.7773>:
  D.7774 = inptr + 2;
  D.7775 = *D.7774;
  D.7776 = (int) D.7775;
  D.7777 = D.7776 << 8;
  D.7778 = (signed short) D.7777;
  D.7779 = inptr + 3;
  D.7780 = *D.7779;
  D.7781 = (signed short) D.7780;
  D.7782 = D.7778 | D.7781;
  c = (gunichar2) D.7782;
  D.7783 = c + 9216;
  if (D.7783 > 1023) goto <D.7784>; else goto <D.7785>;
  <D.7784>:
  D.7759 = __errno_location ();
  *D.7759 = 84;
  D.7760 = -2;
  return D.7760;
  <D.7785>:
  D.7786 = u + 4294912000;
  D.7787 = D.7786 << 10;
  D.7788 = (unsigned int) c;
  D.7789 = D.7787 + D.7788;
  u = D.7789 + 9216;
  *outchar = u;
  D.7760 = 4;
  return D.7760;
  <D.7771>:
  if (u <= 57343) goto <D.7790>; else goto <D.7791>;
  <D.7790>:
  D.7759 = __errno_location ();
  *D.7759 = 84;
  D.7760 = -1;
  return D.7760;
  <D.7791>:
  *outchar = u;
  D.7760 = 2;
  return D.7760;
}


encode_utf32le (gunichar c, char * outbuf, size_t outleft)
{
  int * D.7795;
  int D.7796;
  unsigned char D.7797;
  unsigned char * D.7798;
  unsigned int D.7799;
  unsigned char D.7800;
  unsigned char * D.7801;
  unsigned int D.7802;
  unsigned char D.7803;
  unsigned char * D.7804;
  unsigned int D.7805;
  unsigned char D.7806;
  unsigned char * outptr;

  outptr = outbuf;
  if (outleft <= 3) goto <D.7793>; else goto <D.7794>;
  <D.7793>:
  D.7795 = __errno_location ();
  *D.7795 = 7;
  D.7796 = -1;
  return D.7796;
  <D.7794>:
  D.7797 = (unsigned char) c;
  *outptr = D.7797;
  D.7798 = outptr + 1;
  D.7799 = c >> 8;
  D.7800 = (unsigned char) D.7799;
  *D.7798 = D.7800;
  D.7801 = outptr + 2;
  D.7802 = c >> 16;
  D.7803 = (unsigned char) D.7802;
  *D.7801 = D.7803;
  D.7804 = outptr + 3;
  D.7805 = c >> 24;
  D.7806 = (unsigned char) D.7805;
  *D.7804 = D.7806;
  D.7796 = 4;
  return D.7796;
}


decode_utf32le (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.7810;
  int D.7811;
  unsigned char * D.7812;
  unsigned char D.7813;
  int D.7814;
  int D.7815;
  unsigned char * D.7816;
  unsigned char D.7817;
  int D.7818;
  int D.7819;
  int D.7820;
  unsigned char * D.7821;
  unsigned char D.7822;
  int D.7823;
  int D.7824;
  int D.7825;
  unsigned char D.7826;
  int D.7827;
  int D.7828;
  unsigned int D.7829;
  unsigned char * inptr;
  gunichar c;

  inptr = inbuf;
  if (inleft <= 3) goto <D.7808>; else goto <D.7809>;
  <D.7808>:
  D.7810 = __errno_location ();
  *D.7810 = 22;
  D.7811 = -1;
  return D.7811;
  <D.7809>:
  D.7812 = inptr + 3;
  D.7813 = *D.7812;
  D.7814 = (int) D.7813;
  D.7815 = D.7814 << 24;
  D.7816 = inptr + 2;
  D.7817 = *D.7816;
  D.7818 = (int) D.7817;
  D.7819 = D.7818 << 16;
  D.7820 = D.7815 | D.7819;
  D.7821 = inptr + 1;
  D.7822 = *D.7821;
  D.7823 = (int) D.7822;
  D.7824 = D.7823 << 8;
  D.7825 = D.7820 | D.7824;
  D.7826 = *inptr;
  D.7827 = (int) D.7826;
  D.7828 = D.7825 | D.7827;
  c = (gunichar) D.7828;
  D.7829 = c + 4294912000;
  if (D.7829 <= 2047) goto <D.7830>; else goto <D.7831>;
  <D.7830>:
  D.7810 = __errno_location ();
  *D.7810 = 84;
  D.7811 = -1;
  return D.7811;
  <D.7831>:
  if (c > 1114111) goto <D.7832>; else goto <D.7833>;
  <D.7832>:
  D.7810 = __errno_location ();
  *D.7810 = 84;
  D.7811 = -1;
  return D.7811;
  <D.7833>:
  *outchar = c;
  D.7811 = 4;
  return D.7811;
}


encode_utf32be (gunichar c, char * outbuf, size_t outleft)
{
  int * D.7837;
  int D.7838;
  unsigned int D.7839;
  unsigned char D.7840;
  unsigned char * D.7841;
  unsigned int D.7842;
  unsigned char D.7843;
  unsigned char * D.7844;
  unsigned int D.7845;
  unsigned char D.7846;
  unsigned char * D.7847;
  unsigned char D.7848;
  unsigned char * outptr;

  outptr = outbuf;
  if (outleft <= 3) goto <D.7835>; else goto <D.7836>;
  <D.7835>:
  D.7837 = __errno_location ();
  *D.7837 = 7;
  D.7838 = -1;
  return D.7838;
  <D.7836>:
  D.7839 = c >> 24;
  D.7840 = (unsigned char) D.7839;
  *outptr = D.7840;
  D.7841 = outptr + 1;
  D.7842 = c >> 16;
  D.7843 = (unsigned char) D.7842;
  *D.7841 = D.7843;
  D.7844 = outptr + 2;
  D.7845 = c >> 8;
  D.7846 = (unsigned char) D.7845;
  *D.7844 = D.7846;
  D.7847 = outptr + 3;
  D.7848 = (unsigned char) c;
  *D.7847 = D.7848;
  D.7838 = 4;
  return D.7838;
}


decode_utf32be (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.7852;
  int D.7853;
  unsigned char D.7854;
  int D.7855;
  int D.7856;
  unsigned char * D.7857;
  unsigned char D.7858;
  int D.7859;
  int D.7860;
  int D.7861;
  unsigned char * D.7862;
  unsigned char D.7863;
  int D.7864;
  int D.7865;
  int D.7866;
  unsigned char * D.7867;
  unsigned char D.7868;
  int D.7869;
  int D.7870;
  unsigned int D.7871;
  unsigned char * inptr;
  gunichar c;

  inptr = inbuf;
  if (inleft <= 3) goto <D.7850>; else goto <D.7851>;
  <D.7850>:
  D.7852 = __errno_location ();
  *D.7852 = 22;
  D.7853 = -1;
  return D.7853;
  <D.7851>:
  D.7854 = *inptr;
  D.7855 = (int) D.7854;
  D.7856 = D.7855 << 24;
  D.7857 = inptr + 1;
  D.7858 = *D.7857;
  D.7859 = (int) D.7858;
  D.7860 = D.7859 << 16;
  D.7861 = D.7856 | D.7860;
  D.7862 = inptr + 2;
  D.7863 = *D.7862;
  D.7864 = (int) D.7863;
  D.7865 = D.7864 << 8;
  D.7866 = D.7861 | D.7865;
  D.7867 = inptr + 3;
  D.7868 = *D.7867;
  D.7869 = (int) D.7868;
  D.7870 = D.7866 | D.7869;
  c = (gunichar) D.7870;
  D.7871 = c + 4294912000;
  if (D.7871 <= 2047) goto <D.7872>; else goto <D.7873>;
  <D.7872>:
  D.7852 = __errno_location ();
  *D.7852 = 84;
  D.7853 = -1;
  return D.7853;
  <D.7873>:
  if (c > 1114111) goto <D.7874>; else goto <D.7875>;
  <D.7874>:
  D.7852 = __errno_location ();
  *D.7852 = 84;
  D.7853 = -1;
  return D.7853;
  <D.7875>:
  *outchar = c;
  D.7853 = 4;
  return D.7853;
}


encode_latin1 (gunichar c, char * outbuf, size_t outleft)
{
  int * D.7879;
  int D.7880;
  char D.7883;

  if (outleft == 0) goto <D.7877>; else goto <D.7878>;
  <D.7877>:
  D.7879 = __errno_location ();
  *D.7879 = 7;
  D.7880 = -1;
  return D.7880;
  <D.7878>:
  if (c > 255) goto <D.7881>; else goto <D.7882>;
  <D.7881>:
  D.7879 = __errno_location ();
  *D.7879 = 84;
  D.7880 = -1;
  return D.7880;
  <D.7882>:
  D.7883 = (char) c;
  *outbuf = D.7883;
  D.7880 = 1;
  return D.7880;
}


decode_latin1 (char * inbuf, size_t inleft, gunichar * outchar)
{
  char D.7885;
  unsigned int D.7886;
  int D.7887;

  D.7885 = *inbuf;
  D.7886 = (unsigned int) D.7885;
  *outchar = D.7886;
  D.7887 = 1;
  return D.7887;
}


monoeg_g_iconv_close (struct _GIConv * cd)
{
  void * D.7889;
  int D.7892;

  D.7889 = cd->cd;
  if (D.7889 != 4294967295B) goto <D.7890>; else goto <D.7891>;
  <D.7890>:
  D.7889 = cd->cd;
  iconv_close (D.7889);
  <D.7891>:
  monoeg_g_free (cd);
  D.7892 = 0;
  return D.7892;
}


monoeg_g_iconv (struct _GIConv * cd, gchar * * inbytes, gsize * inbytesleft, gchar * * outbytes, gsize * outbytesleft)
{
  void * D.7894;
  unsigned int n_inleft.3;
  unsigned int n_outleft.4;
  gsize D.7905;
  _Bool D.7906;
  _Bool D.7907;
  _Bool D.7908;
  gsize iftmp.5;
  char * iftmp.6;
  unsigned int c.7;
  unsigned int c.8;
  int (*<T1854>) (char *, size_t, gunichar *) D.7922;
  unsigned int rc.9;
  sizetype rc.10;
  int (*<T1859>) (gunichar, char *, size_t) D.7926;
  gsize iftmp.11;
  gsize inleft;
  gsize outleft;
  char * inptr;
  char * outptr;
  gunichar c;
  int rc;
  void encode = <<< error >>>;

  try
    {
      rc = 0;
      D.7894 = cd->cd;
      if (D.7894 != 4294967295B) goto <D.7895>; else goto <D.7896>;
      <D.7895>:
      {
        size_t * outleftptr;
        size_t * inleftptr;
        size_t n_outleft;
        size_t n_inleft;

        try
          {
            if (inbytesleft != 0B) goto <D.7897>; else goto <D.7898>;
            <D.7897>:
            n_inleft.3 = *inbytesleft;
            n_inleft = n_inleft.3;
            inleftptr = &n_inleft;
            goto <D.7900>;
            <D.7898>:
            inleftptr = 0B;
            <D.7900>:
            if (outbytesleft != 0B) goto <D.7901>; else goto <D.7902>;
            <D.7901>:
            n_outleft.4 = *outbytesleft;
            n_outleft = n_outleft.4;
            outleftptr = &n_outleft;
            goto <D.7904>;
            <D.7902>:
            outleftptr = 0B;
            <D.7904>:
            D.7894 = cd->cd;
            D.7905 = iconv (D.7894, inbytes, inleftptr, outbytes, outleftptr);
            return D.7905;
          }
        finally
          {
            n_outleft = {CLOBBER};
            n_inleft = {CLOBBER};
          }
      }
      <D.7896>:
      D.7906 = outbytes == 0B;
      D.7907 = outbytesleft == 0B;
      D.7908 = D.7906 | D.7907;
      if (D.7908 != 0) goto <D.7909>; else goto <D.7910>;
      <D.7909>:
      cd->c = 4294967295;
      D.7905 = 0;
      return D.7905;
      <D.7910>:
      if (inbytesleft != 0B) goto <D.7912>; else goto <D.7913>;
      <D.7912>:
      iftmp.5 = *inbytesleft;
      goto <D.7914>;
      <D.7913>:
      iftmp.5 = 0;
      <D.7914>:
      inleft = iftmp.5;
      if (inbytes != 0B) goto <D.7916>; else goto <D.7917>;
      <D.7916>:
      iftmp.6 = *inbytes;
      goto <D.7918>;
      <D.7917>:
      iftmp.6 = 0B;
      <D.7918>:
      inptr = iftmp.6;
      outleft = *outbytesleft;
      outptr = *outbytes;
      c.7 = cd->c;
      c = c.7;
      c.8 = c;
      if (c.8 != 4294967295) goto encode; else goto <D.7921>;
      <D.7921>:
      goto <D.7294>;
      <D.7293>:
      D.7922 = cd->decode;
      rc = D.7922 (inptr, inleft, &c);
      if (rc < 0) goto <D.7292>; else goto <D.7923>;
      <D.7923>:
      rc.9 = (unsigned int) rc;
      inleft = inleft - rc.9;
      rc.10 = (sizetype) rc;
      inptr = inptr + rc.10;
      encode:
      D.7926 = cd->encode;
      c.8 = c;
      rc = D.7926 (c.8, outptr, outleft);
      if (rc < 0) goto <D.7292>; else goto <D.7927>;
      <D.7927>:
      c = 4294967295;
      rc.9 = (unsigned int) rc;
      outleft = outleft - rc.9;
      rc.10 = (sizetype) rc;
      outptr = outptr + rc.10;
      <D.7294>:
      if (inleft != 0) goto <D.7293>; else goto <D.7292>;
      <D.7292>:
      if (inbytesleft != 0B) goto <D.7928>; else goto <D.7929>;
      <D.7928>:
      *inbytesleft = inleft;
      <D.7929>:
      if (inbytes != 0B) goto <D.7930>; else goto <D.7931>;
      <D.7930>:
      *inbytes = inptr;
      <D.7931>:
      *outbytesleft = outleft;
      *outbytes = outptr;
      c.8 = c;
      cd->c = c.8;
      if (rc < 0) goto <D.7933>; else goto <D.7934>;
      <D.7933>:
      iftmp.11 = 4294967295;
      goto <D.7935>;
      <D.7934>:
      iftmp.11 = 0;
      <D.7935>:
      D.7905 = iftmp.11;
      return D.7905;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_convert_error_quark ()
{
  void * D.7939;

  D.7939 = error_quark;
  return D.7939;
}


monoeg_g_convert (const gchar * str, gssize len, const gchar * to_charset, const gchar * from_charset, gsize * bytes_read, gsize * bytes_written, struct GError * * err)
{
  gchar * D.7943;
  void * D.7950;
  size_t iftmp.12;
  unsigned int inleft.13;
  unsigned int D.7960;
  int * D.7966;
  int D.7967;
  unsigned int D.7968;
  char * outbuf.14;
  int outbuf.15;
  int result.16;
  int D.7972;
  unsigned int outleft.17;
  unsigned int outleft.18;
  char * outbuf.19;
  void * D.7979;
  const gchar * D.7980;
  char * inbuf.20;
  int inbuf.21;
  int str.22;
  int D.7986;
  unsigned int D.7987;
  void * D.7990;
  const gchar * D.7991;
  unsigned int D.8000;
  gsize outsize;
  gsize outused;
  gsize outleft;
  gsize inleft;
  gsize grow;
  gsize rc;
  char * result;
  char * outbuf;
  char * inbuf;
  gboolean flush;
  gboolean done;
  struct _GIConv * cd;

  try
    {
      flush = 0;
      done = 0;
      if (str == 0B) goto <D.7941>; else goto <D.7942>;
      <D.7941>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 669, "str != NULL");
      D.7943 = 0B;
      return D.7943;
      <D.7942>:
      if (to_charset == 0B) goto <D.7944>; else goto <D.7945>;
      <D.7944>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 670, "to_charset != NULL");
      D.7943 = 0B;
      return D.7943;
      <D.7945>:
      if (from_charset == 0B) goto <D.7946>; else goto <D.7947>;
      <D.7946>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 671, "from_charset != NULL");
      D.7943 = 0B;
      return D.7943;
      <D.7947>:
      cd = monoeg_g_iconv_open (to_charset, from_charset);
      if (cd == 4294967295B) goto <D.7948>; else goto <D.7949>;
      <D.7948>:
      D.7950 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.7950, 0, "Conversion from %s to %s not supported.", from_charset, to_charset);
      if (bytes_written != 0B) goto <D.7951>; else goto <D.7952>;
      <D.7951>:
      *bytes_written = 0;
      <D.7952>:
      if (bytes_read != 0B) goto <D.7953>; else goto <D.7954>;
      <D.7953>:
      *bytes_read = 0;
      <D.7954>:
      D.7943 = 0B;
      return D.7943;
      <D.7949>:
      if (len < 0) goto <D.7956>; else goto <D.7957>;
      <D.7956>:
      iftmp.12 = strlen (str);
      goto <D.7958>;
      <D.7957>:
      iftmp.12 = (size_t) len;
      <D.7958>:
      inleft = iftmp.12;
      inbuf = str;
      inleft.13 = inleft;
      outsize = MAX_EXPR <inleft.13, 8>;
      outleft = outsize;
      D.7960 = outsize + 4;
      result = monoeg_malloc (D.7960);
      outbuf = result;
      <D.7418>:
      if (flush == 0) goto <D.7961>; else goto <D.7962>;
      <D.7961>:
      rc = monoeg_g_iconv (cd, &inbuf, &inleft, &outbuf, &outleft);
      goto <D.7963>;
      <D.7962>:
      rc = monoeg_g_iconv (cd, 0B, 0B, &outbuf, &outleft);
      <D.7963>:
      if (rc == 4294967295) goto <D.7964>; else goto <D.7965>;
      <D.7964>:
      D.7966 = __errno_location ();
      D.7967 = *D.7966;
      switch (D.7967) <default: <D.7416>, case 7: <D.7412>, case 22: <D.7414>, case 84: <D.7415>>
      <D.7412>:
      inleft.13 = inleft;
      D.7968 = MAX_EXPR <inleft.13, 8>;
      grow = D.7968 << 1;
      outbuf.14 = outbuf;
      outbuf.15 = (int) outbuf.14;
      result.16 = (int) result;
      D.7972 = outbuf.15 - result.16;
      outused = (gsize) D.7972;
      outsize = outsize + grow;
      outleft.17 = outleft;
      outleft.18 = outleft.17 + grow;
      outleft = outleft.18;
      D.7960 = outsize + 4;
      result = monoeg_realloc (result, D.7960);
      outbuf.19 = result + outused;
      outbuf = outbuf.19;
      goto <D.7413>;
      <D.7414>:
      if (flush != 0) goto <D.7976>; else goto <D.7977>;
      <D.7976>:
      done = 1;
      goto <D.7978>;
      <D.7977>:
      flush = 1;
      <D.7978>:
      goto <D.7413>;
      <D.7415>:
      D.7979 = monoeg_g_convert_error_quark ();
      D.7966 = __errno_location ();
      D.7967 = *D.7966;
      D.7980 = monoeg_g_strerror (D.7967);
      monoeg_g_set_error (err, D.7979, 1, "%s", D.7980);
      if (bytes_read != 0B) goto <D.7981>; else goto <D.7982>;
      <D.7981>:
      inbuf.20 = inbuf;
      inbuf.21 = (int) inbuf.20;
      str.22 = (int) str;
      D.7986 = inbuf.21 - str.22;
      D.7987 = (unsigned int) D.7986;
      *bytes_read = D.7987;
      <D.7982>:
      if (bytes_written != 0B) goto <D.7988>; else goto <D.7989>;
      <D.7988>:
      *bytes_written = 0;
      <D.7989>:
      monoeg_g_iconv_close (cd);
      monoeg_g_free (result);
      D.7943 = 0B;
      return D.7943;
      <D.7416>:
      D.7990 = monoeg_g_convert_error_quark ();
      D.7966 = __errno_location ();
      D.7967 = *D.7966;
      D.7991 = monoeg_g_strerror (D.7967);
      monoeg_g_set_error (err, D.7990, 2, "%s", D.7991);
      if (bytes_written != 0B) goto <D.7992>; else goto <D.7993>;
      <D.7992>:
      *bytes_written = 0;
      <D.7993>:
      if (bytes_read != 0B) goto <D.7994>; else goto <D.7995>;
      <D.7994>:
      *bytes_read = 0;
      <D.7995>:
      monoeg_g_iconv_close (cd);
      monoeg_g_free (result);
      D.7943 = 0B;
      return D.7943;
      <D.7413>:
      goto <D.7996>;
      <D.7965>:
      if (flush != 0) goto <D.7417>; else goto <D.7997>;
      <D.7997>:
      flush = 1;
      <D.7996>:
      if (done == 0) goto <D.7418>; else goto <D.7417>;
      <D.7417>:
      monoeg_g_iconv_close (cd);
      outbuf.14 = outbuf;
      memset (outbuf.14, 0, 4);
      if (bytes_written != 0B) goto <D.7998>; else goto <D.7999>;
      <D.7998>:
      outbuf.14 = outbuf;
      outbuf.15 = (int) outbuf.14;
      result.16 = (int) result;
      D.7972 = outbuf.15 - result.16;
      D.8000 = (unsigned int) D.7972;
      *bytes_written = D.8000;
      <D.7999>:
      if (bytes_read != 0B) goto <D.8001>; else goto <D.8002>;
      <D.8001>:
      inbuf.20 = inbuf;
      inbuf.21 = (int) inbuf.20;
      str.22 = (int) str;
      D.7986 = inbuf.21 - str.22;
      D.7987 = (unsigned int) D.7986;
      *bytes_read = D.7987;
      <D.8002>:
      D.7943 = result;
      return D.7943;
    }
  finally
    {
      outleft = {CLOBBER};
      inleft = {CLOBBER};
      outbuf = {CLOBBER};
      inbuf = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.8007;
  int D.8012;
  void * D.8014;
  unsigned int D.8015;

  D.8007 = __builtin_constant_p (__len);
  if (D.8007 != 0) goto <D.8008>; else goto <D.8009>;
  <D.8008>:
  if (__len == 0) goto <D.8010>; else goto <D.8011>;
  <D.8010>:
  D.8012 = __builtin_constant_p (__ch);
  if (D.8012 == 0) goto <D.8005>; else goto <D.8013>;
  <D.8013>:
  if (__ch != 0) goto <D.8005>; else goto <D.8006>;
  <D.8005>:
  __warn_memset_zero_len ();
  D.8014 = __dest;
  return D.8014;
  <D.8006>:
  <D.8011>:
  <D.8009>:
  D.8015 = __builtin_object_size (__dest, 0);
  D.8014 = __builtin___memset_chk (__dest, __ch, __len, D.8015);
  return D.8014;
}


monoeg_g_unichar_to_utf8 (gunichar c, gchar * outbuf)
{
  signed int c.23;
  gint D.8036;
  sizetype i.24;
  gchar * D.8040;
  char D.8041;
  char D.8042;
  char D.8043;
  char D.8044;
  char D.8045;
  int base;
  int n;
  int i;

  if (c <= 127) goto <D.8017>; else goto <D.8018>;
  <D.8017>:
  base = 0;
  n = 1;
  goto <D.8019>;
  <D.8018>:
  if (c <= 2047) goto <D.8020>; else goto <D.8021>;
  <D.8020>:
  base = 192;
  n = 2;
  goto <D.8022>;
  <D.8021>:
  if (c <= 65535) goto <D.8023>; else goto <D.8024>;
  <D.8023>:
  base = 224;
  n = 3;
  goto <D.8025>;
  <D.8024>:
  if (c <= 2097151) goto <D.8026>; else goto <D.8027>;
  <D.8026>:
  base = 240;
  n = 4;
  goto <D.8028>;
  <D.8027>:
  if (c <= 67108863) goto <D.8029>; else goto <D.8030>;
  <D.8029>:
  base = 248;
  n = 5;
  goto <D.8031>;
  <D.8030>:
  c.23 = (signed int) c;
  if (c.23 >= 0) goto <D.8033>; else goto <D.8034>;
  <D.8033>:
  base = 252;
  n = 6;
  goto <D.8035>;
  <D.8034>:
  D.8036 = -1;
  return D.8036;
  <D.8035>:
  <D.8031>:
  <D.8028>:
  <D.8025>:
  <D.8022>:
  <D.8019>:
  if (outbuf != 0B) goto <D.8037>; else goto <D.8038>;
  <D.8037>:
  i = n + -1;
  goto <D.7427>;
  <D.7426>:
  i.24 = (sizetype) i;
  D.8040 = outbuf + i.24;
  D.8041 = (char) c;
  D.8042 = D.8041 & 63;
  D.8043 = D.8042 | 128;
  *D.8040 = D.8043;
  c = c >> 6;
  i = i + -1;
  <D.7427>:
  if (i > 0) goto <D.7426>; else goto <D.7428>;
  <D.7428>:
  D.8041 = (char) c;
  D.8044 = (char) base;
  D.8045 = D.8041 | D.8044;
  *outbuf = D.8045;
  <D.8038>:
  D.8036 = n;
  return D.8036;
}


monoeg_g_utf8_to_ucs4_fast (const gchar * str, glong len, glong * items_written)
{
  gunichar * D.8049;
  long int D.8052;
  long unsigned int D.8053;
  long unsigned int D.8054;
  gunichar * outptr.25;
  unsigned int D.8056;
  char D.8057;
  int D.8058;
  unsigned char D.8059;
  sizetype D.8060;
  gunichar * outbuf;
  gunichar * outptr;
  char * inptr;
  glong n;
  glong i;

  if (str == 0B) goto <D.8047>; else goto <D.8048>;
  <D.8047>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 896, "str != NULL");
  D.8049 = 0B;
  return D.8049;
  <D.8048>:
  n = monoeg_g_utf8_strlen (str, len);
  if (items_written != 0B) goto <D.8050>; else goto <D.8051>;
  <D.8050>:
  *items_written = n;
  <D.8051>:
  D.8052 = n + 1;
  D.8053 = (long unsigned int) D.8052;
  D.8054 = D.8053 * 4;
  outbuf = monoeg_malloc (D.8054);
  outptr = outbuf;
  inptr = str;
  i = 0;
  goto <D.7445>;
  <D.7444>:
  outptr.25 = outptr;
  outptr = outptr.25 + 4;
  D.8056 = monoeg_g_utf8_get_char (inptr);
  *outptr.25 = D.8056;
  D.8057 = *inptr;
  D.8058 = (int) D.8057;
  D.8059 = g_utf8_jump_table[D.8058];
  D.8060 = (sizetype) D.8059;
  inptr = inptr + D.8060;
  i = i + 1;
  <D.7445>:
  if (i < n) goto <D.7444>; else goto <D.7446>;
  <D.7446>:
  *outptr = 0;
  D.8049 = outbuf;
  return D.8049;
}


monoeg_g_utf8_to_utf16 (const gchar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar2 * D.8062;

  D.8062 = eg_utf8_to_utf16_general (str, len, items_read, items_written, 0, err);
  return D.8062;
}


eg_utf8_to_utf16_general (const gchar * str, glong len, glong * items_read, glong * items_written, gboolean include_nuls, struct GError * * err)
{
  gunichar2 * D.8066;
  void * D.8071;
  unsigned int D.8072;
  unsigned int c.26;
  int * D.8080;
  unsigned int u.27;
  unsigned int n.28;
  sizetype n.29;
  int inptr.30;
  int str.31;
  int D.8088;
  long int outlen.32;
  unsigned int D.8092;
  unsigned int D.8093;
  int D.8098;
  unsigned int D.8099;
  unsigned int D.8100;
  int D.8101;
  void * D.8104;
  void * D.8109;
  gunichar2 * outbuf;
  gunichar2 * outptr;
  size_t outlen;
  size_t inleft;
  char * inptr;
  gunichar c;
  int u;
  int n;
  void error = <<< error >>>;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.8064>; else goto <D.8065>;
      <D.8064>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 926, "str != NULL");
      D.8066 = 0B;
      return D.8066;
      <D.8065>:
      if (len < 0) goto <D.8067>; else goto <D.8068>;
      <D.8067>:
      if (include_nuls != 0) goto <D.8069>; else goto <D.8070>;
      <D.8069>:
      D.8071 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8071, 2, "Conversions with embedded nulls must pass the string length");
      D.8066 = 0B;
      return D.8066;
      <D.8070>:
      D.8072 = strlen (str);
      len = (glong) D.8072;
      <D.8068>:
      inptr = str;
      inleft = (size_t) len;
      goto <D.7466>;
      <D.7465>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto error; else goto <D.8073>;
      <D.8073>:
      c.26 = c;
      if (c.26 == 0) goto <D.8075>; else goto <D.8076>;
      <D.8075>:
      if (include_nuls == 0) goto <D.7464>; else goto <D.8077>;
      <D.8077>:
      <D.8076>:
      c.26 = c;
      u = monoeg_unichar_to_utf16 (c.26, 0B);
      if (u < 0) goto <D.8078>; else goto <D.8079>;
      <D.8078>:
      D.8080 = __errno_location ();
      *D.8080 = 84;
      goto error;
      <D.8079>:
      u.27 = (unsigned int) u;
      outlen = outlen + u.27;
      n.28 = (unsigned int) n;
      inleft = inleft - n.28;
      n.29 = (sizetype) n;
      inptr = inptr + n.29;
      <D.7466>:
      if (inleft != 0) goto <D.7465>; else goto <D.7464>;
      <D.7464>:
      if (items_read != 0B) goto <D.8084>; else goto <D.8085>;
      <D.8084>:
      inptr.30 = (int) inptr;
      str.31 = (int) str;
      D.8088 = inptr.30 - str.31;
      *items_read = D.8088;
      <D.8085>:
      if (items_written != 0B) goto <D.8089>; else goto <D.8090>;
      <D.8089>:
      outlen.32 = (long int) outlen;
      *items_written = outlen.32;
      <D.8090>:
      D.8092 = outlen + 1;
      D.8093 = D.8092 * 2;
      outbuf = monoeg_malloc (D.8093);
      outptr = outbuf;
      inptr = str;
      inleft = (size_t) len;
      goto <D.7469>;
      <D.7468>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.7467>; else goto <D.8094>;
      <D.8094>:
      c.26 = c;
      if (c.26 == 0) goto <D.8095>; else goto <D.8096>;
      <D.8095>:
      if (include_nuls == 0) goto <D.7467>; else goto <D.8097>;
      <D.8097>:
      <D.8096>:
      c.26 = c;
      D.8098 = monoeg_unichar_to_utf16 (c.26, outptr);
      D.8099 = (unsigned int) D.8098;
      D.8100 = D.8099 * 2;
      outptr = outptr + D.8100;
      n.28 = (unsigned int) n;
      inleft = inleft - n.28;
      n.29 = (sizetype) n;
      inptr = inptr + n.29;
      <D.7469>:
      if (inleft != 0) goto <D.7468>; else goto <D.7467>;
      <D.7467>:
      *outptr = 0;
      D.8066 = outbuf;
      return D.8066;
      error:
      D.8080 = __errno_location ();
      D.8101 = *D.8080;
      if (D.8101 == 84) goto <D.8102>; else goto <D.8103>;
      <D.8102>:
      D.8104 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8104, 1, "Illegal byte sequence encounted in the input.");
      goto <D.8105>;
      <D.8103>:
      if (items_read != 0B) goto <D.8106>; else goto <D.8107>;
      <D.8106>:
      goto <D.8108>;
      <D.8107>:
      D.8109 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8109, 3, "Partial byte sequence encountered in the input.");
      <D.8108>:
      <D.8105>:
      if (items_read != 0B) goto <D.8110>; else goto <D.8111>;
      <D.8110>:
      inptr.30 = (int) inptr;
      str.31 = (int) str;
      D.8088 = inptr.30 - str.31;
      *items_read = D.8088;
      <D.8111>:
      if (items_written != 0B) goto <D.8112>; else goto <D.8113>;
      <D.8112>:
      *items_written = 0;
      <D.8113>:
      D.8066 = 0B;
      return D.8066;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_unichar_to_utf16 (gunichar c, gunichar2 * outbuf)
{
  short unsigned int D.8120;
  int D.8121;
  unsigned int D.8132;
  short unsigned int D.8133;
  short unsigned int D.8134;
  gunichar2 * D.8135;
  short unsigned int D.8136;
  short unsigned int D.8137;
  short unsigned int D.8138;
  gunichar c2;

  if (c <= 55295) goto <D.8116>; else goto <D.8117>;
  <D.8116>:
  if (outbuf != 0B) goto <D.8118>; else goto <D.8119>;
  <D.8118>:
  D.8120 = (short unsigned int) c;
  *outbuf = D.8120;
  <D.8119>:
  D.8121 = 1;
  return D.8121;
  <D.8117>:
  if (c <= 57343) goto <D.8122>; else goto <D.8123>;
  <D.8122>:
  D.8121 = -1;
  return D.8121;
  <D.8123>:
  if (c <= 65535) goto <D.8124>; else goto <D.8125>;
  <D.8124>:
  if (outbuf != 0B) goto <D.8126>; else goto <D.8127>;
  <D.8126>:
  D.8120 = (short unsigned int) c;
  *outbuf = D.8120;
  <D.8127>:
  D.8121 = 1;
  return D.8121;
  <D.8125>:
  if (c <= 1114111) goto <D.8128>; else goto <D.8129>;
  <D.8128>:
  if (outbuf != 0B) goto <D.8130>; else goto <D.8131>;
  <D.8130>:
  c2 = c + 4294901760;
  D.8132 = c2 >> 10;
  D.8133 = (short unsigned int) D.8132;
  D.8134 = D.8133 + 55296;
  *outbuf = D.8134;
  D.8135 = outbuf + 2;
  D.8136 = (short unsigned int) c2;
  D.8137 = D.8136 & 1023;
  D.8138 = D.8137 + 56320;
  *D.8135 = D.8138;
  <D.8131>:
  D.8121 = 2;
  return D.8121;
  <D.8129>:
  D.8121 = -1;
  return D.8121;
}


eg_utf8_to_utf16_with_nuls (const gchar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar2 * D.8140;

  D.8140 = eg_utf8_to_utf16_general (str, len, items_read, items_written, 1, err);
  return D.8140;
}


monoeg_utf8_to_ucs4 (const gchar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar * D.8144;
  unsigned int D.8147;
  int * D.8150;
  int D.8151;
  void * D.8154;
  void * D.8157;
  int inptr.33;
  int str.34;
  int D.8162;
  unsigned int c.35;
  unsigned int n.36;
  sizetype n.37;
  unsigned int D.8171;
  long int D.8172;
  unsigned int D.8175;
  gunichar * outptr.38;
  gunichar * outbuf;
  gunichar * outptr;
  size_t outlen;
  size_t inleft;
  char * inptr;
  gunichar c;
  int n;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.8142>; else goto <D.8143>;
      <D.8142>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1025, "str != NULL");
      D.8144 = 0B;
      return D.8144;
      <D.8143>:
      if (len < 0) goto <D.8145>; else goto <D.8146>;
      <D.8145>:
      D.8147 = strlen (str);
      len = (glong) D.8147;
      <D.8146>:
      inptr = str;
      inleft = (size_t) len;
      goto <D.7500>;
      <D.7499>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.8148>; else goto <D.8149>;
      <D.8148>:
      D.8150 = __errno_location ();
      D.8151 = *D.8150;
      if (D.8151 == 84) goto <D.8152>; else goto <D.8153>;
      <D.8152>:
      D.8154 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8154, 1, "Illegal byte sequence encounted in the input.");
      goto <D.8155>;
      <D.8153>:
      if (items_read != 0B) goto <D.7498>; else goto <D.8156>;
      <D.8156>:
      D.8157 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8157, 3, "Partial byte sequence encountered in the input.");
      <D.8155>:
      if (items_read != 0B) goto <D.8158>; else goto <D.8159>;
      <D.8158>:
      inptr.33 = (int) inptr;
      str.34 = (int) str;
      D.8162 = inptr.33 - str.34;
      *items_read = D.8162;
      <D.8159>:
      if (items_written != 0B) goto <D.8163>; else goto <D.8164>;
      <D.8163>:
      *items_written = 0;
      <D.8164>:
      D.8144 = 0B;
      return D.8144;
      <D.8149>:
      c.35 = c;
      if (c.35 == 0) goto <D.7498>; else goto <D.8166>;
      <D.8166>:
      outlen = outlen + 4;
      n.36 = (unsigned int) n;
      inleft = inleft - n.36;
      n.37 = (sizetype) n;
      inptr = inptr + n.37;
      <D.7500>:
      if (inleft != 0) goto <D.7499>; else goto <D.7498>;
      <D.7498>:
      if (items_written != 0B) goto <D.8169>; else goto <D.8170>;
      <D.8169>:
      D.8171 = outlen / 4;
      D.8172 = (long int) D.8171;
      *items_written = D.8172;
      <D.8170>:
      if (items_read != 0B) goto <D.8173>; else goto <D.8174>;
      <D.8173>:
      inptr.33 = (int) inptr;
      str.34 = (int) str;
      D.8162 = inptr.33 - str.34;
      *items_read = D.8162;
      <D.8174>:
      D.8175 = outlen + 4;
      outbuf = monoeg_malloc (D.8175);
      outptr = outbuf;
      inptr = str;
      inleft = (size_t) len;
      goto <D.7503>;
      <D.7502>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.7501>; else goto <D.8176>;
      <D.8176>:
      c.35 = c;
      if (c.35 == 0) goto <D.7501>; else goto <D.8177>;
      <D.8177>:
      outptr.38 = outptr;
      outptr = outptr.38 + 4;
      c.35 = c;
      *outptr.38 = c.35;
      n.36 = (unsigned int) n;
      inleft = inleft - n.36;
      n.37 = (sizetype) n;
      inptr = inptr + n.37;
      <D.7503>:
      if (inleft != 0) goto <D.7502>; else goto <D.7501>;
      <D.7501>:
      *outptr = 0;
      D.8144 = outbuf;
      return D.8144;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_utf16_to_utf8 (const gunichar2 * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gchar * D.8183;
  unsigned int len.39;
  unsigned int D.8187;
  const gunichar2 * D.8188;
  short unsigned int D.8189;
  long int D.8190;
  _Bool D.8193;
  _Bool D.8194;
  _Bool D.8195;
  int * D.8198;
  int D.8199;
  void * D.8202;
  void * D.8205;
  int inptr.40;
  int str.41;
  int D.8210;
  int D.8211;
  unsigned int c.42;
  int D.8216;
  unsigned int D.8217;
  unsigned int n.43;
  sizetype n.44;
  long int outlen.45;
  unsigned int D.8225;
  int D.8228;
  sizetype D.8229;
  char * inptr;
  char * outbuf;
  char * outptr;
  size_t outlen;
  size_t inleft;
  gunichar c;
  int n;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.8181>; else goto <D.8182>;
      <D.8181>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1096, "str != NULL");
      D.8183 = 0B;
      return D.8183;
      <D.8182>:
      if (len < 0) goto <D.8184>; else goto <D.8185>;
      <D.8184>:
      len = 0;
      goto <D.7519>;
      <D.7518>:
      len = len + 1;
      <D.7519>:
      len.39 = (unsigned int) len;
      D.8187 = len.39 * 2;
      D.8188 = str + D.8187;
      D.8189 = *D.8188;
      if (D.8189 != 0) goto <D.7518>; else goto <D.7520>;
      <D.7520>:
      <D.8185>:
      inptr = str;
      D.8190 = len * 2;
      inleft = (size_t) D.8190;
      goto <D.7523>;
      <D.7522>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.8191>; else goto <D.8192>;
      <D.8191>:
      D.8193 = n == -2;
      D.8194 = inleft > 2;
      D.8195 = D.8193 & D.8194;
      if (D.8195 != 0) goto <D.8196>; else goto <D.8197>;
      <D.8196>:
      inleft = inleft + 4294967294;
      inptr = inptr + 2;
      <D.8197>:
      D.8198 = __errno_location ();
      D.8199 = *D.8198;
      if (D.8199 == 84) goto <D.8200>; else goto <D.8201>;
      <D.8200>:
      D.8202 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8202, 1, "Illegal byte sequence encounted in the input.");
      goto <D.8203>;
      <D.8201>:
      if (items_read != 0B) goto <D.7521>; else goto <D.8204>;
      <D.8204>:
      D.8205 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8205, 3, "Partial byte sequence encountered in the input.");
      <D.8203>:
      if (items_read != 0B) goto <D.8206>; else goto <D.8207>;
      <D.8206>:
      inptr.40 = (int) inptr;
      str.41 = (int) str;
      D.8210 = inptr.40 - str.41;
      D.8211 = D.8210 / 2;
      *items_read = D.8211;
      <D.8207>:
      if (items_written != 0B) goto <D.8212>; else goto <D.8213>;
      <D.8212>:
      *items_written = 0;
      <D.8213>:
      D.8183 = 0B;
      return D.8183;
      <D.8192>:
      c.42 = c;
      if (c.42 == 0) goto <D.7521>; else goto <D.8215>;
      <D.8215>:
      c.42 = c;
      D.8216 = monoeg_g_unichar_to_utf8 (c.42, 0B);
      D.8217 = (unsigned int) D.8216;
      outlen = D.8217 + outlen;
      n.43 = (unsigned int) n;
      inleft = inleft - n.43;
      n.44 = (sizetype) n;
      inptr = inptr + n.44;
      <D.7523>:
      if (inleft != 0) goto <D.7522>; else goto <D.7521>;
      <D.7521>:
      if (items_read != 0B) goto <D.8220>; else goto <D.8221>;
      <D.8220>:
      inptr.40 = (int) inptr;
      str.41 = (int) str;
      D.8210 = inptr.40 - str.41;
      D.8211 = D.8210 / 2;
      *items_read = D.8211;
      <D.8221>:
      if (items_written != 0B) goto <D.8222>; else goto <D.8223>;
      <D.8222>:
      outlen.45 = (long int) outlen;
      *items_written = outlen.45;
      <D.8223>:
      D.8225 = outlen + 1;
      outbuf = monoeg_malloc (D.8225);
      outptr = outbuf;
      inptr = str;
      D.8190 = len * 2;
      inleft = (size_t) D.8190;
      goto <D.7526>;
      <D.7525>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.7524>; else goto <D.8226>;
      <D.8226>:
      c.42 = c;
      if (c.42 == 0) goto <D.7524>; else goto <D.8227>;
      <D.8227>:
      c.42 = c;
      D.8228 = monoeg_g_unichar_to_utf8 (c.42, outptr);
      D.8229 = (sizetype) D.8228;
      outptr = outptr + D.8229;
      n.43 = (unsigned int) n;
      inleft = inleft - n.43;
      n.44 = (sizetype) n;
      inptr = inptr + n.44;
      <D.7526>:
      if (inleft != 0) goto <D.7525>; else goto <D.7524>;
      <D.7524>:
      *outptr = 0;
      D.8183 = outbuf;
      return D.8183;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_utf16_to_ucs4 (const gunichar2 * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar * D.8234;
  unsigned int len.46;
  unsigned int D.8238;
  const gunichar2 * D.8239;
  short unsigned int D.8240;
  long int D.8241;
  _Bool D.8244;
  _Bool D.8245;
  _Bool D.8246;
  int * D.8249;
  int D.8250;
  void * D.8253;
  void * D.8256;
  int inptr.47;
  int str.48;
  int D.8261;
  int D.8262;
  unsigned int c.49;
  unsigned int n.50;
  sizetype n.51;
  unsigned int D.8273;
  long int D.8274;
  unsigned int D.8275;
  gunichar * outptr.52;
  gunichar * outbuf;
  gunichar * outptr;
  size_t outlen;
  size_t inleft;
  char * inptr;
  gunichar c;
  int n;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.8232>; else goto <D.8233>;
      <D.8232>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1177, "str != NULL");
      D.8234 = 0B;
      return D.8234;
      <D.8233>:
      if (len < 0) goto <D.8235>; else goto <D.8236>;
      <D.8235>:
      len = 0;
      goto <D.7542>;
      <D.7541>:
      len = len + 1;
      <D.7542>:
      len.46 = (unsigned int) len;
      D.8238 = len.46 * 2;
      D.8239 = str + D.8238;
      D.8240 = *D.8239;
      if (D.8240 != 0) goto <D.7541>; else goto <D.7543>;
      <D.7543>:
      <D.8236>:
      inptr = str;
      D.8241 = len * 2;
      inleft = (size_t) D.8241;
      goto <D.7546>;
      <D.7545>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.8242>; else goto <D.8243>;
      <D.8242>:
      D.8244 = n == -2;
      D.8245 = inleft > 2;
      D.8246 = D.8244 & D.8245;
      if (D.8246 != 0) goto <D.8247>; else goto <D.8248>;
      <D.8247>:
      inleft = inleft + 4294967294;
      inptr = inptr + 2;
      <D.8248>:
      D.8249 = __errno_location ();
      D.8250 = *D.8249;
      if (D.8250 == 84) goto <D.8251>; else goto <D.8252>;
      <D.8251>:
      D.8253 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8253, 1, "Illegal byte sequence encounted in the input.");
      goto <D.8254>;
      <D.8252>:
      if (items_read != 0B) goto <D.7544>; else goto <D.8255>;
      <D.8255>:
      D.8256 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.8256, 3, "Partial byte sequence encountered in the input.");
      <D.8254>:
      if (items_read != 0B) goto <D.8257>; else goto <D.8258>;
      <D.8257>:
      inptr.47 = (int) inptr;
      str.48 = (int) str;
      D.8261 = inptr.47 - str.48;
      D.8262 = D.8261 / 2;
      *items_read = D.8262;
      <D.8258>:
      if (items_written != 0B) goto <D.8263>; else goto <D.8264>;
      <D.8263>:
      *items_written = 0;
      <D.8264>:
      D.8234 = 0B;
      return D.8234;
      <D.8243>:
      c.49 = c;
      if (c.49 == 0) goto <D.7544>; else goto <D.8266>;
      <D.8266>:
      outlen = outlen + 4;
      n.50 = (unsigned int) n;
      inleft = inleft - n.50;
      n.51 = (sizetype) n;
      inptr = inptr + n.51;
      <D.7546>:
      if (inleft != 0) goto <D.7545>; else goto <D.7544>;
      <D.7544>:
      if (items_read != 0B) goto <D.8269>; else goto <D.8270>;
      <D.8269>:
      inptr.47 = (int) inptr;
      str.48 = (int) str;
      D.8261 = inptr.47 - str.48;
      D.8262 = D.8261 / 2;
      *items_read = D.8262;
      <D.8270>:
      if (items_written != 0B) goto <D.8271>; else goto <D.8272>;
      <D.8271>:
      D.8273 = outlen / 4;
      D.8274 = (long int) D.8273;
      *items_written = D.8274;
      <D.8272>:
      D.8275 = outlen + 4;
      outbuf = monoeg_malloc (D.8275);
      outptr = outbuf;
      inptr = str;
      D.8241 = len * 2;
      inleft = (size_t) D.8241;
      goto <D.7549>;
      <D.7548>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.7547>; else goto <D.8276>;
      <D.8276>:
      c.49 = c;
      if (c.49 == 0) goto <D.7547>; else goto <D.8277>;
      <D.8277>:
      outptr.52 = outptr;
      outptr = outptr.52 + 4;
      c.49 = c;
      *outptr.52 = c.49;
      n.50 = (unsigned int) n;
      inleft = inleft - n.50;
      n.51 = (sizetype) n;
      inptr = inptr + n.51;
      <D.7549>:
      if (inleft != 0) goto <D.7548>; else goto <D.7547>;
      <D.7547>:
      *outptr = 0;
      D.8234 = outbuf;
      return D.8234;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_ucs4_to_utf8 (const gunichar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gchar * D.8283;
  unsigned int i.53;
  unsigned int D.8287;
  const gunichar * D.8288;
  unsigned int D.8289;
  void * D.8292;
  unsigned int n.54;
  void * D.8301;
  unsigned int D.8307;
  int D.8308;
  sizetype D.8309;
  long int outlen.55;
  char * outbuf;
  char * outptr;
  size_t outlen;
  glong i;
  int n;

  outlen = 0;
  if (str == 0B) goto <D.8281>; else goto <D.8282>;
  <D.8281>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1256, "str != NULL");
  D.8283 = 0B;
  return D.8283;
  <D.8282>:
  if (len < 0) goto <D.8284>; else goto <D.8285>;
  <D.8284>:
  i = 0;
  goto <D.7563>;
  <D.7562>:
  i.53 = (unsigned int) i;
  D.8287 = i.53 * 4;
  D.8288 = str + D.8287;
  D.8289 = *D.8288;
  n = monoeg_g_unichar_to_utf8 (D.8289, 0B);
  if (n < 0) goto <D.8290>; else goto <D.8291>;
  <D.8290>:
  D.8292 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.8292, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.8293>; else goto <D.8294>;
  <D.8293>:
  *items_written = 0;
  <D.8294>:
  if (items_read != 0B) goto <D.8295>; else goto <D.8296>;
  <D.8295>:
  *items_read = i;
  <D.8296>:
  D.8283 = 0B;
  return D.8283;
  <D.8291>:
  n.54 = (unsigned int) n;
  outlen = outlen + n.54;
  i = i + 1;
  <D.7563>:
  i.53 = (unsigned int) i;
  D.8287 = i.53 * 4;
  D.8288 = str + D.8287;
  D.8289 = *D.8288;
  if (D.8289 != 0) goto <D.7562>; else goto <D.7564>;
  <D.7564>:
  goto <D.8298>;
  <D.8285>:
  i = 0;
  goto <D.7566>;
  <D.7565>:
  i.53 = (unsigned int) i;
  D.8287 = i.53 * 4;
  D.8288 = str + D.8287;
  D.8289 = *D.8288;
  n = monoeg_g_unichar_to_utf8 (D.8289, 0B);
  if (n < 0) goto <D.8299>; else goto <D.8300>;
  <D.8299>:
  D.8301 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.8301, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.8302>; else goto <D.8303>;
  <D.8302>:
  *items_written = 0;
  <D.8303>:
  if (items_read != 0B) goto <D.8304>; else goto <D.8305>;
  <D.8304>:
  *items_read = i;
  <D.8305>:
  D.8283 = 0B;
  return D.8283;
  <D.8300>:
  n.54 = (unsigned int) n;
  outlen = outlen + n.54;
  i = i + 1;
  <D.7566>:
  if (i < len) goto <D.8306>; else goto <D.7567>;
  <D.8306>:
  i.53 = (unsigned int) i;
  D.8287 = i.53 * 4;
  D.8288 = str + D.8287;
  D.8289 = *D.8288;
  if (D.8289 != 0) goto <D.7565>; else goto <D.7567>;
  <D.7567>:
  <D.8298>:
  len = i;
  D.8307 = outlen + 1;
  outbuf = monoeg_malloc (D.8307);
  outptr = outbuf;
  i = 0;
  goto <D.7569>;
  <D.7568>:
  i.53 = (unsigned int) i;
  D.8287 = i.53 * 4;
  D.8288 = str + D.8287;
  D.8289 = *D.8288;
  D.8308 = monoeg_g_unichar_to_utf8 (D.8289, outptr);
  D.8309 = (sizetype) D.8308;
  outptr = outptr + D.8309;
  i = i + 1;
  <D.7569>:
  if (i < len) goto <D.7568>; else goto <D.7570>;
  <D.7570>:
  *outptr = 0;
  if (items_written != 0B) goto <D.8310>; else goto <D.8311>;
  <D.8310>:
  outlen.55 = (long int) outlen;
  *items_written = outlen.55;
  <D.8311>:
  if (items_read != 0B) goto <D.8313>; else goto <D.8314>;
  <D.8313>:
  *items_read = i;
  <D.8314>:
  D.8283 = outbuf;
  return D.8283;
}


monoeg_g_ucs4_to_utf16 (const gunichar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar2 * D.8318;
  unsigned int i.56;
  unsigned int D.8322;
  const gunichar * D.8323;
  unsigned int D.8324;
  void * D.8327;
  unsigned int n.57;
  void * D.8336;
  unsigned int D.8342;
  unsigned int D.8343;
  int D.8344;
  unsigned int D.8345;
  unsigned int D.8346;
  long int outlen.58;
  gunichar2 * outbuf;
  gunichar2 * outptr;
  size_t outlen;
  glong i;
  int n;

  outlen = 0;
  if (str == 0B) goto <D.8316>; else goto <D.8317>;
  <D.8316>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1318, "str != NULL");
  D.8318 = 0B;
  return D.8318;
  <D.8317>:
  if (len < 0) goto <D.8319>; else goto <D.8320>;
  <D.8319>:
  i = 0;
  goto <D.7584>;
  <D.7583>:
  i.56 = (unsigned int) i;
  D.8322 = i.56 * 4;
  D.8323 = str + D.8322;
  D.8324 = *D.8323;
  n = monoeg_unichar_to_utf16 (D.8324, 0B);
  if (n < 0) goto <D.8325>; else goto <D.8326>;
  <D.8325>:
  D.8327 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.8327, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.8328>; else goto <D.8329>;
  <D.8328>:
  *items_written = 0;
  <D.8329>:
  if (items_read != 0B) goto <D.8330>; else goto <D.8331>;
  <D.8330>:
  *items_read = i;
  <D.8331>:
  D.8318 = 0B;
  return D.8318;
  <D.8326>:
  n.57 = (unsigned int) n;
  outlen = outlen + n.57;
  i = i + 1;
  <D.7584>:
  i.56 = (unsigned int) i;
  D.8322 = i.56 * 4;
  D.8323 = str + D.8322;
  D.8324 = *D.8323;
  if (D.8324 != 0) goto <D.7583>; else goto <D.7585>;
  <D.7585>:
  goto <D.8333>;
  <D.8320>:
  i = 0;
  goto <D.7587>;
  <D.7586>:
  i.56 = (unsigned int) i;
  D.8322 = i.56 * 4;
  D.8323 = str + D.8322;
  D.8324 = *D.8323;
  n = monoeg_unichar_to_utf16 (D.8324, 0B);
  if (n < 0) goto <D.8334>; else goto <D.8335>;
  <D.8334>:
  D.8336 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.8336, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.8337>; else goto <D.8338>;
  <D.8337>:
  *items_written = 0;
  <D.8338>:
  if (items_read != 0B) goto <D.8339>; else goto <D.8340>;
  <D.8339>:
  *items_read = i;
  <D.8340>:
  D.8318 = 0B;
  return D.8318;
  <D.8335>:
  n.57 = (unsigned int) n;
  outlen = outlen + n.57;
  i = i + 1;
  <D.7587>:
  if (i < len) goto <D.8341>; else goto <D.7588>;
  <D.8341>:
  i.56 = (unsigned int) i;
  D.8322 = i.56 * 4;
  D.8323 = str + D.8322;
  D.8324 = *D.8323;
  if (D.8324 != 0) goto <D.7586>; else goto <D.7588>;
  <D.7588>:
  <D.8333>:
  len = i;
  D.8342 = outlen + 1;
  D.8343 = D.8342 * 2;
  outbuf = monoeg_malloc (D.8343);
  outptr = outbuf;
  i = 0;
  goto <D.7590>;
  <D.7589>:
  i.56 = (unsigned int) i;
  D.8322 = i.56 * 4;
  D.8323 = str + D.8322;
  D.8324 = *D.8323;
  D.8344 = monoeg_unichar_to_utf16 (D.8324, outptr);
  D.8345 = (unsigned int) D.8344;
  D.8346 = D.8345 * 2;
  outptr = outptr + D.8346;
  i = i + 1;
  <D.7590>:
  if (i < len) goto <D.7589>; else goto <D.7591>;
  <D.7591>:
  *outptr = 0;
  if (items_written != 0B) goto <D.8347>; else goto <D.8348>;
  <D.8347>:
  outlen.58 = (long int) outlen;
  *items_written = outlen.58;
  <D.8348>:
  if (items_read != 0B) goto <D.8350>; else goto <D.8351>;
  <D.8350>:
  *items_read = i;
  <D.8351>:
  D.8318 = outbuf;
  return D.8318;
}


