
/* std::__codecvt_utf16_base<char16_t>::do_out(__mbstate_t&, char16_t const*, char16_t const*,
   char16_t const*&, char*, char*, char*&) const */

undefined8 __thiscall
std::__codecvt_utf16_base<char16_t>::do_out
          (__codecvt_utf16_base<char16_t> *this,__mbstate_t *param_1,wchar16 *param_2,
          wchar16 *param_3,wchar16 **param_4,char *param_5,char *param_6,char **param_7)

{
  bool bVar1;
  wchar16 wVar2;
  undefined8 uVar3;
  uint uVar4;
  wchar16 *local_28;
  char *local_20;
  
  uVar3 = *(undefined8 *)(this + 0x10);
  uVar4 = *(uint *)(this + 0x18);
  local_20 = param_6;
  local_28 = (wchar16 *)param_5;
  bVar1 = (anonymous_namespace)::write_utf16_bom<false>(&local_28,uVar4);
  if (bVar1) {
    if (param_2 == param_3) {
LAB_003597ec:
      uVar3 = 0;
      goto LAB_003597f5;
    }
    if (1 < (ulong)((long)local_20 - (long)local_28)) {
      wVar2 = *param_2;
      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {
        do {
          param_2 = param_2 + 1;
          if ((uVar4 & 1) == 0) {
            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;
          }
          *local_28 = wVar2;
          local_28 = local_28 + 1;
          if (param_3 == param_2) goto LAB_003597ec;
          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;
          wVar2 = *param_2;
        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));
      }
      uVar3 = 2;
      goto LAB_003597f5;
    }
  }
LAB_003597f0:
  uVar3 = 1;
LAB_003597f5:
  *param_4 = param_2;
  *param_7 = (char *)local_28;
  return uVar3;
}



undefined8
FUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,
            ushort *param_6,long param_7,long *param_8)

{
  char cVar1;
  ushort uVar2;
  undefined8 uVar3;
  uint uVar4;
  uint uVar5;
  ushort *local_28;
  long local_20;
  
  uVar3 = *(undefined8 *)(param_1 + 0x10);
  uVar5 = *(uint *)(param_1 + 0x18);
  local_20 = param_7;
  local_28 = param_6;
  cVar1 = FUN_003596d0(&local_28,uVar5);
  if (cVar1 != '\0') {
    if (param_3 == param_4) {
LAB_003597ec:
      uVar3 = 0;
      goto LAB_003597f5;
    }
    if (1 < (ulong)(local_20 - (long)local_28)) {
      uVar2 = *param_3;
      uVar4 = (uint)uVar3;
      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {
        do {
          param_3 = param_3 + 1;
          if ((uVar5 & 1) == 0) {
            uVar2 = uVar2 << 8 | uVar2 >> 8;
          }
          *local_28 = uVar2;
          local_28 = local_28 + 1;
          if (param_4 == param_3) goto LAB_003597ec;
          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;
          uVar2 = *param_3;
        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));
      }
      uVar3 = 2;
      goto LAB_003597f5;
    }
  }
LAB_003597f0:
  uVar3 = 1;
LAB_003597f5:
  *param_5 = param_3;
  *param_8 = (long)local_28;
  return uVar3;
}


