monoeg_g_iconv_open (const char * to_charset, const char * from_charset)
{
  char D.5443;
  char D.5445;
  int * D.5446;
  struct _GIConv * D.5447;
  const char * D.5448;
  int D.5449;
  int D.5452;
  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.5439>; else goto <D.5441>;
  <D.5441>:
  if (from_charset == 0B) goto <D.5439>; else goto <D.5442>;
  <D.5442>:
  D.5443 = *to_charset;
  if (D.5443 == 0) goto <D.5439>; else goto <D.5444>;
  <D.5444>:
  D.5445 = *from_charset;
  if (D.5445 == 0) goto <D.5439>; else goto <D.5440>;
  <D.5439>:
  D.5446 = __errno_location ();
  *D.5446 = 22;
  D.5447 = -1B;
  return D.5447;
  <D.5440>:
  i = 0;
  goto <D.5115>;
  <D.5114>:
  D.5448 = charsets[i].name;
  D.5449 = monoeg_ascii_strcasecmp (D.5448, from_charset);
  if (D.5449 == 0) goto <D.5450>; else goto <D.5451>;
  <D.5450>:
  decoder = charsets[i].decoder;
  <D.5451>:
  D.5448 = charsets[i].name;
  D.5452 = monoeg_ascii_strcasecmp (D.5448, to_charset);
  if (D.5452 == 0) goto <D.5453>; else goto <D.5454>;
  <D.5453>:
  encoder = charsets[i].encoder;
  <D.5454>:
  i = i + 1;
  <D.5115>:
  if (i <= 14) goto <D.5114>; else goto <D.5116>;
  <D.5116>:
  if (encoder == 0B) goto <D.5455>; else goto <D.5457>;
  <D.5457>:
  if (decoder == 0B) goto <D.5455>; else goto <D.5456>;
  <D.5455>:
  icd = iconv_open (to_charset, from_charset);
  if (icd == -1B) goto <D.5458>; else goto <D.5459>;
  <D.5458>:
  D.5447 = -1B;
  return D.5447;
  <D.5459>:
  <D.5456>:
  cd = monoeg_malloc (32);
  cd->decode = decoder;
  cd->encode = encoder;
  cd->c = 4294967295;
  cd->cd = icd;
  D.5447 = cd;
  return D.5447;
}


encode_utf8 (gunichar c, char * outbuf, size_t outleft)
{
  unsigned char D.5463;
  int D.5464;
  long unsigned int D.5477;
  int * D.5480;
  sizetype D.5481;
  unsigned char * D.5482;
  unsigned char D.5483;
  unsigned char D.5484;
  unsigned char D.5485;
  unsigned char D.5486;
  unsigned char * outptr;
  int base;
  int n;
  int i;

  outptr = outbuf;
  if (c <= 127) goto <D.5461>; else goto <D.5462>;
  <D.5461>:
  D.5463 = (unsigned char) c;
  *outptr = D.5463;
  D.5464 = 1;
  return D.5464;
  <D.5462>:
  if (c <= 2047) goto <D.5465>; else goto <D.5466>;
  <D.5465>:
  base = 192;
  n = 2;
  goto <D.5467>;
  <D.5466>:
  if (c <= 65535) goto <D.5468>; else goto <D.5469>;
  <D.5468>:
  base = 224;
  n = 3;
  goto <D.5470>;
  <D.5469>:
  if (c <= 2097151) goto <D.5471>; else goto <D.5472>;
  <D.5471>:
  base = 240;
  n = 4;
  goto <D.5473>;
  <D.5472>:
  if (c <= 67108863) goto <D.5474>; else goto <D.5475>;
  <D.5474>:
  base = 248;
  n = 5;
  goto <D.5476>;
  <D.5475>:
  base = 252;
  n = 6;
  <D.5476>:
  <D.5473>:
  <D.5470>:
  <D.5467>:
  D.5477 = (long unsigned int) n;
  if (D.5477 > outleft) goto <D.5478>; else goto <D.5479>;
  <D.5478>:
  D.5480 = __errno_location ();
  *D.5480 = 7;
  D.5464 = -1;
  return D.5464;
  <D.5479>:
  i = n + -1;
  goto <D.5221>;
  <D.5220>:
  D.5481 = (sizetype) i;
  D.5482 = outptr + D.5481;
  D.5463 = (unsigned char) c;
  D.5483 = D.5463 & 63;
  D.5484 = D.5483 | 128;
  *D.5482 = D.5484;
  c = c >> 6;
  i = i + -1;
  <D.5221>:
  if (i > 0) goto <D.5220>; else goto <D.5222>;
  <D.5222>:
  D.5463 = (unsigned char) c;
  D.5485 = (unsigned char) base;
  D.5486 = D.5463 | D.5485;
  *outptr = D.5486;
  D.5464 = n;
  return D.5464;
}


__attribute__((always_inline))
decode_utf8 (char * inbuf, size_t inleft, gunichar * outchar)
{
  unsigned char D.5488;
  int D.5491;
  int * D.5494;
  long unsigned int D.5510;
  unsigned int D.5513;
  unsigned char D.5514;
  unsigned int D.5515;
  unsigned char * inptr;
  gunichar u;
  int n;
  int i;

  inptr = inbuf;
  D.5488 = *inptr;
  u = (gunichar) D.5488;
  if (u <= 127) goto <D.5489>; else goto <D.5490>;
  <D.5489>:
  *outchar = u;
  D.5491 = 1;
  return D.5491;
  <D.5490>:
  if (u <= 193) goto <D.5492>; else goto <D.5493>;
  <D.5492>:
  D.5494 = __errno_location ();
  *D.5494 = 84;
  D.5491 = -1;
  return D.5491;
  <D.5493>:
  if (u <= 223) goto <D.5495>; else goto <D.5496>;
  <D.5495>:
  u = u & 31;
  n = 2;
  goto <D.5497>;
  <D.5496>:
  if (u <= 239) goto <D.5498>; else goto <D.5499>;
  <D.5498>:
  u = u & 15;
  n = 3;
  goto <D.5500>;
  <D.5499>:
  if (u <= 247) goto <D.5501>; else goto <D.5502>;
  <D.5501>:
  u = u & 7;
  n = 4;
  goto <D.5503>;
  <D.5502>:
  if (u <= 251) goto <D.5504>; else goto <D.5505>;
  <D.5504>:
  u = u & 3;
  n = 5;
  goto <D.5506>;
  <D.5505>:
  if (u <= 253) goto <D.5507>; else goto <D.5508>;
  <D.5507>:
  u = u & 1;
  n = 6;
  goto <D.5509>;
  <D.5508>:
  D.5494 = __errno_location ();
  *D.5494 = 84;
  D.5491 = -1;
  return D.5491;
  <D.5509>:
  <D.5506>:
  <D.5503>:
  <D.5500>:
  <D.5497>:
  D.5510 = (long unsigned int) n;
  if (D.5510 > inleft) goto <D.5511>; else goto <D.5512>;
  <D.5511>:
  D.5494 = __errno_location ();
  *D.5494 = 22;
  D.5491 = -1;
  return D.5491;
  <D.5512>:
  i = 1;
  goto <D.5209>;
  <D.5208>:
  D.5513 = u << 6;
  inptr = inptr + 1;
  D.5488 = *inptr;
  D.5514 = D.5488 ^ 128;
  D.5515 = (unsigned int) D.5514;
  u = D.5513 | D.5515;
  i = i + 1;
  <D.5209>:
  if (i < n) goto <D.5208>; else goto <D.5210>;
  <D.5210>:
  *outchar = u;
  D.5491 = n;
  return D.5491;
}


encode_utf16le (gunichar c, char * outbuf, size_t outleft)
{
  int * D.5521;
  int D.5522;
  unsigned char D.5523;
  unsigned char * D.5524;
  unsigned int D.5525;
  unsigned char D.5526;
  unsigned int D.5529;
  short unsigned int D.5530;
  unsigned char D.5531;
  short unsigned int D.5532;
  unsigned char D.5533;
  short unsigned int D.5534;
  short unsigned int D.5535;
  unsigned char * D.5536;
  unsigned char * D.5537;
  unsigned char * outptr;
  gunichar2 ch;
  gunichar c2;

  outptr = outbuf;
  if (c <= 65535) goto <D.5517>; else goto <D.5518>;
  <D.5517>:
  if (outleft <= 1) goto <D.5519>; else goto <D.5520>;
  <D.5519>:
  D.5521 = __errno_location ();
  *D.5521 = 7;
  D.5522 = -1;
  return D.5522;
  <D.5520>:
  D.5523 = (unsigned char) c;
  *outptr = D.5523;
  D.5524 = outptr + 1;
  D.5525 = c >> 8;
  D.5526 = (unsigned char) D.5525;
  *D.5524 = D.5526;
  D.5522 = 2;
  return D.5522;
  <D.5518>:
  if (outleft <= 3) goto <D.5527>; else goto <D.5528>;
  <D.5527>:
  D.5521 = __errno_location ();
  *D.5521 = 7;
  D.5522 = -1;
  return D.5522;
  <D.5528>:
  c2 = c + 4294901760;
  D.5529 = c2 >> 10;
  D.5530 = (short unsigned int) D.5529;
  ch = D.5530 + 55296;
  D.5531 = (unsigned char) ch;
  *outptr = D.5531;
  D.5524 = outptr + 1;
  D.5532 = ch >> 8;
  D.5533 = (unsigned char) D.5532;
  *D.5524 = D.5533;
  D.5534 = (short unsigned int) c2;
  D.5535 = D.5534 & 1023;
  ch = D.5535 + 56320;
  D.5536 = outptr + 2;
  D.5531 = (unsigned char) ch;
  *D.5536 = D.5531;
  D.5537 = outptr + 3;
  D.5532 = ch >> 8;
  D.5533 = (unsigned char) D.5532;
  *D.5537 = D.5533;
  D.5522 = 4;
  return D.5522;
}


