mono_unicode_from_external (const gchar * in, gsize * bytes)
{
  gunichar2 * D.4719;
  int D.4616;
  int iftmp.0;
  int D.4615;
  unsigned int i.1;
  unsigned int D.4726;
  gchar * * D.4727;
  const char[15] * D.4728;
  unsigned char D.4729;
  int D.4730;
  unsigned char D.4731;
  int D.4732;
  _Bool D.4733;
  _Bool D.4734;
  _Bool D.4735;
  const unsigned char * D.4738;
  unsigned char D.4739;
  int D.4740;
  const unsigned char * D.4741;
  unsigned char D.4742;
  int D.4743;
  _Bool D.4744;
  _Bool D.4745;
  const unsigned char * D.4748;
  unsigned char D.4749;
  int D.4750;
  const unsigned char * D.4751;
  unsigned char D.4752;
  int D.4753;
  _Bool D.4754;
  _Bool D.4755;
  const unsigned char * D.4758;
  unsigned char D.4759;
  int D.4760;
  const unsigned char * D.4761;
  unsigned char D.4762;
  int D.4763;
  gchar * D.4765;
  long int lbytes.2;
  unsigned int lbytes.3;
  unsigned int D.4773;
  int D.4774;
  unsigned int D.4779;
  unsigned int D.4780;
  int D.4781;
  gchar * res;
  gchar * * encodings;
  const gchar * encoding_list;
  int i;
  glong lbytes;

  try
    {
      res = 0B;
      if (in == 0B) goto <D.4717>; else goto <D.4718>;
      <D.4717>:
      D.4719 = 0B;
      return D.4719;
      <D.4718>:
      encoding_list = monoeg_g_getenv ("MONO_EXTERNAL_ENCODINGS");
      if (encoding_list == 0B) goto <D.4720>; else goto <D.4721>;
      <D.4720>:
      encoding_list = "";
      <D.4721>:
      encodings = monoeg_g_strsplit (encoding_list, ":", 0);
      i = 0;
      goto <D.4620>;
      <D.4619>:
      {
        size_t __s1_len;
        size_t __s2_len;

        __s2_len = 14;
        if (__s2_len <= 3) goto <D.4723>; else goto <D.4724>;
        <D.4723>:
        {
          const unsigned char * __s2;
          int __result;

          i.1 = (unsigned int) i;
          D.4726 = i.1 * 4;
          D.4727 = encodings + D.4726;
          __s2 = *D.4727;
          D.4728 = "default_locale";
          D.4729 = MEM[(const unsigned char *)D.4728];
          D.4730 = (int) D.4729;
          D.4731 = *__s2;
          D.4732 = (int) D.4731;
          __result = D.4730 - D.4732;
          {
            D.4733 = __s2_len != 0;
            D.4734 = __result == 0;
            D.4735 = D.4733 & D.4734;
            if (D.4735 != 0) goto <D.4736>; else goto <D.4737>;
            <D.4736>:
            D.4738 = &MEM[(void *)"default_locale" + 1B];
            D.4739 = *D.4738;
            D.4740 = (int) D.4739;
            D.4741 = __s2 + 1;
            D.4742 = *D.4741;
            D.4743 = (int) D.4742;
            __result = D.4740 - D.4743;
            D.4744 = __s2_len > 1;
            D.4734 = __result == 0;
            D.4745 = D.4744 & D.4734;
            if (D.4745 != 0) goto <D.4746>; else goto <D.4747>;
            <D.4746>:
            D.4748 = &MEM[(void *)"default_locale" + 2B];
            D.4749 = *D.4748;
            D.4750 = (int) D.4749;
            D.4751 = __s2 + 2;
            D.4752 = *D.4751;
            D.4753 = (int) D.4752;
            __result = D.4750 - D.4753;
            D.4754 = __s2_len > 2;
            D.4734 = __result == 0;
            D.4755 = D.4754 & D.4734;
            if (D.4755 != 0) goto <D.4756>; else goto <D.4757>;
            <D.4756>:
            D.4758 = &MEM[(void *)"default_locale" + 3B];
            D.4759 = *D.4758;
            D.4760 = (int) D.4759;
            D.4761 = __s2 + 3;
            D.4762 = *D.4761;
            D.4763 = (int) D.4762;
            __result = D.4760 - D.4763;
            <D.4757>:
            <D.4747>:
            <D.4737>:
          }
          D.4615 = __result;
        }
        iftmp.0 = -D.4615;
        goto <D.4764>;
        <D.4724>:
        i.1 = (unsigned int) i;
        D.4726 = i.1 * 4;
        D.4727 = encodings + D.4726;
        D.4765 = *D.4727;
        iftmp.0 = __builtin_strcmp (D.4765, "default_locale");
        <D.4764>:
        D.4616 = iftmp.0;
      }
      if (D.4616 == 0) goto <D.4766>; else goto <D.4767>;
      <D.4766>:
      {
        gchar * utf8;

        utf8 = monoeg_g_locale_to_utf8 (in, -1, 0B, 0B, 0B);
        if (utf8 != 0B) goto <D.4768>; else goto <D.4769>;
        <D.4768>:
        res = monoeg_g_utf8_to_utf16 (utf8, -1, 0B, &lbytes, 0B);
        lbytes.2 = lbytes;
        lbytes.3 = (unsigned int) lbytes.2;
        *bytes = lbytes.3;
        <D.4769>:
        monoeg_g_free (utf8);
      }
      goto <D.4772>;
      <D.4767>:
      i.1 = (unsigned int) i;
      D.4726 = i.1 * 4;
      D.4727 = encodings + D.4726;
      D.4765 = *D.4727;
      D.4773 = strlen (in);
      D.4774 = (int) D.4773;
      res = monoeg_g_convert (in, D.4774, "UTF8", D.4765, 0B, bytes, 0B);
      if (res != 0B) goto <D.4775>; else goto <D.4776>;
      <D.4775>:
      {
        gchar * ptr;

        ptr = res;
        res = monoeg_g_utf8_to_utf16 (res, -1, 0B, &lbytes, 0B);
        lbytes.2 = lbytes;
        lbytes.3 = (unsigned int) lbytes.2;
        *bytes = lbytes.3;
        monoeg_g_free (ptr);
      }
      <D.4776>:
      <D.4772>:
      if (res != 0B) goto <D.4777>; else goto <D.4778>;
      <D.4777>:
      monoeg_g_strfreev (encodings);
      D.4779 = *bytes;
      D.4780 = D.4779 * 2;
      *bytes = D.4780;
      D.4719 = res;
      return D.4719;
      <D.4778>:
      i = i + 1;
      <D.4620>:
      i.1 = (unsigned int) i;
      D.4726 = i.1 * 4;
      D.4727 = encodings + D.4726;
      D.4765 = *D.4727;
      if (D.4765 != 0B) goto <D.4619>; else goto <D.4621>;
      <D.4621>:
      monoeg_g_strfreev (encodings);
      D.4781 = monoeg_g_utf8_validate (in, -1, 0B);
      if (D.4781 != 0) goto <D.4782>; else goto <D.4783>;
      <D.4782>:
      {
        gunichar2 * unires;

        unires = monoeg_g_utf8_to_utf16 (in, -1, 0B, bytes, 0B);
        D.4779 = *bytes;
        D.4780 = D.4779 * 2;
        *bytes = D.4780;
        D.4719 = unires;
        return D.4719;
      }
      <D.4783>:
      D.4719 = 0B;
      return D.4719;
    }
  finally
    {
      lbytes = {CLOBBER};
    }
}


