
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

kwset_t kwsinit(_Bool mb_trans)

{
  int iVar1;
  wchar_t __wc;
  __int32_t *p_Var2;
  size_t sVar3;
  kwset_t pkVar4;
  wchar_t __wc_00;
  __int32_t **pp_Var5;
  int iVar6;
  char *trans;
  int in_GS_OFFSET;
  mbstate_t mbs;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  if ((match_icase) && ((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)))) {
    trans = (char *)xmalloc(0x100);
    sVar3 = __ctype_get_mb_cur_max();
    if (sVar3 == 1) {
      pp_Var5 = __ctype_toupper_loc();
      p_Var2 = *pp_Var5;
      iVar6 = 0;
      do {
        trans[iVar6] = (char)p_Var2[iVar6];
        iVar6 = iVar6 + 1;
      } while (iVar6 != 0x100);
    }
    else {
      iVar6 = 0;
      do {
        __wc = localeinfo.sbctowc[iVar6];
        __wc_00 = towupper(__wc);
        if (__wc == __wc_00) {
          trans[iVar6] = (char)iVar6;
        }
        else {
          mbs.__count = 0;
          mbs.__value.__wch = 0;
          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);
          if (sVar3 != 1) {
                    /* WARNING: Subroutine does not return */
            abort();
          }
        }
        iVar6 = iVar6 + 1;
      } while (iVar6 != 0x100);
    }
  }
  else {
    trans = (char *)0x0;
  }
  pkVar4 = kwsalloc(trans);
  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  return pkVar4;
}



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

void FUN_0001e980(char param_1)

{
  wchar_t __wc;
  __int32_t *p_Var1;
  size_t sVar2;
  wchar_t __wc_00;
  __int32_t **pp_Var3;
  int iVar4;
  int iVar5;
  int in_GS_OFFSET;
  mbstate_t local_28;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1e989;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((DAT_0004ca26 == '\0') ||
     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {
    iVar5 = 0;
  }
  else {
    iVar5 = FUN_0002efa0(0x100);
    sVar2 = __ctype_get_mb_cur_max();
    if (sVar2 == 1) {
      pp_Var3 = __ctype_toupper_loc();
      p_Var1 = *pp_Var3;
      iVar4 = 0;
      do {
        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];
        iVar4 = iVar4 + 1;
      } while (iVar4 != 0x100);
    }
    else {
      iVar4 = 0;
      do {
        __wc = (&DAT_0004c624)[iVar4];
        __wc_00 = towupper(__wc);
        if (__wc == __wc_00) {
          *(char *)(iVar5 + iVar4) = (char)iVar4;
        }
        else {
          local_28.__count = 0;
          local_28.__value.__wch = 0;
          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);
          if (sVar2 != 1) {
                    /* WARNING: Subroutine does not return */
            abort();
          }
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 != 0x100);
    }
  }
  FUN_0001a8c0(iVar5);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_00038830();
  }
  return;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000142a0