decode_utf16le (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.5541;
  int D.5542;
  unsigned char * D.5543;
  unsigned char D.5544;
  int D.5545;
  int D.5546;
  unsigned char D.5547;
  int D.5548;
  int D.5549;
  unsigned char * D.5556;
  unsigned char D.5557;
  int D.5558;
  int D.5559;
  signed short D.5560;
  unsigned char * D.5561;
  unsigned char D.5562;
  signed short D.5563;
  signed short D.5564;
  short unsigned int D.5565;
  unsigned int D.5568;
  unsigned int D.5569;
  unsigned int D.5570;
  unsigned int D.5571;
  unsigned char * inptr;
  gunichar2 c;
  gunichar u;

  inptr = inbuf;
  if (inleft <= 1) goto <D.5539>; else goto <D.5540>;
  <D.5539>:
  D.5541 = __errno_location ();
  *D.5541 = 22;
  D.5542 = -1;
  return D.5542;
  <D.5540>:
  D.5543 = inptr + 1;
  D.5544 = *D.5543;
  D.5545 = (int) D.5544;
  D.5546 = D.5545 << 8;
  D.5547 = *inptr;
  D.5548 = (int) D.5547;
  D.5549 = D.5546 | D.5548;
  u = (gunichar) D.5549;
  if (u <= 55295) goto <D.5550>; else goto <D.5551>;
  <D.5550>:
  *outchar = u;
  D.5542 = 2;
  return D.5542;
  <D.5551>:
  if (u <= 56319) goto <D.5552>; else goto <D.5553>;
  <D.5552>:
  if (inleft <= 3) goto <D.5554>; else goto <D.5555>;
  <D.5554>:
  D.5541 = __errno_location ();
  *D.5541 = 22;
  D.5542 = -2;
  return D.5542;
  <D.5555>:
  D.5556 = inptr + 3;
  D.5557 = *D.5556;
  D.5558 = (int) D.5557;
  D.5559 = D.5558 << 8;
  D.5560 = (signed short) D.5559;
  D.5561 = inptr + 2;
  D.5562 = *D.5561;
  D.5563 = (signed short) D.5562;
  D.5564 = D.5560 | D.5563;
  c = (gunichar2) D.5564;
  D.5565 = c + 9216;
  if (D.5565 > 1023) goto <D.5566>; else goto <D.5567>;
  <D.5566>:
  D.5541 = __errno_location ();
  *D.5541 = 84;
  D.5542 = -2;
  return D.5542;
  <D.5567>:
  D.5568 = u + 4294912000;
  D.5569 = D.5568 << 10;
  D.5570 = (unsigned int) c;
  D.5571 = D.5569 + D.5570;
  u = D.5571 + 9216;
  *outchar = u;
  D.5542 = 4;
  return D.5542;
  <D.5553>:
  if (u <= 57343) goto <D.5572>; else goto <D.5573>;
  <D.5572>:
  D.5541 = __errno_location ();
  *D.5541 = 84;
  D.5542 = -1;
  return D.5542;
  <D.5573>:
  *outchar = u;
  D.5542 = 2;
  return D.5542;
}


encode_utf16be (gunichar c, char * outbuf, size_t outleft)
{
  int * D.5579;
  int D.5580;
  unsigned int D.5581;
  unsigned char D.5582;
  unsigned char * D.5583;
  unsigned char D.5584;
  unsigned int D.5587;
  short unsigned int D.5588;
  short unsigned int D.5589;
  unsigned char D.5590;
  unsigned char D.5591;
  short unsigned int D.5592;
  short unsigned int D.5593;
  unsigned char * D.5594;
  unsigned char * D.5595;
  unsigned char * outptr;
  gunichar2 ch;
  gunichar c2;

  outptr = outbuf;
  if (c <= 65535) goto <D.5575>; else goto <D.5576>;
  <D.5575>:
  if (outleft <= 1) goto <D.5577>; else goto <D.5578>;
  <D.5577>:
  D.5579 = __errno_location ();
  *D.5579 = 7;
  D.5580 = -1;
  return D.5580;
  <D.5578>:
  D.5581 = c >> 8;
  D.5582 = (unsigned char) D.5581;
  *outptr = D.5582;
  D.5583 = outptr + 1;
  D.5584 = (unsigned char) c;
  *D.5583 = D.5584;
  D.5580 = 2;
  return D.5580;
  <D.5576>:
  if (outleft <= 3) goto <D.5585>; else goto <D.5586>;
  <D.5585>:
  D.5579 = __errno_location ();
  *D.5579 = 7;
  D.5580 = -1;
  return D.5580;
  <D.5586>:
  c2 = c + 4294901760;
  D.5587 = c2 >> 10;
  D.5588 = (short unsigned int) D.5587;
  ch = D.5588 + 55296;
  D.5589 = ch >> 8;
  D.5590 = (unsigned char) D.5589;
  *outptr = D.5590;
  D.5583 = outptr + 1;
  D.5591 = (unsigned char) ch;
  *D.5583 = D.5591;
  D.5592 = (short unsigned int) c2;
  D.5593 = D.5592 & 1023;
  ch = D.5593 + 56320;
  D.5594 = outptr + 2;
  D.5589 = ch >> 8;
  D.5590 = (unsigned char) D.5589;
  *D.5594 = D.5590;
  D.5595 = outptr + 3;
  D.5591 = (unsigned char) ch;
  *D.5595 = D.5591;
  D.5580 = 4;
  return D.5580;
}


decode_utf16be (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.5599;
  int D.5600;
  unsigned char D.5601;
  int D.5602;
  int D.5603;
  unsigned char * D.5604;
  unsigned char D.5605;
  int D.5606;
  int D.5607;
  unsigned char * D.5614;
  unsigned char D.5615;
  int D.5616;
  int D.5617;
  signed short D.5618;
  unsigned char * D.5619;
  unsigned char D.5620;
  signed short D.5621;
  signed short D.5622;
  short unsigned int D.5623;
  unsigned int D.5626;
  unsigned int D.5627;
  unsigned int D.5628;
  unsigned int D.5629;
  unsigned char * inptr;
  gunichar2 c;
  gunichar u;

  inptr = inbuf;
  if (inleft <= 1) goto <D.5597>; else goto <D.5598>;
  <D.5597>:
  D.5599 = __errno_location ();
  *D.5599 = 22;
  D.5600 = -1;
  return D.5600;
  <D.5598>:
  D.5601 = *inptr;
  D.5602 = (int) D.5601;
  D.5603 = D.5602 << 8;
  D.5604 = inptr + 1;
  D.5605 = *D.5604;
  D.5606 = (int) D.5605;
  D.5607 = D.5603 | D.5606;
  u = (gunichar) D.5607;
  if (u <= 55295) goto <D.5608>; else goto <D.5609>;
  <D.5608>:
  *outchar = u;
  D.5600 = 2;
  return D.5600;
  <D.5609>:
  if (u <= 56319) goto <D.5610>; else goto <D.5611>;
  <D.5610>:
  if (inleft <= 3) goto <D.5612>; else goto <D.5613>;
  <D.5612>:
  D.5599 = __errno_location ();
  *D.5599 = 22;
  D.5600 = -2;
  return D.5600;
  <D.5613>:
  D.5614 = inptr + 2;
  D.5615 = *D.5614;
  D.5616 = (int) D.5615;
  D.5617 = D.5616 << 8;
  D.5618 = (signed short) D.5617;
  D.5619 = inptr + 3;
  D.5620 = *D.5619;
  D.5621 = (signed short) D.5620;
  D.5622 = D.5618 | D.5621;
  c = (gunichar2) D.5622;
  D.5623 = c + 9216;
  if (D.5623 > 1023) goto <D.5624>; else goto <D.5625>;
  <D.5624>:
  D.5599 = __errno_location ();
  *D.5599 = 84;
  D.5600 = -2;
  return D.5600;
  <D.5625>:
  D.5626 = u + 4294912000;
  D.5627 = D.5626 << 10;
  D.5628 = (unsigned int) c;
  D.5629 = D.5627 + D.5628;
  u = D.5629 + 9216;
  *outchar = u;
  D.5600 = 4;
  return D.5600;
  <D.5611>:
  if (u <= 57343) goto <D.5630>; else goto <D.5631>;
  <D.5630>:
  D.5599 = __errno_location ();
  *D.5599 = 84;
  D.5600 = -1;
  return D.5600;
  <D.5631>:
  *outchar = u;
  D.5600 = 2;
  return D.5600;
}


