
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::ctype<wchar_t>::do_narrow(wchar_t const*, wchar_t const*, char, char*) const */

wchar_t * __thiscall
std::ctype<wchar_t>::do_narrow
          (ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2,char param_3,char *param_4)

{
  wchar_t __c;
  int iVar1;
  undefined4 uVar2;
  uint uVar3;
  ctype<wchar_t> *pcVar4;
  ctype<wchar_t> *pcVar5;
  char *pcVar6;
  char *pcVar7;
  
  uVar2 = __uselocale(*(undefined4 *)(this + 8));
  if (this[0xc] == (ctype<wchar_t>)0x0) {
    if (param_1 < param_2) {
      iVar1 = -1 - (int)param_1;
      pcVar6 = param_4;
      do {
                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */
        uVar3 = wctob(*param_1);
        if (uVar3 == 0xffffffff) {
          uVar3 = (uint)(byte)param_3;
        }
        param_1 = param_1 + 1;
        pcVar7 = pcVar6 + 1;
        *pcVar6 = (char)uVar3;
        pcVar6 = pcVar7;
      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);
    }
  }
  else if (param_1 < param_2) {
    iVar1 = -1 - (int)param_1;
    pcVar4 = (ctype<wchar_t> *)param_4;
    do {
      while (__c = *param_1, (uint)__c < 0x80) {
        param_1 = param_1 + 1;
        pcVar5 = pcVar4 + 1;
        *pcVar4 = this[__c + L'\r'];
        pcVar4 = pcVar5;
        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))
        goto LAB_002217f4;
      }
                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */
      uVar3 = wctob(__c);
      if (uVar3 == 0xffffffff) {
        uVar3 = (uint)(byte)param_3;
      }
      param_1 = param_1 + 1;
      pcVar5 = pcVar4 + 1;
      *pcVar4 = SUB41(uVar3,0);
      pcVar4 = pcVar5;
    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));
  }
LAB_002217f4:
  __uselocale(uVar2);
  return param_2;
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

uint * FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)

{
  int iVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined1 *puVar4;
  undefined1 *puVar5;
  
  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));
  if (*(char *)(param_1 + 0xc) == '\0') {
    if (param_2 < param_3) {
      iVar1 = -1 - (int)param_2;
      puVar4 = param_5;
      do {
                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */
        uVar3 = wctob(*param_2);
        if (uVar3 == 0xffffffff) {
          uVar3 = (uint)param_4;
        }
        param_2 = param_2 + 1;
        puVar5 = puVar4 + 1;
        *puVar4 = (char)uVar3;
        puVar4 = puVar5;
      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);
    }
  }
  else if (param_2 < param_3) {
    iVar1 = -1 - (int)param_2;
    puVar4 = param_5;
    do {
      while (uVar3 = *param_2, uVar3 < 0x80) {
        param_2 = param_2 + 1;
        puVar5 = puVar4 + 1;
        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);
        puVar4 = puVar5;
        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;
      }
                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */
      uVar3 = wctob(uVar3);
      if (uVar3 == 0xffffffff) {
        uVar3 = (uint)param_4;
      }
      param_2 = param_2 + 1;
      puVar5 = puVar4 + 1;
      *puVar4 = (char)uVar3;
      puVar4 = puVar5;
    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);
  }
LAB_002217f4:
  __uselocale(uVar2);
  return param_3;
}