mono_utf8_from_external (const gchar * in)
{
  gchar * D.4788;
  int D.4638;
  int iftmp.4;
  int D.4637;
  unsigned int i.5;
  unsigned int D.4795;
  gchar * * D.4796;
  const char[15] * D.4797;
  unsigned char D.4798;
  int D.4799;
  unsigned char D.4800;
  int D.4801;
  _Bool D.4802;
  _Bool D.4803;
  _Bool D.4804;
  const unsigned char * D.4807;
  unsigned char D.4808;
  int D.4809;
  const unsigned char * D.4810;
  unsigned char D.4811;
  int D.4812;
  _Bool D.4813;
  _Bool D.4814;
  const unsigned char * D.4817;
  unsigned char D.4818;
  int D.4819;
  const unsigned char * D.4820;
  unsigned char D.4821;
  int D.4822;
  _Bool D.4823;
  _Bool D.4824;
  const unsigned char * D.4827;
  unsigned char D.4828;
  int D.4829;
  const unsigned char * D.4830;
  unsigned char D.4831;
  int D.4832;
  gchar * D.4834;
  int D.4839;
  int D.4845;
  gchar * res;
  gchar * * encodings;
  const gchar * encoding_list;
  int i;

  res = 0B;
  if (in == 0B) goto <D.4786>; else goto <D.4787>;
  <D.4786>:
  D.4788 = 0B;
  return D.4788;
  <D.4787>:
  encoding_list = monoeg_g_getenv ("MONO_EXTERNAL_ENCODINGS");
  if (encoding_list == 0B) goto <D.4789>; else goto <D.4790>;
  <D.4789>:
  encoding_list = "";
  <D.4790>:
  encodings = monoeg_g_strsplit (encoding_list, ":", 0);
  i = 0;
  goto <D.4640>;
  <D.4639>:
  {
    size_t __s1_len;
    size_t __s2_len;

    __s2_len = 14;
    if (__s2_len <= 3) goto <D.4792>; else goto <D.4793>;
    <D.4792>:
    {
      const unsigned char * __s2;
      int __result;

      i.5 = (unsigned int) i;
      D.4795 = i.5 * 4;
      D.4796 = encodings + D.4795;
      __s2 = *D.4796;
      D.4797 = "default_locale";
      D.4798 = MEM[(const unsigned char *)D.4797];
      D.4799 = (int) D.4798;
      D.4800 = *__s2;
      D.4801 = (int) D.4800;
      __result = D.4799 - D.4801;
      {
        D.4802 = __s2_len != 0;
        D.4803 = __result == 0;
        D.4804 = D.4802 & D.4803;
        if (D.4804 != 0) goto <D.4805>; else goto <D.4806>;
        <D.4805>:
        D.4807 = &MEM[(void *)"default_locale" + 1B];
        D.4808 = *D.4807;
        D.4809 = (int) D.4808;
        D.4810 = __s2 + 1;
        D.4811 = *D.4810;
        D.4812 = (int) D.4811;
        __result = D.4809 - D.4812;
        D.4813 = __s2_len > 1;
        D.4803 = __result == 0;
        D.4814 = D.4813 & D.4803;
        if (D.4814 != 0) goto <D.4815>; else goto <D.4816>;
        <D.4815>:
        D.4817 = &MEM[(void *)"default_locale" + 2B];
        D.4818 = *D.4817;
        D.4819 = (int) D.4818;
        D.4820 = __s2 + 2;
        D.4821 = *D.4820;
        D.4822 = (int) D.4821;
        __result = D.4819 - D.4822;
        D.4823 = __s2_len > 2;
        D.4803 = __result == 0;
        D.4824 = D.4823 & D.4803;
        if (D.4824 != 0) goto <D.4825>; else goto <D.4826>;
        <D.4825>:
        D.4827 = &MEM[(void *)"default_locale" + 3B];
        D.4828 = *D.4827;
        D.4829 = (int) D.4828;
        D.4830 = __s2 + 3;
        D.4831 = *D.4830;
        D.4832 = (int) D.4831;
        __result = D.4829 - D.4832;
        <D.4826>:
        <D.4816>:
        <D.4806>:
      }
      D.4637 = __result;
    }
    iftmp.4 = -D.4637;
    goto <D.4833>;
    <D.4793>:
    i.5 = (unsigned int) i;
    D.4795 = i.5 * 4;
    D.4796 = encodings + D.4795;
    D.4834 = *D.4796;
    iftmp.4 = __builtin_strcmp (D.4834, "default_locale");
    <D.4833>:
    D.4638 = iftmp.4;
  }
  if (D.4638 == 0) goto <D.4835>; else goto <D.4836>;
  <D.4835>:
  res = monoeg_g_locale_to_utf8 (in, -1, 0B, 0B, 0B);
  if (res != 0B) goto <D.4837>; else goto <D.4838>;
  <D.4837>:
  D.4839 = monoeg_g_utf8_validate (res, -1, 0B);
  if (D.4839 == 0) goto <D.4840>; else goto <D.4841>;
  <D.4840>:
  monoeg_g_free (res);
  res = 0B;
  <D.4841>:
  <D.4838>:
  goto <D.4842>;
  <D.4836>:
  i.5 = (unsigned int) i;
  D.4795 = i.5 * 4;
  D.4796 = encodings + D.4795;
  D.4834 = *D.4796;
  res = monoeg_g_convert (in, -1, "UTF8", D.4834, 0B, 0B, 0B);
  <D.4842>:
  if (res != 0B) goto <D.4843>; else goto <D.4844>;
  <D.4843>:
  monoeg_g_strfreev (encodings);
  D.4788 = res;
  return D.4788;
  <D.4844>:
  i = i + 1;
  <D.4640>:
  i.5 = (unsigned int) i;
  D.4795 = i.5 * 4;
  D.4796 = encodings + D.4795;
  D.4834 = *D.4796;
  if (D.4834 != 0B) goto <D.4639>; else goto <D.4641>;
  <D.4641>:
  monoeg_g_strfreev (encodings);
  D.4845 = monoeg_g_utf8_validate (in, -1, 0B);
  if (D.4845 != 0) goto <D.4846>; else goto <D.4847>;
  <D.4846>:
  D.4788 = monoeg_strdup (in);
  return D.4788;
  <D.4847>:
  D.4788 = 0B;
  return D.4788;
}


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

  if (str != 0B) goto <D.4849>; else goto <D.4850>;
  <D.4849>:
  D.4851 = __strdup (str);
  return D.4851;
  <D.4850>:
  D.4851 = 0B;
  return D.4851;
}