encode_utf32le (gunichar c, char * outbuf, size_t outleft)
{
  int * D.5635;
  int D.5636;
  unsigned char D.5637;
  unsigned char * D.5638;
  unsigned int D.5639;
  unsigned char D.5640;
  unsigned char * D.5641;
  unsigned int D.5642;
  unsigned char D.5643;
  unsigned char * D.5644;
  unsigned int D.5645;
  unsigned char D.5646;
  unsigned char * outptr;

  outptr = outbuf;
  if (outleft <= 3) goto <D.5633>; else goto <D.5634>;
  <D.5633>:
  D.5635 = __errno_location ();
  *D.5635 = 7;
  D.5636 = -1;
  return D.5636;
  <D.5634>:
  D.5637 = (unsigned char) c;
  *outptr = D.5637;
  D.5638 = outptr + 1;
  D.5639 = c >> 8;
  D.5640 = (unsigned char) D.5639;
  *D.5638 = D.5640;
  D.5641 = outptr + 2;
  D.5642 = c >> 16;
  D.5643 = (unsigned char) D.5642;
  *D.5641 = D.5643;
  D.5644 = outptr + 3;
  D.5645 = c >> 24;
  D.5646 = (unsigned char) D.5645;
  *D.5644 = D.5646;
  D.5636 = 4;
  return D.5636;
}


decode_utf32le (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.5650;
  int D.5651;
  unsigned char * D.5652;
  unsigned char D.5653;
  int D.5654;
  int D.5655;
  unsigned char * D.5656;
  unsigned char D.5657;
  int D.5658;
  int D.5659;
  int D.5660;
  unsigned char * D.5661;
  unsigned char D.5662;
  int D.5663;
  int D.5664;
  int D.5665;
  unsigned char D.5666;
  int D.5667;
  int D.5668;
  unsigned int D.5669;
  unsigned char * inptr;
  gunichar c;

  inptr = inbuf;
  if (inleft <= 3) goto <D.5648>; else goto <D.5649>;
  <D.5648>:
  D.5650 = __errno_location ();
  *D.5650 = 22;
  D.5651 = -1;
  return D.5651;
  <D.5649>:
  D.5652 = inptr + 3;
  D.5653 = *D.5652;
  D.5654 = (int) D.5653;
  D.5655 = D.5654 << 24;
  D.5656 = inptr + 2;
  D.5657 = *D.5656;
  D.5658 = (int) D.5657;
  D.5659 = D.5658 << 16;
  D.5660 = D.5655 | D.5659;
  D.5661 = inptr + 1;
  D.5662 = *D.5661;
  D.5663 = (int) D.5662;
  D.5664 = D.5663 << 8;
  D.5665 = D.5660 | D.5664;
  D.5666 = *inptr;
  D.5667 = (int) D.5666;
  D.5668 = D.5665 | D.5667;
  c = (gunichar) D.5668;
  D.5669 = c + 4294912000;
  if (D.5669 <= 2047) goto <D.5670>; else goto <D.5671>;
  <D.5670>:
  D.5650 = __errno_location ();
  *D.5650 = 84;
  D.5651 = -1;
  return D.5651;
  <D.5671>:
  if (c > 1114111) goto <D.5672>; else goto <D.5673>;
  <D.5672>:
  D.5650 = __errno_location ();
  *D.5650 = 84;
  D.5651 = -1;
  return D.5651;
  <D.5673>:
  *outchar = c;
  D.5651 = 4;
  return D.5651;
}


encode_utf32be (gunichar c, char * outbuf, size_t outleft)
{
  int * D.5677;
  int D.5678;
  unsigned int D.5679;
  unsigned char D.5680;
  unsigned char * D.5681;
  unsigned int D.5682;
  unsigned char D.5683;
  unsigned char * D.5684;
  unsigned int D.5685;
  unsigned char D.5686;
  unsigned char * D.5687;
  unsigned char D.5688;
  unsigned char * outptr;

  outptr = outbuf;
  if (outleft <= 3) goto <D.5675>; else goto <D.5676>;
  <D.5675>:
  D.5677 = __errno_location ();
  *D.5677 = 7;
  D.5678 = -1;
  return D.5678;
  <D.5676>:
  D.5679 = c >> 24;
  D.5680 = (unsigned char) D.5679;
  *outptr = D.5680;
  D.5681 = outptr + 1;
  D.5682 = c >> 16;
  D.5683 = (unsigned char) D.5682;
  *D.5681 = D.5683;
  D.5684 = outptr + 2;
  D.5685 = c >> 8;
  D.5686 = (unsigned char) D.5685;
  *D.5684 = D.5686;
  D.5687 = outptr + 3;
  D.5688 = (unsigned char) c;
  *D.5687 = D.5688;
  D.5678 = 4;
  return D.5678;
}


decode_utf32be (char * inbuf, size_t inleft, gunichar * outchar)
{
  int * D.5692;
  int D.5693;
  unsigned char D.5694;
  int D.5695;
  int D.5696;
  unsigned char * D.5697;
  unsigned char D.5698;
  int D.5699;
  int D.5700;
  int D.5701;
  unsigned char * D.5702;
  unsigned char D.5703;
  int D.5704;
  int D.5705;
  int D.5706;
  unsigned char * D.5707;
  unsigned char D.5708;
  int D.5709;
  int D.5710;
  unsigned int D.5711;
  unsigned char * inptr;
  gunichar c;

  inptr = inbuf;
  if (inleft <= 3) goto <D.5690>; else goto <D.5691>;
  <D.5690>:
  D.5692 = __errno_location ();
  *D.5692 = 22;
  D.5693 = -1;
  return D.5693;
  <D.5691>:
  D.5694 = *inptr;
  D.5695 = (int) D.5694;
  D.5696 = D.5695 << 24;
  D.5697 = inptr + 1;
  D.5698 = *D.5697;
  D.5699 = (int) D.5698;
  D.5700 = D.5699 << 16;
  D.5701 = D.5696 | D.5700;
  D.5702 = inptr + 2;
  D.5703 = *D.5702;
  D.5704 = (int) D.5703;
  D.5705 = D.5704 << 8;
  D.5706 = D.5701 | D.5705;
  D.5707 = inptr + 3;
  D.5708 = *D.5707;
  D.5709 = (int) D.5708;
  D.5710 = D.5706 | D.5709;
  c = (gunichar) D.5710;
  D.5711 = c + 4294912000;
  if (D.5711 <= 2047) goto <D.5712>; else goto <D.5713>;
  <D.5712>:
  D.5692 = __errno_location ();
  *D.5692 = 84;
  D.5693 = -1;
  return D.5693;
  <D.5713>:
  if (c > 1114111) goto <D.5714>; else goto <D.5715>;
  <D.5714>:
  D.5692 = __errno_location ();
  *D.5692 = 84;
  D.5693 = -1;
  return D.5693;
  <D.5715>:
  *outchar = c;
  D.5693 = 4;
  return D.5693;
}


encode_latin1 (gunichar c, char * outbuf, size_t outleft)
{
  int * D.5719;
  int D.5720;
  char D.5723;

  if (outleft == 0) goto <D.5717>; else goto <D.5718>;
  <D.5717>:
  D.5719 = __errno_location ();
  *D.5719 = 7;
  D.5720 = -1;
  return D.5720;
  <D.5718>:
  if (c > 255) goto <D.5721>; else goto <D.5722>;
  <D.5721>:
  D.5719 = __errno_location ();
  *D.5719 = 84;
  D.5720 = -1;
  return D.5720;
  <D.5722>:
  D.5723 = (char) c;
  *outbuf = D.5723;
  D.5720 = 1;
  return D.5720;
}


decode_latin1 (char * inbuf, size_t inleft, gunichar * outchar)
{
  char D.5725;
  unsigned int D.5726;
  int D.5727;

  D.5725 = *inbuf;
  D.5726 = (unsigned int) D.5725;
  *outchar = D.5726;
  D.5727 = 1;
  return D.5727;
}


monoeg_g_iconv_close (struct _GIConv * cd)
{
  void * D.5729;
  int D.5732;

  D.5729 = cd->cd;
  if (D.5729 != -1B) goto <D.5730>; else goto <D.5731>;
  <D.5730>:
  D.5729 = cd->cd;
  iconv_close (D.5729);
  <D.5731>:
  monoeg_g_free (cd);
  D.5732 = 0;
  return D.5732;
}


