
u32 sqlite3Utf8Read(uchar **pz)

{
  byte bVar1;
  u32 uVar2;
  byte *pbVar3;
  
  pbVar3 = *pz;
  *pz = pbVar3 + 1;
  uVar2 = (u32)*pbVar3;
  if (0xbf < uVar2) {
    uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0];
    if ((pbVar3[1] & 0xc0) == 0x80) {
      pbVar3 = pbVar3 + 2;
      do {
        *pz = pbVar3;
        bVar1 = *pbVar3;
        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;
        pbVar3 = pbVar3 + 1;
      } while ((bVar1 & 0xc0) == 0x80);
      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {
        return 0xfffd;
      }
    }
    else if (uVar2 < 0x80) {
      return 0xfffd;
    }
    if ((uVar2 & 0xfffffffe) == 0xfffe) {
      uVar2 = 0xfffd;
    }
  }
  return uVar2;
}



uint FUN_00020168(undefined4 *param_1)

{
  byte bVar1;
  uint uVar2;
  byte *pbVar3;
  
  pbVar3 = (byte *)*param_1;
  *param_1 = pbVar3 + 1;
  uVar2 = (uint)*pbVar3;
  if (0xbf < uVar2) {
    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];
    if ((pbVar3[1] & 0xc0) == 0x80) {
      pbVar3 = pbVar3 + 2;
      do {
        *param_1 = pbVar3;
        bVar1 = *pbVar3;
        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;
        pbVar3 = pbVar3 + 1;
      } while ((bVar1 & 0xc0) == 0x80);
      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {
        return 0xfffd;
      }
    }
    else if (uVar2 < 0x80) {
      return 0xfffd;
    }
    if ((uVar2 & 0xfffffffe) == 0xfffe) {
      uVar2 = 0xfffd;
    }
  }
  return uVar2;
}