mono_unicode_to_external (const gunichar2 * uni)
{
  _Bool D.4853;
  long int D.4854;
  long int D.4855;
  gchar * D.4860;
  int D.4658;
  int iftmp.6;
  int D.4657;
  unsigned int i.7;
  unsigned int D.4865;
  gchar * * D.4866;
  const char[15] * D.4867;
  unsigned char D.4868;
  int D.4869;
  unsigned char D.4870;
  int D.4871;
  _Bool D.4872;
  _Bool D.4873;
  _Bool D.4874;
  const unsigned char * D.4877;
  unsigned char D.4878;
  int D.4879;
  const unsigned char * D.4880;
  unsigned char D.4881;
  int D.4882;
  _Bool D.4883;
  _Bool D.4884;
  const unsigned char * D.4887;
  unsigned char D.4888;
  int D.4889;
  const unsigned char * D.4890;
  unsigned char D.4891;
  int D.4892;
  _Bool D.4893;
  _Bool D.4894;
  const unsigned char * D.4897;
  unsigned char D.4898;
  int D.4899;
  const unsigned char * D.4900;
  unsigned char D.4901;
  int D.4902;
  gchar * D.4904;
  gchar * utf8;
  const gchar * encoding_list;

  utf8 = monoeg_g_utf16_to_utf8 (uni, -1, 0B, 0B, 0B);
  D.4853 = utf8 == 0B;
  D.4854 = (long int) D.4853;
  D.4855 = __builtin_expect (D.4854, 0);
  if (D.4855 != 0) goto <D.4856>; else goto <D.4857>;
  <D.4856>:
  monoeg_assertion_message ("* Assertion at %s:%d, condition `%s\' not met\n", "strenc.c", 183, "utf8!=NULL");
  <D.4857>:
  encoding_list = monoeg_g_getenv ("MONO_EXTERNAL_ENCODINGS");
  if (encoding_list == 0B) goto <D.4858>; else goto <D.4859>;
  <D.4858>:
  D.4860 = utf8;
  return D.4860;
  <D.4859>:
  {
    gchar * res;
    gchar * * encodings;
    int i;

    encodings = monoeg_g_strsplit (encoding_list, ":", 0);
    i = 0;
    goto <D.4660>;
    <D.4659>:
    {
      size_t __s1_len;
      size_t __s2_len;

      __s2_len = 14;
      if (__s2_len <= 3) goto <D.4862>; else goto <D.4863>;
      <D.4862>:
      {
        const unsigned char * __s2;
        int __result;

        i.7 = (unsigned int) i;
        D.4865 = i.7 * 4;
        D.4866 = encodings + D.4865;
        __s2 = *D.4866;
        D.4867 = "default_locale";
        D.4868 = MEM[(const unsigned char *)D.4867];
        D.4869 = (int) D.4868;
        D.4870 = *__s2;
        D.4871 = (int) D.4870;
        __result = D.4869 - D.4871;
        {
          D.4872 = __s2_len != 0;
          D.4873 = __result == 0;
          D.4874 = D.4872 & D.4873;
          if (D.4874 != 0) goto <D.4875>; else goto <D.4876>;
          <D.4875>:
          D.4877 = &MEM[(void *)"default_locale" + 1B];
          D.4878 = *D.4877;
          D.4879 = (int) D.4878;
          D.4880 = __s2 + 1;
          D.4881 = *D.4880;
          D.4882 = (int) D.4881;
          __result = D.4879 - D.4882;
          D.4883 = __s2_len > 1;
          D.4873 = __result == 0;
          D.4884 = D.4883 & D.4873;
          if (D.4884 != 0) goto <D.4885>; else goto <D.4886>;
          <D.4885>:
          D.4887 = &MEM[(void *)"default_locale" + 2B];
          D.4888 = *D.4887;
          D.4889 = (int) D.4888;
          D.4890 = __s2 + 2;
          D.4891 = *D.4890;
          D.4892 = (int) D.4891;
          __result = D.4889 - D.4892;
          D.4893 = __s2_len > 2;
          D.4873 = __result == 0;
          D.4894 = D.4893 & D.4873;
          if (D.4894 != 0) goto <D.4895>; else goto <D.4896>;
          <D.4895>:
          D.4897 = &MEM[(void *)"default_locale" + 3B];
          D.4898 = *D.4897;
          D.4899 = (int) D.4898;
          D.4900 = __s2 + 3;
          D.4901 = *D.4900;
          D.4902 = (int) D.4901;
          __result = D.4899 - D.4902;
          <D.4896>:
          <D.4886>:
          <D.4876>:
        }
        D.4657 = __result;
      }
      iftmp.6 = -D.4657;
      goto <D.4903>;
      <D.4863>:
      i.7 = (unsigned int) i;
      D.4865 = i.7 * 4;
      D.4866 = encodings + D.4865;
      D.4904 = *D.4866;
      iftmp.6 = __builtin_strcmp (D.4904, "default_locale");
      <D.4903>:
      D.4658 = iftmp.6;
    }
    if (D.4658 == 0) goto <D.4905>; else goto <D.4906>;
    <D.4905>:
    res = monoeg_g_locale_from_utf8 (utf8, -1, 0B, 0B, 0B);
    goto <D.4907>;
    <D.4906>:
    i.7 = (unsigned int) i;
    D.4865 = i.7 * 4;
    D.4866 = encodings + D.4865;
    D.4904 = *D.4866;
    res = monoeg_g_convert (utf8, -1, D.4904, "UTF8", 0B, 0B, 0B);
    <D.4907>:
    if (res != 0B) goto <D.4908>; else goto <D.4909>;
    <D.4908>:
    monoeg_g_free (utf8);
    monoeg_g_strfreev (encodings);
    D.4860 = res;
    return D.4860;
    <D.4909>:
    i = i + 1;
    <D.4660>:
    i.7 = (unsigned int) i;
    D.4865 = i.7 * 4;
    D.4866 = encodings + D.4865;
    D.4904 = *D.4866;
    if (D.4904 != 0B) goto <D.4659>; else goto <D.4661>;
    <D.4661>:
    monoeg_g_strfreev (encodings);
  }
  D.4860 = utf8;
  return D.4860;
}