monoeg_g_iconv (struct _GIConv * cd, gchar * * inbytes, gsize * inbytesleft, gchar * * outbytes, gsize * outbytesleft)
{
  void * D.5734;
  long unsigned int n_inleft.0;
  long unsigned int n_outleft.1;
  gsize D.5745;
  gsize iftmp.2;
  char * iftmp.3;
  unsigned int c.4;
  unsigned int c.5;
  int (*<Tee5>) (char *, size_t, gunichar *) D.5760;
  long unsigned int D.5762;
  sizetype D.5763;
  int (*<Teea>) (gunichar, char *, size_t) D.5764;
  gsize iftmp.6;
  gsize inleft;
  gsize outleft;
  char * inptr;
  char * outptr;
  gunichar c;
  int rc;
  void encode = <<< error >>>;

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

        try
          {
            if (inbytesleft != 0B) goto <D.5737>; else goto <D.5738>;
            <D.5737>:
            n_inleft.0 = *inbytesleft;
            n_inleft = n_inleft.0;
            inleftptr = &n_inleft;
            goto <D.5740>;
            <D.5738>:
            inleftptr = 0B;
            <D.5740>:
            if (outbytesleft != 0B) goto <D.5741>; else goto <D.5742>;
            <D.5741>:
            n_outleft.1 = *outbytesleft;
            n_outleft = n_outleft.1;
            outleftptr = &n_outleft;
            goto <D.5744>;
            <D.5742>:
            outleftptr = 0B;
            <D.5744>:
            D.5734 = cd->cd;
            D.5745 = iconv (D.5734, inbytes, inleftptr, outbytes, outleftptr);
            return D.5745;
          }
        finally
          {
            n_outleft = {CLOBBER};
            n_inleft = {CLOBBER};
          }
      }
      <D.5736>:
      if (outbytes == 0B) goto <D.5746>; else goto <D.5748>;
      <D.5748>:
      if (outbytesleft == 0B) goto <D.5746>; else goto <D.5747>;
      <D.5746>:
      cd->c = 4294967295;
      D.5745 = 0;
      return D.5745;
      <D.5747>:
      if (inbytesleft != 0B) goto <D.5750>; else goto <D.5751>;
      <D.5750>:
      iftmp.2 = *inbytesleft;
      goto <D.5752>;
      <D.5751>:
      iftmp.2 = 0;
      <D.5752>:
      inleft = iftmp.2;
      if (inbytes != 0B) goto <D.5754>; else goto <D.5755>;
      <D.5754>:
      iftmp.3 = *inbytes;
      goto <D.5756>;
      <D.5755>:
      iftmp.3 = 0B;
      <D.5756>:
      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.5759>;
      <D.5759>:
      goto <D.5140>;
      <D.5139>:
      D.5760 = cd->decode;
      rc = D.5760 (inptr, inleft, &c);
      if (rc < 0) goto <D.5138>; else goto <D.5761>;
      <D.5761>:
      D.5762 = (long unsigned int) rc;
      inleft = inleft - D.5762;
      D.5763 = (sizetype) rc;
      inptr = inptr + D.5763;
      encode:
      D.5764 = cd->encode;
      c.5 = c;
      rc = D.5764 (c.5, outptr, outleft);
      if (rc < 0) goto <D.5138>; else goto <D.5765>;
      <D.5765>:
      c = 4294967295;
      D.5762 = (long unsigned int) rc;
      outleft = outleft - D.5762;
      D.5763 = (sizetype) rc;
      outptr = outptr + D.5763;
      <D.5140>:
      if (inleft != 0) goto <D.5139>; else goto <D.5138>;
      <D.5138>:
      if (inbytesleft != 0B) goto <D.5766>; else goto <D.5767>;
      <D.5766>:
      *inbytesleft = inleft;
      <D.5767>:
      if (inbytes != 0B) goto <D.5768>; else goto <D.5769>;
      <D.5768>:
      *inbytes = inptr;
      <D.5769>:
      *outbytesleft = outleft;
      *outbytes = outptr;
      c.5 = c;
      cd->c = c.5;
      if (rc < 0) goto <D.5771>; else goto <D.5772>;
      <D.5771>:
      iftmp.6 = 18446744073709551615;
      goto <D.5773>;
      <D.5772>:
      iftmp.6 = 0;
      <D.5773>:
      D.5745 = iftmp.6;
      return D.5745;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_convert_error_quark ()
{
  void * D.5777;

  D.5777 = error_quark;
  return D.5777;
}


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.5781;
  void * D.5788;
  long unsigned int iftmp.7;
  long unsigned int inleft.8;
  long unsigned int D.5798;
  int * D.5804;
  int D.5805;
  long unsigned int D.5806;
  char * outbuf.9;
  long int outbuf.10;
  long int result.11;
  long int D.5810;
  long unsigned int outleft.12;
  long unsigned int outleft.13;
  char * outbuf.14;
  void * D.5817;
  const gchar * D.5818;
  char * inbuf.15;
  long int inbuf.16;
  long int str.17;
  long int D.5824;
  long unsigned int D.5825;
  void * D.5828;
  const gchar * D.5829;
  long unsigned int D.5838;
  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.5779>; else goto <D.5780>;
      <D.5779>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 669, "str != NULL");
      D.5781 = 0B;
      return D.5781;
      <D.5780>:
      if (to_charset == 0B) goto <D.5782>; else goto <D.5783>;
      <D.5782>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 670, "to_charset != NULL");
      D.5781 = 0B;
      return D.5781;
      <D.5783>:
      if (from_charset == 0B) goto <D.5784>; else goto <D.5785>;
      <D.5784>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 671, "from_charset != NULL");
      D.5781 = 0B;
      return D.5781;
      <D.5785>:
      cd = monoeg_g_iconv_open (to_charset, from_charset);
      if (cd == -1B) goto <D.5786>; else goto <D.5787>;
      <D.5786>:
      D.5788 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.5788, 0, "Conversion from %s to %s not supported.", from_charset, to_charset);
      if (bytes_written != 0B) goto <D.5789>; else goto <D.5790>;
      <D.5789>:
      *bytes_written = 0;
      <D.5790>:
      if (bytes_read != 0B) goto <D.5791>; else goto <D.5792>;
      <D.5791>:
      *bytes_read = 0;
      <D.5792>:
      D.5781 = 0B;
      return D.5781;
      <D.5787>:
      if (len < 0) goto <D.5794>; else goto <D.5795>;
      <D.5794>:
      iftmp.7 = strlen (str);
      goto <D.5796>;
      <D.5795>:
      iftmp.7 = (long unsigned int) len;
      <D.5796>:
      inleft = iftmp.7;
      inbuf = str;
      inleft.8 = inleft;
      outsize = MAX_EXPR <inleft.8, 8>;
      outleft = outsize;
      D.5798 = outsize + 4;
      result = monoeg_malloc (D.5798);
      outbuf = result;
      <D.5264>:
      if (flush == 0) goto <D.5799>; else goto <D.5800>;
      <D.5799>:
      rc = monoeg_g_iconv (cd, &inbuf, &inleft, &outbuf, &outleft);
      goto <D.5801>;
      <D.5800>:
      rc = monoeg_g_iconv (cd, 0B, 0B, &outbuf, &outleft);
      <D.5801>:
      if (rc == 18446744073709551615) goto <D.5802>; else goto <D.5803>;
      <D.5802>:
      D.5804 = __errno_location ();
      D.5805 = *D.5804;
      switch (D.5805) <default: <D.5262>, case 7: <D.5258>, case 22: <D.5260>, case 84: <D.5261>>
      <D.5258>:
      inleft.8 = inleft;
      D.5806 = MAX_EXPR <inleft.8, 8>;
      grow = D.5806 << 1;
      outbuf.9 = outbuf;
      outbuf.10 = (long int) outbuf.9;
      result.11 = (long int) result;
      D.5810 = outbuf.10 - result.11;
      outused = (gsize) D.5810;
      outsize = outsize + grow;
      outleft.12 = outleft;
      outleft.13 = outleft.12 + grow;
      outleft = outleft.13;
      D.5798 = outsize + 4;
      result = monoeg_realloc (result, D.5798);
      outbuf.14 = result + outused;
      outbuf = outbuf.14;
      goto <D.5259>;
      <D.5260>:
      if (flush != 0) goto <D.5814>; else goto <D.5815>;
      <D.5814>:
      done = 1;
      goto <D.5816>;
      <D.5815>:
      flush = 1;
      <D.5816>:
      goto <D.5259>;
      <D.5261>:
      D.5817 = monoeg_g_convert_error_quark ();
      D.5804 = __errno_location ();
      D.5805 = *D.5804;
      D.5818 = monoeg_g_strerror (D.5805);
      monoeg_g_set_error (err, D.5817, 1, "%s", D.5818);
      if (bytes_read != 0B) goto <D.5819>; else goto <D.5820>;
      <D.5819>:
      inbuf.15 = inbuf;
      inbuf.16 = (long int) inbuf.15;
      str.17 = (long int) str;
      D.5824 = inbuf.16 - str.17;
      D.5825 = (long unsigned int) D.5824;
      *bytes_read = D.5825;
      <D.5820>:
      if (bytes_written != 0B) goto <D.5826>; else goto <D.5827>;
      <D.5826>:
      *bytes_written = 0;
      <D.5827>:
      monoeg_g_iconv_close (cd);
      monoeg_g_free (result);
      D.5781 = 0B;
      return D.5781;
      <D.5262>:
      D.5828 = monoeg_g_convert_error_quark ();
      D.5804 = __errno_location ();
      D.5805 = *D.5804;
      D.5829 = monoeg_g_strerror (D.5805);
      monoeg_g_set_error (err, D.5828, 2, "%s", D.5829);
      if (bytes_written != 0B) goto <D.5830>; else goto <D.5831>;
      <D.5830>:
      *bytes_written = 0;
      <D.5831>:
      if (bytes_read != 0B) goto <D.5832>; else goto <D.5833>;
      <D.5832>:
      *bytes_read = 0;
      <D.5833>:
      monoeg_g_iconv_close (cd);
      monoeg_g_free (result);
      D.5781 = 0B;
      return D.5781;
      <D.5259>:
      goto <D.5834>;
      <D.5803>:
      if (flush != 0) goto <D.5263>; else goto <D.5835>;
      <D.5835>:
      flush = 1;
      <D.5834>:
      if (done == 0) goto <D.5264>; else goto <D.5263>;
      <D.5263>:
      monoeg_g_iconv_close (cd);
      outbuf.9 = outbuf;
      memset (outbuf.9, 0, 4);
      if (bytes_written != 0B) goto <D.5836>; else goto <D.5837>;
      <D.5836>:
      outbuf.9 = outbuf;
      outbuf.10 = (long int) outbuf.9;
      result.11 = (long int) result;
      D.5810 = outbuf.10 - result.11;
      D.5838 = (long unsigned int) D.5810;
      *bytes_written = D.5838;
      <D.5837>:
      if (bytes_read != 0B) goto <D.5839>; else goto <D.5840>;
      <D.5839>:
      inbuf.15 = inbuf;
      inbuf.16 = (long int) inbuf.15;
      str.17 = (long int) str;
      D.5824 = inbuf.16 - str.17;
      D.5825 = (long unsigned int) D.5824;
      *bytes_read = D.5825;
      <D.5840>:
      D.5781 = result;
      return D.5781;
    }
  finally
    {
      outleft = {CLOBBER};
      inleft = {CLOBBER};
      outbuf = {CLOBBER};
      inbuf = {CLOBBER};
    }
}


