
/* std::codecvt_base::result std::(anonymous namespace)::utf16_out<char16_t>(std::(anonymous
   namespace)::range<char16_t const, true>&, std::(anonymous namespace)::range<char, true>&,
   unsigned long, std::codecvt_mode, std::(anonymous namespace)::surrogates) [clone .part.20] */

undefined8
std::(anonymous_namespace)::utf16_out<char16_t>
          (long *param_1,range *param_2,ulong param_3,int param_4)

{
  ushort uVar1;
  char cVar2;
  ushort *puVar3;
  long lVar4;
  wchar32 wVar5;
  
  puVar3 = (ushort *)*param_1;
  lVar4 = param_1[1] - (long)puVar3;
  if (puVar3 != (ushort *)param_1[1]) {
    do {
      uVar1 = *puVar3;
      wVar5 = (wchar32)uVar1;
      if (uVar1 - 0xd800 < 0x400) {
        if (param_4 == 1) {
          return 2;
        }
        if ((ulong)(lVar4 >> 1) < 2) {
          return 0;
        }
        if (0x3ff < puVar3[1] - 0xdc00) {
          return 2;
        }
        lVar4 = 2;
        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;
      }
      else {
        if (uVar1 - 0xdc00 < 0x400) {
          return 2;
        }
        lVar4 = 1;
      }
      if (param_3 < (uint)wVar5) {
        return 2;
      }
      cVar2 = write_utf8_code_point(param_2,wVar5);
      if (cVar2 == '\0') {
        return 1;
      }
      puVar3 = (ushort *)(*param_1 + lVar4 * 2);
      lVar4 = param_1[1] - (long)puVar3;
      *param_1 = (long)puVar3;
    } while ((ushort *)param_1[1] != puVar3);
  }
  return 0;
}



undefined8 FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)

{
  ushort uVar1;
  char cVar2;
  ushort *puVar3;
  long lVar4;
  uint uVar5;
  
  puVar3 = (ushort *)*param_1;
  lVar4 = param_1[1] - (long)puVar3;
  if (puVar3 != (ushort *)param_1[1]) {
    do {
      uVar1 = *puVar3;
      uVar5 = (uint)uVar1;
      if (uVar1 - 0xd800 < 0x400) {
        if (param_4 == 1) {
          return 2;
        }
        if ((ulong)(lVar4 >> 1) < 2) {
          return 0;
        }
        if (0x3ff < puVar3[1] - 0xdc00) {
          return 2;
        }
        lVar4 = 2;
        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;
      }
      else {
        if (uVar1 - 0xdc00 < 0x400) {
          return 2;
        }
        lVar4 = 1;
      }
      if (param_3 < uVar5) {
        return 2;
      }
      cVar2 = FUN_003595c0(param_2);
      if (cVar2 == '\0') {
        return 1;
      }
      puVar3 = (ushort *)(*param_1 + lVar4 * 2);
      lVar4 = param_1[1] - (long)puVar3;
      *param_1 = (long)puVar3;
    } while ((ushort *)param_1[1] != puVar3);
  }
  return 0;
}


