monoeg_g_iconv_open (const char * to_charset, const char * from_charset)
{
  char D.5854;
  char D.5856;
  int * D.5857;
  struct _GIConv * D.5858;
  const char * D.5859;
  int D.5860;
  int D.5863;
  void * icd;
  int (*Decoder) (char *, size_t, gunichar *) decoder;
  int (*Encoder) (gunichar, char *, size_t) encoder;
  struct _GIConv * cd;
  guint i;

  icd = -1B;
  decoder = 0B;
  encoder = 0B;
  if (to_charset == 0B) goto <D.5850>; else goto <D.5852>;
  <D.5852>:
  if (from_charset == 0B) goto <D.5850>; else goto <D.5853>;
  <D.5853>:
  D.5854 = *to_charset;
  if (D.5854 == 0) goto <D.5850>; else goto <D.5855>;
  <D.5855>:
  D.5856 = *from_charset;
  if (D.5856 == 0) goto <D.5850>; else goto <D.5851>;
  <D.5850>:
  D.5857 = __errno_location ();
  *D.5857 = 22;
  D.5858 = -1B;
  return D.5858;
  <D.5851>:
  i = 0;
  goto <D.5526>;
  <D.5525>:
  D.5859 = charsets[i].name;
  D.5860 = monoeg_ascii_strcasecmp (D.5859, from_charset);
  if (D.5860 == 0) goto <D.5861>; else goto <D.5862>;
  <D.5861>:
  decoder = charsets[i].decoder;
  <D.5862>:
  D.5859 = charsets[i].name;
  D.5863 = monoeg_ascii_strcasecmp (D.5859, to_charset);
  if (D.5863 == 0) goto <D.5864>; else goto <D.5865>;
  <D.5864>:
  encoder = charsets[i].encoder;
  <D.5865>:
  i = i + 1;
  <D.5526>:
  if (i <= 14) goto <D.5525>; else goto <D.5527>;
  <D.5527>:
  if (encoder == 0B) goto <D.5866>; else goto <D.5868>;
  <D.5868>:
  if (decoder == 0B) goto <D.5866>; else goto <D.5867>;
  <D.5866>:
  icd = iconv_open (to_charset, from_charset);
  if (icd == -1B) goto <D.5869>; else goto <D.5870>;
  <D.5869>:
  D.5858 = -1B;
  return D.5858;
  <D.5870>:
  <D.5867>:
  cd = monoeg_malloc (32);
  cd->decode = decoder;
  cd->encode = encoder;
  cd->c = 4294967295;
  cd->cd = icd;
  D.5858 = cd;
  return D.5858;
}


encode_utf8 (gunichar c, char * outbuf, size_t outleft)
{
  unsigned char D.5874;
  int D.5875;
  long unsigned int D.5888;
  int * D.5891;
  sizetype D.5892;
  unsigned char * D.5893;
  unsigned char D.5894;
  unsigned char D.5895;
  unsigned char D.5896;
  unsigned char D.5897;
  unsigned char * outptr;
  int base;
  int n;
  int i;

  outptr = outbuf;
  if (c <= 127) goto <D.5872>; else goto <D.5873>;
  <D.5872>:
  D.5874 = (unsigned char) c;
  *outptr = D.5874;
  D.5875 = 1;
  return D.5875;
  <D.5873>:
  if (c <= 2047) goto <D.5876>; else goto <D.5877>;
  <D.5876>:
  base = 192;
  n = 2;
  goto <D.5878>;
  <D.5877>:
  if (c <= 65535) goto <D.5879>; else goto <D.5880>;
  <D.5879>:
  base = 224;
  n = 3;
  goto <D.5881>;
  <D.5880>:
  if (c <= 2097151) goto <D.5882>; else goto <D.5883>;
  <D.5882>:
  base = 240;
  n = 4;
  goto <D.5884>;
  <D.5883>:
  if (c <= 67108863) goto <D.5885>; else goto <D.5886>;
  <D.5885>:
  base = 248;
  n = 5;
  goto <D.5887>;
  <D.5886>:
  base = 252;
  n = 6;
  <D.5887>:
  <D.5884>:
  <D.5881>:
  <D.5878>:
  D.5888 = (long unsigned int) n;
  if (D.5888 > outleft) goto <D.5889>; else goto <D.5890>;
  <D.5889>:
  D.5891 = __errno_location ();
  *D.5891 = 7;
  D.5875 = -1;
  return D.5875;
  <D.5890>:
  i = n + -1;
  goto <D.5632>;
  <D.5631>:
  D.5892 = (sizetype) i;
  D.5893 = outptr + D.5892;
  D.5874 = (unsigned char) c;
  D.5894 = D.5874 & 63;
  D.5895 = D.5894 | 128;
  *D.5893 = D.5895;
  c = c >> 6;
  i = i + -1;
  <D.5632>:
  if (i > 0) goto <D.5631>; else goto <D.5633>;
  <D.5633>:
  D.5874 = (unsigned char) c;
  D.5896 = (unsigned char) base;
  D.5897 = D.5874 | D.5896;
  *outptr = D.5897;
  D.5875 = n;
  return D.5875;
}


decode_utf8 (char * inbuf, size_t inleft, gunichar * outchar)
{
  unsigned char D.5899;
  int D.5902;
  int * D.5905;
  long unsigned int D.5921;
  unsigned int D.5924;
  unsigned char D.5925;
  unsigned int D.5926;
  unsigned char * inptr;
  gunichar u;
  int n;
  int i;

  inptr = inbuf;
  D.5899 = *inptr;
  u = (gunichar) D.5899;
  if (u <= 127) goto <D.5900>; else goto <D.5901>;
  <D.5900>:
  *outchar = u;
  D.5902 = 1;
  return D.5902;
  <D.5901>:
  if (u <= 193) goto <D.5903>; else goto <D.5904>;
  <D.5903>:
  D.5905 = __errno_location ();
  *D.5905 = 84;
  D.5902 = -1;
  return D.5902;
  <D.5904>:
  if (u <= 223) goto <D.5906>; else goto <D.5907>;
  <D.5906>:
  u = u & 31;
  n = 2;
  goto <D.5908>;
  <D.5907>:
  if (u <= 239) goto <D.5909>; else goto <D.5910>;
  <D.5909>:
  u = u & 15;
  n = 3;
  goto <D.5911>;
  <D.5910>:
  if (u <= 247) goto <D.5912>; else goto <D.5913>;
  <D.5912>:
  u = u & 7;
  n = 4;
  goto <D.5914>;
  <D.5913>:
  if (u <= 251) goto <D.5915>; else goto <D.5916>;
  <D.5915>:
  u = u & 3;
  n = 5;
  goto <D.5917>;
  <D.5916>:
  if (u <= 253) goto <D.5918>; else goto <D.5919>;
  <D.5918>:
  u = u & 1;
  n = 6;
  goto <D.5920>;
  <D.5919>:
  D.5905 = __errno_location ();
  *D.5905 = 84;
  D.5902 = -1;
  return D.5902;
  <D.5920>:
  <D.5917>:
  <D.5914>:
  <D.5911>:
  <D.5908>:
  D.5921 = (long unsigned int) n;
  if (D.5921 > inleft) goto <D.5922>; else goto <D.5923>;
  <D.5922>:
  D.5905 = __errno_location ();
  *D.5905 = 22;
  D.5902 = -1;
  return D.5902;
  <D.5923>:
  i = 1;
  goto <D.5620>;
  <D.5619>:
  D.5924 = u << 6;
  inptr = inptr + 1;
  D.5899 = *inptr;
  D.5925 = D.5899 ^ 128;
  D.5926 = (unsigned int) D.5925;
  u = D.5924 | D.5926;
  i = i + 1;
  <D.5620>:
  if (i < n) goto <D.5619>; else goto <D.5621>;
  <D.5621>:
  *outchar = u;
  D.5902 = n;
  return D.5902;
}


encode_utf16le (gunichar c, char * outbuf, size_t outleft)
{
  int * D.5932;
  int D.5933;
  unsigned char D.5934;
  unsigned char * D.5935;
  unsigned int D.5936;
  unsigned char D.5937;
  unsigned int D.5940;
  short unsigned int D.5941;
  unsigned char D.5942;
  short unsigned int D.5943;
  unsigned char D.5944;
  short unsigned int D.5945;
  short unsigned int D.5946;
  unsigned char * D.5947;
  unsigned char * D.5948;
  unsigned char * outptr;
  gunichar2 ch;
  gunichar c2;

  outptr = outbuf;
  if (c <= 65535) goto <D.5928>; else goto <D.5929>;
  <D.5928>:
  if (outleft <= 1) goto <D.5930>; else goto <D.5931>;
  <D.5930>:
  D.5932 = __errno_location ();
  *D.5932 = 7;
  D.5933 = -1;
  return D.5933;
  <D.5931>:
  D.5934 = (unsigned char) c;
  *outptr = D.5934;
  D.5935 = outptr + 1;
  D.5936 = c >> 8;
  D.5937 = (unsigned char) D.5936;
  *D.5935 = D.5937;
  D.5933 = 2;
  return D.5933;
  <D.5929>:
  if (outleft <= 3) goto <D.5938>; else goto <D.5939>;
  <D.5938>:
  D.5932 = __errno_location ();
  *D.5932 = 7;
  D.5933 = -1;
  return D.5933;
  <D.5939>:
  c2 = c + 4294901760;
  D.5940 = c2 >> 10;
  D.5941 = (short unsigned int) D.5940;
  ch = D.5941 + 55296;
  D.5942 = (unsigned char) ch;
  *outptr = D.5942;
  D.5935 = outptr + 1;
  D.5943 = ch >> 8;
  D.5944 = (unsigned char) D.5943;
  *D.5935 = D.5944;
  D.5945 = (short unsigned int) c2;
  D.5946 = D.5945 & 1023;
  ch = D.5946 + 56320;
  D.5947 = outptr + 2;
  D.5942 = (unsigned char) ch;
  *D.5947 = D.5942;
  D.5948 = outptr + 3;
  D.5943 = ch >> 8;
  D.5944 = (unsigned char) D.5943;
  *D.5948 = D.5944;
  D.5933 = 4;
  return D.5933;
}