__attribute__((__artificial__, __gnu_inline__, __always_inline__, __nothrow__, __leaf__))
memset (void * __dest, int __ch, size_t __len)
{
  void * D.5843;
  long unsigned int D.5844;

  D.5844 = __builtin_object_size (__dest, 0);
  D.5843 = __builtin___memset_chk (__dest, __ch, __len, D.5844);
  return D.5843;
}


monoeg_g_unichar_to_utf8 (gunichar c, gchar * outbuf)
{
  signed int c.18;
  gint D.5865;
  sizetype D.5868;
  gchar * D.5869;
  char D.5870;
  char D.5871;
  char D.5872;
  char D.5873;
  char D.5874;
  int base;
  int n;
  int i;

  if (c <= 127) goto <D.5846>; else goto <D.5847>;
  <D.5846>:
  base = 0;
  n = 1;
  goto <D.5848>;
  <D.5847>:
  if (c <= 2047) goto <D.5849>; else goto <D.5850>;
  <D.5849>:
  base = 192;
  n = 2;
  goto <D.5851>;
  <D.5850>:
  if (c <= 65535) goto <D.5852>; else goto <D.5853>;
  <D.5852>:
  base = 224;
  n = 3;
  goto <D.5854>;
  <D.5853>:
  if (c <= 2097151) goto <D.5855>; else goto <D.5856>;
  <D.5855>:
  base = 240;
  n = 4;
  goto <D.5857>;
  <D.5856>:
  if (c <= 67108863) goto <D.5858>; else goto <D.5859>;
  <D.5858>:
  base = 248;
  n = 5;
  goto <D.5860>;
  <D.5859>:
  c.18 = (signed int) c;
  if (c.18 >= 0) goto <D.5862>; else goto <D.5863>;
  <D.5862>:
  base = 252;
  n = 6;
  goto <D.5864>;
  <D.5863>:
  D.5865 = -1;
  return D.5865;
  <D.5864>:
  <D.5860>:
  <D.5857>:
  <D.5854>:
  <D.5851>:
  <D.5848>:
  if (outbuf != 0B) goto <D.5866>; else goto <D.5867>;
  <D.5866>:
  i = n + -1;
  goto <D.5273>;
  <D.5272>:
  D.5868 = (sizetype) i;
  D.5869 = outbuf + D.5868;
  D.5870 = (char) c;
  D.5871 = D.5870 & 63;
  D.5872 = D.5871 | 128;
  *D.5869 = D.5872;
  c = c >> 6;
  i = i + -1;
  <D.5273>:
  if (i > 0) goto <D.5272>; else goto <D.5274>;
  <D.5274>:
  D.5870 = (char) c;
  D.5873 = (char) base;
  D.5874 = D.5870 | D.5873;
  *outbuf = D.5874;
  <D.5867>:
  D.5865 = n;
  return D.5865;
}


monoeg_g_utf8_to_ucs4_fast (const gchar * str, glong len, glong * items_written)
{
  gunichar * D.5878;
  long int D.5881;
  long unsigned int D.5882;
  long unsigned int D.5883;
  gunichar * outptr.19;
  unsigned int D.5885;
  char D.5886;
  int D.5887;
  unsigned char D.5888;
  sizetype D.5889;
  gunichar * outbuf;
  gunichar * outptr;
  char * inptr;
  glong n;
  glong i;

  if (str == 0B) goto <D.5876>; else goto <D.5877>;
  <D.5876>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 896, "str != NULL");
  D.5878 = 0B;
  return D.5878;
  <D.5877>:
  n = monoeg_g_utf8_strlen (str, len);
  if (items_written != 0B) goto <D.5879>; else goto <D.5880>;
  <D.5879>:
  *items_written = n;
  <D.5880>:
  D.5881 = n + 1;
  D.5882 = (long unsigned int) D.5881;
  D.5883 = D.5882 * 4;
  outbuf = monoeg_malloc (D.5883);
  outptr = outbuf;
  inptr = str;
  i = 0;
  goto <D.5291>;
  <D.5290>:
  outptr.19 = outptr;
  outptr = outptr.19 + 4;
  D.5885 = monoeg_g_utf8_get_char (inptr);
  *outptr.19 = D.5885;
  D.5886 = *inptr;
  D.5887 = (int) D.5886;
  D.5888 = g_utf8_jump_table[D.5887];
  D.5889 = (sizetype) D.5888;
  inptr = inptr + D.5889;
  i = i + 1;
  <D.5291>:
  if (i < n) goto <D.5290>; else goto <D.5292>;
  <D.5292>:
  *outptr = 0;
  D.5878 = outbuf;
  return D.5878;
}


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

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


eg_utf8_to_utf16_general (const gchar * str, glong len, glong * items_read, glong * items_written, gboolean include_nuls, struct GError * * err)
{
  gunichar2 * D.5895;
  void * D.5900;
  long unsigned int D.5901;
  unsigned int c.20;
  int * D.5909;
  long unsigned int D.5910;
  long unsigned int D.5911;
  sizetype D.5912;
  long int inptr.21;
  long int str.22;
  long int D.5917;
  long int outlen.23;
  long unsigned int D.5921;
  long unsigned int D.5922;
  int D.5927;
  long unsigned int D.5928;
  long unsigned int D.5929;
  int D.5930;
  void * D.5933;
  void * D.5938;
  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.5893>; else goto <D.5894>;
      <D.5893>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 926, "str != NULL");
      D.5895 = 0B;
      return D.5895;
      <D.5894>:
      if (len < 0) goto <D.5896>; else goto <D.5897>;
      <D.5896>:
      if (include_nuls != 0) goto <D.5898>; else goto <D.5899>;
      <D.5898>:
      D.5900 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.5900, 2, "Conversions with embedded nulls must pass the string length");
      D.5895 = 0B;
      return D.5895;
      <D.5899>:
      D.5901 = strlen (str);
      len = (glong) D.5901;
      <D.5897>:
      inptr = str;
      inleft = (size_t) len;
      goto <D.5312>;
      <D.5311>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto error; else goto <D.5902>;
      <D.5902>:
      c.20 = c;
      if (c.20 == 0) goto <D.5904>; else goto <D.5905>;
      <D.5904>:
      if (include_nuls == 0) goto <D.5310>; else goto <D.5906>;
      <D.5906>:
      <D.5905>:
      c.20 = c;
      u = monoeg_unichar_to_utf16 (c.20, 0B);
      if (u < 0) goto <D.5907>; else goto <D.5908>;
      <D.5907>:
      D.5909 = __errno_location ();
      *D.5909 = 84;
      goto error;
      <D.5908>:
      D.5910 = (long unsigned int) u;
      outlen = D.5910 + outlen;
      D.5911 = (long unsigned int) n;
      inleft = inleft - D.5911;
      D.5912 = (sizetype) n;
      inptr = inptr + D.5912;
      <D.5312>:
      if (inleft != 0) goto <D.5311>; else goto <D.5310>;
      <D.5310>:
      if (items_read != 0B) goto <D.5913>; else goto <D.5914>;
      <D.5913>:
      inptr.21 = (long int) inptr;
      str.22 = (long int) str;
      D.5917 = inptr.21 - str.22;
      *items_read = D.5917;
      <D.5914>:
      if (items_written != 0B) goto <D.5918>; else goto <D.5919>;
      <D.5918>:
      outlen.23 = (long int) outlen;
      *items_written = outlen.23;
      <D.5919>:
      D.5921 = outlen + 1;
      D.5922 = D.5921 * 2;
      outbuf = monoeg_malloc (D.5922);
      outptr = outbuf;
      inptr = str;
      inleft = (size_t) len;
      goto <D.5315>;
      <D.5314>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.5313>; else goto <D.5923>;
      <D.5923>:
      c.20 = c;
      if (c.20 == 0) goto <D.5924>; else goto <D.5925>;
      <D.5924>:
      if (include_nuls == 0) goto <D.5313>; else goto <D.5926>;
      <D.5926>:
      <D.5925>:
      c.20 = c;
      D.5927 = monoeg_unichar_to_utf16 (c.20, outptr);
      D.5928 = (long unsigned int) D.5927;
      D.5929 = D.5928 * 2;
      outptr = outptr + D.5929;
      D.5911 = (long unsigned int) n;
      inleft = inleft - D.5911;
      D.5912 = (sizetype) n;
      inptr = inptr + D.5912;
      <D.5315>:
      if (inleft != 0) goto <D.5314>; else goto <D.5313>;
      <D.5313>:
      *outptr = 0;
      D.5895 = outbuf;
      return D.5895;
      error:
      D.5909 = __errno_location ();
      D.5930 = *D.5909;
      if (D.5930 == 84) goto <D.5931>; else goto <D.5932>;
      <D.5931>:
      D.5933 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.5933, 1, "Illegal byte sequence encounted in the input.");
      goto <D.5934>;
      <D.5932>:
      if (items_read != 0B) goto <D.5935>; else goto <D.5936>;
      <D.5935>:
      goto <D.5937>;
      <D.5936>:
      D.5938 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.5938, 3, "Partial byte sequence encountered in the input.");
      <D.5937>:
      <D.5934>:
      if (items_read != 0B) goto <D.5939>; else goto <D.5940>;
      <D.5939>:
      inptr.21 = (long int) inptr;
      str.22 = (long int) str;
      D.5917 = inptr.21 - str.22;
      *items_read = D.5917;
      <D.5940>:
      if (items_written != 0B) goto <D.5941>; else goto <D.5942>;
      <D.5941>:
      *items_written = 0;
      <D.5942>:
      D.5895 = 0B;
      return D.5895;
    }
  finally
    {
      c = {CLOBBER};
    }
}