PUSH RBX
MOV EBX,ECX
MOV RCX,qword ptr [RDI + 0x8]
MOV R10,RDX
MOV RAX,qword ptr [RDI]
MOV RDX,RCX
SUB RDX,RAX
SAR RDX,0x1
CMP RAX,RCX
JZ 0x00359930
MOV R9,RDI
MOV R11,RSI
JMP 0x003598f4
CMP EBX,0x1
JZ 0x0035991f
CMP RDX,0x1
JBE 0x00359930
MOVZX EAX,word ptr [RAX + 0x2]
LEA EDX,[RAX + -0xdc00]
CMP EDX,0x3ff
JA 0x0035991f
SHL ESI,0xa
MOV R8D,0x2
LEA ESI,[RAX + RSI*0x1 + -0x35fdc00]
MOV EAX,ESI
CMP RAX,R10
JA 0x0035991f
MOV RDI,R11
CALL 0x003595c0
TEST AL,AL
JZ 0x00359938
MOV RAX,qword ptr [R9]
MOV RCX,qword ptr [R9 + 0x8]
LEA RAX,[RAX + R8*0x2]
MOV RDX,RCX
SUB RDX,RAX
MOV qword ptr [R9],RAX
SAR RDX,0x1
CMP RCX,RAX
JZ 0x00359930
MOVZX ESI,word ptr [RAX]
LEA ECX,[RSI + -0xd800]
CMP ECX,0x3ff
JBE 0x00359890
LEA EAX,[RSI + -0xdc00]
CMP EAX,0x3ff
JBE 0x0035991f
MOV EAX,ESI
MOV R8D,0x1
CMP RAX,R10
JBE 0x003598cc
MOV EAX,0x2
POP RBX
RET
XOR EAX,EAX
POP RBX
RET
MOV EAX,0x1
POP RBX
RET
(translation_unit "undefined8 FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)\n\n{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)\n\n{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)" identifier (parameter_list "(long *param_1,undefined8 param_2,ulong param_3,int param_4)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "int param_4" primitive_type identifier) ))) (compound_statement "{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "ushort *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "puVar3 = (ushort *)*param_1;" (assignment_expression "puVar3 = (ushort *)*param_1" identifier = (cast_expression "(ushort *)*param_1" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" identifier = (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (if_statement "if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" if (parenthesized_expression "(puVar3 != (ushort *)param_1[1])" ( (binary_expression "puVar3 != (ushort *)param_1[1]" identifier != (cast_expression "(ushort *)param_1[1]" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" { (do_statement "do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);" do (compound_statement "{\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    }" { (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "uVar5 = (uint)uVar1;" (assignment_expression "uVar5 = (uint)uVar1" identifier = (cast_expression "(uint)uVar1" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (if_statement "if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" if (parenthesized_expression "(uVar1 - 0xd800 < 0x400)" ( (binary_expression "uVar1 - 0xd800 < 0x400" (binary_expression "uVar1 - 0xd800" identifier - number_literal) < number_literal) )) (compound_statement "{\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }" { (if_statement "if (param_4 == 1) {\n          return 2;\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (if_statement "if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }" if (parenthesized_expression "((ulong)(lVar4 >> 1) < 2)" ( (binary_expression "(ulong)(lVar4 >> 1) < 2" (call_expression "(ulong)(lVar4 >> 1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(lVar4 >> 1)" ( (binary_expression "lVar4 >> 1" identifier >> number_literal) ))) < number_literal) )) (compound_statement "{\n          return 0;\n        }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }" if (parenthesized_expression "(0x3ff < puVar3[1] - 0xdc00)" ( (binary_expression "0x3ff < puVar3[1] - 0xdc00" number_literal < (binary_expression "puVar3[1] - 0xdc00" (subscript_expression "puVar3[1]" identifier [ number_literal ]) - number_literal)) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "lVar4 = 2;" (assignment_expression "lVar4 = 2" identifier = number_literal) ;) (expression_statement "uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;" (assignment_expression "uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400" identifier = (binary_expression "puVar3[1] + 0xfca02400 + uVar5 * 0x400" (binary_expression "puVar3[1] + 0xfca02400" (subscript_expression "puVar3[1]" identifier [ number_literal ]) + number_literal) + (binary_expression "uVar5 * 0x400" identifier * number_literal))) ;) }) (else_clause "else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" else (compound_statement "{\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" { (if_statement "if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }" if (parenthesized_expression "(uVar1 - 0xdc00 < 0x400)" ( (binary_expression "uVar1 - 0xdc00 < 0x400" (binary_expression "uVar1 - 0xdc00" identifier - number_literal) < number_literal) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" identifier = number_literal) ;) }))) (if_statement "if (param_3 < uVar5) {\n        return 2;\n      }" if (parenthesized_expression "(param_3 < uVar5)" ( (binary_expression "param_3 < uVar5" identifier < identifier) )) (compound_statement "{\n        return 2;\n      }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "cVar2 = FUN_003595c0(param_2);" (assignment_expression "cVar2 = FUN_003595c0(param_2)" identifier = (call_expression "FUN_003595c0(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (if_statement "if (cVar2 == '\0') {\n        return 1;\n      }" if (parenthesized_expression "(cVar2 == '\0')" ( (binary_expression "cVar2 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n        return 1;\n      }" { (return_statement "return 1;" return number_literal ;) })) (expression_statement "puVar3 = (ushort *)(*param_1 + lVar4 * 2);" (assignment_expression "puVar3 = (ushort *)(*param_1 + lVar4 * 2)" identifier = (cast_expression "(ushort *)(*param_1 + lVar4 * 2)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + lVar4 * 2)" ( (binary_expression "*param_1 + lVar4 * 2" (pointer_expression "*param_1" * identifier) + (binary_expression "lVar4 * 2" identifier * number_literal)) )))) ;) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" identifier = (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "*param_1 = (long)puVar3;" (assignment_expression "*param_1 = (long)puVar3" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) }) while (parenthesized_expression "((ushort *)param_1[1] != puVar3)" ( (binary_expression "(ushort *)param_1[1] != puVar3" (cast_expression "(ushort *)param_1[1]" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) != identifier) )) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "/* std::codecvt_base::result std::(anonymous namespace)::utf16_out<char16_t>(std::(anonymous\n   namespace)::range<char16_t const, true>&, std::(anonymous namespace)::range<char, true>&,\n   unsigned long, std::codecvt_mode, std::(anonymous namespace)::surrogates) [clone .part.20] */\n\nundefined8\nstd::(anonymous_namespace)::utf16_out<char16_t>\n          (long *param_1,range *param_2,ulong param_3,int param_4)\n\n{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  wchar32 wVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      wVar5 = (wchar32)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < (uint)wVar5) {\n        return 2;\n      }\n      cVar2 = write_utf8_code_point(param_2,wVar5);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}\n\n" comment (function_definition "undefined8\nstd::(anonymous_namespace)::utf16_out<char16_t>\n          (long *param_1,range *param_2,ulong param_3,int param_4)\n\n{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  wchar32 wVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      wVar5 = (wchar32)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < (uint)wVar5) {\n        return 2;\n      }\n      cVar2 = write_utf8_code_point(param_2,wVar5);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" type_identifier (ERROR "std::(anonymous_namespace)::" identifier : : ( identifier ) : :) (function_declarator "utf16_out<char16_t>\n          (long *param_1,range *param_2,ulong param_3,int param_4)" identifier (ERROR "<char16_t>" < primitive_type >) (parameter_list "(long *param_1,range *param_2,ulong param_3,int param_4)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "range *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "int param_4" primitive_type identifier) ))) (compound_statement "{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  wchar32 wVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      wVar5 = (wchar32)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < (uint)wVar5) {\n        return 2;\n      }\n      cVar2 = write_utf8_code_point(param_2,wVar5);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "ushort *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar32 wVar5;" type_identifier identifier ;) (expression_statement "puVar3 = (ushort *)*param_1;" (assignment_expression "puVar3 = (ushort *)*param_1" identifier = (cast_expression "(ushort *)*param_1" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" identifier = (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (if_statement "if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      wVar5 = (wchar32)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < (uint)wVar5) {\n        return 2;\n      }\n      cVar2 = write_utf8_code_point(param_2,wVar5);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" if (parenthesized_expression "(puVar3 != (ushort *)param_1[1])" ( (binary_expression "puVar3 != (ushort *)param_1[1]" identifier != (cast_expression "(ushort *)param_1[1]" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    do {\n      uVar1 = *puVar3;\n      wVar5 = (wchar32)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < (uint)wVar5) {\n        return 2;\n      }\n      cVar2 = write_utf8_code_point(param_2,wVar5);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" { (do_statement "do {\n      uVar1 = *puVar3;\n      wVar5 = (wchar32)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < (uint)wVar5) {\n        return 2;\n      }\n      cVar2 = write_utf8_code_point(param_2,wVar5);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);" do (compound_statement "{\n      uVar1 = *puVar3;\n      wVar5 = (wchar32)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < (uint)wVar5) {\n        return 2;\n      }\n      cVar2 = write_utf8_code_point(param_2,wVar5);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    }" { (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "wVar5 = (wchar32)uVar1;" (assignment_expression "wVar5 = (wchar32)uVar1" identifier = (cast_expression "(wchar32)uVar1" ( (type_descriptor "wchar32" type_identifier) ) identifier)) ;) (if_statement "if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" if (parenthesized_expression "(uVar1 - 0xd800 < 0x400)" ( (binary_expression "uVar1 - 0xd800 < 0x400" (binary_expression "uVar1 - 0xd800" identifier - number_literal) < number_literal) )) (compound_statement "{\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;\n      }" { (if_statement "if (param_4 == 1) {\n          return 2;\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (if_statement "if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }" if (parenthesized_expression "((ulong)(lVar4 >> 1) < 2)" ( (binary_expression "(ulong)(lVar4 >> 1) < 2" (call_expression "(ulong)(lVar4 >> 1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(lVar4 >> 1)" ( (binary_expression "lVar4 >> 1" identifier >> number_literal) ))) < number_literal) )) (compound_statement "{\n          return 0;\n        }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }" if (parenthesized_expression "(0x3ff < puVar3[1] - 0xdc00)" ( (binary_expression "0x3ff < puVar3[1] - 0xdc00" number_literal < (binary_expression "puVar3[1] - 0xdc00" (subscript_expression "puVar3[1]" identifier [ number_literal ]) - number_literal)) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "lVar4 = 2;" (assignment_expression "lVar4 = 2" identifier = number_literal) ;) (expression_statement "wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400;" (assignment_expression "wVar5 = puVar3[1] + 0xfca02400 + wVar5 * 0x400" identifier = (binary_expression "puVar3[1] + 0xfca02400 + wVar5 * 0x400" (binary_expression "puVar3[1] + 0xfca02400" (subscript_expression "puVar3[1]" identifier [ number_literal ]) + number_literal) + (binary_expression "wVar5 * 0x400" identifier * number_literal))) ;) }) (else_clause "else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" else (compound_statement "{\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" { (if_statement "if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }" if (parenthesized_expression "(uVar1 - 0xdc00 < 0x400)" ( (binary_expression "uVar1 - 0xdc00 < 0x400" (binary_expression "uVar1 - 0xdc00" identifier - number_literal) < number_literal) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" identifier = number_literal) ;) }))) (if_statement "if (param_3 < (uint)wVar5) {\n        return 2;\n      }" if (parenthesized_expression "(param_3 < (uint)wVar5)" ( (binary_expression "param_3 < (uint)wVar5" identifier < (cast_expression "(uint)wVar5" ( (type_descriptor "uint" type_identifier) ) identifier)) )) (compound_statement "{\n        return 2;\n      }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "cVar2 = write_utf8_code_point(param_2,wVar5);" (assignment_expression "cVar2 = write_utf8_code_point(param_2,wVar5)" identifier = (call_expression "write_utf8_code_point(param_2,wVar5)" identifier (argument_list "(param_2,wVar5)" ( identifier , identifier )))) ;) (if_statement "if (cVar2 == '\0') {\n        return 1;\n      }" if (parenthesized_expression "(cVar2 == '\0')" ( (binary_expression "cVar2 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n        return 1;\n      }" { (return_statement "return 1;" return number_literal ;) })) (expression_statement "puVar3 = (ushort *)(*param_1 + lVar4 * 2);" (assignment_expression "puVar3 = (ushort *)(*param_1 + lVar4 * 2)" identifier = (cast_expression "(ushort *)(*param_1 + lVar4 * 2)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + lVar4 * 2)" ( (binary_expression "*param_1 + lVar4 * 2" (pointer_expression "*param_1" * identifier) + (binary_expression "lVar4 * 2" identifier * number_literal)) )))) ;) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" identifier = (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "*param_1 = (long)puVar3;" (assignment_expression "*param_1 = (long)puVar3" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) }) while (parenthesized_expression "((ushort *)param_1[1] != puVar3)" ( (binary_expression "(ushort *)param_1[1] != puVar3" (cast_expression "(ushort *)param_1[1]" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) != identifier) )) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit "undefined8 FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)\n\n{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}\n\n" (function_definition "undefined8 FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)\n\n{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" type_identifier (function_declarator "FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)" identifier (parameter_list "(long *param_1,undefined8 param_2,ulong param_3,int param_4)" ( (parameter_declaration "long *param_1" (sized_type_specifier "long" long) (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) , (parameter_declaration "int param_4" primitive_type identifier) ))) (compound_statement "{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "char cVar2;" primitive_type identifier ;) (declaration "ushort *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (expression_statement "puVar3 = (ushort *)*param_1;" (assignment_expression "puVar3 = (ushort *)*param_1" identifier = (cast_expression "(ushort *)*param_1" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "*param_1" * identifier))) ;) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" identifier = (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (if_statement "if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" if (parenthesized_expression "(puVar3 != (ushort *)param_1[1])" ( (binary_expression "puVar3 != (ushort *)param_1[1]" identifier != (cast_expression "(ushort *)param_1[1]" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ]))) )) (compound_statement "{\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" { (do_statement "do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);" do (compound_statement "{\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    }" { (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" identifier = (pointer_expression "*puVar3" * identifier)) ;) (expression_statement "uVar5 = (uint)uVar1;" (assignment_expression "uVar5 = (uint)uVar1" identifier = (cast_expression "(uint)uVar1" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (if_statement "if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" if (parenthesized_expression "(uVar1 - 0xd800 < 0x400)" ( (binary_expression "uVar1 - 0xd800 < 0x400" (binary_expression "uVar1 - 0xd800" identifier - number_literal) < number_literal) )) (compound_statement "{\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }" { (if_statement "if (param_4 == 1) {\n          return 2;\n        }" if (parenthesized_expression "(param_4 == 1)" ( (binary_expression "param_4 == 1" identifier == number_literal) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (if_statement "if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }" if (parenthesized_expression "((ulong)(lVar4 >> 1) < 2)" ( (binary_expression "(ulong)(lVar4 >> 1) < 2" (call_expression "(ulong)(lVar4 >> 1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(lVar4 >> 1)" ( (binary_expression "lVar4 >> 1" identifier >> number_literal) ))) < number_literal) )) (compound_statement "{\n          return 0;\n        }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }" if (parenthesized_expression "(0x3ff < puVar3[1] - 0xdc00)" ( (binary_expression "0x3ff < puVar3[1] - 0xdc00" number_literal < (binary_expression "puVar3[1] - 0xdc00" (subscript_expression "puVar3[1]" identifier [ number_literal ]) - number_literal)) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "lVar4 = 2;" (assignment_expression "lVar4 = 2" identifier = number_literal) ;) (expression_statement "uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;" (assignment_expression "uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400" identifier = (binary_expression "puVar3[1] + 0xfca02400 + uVar5 * 0x400" (binary_expression "puVar3[1] + 0xfca02400" (subscript_expression "puVar3[1]" identifier [ number_literal ]) + number_literal) + (binary_expression "uVar5 * 0x400" identifier * number_literal))) ;) }) (else_clause "else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" else (compound_statement "{\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" { (if_statement "if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }" if (parenthesized_expression "(uVar1 - 0xdc00 < 0x400)" ( (binary_expression "uVar1 - 0xdc00 < 0x400" (binary_expression "uVar1 - 0xdc00" identifier - number_literal) < number_literal) )) (compound_statement "{\n          return 2;\n        }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" identifier = number_literal) ;) }))) (if_statement "if (param_3 < uVar5) {\n        return 2;\n      }" if (parenthesized_expression "(param_3 < uVar5)" ( (binary_expression "param_3 < uVar5" identifier < identifier) )) (compound_statement "{\n        return 2;\n      }" { (return_statement "return 2;" return number_literal ;) })) (expression_statement "cVar2 = FUN_003595c0(param_2);" (assignment_expression "cVar2 = FUN_003595c0(param_2)" identifier = (call_expression "FUN_003595c0(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (if_statement "if (cVar2 == '\0') {\n        return 1;\n      }" if (parenthesized_expression "(cVar2 == '\0')" ( (binary_expression "cVar2 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n        return 1;\n      }" { (return_statement "return 1;" return number_literal ;) })) (expression_statement "puVar3 = (ushort *)(*param_1 + lVar4 * 2);" (assignment_expression "puVar3 = (ushort *)(*param_1 + lVar4 * 2)" identifier = (cast_expression "(ushort *)(*param_1 + lVar4 * 2)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(*param_1 + lVar4 * 2)" ( (binary_expression "*param_1 + lVar4 * 2" (pointer_expression "*param_1" * identifier) + (binary_expression "lVar4 * 2" identifier * number_literal)) )))) ;) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" identifier = (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" identifier [ number_literal ]) - (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier))) ;) (expression_statement "*param_1 = (long)puVar3;" (assignment_expression "*param_1 = (long)puVar3" (pointer_expression "*param_1" * identifier) = (cast_expression "(long)puVar3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) }) while (parenthesized_expression "((ushort *)param_1[1] != puVar3)" ( (binary_expression "(ushort *)param_1[1] != puVar3" (cast_expression "(ushort *)param_1[1]" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) != identifier) )) ;) })) (return_statement "return 0;" return number_literal ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression * IDENT))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT - LIT) < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (return_statement return LIT ;) })) (if_statement if (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT >> LIT) ))) < LIT) )) (compound_statement { (return_statement return LIT ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < (binary_expression (subscript_expression IDENT [ LIT ]) - LIT)) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) + (binary_expression IDENT * LIT))) ;) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (binary_expression IDENT - LIT) < LIT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) + (binary_expression IDENT * LIT)) )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) }) while (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ])) != IDENT) )) ;) })) (return_statement return LIT ;) })))
(function_definition "undefined8 FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)\n\n{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" (type_identifier "undefined8") (function_declarator "FUN_00359860(long *param_1,undefined8 param_2,ulong param_3,int param_4)" (identifier "FUN_00359860") (parameter_list "(long *param_1,undefined8 param_2,ulong param_3,int param_4)" (( "(") (parameter_declaration "long *param_1" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) (, ",") (parameter_declaration "int param_4" (primitive_type "int") (identifier "param_4")) () ")"))) (compound_statement "{\n  ushort uVar1;\n  char cVar2;\n  ushort *puVar3;\n  long lVar4;\n  uint uVar5;\n  \n  puVar3 = (ushort *)*param_1;\n  lVar4 = param_1[1] - (long)puVar3;\n  if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }\n  return 0;\n}" ({ "{") (declaration "ushort uVar1;" (type_identifier "ushort") (identifier "uVar1") (; ";")) (declaration "char cVar2;" (primitive_type "char") (identifier "cVar2") (; ";")) (declaration "ushort *puVar3;" (type_identifier "ushort") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (declaration "uint uVar5;" (type_identifier "uint") (identifier "uVar5") (; ";")) (expression_statement "puVar3 = (ushort *)*param_1;" (assignment_expression "puVar3 = (ushort *)*param_1" (identifier "puVar3") (= "=") (cast_expression "(ushort *)*param_1" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "*param_1" (* "*") (identifier "param_1")))) (; ";")) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" (identifier "lVar4") (= "=") (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (cast_expression "(long)puVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar3")))) (; ";")) (if_statement "if (puVar3 != (ushort *)param_1[1]) {\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" (if "if") (parenthesized_expression "(puVar3 != (ushort *)param_1[1])" (( "(") (binary_expression "puVar3 != (ushort *)param_1[1]" (identifier "puVar3") (!= "!=") (cast_expression "(ushort *)param_1[1]" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")))) () ")")) (compound_statement "{\n    do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);\n  }" ({ "{") (do_statement "do {\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    } while ((ushort *)param_1[1] != puVar3);" (do "do") (compound_statement "{\n      uVar1 = *puVar3;\n      uVar5 = (uint)uVar1;\n      if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }\n      if (param_3 < uVar5) {\n        return 2;\n      }\n      cVar2 = FUN_003595c0(param_2);\n      if (cVar2 == '\0') {\n        return 1;\n      }\n      puVar3 = (ushort *)(*param_1 + lVar4 * 2);\n      lVar4 = param_1[1] - (long)puVar3;\n      *param_1 = (long)puVar3;\n    }" ({ "{") (expression_statement "uVar1 = *puVar3;" (assignment_expression "uVar1 = *puVar3" (identifier "uVar1") (= "=") (pointer_expression "*puVar3" (* "*") (identifier "puVar3"))) (; ";")) (expression_statement "uVar5 = (uint)uVar1;" (assignment_expression "uVar5 = (uint)uVar1" (identifier "uVar5") (= "=") (cast_expression "(uint)uVar1" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "uVar1"))) (; ";")) (if_statement "if (uVar1 - 0xd800 < 0x400) {\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }\n      else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" (if "if") (parenthesized_expression "(uVar1 - 0xd800 < 0x400)" (( "(") (binary_expression "uVar1 - 0xd800 < 0x400" (binary_expression "uVar1 - 0xd800" (identifier "uVar1") (- "-") (number_literal "0xd800")) (< "<") (number_literal "0x400")) () ")")) (compound_statement "{\n        if (param_4 == 1) {\n          return 2;\n        }\n        if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }\n        if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }\n        lVar4 = 2;\n        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;\n      }" ({ "{") (if_statement "if (param_4 == 1) {\n          return 2;\n        }" (if "if") (parenthesized_expression "(param_4 == 1)" (( "(") (binary_expression "param_4 == 1" (identifier "param_4") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n          return 2;\n        }" ({ "{") (return_statement "return 2;" (return "return") (number_literal "2") (; ";")) (} "}"))) (if_statement "if ((ulong)(lVar4 >> 1) < 2) {\n          return 0;\n        }" (if "if") (parenthesized_expression "((ulong)(lVar4 >> 1) < 2)" (( "(") (binary_expression "(ulong)(lVar4 >> 1) < 2" (call_expression "(ulong)(lVar4 >> 1)" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (argument_list "(lVar4 >> 1)" (( "(") (binary_expression "lVar4 >> 1" (identifier "lVar4") (>> ">>") (number_literal "1")) () ")"))) (< "<") (number_literal "2")) () ")")) (compound_statement "{\n          return 0;\n        }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (if_statement "if (0x3ff < puVar3[1] - 0xdc00) {\n          return 2;\n        }" (if "if") (parenthesized_expression "(0x3ff < puVar3[1] - 0xdc00)" (( "(") (binary_expression "0x3ff < puVar3[1] - 0xdc00" (number_literal "0x3ff") (< "<") (binary_expression "puVar3[1] - 0xdc00" (subscript_expression "puVar3[1]" (identifier "puVar3") ([ "[") (number_literal "1") (] "]")) (- "-") (number_literal "0xdc00"))) () ")")) (compound_statement "{\n          return 2;\n        }" ({ "{") (return_statement "return 2;" (return "return") (number_literal "2") (; ";")) (} "}"))) (expression_statement "lVar4 = 2;" (assignment_expression "lVar4 = 2" (identifier "lVar4") (= "=") (number_literal "2")) (; ";")) (expression_statement "uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;" (assignment_expression "uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400" (identifier "uVar5") (= "=") (binary_expression "puVar3[1] + 0xfca02400 + uVar5 * 0x400" (binary_expression "puVar3[1] + 0xfca02400" (subscript_expression "puVar3[1]" (identifier "puVar3") ([ "[") (number_literal "1") (] "]")) (+ "+") (number_literal "0xfca02400")) (+ "+") (binary_expression "uVar5 * 0x400" (identifier "uVar5") (* "*") (number_literal "0x400")))) (; ";")) (} "}")) (else_clause "else {\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" (else "else") (compound_statement "{\n        if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }\n        lVar4 = 1;\n      }" ({ "{") (if_statement "if (uVar1 - 0xdc00 < 0x400) {\n          return 2;\n        }" (if "if") (parenthesized_expression "(uVar1 - 0xdc00 < 0x400)" (( "(") (binary_expression "uVar1 - 0xdc00 < 0x400" (binary_expression "uVar1 - 0xdc00" (identifier "uVar1") (- "-") (number_literal "0xdc00")) (< "<") (number_literal "0x400")) () ")")) (compound_statement "{\n          return 2;\n        }" ({ "{") (return_statement "return 2;" (return "return") (number_literal "2") (; ";")) (} "}"))) (expression_statement "lVar4 = 1;" (assignment_expression "lVar4 = 1" (identifier "lVar4") (= "=") (number_literal "1")) (; ";")) (} "}")))) (if_statement "if (param_3 < uVar5) {\n        return 2;\n      }" (if "if") (parenthesized_expression "(param_3 < uVar5)" (( "(") (binary_expression "param_3 < uVar5" (identifier "param_3") (< "<") (identifier "uVar5")) () ")")) (compound_statement "{\n        return 2;\n      }" ({ "{") (return_statement "return 2;" (return "return") (number_literal "2") (; ";")) (} "}"))) (expression_statement "cVar2 = FUN_003595c0(param_2);" (assignment_expression "cVar2 = FUN_003595c0(param_2)" (identifier "cVar2") (= "=") (call_expression "FUN_003595c0(param_2)" (identifier "FUN_003595c0") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (cVar2 == '\0') {\n        return 1;\n      }" (if "if") (parenthesized_expression "(cVar2 == '\0')" (( "(") (binary_expression "cVar2 == '\0'" (identifier "cVar2") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n        return 1;\n      }" ({ "{") (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (expression_statement "puVar3 = (ushort *)(*param_1 + lVar4 * 2);" (assignment_expression "puVar3 = (ushort *)(*param_1 + lVar4 * 2)" (identifier "puVar3") (= "=") (cast_expression "(ushort *)(*param_1 + lVar4 * 2)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(*param_1 + lVar4 * 2)" (( "(") (binary_expression "*param_1 + lVar4 * 2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (+ "+") (binary_expression "lVar4 * 2" (identifier "lVar4") (* "*") (number_literal "2"))) () ")")))) (; ";")) (expression_statement "lVar4 = param_1[1] - (long)puVar3;" (assignment_expression "lVar4 = param_1[1] - (long)puVar3" (identifier "lVar4") (= "=") (binary_expression "param_1[1] - (long)puVar3" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (cast_expression "(long)puVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar3")))) (; ";")) (expression_statement "*param_1 = (long)puVar3;" (assignment_expression "*param_1 = (long)puVar3" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (cast_expression "(long)puVar3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "puVar3"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((ushort *)param_1[1] != puVar3)" (( "(") (binary_expression "(ushort *)param_1[1] != puVar3" (cast_expression "(ushort *)param_1[1]" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (!= "!=") (identifier "puVar3")) () ")")) (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}")))

/* std::codecvt_base::result std::(anonymous namespace)::utf16_out<char16_t>(std::(anonymous
   namespace)::range<char16_t const, true>&, std::(anonymous namespace)::range<char, true>&,
   unsigned long, std::codecvt_mode, std::(anonymous namespace)::surrogates) [clone .part.20] */

type_1
std::(anonymous_namespace)::function_1<char16_t>
          (long *param_1,type_2 *param_2,type_3 var_6,int var_3)

{
  type_4 var_2;
  char var_8;
  type_4 *var_1;
  long var_4;
  type_5 var_5;
  
  var_1 = (type_4 *)*param_1;
  var_4 = param_1[1] - (long)var_1;
  if (var_1 != (type_4 *)param_1[1]) {
    do {
      var_2 = *var_1;
      var_5 = (type_5)var_2;
      if (var_2 - 0xd800 < 0x400) {
        if (var_3 == 1) {
          return 2;
        }
        if ((type_3)(var_4 >> 1) < 2) {
          return 0;
        }
        if (0x3ff < var_1[1] - 0xdc00) {
          return 2;
        }
        var_4 = 2;
        var_5 = var_1[1] + 0xfca02400 + var_5 * 0x400;
      }
      else {
        if (var_2 - 0xdc00 < 0x400) {
          return 2;
        }
        var_4 = 1;
      }
      if (var_6 < (type_6)var_5) {
        return 2;
      }
      var_8 = var_7(param_2,var_5);
      if (var_8 == '\0') {
        return 1;
      }
      var_1 = (type_4 *)(*param_1 + var_4 * 2);
      var_4 = param_1[1] - (long)var_1;
      *param_1 = (long)var_1;
    } while ((type_4 *)param_1[1] != var_1);
  }
  return 0;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) 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: (identifier) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))))) consequence: (compound_statement (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (number_literal))) consequence: (compound_statement (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: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)))) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (number_literal))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (return_statement (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))) condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (subscript_expression argument: (identifier) index: (number_literal))) right: (identifier)))))) (return_statement (number_literal)))))

undefined8 MASKED(long *param_1,undefined8 param_2,ulong param_3,int param_4)

{
  ushort uVar1;
  char cVar2;
  ushort *puVar3;
  long lVar4;
  uint uVar5;
  
  puVar3 = (ushort *)*param_1;
  lVar4 = param_1[1] - (long)puVar3;
  if (puVar3 != (ushort *)param_1[1]) {
    do {
      uVar1 = *puVar3;
      uVar5 = (uint)uVar1;
      if (uVar1 - 0xd800 < 0x400) {
        if (param_4 == 1) {
          return 2;
        }
        if ((ulong)(lVar4 >> 1) < 2) {
          return 0;
        }
        if (0x3ff < puVar3[1] - 0xdc00) {
          return 2;
        }
        lVar4 = 2;
        uVar5 = puVar3[1] + 0xfca02400 + uVar5 * 0x400;
      }
      else {
        if (uVar1 - 0xdc00 < 0x400) {
          return 2;
        }
        lVar4 = 1;
      }
      if (param_3 < uVar5) {
        return 2;
      }
      cVar2 = FUN_003595c0(param_2);
      if (cVar2 == '\0') {
        return 1;
      }
      puVar3 = (ushort *)(*param_1 + lVar4 * 2);
      lVar4 = param_1[1] - (long)puVar3;
      *param_1 = (long)puVar3;
    } while ((ushort *)param_1[1] != puVar3);
  }
  return 0;
}