PUSH EBP
MOV EBP,ESP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00035840
ADD EBX,0x16d8a5
SUB ESP,0x28
MOVZX EAX,byte ptr [EBP + 0x14]
MOV EDI,dword ptr [EBP + 0xc]
MOV ESI,dword ptr [EBP + 0x18]
MOV byte ptr [EBP + -0x1d],AL
MOV EAX,dword ptr [EBP + 0x8]
PUSH dword ptr [EAX + 0x8]
MOV dword ptr [EBP + -0x1c],EBX
CALL 0x000297d0
ADD ESP,0x10
MOV dword ptr [EBP + -0x28],EAX
MOV EAX,dword ptr [EBP + 0x8]
CMP byte ptr [EAX + 0xc],0x0
JZ 0x00221810
CMP EDI,dword ptr [EBP + 0x10]
JNC 0x002217f4
MOV EAX,dword ptr [EBP + 0x10]
SUB EAX,0x1
SUB EAX,EDI
SHR EAX,0x2
LEA EAX,[ESI + EAX*0x1 + 0x1]
MOV dword ptr [EBP + -0x24],EAX
JMP 0x002217c6
MOV EDX,dword ptr [EBP + 0x8]
ADD EDI,0x4
ADD ESI,0x1
MOVZX EAX,byte ptr [EDX + EAX*0x1 + 0xd]
MOV byte ptr [ESI + -0x1],AL
CMP ESI,dword ptr [EBP + -0x24]
JZ 0x002217f4
MOV EAX,dword ptr [EDI]
CMP EAX,0x7f
JBE 0x002217b0
SUB ESP,0xc
MOV EBX,dword ptr [EBP + -0x1c]
PUSH EAX
CALL 0x00029520
MOVZX EDX,byte ptr [EBP + -0x1d]
ADD ESP,0x10
CMP EAX,-0x1
CMOVZ EAX,EDX
ADD EDI,0x4
ADD ESI,0x1
MOV byte ptr [ESI + -0x1],AL
CMP ESI,dword ptr [EBP + -0x24]
JNZ 0x002217c6
SUB ESP,0xc
PUSH dword ptr [EBP + -0x28]
MOV EBX,dword ptr [EBP + -0x1c]
CALL 0x000297d0
MOV EAX,dword ptr [EBP + 0x10]
ADD ESP,0x10
LEA ESP,[EBP + -0xc]
POP EBX
POP ESI
POP EDI
POP EBP
RET
CMP EDI,dword ptr [EBP + 0x10]
JNC 0x002217f4
MOV EAX,dword ptr [EBP + 0x10]
SUB EAX,0x1
SUB EAX,EDI
SHR EAX,0x2
LEA EAX,[ESI + EAX*0x1 + 0x1]
MOV dword ptr [EBP + -0x24],EAX
LEA ESI,[ESI]
NOP
SUB ESP,0xc
PUSH dword ptr [EDI]
MOV EBX,dword ptr [EBP + -0x1c]
CALL 0x00029520
MOVZX ECX,byte ptr [EBP + -0x1d]
ADD ESP,0x10
CMP EAX,-0x1
CMOVZ EAX,ECX
ADD EDI,0x4
ADD ESI,0x1
MOV byte ptr [ESI + -0x1],AL
CMP dword ptr [EBP + -0x24],ESI
JNZ 0x00221830
JMP 0x002217f4
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nuint * FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}\n\n" comment (function_definition "uint * FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}" type_identifier (pointer_declarator "* FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" * (function_declarator "FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" identifier (parameter_list "(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "byte param_4" type_identifier identifier) , (parameter_declaration "undefined1 *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (expression_statement "uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));" (assignment_expression "uVar2 = __uselocale(*(undefined4 *)(param_1 + 8))" identifier = (call_expression "__uselocale(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0xc) == '\0')" ( (binary_expression "*(char *)(param_1 + 0xc) == '\0'" (pointer_expression "*(char *)(param_1 + 0xc)" * (cast_expression "(char *)(param_1 + 0xc)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }" { (if_statement "if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }" { (expression_statement "iVar1 = -1 - (int)param_2;" (assignment_expression "iVar1 = -1 - (int)param_2" identifier = (binary_expression "-1 - (int)param_2" number_literal - (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "puVar4 = param_5;" (assignment_expression "puVar4 = param_5" identifier = identifier) ;) (do_statement "do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);" do (compound_statement "{\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      }" { comment (expression_statement "uVar3 = wctob(*param_2);" (assignment_expression "uVar3 = wctob(*param_2)" identifier = (call_expression "wctob(*param_2)" identifier (argument_list "(*param_2)" ( (pointer_expression "*param_2" * identifier) )))) ;) (if_statement "if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }" if (parenthesized_expression "(uVar3 == 0xffffffff)" ( (binary_expression "uVar3 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n          uVar3 = (uint)param_4;\n        }" { (expression_statement "uVar3 = (uint)param_4;" (assignment_expression "uVar3 = (uint)param_4" identifier = (cast_expression "(uint)param_4" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) })) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*puVar4 = (char)uVar3;" (assignment_expression "*puVar4 = (char)uVar3" (pointer_expression "*puVar4" * identifier) = (cast_expression "(char)uVar3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5)" ( (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_3 + iVar1)" ( (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal) != identifier) )) ;) })) }) (else_clause "else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" else (if_statement "if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" { (expression_statement "iVar1 = -1 - (int)param_2;" (assignment_expression "iVar1 = -1 - (int)param_2" identifier = (binary_expression "-1 - (int)param_2" number_literal - (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "puVar4 = param_5;" (assignment_expression "puVar4 = param_5" identifier = identifier) ;) (do_statement "do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);" do (compound_statement "{\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    }" { (while_statement "while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }" while (parenthesized_expression "(uVar3 = *param_2, uVar3 < 0x80)" ( (comma_expression "uVar3 = *param_2, uVar3 < 0x80" (assignment_expression "uVar3 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) , (binary_expression "uVar3 < 0x80" identifier < number_literal)) )) (compound_statement "{\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }" { (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);" (assignment_expression "*puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3)" (pointer_expression "*puVar4" * identifier) = (pointer_expression "*(undefined1 *)(param_1 + 0xd + uVar3)" * (cast_expression "(undefined1 *)(param_1 + 0xd + uVar3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd + uVar3)" ( (binary_expression "param_1 + 0xd + uVar3" (binary_expression "param_1 + 0xd" identifier + number_literal) + identifier) ))))) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) (if_statement "if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;" if (parenthesized_expression "(puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1)" ( (binary_expression "puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" identifier == (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_3 + iVar1)" ( (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal)) )) (goto_statement "goto LAB_002217f4;" goto statement_identifier ;)) })) comment (expression_statement "uVar3 = wctob(uVar3);" (assignment_expression "uVar3 = wctob(uVar3)" identifier = (call_expression "wctob(uVar3)" identifier (argument_list "(uVar3)" ( identifier )))) ;) (if_statement "if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }" if (parenthesized_expression "(uVar3 == 0xffffffff)" ( (binary_expression "uVar3 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        uVar3 = (uint)param_4;\n      }" { (expression_statement "uVar3 = (uint)param_4;" (assignment_expression "uVar3 = (uint)param_4" identifier = (cast_expression "(uint)param_4" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) })) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*puVar4 = (char)uVar3;" (assignment_expression "*puVar4 = (char)uVar3" (pointer_expression "*puVar4" * identifier) = (cast_expression "(char)uVar3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1)" ( (binary_expression "puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" identifier != (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_3 + iVar1)" ( (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal)) )) ;) })))) (labeled_statement "LAB_002217f4:\n  __uselocale(uVar2);" statement_identifier : (expression_statement "__uselocale(uVar2);" (call_expression "__uselocale(uVar2)" identifier (argument_list "(uVar2)" ( identifier ))) ;)) (return_statement "return param_3;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* std::ctype<wchar_t>::do_narrow(wchar_t const*, wchar_t const*, char, char*) const */\n\nwchar_t * __thiscall\nstd::ctype<wchar_t>::do_narrow\n          (ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2,char param_3,char *param_4)\n\n{\n  wchar_t __c;\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  ctype<wchar_t> *pcVar4;\n  ctype<wchar_t> *pcVar5;\n  char *pcVar6;\n  char *pcVar7;\n  \n  uVar2 = __uselocale(*(undefined4 *)(this + 8));\n  if (this[0xc] == (ctype<wchar_t>)0x0) {\n    if (param_1 < param_2) {\n      iVar1 = -1 - (int)param_1;\n      pcVar6 = param_4;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);\n    }\n  }\n  else if (param_1 < param_2) {\n    iVar1 = -1 - (int)param_1;\n    pcVar4 = (ctype<wchar_t> *)param_4;\n    do {\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_2;\n}\n\n" comment comment (ERROR "wchar_t * __thiscall\nstd::ctype<wchar_t>::do_narrow\n          (ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2,char param_3,char *param_4)" (binary_expression "wchar_t * __thiscall\nstd::ctype<wchar_t>::do_narrow\n          (ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2,char param_3,char *param_4)" (binary_expression "wchar_t * __thiscall\nstd::ctype<wchar_t" (binary_expression "wchar_t * __thiscall" identifier * identifier) (ERROR "std::ctype" identifier : : identifier) < identifier) > (ERROR "::" : :) (call_expression "do_narrow\n          (ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2,char param_3,char *param_4)" identifier (argument_list "(ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2,char param_3,char *param_4)" ( (binary_expression "ctype<wchar_t> *this" (binary_expression "ctype<wchar_t" identifier < identifier) > (pointer_expression "*this" * identifier)) , (binary_expression "wchar_t *param_1" identifier * identifier) , (binary_expression "wchar_t *param_2" identifier * identifier) , (ERROR "char" identifier) identifier , (binary_expression "char *param_4" identifier * identifier) ))))) (compound_statement "{\n  wchar_t __c;\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  ctype<wchar_t> *pcVar4;\n  ctype<wchar_t> *pcVar5;\n  char *pcVar6;\n  char *pcVar7;\n  \n  uVar2 = __uselocale(*(undefined4 *)(this + 8));\n  if (this[0xc] == (ctype<wchar_t>)0x0) {\n    if (param_1 < param_2) {\n      iVar1 = -1 - (int)param_1;\n      pcVar6 = param_4;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);\n    }\n  }\n  else if (param_1 < param_2) {\n    iVar1 = -1 - (int)param_1;\n    pcVar4 = (ctype<wchar_t> *)param_4;\n    do {\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_2;\n}" { (declaration "wchar_t __c;" type_identifier identifier ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "ctype<wchar_t> *pcVar4;" (binary_expression "ctype<wchar_t> *pcVar4" (binary_expression "ctype<wchar_t" identifier < identifier) > (pointer_expression "*pcVar4" * identifier)) ;) (expression_statement "ctype<wchar_t> *pcVar5;" (binary_expression "ctype<wchar_t> *pcVar5" (binary_expression "ctype<wchar_t" identifier < identifier) > (pointer_expression "*pcVar5" * identifier)) ;) (declaration "char *pcVar6;" primitive_type (pointer_declarator "*pcVar6" * identifier) ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (expression_statement "uVar2 = __uselocale(*(undefined4 *)(this + 8));" (assignment_expression "uVar2 = __uselocale(*(undefined4 *)(this + 8))" identifier = (call_expression "__uselocale(*(undefined4 *)(this + 8))" identifier (argument_list "(*(undefined4 *)(this + 8))" ( (pointer_expression "*(undefined4 *)(this + 8)" * (cast_expression "(undefined4 *)(this + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 8)" ( (binary_expression "this + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (this[0xc] == (ctype<wchar_t>)0x0) {\n    if (param_1 < param_2) {\n      iVar1 = -1 - (int)param_1;\n      pcVar6 = param_4;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);\n    }\n  }\n  else if (param_1 < param_2) {\n    iVar1 = -1 - (int)param_1;\n    pcVar4 = (ctype<wchar_t> *)param_4;\n    do {\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));\n  }" if (parenthesized_expression "(this[0xc] == (ctype<wchar_t>)0x0)" ( (binary_expression "this[0xc] == (ctype<wchar_t>)0x0)" (subscript_expression "this[0xc]" identifier [ number_literal ]) == (parenthesized_expression "(ctype<wchar_t>)0x0)" ( (binary_expression "ctype<wchar_t>)0x0" (binary_expression "ctype<wchar_t" identifier < identifier) > (ERROR ")" )) number_literal) ))) )) (compound_statement "{\n    if (param_1 < param_2) {\n      iVar1 = -1 - (int)param_1;\n      pcVar6 = param_4;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);\n    }\n  }" { (if_statement "if (param_1 < param_2) {\n      iVar1 = -1 - (int)param_1;\n      pcVar6 = param_4;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);\n    }" if (parenthesized_expression "(param_1 < param_2)" ( (binary_expression "param_1 < param_2" identifier < identifier) )) (compound_statement "{\n      iVar1 = -1 - (int)param_1;\n      pcVar6 = param_4;\n      do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);\n    }" { (expression_statement "iVar1 = -1 - (int)param_1;" (assignment_expression "iVar1 = -1 - (int)param_1" identifier = (binary_expression "-1 - (int)param_1" number_literal - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "pcVar6 = param_4;" (assignment_expression "pcVar6 = param_4" identifier = identifier) ;) (do_statement "do {\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      } while (param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7);" do (compound_statement "{\n                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */\n        uVar3 = wctob(*param_1);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }\n        param_1 = param_1 + 1;\n        pcVar7 = pcVar6 + 1;\n        *pcVar6 = (char)uVar3;\n        pcVar6 = pcVar7;\n      }" { comment (expression_statement "uVar3 = wctob(*param_1);" (assignment_expression "uVar3 = wctob(*param_1)" identifier = (call_expression "wctob(*param_1)" identifier (argument_list "(*param_1)" ( (pointer_expression "*param_1" * identifier) )))) ;) (if_statement "if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)(byte)param_3;\n        }" if (parenthesized_expression "(uVar3 == 0xffffffff)" ( (binary_expression "uVar3 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n          uVar3 = (uint)(byte)param_3;\n        }" { (expression_statement "uVar3 = (uint)(byte)param_3;" (assignment_expression "uVar3 = (uint)(byte)param_3" identifier = (cast_expression "(uint)(byte)param_3" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(byte)param_3" ( (type_descriptor "byte" type_identifier) ) identifier))) ;) })) (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "pcVar7 = pcVar6 + 1;" (assignment_expression "pcVar7 = pcVar6 + 1" identifier = (binary_expression "pcVar6 + 1" identifier + number_literal)) ;) (expression_statement "*pcVar6 = (char)uVar3;" (assignment_expression "*pcVar6 = (char)uVar3" (pointer_expression "*pcVar6" * identifier) = (cast_expression "(char)uVar3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "pcVar6 = pcVar7;" (assignment_expression "pcVar6 = pcVar7" identifier = identifier) ;) }) while (parenthesized_expression "(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7)" ( (binary_expression "param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1 != pcVar7" (binary_expression "param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1" (binary_expression "param_4 + ((uint)((int)param_2 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_2 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_2 + iVar1) >> 2" (call_expression "(uint)((int)param_2 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_2 + iVar1)" ( (binary_expression "(int)param_2 + iVar1" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal) != identifier) )) ;) })) }) (else_clause "else if (param_1 < param_2) {\n    iVar1 = -1 - (int)param_1;\n    pcVar4 = (ctype<wchar_t> *)param_4;\n    do {\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));\n  }" else (if_statement "if (param_1 < param_2) {\n    iVar1 = -1 - (int)param_1;\n    pcVar4 = (ctype<wchar_t> *)param_4;\n    do {\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));\n  }" if (parenthesized_expression "(param_1 < param_2)" ( (binary_expression "param_1 < param_2" identifier < identifier) )) (compound_statement "{\n    iVar1 = -1 - (int)param_1;\n    pcVar4 = (ctype<wchar_t> *)param_4;\n    do {\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));\n  }" { (expression_statement "iVar1 = -1 - (int)param_1;" (assignment_expression "iVar1 = -1 - (int)param_1" identifier = (binary_expression "-1 - (int)param_1" number_literal - (cast_expression "(int)param_1" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "pcVar4 = (ctype<wchar_t> *)param_4;" (assignment_expression "pcVar4 = (ctype<wchar_t> *)param_4" identifier = (parenthesized_expression "(ctype<wchar_t> *)param_4" ( (binary_expression "ctype<wchar_t> *)param_4" (binary_expression "ctype<wchar_t" identifier < identifier) > (pointer_expression "*)param_4" * (ERROR ")" )) identifier)) ))) ;) (do_statement "do {\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    } while (pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1));" do (compound_statement "{\n      while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }\n                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */\n      uVar3 = wctob(__c);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }\n      param_1 = param_1 + 1;\n      pcVar5 = pcVar4 + 1;\n      *pcVar4 = SUB41(uVar3,0);\n      pcVar4 = pcVar5;\n    }" { (while_statement "while (__c = *param_1, (uint)__c < 0x80) {\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }" while (parenthesized_expression "(__c = *param_1, (uint)__c < 0x80)" ( (comma_expression "__c = *param_1, (uint)__c < 0x80" (assignment_expression "__c = *param_1" identifier = (pointer_expression "*param_1" * identifier)) , (binary_expression "(uint)__c < 0x80" (cast_expression "(uint)__c" ( (type_descriptor "uint" type_identifier) ) identifier) < number_literal)) )) (compound_statement "{\n        param_1 = param_1 + 1;\n        pcVar5 = pcVar4 + 1;\n        *pcVar4 = this[__c + L'\r'];\n        pcVar4 = pcVar5;\n        if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;\n      }" { (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "pcVar5 = pcVar4 + 1;" (assignment_expression "pcVar5 = pcVar4 + 1" identifier = (binary_expression "pcVar4 + 1" identifier + number_literal)) ;) (expression_statement "*pcVar4 = this[__c + L'\r'];" (assignment_expression "*pcVar4 = this[__c + L'\r']" (pointer_expression "*pcVar4" * identifier) = (subscript_expression "this[__c + L'\r']" identifier [ (binary_expression "__c + L'\r'" identifier + (char_literal "L'\r'" L' escape_sequence ')) ])) ;) (expression_statement "pcVar4 = pcVar5;" (assignment_expression "pcVar4 = pcVar5" identifier = identifier) ;) (if_statement "if (pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))\n        goto LAB_002217f4;" if (parenthesized_expression "(pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))" ( (binary_expression "pcVar5 == (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1)" identifier == (call_expression "(ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1)" (parenthesized_expression "(ctype<wchar_t> *)" ( (binary_expression "ctype<wchar_t> *" (binary_expression "ctype<wchar_t" identifier < identifier) > (pointer_expression "*" * identifier)) )) (argument_list "(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1)" ( (binary_expression "param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1" (binary_expression "param_4 + ((uint)((int)param_2 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_2 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_2 + iVar1) >> 2" (call_expression "(uint)((int)param_2 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_2 + iVar1)" ( (binary_expression "(int)param_2 + iVar1" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal) )))) )) (goto_statement "goto LAB_002217f4;" goto statement_identifier ;)) })) comment (expression_statement "uVar3 = wctob(__c);" (assignment_expression "uVar3 = wctob(__c)" identifier = (call_expression "wctob(__c)" identifier (argument_list "(__c)" ( identifier )))) ;) (if_statement "if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)(byte)param_3;\n      }" if (parenthesized_expression "(uVar3 == 0xffffffff)" ( (binary_expression "uVar3 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        uVar3 = (uint)(byte)param_3;\n      }" { (expression_statement "uVar3 = (uint)(byte)param_3;" (assignment_expression "uVar3 = (uint)(byte)param_3" identifier = (cast_expression "(uint)(byte)param_3" ( (type_descriptor "uint" type_identifier) ) (cast_expression "(byte)param_3" ( (type_descriptor "byte" type_identifier) ) identifier))) ;) })) (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "pcVar5 = pcVar4 + 1;" (assignment_expression "pcVar5 = pcVar4 + 1" identifier = (binary_expression "pcVar4 + 1" identifier + number_literal)) ;) (expression_statement "*pcVar4 = SUB41(uVar3,0);" (assignment_expression "*pcVar4 = SUB41(uVar3,0)" (pointer_expression "*pcVar4" * identifier) = (call_expression "SUB41(uVar3,0)" identifier (argument_list "(uVar3,0)" ( identifier , number_literal )))) ;) (expression_statement "pcVar4 = pcVar5;" (assignment_expression "pcVar4 = pcVar5" identifier = identifier) ;) }) while (parenthesized_expression "(pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1))" ( (binary_expression "pcVar5 != (ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1)" identifier != (call_expression "(ctype<wchar_t> *)(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1)" (parenthesized_expression "(ctype<wchar_t> *)" ( (binary_expression "ctype<wchar_t> *" (binary_expression "ctype<wchar_t" identifier < identifier) > (pointer_expression "*" * identifier)) )) (argument_list "(param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1)" ( (binary_expression "param_4 + ((uint)((int)param_2 + iVar1) >> 2) + 1" (binary_expression "param_4 + ((uint)((int)param_2 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_2 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_2 + iVar1) >> 2" (call_expression "(uint)((int)param_2 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_2 + iVar1)" ( (binary_expression "(int)param_2 + iVar1" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal) )))) )) ;) })))) (labeled_statement "LAB_002217f4:\n  __uselocale(uVar2);" statement_identifier : (expression_statement "__uselocale(uVar2);" (call_expression "__uselocale(uVar2)" identifier (argument_list "(uVar2)" ( identifier ))) ;)) (return_statement "return param_2;" return identifier ;) }))
(translation_unit "uint * FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}\n\n" (function_definition "uint * FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}" type_identifier (pointer_declarator "* FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" * (function_declarator "FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" identifier (parameter_list "(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "uint *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "byte param_4" type_identifier identifier) , (parameter_declaration "undefined1 *param_5" type_identifier (pointer_declarator "*param_5" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "undefined1 *puVar4;" type_identifier (pointer_declarator "*puVar4" * identifier) ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (expression_statement "uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));" (assignment_expression "uVar2 = __uselocale(*(undefined4 *)(param_1 + 8))" identifier = (call_expression "__uselocale(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" if (parenthesized_expression "(*(char *)(param_1 + 0xc) == '\0')" ( (binary_expression "*(char *)(param_1 + 0xc) == '\0'" (pointer_expression "*(char *)(param_1 + 0xc)" * (cast_expression "(char *)(param_1 + 0xc)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }" { (if_statement "if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }" { (expression_statement "iVar1 = -1 - (int)param_2;" (assignment_expression "iVar1 = -1 - (int)param_2" identifier = (binary_expression "-1 - (int)param_2" number_literal - (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "puVar4 = param_5;" (assignment_expression "puVar4 = param_5" identifier = identifier) ;) (do_statement "do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);" do (compound_statement "{\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      }" { (expression_statement "uVar3 = wctob(*param_2);" (assignment_expression "uVar3 = wctob(*param_2)" identifier = (call_expression "wctob(*param_2)" identifier (argument_list "(*param_2)" ( (pointer_expression "*param_2" * identifier) )))) ;) (if_statement "if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }" if (parenthesized_expression "(uVar3 == 0xffffffff)" ( (binary_expression "uVar3 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n          uVar3 = (uint)param_4;\n        }" { (expression_statement "uVar3 = (uint)param_4;" (assignment_expression "uVar3 = (uint)param_4" identifier = (cast_expression "(uint)param_4" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) })) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*puVar4 = (char)uVar3;" (assignment_expression "*puVar4 = (char)uVar3" (pointer_expression "*puVar4" * identifier) = (cast_expression "(char)uVar3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5)" ( (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_3 + iVar1)" ( (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal) != identifier) )) ;) })) }) (else_clause "else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" else (if_statement "if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" { (expression_statement "iVar1 = -1 - (int)param_2;" (assignment_expression "iVar1 = -1 - (int)param_2" identifier = (binary_expression "-1 - (int)param_2" number_literal - (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier))) ;) (expression_statement "puVar4 = param_5;" (assignment_expression "puVar4 = param_5" identifier = identifier) ;) (do_statement "do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);" do (compound_statement "{\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    }" { (while_statement "while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }" while (parenthesized_expression "(uVar3 = *param_2, uVar3 < 0x80)" ( (comma_expression "uVar3 = *param_2, uVar3 < 0x80" (assignment_expression "uVar3 = *param_2" identifier = (pointer_expression "*param_2" * identifier)) , (binary_expression "uVar3 < 0x80" identifier < number_literal)) )) (compound_statement "{\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }" { (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);" (assignment_expression "*puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3)" (pointer_expression "*puVar4" * identifier) = (pointer_expression "*(undefined1 *)(param_1 + 0xd + uVar3)" * (cast_expression "(undefined1 *)(param_1 + 0xd + uVar3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd + uVar3)" ( (binary_expression "param_1 + 0xd + uVar3" (binary_expression "param_1 + 0xd" identifier + number_literal) + identifier) ))))) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) (if_statement "if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;" if (parenthesized_expression "(puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1)" ( (binary_expression "puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" identifier == (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_3 + iVar1)" ( (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal)) )) (goto_statement "goto LAB_002217f4;" goto statement_identifier ;)) })) (expression_statement "uVar3 = wctob(uVar3);" (assignment_expression "uVar3 = wctob(uVar3)" identifier = (call_expression "wctob(uVar3)" identifier (argument_list "(uVar3)" ( identifier )))) ;) (if_statement "if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }" if (parenthesized_expression "(uVar3 == 0xffffffff)" ( (binary_expression "uVar3 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n        uVar3 = (uint)param_4;\n      }" { (expression_statement "uVar3 = (uint)param_4;" (assignment_expression "uVar3 = (uint)param_4" identifier = (cast_expression "(uint)param_4" ( (type_descriptor "uint" type_identifier) ) identifier)) ;) })) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" identifier = (binary_expression "param_2 + 1" identifier + number_literal)) ;) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" identifier = (binary_expression "puVar4 + 1" identifier + number_literal)) ;) (expression_statement "*puVar4 = (char)uVar3;" (assignment_expression "*puVar4 = (char)uVar3" (pointer_expression "*puVar4" * identifier) = (cast_expression "(char)uVar3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" identifier = identifier) ;) }) while (parenthesized_expression "(puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1)" ( (binary_expression "puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" identifier != (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" identifier + (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" ( (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "((int)param_3 + iVar1)" ( (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) ))) >> number_literal) ))) + number_literal)) )) ;) })))) (labeled_statement "LAB_002217f4:\n  __uselocale(uVar2);" statement_identifier : (expression_statement "__uselocale(uVar2);" (call_expression "__uselocale(uVar2)" identifier (argument_list "(uVar2)" ( identifier ))) ;)) (return_statement "return param_3;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == (char_literal ' escape_sequence ')) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression LIT - (cast_expression ( (type_descriptor TYPE) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression (binary_expression (binary_expression IDENT + (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) ))) >> LIT) ))) + LIT) != IDENT) )) ;) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression LIT - (cast_expression ( (type_descriptor TYPE) ) IDENT))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (while_statement while (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (pointer_expression * IDENT)) , (binary_expression IDENT < LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (binary_expression (binary_expression IDENT + (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) ))) >> LIT) ))) + LIT)) )) (goto_statement goto statement_identifier ;)) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (binary_expression (binary_expression IDENT + (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) ))) >> LIT) ))) + LIT)) )) ;) })))) (labeled_statement statement_identifier : (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;)) (return_statement return IDENT ;) })))
(function_definition "uint * FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}" (type_identifier "uint") (pointer_declarator "* FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" (* "*") (function_declarator "FUN_00221750(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" (identifier "FUN_00221750") (parameter_list "(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint *param_2" (type_identifier "uint") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "uint *param_3" (type_identifier "uint") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "byte param_4" (type_identifier "byte") (identifier "param_4")) (, ",") (parameter_declaration "undefined1 *param_5" (type_identifier "undefined1") (pointer_declarator "*param_5" (* "*") (identifier "param_5"))) () ")")))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  uint uVar3;\n  undefined1 *puVar4;\n  undefined1 *puVar5;\n  \n  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));\n  if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }\nLAB_002217f4:\n  __uselocale(uVar2);\n  return param_3;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "uint uVar3;" (type_identifier "uint") (identifier "uVar3") (; ";")) (declaration "undefined1 *puVar4;" (type_identifier "undefined1") (pointer_declarator "*puVar4" (* "*") (identifier "puVar4")) (; ";")) (declaration "undefined1 *puVar5;" (type_identifier "undefined1") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (expression_statement "uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));" (assignment_expression "uVar2 = __uselocale(*(undefined4 *)(param_1 + 8))" (identifier "uVar2") (= "=") (call_expression "__uselocale(*(undefined4 *)(param_1 + 8))" (identifier "__uselocale") (argument_list "(*(undefined4 *)(param_1 + 8))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) () ")")))) (; ";")) (if_statement "if (*(char *)(param_1 + 0xc) == '\0') {\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }\n  else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" (if "if") (parenthesized_expression "(*(char *)(param_1 + 0xc) == '\0')" (( "(") (binary_expression "*(char *)(param_1 + 0xc) == '\0'" (pointer_expression "*(char *)(param_1 + 0xc)" (* "*") (cast_expression "(char *)(param_1 + 0xc)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n    if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }\n  }" ({ "{") (if_statement "if (param_2 < param_3) {\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }" (if "if") (parenthesized_expression "(param_2 < param_3)" (( "(") (binary_expression "param_2 < param_3" (identifier "param_2") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n      iVar1 = -1 - (int)param_2;\n      puVar4 = param_5;\n      do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);\n    }" ({ "{") (expression_statement "iVar1 = -1 - (int)param_2;" (assignment_expression "iVar1 = -1 - (int)param_2" (identifier "iVar1") (= "=") (binary_expression "-1 - (int)param_2" (number_literal "-1") (- "-") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2")))) (; ";")) (expression_statement "puVar4 = param_5;" (assignment_expression "puVar4 = param_5" (identifier "puVar4") (= "=") (identifier "param_5")) (; ";")) (do_statement "do {\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);" (do "do") (compound_statement "{\n                    \n        uVar3 = wctob(*param_2);\n        if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = (char)uVar3;\n        puVar4 = puVar5;\n      }" ({ "{") (expression_statement "uVar3 = wctob(*param_2);" (assignment_expression "uVar3 = wctob(*param_2)" (identifier "uVar3") (= "=") (call_expression "wctob(*param_2)" (identifier "wctob") (argument_list "(*param_2)" (( "(") (pointer_expression "*param_2" (* "*") (identifier "param_2")) () ")")))) (; ";")) (if_statement "if (uVar3 == 0xffffffff) {\n          uVar3 = (uint)param_4;\n        }" (if "if") (parenthesized_expression "(uVar3 == 0xffffffff)" (( "(") (binary_expression "uVar3 == 0xffffffff" (identifier "uVar3") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n          uVar3 = (uint)param_4;\n        }" ({ "{") (expression_statement "uVar3 = (uint)param_4;" (assignment_expression "uVar3 = (uint)param_4" (identifier "uVar3") (= "=") (cast_expression "(uint)param_4" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "param_4"))) (; ";")) (} "}"))) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" (identifier "puVar5") (= "=") (binary_expression "puVar4 + 1" (identifier "puVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*puVar4 = (char)uVar3;" (assignment_expression "*puVar4 = (char)uVar3" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (cast_expression "(char)uVar3" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "uVar3"))) (; ";")) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" (identifier "puVar4") (= "=") (identifier "puVar5")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5)" (( "(") (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" (identifier "param_5") (+ "+") (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" (( "(") (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((int)param_3 + iVar1)" (( "(") (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3")) (+ "+") (identifier "iVar1")) () ")"))) (>> ">>") (number_literal "2")) () ")"))) (+ "+") (number_literal "1")) (!= "!=") (identifier "puVar5")) () ")")) (; ";")) (} "}"))) (} "}")) (else_clause "else if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" (else "else") (if_statement "if (param_2 < param_3) {\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" (if "if") (parenthesized_expression "(param_2 < param_3)" (( "(") (binary_expression "param_2 < param_3" (identifier "param_2") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    iVar1 = -1 - (int)param_2;\n    puVar4 = param_5;\n    do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);\n  }" ({ "{") (expression_statement "iVar1 = -1 - (int)param_2;" (assignment_expression "iVar1 = -1 - (int)param_2" (identifier "iVar1") (= "=") (binary_expression "-1 - (int)param_2" (number_literal "-1") (- "-") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2")))) (; ";")) (expression_statement "puVar4 = param_5;" (assignment_expression "puVar4 = param_5" (identifier "puVar4") (= "=") (identifier "param_5")) (; ";")) (do_statement "do {\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);" (do "do") (compound_statement "{\n      while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }\n                    \n      uVar3 = wctob(uVar3);\n      if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }\n      param_2 = param_2 + 1;\n      puVar5 = puVar4 + 1;\n      *puVar4 = (char)uVar3;\n      puVar4 = puVar5;\n    }" ({ "{") (while_statement "while (uVar3 = *param_2, uVar3 < 0x80) {\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }" (while "while") (parenthesized_expression "(uVar3 = *param_2, uVar3 < 0x80)" (( "(") (comma_expression "uVar3 = *param_2, uVar3 < 0x80" (assignment_expression "uVar3 = *param_2" (identifier "uVar3") (= "=") (pointer_expression "*param_2" (* "*") (identifier "param_2"))) (, ",") (binary_expression "uVar3 < 0x80" (identifier "uVar3") (< "<") (number_literal "0x80"))) () ")")) (compound_statement "{\n        param_2 = param_2 + 1;\n        puVar5 = puVar4 + 1;\n        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);\n        puVar4 = puVar5;\n        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;\n      }" ({ "{") (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" (identifier "puVar5") (= "=") (binary_expression "puVar4 + 1" (identifier "puVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);" (assignment_expression "*puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3)" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (pointer_expression "*(undefined1 *)(param_1 + 0xd + uVar3)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0xd + uVar3)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd + uVar3)" (( "(") (binary_expression "param_1 + 0xd + uVar3" (binary_expression "param_1 + 0xd" (identifier "param_1") (+ "+") (number_literal "0xd")) (+ "+") (identifier "uVar3")) () ")"))))) (; ";")) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" (identifier "puVar4") (= "=") (identifier "puVar5")) (; ";")) (if_statement "if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;" (if "if") (parenthesized_expression "(puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1)" (( "(") (binary_expression "puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (identifier "puVar5") (== "==") (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" (identifier "param_5") (+ "+") (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" (( "(") (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((int)param_3 + iVar1)" (( "(") (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3")) (+ "+") (identifier "iVar1")) () ")"))) (>> ">>") (number_literal "2")) () ")"))) (+ "+") (number_literal "1"))) () ")")) (goto_statement "goto LAB_002217f4;" (goto "goto") (statement_identifier "LAB_002217f4") (; ";"))) (} "}"))) (expression_statement "uVar3 = wctob(uVar3);" (assignment_expression "uVar3 = wctob(uVar3)" (identifier "uVar3") (= "=") (call_expression "wctob(uVar3)" (identifier "wctob") (argument_list "(uVar3)" (( "(") (identifier "uVar3") () ")")))) (; ";")) (if_statement "if (uVar3 == 0xffffffff) {\n        uVar3 = (uint)param_4;\n      }" (if "if") (parenthesized_expression "(uVar3 == 0xffffffff)" (( "(") (binary_expression "uVar3 == 0xffffffff" (identifier "uVar3") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n        uVar3 = (uint)param_4;\n      }" ({ "{") (expression_statement "uVar3 = (uint)param_4;" (assignment_expression "uVar3 = (uint)param_4" (identifier "uVar3") (= "=") (cast_expression "(uint)param_4" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "param_4"))) (; ";")) (} "}"))) (expression_statement "param_2 = param_2 + 1;" (assignment_expression "param_2 = param_2 + 1" (identifier "param_2") (= "=") (binary_expression "param_2 + 1" (identifier "param_2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "puVar5 = puVar4 + 1;" (assignment_expression "puVar5 = puVar4 + 1" (identifier "puVar5") (= "=") (binary_expression "puVar4 + 1" (identifier "puVar4") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "*puVar4 = (char)uVar3;" (assignment_expression "*puVar4 = (char)uVar3" (pointer_expression "*puVar4" (* "*") (identifier "puVar4")) (= "=") (cast_expression "(char)uVar3" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "uVar3"))) (; ";")) (expression_statement "puVar4 = puVar5;" (assignment_expression "puVar4 = puVar5" (identifier "puVar4") (= "=") (identifier "puVar5")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1)" (( "(") (binary_expression "puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (identifier "puVar5") (!= "!=") (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1" (binary_expression "param_5 + ((uint)((int)param_3 + iVar1) >> 2)" (identifier "param_5") (+ "+") (parenthesized_expression "((uint)((int)param_3 + iVar1) >> 2)" (( "(") (binary_expression "(uint)((int)param_3 + iVar1) >> 2" (call_expression "(uint)((int)param_3 + iVar1)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "((int)param_3 + iVar1)" (( "(") (binary_expression "(int)param_3 + iVar1" (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3")) (+ "+") (identifier "iVar1")) () ")"))) (>> ">>") (number_literal "2")) () ")"))) (+ "+") (number_literal "1"))) () ")")) (; ";")) (} "}"))))) (labeled_statement "LAB_002217f4:\n  __uselocale(uVar2);" (statement_identifier "LAB_002217f4") (: ":") (expression_statement "__uselocale(uVar2);" (call_expression "__uselocale(uVar2)" (identifier "__uselocale") (argument_list "(uVar2)" (( "(") (identifier "uVar2") () ")"))) (; ";"))) (return_statement "return param_3;" (return "return") (identifier "param_3") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* std::ctype<wchar_t>::do_narrow(wchar_t const*, wchar_t const*, char, char*) const */

type_1 * __thiscall
std::var_1<type_1>::do_narrow
          (var_1<type_1> *var_3,type_1 *var_4,type_1 *var_5,char param_3,char *var_9)

{
  type_1 var_13;
  int var_10;
  type_2 uVar2;
  type_3 var_7;
  var_1<type_1> *var_12;
  var_1<type_1> *var_14;
  char *var_8;
  char *var_11;
  
  uVar2 = var_2(*(type_2 *)(var_3 + 8));
  if (var_3[0xc] == (var_1<type_1>)0x0) {
    if (var_4 < var_5) {
      var_10 = -1 - (int)var_4;
      var_8 = var_9;
      do {
                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */
        var_7 = var_6(*var_4);
        if (var_7 == 0xffffffff) {
          var_7 = (type_3)(type_4)param_3;
        }
        var_4 = var_4 + 1;
        var_11 = var_8 + 1;
        *var_8 = (char)var_7;
        var_8 = var_11;
      } while (var_9 + ((type_3)((int)var_5 + var_10) >> 2) + 1 != var_11);
    }
  }
  else if (var_4 < var_5) {
    var_10 = -1 - (int)var_4;
    var_12 = (var_1<type_1> *)var_9;
    do {
      while (var_13 = *var_4, (type_3)var_13 < 0x80) {
        var_4 = var_4 + 1;
        var_14 = var_12 + 1;
        *var_12 = var_3[var_13 + L'\r'];
        var_12 = var_14;
        if (var_14 == (var_1<type_1> *)(var_9 + ((type_3)((int)var_5 + var_10) >> 2) + 1))
        goto LAB_002217f4;
      }
                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */
      var_7 = var_6(var_13);
      if (var_7 == 0xffffffff) {
        var_7 = (type_3)(type_4)param_3;
      }
      var_4 = var_4 + 1;
      var_14 = var_12 + 1;
      *var_12 = var_15(var_7,0);
      var_12 = var_14;
    } while (var_14 != (var_1<type_1> *)(var_9 + ((type_3)((int)var_5 + var_10) >> 2) + 1));
  }
LAB_002217f4:
  var_2(uVar2);
  return var_5;
}


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

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

uint * MASKED(int param_1,uint *param_2,uint *param_3,byte param_4,undefined1 *param_5)

{
  int iVar1;
  undefined4 uVar2;
  uint uVar3;
  undefined1 *puVar4;
  undefined1 *puVar5;
  
  uVar2 = __uselocale(*(undefined4 *)(param_1 + 8));
  if (*(char *)(param_1 + 0xc) == '\0') {
    if (param_2 < param_3) {
      iVar1 = -1 - (int)param_2;
      puVar4 = param_5;
      do {
                    /* try { // try from 00221838 to 0022183c has its CatchHandler @ 0022185a */
        uVar3 = wctob(*param_2);
        if (uVar3 == 0xffffffff) {
          uVar3 = (uint)param_4;
        }
        param_2 = param_2 + 1;
        puVar5 = puVar4 + 1;
        *puVar4 = (char)uVar3;
        puVar4 = puVar5;
      } while (param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1 != puVar5);
    }
  }
  else if (param_2 < param_3) {
    iVar1 = -1 - (int)param_2;
    puVar4 = param_5;
    do {
      while (uVar3 = *param_2, uVar3 < 0x80) {
        param_2 = param_2 + 1;
        puVar5 = puVar4 + 1;
        *puVar4 = *(undefined1 *)(param_1 + 0xd + uVar3);
        puVar4 = puVar5;
        if (puVar5 == param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1) goto LAB_002217f4;
      }
                    /* try { // try from 002217d4 to 002217d8 has its CatchHandler @ 0022185f */
      uVar3 = wctob(uVar3);
      if (uVar3 == 0xffffffff) {
        uVar3 = (uint)param_4;
      }
      param_2 = param_2 + 1;
      puVar5 = puVar4 + 1;
      *puVar4 = (char)uVar3;
      puVar4 = puVar5;
    } while (puVar5 != param_5 + ((uint)((int)param_3 + iVar1) >> 2) + 1);
  }
LAB_002217f4:
  __uselocale(uVar2);
  return param_3;
}