__attribute__((always_inline))
monoeg_unichar_to_utf16 (gunichar c, gunichar2 * outbuf)
{
  short unsigned int D.5949;
  int D.5950;
  unsigned int D.5961;
  short unsigned int D.5962;
  short unsigned int D.5963;
  gunichar2 * D.5964;
  short unsigned int D.5965;
  short unsigned int D.5966;
  short unsigned int D.5967;
  gunichar c2;

  if (c <= 55295) goto <D.5945>; else goto <D.5946>;
  <D.5945>:
  if (outbuf != 0B) goto <D.5947>; else goto <D.5948>;
  <D.5947>:
  D.5949 = (short unsigned int) c;
  *outbuf = D.5949;
  <D.5948>:
  D.5950 = 1;
  return D.5950;
  <D.5946>:
  if (c <= 57343) goto <D.5951>; else goto <D.5952>;
  <D.5951>:
  D.5950 = -1;
  return D.5950;
  <D.5952>:
  if (c <= 65535) goto <D.5953>; else goto <D.5954>;
  <D.5953>:
  if (outbuf != 0B) goto <D.5955>; else goto <D.5956>;
  <D.5955>:
  D.5949 = (short unsigned int) c;
  *outbuf = D.5949;
  <D.5956>:
  D.5950 = 1;
  return D.5950;
  <D.5954>:
  if (c <= 1114111) goto <D.5957>; else goto <D.5958>;
  <D.5957>:
  if (outbuf != 0B) goto <D.5959>; else goto <D.5960>;
  <D.5959>:
  c2 = c + 4294901760;
  D.5961 = c2 >> 10;
  D.5962 = (short unsigned int) D.5961;
  D.5963 = D.5962 + 55296;
  *outbuf = D.5963;
  D.5964 = outbuf + 2;
  D.5965 = (short unsigned int) c2;
  D.5966 = D.5965 & 1023;
  D.5967 = D.5966 + 56320;
  *D.5964 = D.5967;
  <D.5960>:
  D.5950 = 2;
  return D.5950;
  <D.5958>:
  D.5950 = -1;
  return D.5950;
}


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

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