lui gp,0xe
addiu gp,gp,-0x2ec8
addu gp,gp,t9
lw v1,0x0(a0)
addiu v0,v1,0x1
sw v0,0x0(a0)
lbu v0,0x0(v1)
sltiu a1,v0,0xc0
bne a1,zero,0x00020204
_lw a2,-0x7fcc(gp)
li a3,0x80
lbu a1,0x1(v1)
addiu a2,a2,0x22a0
andi a1,a1,0xc0
addu v0,v0,a2
bne a1,a3,0x0002020c
_lbu v0,-0xc0(v0)
addiu v1,v1,0x2
li t0,-0x40
sw v1,0x0(a0)
sll v0,v0,0x6
lbu a2,-0x1(v1)
addiu v1,v1,0x1
lbu a1,-0x1(v1)
andi a2,a2,0x3f
and a1,t0,a1
beq a1,a3,0x000201b4
_addu v0,a2,v0
sltiu v1,v0,0x80
bne v1,zero,0x00020218
_li v1,-0x800
ori a0,zero,0xd800
and v1,v0,v1
beq v1,a0,0x00020218
_li v1,-0x2
ori a0,zero,0xfffd
and v1,v0,v1
xori v1,v1,0xfffe
movz v0,a0,v1
jr ra
_nop
sltiu v1,v0,0x80
beq v1,zero,0x000201f4
_li v1,-0x2
jr ra
_ori v0,zero,0xfffd
(translation_unit "uint FUN_00020168(undefined4 *param_1)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_00020168(undefined4 *param_1)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00020168(undefined4 *param_1)" identifier (parameter_list "(undefined4 *param_1)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "byte *pbVar3;" type_identifier (pointer_declarator "*pbVar3" * identifier) ;) (expression_statement "pbVar3 = (byte *)*param_1;" (assignment_expression "pbVar3 = (byte *)*param_1" identifier = (cast_expression "(byte *)*param_1" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "*param_1 = pbVar3 + 1;" (assignment_expression "*param_1 = pbVar3 + 1" (pointer_expression "*param_1" * identifier) = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) (expression_statement "uVar2 = (uint)*pbVar3;" (assignment_expression "uVar2 = (uint)*pbVar3" identifier = (binary_expression "(uint)*pbVar3" (parenthesized_expression "(uint)" ( identifier )) * identifier)) ;) (if_statement "if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" if (parenthesized_expression "(0xbf < uVar2)" ( (binary_expression "0xbf < uVar2" number_literal < identifier) )) (compound_statement "{\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" { (expression_statement "uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];" (assignment_expression "uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" identifier = (cast_expression "(uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "PTR_DAT_000f52d4[uVar2 + 0x21e0]" identifier [ (binary_expression "uVar2 + 0x21e0" identifier + number_literal) ])))) ;) (if_statement "if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" if (parenthesized_expression "((pbVar3[1] & 0xc0) == 0x80)" ( (binary_expression "(pbVar3[1] & 0xc0) == 0x80" (parenthesized_expression "(pbVar3[1] & 0xc0)" ( (binary_expression "pbVar3[1] & 0xc0" (subscript_expression "pbVar3[1]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }" { (expression_statement "pbVar3 = pbVar3 + 2;" (assignment_expression "pbVar3 = pbVar3 + 2" identifier = (binary_expression "pbVar3 + 2" identifier + number_literal)) ;) (do_statement "do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);" do (compound_statement "{\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      }" { (expression_statement "*param_1 = pbVar3;" (assignment_expression "*param_1 = pbVar3" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "bVar1 = *pbVar3;" (assignment_expression "bVar1 = *pbVar3" identifier = (pointer_expression "*pbVar3" * identifier)) ;) (expression_statement "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;" (assignment_expression "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40" identifier = (binary_expression "(pbVar3[-1] & 0x3f) + uVar2 * 0x40" (parenthesized_expression "(pbVar3[-1] & 0x3f)" ( (binary_expression "pbVar3[-1] & 0x3f" (subscript_expression "pbVar3[-1]" identifier [ number_literal ]) & number_literal) )) + (binary_expression "uVar2 * 0x40" identifier * number_literal))) ;) (expression_statement "pbVar3 = pbVar3 + 1;" (assignment_expression "pbVar3 = pbVar3 + 1" identifier = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "((bVar1 & 0xc0) == 0x80)" ( (binary_expression "(bVar1 & 0xc0) == 0x80" (parenthesized_expression "(bVar1 & 0xc0)" ( (binary_expression "bVar1 & 0xc0" identifier & number_literal) )) == number_literal) )) ;) (if_statement "if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }" if (parenthesized_expression "((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800))" ( (binary_expression "(uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)" (parenthesized_expression "(uVar2 < 0x80)" ( (binary_expression "uVar2 < 0x80" identifier < number_literal) )) || (parenthesized_expression "((uVar2 & 0xfffff800) == 0xd800)" ( (binary_expression "(uVar2 & 0xfffff800) == 0xd800" (parenthesized_expression "(uVar2 & 0xfffff800)" ( (binary_expression "uVar2 & 0xfffff800" identifier & number_literal) )) == number_literal) ))) )) (compound_statement "{\n        return 0xfffd;\n      }" { (return_statement "return 0xfffd;" return number_literal ;) })) }) (else_clause "else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" else (if_statement "if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" if (parenthesized_expression "(uVar2 < 0x80)" ( (binary_expression "uVar2 < 0x80" identifier < number_literal) )) (compound_statement "{\n      return 0xfffd;\n    }" { (return_statement "return 0xfffd;" return number_literal ;) })))) (if_statement "if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }" if (parenthesized_expression "((uVar2 & 0xfffffffe) == 0xfffe)" ( (binary_expression "(uVar2 & 0xfffffffe) == 0xfffe" (parenthesized_expression "(uVar2 & 0xfffffffe)" ( (binary_expression "uVar2 & 0xfffffffe" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      uVar2 = 0xfffd;\n    }" { (expression_statement "uVar2 = 0xfffd;" (assignment_expression "uVar2 = 0xfffd" identifier = number_literal) ;) })) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "u32 sqlite3Utf8Read(uchar **pz)\n\n{\n  byte bVar1;\n  u32 uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = *pz;\n  *pz = pbVar3 + 1;\n  uVar2 = (u32)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}\n\n" (function_definition "u32 sqlite3Utf8Read(uchar **pz)\n\n{\n  byte bVar1;\n  u32 uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = *pz;\n  *pz = pbVar3 + 1;\n  uVar2 = (u32)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" type_identifier (function_declarator "sqlite3Utf8Read(uchar **pz)" identifier (parameter_list "(uchar **pz)" ( (parameter_declaration "uchar **pz" type_identifier (pointer_declarator "**pz" * (pointer_declarator "*pz" * identifier))) ))) (compound_statement "{\n  byte bVar1;\n  u32 uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = *pz;\n  *pz = pbVar3 + 1;\n  uVar2 = (u32)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "u32 uVar2;" type_identifier identifier ;) (declaration "byte *pbVar3;" type_identifier (pointer_declarator "*pbVar3" * identifier) ;) (expression_statement "pbVar3 = *pz;" (assignment_expression "pbVar3 = *pz" identifier = (pointer_expression "*pz" * identifier)) ;) (expression_statement "*pz = pbVar3 + 1;" (assignment_expression "*pz = pbVar3 + 1" (pointer_expression "*pz" * identifier) = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) (expression_statement "uVar2 = (u32)*pbVar3;" (assignment_expression "uVar2 = (u32)*pbVar3" identifier = (binary_expression "(u32)*pbVar3" (parenthesized_expression "(u32)" ( identifier )) * identifier)) ;) (if_statement "if (0xbf < uVar2) {\n    uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" if (parenthesized_expression "(0xbf < uVar2)" ( (binary_expression "0xbf < uVar2" number_literal < identifier) )) (compound_statement "{\n    uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" { (expression_statement "uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0];" (assignment_expression "uVar2 = (u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0]" identifier = (cast_expression "(u32)(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0]" ( (type_descriptor "u32" type_identifier) ) (cast_expression "(byte)PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "PTR_yy_shift_ofst_376__000f52d4[uVar2 + 0x21e0]" identifier [ (binary_expression "uVar2 + 0x21e0" identifier + number_literal) ])))) ;) (if_statement "if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" if (parenthesized_expression "((pbVar3[1] & 0xc0) == 0x80)" ( (binary_expression "(pbVar3[1] & 0xc0) == 0x80" (parenthesized_expression "(pbVar3[1] & 0xc0)" ( (binary_expression "pbVar3[1] & 0xc0" (subscript_expression "pbVar3[1]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n      pbVar3 = pbVar3 + 2;\n      do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }" { (expression_statement "pbVar3 = pbVar3 + 2;" (assignment_expression "pbVar3 = pbVar3 + 2" identifier = (binary_expression "pbVar3 + 2" identifier + number_literal)) ;) (do_statement "do {\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);" do (compound_statement "{\n        *pz = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      }" { (expression_statement "*pz = pbVar3;" (assignment_expression "*pz = pbVar3" (pointer_expression "*pz" * identifier) = identifier) ;) (expression_statement "bVar1 = *pbVar3;" (assignment_expression "bVar1 = *pbVar3" identifier = (pointer_expression "*pbVar3" * identifier)) ;) (expression_statement "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;" (assignment_expression "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40" identifier = (binary_expression "(pbVar3[-1] & 0x3f) + uVar2 * 0x40" (parenthesized_expression "(pbVar3[-1] & 0x3f)" ( (binary_expression "pbVar3[-1] & 0x3f" (subscript_expression "pbVar3[-1]" identifier [ number_literal ]) & number_literal) )) + (binary_expression "uVar2 * 0x40" identifier * number_literal))) ;) (expression_statement "pbVar3 = pbVar3 + 1;" (assignment_expression "pbVar3 = pbVar3 + 1" identifier = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "((bVar1 & 0xc0) == 0x80)" ( (binary_expression "(bVar1 & 0xc0) == 0x80" (parenthesized_expression "(bVar1 & 0xc0)" ( (binary_expression "bVar1 & 0xc0" identifier & number_literal) )) == number_literal) )) ;) (if_statement "if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }" if (parenthesized_expression "((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800))" ( (binary_expression "(uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)" (parenthesized_expression "(uVar2 < 0x80)" ( (binary_expression "uVar2 < 0x80" identifier < number_literal) )) || (parenthesized_expression "((uVar2 & 0xfffff800) == 0xd800)" ( (binary_expression "(uVar2 & 0xfffff800) == 0xd800" (parenthesized_expression "(uVar2 & 0xfffff800)" ( (binary_expression "uVar2 & 0xfffff800" identifier & number_literal) )) == number_literal) ))) )) (compound_statement "{\n        return 0xfffd;\n      }" { (return_statement "return 0xfffd;" return number_literal ;) })) }) (else_clause "else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" else (if_statement "if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" if (parenthesized_expression "(uVar2 < 0x80)" ( (binary_expression "uVar2 < 0x80" identifier < number_literal) )) (compound_statement "{\n      return 0xfffd;\n    }" { (return_statement "return 0xfffd;" return number_literal ;) })))) (if_statement "if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }" if (parenthesized_expression "((uVar2 & 0xfffffffe) == 0xfffe)" ( (binary_expression "(uVar2 & 0xfffffffe) == 0xfffe" (parenthesized_expression "(uVar2 & 0xfffffffe)" ( (binary_expression "uVar2 & 0xfffffffe" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      uVar2 = 0xfffd;\n    }" { (expression_statement "uVar2 = 0xfffd;" (assignment_expression "uVar2 = 0xfffd" identifier = number_literal) ;) })) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "uint FUN_00020168(undefined4 *param_1)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}\n\n" (function_definition "uint FUN_00020168(undefined4 *param_1)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00020168(undefined4 *param_1)" identifier (parameter_list "(undefined4 *param_1)" ( (parameter_declaration "undefined4 *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (declaration "byte *pbVar3;" type_identifier (pointer_declarator "*pbVar3" * identifier) ;) (expression_statement "pbVar3 = (byte *)*param_1;" (assignment_expression "pbVar3 = (byte *)*param_1" identifier = (cast_expression "(byte *)*param_1" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "*param_1 = pbVar3 + 1;" (assignment_expression "*param_1 = pbVar3 + 1" (pointer_expression "*param_1" * identifier) = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) (expression_statement "uVar2 = (uint)*pbVar3;" (assignment_expression "uVar2 = (uint)*pbVar3" identifier = (binary_expression "(uint)*pbVar3" (parenthesized_expression "(uint)" ( identifier )) * identifier)) ;) (if_statement "if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" if (parenthesized_expression "(0xbf < uVar2)" ( (binary_expression "0xbf < uVar2" number_literal < identifier) )) (compound_statement "{\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" { (expression_statement "uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];" (assignment_expression "uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" identifier = (cast_expression "(uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "PTR_DAT_000f52d4[uVar2 + 0x21e0]" identifier [ (binary_expression "uVar2 + 0x21e0" identifier + number_literal) ])))) ;) (if_statement "if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" if (parenthesized_expression "((pbVar3[1] & 0xc0) == 0x80)" ( (binary_expression "(pbVar3[1] & 0xc0) == 0x80" (parenthesized_expression "(pbVar3[1] & 0xc0)" ( (binary_expression "pbVar3[1] & 0xc0" (subscript_expression "pbVar3[1]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }" { (expression_statement "pbVar3 = pbVar3 + 2;" (assignment_expression "pbVar3 = pbVar3 + 2" identifier = (binary_expression "pbVar3 + 2" identifier + number_literal)) ;) (do_statement "do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);" do (compound_statement "{\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      }" { (expression_statement "*param_1 = pbVar3;" (assignment_expression "*param_1 = pbVar3" (pointer_expression "*param_1" * identifier) = identifier) ;) (expression_statement "bVar1 = *pbVar3;" (assignment_expression "bVar1 = *pbVar3" identifier = (pointer_expression "*pbVar3" * identifier)) ;) (expression_statement "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;" (assignment_expression "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40" identifier = (binary_expression "(pbVar3[-1] & 0x3f) + uVar2 * 0x40" (parenthesized_expression "(pbVar3[-1] & 0x3f)" ( (binary_expression "pbVar3[-1] & 0x3f" (subscript_expression "pbVar3[-1]" identifier [ number_literal ]) & number_literal) )) + (binary_expression "uVar2 * 0x40" identifier * number_literal))) ;) (expression_statement "pbVar3 = pbVar3 + 1;" (assignment_expression "pbVar3 = pbVar3 + 1" identifier = (binary_expression "pbVar3 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "((bVar1 & 0xc0) == 0x80)" ( (binary_expression "(bVar1 & 0xc0) == 0x80" (parenthesized_expression "(bVar1 & 0xc0)" ( (binary_expression "bVar1 & 0xc0" identifier & number_literal) )) == number_literal) )) ;) (if_statement "if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }" if (parenthesized_expression "((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800))" ( (binary_expression "(uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)" (parenthesized_expression "(uVar2 < 0x80)" ( (binary_expression "uVar2 < 0x80" identifier < number_literal) )) || (parenthesized_expression "((uVar2 & 0xfffff800) == 0xd800)" ( (binary_expression "(uVar2 & 0xfffff800) == 0xd800" (parenthesized_expression "(uVar2 & 0xfffff800)" ( (binary_expression "uVar2 & 0xfffff800" identifier & number_literal) )) == number_literal) ))) )) (compound_statement "{\n        return 0xfffd;\n      }" { (return_statement "return 0xfffd;" return number_literal ;) })) }) (else_clause "else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" else (if_statement "if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" if (parenthesized_expression "(uVar2 < 0x80)" ( (binary_expression "uVar2 < 0x80" identifier < number_literal) )) (compound_statement "{\n      return 0xfffd;\n    }" { (return_statement "return 0xfffd;" return number_literal ;) })))) (if_statement "if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }" if (parenthesized_expression "((uVar2 & 0xfffffffe) == 0xfffe)" ( (binary_expression "(uVar2 & 0xfffffffe) == 0xfffe" (parenthesized_expression "(uVar2 & 0xfffffffe)" ( (binary_expression "uVar2 & 0xfffffffe" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n      uVar2 = 0xfffd;\n    }" { (expression_statement "uVar2 = 0xfffd;" (assignment_expression "uVar2 = 0xfffd" identifier = number_literal) ;) })) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( IDENT )) * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ (binary_expression IDENT + LIT) ])))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) & LIT) )) + (binary_expression IDENT * LIT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT < LIT) )) || (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) ))) )) (compound_statement { (return_statement return LIT ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (return_statement return LIT ;) })))) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "uint FUN_00020168(undefined4 *param_1)\n\n{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" (type_identifier "uint") (function_declarator "FUN_00020168(undefined4 *param_1)" (identifier "FUN_00020168") (parameter_list "(undefined4 *param_1)" (( "(") (parameter_declaration "undefined4 *param_1" (type_identifier "undefined4") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  byte bVar1;\n  uint uVar2;\n  byte *pbVar3;\n  \n  pbVar3 = (byte *)*param_1;\n  *param_1 = pbVar3 + 1;\n  uVar2 = (uint)*pbVar3;\n  if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }\n  return uVar2;\n}" ({ "{") (declaration "byte bVar1;" (type_identifier "byte") (identifier "bVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (declaration "byte *pbVar3;" (type_identifier "byte") (pointer_declarator "*pbVar3" (* "*") (identifier "pbVar3")) (; ";")) (expression_statement "pbVar3 = (byte *)*param_1;" (assignment_expression "pbVar3 = (byte *)*param_1" (identifier "pbVar3") (= "=") (cast_expression "(byte *)*param_1" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "*param_1 = pbVar3 + 1;" (assignment_expression "*param_1 = pbVar3 + 1" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (binary_expression "pbVar3 + 1" (identifier "pbVar3") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "uVar2 = (uint)*pbVar3;" (assignment_expression "uVar2 = (uint)*pbVar3" (identifier "uVar2") (= "=") (binary_expression "(uint)*pbVar3" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (identifier "pbVar3"))) (; ";")) (if_statement "if (0xbf < uVar2) {\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" (if "if") (parenthesized_expression "(0xbf < uVar2)" (( "(") (binary_expression "0xbf < uVar2" (number_literal "0xbf") (< "<") (identifier "uVar2")) () ")")) (compound_statement "{\n    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];\n    if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }\n    if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }\n  }" ({ "{") (expression_statement "uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];" (assignment_expression "uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" (identifier "uVar2") (= "=") (cast_expression "(uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (cast_expression "(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0]" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (subscript_expression "PTR_DAT_000f52d4[uVar2 + 0x21e0]" (identifier "PTR_DAT_000f52d4") ([ "[") (binary_expression "uVar2 + 0x21e0" (identifier "uVar2") (+ "+") (number_literal "0x21e0")) (] "]"))))) (; ";")) (if_statement "if ((pbVar3[1] & 0xc0) == 0x80) {\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }\n    else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" (if "if") (parenthesized_expression "((pbVar3[1] & 0xc0) == 0x80)" (( "(") (binary_expression "(pbVar3[1] & 0xc0) == 0x80" (parenthesized_expression "(pbVar3[1] & 0xc0)" (( "(") (binary_expression "pbVar3[1] & 0xc0" (subscript_expression "pbVar3[1]" (identifier "pbVar3") ([ "[") (number_literal "1") (] "]")) (& "&") (number_literal "0xc0")) () ")")) (== "==") (number_literal "0x80")) () ")")) (compound_statement "{\n      pbVar3 = pbVar3 + 2;\n      do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);\n      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }\n    }" ({ "{") (expression_statement "pbVar3 = pbVar3 + 2;" (assignment_expression "pbVar3 = pbVar3 + 2" (identifier "pbVar3") (= "=") (binary_expression "pbVar3 + 2" (identifier "pbVar3") (+ "+") (number_literal "2"))) (; ";")) (do_statement "do {\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      } while ((bVar1 & 0xc0) == 0x80);" (do "do") (compound_statement "{\n        *param_1 = pbVar3;\n        bVar1 = *pbVar3;\n        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;\n        pbVar3 = pbVar3 + 1;\n      }" ({ "{") (expression_statement "*param_1 = pbVar3;" (assignment_expression "*param_1 = pbVar3" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (identifier "pbVar3")) (; ";")) (expression_statement "bVar1 = *pbVar3;" (assignment_expression "bVar1 = *pbVar3" (identifier "bVar1") (= "=") (pointer_expression "*pbVar3" (* "*") (identifier "pbVar3"))) (; ";")) (expression_statement "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;" (assignment_expression "uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40" (identifier "uVar2") (= "=") (binary_expression "(pbVar3[-1] & 0x3f) + uVar2 * 0x40" (parenthesized_expression "(pbVar3[-1] & 0x3f)" (( "(") (binary_expression "pbVar3[-1] & 0x3f" (subscript_expression "pbVar3[-1]" (identifier "pbVar3") ([ "[") (number_literal "-1") (] "]")) (& "&") (number_literal "0x3f")) () ")")) (+ "+") (binary_expression "uVar2 * 0x40" (identifier "uVar2") (* "*") (number_literal "0x40")))) (; ";")) (expression_statement "pbVar3 = pbVar3 + 1;" (assignment_expression "pbVar3 = pbVar3 + 1" (identifier "pbVar3") (= "=") (binary_expression "pbVar3 + 1" (identifier "pbVar3") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((bVar1 & 0xc0) == 0x80)" (( "(") (binary_expression "(bVar1 & 0xc0) == 0x80" (parenthesized_expression "(bVar1 & 0xc0)" (( "(") (binary_expression "bVar1 & 0xc0" (identifier "bVar1") (& "&") (number_literal "0xc0")) () ")")) (== "==") (number_literal "0x80")) () ")")) (; ";")) (if_statement "if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {\n        return 0xfffd;\n      }" (if "if") (parenthesized_expression "((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800))" (( "(") (binary_expression "(uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)" (parenthesized_expression "(uVar2 < 0x80)" (( "(") (binary_expression "uVar2 < 0x80" (identifier "uVar2") (< "<") (number_literal "0x80")) () ")")) (|| "||") (parenthesized_expression "((uVar2 & 0xfffff800) == 0xd800)" (( "(") (binary_expression "(uVar2 & 0xfffff800) == 0xd800" (parenthesized_expression "(uVar2 & 0xfffff800)" (( "(") (binary_expression "uVar2 & 0xfffff800" (identifier "uVar2") (& "&") (number_literal "0xfffff800")) () ")")) (== "==") (number_literal "0xd800")) () ")"))) () ")")) (compound_statement "{\n        return 0xfffd;\n      }" ({ "{") (return_statement "return 0xfffd;" (return "return") (number_literal "0xfffd") (; ";")) (} "}"))) (} "}")) (else_clause "else if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" (else "else") (if_statement "if (uVar2 < 0x80) {\n      return 0xfffd;\n    }" (if "if") (parenthesized_expression "(uVar2 < 0x80)" (( "(") (binary_expression "uVar2 < 0x80" (identifier "uVar2") (< "<") (number_literal "0x80")) () ")")) (compound_statement "{\n      return 0xfffd;\n    }" ({ "{") (return_statement "return 0xfffd;" (return "return") (number_literal "0xfffd") (; ";")) (} "}"))))) (if_statement "if ((uVar2 & 0xfffffffe) == 0xfffe) {\n      uVar2 = 0xfffd;\n    }" (if "if") (parenthesized_expression "((uVar2 & 0xfffffffe) == 0xfffe)" (( "(") (binary_expression "(uVar2 & 0xfffffffe) == 0xfffe" (parenthesized_expression "(uVar2 & 0xfffffffe)" (( "(") (binary_expression "uVar2 & 0xfffffffe" (identifier "uVar2") (& "&") (number_literal "0xfffffffe")) () ")")) (== "==") (number_literal "0xfffe")) () ")")) (compound_statement "{\n      uVar2 = 0xfffd;\n    }" ({ "{") (expression_statement "uVar2 = 0xfffd;" (assignment_expression "uVar2 = 0xfffd" (identifier "uVar2") (= "=") (number_literal "0xfffd")) (; ";")) (} "}"))) (} "}"))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (identifier)) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (cast_expression type: (type_descriptor type: (type_identifier)) value: (subscript_expression argument: (identifier) index: (binary_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) right: (binary_expression left: (identifier) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))))) consequence: (compound_statement (return_statement (number_literal))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))))))) (return_statement (identifier)))))

uint MASKED(undefined4 *param_1)

{
  byte bVar1;
  uint uVar2;
  byte *pbVar3;
  
  pbVar3 = (byte *)*param_1;
  *param_1 = pbVar3 + 1;
  uVar2 = (uint)*pbVar3;
  if (0xbf < uVar2) {
    uVar2 = (uint)(byte)PTR_DAT_000f52d4[uVar2 + 0x21e0];
    if ((pbVar3[1] & 0xc0) == 0x80) {
      pbVar3 = pbVar3 + 2;
      do {
        *param_1 = pbVar3;
        bVar1 = *pbVar3;
        uVar2 = (pbVar3[-1] & 0x3f) + uVar2 * 0x40;
        pbVar3 = pbVar3 + 1;
      } while ((bVar1 & 0xc0) == 0x80);
      if ((uVar2 < 0x80) || ((uVar2 & 0xfffff800) == 0xd800)) {
        return 0xfffd;
      }
    }
    else if (uVar2 < 0x80) {
      return 0xfffd;
    }
    if ((uVar2 & 0xfffffffe) == 0xfffe) {
      uVar2 = 0xfffd;
    }
  }
  return uVar2;
}