decode_utf16le (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.5952;
  int D.5953;
  unsigned char * D.5954;
  unsigned char D.5955;
  int D.5956;
  int D.5957;
  unsigned char D.5958;
  int D.5959;
  int D.5960;
  unsigned char * D.5967;
  unsigned char D.5968;
  int D.5969;
  int D.5970;
  signed short D.5971;
  unsigned char * D.5972;
  unsigned char D.5973;
  signed short D.5974;
  signed short D.5975;
  short unsigned int D.5976;
  unsigned int D.5979;
  unsigned int D.5980;
  unsigned int D.5981;
  unsigned int D.5982;
  unsigned char * inptr;
  gunichar2 c;
  gunichar u;

  inptr = inbuf;
  if (inleft <= 1) goto <D.5950>; else goto <D.5951>;
  <D.5950>:
  D.5952 = __errno_location ();
  *D.5952 = 22;
  D.5953 = -1;
  return D.5953;
  <D.5951>:
  D.5954 = inptr + 1;
  D.5955 = *D.5954;
  D.5956 = (int) D.5955;
  D.5957 = D.5956 << 8;
  D.5958 = *inptr;
  D.5959 = (int) D.5958;
  D.5960 = D.5957 | D.5959;
  u = (gunichar) D.5960;
  if (u <= 55295) goto <D.5961>; else goto <D.5962>;
  <D.5961>:
  *outchar = u;
  D.5953 = 2;
  return D.5953;
  <D.5962>:
  if (u <= 56319) goto <D.5963>; else goto <D.5964>;
  <D.5963>:
  if (inleft <= 3) goto <D.5965>; else goto <D.5966>;
  <D.5965>:
  D.5952 = __errno_location ();
  *D.5952 = 22;
  D.5953 = -2;
  return D.5953;
  <D.5966>:
  D.5967 = inptr + 3;
  D.5968 = *D.5967;
  D.5969 = (int) D.5968;
  D.5970 = D.5969 << 8;
  D.5971 = (signed short) D.5970;
  D.5972 = inptr + 2;
  D.5973 = *D.5972;
  D.5974 = (signed short) D.5973;
  D.5975 = D.5971 | D.5974;
  c = (gunichar2) D.5975;
  D.5976 = c + 9216;
  if (D.5976 > 1023) goto <D.5977>; else goto <D.5978>;
  <D.5977>:
  D.5952 = __errno_location ();
  *D.5952 = 84;
  D.5953 = -2;
  return D.5953;
  <D.5978>:
  D.5979 = u + 4294912000;
  D.5980 = D.5979 << 10;
  D.5981 = (unsigned int) c;
  D.5982 = D.5980 + D.5981;
  u = D.5982 + 9216;
  *outchar = u;
  D.5953 = 4;
  return D.5953;
  <D.5964>:
  if (u <= 57343) goto <D.5983>; else goto <D.5984>;
  <D.5983>:
  D.5952 = __errno_location ();
  *D.5952 = 84;
  D.5953 = -1;
  return D.5953;
  <D.5984>:
  *outchar = u;
  D.5953 = 2;
  return D.5953;
}


encode_utf16be (gunichar c, char * outbuf, size_t outleft)
{
  int * D.5990;
  int D.5991;
  unsigned int D.5992;
  unsigned char D.5993;
  unsigned char * D.5994;
  unsigned char D.5995;
  unsigned int D.5998;
  short unsigned int D.5999;
  short unsigned int D.6000;
  unsigned char D.6001;
  unsigned char D.6002;
  short unsigned int D.6003;
  short unsigned int D.6004;
  unsigned char * D.6005;
  unsigned char * D.6006;
  unsigned char * outptr;
  gunichar2 ch;
  gunichar c2;

  outptr = outbuf;
  if (c <= 65535) goto <D.5986>; else goto <D.5987>;
  <D.5986>:
  if (outleft <= 1) goto <D.5988>; else goto <D.5989>;
  <D.5988>:
  D.5990 = __errno_location ();
  *D.5990 = 7;
  D.5991 = -1;
  return D.5991;
  <D.5989>:
  D.5992 = c >> 8;
  D.5993 = (unsigned char) D.5992;
  *outptr = D.5993;
  D.5994 = outptr + 1;
  D.5995 = (unsigned char) c;
  *D.5994 = D.5995;
  D.5991 = 2;
  return D.5991;
  <D.5987>:
  if (outleft <= 3) goto <D.5996>; else goto <D.5997>;
  <D.5996>:
  D.5990 = __errno_location ();
  *D.5990 = 7;
  D.5991 = -1;
  return D.5991;
  <D.5997>:
  c2 = c + 4294901760;
  D.5998 = c2 >> 10;
  D.5999 = (short unsigned int) D.5998;
  ch = D.5999 + 55296;
  D.6000 = ch >> 8;
  D.6001 = (unsigned char) D.6000;
  *outptr = D.6001;
  D.5994 = outptr + 1;
  D.6002 = (unsigned char) ch;
  *D.5994 = D.6002;
  D.6003 = (short unsigned int) c2;
  D.6004 = D.6003 & 1023;
  ch = D.6004 + 56320;
  D.6005 = outptr + 2;
  D.6000 = ch >> 8;
  D.6001 = (unsigned char) D.6000;
  *D.6005 = D.6001;
  D.6006 = outptr + 3;
  D.6002 = (unsigned char) ch;
  *D.6006 = D.6002;
  D.5991 = 4;
  return D.5991;
}


decode_utf16be (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.6010;
  int D.6011;
  unsigned char D.6012;
  int D.6013;
  int D.6014;
  unsigned char * D.6015;
  unsigned char D.6016;
  int D.6017;
  int D.6018;
  unsigned char * D.6025;
  unsigned char D.6026;
  int D.6027;
  int D.6028;
  signed short D.6029;
  unsigned char * D.6030;
  unsigned char D.6031;
  signed short D.6032;
  signed short D.6033;
  short unsigned int D.6034;
  unsigned int D.6037;
  unsigned int D.6038;
  unsigned int D.6039;
  unsigned int D.6040;
  unsigned char * inptr;
  gunichar2 c;
  gunichar u;

  inptr = inbuf;
  if (inleft <= 1) goto <D.6008>; else goto <D.6009>;
  <D.6008>:
  D.6010 = __errno_location ();
  *D.6010 = 22;
  D.6011 = -1;
  return D.6011;
  <D.6009>:
  D.6012 = *inptr;
  D.6013 = (int) D.6012;
  D.6014 = D.6013 << 8;
  D.6015 = inptr + 1;
  D.6016 = *D.6015;
  D.6017 = (int) D.6016;
  D.6018 = D.6014 | D.6017;
  u = (gunichar) D.6018;
  if (u <= 55295) goto <D.6019>; else goto <D.6020>;
  <D.6019>:
  *outchar = u;
  D.6011 = 2;
  return D.6011;
  <D.6020>:
  if (u <= 56319) goto <D.6021>; else goto <D.6022>;
  <D.6021>:
  if (inleft <= 3) goto <D.6023>; else goto <D.6024>;
  <D.6023>:
  D.6010 = __errno_location ();
  *D.6010 = 22;
  D.6011 = -2;
  return D.6011;
  <D.6024>:
  D.6025 = inptr + 2;
  D.6026 = *D.6025;
  D.6027 = (int) D.6026;
  D.6028 = D.6027 << 8;
  D.6029 = (signed short) D.6028;
  D.6030 = inptr + 3;
  D.6031 = *D.6030;
  D.6032 = (signed short) D.6031;
  D.6033 = D.6029 | D.6032;
  c = (gunichar2) D.6033;
  D.6034 = c + 9216;
  if (D.6034 > 1023) goto <D.6035>; else goto <D.6036>;
  <D.6035>:
  D.6010 = __errno_location ();
  *D.6010 = 84;
  D.6011 = -2;
  return D.6011;
  <D.6036>:
  D.6037 = u + 4294912000;
  D.6038 = D.6037 << 10;
  D.6039 = (unsigned int) c;
  D.6040 = D.6038 + D.6039;
  u = D.6040 + 9216;
  *outchar = u;
  D.6011 = 4;
  return D.6011;
  <D.6022>:
  if (u <= 57343) goto <D.6041>; else goto <D.6042>;
  <D.6041>:
  D.6010 = __errno_location ();
  *D.6010 = 84;
  D.6011 = -1;
  return D.6011;
  <D.6042>:
  *outchar = u;
  D.6011 = 2;
  return D.6011;
}