monoeg_utf8_to_ucs4 (const gchar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar * D.5973;
  long unsigned int D.5976;
  int * D.5979;
  int D.5980;
  void * D.5983;
  void * D.5986;
  long int inptr.24;
  long int str.25;
  long int D.5991;
  unsigned int c.26;
  long unsigned int D.5996;
  sizetype D.5997;
  long unsigned int D.6000;
  long int D.6001;
  long unsigned int D.6004;
  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.5971>; else goto <D.5972>;
      <D.5971>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1025, "str != NULL");
      D.5973 = 0B;
      return D.5973;
      <D.5972>:
      if (len < 0) goto <D.5974>; else goto <D.5975>;
      <D.5974>:
      D.5976 = strlen (str);
      len = (glong) D.5976;
      <D.5975>:
      inptr = str;
      inleft = (size_t) len;
      goto <D.5346>;
      <D.5345>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.5977>; else goto <D.5978>;
      <D.5977>:
      D.5979 = __errno_location ();
      D.5980 = *D.5979;
      if (D.5980 == 84) goto <D.5981>; else goto <D.5982>;
      <D.5981>:
      D.5983 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.5983, 1, "Illegal byte sequence encounted in the input.");
      goto <D.5984>;
      <D.5982>:
      if (items_read != 0B) goto <D.5344>; else goto <D.5985>;
      <D.5985>:
      D.5986 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.5986, 3, "Partial byte sequence encountered in the input.");
      <D.5984>:
      if (items_read != 0B) goto <D.5987>; else goto <D.5988>;
      <D.5987>:
      inptr.24 = (long int) inptr;
      str.25 = (long int) str;
      D.5991 = inptr.24 - str.25;
      *items_read = D.5991;
      <D.5988>:
      if (items_written != 0B) goto <D.5992>; else goto <D.5993>;
      <D.5992>:
      *items_written = 0;
      <D.5993>:
      D.5973 = 0B;
      return D.5973;
      <D.5978>:
      c.26 = c;
      if (c.26 == 0) goto <D.5344>; else goto <D.5995>;
      <D.5995>:
      outlen = outlen + 4;
      D.5996 = (long unsigned int) n;
      inleft = inleft - D.5996;
      D.5997 = (sizetype) n;
      inptr = inptr + D.5997;
      <D.5346>:
      if (inleft != 0) goto <D.5345>; else goto <D.5344>;
      <D.5344>:
      if (items_written != 0B) goto <D.5998>; else goto <D.5999>;
      <D.5998>:
      D.6000 = outlen / 4;
      D.6001 = (long int) D.6000;
      *items_written = D.6001;
      <D.5999>:
      if (items_read != 0B) goto <D.6002>; else goto <D.6003>;
      <D.6002>:
      inptr.24 = (long int) inptr;
      str.25 = (long int) str;
      D.5991 = inptr.24 - str.25;
      *items_read = D.5991;
      <D.6003>:
      D.6004 = outlen + 4;
      outbuf = monoeg_malloc (D.6004);
      outptr = outbuf;
      inptr = str;
      inleft = (size_t) len;
      goto <D.5349>;
      <D.5348>:
      n = decode_utf8 (inptr, inleft, &c);
      if (n < 0) goto <D.5347>; else goto <D.6005>;
      <D.6005>:
      c.26 = c;
      if (c.26 == 0) goto <D.5347>; else goto <D.6006>;
      <D.6006>:
      outptr.27 = outptr;
      outptr = outptr.27 + 4;
      c.26 = c;
      *outptr.27 = c.26;
      D.5996 = (long unsigned int) n;
      inleft = inleft - D.5996;
      D.5997 = (sizetype) n;
      inptr = inptr + D.5997;
      <D.5349>:
      if (inleft != 0) goto <D.5348>; else goto <D.5347>;
      <D.5347>:
      *outptr = 0;
      D.5973 = outbuf;
      return D.5973;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_utf16_to_utf8 (const gunichar2 * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gchar * D.6012;
  long unsigned int len.28;
  long unsigned int D.6016;
  const gunichar2 * D.6017;
  short unsigned int D.6018;
  long int D.6019;
  int * D.6026;
  int D.6027;
  void * D.6030;
  void * D.6033;
  long int inptr.29;
  long int str.30;
  long int D.6038;
  long int D.6039;
  unsigned int c.31;
  int D.6044;
  long unsigned int D.6045;
  long unsigned int D.6046;
  sizetype D.6047;
  long int outlen.32;
  long unsigned int D.6053;
  int D.6056;
  sizetype D.6057;
  char * inptr;
  char * outbuf;
  char * outptr;
  size_t outlen;
  size_t inleft;
  gunichar c;
  int n;

  try
    {
      outlen = 0;
      if (str == 0B) goto <D.6010>; else goto <D.6011>;
      <D.6010>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1096, "str != NULL");
      D.6012 = 0B;
      return D.6012;
      <D.6011>:
      if (len < 0) goto <D.6013>; else goto <D.6014>;
      <D.6013>:
      len = 0;
      goto <D.5365>;
      <D.5364>:
      len = len + 1;
      <D.5365>:
      len.28 = (long unsigned int) len;
      D.6016 = len.28 * 2;
      D.6017 = str + D.6016;
      D.6018 = *D.6017;
      if (D.6018 != 0) goto <D.5364>; else goto <D.5366>;
      <D.5366>:
      <D.6014>:
      inptr = str;
      D.6019 = len * 2;
      inleft = (size_t) D.6019;
      goto <D.5369>;
      <D.5368>:
      n = decode_utf16be (inptr, inleft, &c);
      if (n < 0) goto <D.6020>; else goto <D.6021>;
      <D.6020>:
      if (n == -2) goto <D.6022>; else goto <D.6023>;
      <D.6022>:
      if (inleft > 2) goto <D.6024>; else goto <D.6025>;
      <D.6024>:
      inleft = inleft + 18446744073709551614;
      inptr = inptr + 2;
      <D.6025>:
      <D.6023>:
      D.6026 = __errno_location ();
      D.6027 = *D.6026;
      if (D.6027 == 84) goto <D.6028>; else goto <D.6029>;
      <D.6028>:
      D.6030 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6030, 1, "Illegal byte sequence encounted in the input.");
      goto <D.6031>;
      <D.6029>:
      if (items_read != 0B) goto <D.5367>; else goto <D.6032>;
      <D.6032>:
      D.6033 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6033, 3, "Partial byte sequence encountered in the input.");
      <D.6031>:
      if (items_read != 0B) goto <D.6034>; else goto <D.6035>;
      <D.6034>:
      inptr.29 = (long int) inptr;
      str.30 = (long int) str;
      D.6038 = inptr.29 - str.30;
      D.6039 = D.6038 / 2;
      *items_read = D.6039;
      <D.6035>:
      if (items_written != 0B) goto <D.6040>; else goto <D.6041>;
      <D.6040>:
      *items_written = 0;
      <D.6041>:
      D.6012 = 0B;
      return D.6012;
      <D.6021>:
      c.31 = c;
      if (c.31 == 0) goto <D.5367>; else goto <D.6043>;
      <D.6043>:
      c.31 = c;
      D.6044 = monoeg_g_unichar_to_utf8 (c.31, 0B);
      D.6045 = (long unsigned int) D.6044;
      outlen = D.6045 + outlen;
      D.6046 = (long unsigned int) n;
      inleft = inleft - D.6046;
      D.6047 = (sizetype) n;
      inptr = inptr + D.6047;
      <D.5369>:
      if (inleft != 0) goto <D.5368>; else goto <D.5367>;
      <D.5367>:
      if (items_read != 0B) goto <D.6048>; else goto <D.6049>;
      <D.6048>:
      inptr.29 = (long int) inptr;
      str.30 = (long int) str;
      D.6038 = inptr.29 - str.30;
      D.6039 = D.6038 / 2;
      *items_read = D.6039;
      <D.6049>:
      if (items_written != 0B) goto <D.6050>; else goto <D.6051>;
      <D.6050>:
      outlen.32 = (long int) outlen;
      *items_written = outlen.32;
      <D.6051>:
      D.6053 = outlen + 1;
      outbuf = monoeg_malloc (D.6053);
      outptr = outbuf;
      inptr = str;
      D.6019 = len * 2;
      inleft = (size_t) D.6019;
      goto <D.5372>;
      <D.5371>:
      n = decode_utf16be (inptr, inleft, &c);
      if (n < 0) goto <D.5370>; else goto <D.6054>;
      <D.6054>:
      c.31 = c;
      if (c.31 == 0) goto <D.5370>; else goto <D.6055>;
      <D.6055>:
      c.31 = c;
      D.6056 = monoeg_g_unichar_to_utf8 (c.31, outptr);
      D.6057 = (sizetype) D.6056;
      outptr = outptr + D.6057;
      D.6046 = (long unsigned int) n;
      inleft = inleft - D.6046;
      D.6047 = (sizetype) n;
      inptr = inptr + D.6047;
      <D.5372>:
      if (inleft != 0) goto <D.5371>; else goto <D.5370>;
      <D.5370>:
      *outptr = 0;
      D.6012 = outbuf;
      return D.6012;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_utf16_to_ucs4 (const gunichar2 * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar * D.6062;
  long unsigned int len.33;
  long unsigned int D.6066;
  const gunichar2 * D.6067;
  short unsigned int D.6068;
  long int D.6069;
  int * D.6076;
  int D.6077;
  void * D.6080;
  void * D.6083;
  long int inptr.34;
  long int str.35;
  long int D.6088;
  long int D.6089;
  unsigned int c.36;
  long unsigned int D.6094;
  sizetype D.6095;
  long unsigned int D.6100;
  long int D.6101;
  long unsigned int D.6102;
  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.6060>; else goto <D.6061>;
      <D.6060>:
      monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1177, "str != NULL");
      D.6062 = 0B;
      return D.6062;
      <D.6061>:
      if (len < 0) goto <D.6063>; else goto <D.6064>;
      <D.6063>:
      len = 0;
      goto <D.5388>;
      <D.5387>:
      len = len + 1;
      <D.5388>:
      len.33 = (long unsigned int) len;
      D.6066 = len.33 * 2;
      D.6067 = str + D.6066;
      D.6068 = *D.6067;
      if (D.6068 != 0) goto <D.5387>; else goto <D.5389>;
      <D.5389>:
      <D.6064>:
      inptr = str;
      D.6069 = len * 2;
      inleft = (size_t) D.6069;
      goto <D.5392>;
      <D.5391>:
      n = decode_utf16be (inptr, inleft, &c);
      if (n < 0) goto <D.6070>; else goto <D.6071>;
      <D.6070>:
      if (n == -2) goto <D.6072>; else goto <D.6073>;
      <D.6072>:
      if (inleft > 2) goto <D.6074>; else goto <D.6075>;
      <D.6074>:
      inleft = inleft + 18446744073709551614;
      inptr = inptr + 2;
      <D.6075>:
      <D.6073>:
      D.6076 = __errno_location ();
      D.6077 = *D.6076;
      if (D.6077 == 84) goto <D.6078>; else goto <D.6079>;
      <D.6078>:
      D.6080 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6080, 1, "Illegal byte sequence encounted in the input.");
      goto <D.6081>;
      <D.6079>:
      if (items_read != 0B) goto <D.5390>; else goto <D.6082>;
      <D.6082>:
      D.6083 = monoeg_g_convert_error_quark ();
      monoeg_g_set_error (err, D.6083, 3, "Partial byte sequence encountered in the input.");
      <D.6081>:
      if (items_read != 0B) goto <D.6084>; else goto <D.6085>;
      <D.6084>:
      inptr.34 = (long int) inptr;
      str.35 = (long int) str;
      D.6088 = inptr.34 - str.35;
      D.6089 = D.6088 / 2;
      *items_read = D.6089;
      <D.6085>:
      if (items_written != 0B) goto <D.6090>; else goto <D.6091>;
      <D.6090>:
      *items_written = 0;
      <D.6091>:
      D.6062 = 0B;
      return D.6062;
      <D.6071>:
      c.36 = c;
      if (c.36 == 0) goto <D.5390>; else goto <D.6093>;
      <D.6093>:
      outlen = outlen + 4;
      D.6094 = (long unsigned int) n;
      inleft = inleft - D.6094;
      D.6095 = (sizetype) n;
      inptr = inptr + D.6095;
      <D.5392>:
      if (inleft != 0) goto <D.5391>; else goto <D.5390>;
      <D.5390>:
      if (items_read != 0B) goto <D.6096>; else goto <D.6097>;
      <D.6096>:
      inptr.34 = (long int) inptr;
      str.35 = (long int) str;
      D.6088 = inptr.34 - str.35;
      D.6089 = D.6088 / 2;
      *items_read = D.6089;
      <D.6097>:
      if (items_written != 0B) goto <D.6098>; else goto <D.6099>;
      <D.6098>:
      D.6100 = outlen / 4;
      D.6101 = (long int) D.6100;
      *items_written = D.6101;
      <D.6099>:
      D.6102 = outlen + 4;
      outbuf = monoeg_malloc (D.6102);
      outptr = outbuf;
      inptr = str;
      D.6069 = len * 2;
      inleft = (size_t) D.6069;
      goto <D.5395>;
      <D.5394>:
      n = decode_utf16be (inptr, inleft, &c);
      if (n < 0) goto <D.5393>; else goto <D.6103>;
      <D.6103>:
      c.36 = c;
      if (c.36 == 0) goto <D.5393>; else goto <D.6104>;
      <D.6104>:
      outptr.37 = outptr;
      outptr = outptr.37 + 4;
      c.36 = c;
      *outptr.37 = c.36;
      D.6094 = (long unsigned int) n;
      inleft = inleft - D.6094;
      D.6095 = (sizetype) n;
      inptr = inptr + D.6095;
      <D.5395>:
      if (inleft != 0) goto <D.5394>; else goto <D.5393>;
      <D.5393>:
      *outptr = 0;
      D.6062 = outbuf;
      return D.6062;
    }
  finally
    {
      c = {CLOBBER};
    }
}