PUSH RBP
MOV R10,RDX
MOV R11,RCX
PUSH RBX
SUB RSP,0x18
MOV RBX,qword ptr [RDI + 0x10]
MOV qword ptr [RSP],R9
MOV R9D,dword ptr [RDI + 0x18]
MOV RDI,RSP
MOV RAX,qword ptr [RSP + 0x30]
MOV ESI,R9D
MOV qword ptr [RSP + 0x8],RAX
CALL 0x003596d0
MOV RDI,qword ptr [RSP]
TEST AL,AL
JZ 0x003597f0
CMP R10,R11
JZ 0x003597ec
MOV RAX,qword ptr [RSP + 0x8]
SUB RAX,RDI
CMP RAX,0x1
JBE 0x003597f0
MOVZX EDX,word ptr [R10]
MOV EBP,EBX
LEA ECX,[RDX + -0xd800]
MOV EAX,EDX
CMP ECX,0x3ff
JBE 0x00359810
CMP EDX,EBX
JA 0x00359810
AND R9D,0x1
LEA RDX,[R10 + 0x2]
JMP 0x003597c9
MOV RAX,qword ptr [RSP + 0x8]
SUB RAX,RDI
CMP RAX,0x1
JBE 0x003597f0
MOVZX ESI,word ptr [RDX]
ADD RDX,0x2
LEA ECX,[RSI + -0xd800]
MOV EAX,ESI
CMP ECX,0x3ff
JBE 0x00359810
CMP EBP,ESI
JC 0x00359810
MOV ECX,EAX
MOV R10,RDX
ROL CX,0x8
TEST R9D,R9D
CMOVZ EAX,ECX
MOV word ptr [RDI],AX
MOV RAX,qword ptr [RSP]
LEA RDI,[RAX + 0x2]
MOV qword ptr [RSP],RDI
CMP R11,RDX
JNZ 0x003597a0
XOR EAX,EAX
JMP 0x003597f5
MOV EAX,0x1
MOV RDX,qword ptr [RSP + 0x38]
MOV qword ptr [R8],R10
MOV qword ptr [RDX],RDI
ADD RSP,0x18
POP RBX
POP RBP
RET
MOV EAX,0x2
JMP 0x003597f5
(translation_unit "undefined8\nFUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)\n\n{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}\n\n" (function_definition "undefined8\nFUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)\n\n{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)" identifier (parameter_list "(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "ushort *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "ushort *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "undefined8 *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) , (parameter_declaration "ushort *param_6" type_identifier (pointer_declarator "*param_6" * identifier)) , (parameter_declaration "long param_7" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long *param_8" (sized_type_specifier "long" long) (pointer_declarator "*param_8" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "ushort uVar2;" type_identifier identifier ;) (declaration "undefined8 uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "ushort *local_28;" type_identifier (pointer_declarator "*local_28" * identifier) ;) (declaration "long local_20;" (sized_type_specifier "long" long) identifier ;) (expression_statement "uVar3 = *(undefined8 *)(param_1 + 0x10);" (assignment_expression "uVar3 = *(undefined8 *)(param_1 + 0x10)" identifier = (pointer_expression "*(undefined8 *)(param_1 + 0x10)" * (cast_expression "(undefined8 *)(param_1 + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar5 = *(uint *)(param_1 + 0x18);" (assignment_expression "uVar5 = *(uint *)(param_1 + 0x18)" identifier = (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) ;) (expression_statement "local_20 = param_7;" (assignment_expression "local_20 = param_7" identifier = identifier) ;) (expression_statement "local_28 = param_6;" (assignment_expression "local_28 = param_6" identifier = identifier) ;) (expression_statement "cVar1 = FUN_003596d0(&local_28,uVar5);" (assignment_expression "cVar1 = FUN_003596d0(&local_28,uVar5)" identifier = (call_expression "FUN_003596d0(&local_28,uVar5)" identifier (argument_list "(&local_28,uVar5)" ( (pointer_expression "&local_28" & identifier) , identifier )))) ;) (if_statement "if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" if (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" { (if_statement "if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" if (parenthesized_expression "(param_3 == param_4)" ( (binary_expression "param_3 == param_4" identifier == identifier) )) (compound_statement "{\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" { (labeled_statement "LAB_003597ec:\n      uVar3 = 0;" statement_identifier : (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;)) (goto_statement "goto LAB_003597f5;" goto statement_identifier ;) })) (if_statement "if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" if (parenthesized_expression "(1 < (ulong)(local_20 - (long)local_28))" ( (binary_expression "1 < (ulong)(local_20 - (long)local_28)" number_literal < (call_expression "(ulong)(local_20 - (long)local_28)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(local_20 - (long)local_28)" ( (binary_expression "local_20 - (long)local_28" identifier - (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) )) (compound_statement "{\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" { (expression_statement "uVar2 = *param_3;" (assignment_expression "uVar2 = *param_3" identifier = (pointer_expression "*param_3" * identifier)) ;) (expression_statement "uVar4 = (uint)uVar3;" (assignment_expression "uVar4 = (uint)uVar3" identifier = (cast_expression "(uint)uVar3" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (if_statement "if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }" if (parenthesized_expression "((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4))" ( (binary_expression "(0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)" (parenthesized_expression "(0x3ff < uVar2 - 0xd800)" ( (binary_expression "0x3ff < uVar2 - 0xd800" number_literal < (binary_expression "uVar2 - 0xd800" identifier - number_literal)) )) && (parenthesized_expression "(uVar2 <= uVar4)" ( (binary_expression "uVar2 <= uVar4" identifier <= identifier) ))) )) (compound_statement "{\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }" { (do_statement "do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));" do (compound_statement "{\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        }" { (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" identifier = (binary_expression "param_3 + 1" identifier + number_literal)) ;) (if_statement "if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }" if (parenthesized_expression "((uVar5 & 1) == 0)" ( (binary_expression "(uVar5 & 1) == 0" (parenthesized_expression "(uVar5 & 1)" ( (binary_expression "uVar5 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }" { (expression_statement "uVar2 = uVar2 << 8 | uVar2 >> 8;" (assignment_expression "uVar2 = uVar2 << 8 | uVar2 >> 8" identifier = (binary_expression "uVar2 << 8 | uVar2 >> 8" (binary_expression "uVar2 << 8" identifier << number_literal) | (binary_expression "uVar2 >> 8" identifier >> number_literal))) ;) })) (expression_statement "*local_28 = uVar2;" (assignment_expression "*local_28 = uVar2" (pointer_expression "*local_28" * identifier) = identifier) ;) (expression_statement "local_28 = local_28 + 1;" (assignment_expression "local_28 = local_28 + 1" identifier = (binary_expression "local_28 + 1" identifier + number_literal)) ;) (if_statement "if (param_4 == param_3) goto LAB_003597ec;" if (parenthesized_expression "(param_4 == param_3)" ( (binary_expression "param_4 == param_3" identifier == identifier) )) (goto_statement "goto LAB_003597ec;" goto statement_identifier ;)) (if_statement "if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;" if (parenthesized_expression "((ulong)(local_20 - (long)local_28) < 2)" ( (binary_expression "(ulong)(local_20 - (long)local_28) < 2" (call_expression "(ulong)(local_20 - (long)local_28)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(local_20 - (long)local_28)" ( (binary_expression "local_20 - (long)local_28" identifier - (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) < number_literal) )) (goto_statement "goto LAB_003597f0;" goto statement_identifier ;)) (expression_statement "uVar2 = *param_3;" (assignment_expression "uVar2 = *param_3" identifier = (pointer_expression "*param_3" * identifier)) ;) }) while (parenthesized_expression "((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4))" ( (binary_expression "(0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)" (parenthesized_expression "(0x3ff < uVar2 - 0xd800)" ( (binary_expression "0x3ff < uVar2 - 0xd800" number_literal < (binary_expression "uVar2 - 0xd800" identifier - number_literal)) )) && (parenthesized_expression "(uVar2 <= uVar4)" ( (binary_expression "uVar2 <= uVar4" identifier <= identifier) ))) )) ;) })) (expression_statement "uVar3 = 2;" (assignment_expression "uVar3 = 2" identifier = number_literal) ;) (goto_statement "goto LAB_003597f5;" goto statement_identifier ;) })) })) (labeled_statement "LAB_003597f0:\n  uVar3 = 1;" statement_identifier : (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;)) (labeled_statement "LAB_003597f5:\n  *param_5 = param_3;" statement_identifier : (expression_statement "*param_5 = param_3;" (assignment_expression "*param_5 = param_3" (pointer_expression "*param_5" * identifier) = identifier) ;)) (expression_statement "*param_8 = (long)local_28;" (assignment_expression "*param_8 = (long)local_28" (pointer_expression "*param_8" * identifier) = (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "/* std::__codecvt_utf16_base<char16_t>::do_out(__mbstate_t&, char16_t const*, char16_t const*,\n   char16_t const*&, char*, char*, char*&) const */\n\nundefined8 __thiscall\nstd::__codecvt_utf16_base<char16_t>::do_out\n          (__codecvt_utf16_base<char16_t> *this,__mbstate_t *param_1,wchar16 *param_2,\n          wchar16 *param_3,wchar16 **param_4,char *param_5,char *param_6,char **param_7)\n\n{\n  bool bVar1;\n  wchar16 wVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  wchar16 *local_28;\n  char *local_20;\n  \n  uVar3 = *(undefined8 *)(this + 0x10);\n  uVar4 = *(uint *)(this + 0x18);\n  local_20 = param_6;\n  local_28 = (wchar16 *)param_5;\n  bVar1 = (anonymous_namespace)::write_utf16_bom<false>(&local_28,uVar4);\n  if (bVar1) {\n    if (param_2 == param_3) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)((long)local_20 - (long)local_28)) {\n      wVar2 = *param_2;\n      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_4 = param_2;\n  *param_7 = (char *)local_28;\n  return uVar3;\n}\n\n" comment (function_definition "undefined8 __thiscall\nstd::__codecvt_utf16_base<char16_t>::do_out\n          (__codecvt_utf16_base<char16_t> *this,__mbstate_t *param_1,wchar16 *param_2,\n          wchar16 *param_3,wchar16 **param_4,char *param_5,char *param_6,char **param_7)\n\n{\n  bool bVar1;\n  wchar16 wVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  wchar16 *local_28;\n  char *local_20;\n  \n  uVar3 = *(undefined8 *)(this + 0x10);\n  uVar4 = *(uint *)(this + 0x18);\n  local_20 = param_6;\n  local_28 = (wchar16 *)param_5;\n  bVar1 = (anonymous_namespace)::write_utf16_bom<false>(&local_28,uVar4);\n  if (bVar1) {\n    if (param_2 == param_3) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)((long)local_20 - (long)local_28)) {\n      wVar2 = *param_2;\n      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_4 = param_2;\n  *param_7 = (char *)local_28;\n  return uVar3;\n}" type_identifier (ms_call_modifier "__thiscall" __thiscall) (ERROR "std::__codecvt_utf16_base<char16_t>::" identifier : : identifier < primitive_type > : :) (function_declarator "do_out\n          (__codecvt_utf16_base<char16_t> *this,__mbstate_t *param_1,wchar16 *param_2,\n          wchar16 *param_3,wchar16 **param_4,char *param_5,char *param_6,char **param_7)" identifier (parameter_list "(__codecvt_utf16_base<char16_t> *this,__mbstate_t *param_1,wchar16 *param_2,\n          wchar16 *param_3,wchar16 **param_4,char *param_5,char *param_6,char **param_7)" ( (parameter_declaration "__codecvt_utf16_base<char16_t> *this" type_identifier (ERROR "<char16_t>" < primitive_type >) (pointer_declarator "*this" * identifier)) , (parameter_declaration "__mbstate_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "wchar16 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "wchar16 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "wchar16 **param_4" type_identifier (pointer_declarator "**param_4" * (pointer_declarator "*param_4" * identifier))) , (parameter_declaration "char *param_5" primitive_type (pointer_declarator "*param_5" * identifier)) , (parameter_declaration "char *param_6" primitive_type (pointer_declarator "*param_6" * identifier)) , (parameter_declaration "char **param_7" primitive_type (pointer_declarator "**param_7" * (pointer_declarator "*param_7" * identifier))) ))) (compound_statement "{\n  bool bVar1;\n  wchar16 wVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  wchar16 *local_28;\n  char *local_20;\n  \n  uVar3 = *(undefined8 *)(this + 0x10);\n  uVar4 = *(uint *)(this + 0x18);\n  local_20 = param_6;\n  local_28 = (wchar16 *)param_5;\n  bVar1 = (anonymous_namespace)::write_utf16_bom<false>(&local_28,uVar4);\n  if (bVar1) {\n    if (param_2 == param_3) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)((long)local_20 - (long)local_28)) {\n      wVar2 = *param_2;\n      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_4 = param_2;\n  *param_7 = (char *)local_28;\n  return uVar3;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "wchar16 wVar2;" type_identifier identifier ;) (declaration "undefined8 uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "wchar16 *local_28;" type_identifier (pointer_declarator "*local_28" * identifier) ;) (declaration "char *local_20;" primitive_type (pointer_declarator "*local_20" * identifier) ;) (expression_statement "uVar3 = *(undefined8 *)(this + 0x10);" (assignment_expression "uVar3 = *(undefined8 *)(this + 0x10)" identifier = (pointer_expression "*(undefined8 *)(this + 0x10)" * (cast_expression "(undefined8 *)(this + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar4 = *(uint *)(this + 0x18);" (assignment_expression "uVar4 = *(uint *)(this + 0x18)" identifier = (pointer_expression "*(uint *)(this + 0x18)" * (cast_expression "(uint *)(this + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x18)" ( (binary_expression "this + 0x18" identifier + number_literal) ))))) ;) (expression_statement "local_20 = param_6;" (assignment_expression "local_20 = param_6" identifier = identifier) ;) (expression_statement "local_28 = (wchar16 *)param_5;" (assignment_expression "local_28 = (wchar16 *)param_5" identifier = (cast_expression "(wchar16 *)param_5" ( (type_descriptor "wchar16 *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) (expression_statement "bVar1 = (anonymous_namespace)::write_utf16_bom<false>(&local_28,uVar4);" (binary_expression "bVar1 = (anonymous_namespace)::write_utf16_bom<false>(&local_28,uVar4)" (binary_expression "bVar1 = (anonymous_namespace)::write_utf16_bom<false" (assignment_expression "bVar1 = (anonymous_namespace)" identifier = (parenthesized_expression "(anonymous_namespace)" ( identifier ))) (ERROR "::write_utf16_bom" : : identifier) < false) > (parenthesized_expression "(&local_28,uVar4)" ( (comma_expression "&local_28,uVar4" (pointer_expression "&local_28" & identifier) , identifier) ))) ;) (if_statement "if (bVar1) {\n    if (param_2 == param_3) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)((long)local_20 - (long)local_28)) {\n      wVar2 = *param_2;\n      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n    if (param_2 == param_3) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)((long)local_20 - (long)local_28)) {\n      wVar2 = *param_2;\n      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" { (if_statement "if (param_2 == param_3) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" if (parenthesized_expression "(param_2 == param_3)" ( (binary_expression "param_2 == param_3" identifier == identifier) )) (compound_statement "{\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" { (labeled_statement "LAB_003597ec:\n      uVar3 = 0;" statement_identifier : (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;)) (goto_statement "goto LAB_003597f5;" goto statement_identifier ;) })) (if_statement "if (1 < (ulong)((long)local_20 - (long)local_28)) {\n      wVar2 = *param_2;\n      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" if (parenthesized_expression "(1 < (ulong)((long)local_20 - (long)local_28))" ( (binary_expression "1 < (ulong)((long)local_20 - (long)local_28)" number_literal < (call_expression "(ulong)((long)local_20 - (long)local_28)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "((long)local_20 - (long)local_28)" ( (binary_expression "(long)local_20 - (long)local_28" (cast_expression "(long)local_20" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) )) (compound_statement "{\n      wVar2 = *param_2;\n      if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" { (expression_statement "wVar2 = *param_2;" (assignment_expression "wVar2 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) (if_statement "if ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)) {\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }" if (parenthesized_expression "((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3))" ( (binary_expression "(0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)" (parenthesized_expression "(0x3ff < (ushort)wVar2 - 0xd800)" ( (binary_expression "0x3ff < (ushort)wVar2 - 0xd800" number_literal < (binary_expression "(ushort)wVar2 - 0xd800" (cast_expression "(ushort)wVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) - number_literal)) )) && (parenthesized_expression "((uint)(ushort)wVar2 <= (uint)uVar3)" ( (binary_expression "(uint)(ushort)wVar2 <= (uint)uVar3" (cast_expression "(uint)(ushort)wVar2" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(ushort)wVar2" ( (type_descriptor "ushort" type_identifier) ) identifier)) <= (cast_expression "(uint)uVar3" ( (type_descriptor "uint" type_identifier) ) identifier)) ))) )) (compound_statement "{\n        do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));\n      }" { (do_statement "do {\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        } while ((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3));" do (compound_statement "{\n          param_2 = param_2 + 1;\n          if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }\n          *local_28 = wVar2;\n          local_28 = local_28 + 1;\n          if (param_3 == param_2) goto LAB_003597ec;\n          if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          wVar2 = *param_2;\n        }" { (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (if_statement "if ((uVar4 & 1) == 0) {\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }" if (parenthesized_expression "((uVar4 & 1) == 0)" ( (binary_expression "(uVar4 & 1) == 0" (parenthesized_expression "(uVar4 & 1)" ( (binary_expression "uVar4 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n            wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;\n          }" { (expression_statement "wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8;" (assignment_expression "wVar2 = wVar2 << 8 | (ushort)wVar2 >> 8" identifier = (binary_expression "wVar2 << 8 | (ushort)wVar2 >> 8" (binary_expression "wVar2 << 8" identifier << number_literal) | (binary_expression "(ushort)wVar2 >> 8" (cast_expression "(ushort)wVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) >> number_literal))) ;) })) (expression_statement "*local_28 = wVar2;" (assignment_expression "*local_28 = wVar2" (pointer_expression "*local_28" * identifier) = identifier) ;) (expression_statement "local_28 = local_28 + 1;" (assignment_expression "local_28 = local_28 + 1" identifier = (binary_expression "local_28 + 1" identifier + number_literal)) ;) (if_statement "if (param_3 == param_2) goto LAB_003597ec;" if (parenthesized_expression "(param_3 == param_2)" ( (binary_expression "param_3 == param_2" identifier == identifier) )) (goto_statement "goto LAB_003597ec;" goto statement_identifier ;)) (if_statement "if ((ulong)((long)local_20 - (long)local_28) < 2) goto LAB_003597f0;" if (parenthesized_expression "((ulong)((long)local_20 - (long)local_28) < 2)" ( (binary_expression "(ulong)((long)local_20 - (long)local_28) < 2" (call_expression "(ulong)((long)local_20 - (long)local_28)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "((long)local_20 - (long)local_28)" ( (binary_expression "(long)local_20 - (long)local_28" (cast_expression "(long)local_20" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) - (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) < number_literal) )) (goto_statement "goto LAB_003597f0;" goto statement_identifier ;)) (expression_statement "wVar2 = *param_2;" (assignment_expression "wVar2 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) ;) }) while (parenthesized_expression "((0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3))" ( (binary_expression "(0x3ff < (ushort)wVar2 - 0xd800) && ((uint)(ushort)wVar2 <= (uint)uVar3)" (parenthesized_expression "(0x3ff < (ushort)wVar2 - 0xd800)" ( (binary_expression "0x3ff < (ushort)wVar2 - 0xd800" number_literal < (binary_expression "(ushort)wVar2 - 0xd800" (cast_expression "(ushort)wVar2" ( (type_descriptor "ushort" type_identifier) ) identifier) - number_literal)) )) && (parenthesized_expression "((uint)(ushort)wVar2 <= (uint)uVar3)" ( (binary_expression "(uint)(ushort)wVar2 <= (uint)uVar3" (cast_expression "(uint)(ushort)wVar2" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(ushort)wVar2" ( (type_descriptor "ushort" type_identifier) ) identifier)) <= (cast_expression "(uint)uVar3" ( (type_descriptor "uint" type_identifier) ) identifier)) ))) )) ;) })) (expression_statement "uVar3 = 2;" (assignment_expression "uVar3 = 2" identifier = number_literal) ;) (goto_statement "goto LAB_003597f5;" goto statement_identifier ;) })) })) (labeled_statement "LAB_003597f0:\n  uVar3 = 1;" statement_identifier : (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;)) (labeled_statement "LAB_003597f5:\n  *param_4 = param_2;" statement_identifier : (expression_statement "*param_4 = param_2;" (assignment_expression "*param_4 = param_2" (pointer_expression "*param_4" * identifier) = identifier) ;)) (expression_statement "*param_7 = (char *)local_28;" (assignment_expression "*param_7 = (char *)local_28" (pointer_expression "*param_7" * identifier) = (cast_expression "(char *)local_28" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "undefined8\nFUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)\n\n{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}\n\n" (function_definition "undefined8\nFUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)\n\n{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}" type_identifier (function_declarator "FUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)" identifier (parameter_list "(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "ushort *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "ushort *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "undefined8 *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) , (parameter_declaration "ushort *param_6" type_identifier (pointer_declarator "*param_6" * identifier)) , (parameter_declaration "long param_7" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long *param_8" (sized_type_specifier "long" long) (pointer_declarator "*param_8" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "ushort uVar2;" type_identifier identifier ;) (declaration "undefined8 uVar3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "ushort *local_28;" type_identifier (pointer_declarator "*local_28" * identifier) ;) (declaration "long local_20;" (sized_type_specifier "long" long) identifier ;) (expression_statement "uVar3 = *(undefined8 *)(param_1 + 0x10);" (assignment_expression "uVar3 = *(undefined8 *)(param_1 + 0x10)" identifier = (pointer_expression "*(undefined8 *)(param_1 + 0x10)" * (cast_expression "(undefined8 *)(param_1 + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) (expression_statement "uVar5 = *(uint *)(param_1 + 0x18);" (assignment_expression "uVar5 = *(uint *)(param_1 + 0x18)" identifier = (pointer_expression "*(uint *)(param_1 + 0x18)" * (cast_expression "(uint *)(param_1 + 0x18)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) ;) (expression_statement "local_20 = param_7;" (assignment_expression "local_20 = param_7" identifier = identifier) ;) (expression_statement "local_28 = param_6;" (assignment_expression "local_28 = param_6" identifier = identifier) ;) (expression_statement "cVar1 = FUN_003596d0(&local_28,uVar5);" (assignment_expression "cVar1 = FUN_003596d0(&local_28,uVar5)" identifier = (call_expression "FUN_003596d0(&local_28,uVar5)" identifier (argument_list "(&local_28,uVar5)" ( (pointer_expression "&local_28" & identifier) , identifier )))) ;) (if_statement "if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" if (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" { (if_statement "if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" if (parenthesized_expression "(param_3 == param_4)" ( (binary_expression "param_3 == param_4" identifier == identifier) )) (compound_statement "{\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" { (labeled_statement "LAB_003597ec:\n      uVar3 = 0;" statement_identifier : (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;)) (goto_statement "goto LAB_003597f5;" goto statement_identifier ;) })) (if_statement "if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" if (parenthesized_expression "(1 < (ulong)(local_20 - (long)local_28))" ( (binary_expression "1 < (ulong)(local_20 - (long)local_28)" number_literal < (call_expression "(ulong)(local_20 - (long)local_28)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(local_20 - (long)local_28)" ( (binary_expression "local_20 - (long)local_28" identifier - (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) )))) )) (compound_statement "{\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" { (expression_statement "uVar2 = *param_3;" (assignment_expression "uVar2 = *param_3" identifier = (pointer_expression "*param_3" * identifier)) ;) (expression_statement "uVar4 = (uint)uVar3;" (assignment_expression "uVar4 = (uint)uVar3" identifier = (cast_expression "(uint)uVar3" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) (if_statement "if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }" if (parenthesized_expression "((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4))" ( (binary_expression "(0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)" (parenthesized_expression "(0x3ff < uVar2 - 0xd800)" ( (binary_expression "0x3ff < uVar2 - 0xd800" number_literal < (binary_expression "uVar2 - 0xd800" identifier - number_literal)) )) && (parenthesized_expression "(uVar2 <= uVar4)" ( (binary_expression "uVar2 <= uVar4" identifier <= identifier) ))) )) (compound_statement "{\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }" { (do_statement "do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));" do (compound_statement "{\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        }" { (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" identifier = (binary_expression "param_3 + 1" identifier + number_literal)) ;) (if_statement "if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }" if (parenthesized_expression "((uVar5 & 1) == 0)" ( (binary_expression "(uVar5 & 1) == 0" (parenthesized_expression "(uVar5 & 1)" ( (binary_expression "uVar5 & 1" identifier & number_literal) )) == number_literal) )) (compound_statement "{\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }" { (expression_statement "uVar2 = uVar2 << 8 | uVar2 >> 8;" (assignment_expression "uVar2 = uVar2 << 8 | uVar2 >> 8" identifier = (binary_expression "uVar2 << 8 | uVar2 >> 8" (binary_expression "uVar2 << 8" identifier << number_literal) | (binary_expression "uVar2 >> 8" identifier >> number_literal))) ;) })) (expression_statement "*local_28 = uVar2;" (assignment_expression "*local_28 = uVar2" (pointer_expression "*local_28" * identifier) = identifier) ;) (expression_statement "local_28 = local_28 + 1;" (assignment_expression "local_28 = local_28 + 1" identifier = (binary_expression "local_28 + 1" identifier + number_literal)) ;) (if_statement "if (param_4 == param_3) goto LAB_003597ec;" if (parenthesized_expression "(param_4 == param_3)" ( (binary_expression "param_4 == param_3" identifier == identifier) )) (goto_statement "goto LAB_003597ec;" goto statement_identifier ;)) (if_statement "if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;" if (parenthesized_expression "((ulong)(local_20 - (long)local_28) < 2)" ( (binary_expression "(ulong)(local_20 - (long)local_28) < 2" (call_expression "(ulong)(local_20 - (long)local_28)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(local_20 - (long)local_28)" ( (binary_expression "local_20 - (long)local_28" identifier - (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) < number_literal) )) (goto_statement "goto LAB_003597f0;" goto statement_identifier ;)) (expression_statement "uVar2 = *param_3;" (assignment_expression "uVar2 = *param_3" identifier = (pointer_expression "*param_3" * identifier)) ;) }) while (parenthesized_expression "((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4))" ( (binary_expression "(0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)" (parenthesized_expression "(0x3ff < uVar2 - 0xd800)" ( (binary_expression "0x3ff < uVar2 - 0xd800" number_literal < (binary_expression "uVar2 - 0xd800" identifier - number_literal)) )) && (parenthesized_expression "(uVar2 <= uVar4)" ( (binary_expression "uVar2 <= uVar4" identifier <= identifier) ))) )) ;) })) (expression_statement "uVar3 = 2;" (assignment_expression "uVar3 = 2" identifier = number_literal) ;) (goto_statement "goto LAB_003597f5;" goto statement_identifier ;) })) })) (labeled_statement "LAB_003597f0:\n  uVar3 = 1;" statement_identifier : (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" identifier = number_literal) ;)) (labeled_statement "LAB_003597f5:\n  *param_5 = param_3;" statement_identifier : (expression_statement "*param_5 = param_3;" (assignment_expression "*param_5 = param_3" (pointer_expression "*param_5" * identifier) = identifier) ;)) (expression_statement "*param_8 = (long)local_28;" (assignment_expression "*param_8 = (long)local_28" (pointer_expression "*param_8" * identifier) = (cast_expression "(long)local_28" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ;) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = LIT) ;)) (goto_statement goto statement_identifier ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) )))) )) (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 (parenthesized_expression ( (binary_expression LIT < (binary_expression IDENT - LIT)) )) && (parenthesized_expression ( (binary_expression IDENT <= IDENT) ))) )) (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT & LIT) )) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT << LIT) | (binary_expression IDENT >> LIT))) ;) })) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ))) < LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }) while (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < (binary_expression IDENT - LIT)) )) && (parenthesized_expression ( (binary_expression IDENT <= IDENT) ))) )) ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (goto_statement goto statement_identifier ;) })) })) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = LIT) ;)) (labeled_statement statement_identifier : (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;)) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ;) (return_statement return IDENT ;) })))
(function_definition "undefined8\nFUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)\n\n{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}" (type_identifier "undefined8") (function_declarator "FUN_00359730(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)" (identifier "FUN_00359730") (parameter_list "(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,\n            ushort *param_6,long param_7,long *param_8)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "ushort *param_3" (type_identifier "ushort") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "ushort *param_4" (type_identifier "ushort") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) (, ",") (parameter_declaration "undefined8 *param_5" (type_identifier "undefined8") (pointer_declarator "*param_5" (* "*") (identifier "param_5"))) (, ",") (parameter_declaration "ushort *param_6" (type_identifier "ushort") (pointer_declarator "*param_6" (* "*") (identifier "param_6"))) (, ",") (parameter_declaration "long param_7" (sized_type_specifier "long" (long "long")) (identifier "param_7")) (, ",") (parameter_declaration "long *param_8" (sized_type_specifier "long" (long "long")) (pointer_declarator "*param_8" (* "*") (identifier "param_8"))) () ")"))) (compound_statement "{\n  char cVar1;\n  ushort uVar2;\n  undefined8 uVar3;\n  uint uVar4;\n  uint uVar5;\n  ushort *local_28;\n  long local_20;\n  \n  uVar3 = *(undefined8 *)(param_1 + 0x10);\n  uVar5 = *(uint *)(param_1 + 0x18);\n  local_20 = param_7;\n  local_28 = param_6;\n  cVar1 = FUN_003596d0(&local_28,uVar5);\n  if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }\nLAB_003597f0:\n  uVar3 = 1;\nLAB_003597f5:\n  *param_5 = param_3;\n  *param_8 = (long)local_28;\n  return uVar3;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "ushort uVar2;" (type_identifier "ushort") (identifier "uVar2") (; ";")) (declaration "undefined8 uVar3;" (type_identifier "undefined8") (identifier "uVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "uint uVar5;" (type_identifier "uint") (identifier "uVar5") (; ";")) (declaration "ushort *local_28;" (type_identifier "ushort") (pointer_declarator "*local_28" (* "*") (identifier "local_28")) (; ";")) (declaration "long local_20;" (sized_type_specifier "long" (long "long")) (identifier "local_20") (; ";")) (expression_statement "uVar3 = *(undefined8 *)(param_1 + 0x10);" (assignment_expression "uVar3 = *(undefined8 *)(param_1 + 0x10)" (identifier "uVar3") (= "=") (pointer_expression "*(undefined8 *)(param_1 + 0x10)" (* "*") (cast_expression "(undefined8 *)(param_1 + 0x10)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (expression_statement "uVar5 = *(uint *)(param_1 + 0x18);" (assignment_expression "uVar5 = *(uint *)(param_1 + 0x18)" (identifier "uVar5") (= "=") (pointer_expression "*(uint *)(param_1 + 0x18)" (* "*") (cast_expression "(uint *)(param_1 + 0x18)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")"))))) (; ";")) (expression_statement "local_20 = param_7;" (assignment_expression "local_20 = param_7" (identifier "local_20") (= "=") (identifier "param_7")) (; ";")) (expression_statement "local_28 = param_6;" (assignment_expression "local_28 = param_6" (identifier "local_28") (= "=") (identifier "param_6")) (; ";")) (expression_statement "cVar1 = FUN_003596d0(&local_28,uVar5);" (assignment_expression "cVar1 = FUN_003596d0(&local_28,uVar5)" (identifier "cVar1") (= "=") (call_expression "FUN_003596d0(&local_28,uVar5)" (identifier "FUN_003596d0") (argument_list "(&local_28,uVar5)" (( "(") (pointer_expression "&local_28" (& "&") (identifier "local_28")) (, ",") (identifier "uVar5") () ")")))) (; ";")) (if_statement "if (cVar1 != '\0') {\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" (if "if") (parenthesized_expression "(cVar1 != '\0')" (( "(") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }\n    if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }\n  }" ({ "{") (if_statement "if (param_3 == param_4) {\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" (if "if") (parenthesized_expression "(param_3 == param_4)" (( "(") (binary_expression "param_3 == param_4" (identifier "param_3") (== "==") (identifier "param_4")) () ")")) (compound_statement "{\nLAB_003597ec:\n      uVar3 = 0;\n      goto LAB_003597f5;\n    }" ({ "{") (labeled_statement "LAB_003597ec:\n      uVar3 = 0;" (statement_identifier "LAB_003597ec") (: ":") (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" (identifier "uVar3") (= "=") (number_literal "0")) (; ";"))) (goto_statement "goto LAB_003597f5;" (goto "goto") (statement_identifier "LAB_003597f5") (; ";")) (} "}"))) (if_statement "if (1 < (ulong)(local_20 - (long)local_28)) {\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" (if "if") (parenthesized_expression "(1 < (ulong)(local_20 - (long)local_28))" (( "(") (binary_expression "1 < (ulong)(local_20 - (long)local_28)" (number_literal "1") (< "<") (call_expression "(ulong)(local_20 - (long)local_28)" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (argument_list "(local_20 - (long)local_28)" (( "(") (binary_expression "local_20 - (long)local_28" (identifier "local_20") (- "-") (cast_expression "(long)local_28" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "local_28"))) () ")")))) () ")")) (compound_statement "{\n      uVar2 = *param_3;\n      uVar4 = (uint)uVar3;\n      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }\n      uVar3 = 2;\n      goto LAB_003597f5;\n    }" ({ "{") (expression_statement "uVar2 = *param_3;" (assignment_expression "uVar2 = *param_3" (identifier "uVar2") (= "=") (pointer_expression "*param_3" (* "*") (identifier "param_3"))) (; ";")) (expression_statement "uVar4 = (uint)uVar3;" (assignment_expression "uVar4 = (uint)uVar3" (identifier "uVar4") (= "=") (cast_expression "(uint)uVar3" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "uVar3"))) (; ";")) (if_statement "if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }" (if "if") (parenthesized_expression "((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4))" (( "(") (binary_expression "(0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)" (parenthesized_expression "(0x3ff < uVar2 - 0xd800)" (( "(") (binary_expression "0x3ff < uVar2 - 0xd800" (number_literal "0x3ff") (< "<") (binary_expression "uVar2 - 0xd800" (identifier "uVar2") (- "-") (number_literal "0xd800"))) () ")")) (&& "&&") (parenthesized_expression "(uVar2 <= uVar4)" (( "(") (binary_expression "uVar2 <= uVar4" (identifier "uVar2") (<= "<=") (identifier "uVar4")) () ")"))) () ")")) (compound_statement "{\n        do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));\n      }" ({ "{") (do_statement "do {\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));" (do "do") (compound_statement "{\n          param_3 = param_3 + 1;\n          if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }\n          *local_28 = uVar2;\n          local_28 = local_28 + 1;\n          if (param_4 == param_3) goto LAB_003597ec;\n          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;\n          uVar2 = *param_3;\n        }" ({ "{") (expression_statement "param_3 = param_3 + 1;" (assignment_expression "param_3 = param_3 + 1" (identifier "param_3") (= "=") (binary_expression "param_3 + 1" (identifier "param_3") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if ((uVar5 & 1) == 0) {\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }" (if "if") (parenthesized_expression "((uVar5 & 1) == 0)" (( "(") (binary_expression "(uVar5 & 1) == 0" (parenthesized_expression "(uVar5 & 1)" (( "(") (binary_expression "uVar5 & 1" (identifier "uVar5") (& "&") (number_literal "1")) () ")")) (== "==") (number_literal "0")) () ")")) (compound_statement "{\n            uVar2 = uVar2 << 8 | uVar2 >> 8;\n          }" ({ "{") (expression_statement "uVar2 = uVar2 << 8 | uVar2 >> 8;" (assignment_expression "uVar2 = uVar2 << 8 | uVar2 >> 8" (identifier "uVar2") (= "=") (binary_expression "uVar2 << 8 | uVar2 >> 8" (binary_expression "uVar2 << 8" (identifier "uVar2") (<< "<<") (number_literal "8")) (| "|") (binary_expression "uVar2 >> 8" (identifier "uVar2") (>> ">>") (number_literal "8")))) (; ";")) (} "}"))) (expression_statement "*local_28 = uVar2;" (assignment_expression "*local_28 = uVar2" (pointer_expression "*local_28" (* "*") (identifier "local_28")) (= "=") (identifier "uVar2")) (; ";")) (expression_statement "local_28 = local_28 + 1;" (assignment_expression "local_28 = local_28 + 1" (identifier "local_28") (= "=") (binary_expression "local_28 + 1" (identifier "local_28") (+ "+") (number_literal "1"))) (; ";")) (if_statement "if (param_4 == param_3) goto LAB_003597ec;" (if "if") (parenthesized_expression "(param_4 == param_3)" (( "(") (binary_expression "param_4 == param_3" (identifier "param_4") (== "==") (identifier "param_3")) () ")")) (goto_statement "goto LAB_003597ec;" (goto "goto") (statement_identifier "LAB_003597ec") (; ";"))) (if_statement "if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;" (if "if") (parenthesized_expression "((ulong)(local_20 - (long)local_28) < 2)" (( "(") (binary_expression "(ulong)(local_20 - (long)local_28) < 2" (call_expression "(ulong)(local_20 - (long)local_28)" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (argument_list "(local_20 - (long)local_28)" (( "(") (binary_expression "local_20 - (long)local_28" (identifier "local_20") (- "-") (cast_expression "(long)local_28" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "local_28"))) () ")"))) (< "<") (number_literal "2")) () ")")) (goto_statement "goto LAB_003597f0;" (goto "goto") (statement_identifier "LAB_003597f0") (; ";"))) (expression_statement "uVar2 = *param_3;" (assignment_expression "uVar2 = *param_3" (identifier "uVar2") (= "=") (pointer_expression "*param_3" (* "*") (identifier "param_3"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4))" (( "(") (binary_expression "(0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)" (parenthesized_expression "(0x3ff < uVar2 - 0xd800)" (( "(") (binary_expression "0x3ff < uVar2 - 0xd800" (number_literal "0x3ff") (< "<") (binary_expression "uVar2 - 0xd800" (identifier "uVar2") (- "-") (number_literal "0xd800"))) () ")")) (&& "&&") (parenthesized_expression "(uVar2 <= uVar4)" (( "(") (binary_expression "uVar2 <= uVar4" (identifier "uVar2") (<= "<=") (identifier "uVar4")) () ")"))) () ")")) (; ";")) (} "}"))) (expression_statement "uVar3 = 2;" (assignment_expression "uVar3 = 2" (identifier "uVar3") (= "=") (number_literal "2")) (; ";")) (goto_statement "goto LAB_003597f5;" (goto "goto") (statement_identifier "LAB_003597f5") (; ";")) (} "}"))) (} "}"))) (labeled_statement "LAB_003597f0:\n  uVar3 = 1;" (statement_identifier "LAB_003597f0") (: ":") (expression_statement "uVar3 = 1;" (assignment_expression "uVar3 = 1" (identifier "uVar3") (= "=") (number_literal "1")) (; ";"))) (labeled_statement "LAB_003597f5:\n  *param_5 = param_3;" (statement_identifier "LAB_003597f5") (: ":") (expression_statement "*param_5 = param_3;" (assignment_expression "*param_5 = param_3" (pointer_expression "*param_5" (* "*") (identifier "param_5")) (= "=") (identifier "param_3")) (; ";"))) (expression_statement "*param_8 = (long)local_28;" (assignment_expression "*param_8 = (long)local_28" (pointer_expression "*param_8" (* "*") (identifier "param_8")) (= "=") (cast_expression "(long)local_28" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "local_28"))) (; ";")) (return_statement "return uVar3;" (return "return") (identifier "uVar3") (; ";")) (} "}")))

/* std::__codecvt_utf16_base<char16_t>::do_out(__mbstate_t&, char16_t const*, char16_t const*,
   char16_t const*&, char*, char*, char*&) const */

type_1 __thiscall
std::type_2<char16_t>::function_1
          (type_2<char16_t> *var_1,type_3 *param_1,type_4 *var_2,
          type_4 *var_3,type_4 **param_4,char *param_5,char *param_6,char **param_7)

{
  bool bVar1;
  type_4 var_5;
  type_1 uVar3;
  type_5 var_4;
  type_4 *var_6;
  char *local_20;
  
  uVar3 = *(type_1 *)(var_1 + 0x10);
  var_4 = *(type_5 *)(var_1 + 0x18);
  local_20 = param_6;
  var_6 = (type_4 *)param_5;
  bVar1 = (anonymous_namespace)::write_utf16_bom<false>(&var_6,var_4);
  if (bVar1) {
    if (var_2 == var_3) {
LAB_003597ec:
      uVar3 = 0;
      goto LAB_003597f5;
    }
    if (1 < (ulong)((long)local_20 - (long)var_6)) {
      var_5 = *var_2;
      if ((0x3ff < (type_6)var_5 - 0xd800) && ((type_5)(type_6)var_5 <= (type_5)uVar3)) {
        do {
          var_2 = var_2 + 1;
          if ((var_4 & 1) == 0) {
            var_5 = var_5 << 8 | (type_6)var_5 >> 8;
          }
          *var_6 = var_5;
          var_6 = var_6 + 1;
          if (var_3 == var_2) goto LAB_003597ec;
          if ((ulong)((long)local_20 - (long)var_6) < 2) goto LAB_003597f0;
          var_5 = *var_2;
        } while ((0x3ff < (type_6)var_5 - 0xd800) && ((type_5)(type_6)var_5 <= (type_5)uVar3));
      }
      uVar3 = 2;
      goto LAB_003597f5;
    }
  }
LAB_003597f0:
  uVar3 = 1;
LAB_003597f5:
  *param_4 = var_2;
  *param_7 = (char *)var_6;
  return uVar3;
}


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

undefined8
MASKED(long param_1,undefined8 param_2,ushort *param_3,ushort *param_4,undefined8 *param_5,
            ushort *param_6,long param_7,long *param_8)

{
  char cVar1;
  ushort uVar2;
  undefined8 uVar3;
  uint uVar4;
  uint uVar5;
  ushort *local_28;
  long local_20;
  
  uVar3 = *(undefined8 *)(param_1 + 0x10);
  uVar5 = *(uint *)(param_1 + 0x18);
  local_20 = param_7;
  local_28 = param_6;
  cVar1 = FUN_003596d0(&local_28,uVar5);
  if (cVar1 != '\0') {
    if (param_3 == param_4) {
LAB_003597ec:
      uVar3 = 0;
      goto LAB_003597f5;
    }
    if (1 < (ulong)(local_20 - (long)local_28)) {
      uVar2 = *param_3;
      uVar4 = (uint)uVar3;
      if ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4)) {
        do {
          param_3 = param_3 + 1;
          if ((uVar5 & 1) == 0) {
            uVar2 = uVar2 << 8 | uVar2 >> 8;
          }
          *local_28 = uVar2;
          local_28 = local_28 + 1;
          if (param_4 == param_3) goto LAB_003597ec;
          if ((ulong)(local_20 - (long)local_28) < 2) goto LAB_003597f0;
          uVar2 = *param_3;
        } while ((0x3ff < uVar2 - 0xd800) && (uVar2 <= uVar4));
      }
      uVar3 = 2;
      goto LAB_003597f5;
    }
  }
LAB_003597f0:
  uVar3 = 1;
LAB_003597f5:
  *param_5 = param_3;
  *param_8 = (long)local_28;
  return uVar3;
}