encode_utf32le (gunichar c, char * outbuf, size_t outleft)
{
  int * D.6046;
  int D.6047;
  unsigned char D.6048;
  unsigned char * D.6049;
  unsigned int D.6050;
  unsigned char D.6051;
  unsigned char * D.6052;
  unsigned int D.6053;
  unsigned char D.6054;
  unsigned char * D.6055;
  unsigned int D.6056;
  unsigned char D.6057;
  unsigned char * outptr;

  outptr = outbuf;
  if (outleft <= 3) goto <D.6044>; else goto <D.6045>;
  <D.6044>:
  D.6046 = __errno_location ();
  *D.6046 = 7;
  D.6047 = -1;
  return D.6047;
  <D.6045>:
  D.6048 = (unsigned char) c;
  *outptr = D.6048;
  D.6049 = outptr + 1;
  D.6050 = c >> 8;
  D.6051 = (unsigned char) D.6050;
  *D.6049 = D.6051;
  D.6052 = outptr + 2;
  D.6053 = c >> 16;
  D.6054 = (unsigned char) D.6053;
  *D.6052 = D.6054;
  D.6055 = outptr + 3;
  D.6056 = c >> 24;
  D.6057 = (unsigned char) D.6056;
  *D.6055 = D.6057;
  D.6047 = 4;
  return D.6047;
}


decode_utf32le (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.6061;
  int D.6062;
  unsigned char * D.6063;
  unsigned char D.6064;
  int D.6065;
  int D.6066;
  unsigned char * D.6067;
  unsigned char D.6068;
  int D.6069;
  int D.6070;
  int D.6071;
  unsigned char * D.6072;
  unsigned char D.6073;
  int D.6074;
  int D.6075;
  int D.6076;
  unsigned char D.6077;
  int D.6078;
  int D.6079;
  unsigned int D.6080;
  unsigned char * inptr;
  gunichar c;

  inptr = inbuf;
  if (inleft <= 3) goto <D.6059>; else goto <D.6060>;
  <D.6059>:
  D.6061 = __errno_location ();
  *D.6061 = 22;
  D.6062 = -1;
  return D.6062;
  <D.6060>:
  D.6063 = inptr + 3;
  D.6064 = *D.6063;
  D.6065 = (int) D.6064;
  D.6066 = D.6065 << 24;
  D.6067 = inptr + 2;
  D.6068 = *D.6067;
  D.6069 = (int) D.6068;
  D.6070 = D.6069 << 16;
  D.6071 = D.6066 | D.6070;
  D.6072 = inptr + 1;
  D.6073 = *D.6072;
  D.6074 = (int) D.6073;
  D.6075 = D.6074 << 8;
  D.6076 = D.6071 | D.6075;
  D.6077 = *inptr;
  D.6078 = (int) D.6077;
  D.6079 = D.6076 | D.6078;
  c = (gunichar) D.6079;
  D.6080 = c + 4294912000;
  if (D.6080 <= 2047) goto <D.6081>; else goto <D.6082>;
  <D.6081>:
  D.6061 = __errno_location ();
  *D.6061 = 84;
  D.6062 = -1;
  return D.6062;
  <D.6082>:
  if (c > 1114111) goto <D.6083>; else goto <D.6084>;
  <D.6083>:
  D.6061 = __errno_location ();
  *D.6061 = 84;
  D.6062 = -1;
  return D.6062;
  <D.6084>:
  *outchar = c;
  D.6062 = 4;
  return D.6062;
}


encode_utf32be (gunichar c, char * outbuf, size_t outleft)
{
  int * D.6088;
  int D.6089;
  unsigned int D.6090;
  unsigned char D.6091;
  unsigned char * D.6092;
  unsigned int D.6093;
  unsigned char D.6094;
  unsigned char * D.6095;
  unsigned int D.6096;
  unsigned char D.6097;
  unsigned char * D.6098;
  unsigned char D.6099;
  unsigned char * outptr;

  outptr = outbuf;
  if (outleft <= 3) goto <D.6086>; else goto <D.6087>;
  <D.6086>:
  D.6088 = __errno_location ();
  *D.6088 = 7;
  D.6089 = -1;
  return D.6089;
  <D.6087>:
  D.6090 = c >> 24;
  D.6091 = (unsigned char) D.6090;
  *outptr = D.6091;
  D.6092 = outptr + 1;
  D.6093 = c >> 16;
  D.6094 = (unsigned char) D.6093;
  *D.6092 = D.6094;
  D.6095 = outptr + 2;
  D.6096 = c >> 8;
  D.6097 = (unsigned char) D.6096;
  *D.6095 = D.6097;
  D.6098 = outptr + 3;
  D.6099 = (unsigned char) c;
  *D.6098 = D.6099;
  D.6089 = 4;
  return D.6089;
}


decode_utf32be (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.6103;
  int D.6104;
  unsigned char D.6105;
  int D.6106;
  int D.6107;
  unsigned char * D.6108;
  unsigned char D.6109;
  int D.6110;
  int D.6111;
  int D.6112;
  unsigned char * D.6113;
  unsigned char D.6114;
  int D.6115;
  int D.6116;
  int D.6117;
  unsigned char * D.6118;
  unsigned char D.6119;
  int D.6120;
  int D.6121;
  unsigned int D.6122;
  unsigned char * inptr;
  gunichar c;

  inptr = inbuf;
  if (inleft <= 3) goto <D.6101>; else goto <D.6102>;
  <D.6101>:
  D.6103 = __errno_location ();
  *D.6103 = 22;
  D.6104 = -1;
  return D.6104;
  <D.6102>:
  D.6105 = *inptr;
  D.6106 = (int) D.6105;
  D.6107 = D.6106 << 24;
  D.6108 = inptr + 1;
  D.6109 = *D.6108;
  D.6110 = (int) D.6109;
  D.6111 = D.6110 << 16;
  D.6112 = D.6107 | D.6111;
  D.6113 = inptr + 2;
  D.6114 = *D.6113;
  D.6115 = (int) D.6114;
  D.6116 = D.6115 << 8;
  D.6117 = D.6112 | D.6116;
  D.6118 = inptr + 3;
  D.6119 = *D.6118;
  D.6120 = (int) D.6119;
  D.6121 = D.6117 | D.6120;
  c = (gunichar) D.6121;
  D.6122 = c + 4294912000;
  if (D.6122 <= 2047) goto <D.6123>; else goto <D.6124>;
  <D.6123>:
  D.6103 = __errno_location ();
  *D.6103 = 84;
  D.6104 = -1;
  return D.6104;
  <D.6124>:
  if (c > 1114111) goto <D.6125>; else goto <D.6126>;
  <D.6125>:
  D.6103 = __errno_location ();
  *D.6103 = 84;
  D.6104 = -1;
  return D.6104;
  <D.6126>:
  *outchar = c;
  D.6104 = 4;
  return D.6104;
}


encode_latin1 (gunichar c, char * outbuf, size_t outleft)
{
  int * D.6130;
  int D.6131;
  char D.6134;

  if (outleft == 0) goto <D.6128>; else goto <D.6129>;
  <D.6128>:
  D.6130 = __errno_location ();
  *D.6130 = 7;
  D.6131 = -1;
  return D.6131;
  <D.6129>:
  if (c > 255) goto <D.6132>; else goto <D.6133>;
  <D.6132>:
  D.6130 = __errno_location ();
  *D.6130 = 84;
  D.6131 = -1;
  return D.6131;
  <D.6133>:
  D.6134 = (char) c;
  *outbuf = D.6134;
  D.6131 = 1;
  return D.6131;
}


decode_latin1 (char * inbuf, size_t inleft, gunichar * outchar)
{
  char D.6136;
  unsigned int D.6137;
  int D.6138;

  D.6136 = *inbuf;
  D.6137 = (unsigned int) D.6136;
  *outchar = D.6137;
  D.6138 = 1;
  return D.6138;
}


monoeg_g_iconv_close (struct _GIConv * cd)
{
  void * D.6140;
  int D.6143;

  D.6140 = cd->cd;
  if (D.6140 != -1B) goto <D.6141>; else goto <D.6142>;
  <D.6141>:
  D.6140 = cd->cd;
  iconv_close (D.6140);
  <D.6142>:
  monoeg_g_free (cd);
  D.6143 = 0;
  return D.6143;
}