monoeg_g_ucs4_to_utf8 (const gunichar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gchar * D.6110;
  long unsigned int i.38;
  long unsigned int D.6114;
  const gunichar * D.6115;
  unsigned int D.6116;
  void * D.6119;
  long unsigned int D.6124;
  void * D.6128;
  long unsigned int D.6134;
  int D.6135;
  sizetype D.6136;
  long int outlen.39;
  char * outbuf;
  char * outptr;
  size_t outlen;
  glong i;
  int n;

  outlen = 0;
  if (str == 0B) goto <D.6108>; else goto <D.6109>;
  <D.6108>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1256, "str != NULL");
  D.6110 = 0B;
  return D.6110;
  <D.6109>:
  if (len < 0) goto <D.6111>; else goto <D.6112>;
  <D.6111>:
  i = 0;
  goto <D.5409>;
  <D.5408>:
  i.38 = (long unsigned int) i;
  D.6114 = i.38 * 4;
  D.6115 = str + D.6114;
  D.6116 = *D.6115;
  n = monoeg_g_unichar_to_utf8 (D.6116, 0B);
  if (n < 0) goto <D.6117>; else goto <D.6118>;
  <D.6117>:
  D.6119 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6119, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6120>; else goto <D.6121>;
  <D.6120>:
  *items_written = 0;
  <D.6121>:
  if (items_read != 0B) goto <D.6122>; else goto <D.6123>;
  <D.6122>:
  *items_read = i;
  <D.6123>:
  D.6110 = 0B;
  return D.6110;
  <D.6118>:
  D.6124 = (long unsigned int) n;
  outlen = D.6124 + outlen;
  i = i + 1;
  <D.5409>:
  i.38 = (long unsigned int) i;
  D.6114 = i.38 * 4;
  D.6115 = str + D.6114;
  D.6116 = *D.6115;
  if (D.6116 != 0) goto <D.5408>; else goto <D.5410>;
  <D.5410>:
  goto <D.6125>;
  <D.6112>:
  i = 0;
  goto <D.5412>;
  <D.5411>:
  i.38 = (long unsigned int) i;
  D.6114 = i.38 * 4;
  D.6115 = str + D.6114;
  D.6116 = *D.6115;
  n = monoeg_g_unichar_to_utf8 (D.6116, 0B);
  if (n < 0) goto <D.6126>; else goto <D.6127>;
  <D.6126>:
  D.6128 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6128, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6129>; else goto <D.6130>;
  <D.6129>:
  *items_written = 0;
  <D.6130>:
  if (items_read != 0B) goto <D.6131>; else goto <D.6132>;
  <D.6131>:
  *items_read = i;
  <D.6132>:
  D.6110 = 0B;
  return D.6110;
  <D.6127>:
  D.6124 = (long unsigned int) n;
  outlen = D.6124 + outlen;
  i = i + 1;
  <D.5412>:
  if (i < len) goto <D.6133>; else goto <D.5413>;
  <D.6133>:
  i.38 = (long unsigned int) i;
  D.6114 = i.38 * 4;
  D.6115 = str + D.6114;
  D.6116 = *D.6115;
  if (D.6116 != 0) goto <D.5411>; else goto <D.5413>;
  <D.5413>:
  <D.6125>:
  len = i;
  D.6134 = outlen + 1;
  outbuf = monoeg_malloc (D.6134);
  outptr = outbuf;
  i = 0;
  goto <D.5415>;
  <D.5414>:
  i.38 = (long unsigned int) i;
  D.6114 = i.38 * 4;
  D.6115 = str + D.6114;
  D.6116 = *D.6115;
  D.6135 = monoeg_g_unichar_to_utf8 (D.6116, outptr);
  D.6136 = (sizetype) D.6135;
  outptr = outptr + D.6136;
  i = i + 1;
  <D.5415>:
  if (i < len) goto <D.5414>; else goto <D.5416>;
  <D.5416>:
  *outptr = 0;
  if (items_written != 0B) goto <D.6137>; else goto <D.6138>;
  <D.6137>:
  outlen.39 = (long int) outlen;
  *items_written = outlen.39;
  <D.6138>:
  if (items_read != 0B) goto <D.6140>; else goto <D.6141>;
  <D.6140>:
  *items_read = i;
  <D.6141>:
  D.6110 = outbuf;
  return D.6110;
}


monoeg_g_ucs4_to_utf16 (const gunichar * str, glong len, glong * items_read, glong * items_written, struct GError * * err)
{
  gunichar2 * D.6145;
  long unsigned int i.40;
  long unsigned int D.6149;
  const gunichar * D.6150;
  unsigned int D.6151;
  void * D.6154;
  long unsigned int D.6159;
  void * D.6163;
  long unsigned int D.6169;
  long unsigned int D.6170;
  int D.6171;
  long unsigned int D.6172;
  long unsigned int D.6173;
  long int outlen.41;
  gunichar2 * outbuf;
  gunichar2 * outptr;
  size_t outlen;
  glong i;
  int n;

  outlen = 0;
  if (str == 0B) goto <D.6143>; else goto <D.6144>;
  <D.6143>:
  monoeg_g_log (0B, 8, "%s:%d: assertion \'%s\' failed", "giconv.c", 1318, "str != NULL");
  D.6145 = 0B;
  return D.6145;
  <D.6144>:
  if (len < 0) goto <D.6146>; else goto <D.6147>;
  <D.6146>:
  i = 0;
  goto <D.5430>;
  <D.5429>:
  i.40 = (long unsigned int) i;
  D.6149 = i.40 * 4;
  D.6150 = str + D.6149;
  D.6151 = *D.6150;
  n = monoeg_unichar_to_utf16 (D.6151, 0B);
  if (n < 0) goto <D.6152>; else goto <D.6153>;
  <D.6152>:
  D.6154 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6154, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6155>; else goto <D.6156>;
  <D.6155>:
  *items_written = 0;
  <D.6156>:
  if (items_read != 0B) goto <D.6157>; else goto <D.6158>;
  <D.6157>:
  *items_read = i;
  <D.6158>:
  D.6145 = 0B;
  return D.6145;
  <D.6153>:
  D.6159 = (long unsigned int) n;
  outlen = D.6159 + outlen;
  i = i + 1;
  <D.5430>:
  i.40 = (long unsigned int) i;
  D.6149 = i.40 * 4;
  D.6150 = str + D.6149;
  D.6151 = *D.6150;
  if (D.6151 != 0) goto <D.5429>; else goto <D.5431>;
  <D.5431>:
  goto <D.6160>;
  <D.6147>:
  i = 0;
  goto <D.5433>;
  <D.5432>:
  i.40 = (long unsigned int) i;
  D.6149 = i.40 * 4;
  D.6150 = str + D.6149;
  D.6151 = *D.6150;
  n = monoeg_unichar_to_utf16 (D.6151, 0B);
  if (n < 0) goto <D.6161>; else goto <D.6162>;
  <D.6161>:
  D.6163 = monoeg_g_convert_error_quark ();
  monoeg_g_set_error (err, D.6163, 1, "Illegal byte sequence encounted in the input.");
  if (items_written != 0B) goto <D.6164>; else goto <D.6165>;
  <D.6164>:
  *items_written = 0;
  <D.6165>:
  if (items_read != 0B) goto <D.6166>; else goto <D.6167>;
  <D.6166>:
  *items_read = i;
  <D.6167>:
  D.6145 = 0B;
  return D.6145;
  <D.6162>:
  D.6159 = (long unsigned int) n;
  outlen = D.6159 + outlen;
  i = i + 1;
  <D.5433>:
  if (i < len) goto <D.6168>; else goto <D.5434>;
  <D.6168>:
  i.40 = (long unsigned int) i;
  D.6149 = i.40 * 4;
  D.6150 = str + D.6149;
  D.6151 = *D.6150;
  if (D.6151 != 0) goto <D.5432>; else goto <D.5434>;
  <D.5434>:
  <D.6160>:
  len = i;
  D.6169 = outlen + 1;
  D.6170 = D.6169 * 2;
  outbuf = monoeg_malloc (D.6170);
  outptr = outbuf;
  i = 0;
  goto <D.5436>;
  <D.5435>:
  i.40 = (long unsigned int) i;
  D.6149 = i.40 * 4;
  D.6150 = str + D.6149;
  D.6151 = *D.6150;
  D.6171 = monoeg_unichar_to_utf16 (D.6151, outptr);
  D.6172 = (long unsigned int) D.6171;
  D.6173 = D.6172 * 2;
  outptr = outptr + D.6173;
  i = i + 1;
  <D.5436>:
  if (i < len) goto <D.5435>; else goto <D.5437>;
  <D.5437>:
  *outptr = 0;
  if (items_written != 0B) goto <D.6174>; else goto <D.6175>;
  <D.6174>:
  outlen.41 = (long int) outlen;
  *items_written = outlen.41;
  <D.6175>:
  if (items_read != 0B) goto <D.6177>; else goto <D.6178>;
  <D.6177>:
  *items_read = i;
  <D.6178>:
  D.6145 = outbuf;
  return D.6145;
}


