
/* std::ctype<wchar_t>::do_toupper(wchar_t*, wchar_t const*) const */

wchar_t * __thiscall
std::ctype<wchar_t>::do_toupper(ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2)

{
  wchar_t wVar1;
  wchar_t *pwVar2;
  wchar_t *pwVar3;
  
  if (param_1 < param_2) {
    pwVar2 = param_1;
    do {
      pwVar3 = pwVar2 + 1;
      wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));
      *pwVar2 = wVar1;
      pwVar2 = pwVar3;
    } while (pwVar3 != (wchar_t *)
                       ((long)param_1 +
                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4));
  }
  return param_2;
}



undefined4 * FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  
  if (param_2 < param_3) {
    puVar2 = param_2;
    do {
      puVar3 = puVar2 + 1;
      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));
      *puVar2 = uVar1;
      puVar2 = puVar3;
    } while (puVar3 != (undefined4 *)
                       ((long)param_2 +
                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));
  }
  return param_3;
}


PUSH R13
MOV R13,RDX
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x8
CMP RSI,RDX
JNC 0x0030fae7
LEA RAX,[RDX + -0x1]
MOV RBP,RDI
MOV RBX,RSI
SUB RAX,RSI
SHR RAX,0x2
LEA R12,[RSI + RAX*0x4 + 0x4]
NOP dword ptr [RAX + RAX*0x1]
MOV EDI,dword ptr [RBX]
MOV RSI,qword ptr [RBP + 0x10]
ADD RBX,0x4
CALL 0x001473b0
MOV dword ptr [RBX + -0x4],EAX
CMP RBX,R12
JNZ 0x0030fad0
ADD RSP,0x8
MOV RAX,R13
POP RBX
POP RBP
POP R12
POP R13
RET
(translation_unit "undefined4 * FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}\n\n" (function_definition "undefined4 * FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}" type_identifier (pointer_declarator "* FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)" * (function_declarator "FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)" identifier (parameter_list "(long param_1,undefined4 *param_2,undefined4 *param_3)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (if_statement "if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }" { (expression_statement "puVar2 = param_2;" (assignment_expression "puVar2 = param_2" identifier = identifier) ;) (do_statement "do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));" do (compound_statement "{\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    }" { (expression_statement "puVar3 = puVar2 + 1;" (assignment_expression "puVar3 = puVar2 + 1" identifier = (binary_expression "puVar2 + 1" identifier + number_literal)) ;) (expression_statement "uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));" (assignment_expression "uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10))" identifier = (call_expression "__towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10))" identifier (argument_list "(*puVar2,*(undefined8 *)(param_1 + 0x10))" ( (pointer_expression "*puVar2" * identifier) , (pointer_expression "*(undefined8 *)(param_1 + 0x10)" * (cast_expression "(undefined8 *)(param_1 + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) )))) ;) (expression_statement "*puVar2 = uVar1;" (assignment_expression "*puVar2 = uVar1" (pointer_expression "*puVar2" * identifier) = identifier) ;) (expression_statement "puVar2 = puVar3;" (assignment_expression "puVar2 = puVar3" identifier = identifier) ;) }) while (parenthesized_expression "(puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4))" ( (binary_expression "puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" identifier != (cast_expression "(undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" ( (binary_expression "(long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4" (binary_expression "(long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU)" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU)" ( (binary_expression "(long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU" (binary_expression "(long)param_3 + (-1 - (long)param_2)" (cast_expression "(long)param_3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(-1 - (long)param_2)" ( (binary_expression "-1 - (long)param_2" number_literal - (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) & number_literal) ))) + number_literal) )))) )) ;) })) (return_statement "return param_3;" return identifier ;) })))
(translation_unit "/* std::ctype<wchar_t>::do_toupper(wchar_t*, wchar_t const*) const */\n\nwchar_t * __thiscall\nstd::ctype<wchar_t>::do_toupper(ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2)\n\n{\n  wchar_t wVar1;\n  wchar_t *pwVar2;\n  wchar_t *pwVar3;\n  \n  if (param_1 < param_2) {\n    pwVar2 = param_1;\n    do {\n      pwVar3 = pwVar2 + 1;\n      wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));\n      *pwVar2 = wVar1;\n      pwVar2 = pwVar3;\n    } while (pwVar3 != (wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_2;\n}\n\n" comment (ERROR "wchar_t * __thiscall\nstd::ctype<wchar_t>::do_toupper(ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2)" (binary_expression "wchar_t * __thiscall\nstd::ctype<wchar_t>::do_toupper(ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2)" (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_toupper(ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2)" identifier (argument_list "(ctype<wchar_t> *this,wchar_t *param_1,wchar_t *param_2)" ( (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) ))))) (compound_statement "{\n  wchar_t wVar1;\n  wchar_t *pwVar2;\n  wchar_t *pwVar3;\n  \n  if (param_1 < param_2) {\n    pwVar2 = param_1;\n    do {\n      pwVar3 = pwVar2 + 1;\n      wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));\n      *pwVar2 = wVar1;\n      pwVar2 = pwVar3;\n    } while (pwVar3 != (wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_2;\n}" { (declaration "wchar_t wVar1;" type_identifier identifier ;) (declaration "wchar_t *pwVar2;" type_identifier (pointer_declarator "*pwVar2" * identifier) ;) (declaration "wchar_t *pwVar3;" type_identifier (pointer_declarator "*pwVar3" * identifier) ;) (if_statement "if (param_1 < param_2) {\n    pwVar2 = param_1;\n    do {\n      pwVar3 = pwVar2 + 1;\n      wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));\n      *pwVar2 = wVar1;\n      pwVar2 = pwVar3;\n    } while (pwVar3 != (wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4));\n  }" if (parenthesized_expression "(param_1 < param_2)" ( (binary_expression "param_1 < param_2" identifier < identifier) )) (compound_statement "{\n    pwVar2 = param_1;\n    do {\n      pwVar3 = pwVar2 + 1;\n      wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));\n      *pwVar2 = wVar1;\n      pwVar2 = pwVar3;\n    } while (pwVar3 != (wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4));\n  }" { (expression_statement "pwVar2 = param_1;" (assignment_expression "pwVar2 = param_1" identifier = identifier) ;) (do_statement "do {\n      pwVar3 = pwVar2 + 1;\n      wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));\n      *pwVar2 = wVar1;\n      pwVar2 = pwVar3;\n    } while (pwVar3 != (wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4));" do (compound_statement "{\n      pwVar3 = pwVar2 + 1;\n      wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));\n      *pwVar2 = wVar1;\n      pwVar2 = pwVar3;\n    }" { (expression_statement "pwVar3 = pwVar2 + 1;" (assignment_expression "pwVar3 = pwVar2 + 1" identifier = (binary_expression "pwVar2 + 1" identifier + number_literal)) ;) (expression_statement "wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10));" (assignment_expression "wVar1 = __towupper_l(*pwVar2,*(undefined8 *)(this + 0x10))" identifier = (call_expression "__towupper_l(*pwVar2,*(undefined8 *)(this + 0x10))" identifier (argument_list "(*pwVar2,*(undefined8 *)(this + 0x10))" ( (pointer_expression "*pwVar2" * identifier) , (pointer_expression "*(undefined8 *)(this + 0x10)" * (cast_expression "(undefined8 *)(this + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(this + 0x10)" ( (binary_expression "this + 0x10" identifier + number_literal) )))) )))) ;) (expression_statement "*pwVar2 = wVar1;" (assignment_expression "*pwVar2 = wVar1" (pointer_expression "*pwVar2" * identifier) = identifier) ;) (expression_statement "pwVar2 = pwVar3;" (assignment_expression "pwVar2 = pwVar3" identifier = identifier) ;) }) while (parenthesized_expression "(pwVar3 != (wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4))" ( (binary_expression "pwVar3 != (wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4)" identifier != (cast_expression "(wchar_t *)\n                       ((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4)" ( (binary_expression "(long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU) + 4" (binary_expression "(long)param_1 +\n                       ((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU)" (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "((long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU)" ( (binary_expression "(long)param_2 + (-1 - (long)param_1) & 0xfffffffffffffffcU" (binary_expression "(long)param_2 + (-1 - (long)param_1)" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(-1 - (long)param_1)" ( (binary_expression "-1 - (long)param_1" number_literal - (cast_expression "(long)param_1" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) & number_literal) ))) + number_literal) )))) )) ;) })) (return_statement "return param_2;" return identifier ;) }))
(translation_unit "undefined4 * FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}\n\n" (function_definition "undefined4 * FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}" type_identifier (pointer_declarator "* FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)" * (function_declarator "FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)" identifier (parameter_list "(long param_1,undefined4 *param_2,undefined4 *param_3)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined4 *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "undefined4 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (declaration "undefined4 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined4 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (if_statement "if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }" if (parenthesized_expression "(param_2 < param_3)" ( (binary_expression "param_2 < param_3" identifier < identifier) )) (compound_statement "{\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }" { (expression_statement "puVar2 = param_2;" (assignment_expression "puVar2 = param_2" identifier = identifier) ;) (do_statement "do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));" do (compound_statement "{\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    }" { (expression_statement "puVar3 = puVar2 + 1;" (assignment_expression "puVar3 = puVar2 + 1" identifier = (binary_expression "puVar2 + 1" identifier + number_literal)) ;) (expression_statement "uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));" (assignment_expression "uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10))" identifier = (call_expression "__towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10))" identifier (argument_list "(*puVar2,*(undefined8 *)(param_1 + 0x10))" ( (pointer_expression "*puVar2" * identifier) , (pointer_expression "*(undefined8 *)(param_1 + 0x10)" * (cast_expression "(undefined8 *)(param_1 + 0x10)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) )))) ;) (expression_statement "*puVar2 = uVar1;" (assignment_expression "*puVar2 = uVar1" (pointer_expression "*puVar2" * identifier) = identifier) ;) (expression_statement "puVar2 = puVar3;" (assignment_expression "puVar2 = puVar3" identifier = identifier) ;) }) while (parenthesized_expression "(puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4))" ( (binary_expression "puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" identifier != (cast_expression "(undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" ( (binary_expression "(long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4" (binary_expression "(long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU)" (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU)" ( (binary_expression "(long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU" (binary_expression "(long)param_3 + (-1 - (long)param_2)" (cast_expression "(long)param_3" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) + (parenthesized_expression "(-1 - (long)param_2)" ( (binary_expression "-1 - (long)param_2" number_literal - (cast_expression "(long)param_2" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier)) ))) & number_literal) ))) + number_literal) )))) )) ;) })) (return_statement "return param_3;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (parenthesized_expression ( (binary_expression (binary_expression (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT) + (parenthesized_expression ( (binary_expression LIT - (cast_expression ( (type_descriptor (sized_type_specifier long)) ) IDENT)) ))) & LIT) ))) + LIT) )))) )) ;) })) (return_statement return IDENT ;) })))
(function_definition "undefined4 * FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)\n\n{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}" (type_identifier "undefined4") (pointer_declarator "* FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)" (* "*") (function_declarator "FUN_0030faa0(long param_1,undefined4 *param_2,undefined4 *param_3)" (identifier "FUN_0030faa0") (parameter_list "(long param_1,undefined4 *param_2,undefined4 *param_3)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "undefined4 *param_2" (type_identifier "undefined4") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "undefined4 *param_3" (type_identifier "undefined4") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")")))) (compound_statement "{\n  undefined4 uVar1;\n  undefined4 *puVar2;\n  undefined4 *puVar3;\n  \n  if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }\n  return param_3;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (declaration "undefined4 *puVar2;" (type_identifier "undefined4") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "undefined4 *puVar3;" (type_identifier "undefined4") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (if_statement "if (param_2 < param_3) {\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }" (if "if") (parenthesized_expression "(param_2 < param_3)" (( "(") (binary_expression "param_2 < param_3" (identifier "param_2") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n    puVar2 = param_2;\n    do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));\n  }" ({ "{") (expression_statement "puVar2 = param_2;" (assignment_expression "puVar2 = param_2" (identifier "puVar2") (= "=") (identifier "param_2")) (; ";")) (do_statement "do {\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    } while (puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));" (do "do") (compound_statement "{\n      puVar3 = puVar2 + 1;\n      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));\n      *puVar2 = uVar1;\n      puVar2 = puVar3;\n    }" ({ "{") (expression_statement "puVar3 = puVar2 + 1;" (assignment_expression "puVar3 = puVar2 + 1" (identifier "puVar3") (= "=") (binary_expression "puVar2 + 1" (identifier "puVar2") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));" (assignment_expression "uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10))" (identifier "uVar1") (= "=") (call_expression "__towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10))" (identifier "__towupper_l") (argument_list "(*puVar2,*(undefined8 *)(param_1 + 0x10))" (( "(") (pointer_expression "*puVar2" (* "*") (identifier "puVar2")) (, ",") (pointer_expression "*(undefined8 *)(param_1 + 0x10)" (* "*") (cast_expression "(undefined8 *)(param_1 + 0x10)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) () ")")))) (; ";")) (expression_statement "*puVar2 = uVar1;" (assignment_expression "*puVar2 = uVar1" (pointer_expression "*puVar2" (* "*") (identifier "puVar2")) (= "=") (identifier "uVar1")) (; ";")) (expression_statement "puVar2 = puVar3;" (assignment_expression "puVar2 = puVar3" (identifier "puVar2") (= "=") (identifier "puVar3")) (; ";")) (} "}")) (while "while") (parenthesized_expression "(puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4))" (( "(") (binary_expression "puVar3 != (undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" (identifier "puVar3") (!= "!=") (cast_expression "(undefined4 *)\n                       ((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4)" (( "(") (binary_expression "(long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4" (binary_expression "(long)param_2 +\n                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU)" (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2")) (+ "+") (parenthesized_expression "((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU)" (( "(") (binary_expression "(long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU" (binary_expression "(long)param_3 + (-1 - (long)param_2)" (cast_expression "(long)param_3" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_3")) (+ "+") (parenthesized_expression "(-1 - (long)param_2)" (( "(") (binary_expression "-1 - (long)param_2" (number_literal "-1") (- "-") (cast_expression "(long)param_2" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "param_2"))) () ")"))) (& "&") (number_literal "0xfffffffffffffffcU")) () ")"))) (+ "+") (number_literal "4")) () ")")))) () ")")) (; ";")) (} "}"))) (return_statement "return param_3;" (return "return") (identifier "param_3") (; ";")) (} "}")))

/* std::ctype<wchar_t>::do_toupper(wchar_t*, wchar_t const*) const */

type_1 * __thiscall
std::ctype<type_1>::do_toupper(ctype<type_1> *var_5,type_1 *var_1,type_1 *var_2)

{
  type_1 wVar1;
  type_1 *var_3;
  type_1 *var_6;
  
  if (var_1 < var_2) {
    var_3 = var_1;
    do {
      var_6 = var_3 + 1;
      wVar1 = var_4(*var_3,*(type_2 *)(var_5 + 0x10));
      *var_3 = wVar1;
      var_3 = var_6;
    } while (var_6 != (type_1 *)
                       ((long)var_1 +
                       ((long)var_2 + (-1 - (long)var_1) & 0xfffffffffffffffcU) + 4));
  }
  return var_2;
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier)))))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (identifier))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)) (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier)))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (parenthesized_expression (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier)) right: (parenthesized_expression (binary_expression left: (number_literal) right: (cast_expression type: (type_descriptor type: (sized_type_specifier)) value: (identifier))))) right: (number_literal)))) right: (number_literal))))))))) (return_statement (identifier)))))

undefined4 * MASKED(long param_1,undefined4 *param_2,undefined4 *param_3)

{
  undefined4 uVar1;
  undefined4 *puVar2;
  undefined4 *puVar3;
  
  if (param_2 < param_3) {
    puVar2 = param_2;
    do {
      puVar3 = puVar2 + 1;
      uVar1 = __towupper_l(*puVar2,*(undefined8 *)(param_1 + 0x10));
      *puVar2 = uVar1;
      puVar2 = puVar3;
    } while (puVar3 != (undefined4 *)
                       ((long)param_2 +
                       ((long)param_3 + (-1 - (long)param_2) & 0xfffffffffffffffcU) + 4));
  }
  return param_3;
}