monoeg_g_iconv (struct _GIConv * cd, gchar * * inbytes, gsize * inbytesleft, gchar * * outbytes, gsize * outbytesleft)
{
  void * D.6145;
  long unsigned int n_inleft.0;
  long unsigned int n_outleft.1;
  gsize D.6156;
  gsize iftmp.2;
  char * iftmp.3;
  unsigned int c.4;
  unsigned int c.5;
  int (*<Teb1>) (char *, size_t, gunichar *) D.6171;
  long unsigned int D.6173;
  sizetype D.6174;
  int (*<Teb6>) (gunichar, char *, size_t) D.6175;
  gsize iftmp.6;
  gsize inleft;
  gsize outleft;
  char * inptr;
  char * outptr;
  gunichar c;
  int rc;
  void encode = <<< error >>>;

  try
    {
      rc = 0;
      D.6145 = cd->cd;
      if (D.6145 != -1B) goto <D.6146>; else goto <D.6147>;
      <D.6146>:
      {
        size_t * outleftptr;
        size_t * inleftptr;
        size_t n_outleft;
        size_t n_inleft;

        try
          {
            if (inbytesleft != 0B) goto <D.6148>; else goto <D.6149>;
            <D.6148>:
            n_inleft.0 = *inbytesleft;
            n_inleft = n_inleft.0;
            inleftptr = &n_inleft;
            goto <D.6151>;
            <D.6149>:
            inleftptr = 0B;
            <D.6151>:
            if (outbytesleft != 0B) goto <D.6152>; else goto <D.6153>;
            <D.6152>:
            n_outleft.1 = *outbytesleft;
            n_outleft = n_outleft.1;
            outleftptr = &n_outleft;
            goto <D.6155>;
            <D.6153>:
            outleftptr = 0B;
            <D.6155>:
            D.6145 = cd->cd;
            D.6156 = iconv (D.6145, inbytes, inleftptr, outbytes, outleftptr);
            return D.6156;
          }
        finally
          {
            n_outleft = {CLOBBER};
            n_inleft = {CLOBBER};
          }
      }
      <D.6147>:
      if (outbytes == 0B) goto <D.6157>; else goto <D.6159>;
      <D.6159>:
      if (outbytesleft == 0B) goto <D.6157>; else goto <D.6158>;
      <D.6157>:
      cd->c = 4294967295;
      D.6156 = 0;
      return D.6156;
      <D.6158>:
      if (inbytesleft != 0B) goto <D.6161>; else goto <D.6162>;
      <D.6161>:
      iftmp.2 = *inbytesleft;
      goto <D.6163>;
      <D.6162>:
      iftmp.2 = 0;
      <D.6163>:
      inleft = iftmp.2;
      if (inbytes != 0B) goto <D.6165>; else goto <D.6166>;
      <D.6165>:
      iftmp.3 = *inbytes;
      goto <D.6167>;
      <D.6166>:
      iftmp.3 = 0B;
      <D.6167>:
      inptr = iftmp.3;
      outleft = *outbytesleft;
      outptr = *outbytes;
      c.4 = cd->c;
      c = c.4;
      c.5 = c;
      if (c.5 != 4294967295) goto encode; else goto <D.6170>;
      <D.6170>:
      goto <D.5551>;
      <D.5550>:
      D.6171 = cd->decode;
      rc = D.6171 (inptr, inleft, &c);
      if (rc < 0) goto <D.5549>; else goto <D.6172>;
      <D.6172>:
      D.6173 = (long unsigned int) rc;
      inleft = inleft - D.6173;
      D.6174 = (sizetype) rc;
      inptr = inptr + D.6174;
      encode:
      D.6175 = cd->encode;
      c.5 = c;
      rc = D.6175 (c.5, outptr, outleft);
      if (rc < 0) goto <D.5549>; else goto <D.6176>;
      <D.6176>:
      c = 4294967295;
      D.6173 = (long unsigned int) rc;
      outleft = outleft - D.6173;
      D.6174 = (sizetype) rc;
      outptr = outptr + D.6174;
      <D.5551>:
      if (inleft != 0) goto <D.5550>; else goto <D.5549>;
      <D.5549>:
      if (inbytesleft != 0B) goto <D.6177>; else goto <D.6178>;
      <D.6177>:
      *inbytesleft = inleft;
      <D.6178>:
      if (inbytes != 0B) goto <D.6179>; else goto <D.6180>;
      <D.6179>:
      *inbytes = inptr;
      <D.6180>:
      *outbytesleft = outleft;
      *outbytes = outptr;
      c.5 = c;
      cd->c = c.5;
      if (rc < 0) goto <D.6182>; else goto <D.6183>;
      <D.6182>:
      iftmp.6 = 18446744073709551615;
      goto <D.6184>;
      <D.6183>:
      iftmp.6 = 0;
      <D.6184>:
      D.6156 = iftmp.6;
      return D.6156;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_convert_error_quark ()
{
  void * D.6188;

  D.6188 = error_quark;
  return D.6188;
}


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.6192;
  void * D.6199;
  long unsigned int iftmp.7;
  long unsigned int inleft.8;
  long unsigned int D.6209;
  int * D.6215;
  int D.6216;
  long unsigned int D.6217;
  char * outbuf.9;
  long int outbuf.10;
  long int result.11;
  long int D.6221;
  long unsigned int outleft.12;
  long unsigned int outleft.13;
  char * outbuf.14;
  void * D.6228;
  const gchar * D.6229;
  char * inbuf.15;
  long int inbuf.16;
  long int str.17;
  long int D.6235;
  long unsigned int D.6236;
  void * D.6239;
  const gchar * D.6240;
  long unsigned int D.6249;
  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.6190>; else goto <D.6191>;
      <D.6190>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 669, "str != NULL");
      D.6192 = 0B;
      return D.6192;
      <D.6191>:
      if (to_charset == 0B) goto <D.6193>; else goto <D.6194>;
      <D.6193>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 670, "to_charset != NULL");
      D.6192 = 0B;
      return D.6192;
      <D.6194>:
      if (from_charset == 0B) goto <D.6195>; else goto <D.6196>;
      <D.6195>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 671, "from_charset != NULL");
      D.6192 = 0B;
      return D.6192;
      <D.6196>:
      cd = monoeg_g_iconv_open (to_charset, from_charset);
      if (cd == -1B) goto <D.6197>; else goto <D.6198>;
      <D.6197>:
      D.6199 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6199, 0, "Conversion from %s to %s not supported.", from_charset, to_charset);
      if (bytes_written != 0B) goto <D.6200>; else goto <D.6201>;
      <D.6200>:
      *bytes_written = 0;
      <D.6201>:
      if (bytes_read != 0B) goto <D.6202>; else goto <D.6203>;
      <D.6202>:
      *bytes_read = 0;
      <D.6203>:
      D.6192 = 0B;
      return D.6192;
      <D.6198>:
      if (len < 0) goto <D.6205>; else goto <D.6206>;
      <D.6205>:
      iftmp.7 = strlen (str);
      goto <D.6207>;
      <D.6206>:
      iftmp.7 = (long unsigned int) len;
      <D.6207>:
      inleft = iftmp.7;
      inbuf = str;
      inleft.8 = inleft;
      outsize = MAX_EXPR <inleft.8, 8>;
      outleft = outsize;
      D.6209 = outsize + 4;
      result = monoeg_malloc (D.6209);
      outbuf = result;
      <D.5675>:
      if (flush == 0) goto <D.6210>; else goto <D.6211>;
      <D.6210>:
      rc = monoeg_g_iconv (cd, &inbuf, &inleft, &outbuf, &outleft);
      goto <D.6212>;
      <D.6211>:
      rc = monoeg_g_iconv (cd, 0B, 0B, &outbuf, &outleft);
      <D.6212>:
      if (rc == 18446744073709551615) goto <D.6213>; else goto <D.6214>;
      <D.6213>:
      D.6215 = __errno_location ();
      D.6216 = *D.6215;
      switch (D.6216) <default: <D.5673>, case 7: <D.5669>, case 22: <D.5671>, case 84: <D.5672>>
      <D.5669>:
      inleft.8 = inleft;
      D.6217 = MAX_EXPR <inleft.8, 8>;
      grow = D.6217 << 1;
      outbuf.9 = outbuf;
      outbuf.10 = (long int) outbuf.9;
      result.11 = (long int) result;
      D.6221 = outbuf.10 - result.11;
      outused = (gsize) D.6221;
      outsize = outsize + grow;
      outleft.12 = outleft;
      outleft.13 = outleft.12 + grow;
      outleft = outleft.13;
      D.6209 = outsize + 4;
      result = monoeg_realloc (result, D.6209);
      outbuf.14 = result + outused;
      outbuf = outbuf.14;
      goto <D.5670>;
      <D.5671>:
      if (flush != 0) goto <D.6225>; else goto <D.6226>;
      <D.6225>:
      done = 1;
      goto <D.6227>;
      <D.6226>:
      flush = 1;
      <D.6227>:
      goto <D.5670>;
      <D.5672>:
      D.6228 = monoeg_g_convert_error_quark ();
      D.6215 = __errno_location ();
      D.6216 = *D.6215;
      D.6229 = monoeg_g_strerror (D.6216);
      monoeg_g_set_error (err, D.6228, 1, "%s", D.6229);
      if (bytes_read != 0B) goto <D.6230>; else goto <D.6231>;
      <D.6230>:
      inbuf.15 = inbuf;
      inbuf.16 = (long int) inbuf.15;
      str.17 = (long int) str;
      D.6235 = inbuf.16 - str.17;
      D.6236 = (long unsigned int) D.6235;
      *bytes_read = D.6236;
      <D.6231>:
      if (bytes_written != 0B) goto <D.6237>; else goto <D.6238>;
      <D.6237>:
      *bytes_written = 0;
      <D.6238>:
      monoeg_g_iconv_close (cd);
      monoeg_g_free (result);
      D.6192 = 0B;
      return D.6192;
      <D.5673>:
      D.6239 = monoeg_g_convert_error_quark ();
      D.6215 = __errno_location ();
      D.6216 = *D.6215;
      D.6240 = monoeg_g_strerror (D.6216);
      monoeg_g_set_error (err, D.6239, 2, "%s", D.6240);
      if (bytes_written != 0B) goto <D.6241>; else goto <D.6242>;
      <D.6241>:
      *bytes_written = 0;
      <D.6242>:
      if (bytes_read != 0B) goto <D.6243>; else goto <D.6244>;
      <D.6243>:
      *bytes_read = 0;
      <D.6244>:
      monoeg_g_iconv_close (cd);
      monoeg_g_free (result);
      D.6192 = 0B;
      return D.6192;
      <D.5670>:
      goto <D.6245>;
      <D.6214>:
      if (flush != 0) goto <D.5674>; else goto <D.6246>;
      <D.6246>:
      flush = 1;
      <D.6245>:
      if (done == 0) goto <D.5675>; else goto <D.5674>;
      <D.5674>:
      monoeg_g_iconv_close (cd);
      outbuf.9 = outbuf;
      memset (outbuf.9, 0, 4);
      if (bytes_written != 0B) goto <D.6247>; else goto <D.6248>;
      <D.6247>:
      outbuf.9 = outbuf;
      outbuf.10 = (long int) outbuf.9;
      result.11 = (long int) result;
      D.6221 = outbuf.10 - result.11;
      D.6249 = (long unsigned int) D.6221;
      *bytes_written = D.6249;
      <D.6248>:
      if (bytes_read != 0B) goto <D.6250>; else goto <D.6251>;
      <D.6250>:
      inbuf.15 = inbuf;
      inbuf.16 = (long int) inbuf.15;
      str.17 = (long int) str;
      D.6235 = inbuf.16 - str.17;
      D.6236 = (long unsigned int) D.6235;
      *bytes_read = D.6236;
      <D.6251>:
      D.6192 = result;
      return D.6192;
    }
  finally
    {
      outleft = {CLOBBER};
      inleft = {CLOBBER};
      outbuf = {CLOBBER};
      inbuf = {CLOBBER};
    }
}