ADD EBX,0x29463
SUB ESP,0x2c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x1c],EAX
XOR EAX,EAX
MOV ESI,dword ptr [ESP + 0x40]
LEA EAX,[EBX + 0x4c3a]
CMP byte ptr [EAX],0x0
JZ 0x0001e9bd
CALL 0x00012240
CMP EAX,0x1
JZ 0x0001e9e8
MOV EAX,ESI
TEST AL,AL
JNZ 0x0001e9e8
XOR EDI,EDI
SUB ESP,0xc
PUSH EDI
CALL 0x0001a8c0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x1c]
XOR EDX,dword ptr GS:[0x14]
JNZ 0x0001eaa5
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH 0x100
CALL 0x0002efa0
MOV EDI,EAX
CALL 0x00012240
ADD ESP,0x10
CMP EAX,0x1
JZ 0x0001ea7e
LEA EAX,[EBX + 0x4734]
XOR ESI,ESI
MOV dword ptr [ESP + 0x8],EAX
LEA EAX,[ESP + 0x14]
MOV dword ptr [ESP + 0xc],EAX
JMP 0x0001ea59
MOV dword ptr [ESP + 0x14],0x0
SUB ESP,0x4
MOV dword ptr [ESP + 0x1c],0x0
PUSH dword ptr [ESP + 0x10]
PUSH EAX
PUSH ECX
CALL 0x00012060
ADD ESP,0x10
CMP EAX,0x1
JNZ 0x0001275a
ADD ESI,0x1
CMP ESI,0x100
JZ 0x0001e9bf
MOV EAX,dword ptr [ESP + 0x8]
SUB ESP,0xc
MOV EBP,dword ptr [EAX + ESI*0x4 + 0x104]
PUSH EBP
CALL 0x00012670
ADD ESP,0x10
LEA ECX,[EDI + ESI*0x1]
CMP EBP,EAX
JNZ 0x0001ea20
MOV EAX,ESI
MOV byte ptr [EDI + ESI*0x1],AL
JMP 0x0001ea4a
CALL 0x00012040
MOV ECX,dword ptr [EAX]
XOR EAX,EAX
LEA ESI,[ESI]
NOP
MOV EDX,dword ptr [ECX + EAX*0x4]
MOV byte ptr [EDI + EAX*0x1],DL
ADD EAX,0x1
CMP EAX,0x100
JNZ 0x0001ea90
JMP 0x0001e9bf
CALL 0x00038830
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid FUN_0001e980(char param_1)\n\n{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00038830();\n  }\n  return;\n}\n\n" comment (function_definition "void FUN_0001e980(char param_1)\n\n{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00038830();\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0001e980(char param_1)" identifier (parameter_list "(char param_1)" ( (parameter_declaration "char param_1" primitive_type identifier) ))) (compound_statement "{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00038830();\n  }\n  return;\n}" { (declaration "wchar_t __wc;" type_identifier identifier ;) (declaration "__int32_t *p_Var1;" type_identifier (pointer_declarator "*p_Var1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "wchar_t __wc_00;" type_identifier identifier ;) (declaration "__int32_t **pp_Var3;" type_identifier (pointer_declarator "**pp_Var3" * (pointer_declarator "*pp_Var3" * identifier)) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "mbstate_t local_28;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1e989;" (assignment_expression "uStack_14 = 0x1e989" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" if (parenthesized_expression "((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0'))))" ( (binary_expression "(DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))" (parenthesized_expression "(DAT_0004ca26 == '\0')" ( (binary_expression "DAT_0004ca26 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) || (parenthesized_expression "((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))" ( (parenthesized_expression "(sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0'))" ( (comma_expression "sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')" (assignment_expression "sVar2 = __ctype_get_mb_cur_max()" identifier = (call_expression "__ctype_get_mb_cur_max()" identifier (argument_list "()" ( )))) , (binary_expression "sVar2 != 1 && (param_1 == '\0')" (binary_expression "sVar2 != 1" identifier != number_literal) && (parenthesized_expression "(param_1 == '\0')" ( (binary_expression "param_1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )))) )) ))) )) (compound_statement "{\n    iVar5 = 0;\n  }" { (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" else (compound_statement "{\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" { (expression_statement "iVar5 = FUN_0002efa0(0x100);" (assignment_expression "iVar5 = FUN_0002efa0(0x100)" identifier = (call_expression "FUN_0002efa0(0x100)" identifier (argument_list "(0x100)" ( number_literal )))) ;) (expression_statement "sVar2 = __ctype_get_mb_cur_max();" (assignment_expression "sVar2 = __ctype_get_mb_cur_max()" identifier = (call_expression "__ctype_get_mb_cur_max()" identifier (argument_list "()" ( )))) ;) (if_statement "if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" if (parenthesized_expression "(sVar2 == 1)" ( (binary_expression "sVar2 == 1" identifier == number_literal) )) (compound_statement "{\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" { (expression_statement "pp_Var3 = __ctype_toupper_loc();" (assignment_expression "pp_Var3 = __ctype_toupper_loc()" identifier = (call_expression "__ctype_toupper_loc()" identifier (argument_list "()" ( )))) ;) (expression_statement "p_Var1 = *pp_Var3;" (assignment_expression "p_Var1 = *pp_Var3" identifier = (pointer_expression "*pp_Var3" * identifier)) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);" do (compound_statement "{\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      }" { (expression_statement "*(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];" (assignment_expression "*(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4]" (pointer_expression "*(char *)(iVar5 + iVar4)" * (cast_expression "(char *)(iVar5 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar4)" ( (binary_expression "iVar5 + iVar4" identifier + identifier) )))) = (cast_expression "(char)p_Var1[iVar4]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "p_Var1[iVar4]" identifier [ identifier ]))) ;) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar4 != 0x100)" ( (binary_expression "iVar4 != 0x100" identifier != number_literal) )) ;) }) (else_clause "else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" else (compound_statement "{\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" { (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);" do (compound_statement "{\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      }" { (expression_statement "__wc = (&DAT_0004c624)[iVar4];" (assignment_expression "__wc = (&DAT_0004c624)[iVar4]" identifier = (subscript_expression "(&DAT_0004c624)[iVar4]" (parenthesized_expression "(&DAT_0004c624)" ( (pointer_expression "&DAT_0004c624" & identifier) )) [ identifier ])) ;) (expression_statement "__wc_00 = towupper(__wc);" (assignment_expression "__wc_00 = towupper(__wc)" identifier = (call_expression "towupper(__wc)" identifier (argument_list "(__wc)" ( identifier )))) ;) (if_statement "if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }" if (parenthesized_expression "(__wc == __wc_00)" ( (binary_expression "__wc == __wc_00" identifier == identifier) )) (compound_statement "{\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }" { (expression_statement "*(char *)(iVar5 + iVar4) = (char)iVar4;" (assignment_expression "*(char *)(iVar5 + iVar4) = (char)iVar4" (pointer_expression "*(char *)(iVar5 + iVar4)" * (cast_expression "(char *)(iVar5 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar4)" ( (binary_expression "iVar5 + iVar4" identifier + identifier) )))) = (cast_expression "(char)iVar4" ( (type_descriptor "char" primitive_type) ) identifier)) ;) }) (else_clause "else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }" else (compound_statement "{\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }" { (expression_statement "local_28.__count = 0;" (assignment_expression "local_28.__count = 0" (field_expression "local_28.__count" identifier . field_identifier) = number_literal) ;) (expression_statement "local_28.__value.__wch = 0;" (assignment_expression "local_28.__value.__wch = 0" (field_expression "local_28.__value.__wch" (field_expression "local_28.__value" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);" (assignment_expression "sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28)" identifier = (call_expression "wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28)" identifier (argument_list "((char *)(iVar5 + iVar4),__wc_00,&local_28)" ( (cast_expression "(char *)(iVar5 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar4)" ( (binary_expression "iVar5 + iVar4" identifier + identifier) ))) , identifier , (pointer_expression "&local_28" & identifier) )))) ;) (if_statement "if (sVar2 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }" if (parenthesized_expression "(sVar2 != 1)" ( (binary_expression "sVar2 != 1" identifier != number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }" { comment (expression_statement "abort();" (call_expression "abort()" identifier (argument_list "()" ( ))) ;) })) }))) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar4 != 0x100)" ( (binary_expression "iVar4 != 0x100" identifier != number_literal) )) ;) }))) }))) (expression_statement "FUN_0001a8c0(iVar5);" (call_expression "FUN_0001a8c0(iVar5)" identifier (argument_list "(iVar5)" ( identifier ))) ;) (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00038830();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_00038830();\n  }" { comment (expression_statement "FUN_00038830();" (call_expression "FUN_00038830()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nkwset_t kwsinit(_Bool mb_trans)\n\n{\n  int iVar1;\n  wchar_t __wc;\n  __int32_t *p_Var2;\n  size_t sVar3;\n  kwset_t pkVar4;\n  wchar_t __wc_00;\n  __int32_t **pp_Var5;\n  int iVar6;\n  char *trans;\n  int in_GS_OFFSET;\n  mbstate_t mbs;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((match_icase) && ((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)))) {\n    trans = (char *)xmalloc(0x100);\n    sVar3 = __ctype_get_mb_cur_max();\n    if (sVar3 == 1) {\n      pp_Var5 = __ctype_toupper_loc();\n      p_Var2 = *pp_Var5;\n      iVar6 = 0;\n      do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n    else {\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n  }\n  else {\n    trans = (char *)0x0;\n  }\n  pkVar4 = kwsalloc(trans);\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return pkVar4;\n}\n\n" comment comment (function_definition "kwset_t kwsinit(_Bool mb_trans)\n\n{\n  int iVar1;\n  wchar_t __wc;\n  __int32_t *p_Var2;\n  size_t sVar3;\n  kwset_t pkVar4;\n  wchar_t __wc_00;\n  __int32_t **pp_Var5;\n  int iVar6;\n  char *trans;\n  int in_GS_OFFSET;\n  mbstate_t mbs;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((match_icase) && ((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)))) {\n    trans = (char *)xmalloc(0x100);\n    sVar3 = __ctype_get_mb_cur_max();\n    if (sVar3 == 1) {\n      pp_Var5 = __ctype_toupper_loc();\n      p_Var2 = *pp_Var5;\n      iVar6 = 0;\n      do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n    else {\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n  }\n  else {\n    trans = (char *)0x0;\n  }\n  pkVar4 = kwsalloc(trans);\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return pkVar4;\n}" type_identifier (function_declarator "kwsinit(_Bool mb_trans)" identifier (parameter_list "(_Bool mb_trans)" ( (parameter_declaration "_Bool mb_trans" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  wchar_t __wc;\n  __int32_t *p_Var2;\n  size_t sVar3;\n  kwset_t pkVar4;\n  wchar_t __wc_00;\n  __int32_t **pp_Var5;\n  int iVar6;\n  char *trans;\n  int in_GS_OFFSET;\n  mbstate_t mbs;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((match_icase) && ((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)))) {\n    trans = (char *)xmalloc(0x100);\n    sVar3 = __ctype_get_mb_cur_max();\n    if (sVar3 == 1) {\n      pp_Var5 = __ctype_toupper_loc();\n      p_Var2 = *pp_Var5;\n      iVar6 = 0;\n      do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n    else {\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n  }\n  else {\n    trans = (char *)0x0;\n  }\n  pkVar4 = kwsalloc(trans);\n  if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return pkVar4;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "wchar_t __wc;" type_identifier identifier ;) (declaration "__int32_t *p_Var2;" type_identifier (pointer_declarator "*p_Var2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "kwset_t pkVar4;" type_identifier identifier ;) (declaration "wchar_t __wc_00;" type_identifier identifier ;) (declaration "__int32_t **pp_Var5;" type_identifier (pointer_declarator "**pp_Var5" * (pointer_declarator "*pp_Var5" * identifier)) ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "char *trans;" primitive_type (pointer_declarator "*trans" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "mbstate_t mbs;" type_identifier identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if ((match_icase) && ((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)))) {\n    trans = (char *)xmalloc(0x100);\n    sVar3 = __ctype_get_mb_cur_max();\n    if (sVar3 == 1) {\n      pp_Var5 = __ctype_toupper_loc();\n      p_Var2 = *pp_Var5;\n      iVar6 = 0;\n      do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n    else {\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n  }\n  else {\n    trans = (char *)0x0;\n  }" if (parenthesized_expression "((match_icase) && ((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans))))" ( (binary_expression "(match_icase) && ((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)))" (parenthesized_expression "(match_icase)" ( identifier )) && (parenthesized_expression "((sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)))" ( (parenthesized_expression "(sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans))" ( (comma_expression "sVar3 = __ctype_get_mb_cur_max(), sVar3 == 1 || (mb_trans)" (assignment_expression "sVar3 = __ctype_get_mb_cur_max()" identifier = (call_expression "__ctype_get_mb_cur_max()" identifier (argument_list "()" ( )))) , (binary_expression "sVar3 == 1 || (mb_trans)" (binary_expression "sVar3 == 1" identifier == number_literal) || (parenthesized_expression "(mb_trans)" ( identifier )))) )) ))) )) (compound_statement "{\n    trans = (char *)xmalloc(0x100);\n    sVar3 = __ctype_get_mb_cur_max();\n    if (sVar3 == 1) {\n      pp_Var5 = __ctype_toupper_loc();\n      p_Var2 = *pp_Var5;\n      iVar6 = 0;\n      do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n    else {\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n  }" { (expression_statement "trans = (char *)xmalloc(0x100);" (assignment_expression "trans = (char *)xmalloc(0x100)" identifier = (cast_expression "(char *)xmalloc(0x100)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x100)" identifier (argument_list "(0x100)" ( number_literal ))))) ;) (expression_statement "sVar3 = __ctype_get_mb_cur_max();" (assignment_expression "sVar3 = __ctype_get_mb_cur_max()" identifier = (call_expression "__ctype_get_mb_cur_max()" identifier (argument_list "()" ( )))) ;) (if_statement "if (sVar3 == 1) {\n      pp_Var5 = __ctype_toupper_loc();\n      p_Var2 = *pp_Var5;\n      iVar6 = 0;\n      do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }\n    else {\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }" if (parenthesized_expression "(sVar3 == 1)" ( (binary_expression "sVar3 == 1" identifier == number_literal) )) (compound_statement "{\n      pp_Var5 = __ctype_toupper_loc();\n      p_Var2 = *pp_Var5;\n      iVar6 = 0;\n      do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }" { (expression_statement "pp_Var5 = __ctype_toupper_loc();" (assignment_expression "pp_Var5 = __ctype_toupper_loc()" identifier = (call_expression "__ctype_toupper_loc()" identifier (argument_list "()" ( )))) ;) (expression_statement "p_Var2 = *pp_Var5;" (assignment_expression "p_Var2 = *pp_Var5" identifier = (pointer_expression "*pp_Var5" * identifier)) ;) (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (do_statement "do {\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);" do (compound_statement "{\n        trans[iVar6] = (char)p_Var2[iVar6];\n        iVar6 = iVar6 + 1;\n      }" { (expression_statement "trans[iVar6] = (char)p_Var2[iVar6];" (assignment_expression "trans[iVar6] = (char)p_Var2[iVar6]" (subscript_expression "trans[iVar6]" identifier [ identifier ]) = (cast_expression "(char)p_Var2[iVar6]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "p_Var2[iVar6]" identifier [ identifier ]))) ;) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 != 0x100)" ( (binary_expression "iVar6 != 0x100" identifier != number_literal) )) ;) }) (else_clause "else {\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }" else (compound_statement "{\n      iVar6 = 0;\n      do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);\n    }" { (expression_statement "iVar6 = 0;" (assignment_expression "iVar6 = 0" identifier = number_literal) ;) (do_statement "do {\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      } while (iVar6 != 0x100);" do (compound_statement "{\n        __wc = localeinfo.sbctowc[iVar6];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }\n        iVar6 = iVar6 + 1;\n      }" { (expression_statement "__wc = localeinfo.sbctowc[iVar6];" (assignment_expression "__wc = localeinfo.sbctowc[iVar6]" identifier = (subscript_expression "localeinfo.sbctowc[iVar6]" (field_expression "localeinfo.sbctowc" identifier . field_identifier) [ identifier ])) ;) (expression_statement "__wc_00 = towupper(__wc);" (assignment_expression "__wc_00 = towupper(__wc)" identifier = (call_expression "towupper(__wc)" identifier (argument_list "(__wc)" ( identifier )))) ;) (if_statement "if (__wc == __wc_00) {\n          trans[iVar6] = (char)iVar6;\n        }\n        else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }" if (parenthesized_expression "(__wc == __wc_00)" ( (binary_expression "__wc == __wc_00" identifier == identifier) )) (compound_statement "{\n          trans[iVar6] = (char)iVar6;\n        }" { (expression_statement "trans[iVar6] = (char)iVar6;" (assignment_expression "trans[iVar6] = (char)iVar6" (subscript_expression "trans[iVar6]" identifier [ identifier ]) = (cast_expression "(char)iVar6" ( (type_descriptor "char" primitive_type) ) identifier)) ;) }) (else_clause "else {\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }" else (compound_statement "{\n          mbs.__count = 0;\n          mbs.__value.__wch = 0;\n          sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);\n          if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }\n        }" { (expression_statement "mbs.__count = 0;" (assignment_expression "mbs.__count = 0" (field_expression "mbs.__count" identifier . field_identifier) = number_literal) ;) (expression_statement "mbs.__value.__wch = 0;" (assignment_expression "mbs.__value.__wch = 0" (field_expression "mbs.__value.__wch" (field_expression "mbs.__value" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs);" (assignment_expression "sVar3 = wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs)" identifier = (call_expression "wcrtomb(trans + iVar6,__wc_00,(mbstate_t *)&mbs)" identifier (argument_list "(trans + iVar6,__wc_00,(mbstate_t *)&mbs)" ( (binary_expression "trans + iVar6" identifier + identifier) , identifier , (cast_expression "(mbstate_t *)&mbs" ( (type_descriptor "mbstate_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&mbs" & identifier)) )))) ;) (if_statement "if (sVar3 != 1) {\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }" if (parenthesized_expression "(sVar3 != 1)" ( (binary_expression "sVar3 != 1" identifier != number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n            abort();\n          }" { comment (expression_statement "abort();" (call_expression "abort()" identifier (argument_list "()" ( ))) ;) })) }))) (expression_statement "iVar6 = iVar6 + 1;" (assignment_expression "iVar6 = iVar6 + 1" identifier = (binary_expression "iVar6 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar6 != 0x100)" ( (binary_expression "iVar6 != 0x100" identifier != number_literal) )) ;) }))) }) (else_clause "else {\n    trans = (char *)0x0;\n  }" else (compound_statement "{\n    trans = (char *)0x0;\n  }" { (expression_statement "trans = (char *)0x0;" (assignment_expression "trans = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) }))) (expression_statement "pkVar4 = kwsalloc(trans);" (assignment_expression "pkVar4 = kwsalloc(trans)" identifier = (call_expression "kwsalloc(trans)" identifier (argument_list "(trans)" ( identifier )))) ;) (if_statement "if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" if (parenthesized_expression "(iVar1 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return pkVar4;" return identifier ;) })))
(translation_unit "void FUN_0001e980(char param_1)\n\n{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00038830();\n  }\n  return;\n}\n\n" (function_definition "void FUN_0001e980(char param_1)\n\n{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00038830();\n  }\n  return;\n}" primitive_type (function_declarator "FUN_0001e980(char param_1)" identifier (parameter_list "(char param_1)" ( (parameter_declaration "char param_1" primitive_type identifier) ))) (compound_statement "{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00038830();\n  }\n  return;\n}" { (declaration "wchar_t __wc;" type_identifier identifier ;) (declaration "__int32_t *p_Var1;" type_identifier (pointer_declarator "*p_Var1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "wchar_t __wc_00;" type_identifier identifier ;) (declaration "__int32_t **pp_Var3;" type_identifier (pointer_declarator "**pp_Var3" * (pointer_declarator "*pp_Var3" * identifier)) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "mbstate_t local_28;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1e989;" (assignment_expression "uStack_14 = 0x1e989" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" if (parenthesized_expression "((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0'))))" ( (binary_expression "(DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))" (parenthesized_expression "(DAT_0004ca26 == '\0')" ( (binary_expression "DAT_0004ca26 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) || (parenthesized_expression "((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))" ( (parenthesized_expression "(sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0'))" ( (comma_expression "sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')" (assignment_expression "sVar2 = __ctype_get_mb_cur_max()" identifier = (call_expression "__ctype_get_mb_cur_max()" identifier (argument_list "()" ( )))) , (binary_expression "sVar2 != 1 && (param_1 == '\0')" (binary_expression "sVar2 != 1" identifier != number_literal) && (parenthesized_expression "(param_1 == '\0')" ( (binary_expression "param_1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )))) )) ))) )) (compound_statement "{\n    iVar5 = 0;\n  }" { (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" else (compound_statement "{\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" { (expression_statement "iVar5 = FUN_0002efa0(0x100);" (assignment_expression "iVar5 = FUN_0002efa0(0x100)" identifier = (call_expression "FUN_0002efa0(0x100)" identifier (argument_list "(0x100)" ( number_literal )))) ;) (expression_statement "sVar2 = __ctype_get_mb_cur_max();" (assignment_expression "sVar2 = __ctype_get_mb_cur_max()" identifier = (call_expression "__ctype_get_mb_cur_max()" identifier (argument_list "()" ( )))) ;) (if_statement "if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" if (parenthesized_expression "(sVar2 == 1)" ( (binary_expression "sVar2 == 1" identifier == number_literal) )) (compound_statement "{\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" { (expression_statement "pp_Var3 = __ctype_toupper_loc();" (assignment_expression "pp_Var3 = __ctype_toupper_loc()" identifier = (call_expression "__ctype_toupper_loc()" identifier (argument_list "()" ( )))) ;) (expression_statement "p_Var1 = *pp_Var3;" (assignment_expression "p_Var1 = *pp_Var3" identifier = (pointer_expression "*pp_Var3" * identifier)) ;) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);" do (compound_statement "{\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      }" { (expression_statement "*(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];" (assignment_expression "*(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4]" (pointer_expression "*(char *)(iVar5 + iVar4)" * (cast_expression "(char *)(iVar5 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar4)" ( (binary_expression "iVar5 + iVar4" identifier + identifier) )))) = (cast_expression "(char)p_Var1[iVar4]" ( (type_descriptor "char" primitive_type) ) (subscript_expression "p_Var1[iVar4]" identifier [ identifier ]))) ;) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar4 != 0x100)" ( (binary_expression "iVar4 != 0x100" identifier != number_literal) )) ;) }) (else_clause "else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" else (compound_statement "{\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" { (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" identifier = number_literal) ;) (do_statement "do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);" do (compound_statement "{\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      }" { (expression_statement "__wc = (&DAT_0004c624)[iVar4];" (assignment_expression "__wc = (&DAT_0004c624)[iVar4]" identifier = (subscript_expression "(&DAT_0004c624)[iVar4]" (parenthesized_expression "(&DAT_0004c624)" ( (pointer_expression "&DAT_0004c624" & identifier) )) [ identifier ])) ;) (expression_statement "__wc_00 = towupper(__wc);" (assignment_expression "__wc_00 = towupper(__wc)" identifier = (call_expression "towupper(__wc)" identifier (argument_list "(__wc)" ( identifier )))) ;) (if_statement "if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }" if (parenthesized_expression "(__wc == __wc_00)" ( (binary_expression "__wc == __wc_00" identifier == identifier) )) (compound_statement "{\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }" { (expression_statement "*(char *)(iVar5 + iVar4) = (char)iVar4;" (assignment_expression "*(char *)(iVar5 + iVar4) = (char)iVar4" (pointer_expression "*(char *)(iVar5 + iVar4)" * (cast_expression "(char *)(iVar5 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar4)" ( (binary_expression "iVar5 + iVar4" identifier + identifier) )))) = (cast_expression "(char)iVar4" ( (type_descriptor "char" primitive_type) ) identifier)) ;) }) (else_clause "else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }" else (compound_statement "{\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }" { (expression_statement "local_28.__count = 0;" (assignment_expression "local_28.__count = 0" (field_expression "local_28.__count" identifier . field_identifier) = number_literal) ;) (expression_statement "local_28.__value.__wch = 0;" (assignment_expression "local_28.__value.__wch = 0" (field_expression "local_28.__value.__wch" (field_expression "local_28.__value" identifier . field_identifier) . field_identifier) = number_literal) ;) (expression_statement "sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);" (assignment_expression "sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28)" identifier = (call_expression "wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28)" identifier (argument_list "((char *)(iVar5 + iVar4),__wc_00,&local_28)" ( (cast_expression "(char *)(iVar5 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar5 + iVar4)" ( (binary_expression "iVar5 + iVar4" identifier + identifier) ))) , identifier , (pointer_expression "&local_28" & identifier) )))) ;) (if_statement "if (sVar2 != 1) {\n                    \n            abort();\n          }" if (parenthesized_expression "(sVar2 != 1)" ( (binary_expression "sVar2 != 1" identifier != number_literal) )) (compound_statement "{\n                    \n            abort();\n          }" { (expression_statement "abort();" (call_expression "abort()" identifier (argument_list "()" ( ))) ;) })) }))) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" identifier = (binary_expression "iVar4 + 1" identifier + number_literal)) ;) }) while (parenthesized_expression "(iVar4 != 0x100)" ( (binary_expression "iVar4 != 0x100" identifier != number_literal) )) ;) }))) }))) (expression_statement "FUN_0001a8c0(iVar5);" (call_expression "FUN_0001a8c0(iVar5)" identifier (argument_list "(iVar5)" ( identifier ))) ;) (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00038830();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    FUN_00038830();\n  }" { (expression_statement "FUN_00038830();" (call_expression "FUN_00038830()" identifier (argument_list "()" ( ))) ;) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * (pointer_declarator * IDENT)) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) || (parenthesized_expression ( (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) , (binary_expression (binary_expression IDENT != LIT) && (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )))) )) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ IDENT ]))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression (parenthesized_expression ( (pointer_expression & IDENT) )) [ IDENT ])) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression (field_expression IDENT . field_identifier) = LIT) ;) (expression_statement (assignment_expression (field_expression (field_expression IDENT . field_identifier) . field_identifier) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))) , IDENT , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) }))) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != LIT) )) ;) }))) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) })) (return_statement return ;) })))
(function_definition "void FUN_0001e980(char param_1)\n\n{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00038830();\n  }\n  return;\n}" (primitive_type "void") (function_declarator "FUN_0001e980(char param_1)" (identifier "FUN_0001e980") (parameter_list "(char param_1)" (( "(") (parameter_declaration "char param_1" (primitive_type "char") (identifier "param_1")) () ")"))) (compound_statement "{\n  wchar_t __wc;\n  __int32_t *p_Var1;\n  size_t sVar2;\n  wchar_t __wc_00;\n  __int32_t **pp_Var3;\n  int iVar4;\n  int iVar5;\n  int in_GS_OFFSET;\n  mbstate_t local_28;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1e989;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }\n  FUN_0001a8c0(iVar5);\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00038830();\n  }\n  return;\n}" ({ "{") (declaration "wchar_t __wc;" (type_identifier "wchar_t") (identifier "__wc") (; ";")) (declaration "__int32_t *p_Var1;" (type_identifier "__int32_t") (pointer_declarator "*p_Var1" (* "*") (identifier "p_Var1")) (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "wchar_t __wc_00;" (type_identifier "wchar_t") (identifier "__wc_00") (; ";")) (declaration "__int32_t **pp_Var3;" (type_identifier "__int32_t") (pointer_declarator "**pp_Var3" (* "*") (pointer_declarator "*pp_Var3" (* "*") (identifier "pp_Var3"))) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "mbstate_t local_28;" (type_identifier "mbstate_t") (identifier "local_28") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x1e989;" (assignment_expression "uStack_14 = 0x1e989" (identifier "uStack_14") (= "=") (number_literal "0x1e989")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if ((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {\n    iVar5 = 0;\n  }\n  else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" (if "if") (parenthesized_expression "((DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0'))))" (( "(") (binary_expression "(DAT_0004ca26 == '\0') ||\n     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))" (parenthesized_expression "(DAT_0004ca26 == '\0')" (( "(") (binary_expression "DAT_0004ca26 == '\0'" (identifier "DAT_0004ca26") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (|| "||") (parenthesized_expression "((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))" (( "(") (parenthesized_expression "(sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0'))" (( "(") (comma_expression "sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')" (assignment_expression "sVar2 = __ctype_get_mb_cur_max()" (identifier "sVar2") (= "=") (call_expression "__ctype_get_mb_cur_max()" (identifier "__ctype_get_mb_cur_max") (argument_list "()" (( "(") () ")")))) (, ",") (binary_expression "sVar2 != 1 && (param_1 == '\0')" (binary_expression "sVar2 != 1" (identifier "sVar2") (!= "!=") (number_literal "1")) (&& "&&") (parenthesized_expression "(param_1 == '\0')" (( "(") (binary_expression "param_1 == '\0'" (identifier "param_1") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")))) () ")")) () ")"))) () ")")) (compound_statement "{\n    iVar5 = 0;\n  }" ({ "{") (expression_statement "iVar5 = 0;" (assignment_expression "iVar5 = 0" (identifier "iVar5") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" (else "else") (compound_statement "{\n    iVar5 = FUN_0002efa0(0x100);\n    sVar2 = __ctype_get_mb_cur_max();\n    if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n  }" ({ "{") (expression_statement "iVar5 = FUN_0002efa0(0x100);" (assignment_expression "iVar5 = FUN_0002efa0(0x100)" (identifier "iVar5") (= "=") (call_expression "FUN_0002efa0(0x100)" (identifier "FUN_0002efa0") (argument_list "(0x100)" (( "(") (number_literal "0x100") () ")")))) (; ";")) (expression_statement "sVar2 = __ctype_get_mb_cur_max();" (assignment_expression "sVar2 = __ctype_get_mb_cur_max()" (identifier "sVar2") (= "=") (call_expression "__ctype_get_mb_cur_max()" (identifier "__ctype_get_mb_cur_max") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (sVar2 == 1) {\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }\n    else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" (if "if") (parenthesized_expression "(sVar2 == 1)" (( "(") (binary_expression "sVar2 == 1" (identifier "sVar2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      pp_Var3 = __ctype_toupper_loc();\n      p_Var1 = *pp_Var3;\n      iVar4 = 0;\n      do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" ({ "{") (expression_statement "pp_Var3 = __ctype_toupper_loc();" (assignment_expression "pp_Var3 = __ctype_toupper_loc()" (identifier "pp_Var3") (= "=") (call_expression "__ctype_toupper_loc()" (identifier "__ctype_toupper_loc") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "p_Var1 = *pp_Var3;" (assignment_expression "p_Var1 = *pp_Var3" (identifier "p_Var1") (= "=") (pointer_expression "*pp_Var3" (* "*") (identifier "pp_Var3"))) (; ";")) (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" (identifier "iVar4") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);" (do "do") (compound_statement "{\n        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];\n        iVar4 = iVar4 + 1;\n      }" ({ "{") (expression_statement "*(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];" (assignment_expression "*(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4]" (pointer_expression "*(char *)(iVar5 + iVar4)" (* "*") (cast_expression "(char *)(iVar5 + iVar4)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + iVar4)" (( "(") (binary_expression "iVar5 + iVar4" (identifier "iVar5") (+ "+") (identifier "iVar4")) () ")")))) (= "=") (cast_expression "(char)p_Var1[iVar4]" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (subscript_expression "p_Var1[iVar4]" (identifier "p_Var1") ([ "[") (identifier "iVar4") (] "]")))) (; ";")) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" (identifier "iVar4") (= "=") (binary_expression "iVar4 + 1" (identifier "iVar4") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar4 != 0x100)" (( "(") (binary_expression "iVar4 != 0x100" (identifier "iVar4") (!= "!=") (number_literal "0x100")) () ")")) (; ";")) (} "}")) (else_clause "else {\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" (else "else") (compound_statement "{\n      iVar4 = 0;\n      do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);\n    }" ({ "{") (expression_statement "iVar4 = 0;" (assignment_expression "iVar4 = 0" (identifier "iVar4") (= "=") (number_literal "0")) (; ";")) (do_statement "do {\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      } while (iVar4 != 0x100);" (do "do") (compound_statement "{\n        __wc = (&DAT_0004c624)[iVar4];\n        __wc_00 = towupper(__wc);\n        if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }\n        iVar4 = iVar4 + 1;\n      }" ({ "{") (expression_statement "__wc = (&DAT_0004c624)[iVar4];" (assignment_expression "__wc = (&DAT_0004c624)[iVar4]" (identifier "__wc") (= "=") (subscript_expression "(&DAT_0004c624)[iVar4]" (parenthesized_expression "(&DAT_0004c624)" (( "(") (pointer_expression "&DAT_0004c624" (& "&") (identifier "DAT_0004c624")) () ")")) ([ "[") (identifier "iVar4") (] "]"))) (; ";")) (expression_statement "__wc_00 = towupper(__wc);" (assignment_expression "__wc_00 = towupper(__wc)" (identifier "__wc_00") (= "=") (call_expression "towupper(__wc)" (identifier "towupper") (argument_list "(__wc)" (( "(") (identifier "__wc") () ")")))) (; ";")) (if_statement "if (__wc == __wc_00) {\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }\n        else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }" (if "if") (parenthesized_expression "(__wc == __wc_00)" (( "(") (binary_expression "__wc == __wc_00" (identifier "__wc") (== "==") (identifier "__wc_00")) () ")")) (compound_statement "{\n          *(char *)(iVar5 + iVar4) = (char)iVar4;\n        }" ({ "{") (expression_statement "*(char *)(iVar5 + iVar4) = (char)iVar4;" (assignment_expression "*(char *)(iVar5 + iVar4) = (char)iVar4" (pointer_expression "*(char *)(iVar5 + iVar4)" (* "*") (cast_expression "(char *)(iVar5 + iVar4)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + iVar4)" (( "(") (binary_expression "iVar5 + iVar4" (identifier "iVar5") (+ "+") (identifier "iVar4")) () ")")))) (= "=") (cast_expression "(char)iVar4" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "iVar4"))) (; ";")) (} "}")) (else_clause "else {\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }" (else "else") (compound_statement "{\n          local_28.__count = 0;\n          local_28.__value.__wch = 0;\n          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);\n          if (sVar2 != 1) {\n                    \n            abort();\n          }\n        }" ({ "{") (expression_statement "local_28.__count = 0;" (assignment_expression "local_28.__count = 0" (field_expression "local_28.__count" (identifier "local_28") (. ".") (field_identifier "__count")) (= "=") (number_literal "0")) (; ";")) (expression_statement "local_28.__value.__wch = 0;" (assignment_expression "local_28.__value.__wch = 0" (field_expression "local_28.__value.__wch" (field_expression "local_28.__value" (identifier "local_28") (. ".") (field_identifier "__value")) (. ".") (field_identifier "__wch")) (= "=") (number_literal "0")) (; ";")) (expression_statement "sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);" (assignment_expression "sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28)" (identifier "sVar2") (= "=") (call_expression "wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28)" (identifier "wcrtomb") (argument_list "((char *)(iVar5 + iVar4),__wc_00,&local_28)" (( "(") (cast_expression "(char *)(iVar5 + iVar4)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar5 + iVar4)" (( "(") (binary_expression "iVar5 + iVar4" (identifier "iVar5") (+ "+") (identifier "iVar4")) () ")"))) (, ",") (identifier "__wc_00") (, ",") (pointer_expression "&local_28" (& "&") (identifier "local_28")) () ")")))) (; ";")) (if_statement "if (sVar2 != 1) {\n                    \n            abort();\n          }" (if "if") (parenthesized_expression "(sVar2 != 1)" (( "(") (binary_expression "sVar2 != 1" (identifier "sVar2") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n                    \n            abort();\n          }" ({ "{") (expression_statement "abort();" (call_expression "abort()" (identifier "abort") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (} "}")))) (expression_statement "iVar4 = iVar4 + 1;" (assignment_expression "iVar4 = iVar4 + 1" (identifier "iVar4") (= "=") (binary_expression "iVar4 + 1" (identifier "iVar4") (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(iVar4 != 0x100)" (( "(") (binary_expression "iVar4 != 0x100" (identifier "iVar4") (!= "!=") (number_literal "0x100")) () ")")) (; ";")) (} "}")))) (} "}")))) (expression_statement "FUN_0001a8c0(iVar5);" (call_expression "FUN_0001a8c0(iVar5)" (identifier "FUN_0001a8c0") (argument_list "(iVar5)" (( "(") (identifier "iVar5") () ")"))) (; ";")) (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00038830();\n  }" (if "if") (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (!= "!=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n                    \n    FUN_00038830();\n  }" ({ "{") (expression_statement "FUN_00038830();" (call_expression "FUN_00038830()" (identifier "FUN_00038830") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

type_1 function_1(type_2 mb_trans)

{
  int var_14;
  type_3 var_8;
  type_4 *p_Var2;
  size_t var_3;
  type_1 pkVar4;
  type_3 var_9;
  type_4 **pp_Var5;
  int var_6;
  char *var_11;
  int var_1;
  type_5 mbs;
  
  var_14 = *(int *)(var_1 + 0x14);
  if ((match_icase) && ((var_3 = var_2(), var_3 == 1 || (mb_trans)))) {
    var_11 = (char *)var_4(0x100);
    var_3 = var_2();
    if (var_3 == 1) {
      pp_Var5 = var_5();
      p_Var2 = *pp_Var5;
      var_6 = 0;
      do {
        var_11[var_6] = (char)p_Var2[var_6];
        var_6 = var_6 + 1;
      } while (var_6 != 0x100);
    }
    else {
      var_6 = 0;
      do {
        var_8 = localeinfo.sbctowc[var_6];
        var_9 = var_7(var_8);
        if (var_8 == var_9) {
          var_11[var_6] = (char)var_6;
        }
        else {
          mbs.__count = 0;
          mbs.__value.__wch = 0;
          var_3 = var_10(var_11 + var_6,var_9,(type_5 *)&mbs);
          if (var_3 != 1) {
                    /* WARNING: Subroutine does not return */
            var_12();
          }
        }
        var_6 = var_6 + 1;
      } while (var_6 != 0x100);
    }
  }
  else {
    var_11 = (char *)0x0;
  }
  pkVar4 = var_13(var_11);
  if (var_14 != *(int *)(var_1 + 0x14)) {
                    /* WARNING: Subroutine does not return */
    var_15();
  }
  return pkVar4;
}


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

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

void MASKED(char param_1)

{
  wchar_t __wc;
  __int32_t *p_Var1;
  size_t sVar2;
  wchar_t __wc_00;
  __int32_t **pp_Var3;
  int iVar4;
  int iVar5;
  int in_GS_OFFSET;
  mbstate_t local_28;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1e989;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((DAT_0004ca26 == '\0') ||
     ((sVar2 = __ctype_get_mb_cur_max(), sVar2 != 1 && (param_1 == '\0')))) {
    iVar5 = 0;
  }
  else {
    iVar5 = FUN_0002efa0(0x100);
    sVar2 = __ctype_get_mb_cur_max();
    if (sVar2 == 1) {
      pp_Var3 = __ctype_toupper_loc();
      p_Var1 = *pp_Var3;
      iVar4 = 0;
      do {
        *(char *)(iVar5 + iVar4) = (char)p_Var1[iVar4];
        iVar4 = iVar4 + 1;
      } while (iVar4 != 0x100);
    }
    else {
      iVar4 = 0;
      do {
        __wc = (&DAT_0004c624)[iVar4];
        __wc_00 = towupper(__wc);
        if (__wc == __wc_00) {
          *(char *)(iVar5 + iVar4) = (char)iVar4;
        }
        else {
          local_28.__count = 0;
          local_28.__value.__wch = 0;
          sVar2 = wcrtomb((char *)(iVar5 + iVar4),__wc_00,&local_28);
          if (sVar2 != 1) {
                    /* WARNING: Subroutine does not return */
            abort();
          }
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 != 0x100);
    }
  }
  FUN_0001a8c0(iVar5);
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_00038830();
  }
  return;
}