mono_utf8_validate_and_len (const gchar * source, glong * oLength, const gchar * * oEnd)
{
  unsigned char D.4911;
  int D.4912;
  char D.4913;
  int D.4914;
  int D.4915;
  signed char a.8;
  unsigned char D.4920;
  guchar * D.4923;
  unsigned char D.4924;
  guchar * D.4929;
  unsigned char D.4930;
  _Bool D.4931;
  _Bool D.4932;
  _Bool D.4933;
  unsigned char D.4935;
  guchar * D.4949;
  unsigned char D.4950;
  unsigned char D.4951;
  unsigned char D.4956;
  unsigned char D.4965;
  _Bool D.4970;
  _Bool D.4971;
  _Bool D.4972;
  long int D.4977;
  long int D.4978;
  _Bool D.4979;
  _Bool D.4980;
  _Bool D.4981;
  gboolean D.4984;
  gboolean retVal;
  gboolean lastRet;
  guchar * ptr;
  guchar * srcPtr;
  guint length;
  guchar a;

  retVal = 1;
  lastRet = 1;
  ptr = source;
  *oLength = 0;
  goto <D.4686>;
  <D.4685>:
  D.4911 = *ptr;
  D.4912 = (int) D.4911;
  D.4913 = trailingBytesForUTF8[D.4912];
  D.4914 = (int) D.4913;
  D.4915 = D.4914 + 1;
  length = (guint) D.4915;
  srcPtr = ptr + length;
  switch (length) <default: <D.4673>, case 1: <D.4684>, case 2: <D.4676>, case 3: <D.4675>, case 4: <D.4674>>
  <D.4673>:
  retVal = 0;
  <D.4674>:
  srcPtr = srcPtr + 4294967295;
  a = *srcPtr;
  a.8 = (signed char) a;
  if (a.8 >= 0) goto <D.4916>; else goto <D.4919>;
  <D.4919>:
  if (a > 191) goto <D.4916>; else goto <D.4917>;
  <D.4916>:
  retVal = 0;
  <D.4917>:
  D.4920 = a + 66;
  if (D.4920 <= 1) goto <D.4921>; else goto <D.4922>;
  <D.4921>:
  D.4923 = srcPtr + 4294967295;
  D.4924 = *D.4923;
  if (D.4924 == 191) goto <D.4925>; else goto <D.4926>;
  <D.4925>:
  D.4929 = srcPtr + 4294967294;
  D.4930 = *D.4929;
  D.4931 = D.4930 == 143;
  D.4932 = D.4930 == 159;
  D.4933 = D.4931 | D.4932;
  if (D.4933 != 0) goto <D.4927>; else goto <D.4934>;
  <D.4934>:
  D.4929 = srcPtr + 4294967294;
  D.4935 = *D.4929;
  if (D.4935 == 175) goto <D.4927>; else goto <D.4936>;
  <D.4936>:
  D.4929 = srcPtr + 4294967294;
  D.4935 = *D.4929;
  if (D.4935 == 191) goto <D.4927>; else goto <D.4928>;
  <D.4927>:
  retVal = 0;
  <D.4928>:
  <D.4926>:
  <D.4922>:
  <D.4675>:
  srcPtr = srcPtr + 4294967295;
  a = *srcPtr;
  a.8 = (signed char) a;
  if (a.8 >= 0) goto <D.4937>; else goto <D.4939>;
  <D.4939>:
  if (a > 191) goto <D.4937>; else goto <D.4938>;
  <D.4937>:
  retVal = 0;
  <D.4938>:
  <D.4676>:
  srcPtr = srcPtr + 4294967295;
  a = *srcPtr;
  a.8 = (signed char) a;
  if (a.8 >= 0) goto <D.4940>; else goto <D.4942>;
  <D.4942>:
  if (a > 191) goto <D.4940>; else goto <D.4941>;
  <D.4940>:
  retVal = 0;
  <D.4941>:
  D.4911 = *ptr;
  D.4912 = (int) D.4911;
  switch (D.4912) <default: <D.4683>, case 224: <D.4677>, case 237: <D.4679>, case 239: <D.4680>, case 240: <D.4681>, case 244: <D.4682>>
  <D.4677>:
  if (a <= 159) goto <D.4943>; else goto <D.4944>;
  <D.4943>:
  retVal = 0;
  <D.4944>:
  goto <D.4678>;
  <D.4679>:
  if (a > 159) goto <D.4945>; else goto <D.4946>;
  <D.4945>:
  retVal = 0;
  <D.4946>:
  goto <D.4678>;
  <D.4680>:
  if (a == 183) goto <D.4947>; else goto <D.4948>;
  <D.4947>:
  D.4949 = srcPtr + 1;
  D.4950 = *D.4949;
  D.4951 = D.4950 + 112;
  if (D.4951 <= 31) goto <D.4952>; else goto <D.4953>;
  <D.4952>:
  retVal = 0;
  <D.4953>:
  <D.4948>:
  if (a == 191) goto <D.4954>; else goto <D.4955>;
  <D.4954>:
  D.4949 = srcPtr + 1;
  D.4950 = *D.4949;
  D.4956 = D.4950 + 66;
  if (D.4956 <= 1) goto <D.4957>; else goto <D.4958>;
  <D.4957>:
  retVal = 0;
  <D.4958>:
  <D.4955>:
  goto <D.4678>;
  <D.4681>:
  if (a <= 143) goto <D.4959>; else goto <D.4960>;
  <D.4959>:
  retVal = 0;
  <D.4960>:
  goto <D.4678>;
  <D.4682>:
  if (a > 143) goto <D.4961>; else goto <D.4962>;
  <D.4961>:
  retVal = 0;
  <D.4962>:
  goto <D.4678>;
  <D.4683>:
  a.8 = (signed char) a;
  if (a.8 >= 0) goto <D.4963>; else goto <D.4964>;
  <D.4963>:
  retVal = 0;
  <D.4964>:
  <D.4678>:
  <D.4684>:
  D.4911 = *ptr;
  D.4965 = D.4911 + 128;
  if (D.4965 <= 65) goto <D.4966>; else goto <D.4967>;
  <D.4966>:
  retVal = 0;
  <D.4967>:
  D.4911 = *ptr;
  if (D.4911 > 244) goto <D.4968>; else goto <D.4969>;
  <D.4968>:
  retVal = 0;
  <D.4969>:
  D.4970 = retVal == 0;
  D.4971 = lastRet != 0;
  D.4972 = D.4970 & D.4971;
  if (D.4972 != 0) goto <D.4973>; else goto <D.4974>;
  <D.4973>:
  if (oEnd != 0B) goto <D.4975>; else goto <D.4976>;
  <D.4975>:
  *oEnd = ptr;
  <D.4976>:
  lastRet = 0;
  <D.4974>:
  ptr = ptr + length;
  D.4977 = *oLength;
  D.4978 = D.4977 + 1;
  *oLength = D.4978;
  <D.4686>:
  D.4911 = *ptr;
  if (D.4911 != 0) goto <D.4685>; else goto <D.4687>;
  <D.4687>:
  D.4979 = retVal != 0;
  D.4980 = oEnd != 0B;
  D.4981 = D.4979 & D.4980;
  if (D.4981 != 0) goto <D.4982>; else goto <D.4983>;
  <D.4982>:
  *oEnd = ptr;
  <D.4983>:
  D.4984 = retVal;
  return D.4984;
}