memset (void * __dest, int __ch, size_t __len)
{
  int D.6256;
  int D.6261;
  void * D.6263;
  long unsigned int D.6264;

  D.6256 = __builtin_constant_p (__len);
  if (D.6256 != 0) goto <D.6257>; else goto <D.6258>;
  <D.6257>:
  if (__len == 0) goto <D.6259>; else goto <D.6260>;
  <D.6259>:
  D.6261 = __builtin_constant_p (__ch);
  if (D.6261 == 0) goto <D.6254>; else goto <D.6262>;
  <D.6262>:
  if (__ch != 0) goto <D.6254>; else goto <D.6255>;
  <D.6254>:
  __warn_memset_zero_len ();
  D.6263 = __dest;
  return D.6263;
  <D.6255>:
  <D.6260>:
  <D.6258>:
  D.6264 = __builtin_object_size (__dest, 0);
  D.6263 = __builtin___memset_chk (__dest, __ch, __len, D.6264);
  return D.6263;
}


monoeg_g_unichar_to_utf8 (gunichar c, gchar * outbuf)
{
  signed int c.18;
  gint D.6285;
  sizetype D.6288;
  gchar * D.6289;
  char D.6290;
  char D.6291;
  char D.6292;
  char D.6293;
  char D.6294;
  int base;
  int n;
  int i;

  if (c <= 127) goto <D.6266>; else goto <D.6267>;
  <D.6266>:
  base = 0;
  n = 1;
  goto <D.6268>;
  <D.6267>:
  if (c <= 2047) goto <D.6269>; else goto <D.6270>;
  <D.6269>:
  base = 192;
  n = 2;
  goto <D.6271>;
  <D.6270>:
  if (c <= 65535) goto <D.6272>; else goto <D.6273>;
  <D.6272>:
  base = 224;
  n = 3;
  goto <D.6274>;
  <D.6273>:
  if (c <= 2097151) goto <D.6275>; else goto <D.6276>;
  <D.6275>:
  base = 240;
  n = 4;
  goto <D.6277>;
  <D.6276>:
  if (c <= 67108863) goto <D.6278>; else goto <D.6279>;
  <D.6278>:
  base = 248;
  n = 5;
  goto <D.6280>;
  <D.6279>:
  c.18 = (signed int) c;
  if (c.18 >= 0) goto <D.6282>; else goto <D.6283>;
  <D.6282>:
  base = 252;
  n = 6;
  goto <D.6284>;
  <D.6283>:
  D.6285 = -1;
  return D.6285;
  <D.6284>:
  <D.6280>:
  <D.6277>:
  <D.6274>:
  <D.6271>:
  <D.6268>:
  if (outbuf != 0B) goto <D.6286>; else goto <D.6287>;
  <D.6286>:
  i = n + -1;
  goto <D.5684>;
  <D.5683>:
  D.6288 = (sizetype) i;
  D.6289 = outbuf + D.6288;
  D.6290 = (char) c;
  D.6291 = D.6290 & 63;
  D.6292 = D.6291 | 128;
  *D.6289 = D.6292;
  c = c >> 6;
  i = i + -1;
  <D.5684>:
  if (i > 0) goto <D.5683>; else goto <D.5685>;
  <D.5685>:
  D.6290 = (char) c;
  D.6293 = (char) base;
  D.6294 = D.6290 | D.6293;
  *outbuf = D.6294;
  <D.6287>:
  D.6285 = n;
  return D.6285;
}


monoeg_g_utf8_to_ucs4_fast (const gchar * str, glong len, glong * items_written)
{
  gunichar * D.6298;
  long int D.6301;
  long unsigned int D.6302;
  long unsigned int D.6303;
  gunichar * outptr.19;
  unsigned int D.6305;
  char D.6306;
  int D.6307;
  unsigned char D.6308;
  sizetype D.6309;
  gunichar * outbuf;
  gunichar * outptr;
  char * inptr;
  glong n;
  glong i;

  if (str == 0B) goto <D.6296>; else goto <D.6297>;
  <D.6296>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 896, "str != NULL");
  D.6298 = 0B;
  return D.6298;
  <D.6297>:
  n = monoeg_g_utf8_strlen (str, len);
  if (items_written != 0B) goto <D.6299>; else goto <D.6300>;
  <D.6299>:
  *items_written = n;
  <D.6300>:
  D.6301 = n + 1;
  D.6302 = (long unsigned int) D.6301;
  D.6303 = D.6302 * 4;
  outbuf = monoeg_malloc (D.6303);
  outptr = outbuf;
  inptr = str;
  i = 0;
  goto <D.5702>;
  <D.5701>:
  outptr.19 = outptr;
  outptr = outptr.19 + 4;
  D.6305 = monoeg_g_utf8_get_char (inptr);
  *outptr.19 = D.6305;
  D.6306 = *inptr;
  D.6307 = (int) D.6306;
  D.6308 = g_utf8_jump_table[D.6307];
  D.6309 = (sizetype) D.6308;
  inptr = inptr + D.6309;
  i = i + 1;
  <D.5702>:
  if (i < n) goto <D.5701>; else goto <D.5703>;
  <D.5703>:
  *outptr = 0;
  D.6298 = outbuf;
  return D.6298;
}


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

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


eg_utf8_to_utf16_general (const gchar * str, glong len, glong * items_read, glong * items_written, gboolean include_nuls, struct GError * * err)
{
  gunichar2 * D.6315;
  void * D.6320;
  long unsigned int D.6321;
  unsigned int c.20;
  int * D.6329;
  long unsigned int D.6330;
  long unsigned int D.6331;
  sizetype D.6332;
  long int inptr.21;
  long int str.22;
  long int D.6337;
  long int outlen.23;
  long unsigned int D.6341;
  long unsigned int D.6342;
  int D.6347;
  long unsigned int D.6348;
  long unsigned int D.6349;
  int D.6350;
  void * D.6353;
  void * D.6358;
  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.6313>; else goto <D.6314>;
      <D.6313>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 926, "str != NULL");
      D.6315 = 0B;
      return D.6315;
      <D.6314>:
      if (len < 0) goto <D.6316>; else goto <D.6317>;
      <D.6316>:
      if (include_nuls != 0) goto <D.6318>; else goto <D.6319>;
      <D.6318>:
      D.6320 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6320, 2, "Conversions with embedded nulls must pass the string length");
      D.6315 = 0B;
      return D.6315;
      <D.6319>:
      D.6321 = strlen (str);
      len = (glong) D.6321;
      <D.6317>:
      inptr = str;
      inleft = (size_t) len;
      goto <D.5723>;
      <D.5722>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto error; else goto <D.6322>;
      <D.6322>:
      c.20 = c;
      if (c.20 == 0) goto <D.6324>; else goto <D.6325>;
      <D.6324>:
      if (include_nuls == 0) goto <D.5721>; else goto <D.6326>;
      <D.6326>:
      <D.6325>:
      c.20 = c;
      u = monoeg_unichar_to_utf16 (c.20, 0B);
      if (u < 0) goto <D.6327>; else goto <D.6328>;
      <D.6327>:
      D.6329 = __errno_location ();
      *D.6329 = 84;
      goto error;
      <D.6328>:
      D.6330 = (long unsigned int) u;
      outlen = D.6330 + outlen;
      D.6331 = (long unsigned int) n;
      inleft = inleft - D.6331;
      D.6332 = (sizetype) n;
      inptr = inptr + D.6332;
      <D.5723>:
      if (inleft != 0) goto <D.5722>; else goto <D.5721>;
      <D.5721>:
      if (items_read != 0B) goto <D.6333>; else goto <D.6334>;
      <D.6333>:
      inptr.21 = (long int) inptr;
      str.22 = (long int) str;
      D.6337 = inptr.21 - str.22;
      *items_read = D.6337;
      <D.6334>:
      if (items_written != 0B) goto <D.6338>; else goto <D.6339>;
      <D.6338>:
      outlen.23 = (long int) outlen;
      *items_written = outlen.23;
      <D.6339>:
      D.6341 = outlen + 1;
      D.6342 = D.6341 * 2;
      outbuf = monoeg_malloc (D.6342);
      outptr = outbuf;
      inptr = str;
      inleft = (size_t) len;
      goto <D.5726>;
      <D.5725>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.5724>; else goto <D.6343>;
      <D.6343>:
      c.20 = c;
      if (c.20 == 0) goto <D.6344>; else goto <D.6345>;
      <D.6344>:
      if (include_nuls == 0) goto <D.5724>; else goto <D.6346>;
      <D.6346>:
      <D.6345>:
      c.20 = c;
      D.6347 = monoeg_unichar_to_utf16 (c.20, outptr);
      D.6348 = (long unsigned int) D.6347;
      D.6349 = D.6348 * 2;
      outptr = outptr + D.6349;
      D.6331 = (long unsigned int) n;
      inleft = inleft - D.6331;
      D.6332 = (sizetype) n;
      inptr = inptr + D.6332;
      <D.5726>:
      if (inleft != 0) goto <D.5725>; else goto <D.5724>;
      <D.5724>:
      *outptr = 0;
      D.6315 = outbuf;
      return D.6315;
      error:
      D.6329 = __errno_location ();
      D.6350 = *D.6329;
      if (D.6350 == 84) goto <D.6351>; else goto <D.6352>;
      <D.6351>:
      D.6353 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6353, 1, "Illegal byte sequence encounted in the input.");
      goto <D.6354>;
      <D.6352>:
      if (items_read != 0B) goto <D.6355>; else goto <D.6356>;
      <D.6355>:
      goto <D.6357>;
      <D.6356>:
      D.6358 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6358, 3, "Partial byte sequence encountered in the input.");
      <D.6357>:
      <D.6354>:
      if (items_read != 0B) goto <D.6359>; else goto <D.6360>;
      <D.6359>:
      inptr.21 = (long int) inptr;
      str.22 = (long int) str;
      D.6337 = inptr.21 - str.22;
      *items_read = D.6337;
      <D.6360>:
      if (items_written != 0B) goto <D.6361>; else goto <D.6362>;
      <D.6361>:
      *items_written = 0;
      <D.6362>:
      D.6315 = 0B;
      return D.6315;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_unichar_to_utf16 (gunichar c, gunichar2 * outbuf)
{
  short unsigned int D.6369;
  int D.6370;
  unsigned int D.6381;
  short unsigned int D.6382;
  short unsigned int D.6383;
  gunichar2 * D.6384;
  short unsigned int D.6385;
  short unsigned int D.6386;
  short unsigned int D.6387;
  gunichar c2;

  if (c <= 55295) goto <D.6365>; else goto <D.6366>;
  <D.6365>:
  if (outbuf != 0B) goto <D.6367>; else goto <D.6368>;
  <D.6367>:
  D.6369 = (short unsigned int) c;
  *outbuf = D.6369;
  <D.6368>:
  D.6370 = 1;
  return D.6370;
  <D.6366>:
  if (c <= 57343) goto <D.6371>; else goto <D.6372>;
  <D.6371>:
  D.6370 = -1;
  return D.6370;
  <D.6372>:
  if (c <= 65535) goto <D.6373>; else goto <D.6374>;
  <D.6373>:
  if (outbuf != 0B) goto <D.6375>; else goto <D.6376>;
  <D.6375>:
  D.6369 = (short unsigned int) c;
  *outbuf = D.6369;
  <D.6376>:
  D.6370 = 1;
  return D.6370;
  <D.6374>:
  if (c <= 1114111) goto <D.6377>; else goto <D.6378>;
  <D.6377>:
  if (outbuf != 0B) goto <D.6379>; else goto <D.6380>;
  <D.6379>:
  c2 = c + 4294901760;
  D.6381 = c2 >> 10;
  D.6382 = (short unsigned int) D.6381;
  D.6383 = D.6382 + 55296;
  *outbuf = D.6383;
  D.6384 = outbuf + 2;
  D.6385 = (short unsigned int) c2;
  D.6386 = D.6385 & 1023;
  D.6387 = D.6386 + 56320;
  *D.6384 = D.6387;
  <D.6380>:
  D.6370 = 2;
  return D.6370;
  <D.6378>:
  D.6370 = -1;
  return D.6370;
}


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

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