mono_utf8_validate_and_len_with_bounds (const gchar * source, glong max_bytes, glong * oLength, const gchar * * oEnd)
{
  sizetype max_bytes.9;
  gboolean D.4991;
  unsigned char D.4992;
  int D.4993;
  char D.4994;
  int D.4995;
  int D.4996;
  signed char a.10;
  unsigned char D.5003;
  guchar * D.5006;
  unsigned char D.5007;
  guchar * D.5012;
  unsigned char D.5013;
  _Bool D.5014;
  _Bool D.5015;
  _Bool D.5016;
  unsigned char D.5018;
  guchar * D.5032;
  unsigned char D.5033;
  unsigned char D.5034;
  unsigned char D.5039;
  unsigned char D.5048;
  _Bool D.5053;
  _Bool D.5054;
  _Bool D.5055;
  long int D.5060;
  long int D.5061;
  _Bool D.5062;
  _Bool D.5063;
  _Bool D.5064;
  gboolean retVal;
  gboolean lastRet;
  guchar * ptr;
  guchar * end;
  guchar * srcPtr;
  guint length;
  guchar a;

  retVal = 1;
  lastRet = 1;
  ptr = source;
  max_bytes.9 = (sizetype) max_bytes;
  end = ptr + max_bytes.9;
  *oLength = 0;
  if (max_bytes <= 0) goto <D.4987>; else goto <D.4988>;
  <D.4987>:
  if (oEnd != 0B) goto <D.4989>; else goto <D.4990>;
  <D.4989>:
  *oEnd = ptr;
  <D.4990>:
  D.4991 = 0;
  return D.4991;
  <D.4988>:
  goto <D.4715>;
  <D.4714>:
  D.4992 = *ptr;
  D.4993 = (int) D.4992;
  D.4994 = trailingBytesForUTF8[D.4993];
  D.4995 = (int) D.4994;
  D.4996 = D.4995 + 1;
  length = (guint) D.4996;
  srcPtr = ptr + length;
  if (srcPtr >= end) goto <D.4997>; else goto <D.4998>;
  <D.4997>:
  retVal = 0;
  goto <D.4701>;
  <D.4998>:
  switch (length) <default: <D.4702>, case 1: <D.4713>, case 2: <D.4705>, case 3: <D.4704>, case 4: <D.4703>>
  <D.4702>:
  retVal = 0;
  <D.4703>:
  srcPtr = srcPtr + 4294967295;
  a = *srcPtr;
  a.10 = (signed char) a;
  if (a.10 >= 0) goto <D.4999>; else goto <D.5002>;
  <D.5002>:
  if (a > 191) goto <D.4999>; else goto <D.5000>;
  <D.4999>:
  retVal = 0;
  <D.5000>:
  D.5003 = a + 66;
  if (D.5003 <= 1) goto <D.5004>; else goto <D.5005>;
  <D.5004>:
  D.5006 = srcPtr + 4294967295;
  D.5007 = *D.5006;
  if (D.5007 == 191) goto <D.5008>; else goto <D.5009>;
  <D.5008>:
  D.5012 = srcPtr + 4294967294;
  D.5013 = *D.5012;
  D.5014 = D.5013 == 143;
  D.5015 = D.5013 == 159;
  D.5016 = D.5014 | D.5015;
  if (D.5016 != 0) goto <D.5010>; else goto <D.5017>;
  <D.5017>:
  D.5012 = srcPtr + 4294967294;
  D.5018 = *D.5012;
  if (D.5018 == 175) goto <D.5010>; else goto <D.5019>;
  <D.5019>:
  D.5012 = srcPtr + 4294967294;
  D.5018 = *D.5012;
  if (D.5018 == 191) goto <D.5010>; else goto <D.5011>;
  <D.5010>:
  retVal = 0;
  <D.5011>:
  <D.5009>:
  <D.5005>:
  <D.4704>:
  srcPtr = srcPtr + 4294967295;
  a = *srcPtr;
  a.10 = (signed char) a;
  if (a.10 >= 0) goto <D.5020>; else goto <D.5022>;
  <D.5022>:
  if (a > 191) goto <D.5020>; else goto <D.5021>;
  <D.5020>:
  retVal = 0;
  <D.5021>:
  <D.4705>:
  srcPtr = srcPtr + 4294967295;
  a = *srcPtr;
  a.10 = (signed char) a;
  if (a.10 >= 0) goto <D.5023>; else goto <D.5025>;
  <D.5025>:
  if (a > 191) goto <D.5023>; else goto <D.5024>;
  <D.5023>:
  retVal = 0;
  <D.5024>:
  D.4992 = *ptr;
  D.4993 = (int) D.4992;
  switch (D.4993) <default: <D.4712>, case 224: <D.4706>, case 237: <D.4708>, case 239: <D.4709>, case 240: <D.4710>, case 244: <D.4711>>
  <D.4706>:
  if (a <= 159) goto <D.5026>; else goto <D.5027>;
  <D.5026>:
  retVal = 0;
  <D.5027>:
  goto <D.4707>;
  <D.4708>:
  if (a > 159) goto <D.5028>; else goto <D.5029>;
  <D.5028>:
  retVal = 0;
  <D.5029>:
  goto <D.4707>;
  <D.4709>:
  if (a == 183) goto <D.5030>; else goto <D.5031>;
  <D.5030>:
  D.5032 = srcPtr + 1;
  D.5033 = *D.5032;
  D.5034 = D.5033 + 112;
  if (D.5034 <= 31) goto <D.5035>; else goto <D.5036>;
  <D.5035>:
  retVal = 0;
  <D.5036>:
  <D.5031>:
  if (a == 191) goto <D.5037>; else goto <D.5038>;
  <D.5037>:
  D.5032 = srcPtr + 1;
  D.5033 = *D.5032;
  D.5039 = D.5033 + 66;
  if (D.5039 <= 1) goto <D.5040>; else goto <D.5041>;
  <D.5040>:
  retVal = 0;
  <D.5041>:
  <D.5038>:
  goto <D.4707>;
  <D.4710>:
  if (a <= 143) goto <D.5042>; else goto <D.5043>;
  <D.5042>:
  retVal = 0;
  <D.5043>:
  goto <D.4707>;
  <D.4711>:
  if (a > 143) goto <D.5044>; else goto <D.5045>;
  <D.5044>:
  retVal = 0;
  <D.5045>:
  goto <D.4707>;
  <D.4712>:
  a.10 = (signed char) a;
  if (a.10 >= 0) goto <D.5046>; else goto <D.5047>;
  <D.5046>:
  retVal = 0;
  <D.5047>:
  <D.4707>:
  <D.4713>:
  D.4992 = *ptr;
  D.5048 = D.4992 + 128;
  if (D.5048 <= 65) goto <D.5049>; else goto <D.5050>;
  <D.5049>:
  retVal = 0;
  <D.5050>:
  D.4992 = *ptr;
  if (D.4992 > 244) goto <D.5051>; else goto <D.5052>;
  <D.5051>:
  retVal = 0;
  <D.5052>:
  D.5053 = retVal == 0;
  D.5054 = lastRet != 0;
  D.5055 = D.5053 & D.5054;
  if (D.5055 != 0) goto <D.5056>; else goto <D.5057>;
  <D.5056>:
  if (oEnd != 0B) goto <D.5058>; else goto <D.5059>;
  <D.5058>:
  *oEnd = ptr;
  <D.5059>:
  lastRet = 0;
  <D.5057>:
  ptr = ptr + length;
  D.5060 = *oLength;
  D.5061 = D.5060 + 1;
  *oLength = D.5061;
  <D.4715>:
  D.4992 = *ptr;
  if (D.4992 != 0) goto <D.4714>; else goto <D.4701>;
  <D.4701>:
  D.5062 = retVal != 0;
  D.5063 = oEnd != 0B;
  D.5064 = D.5062 & D.5063;
  if (D.5064 != 0) goto <D.5065>; else goto <D.5066>;
  <D.5065>:
  *oEnd = ptr;
  <D.5066>:
  D.4991 = retVal;
  return D.4991;
}