monoeg_utf8_to_ucs4 (const gchar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar * D.6393;
  long unsigned int D.6396;
  int * D.6399;
  int D.6400;
  void * D.6403;
  void * D.6406;
  long int inptr.24;
  long int str.25;
  long int D.6411;
  unsigned int c.26;
  long unsigned int D.6416;
  sizetype D.6417;
  long unsigned int D.6420;
  long int D.6421;
  long unsigned int D.6424;
  gunichar * outptr.27;
  gunichar * outbuf;
  gunichar * outptr;
  size_t outlen;
  size_t inleft;
  char * inptr;
  gunichar c;
  int n;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.6391>; else goto <D.6392>;
      <D.6391>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1025, "str != NULL");
      D.6393 = 0B;
      return D.6393;
      <D.6392>:
      if (len < 0) goto <D.6394>; else goto <D.6395>;
      <D.6394>:
      D.6396 = strlen (str);
      len = (glong) D.6396;
      <D.6395>:
      inptr = str;
      inleft = (size_t) len;
      goto <D.5757>;
      <D.5756>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.6397>; else goto <D.6398>;
      <D.6397>:
      D.6399 = __errno_location ();
      D.6400 = *D.6399;
      if (D.6400 == 84) goto <D.6401>; else goto <D.6402>;
      <D.6401>:
      D.6403 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6403, 1, "Illegal byte sequence encounted in the input.");
      goto <D.6404>;
      <D.6402>:
      if (items_read != 0B) goto <D.5755>; else goto <D.6405>;
      <D.6405>:
      D.6406 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6406, 3, "Partial byte sequence encountered in the input.");
      <D.6404>:
      if (items_read != 0B) goto <D.6407>; else goto <D.6408>;
      <D.6407>:
      inptr.24 = (long int) inptr;
      str.25 = (long int) str;
      D.6411 = inptr.24 - str.25;
      *items_read = D.6411;
      <D.6408>:
      if (items_written != 0B) goto <D.6412>; else goto <D.6413>;
      <D.6412>:
      *items_written = 0;
      <D.6413>:
      D.6393 = 0B;
      return D.6393;
      <D.6398>:
      c.26 = c;
      if (c.26 == 0) goto <D.5755>; else goto <D.6415>;
      <D.6415>:
      outlen = outlen + 4;
      D.6416 = (long unsigned int) n;
      inleft = inleft - D.6416;
      D.6417 = (sizetype) n;
      inptr = inptr + D.6417;
      <D.5757>:
      if (inleft != 0) goto <D.5756>; else goto <D.5755>;
      <D.5755>:
      if (items_written != 0B) goto <D.6418>; else goto <D.6419>;
      <D.6418>:
      D.6420 = outlen / 4;
      D.6421 = (long int) D.6420;
      *items_written = D.6421;
      <D.6419>:
      if (items_read != 0B) goto <D.6422>; else goto <D.6423>;
      <D.6422>:
      inptr.24 = (long int) inptr;
      str.25 = (long int) str;
      D.6411 = inptr.24 - str.25;
      *items_read = D.6411;
      <D.6423>:
      D.6424 = outlen + 4;
      outbuf = monoeg_malloc (D.6424);
      outptr = outbuf;
      inptr = str;
      inleft = (size_t) len;
      goto <D.5760>;
      <D.5759>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.5758>; else goto <D.6425>;
      <D.6425>:
      c.26 = c;
      if (c.26 == 0) goto <D.5758>; else goto <D.6426>;
      <D.6426>:
      outptr.27 = outptr;
      outptr = outptr.27 + 4;
      c.26 = c;
      *outptr.27 = c.26;
      D.6416 = (long unsigned int) n;
      inleft = inleft - D.6416;
      D.6417 = (sizetype) n;
      inptr = inptr + D.6417;
      <D.5760>:
      if (inleft != 0) goto <D.5759>; else goto <D.5758>;
      <D.5758>:
      *outptr = 0;
      D.6393 = outbuf;
      return D.6393;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_utf16_to_utf8 (const gunichar2 * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gchar * D.6432;
  long unsigned int len.28;
  long unsigned int D.6436;
  const gunichar2 * D.6437;
  short unsigned int D.6438;
  long int D.6439;
  int * D.6446;
  int D.6447;
  void * D.6450;
  void * D.6453;
  long int inptr.29;
  long int str.30;
  long int D.6458;
  long int D.6459;
  unsigned int c.31;
  int D.6464;
  long unsigned int D.6465;
  long unsigned int D.6466;
  sizetype D.6467;
  long int outlen.32;
  long unsigned int D.6473;
  int D.6476;
  sizetype D.6477;
  char * inptr;
  char * outbuf;
  char * outptr;
  size_t outlen;
  size_t inleft;
  gunichar c;
  int n;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.6430>; else goto <D.6431>;
      <D.6430>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1096, "str != NULL");
      D.6432 = 0B;
      return D.6432;
      <D.6431>:
      if (len < 0) goto <D.6433>; else goto <D.6434>;
      <D.6433>:
      len = 0;
      goto <D.5776>;
      <D.5775>:
      len = len + 1;
      <D.5776>:
      len.28 = (long unsigned int) len;
      D.6436 = len.28 * 2;
      D.6437 = str + D.6436;
      D.6438 = *D.6437;
      if (D.6438 != 0) goto <D.5775>; else goto <D.5777>;
      <D.5777>:
      <D.6434>:
      inptr = str;
      D.6439 = len * 2;
      inleft = (size_t) D.6439;
      goto <D.5780>;
      <D.5779>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.6440>; else goto <D.6441>;
      <D.6440>:
      if (n == -2) goto <D.6442>; else goto <D.6443>;
      <D.6442>:
      if (inleft > 2) goto <D.6444>; else goto <D.6445>;
      <D.6444>:
      inleft = inleft + 18446744073709551614;
      inptr = inptr + 2;
      <D.6445>:
      <D.6443>:
      D.6446 = __errno_location ();
      D.6447 = *D.6446;
      if (D.6447 == 84) goto <D.6448>; else goto <D.6449>;
      <D.6448>:
      D.6450 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6450, 1, "Illegal byte sequence encounted in the input.");
      goto <D.6451>;
      <D.6449>:
      if (items_read != 0B) goto <D.5778>; else goto <D.6452>;
      <D.6452>:
      D.6453 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6453, 3, "Partial byte sequence encountered in the input.");
      <D.6451>:
      if (items_read != 0B) goto <D.6454>; else goto <D.6455>;
      <D.6454>:
      inptr.29 = (long int) inptr;
      str.30 = (long int) str;
      D.6458 = inptr.29 - str.30;
      D.6459 = D.6458 / 2;
      *items_read = D.6459;
      <D.6455>:
      if (items_written != 0B) goto <D.6460>; else goto <D.6461>;
      <D.6460>:
      *items_written = 0;
      <D.6461>:
      D.6432 = 0B;
      return D.6432;
      <D.6441>:
      c.31 = c;
      if (c.31 == 0) goto <D.5778>; else goto <D.6463>;
      <D.6463>:
      c.31 = c;
      D.6464 = monoeg_g_unichar_to_utf8 (c.31, 0B);
      D.6465 = (long unsigned int) D.6464;
      outlen = D.6465 + outlen;
      D.6466 = (long unsigned int) n;
      inleft = inleft - D.6466;
      D.6467 = (sizetype) n;
      inptr = inptr + D.6467;
      <D.5780>:
      if (inleft != 0) goto <D.5779>; else goto <D.5778>;
      <D.5778>:
      if (items_read != 0B) goto <D.6468>; else goto <D.6469>;
      <D.6468>:
      inptr.29 = (long int) inptr;
      str.30 = (long int) str;
      D.6458 = inptr.29 - str.30;
      D.6459 = D.6458 / 2;
      *items_read = D.6459;
      <D.6469>:
      if (items_written != 0B) goto <D.6470>; else goto <D.6471>;
      <D.6470>:
      outlen.32 = (long int) outlen;
      *items_written = outlen.32;
      <D.6471>:
      D.6473 = outlen + 1;
      outbuf = monoeg_malloc (D.6473);
      outptr = outbuf;
      inptr = str;
      D.6439 = len * 2;
      inleft = (size_t) D.6439;
      goto <D.5783>;
      <D.5782>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.5781>; else goto <D.6474>;
      <D.6474>:
      c.31 = c;
      if (c.31 == 0) goto <D.5781>; else goto <D.6475>;
      <D.6475>:
      c.31 = c;
      D.6476 = monoeg_g_unichar_to_utf8 (c.31, outptr);
      D.6477 = (sizetype) D.6476;
      outptr = outptr + D.6477;
      D.6466 = (long unsigned int) n;
      inleft = inleft - D.6466;
      D.6467 = (sizetype) n;
      inptr = inptr + D.6467;
      <D.5783>:
      if (inleft != 0) goto <D.5782>; else goto <D.5781>;
      <D.5781>:
      *outptr = 0;
      D.6432 = outbuf;
      return D.6432;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_utf16_to_ucs4 (const gunichar2 * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar * D.6482;
  long unsigned int len.33;
  long unsigned int D.6486;
  const gunichar2 * D.6487;
  short unsigned int D.6488;
  long int D.6489;
  int * D.6496;
  int D.6497;
  void * D.6500;
  void * D.6503;
  long int inptr.34;
  long int str.35;
  long int D.6508;
  long int D.6509;
  unsigned int c.36;
  long unsigned int D.6514;
  sizetype D.6515;
  long unsigned int D.6520;
  long int D.6521;
  long unsigned int D.6522;
  gunichar * outptr.37;
  gunichar * outbuf;
  gunichar * outptr;
  size_t outlen;
  size_t inleft;
  char * inptr;
  gunichar c;
  int n;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.6480>; else goto <D.6481>;
      <D.6480>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1177, "str != NULL");
      D.6482 = 0B;
      return D.6482;
      <D.6481>:
      if (len < 0) goto <D.6483>; else goto <D.6484>;
      <D.6483>:
      len = 0;
      goto <D.5799>;
      <D.5798>:
      len = len + 1;
      <D.5799>:
      len.33 = (long unsigned int) len;
      D.6486 = len.33 * 2;
      D.6487 = str + D.6486;
      D.6488 = *D.6487;
      if (D.6488 != 0) goto <D.5798>; else goto <D.5800>;
      <D.5800>:
      <D.6484>:
      inptr = str;
      D.6489 = len * 2;
      inleft = (size_t) D.6489;
      goto <D.5803>;
      <D.5802>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.6490>; else goto <D.6491>;
      <D.6490>:
      if (n == -2) goto <D.6492>; else goto <D.6493>;
      <D.6492>:
      if (inleft > 2) goto <D.6494>; else goto <D.6495>;
      <D.6494>:
      inleft = inleft + 18446744073709551614;
      inptr = inptr + 2;
      <D.6495>:
      <D.6493>:
      D.6496 = __errno_location ();
      D.6497 = *D.6496;
      if (D.6497 == 84) goto <D.6498>; else goto <D.6499>;
      <D.6498>:
      D.6500 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6500, 1, "Illegal byte sequence encounted in the input.");
      goto <D.6501>;
      <D.6499>:
      if (items_read != 0B) goto <D.5801>; else goto <D.6502>;
      <D.6502>:
      D.6503 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6503, 3, "Partial byte sequence encountered in the input.");
      <D.6501>:
      if (items_read != 0B) goto <D.6504>; else goto <D.6505>;
      <D.6504>:
      inptr.34 = (long int) inptr;
      str.35 = (long int) str;
      D.6508 = inptr.34 - str.35;
      D.6509 = D.6508 / 2;
      *items_read = D.6509;
      <D.6505>:
      if (items_written != 0B) goto <D.6510>; else goto <D.6511>;
      <D.6510>:
      *items_written = 0;
      <D.6511>:
      D.6482 = 0B;
      return D.6482;
      <D.6491>:
      c.36 = c;
      if (c.36 == 0) goto <D.5801>; else goto <D.6513>;
      <D.6513>:
      outlen = outlen + 4;
      D.6514 = (long unsigned int) n;
      inleft = inleft - D.6514;
      D.6515 = (sizetype) n;
      inptr = inptr + D.6515;
      <D.5803>:
      if (inleft != 0) goto <D.5802>; else goto <D.5801>;
      <D.5801>:
      if (items_read != 0B) goto <D.6516>; else goto <D.6517>;
      <D.6516>:
      inptr.34 = (long int) inptr;
      str.35 = (long int) str;
      D.6508 = inptr.34 - str.35;
      D.6509 = D.6508 / 2;
      *items_read = D.6509;
      <D.6517>:
      if (items_written != 0B) goto <D.6518>; else goto <D.6519>;
      <D.6518>:
      D.6520 = outlen / 4;
      D.6521 = (long int) D.6520;
      *items_written = D.6521;
      <D.6519>:
      D.6522 = outlen + 4;
      outbuf = monoeg_malloc (D.6522);
      outptr = outbuf;
      inptr = str;
      D.6489 = len * 2;
      inleft = (size_t) D.6489;
      goto <D.5806>;
      <D.5805>:
      n = decode_utf16le (inptr, inleft, &c);
      if (n < 0) goto <D.5804>; else goto <D.6523>;
      <D.6523>:
      c.36 = c;
      if (c.36 == 0) goto <D.5804>; else goto <D.6524>;
      <D.6524>:
      outptr.37 = outptr;
      outptr = outptr.37 + 4;
      c.36 = c;
      *outptr.37 = c.36;
      D.6514 = (long unsigned int) n;
      inleft = inleft - D.6514;
      D.6515 = (sizetype) n;
      inptr = inptr + D.6515;
      <D.5806>:
      if (inleft != 0) goto <D.5805>; else goto <D.5804>;
      <D.5804>:
      *outptr = 0;
      D.6482 = outbuf;
      return D.6482;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_ucs4_to_utf8 (const gunichar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gchar * D.6530;
  long unsigned int i.38;
  long unsigned int D.6534;
  const gunichar * D.6535;
  unsigned int D.6536;
  void * D.6539;
  long unsigned int D.6544;
  void * D.6548;
  long unsigned int D.6554;
  int D.6555;
  sizetype D.6556;
  long int outlen.39;
  char * outbuf;
  char * outptr;
  size_t outlen;
  glong i;
  int n;

  outlen = 0;
  if (str == 0B) goto <D.6528>; else goto <D.6529>;
  <D.6528>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1256, "str != NULL");
  D.6530 = 0B;
  return D.6530;
  <D.6529>:
  if (len < 0) goto <D.6531>; else goto <D.6532>;
  <D.6531>:
  i = 0;
  goto <D.5820>;
  <D.5819>:
  i.38 = (long unsigned int) i;
  D.6534 = i.38 * 4;
  D.6535 = str + D.6534;
  D.6536 = *D.6535;
  n = monoeg_g_unichar_to_utf8 (D.6536, 0B);
  if (n < 0) goto <D.6537>; else goto <D.6538>;
  <D.6537>:
  D.6539 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6539, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6540>; else goto <D.6541>;
  <D.6540>:
  *items_written = 0;
  <D.6541>:
  if (items_read != 0B) goto <D.6542>; else goto <D.6543>;
  <D.6542>:
  *items_read = i;
  <D.6543>:
  D.6530 = 0B;
  return D.6530;
  <D.6538>:
  D.6544 = (long unsigned int) n;
  outlen = D.6544 + outlen;
  i = i + 1;
  <D.5820>:
  i.38 = (long unsigned int) i;
  D.6534 = i.38 * 4;
  D.6535 = str + D.6534;
  D.6536 = *D.6535;
  if (D.6536 != 0) goto <D.5819>; else goto <D.5821>;
  <D.5821>:
  goto <D.6545>;
  <D.6532>:
  i = 0;
  goto <D.5823>;
  <D.5822>:
  i.38 = (long unsigned int) i;
  D.6534 = i.38 * 4;
  D.6535 = str + D.6534;
  D.6536 = *D.6535;
  n = monoeg_g_unichar_to_utf8 (D.6536, 0B);
  if (n < 0) goto <D.6546>; else goto <D.6547>;
  <D.6546>:
  D.6548 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6548, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6549>; else goto <D.6550>;
  <D.6549>:
  *items_written = 0;
  <D.6550>:
  if (items_read != 0B) goto <D.6551>; else goto <D.6552>;
  <D.6551>:
  *items_read = i;
  <D.6552>:
  D.6530 = 0B;
  return D.6530;
  <D.6547>:
  D.6544 = (long unsigned int) n;
  outlen = D.6544 + outlen;
  i = i + 1;
  <D.5823>:
  if (i < len) goto <D.6553>; else goto <D.5824>;
  <D.6553>:
  i.38 = (long unsigned int) i;
  D.6534 = i.38 * 4;
  D.6535 = str + D.6534;
  D.6536 = *D.6535;
  if (D.6536 != 0) goto <D.5822>; else goto <D.5824>;
  <D.5824>:
  <D.6545>:
  len = i;
  D.6554 = outlen + 1;
  outbuf = monoeg_malloc (D.6554);
  outptr = outbuf;
  i = 0;
  goto <D.5826>;
  <D.5825>:
  i.38 = (long unsigned int) i;
  D.6534 = i.38 * 4;
  D.6535 = str + D.6534;
  D.6536 = *D.6535;
  D.6555 = monoeg_g_unichar_to_utf8 (D.6536, outptr);
  D.6556 = (sizetype) D.6555;
  outptr = outptr + D.6556;
  i = i + 1;
  <D.5826>:
  if (i < len) goto <D.5825>; else goto <D.5827>;
  <D.5827>:
  *outptr = 0;
  if (items_written != 0B) goto <D.6557>; else goto <D.6558>;
  <D.6557>:
  outlen.39 = (long int) outlen;
  *items_written = outlen.39;
  <D.6558>:
  if (items_read != 0B) goto <D.6560>; else goto <D.6561>;
  <D.6560>:
  *items_read = i;
  <D.6561>:
  D.6530 = outbuf;
  return D.6530;
}


monoeg_g_ucs4_to_utf16 (const gunichar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar2 * D.6565;
  long unsigned int i.40;
  long unsigned int D.6569;
  const gunichar * D.6570;
  unsigned int D.6571;
  void * D.6574;
  long unsigned int D.6579;
  void * D.6583;
  long unsigned int D.6589;
  long unsigned int D.6590;
  int D.6591;
  long unsigned int D.6592;
  long unsigned int D.6593;
  long int outlen.41;
  gunichar2 * outbuf;
  gunichar2 * outptr;
  size_t outlen;
  glong i;
  int n;

  outlen = 0;
  if (str == 0B) goto <D.6563>; else goto <D.6564>;
  <D.6563>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1318, "str != NULL");
  D.6565 = 0B;
  return D.6565;
  <D.6564>:
  if (len < 0) goto <D.6566>; else goto <D.6567>;
  <D.6566>:
  i = 0;
  goto <D.5841>;
  <D.5840>:
  i.40 = (long unsigned int) i;
  D.6569 = i.40 * 4;
  D.6570 = str + D.6569;
  D.6571 = *D.6570;
  n = monoeg_unichar_to_utf16 (D.6571, 0B);
  if (n < 0) goto <D.6572>; else goto <D.6573>;
  <D.6572>:
  D.6574 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6574, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6575>; else goto <D.6576>;
  <D.6575>:
  *items_written = 0;
  <D.6576>:
  if (items_read != 0B) goto <D.6577>; else goto <D.6578>;
  <D.6577>:
  *items_read = i;
  <D.6578>:
  D.6565 = 0B;
  return D.6565;
  <D.6573>:
  D.6579 = (long unsigned int) n;
  outlen = D.6579 + outlen;
  i = i + 1;
  <D.5841>:
  i.40 = (long unsigned int) i;
  D.6569 = i.40 * 4;
  D.6570 = str + D.6569;
  D.6571 = *D.6570;
  if (D.6571 != 0) goto <D.5840>; else goto <D.5842>;
  <D.5842>:
  goto <D.6580>;
  <D.6567>:
  i = 0;
  goto <D.5844>;
  <D.5843>:
  i.40 = (long unsigned int) i;
  D.6569 = i.40 * 4;
  D.6570 = str + D.6569;
  D.6571 = *D.6570;
  n = monoeg_unichar_to_utf16 (D.6571, 0B);
  if (n < 0) goto <D.6581>; else goto <D.6582>;
  <D.6581>:
  D.6583 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6583, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6584>; else goto <D.6585>;
  <D.6584>:
  *items_written = 0;
  <D.6585>:
  if (items_read != 0B) goto <D.6586>; else goto <D.6587>;
  <D.6586>:
  *items_read = i;
  <D.6587>:
  D.6565 = 0B;
  return D.6565;
  <D.6582>:
  D.6579 = (long unsigned int) n;
  outlen = D.6579 + outlen;
  i = i + 1;
  <D.5844>:
  if (i < len) goto <D.6588>; else goto <D.5845>;
  <D.6588>:
  i.40 = (long unsigned int) i;
  D.6569 = i.40 * 4;
  D.6570 = str + D.6569;
  D.6571 = *D.6570;
  if (D.6571 != 0) goto <D.5843>; else goto <D.5845>;
  <D.5845>:
  <D.6580>:
  len = i;
  D.6589 = outlen + 1;
  D.6590 = D.6589 * 2;
  outbuf = monoeg_malloc (D.6590);
  outptr = outbuf;
  i = 0;
  goto <D.5847>;
  <D.5846>:
  i.40 = (long unsigned int) i;
  D.6569 = i.40 * 4;
  D.6570 = str + D.6569;
  D.6571 = *D.6570;
  D.6591 = monoeg_unichar_to_utf16 (D.6571, outptr);
  D.6592 = (long unsigned int) D.6591;
  D.6593 = D.6592 * 2;
  outptr = outptr + D.6593;
  i = i + 1;
  <D.5847>:
  if (i < len) goto <D.5846>; else goto <D.5848>;
  <D.5848>:
  *outptr = 0;
  if (items_written != 0B) goto <D.6594>; else goto <D.6595>;
  <D.6594>:
  outlen.41 = (long int) outlen;
  *items_written = outlen.41;
  <D.6595>:
  if (items_read != 0B) goto <D.6597>; else goto <D.6598>;
  <D.6597>:
  *items_read = i;
  <D.6598>:
  D.6565 = outbuf;
  return D.6565;
}


