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

size_t rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)

{
  _Bool _Var1;
  size_t sVar2;
  int in_GS_OFFSET;
  wchar_t wc;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1a019;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (s == (char *)0x0) {
    n = 1;
    s = "";
LAB_0001a08b:
    pwc = &wc;
  }
  else {
    sVar2 = 0xfffffffe;
    if (n == 0) goto LAB_0001a063;
    if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;
  }
  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);
  if (0xfffffffd < sVar2) {
    _Var1 = hard_locale(0);
    if (!_Var1) {
      sVar2 = 1;
      *pwc = (uint)(byte)*s;
    }
  }
LAB_0001a063:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return sVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

size_t FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)

{
  char cVar1;
  size_t sVar2;
  int in_GS_OFFSET;
  wchar_t local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1a019;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 == (byte *)0x0) {
    param_3 = 1;
    param_2 = (byte *)0x2ac97;
LAB_0001a08b:
    param_1 = &local_24;
  }
  else {
    sVar2 = 0xfffffffe;
    if (param_3 == 0) goto LAB_0001a063;
    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;
  }
  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);
  if (0xfffffffd < sVar2) {
    cVar1 = FUN_00028180(0);
    if (cVar1 == '\0') {
      sVar2 = 1;
      *param_1 = (uint)*param_2;
    }
  }
LAB_0001a063:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return sVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00028670();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00013710
ADD EBX,0x18fe7
SUB ESP,0x1c
MOV EDI,dword ptr [ESP + 0x34]
MOV EBP,dword ptr [ESP + 0x30]
MOV ECX,dword ptr GS:[0x14]
MOV dword ptr [ESP + 0xc],ECX
XOR ECX,ECX
MOV EAX,dword ptr [ESP + 0x38]
MOV EDX,dword ptr [ESP + 0x3c]
TEST EDI,EDI
JZ 0x0001a080
MOV ESI,0xfffffffe
TEST EAX,EAX
JZ 0x0001a063
TEST EBP,EBP
JZ 0x0001a08b
PUSH EDX
PUSH EAX
PUSH EDI
PUSH EBP
CALL 0x00012260
ADD ESP,0x10
MOV ESI,EAX
CMP EAX,-0x3
JA 0x0001a098
MOV ECX,dword ptr [ESP + 0xc]
XOR ECX,dword ptr GS:[0x14]
MOV EAX,ESI
JNZ 0x0001a0b6
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EAX,0x1
LEA EDI,[EBX + 0xffff7c97]
LEA EBP,[ESP + 0x8]
JMP 0x0001a050
SUB ESP,0xc
PUSH 0x0
CALL 0x00028180
ADD ESP,0x10
TEST AL,AL
JNZ 0x0001a063
MOVZX EAX,byte ptr [EDI]
MOV ESI,0x1
MOV dword ptr [EBP],EAX
JMP 0x0001a063
CALL 0x00028670
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nsize_t FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00028670();\n}\n\n" comment (function_definition "size_t FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00028670();\n}" primitive_type (function_declarator "FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)" identifier (parameter_list "(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)" ( (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "byte *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) , (parameter_declaration "mbstate_t *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_00028670();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "wchar_t local_24;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1a019;" (assignment_expression "uStack_14 = 0x1a019" 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 (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" if (parenthesized_expression "(param_2 == (byte *)0x0)" ( (binary_expression "param_2 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }" { (expression_statement "param_3 = 1;" (assignment_expression "param_3 = 1" identifier = number_literal) ;) (expression_statement "param_2 = (byte *)0x2ac97;" (assignment_expression "param_2 = (byte *)0x2ac97" identifier = (cast_expression "(byte *)0x2ac97" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_0001a08b:\n    param_1 = &local_24;" statement_identifier : (expression_statement "param_1 = &local_24;" (assignment_expression "param_1 = &local_24" identifier = (pointer_expression "&local_24" & identifier)) ;)) }) (else_clause "else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" else (compound_statement "{\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" { (expression_statement "sVar2 = 0xfffffffe;" (assignment_expression "sVar2 = 0xfffffffe" identifier = number_literal) ;) (if_statement "if (param_3 == 0) goto LAB_0001a063;" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0001a063;" goto statement_identifier ;)) (if_statement "if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;" if (parenthesized_expression "(param_1 == (wchar_t *)0x0)" ( (binary_expression "param_1 == (wchar_t *)0x0" identifier == (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001a08b;" goto statement_identifier ;)) }))) (expression_statement "sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);" (assignment_expression "sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4)" identifier = (call_expression "mbrtowc(param_1,(char *)param_2,param_3,param_4)" identifier (argument_list "(param_1,(char *)param_2,param_3,param_4)" ( identifier , (cast_expression "(char *)param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier )))) ;) (if_statement "if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }" if (parenthesized_expression "(0xfffffffd < sVar2)" ( (binary_expression "0xfffffffd < sVar2" number_literal < identifier) )) (compound_statement "{\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }" { (expression_statement "cVar1 = FUN_00028180(0);" (assignment_expression "cVar1 = FUN_00028180(0)" identifier = (call_expression "FUN_00028180(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }" { (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) (expression_statement "*param_1 = (uint)*param_2;" (assignment_expression "*param_1 = (uint)*param_2" (pointer_expression "*param_1" * identifier) = (binary_expression "(uint)*param_2" (parenthesized_expression "(uint)" ( identifier )) * identifier)) ;) })) })) (labeled_statement "LAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\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    return sVar2;\n  }" { (return_statement "return sVar2;" return identifier ;) }))) comment (expression_statement "FUN_00028670();" (call_expression "FUN_00028670()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nsize_t rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)\n\n{\n  _Bool _Var1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t wc;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (s == (char *)0x0) {\n    n = 1;\n    s = "";\nLAB_0001a08b:\n    pwc = &wc;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (n == 0) goto LAB_0001a063;\n    if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);\n  if (0xfffffffd < sVar2) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      sVar2 = 1;\n      *pwc = (uint)(byte)*s;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment (function_definition "size_t rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)\n\n{\n  _Bool _Var1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t wc;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (s == (char *)0x0) {\n    n = 1;\n    s = "";\nLAB_0001a08b:\n    pwc = &wc;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (n == 0) goto LAB_0001a063;\n    if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);\n  if (0xfffffffd < sVar2) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      sVar2 = 1;\n      *pwc = (uint)(byte)*s;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)" identifier (parameter_list "(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)" ( (parameter_declaration "wchar_t *pwc" type_identifier (pointer_declarator "*pwc" * identifier)) , (parameter_declaration "char *s" primitive_type (pointer_declarator "*s" * identifier)) , (parameter_declaration "size_t n" primitive_type identifier) , (parameter_declaration "mbstate_t *ps" type_identifier (pointer_declarator "*ps" * identifier)) ))) (compound_statement "{\n  _Bool _Var1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t wc;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (s == (char *)0x0) {\n    n = 1;\n    s = "";\nLAB_0001a08b:\n    pwc = &wc;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (n == 0) goto LAB_0001a063;\n    if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);\n  if (0xfffffffd < sVar2) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      sVar2 = 1;\n      *pwc = (uint)(byte)*s;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "_Bool _Var1;" type_identifier identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "wchar_t wc;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1a019;" (assignment_expression "uStack_14 = 0x1a019" 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 (s == (char *)0x0) {\n    n = 1;\n    s = "";\nLAB_0001a08b:\n    pwc = &wc;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (n == 0) goto LAB_0001a063;\n    if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" if (parenthesized_expression "(s == (char *)0x0)" ( (binary_expression "s == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    n = 1;\n    s = "";\nLAB_0001a08b:\n    pwc = &wc;\n  }" { (expression_statement "n = 1;" (assignment_expression "n = 1" identifier = number_literal) ;) (expression_statement "s = "";" (assignment_expression "s = """ identifier = (string_literal """" " ")) ;) (labeled_statement "LAB_0001a08b:\n    pwc = &wc;" statement_identifier : (expression_statement "pwc = &wc;" (assignment_expression "pwc = &wc" identifier = (pointer_expression "&wc" & identifier)) ;)) }) (else_clause "else {\n    sVar2 = 0xfffffffe;\n    if (n == 0) goto LAB_0001a063;\n    if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" else (compound_statement "{\n    sVar2 = 0xfffffffe;\n    if (n == 0) goto LAB_0001a063;\n    if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" { (expression_statement "sVar2 = 0xfffffffe;" (assignment_expression "sVar2 = 0xfffffffe" identifier = number_literal) ;) (if_statement "if (n == 0) goto LAB_0001a063;" if (parenthesized_expression "(n == 0)" ( (binary_expression "n == 0" identifier == number_literal) )) (goto_statement "goto LAB_0001a063;" goto statement_identifier ;)) (if_statement "if (pwc == (wchar_t *)0x0) goto LAB_0001a08b;" if (parenthesized_expression "(pwc == (wchar_t *)0x0)" ( (binary_expression "pwc == (wchar_t *)0x0" identifier == (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001a08b;" goto statement_identifier ;)) }))) (expression_statement "sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);" (assignment_expression "sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps)" identifier = (call_expression "mbrtowc(pwc,s,n,(mbstate_t *)ps)" identifier (argument_list "(pwc,s,n,(mbstate_t *)ps)" ( identifier , identifier , identifier , (cast_expression "(mbstate_t *)ps" ( (type_descriptor "mbstate_t *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) )))) ;) (if_statement "if (0xfffffffd < sVar2) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      sVar2 = 1;\n      *pwc = (uint)(byte)*s;\n    }\n  }" if (parenthesized_expression "(0xfffffffd < sVar2)" ( (binary_expression "0xfffffffd < sVar2" number_literal < identifier) )) (compound_statement "{\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      sVar2 = 1;\n      *pwc = (uint)(byte)*s;\n    }\n  }" { (expression_statement "_Var1 = hard_locale(0);" (assignment_expression "_Var1 = hard_locale(0)" identifier = (call_expression "hard_locale(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (!_Var1) {\n      sVar2 = 1;\n      *pwc = (uint)(byte)*s;\n    }" if (parenthesized_expression "(!_Var1)" ( (unary_expression "!_Var1" ! identifier) )) (compound_statement "{\n      sVar2 = 1;\n      *pwc = (uint)(byte)*s;\n    }" { (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) (expression_statement "*pwc = (uint)(byte)*s;" (assignment_expression "*pwc = (uint)(byte)*s" (pointer_expression "*pwc" * identifier) = (binary_expression "(uint)(byte)*s" (call_expression "(uint)(byte)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(byte)" ( identifier ))) * identifier)) ;) })) })) (labeled_statement "LAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\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    return sVar2;\n  }" { (return_statement "return sVar2;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "size_t FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    \n  FUN_00028670();\n}\n\n" (function_definition "size_t FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    \n  FUN_00028670();\n}" primitive_type (function_declarator "FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)" identifier (parameter_list "(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)" ( (parameter_declaration "wchar_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "byte *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "size_t param_3" primitive_type identifier) , (parameter_declaration "mbstate_t *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    \n  FUN_00028670();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "wchar_t local_24;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x1a019;" (assignment_expression "uStack_14 = 0x1a019" 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 (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" if (parenthesized_expression "(param_2 == (byte *)0x0)" ( (binary_expression "param_2 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }" { (expression_statement "param_3 = 1;" (assignment_expression "param_3 = 1" identifier = number_literal) ;) (expression_statement "param_2 = (byte *)0x2ac97;" (assignment_expression "param_2 = (byte *)0x2ac97" identifier = (cast_expression "(byte *)0x2ac97" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "LAB_0001a08b:\n    param_1 = &local_24;" statement_identifier : (expression_statement "param_1 = &local_24;" (assignment_expression "param_1 = &local_24" identifier = (pointer_expression "&local_24" & identifier)) ;)) }) (else_clause "else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" else (compound_statement "{\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" { (expression_statement "sVar2 = 0xfffffffe;" (assignment_expression "sVar2 = 0xfffffffe" identifier = number_literal) ;) (if_statement "if (param_3 == 0) goto LAB_0001a063;" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (goto_statement "goto LAB_0001a063;" goto statement_identifier ;)) (if_statement "if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;" if (parenthesized_expression "(param_1 == (wchar_t *)0x0)" ( (binary_expression "param_1 == (wchar_t *)0x0" identifier == (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_0001a08b;" goto statement_identifier ;)) }))) (expression_statement "sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);" (assignment_expression "sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4)" identifier = (call_expression "mbrtowc(param_1,(char *)param_2,param_3,param_4)" identifier (argument_list "(param_1,(char *)param_2,param_3,param_4)" ( identifier , (cast_expression "(char *)param_2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier) , identifier , identifier )))) ;) (if_statement "if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }" if (parenthesized_expression "(0xfffffffd < sVar2)" ( (binary_expression "0xfffffffd < sVar2" number_literal < identifier) )) (compound_statement "{\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }" { (expression_statement "cVar1 = FUN_00028180(0);" (assignment_expression "cVar1 = FUN_00028180(0)" identifier = (call_expression "FUN_00028180(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }" { (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) (expression_statement "*param_1 = (uint)*param_2;" (assignment_expression "*param_1 = (uint)*param_2" (pointer_expression "*param_1" * identifier) = (binary_expression "(uint)*param_2" (parenthesized_expression "(uint)" ( identifier )) * identifier)) ;) })) })) (labeled_statement "LAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\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    return sVar2;\n  }" { (return_statement "return sVar2;" return identifier ;) }))) (expression_statement "FUN_00028670();" (call_expression "FUN_00028670()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE 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 IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (pointer_expression & IDENT)) ;)) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (goto_statement goto statement_identifier ;)) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT) , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (parenthesized_expression ( IDENT )) * IDENT)) ;) })) })) (labeled_statement statement_identifier : (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 { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "size_t FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    \n  FUN_00028670();\n}" (primitive_type "size_t") (function_declarator "FUN_0001a010(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)" (identifier "FUN_0001a010") (parameter_list "(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)" (( "(") (parameter_declaration "wchar_t *param_1" (type_identifier "wchar_t") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "byte *param_2" (type_identifier "byte") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "size_t param_3" (primitive_type "size_t") (identifier "param_3")) (, ",") (parameter_declaration "mbstate_t *param_4" (type_identifier "mbstate_t") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  int in_GS_OFFSET;\n  wchar_t local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x1a019;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }\nLAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }\n                    \n  FUN_00028670();\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "wchar_t local_24;" (type_identifier "wchar_t") (identifier "local_24") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x1a019;" (assignment_expression "uStack_14 = 0x1a019" (identifier "uStack_14") (= "=") (number_literal "0x1a019")) (; ";")) (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 (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }\n  else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" (if "if") (parenthesized_expression "(param_2 == (byte *)0x0)" (( "(") (binary_expression "param_2 == (byte *)0x0" (identifier "param_2") (== "==") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    param_3 = 1;\n    param_2 = (byte *)0x2ac97;\nLAB_0001a08b:\n    param_1 = &local_24;\n  }" ({ "{") (expression_statement "param_3 = 1;" (assignment_expression "param_3 = 1" (identifier "param_3") (= "=") (number_literal "1")) (; ";")) (expression_statement "param_2 = (byte *)0x2ac97;" (assignment_expression "param_2 = (byte *)0x2ac97" (identifier "param_2") (= "=") (cast_expression "(byte *)0x2ac97" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x2ac97"))) (; ";")) (labeled_statement "LAB_0001a08b:\n    param_1 = &local_24;" (statement_identifier "LAB_0001a08b") (: ":") (expression_statement "param_1 = &local_24;" (assignment_expression "param_1 = &local_24" (identifier "param_1") (= "=") (pointer_expression "&local_24" (& "&") (identifier "local_24"))) (; ";"))) (} "}")) (else_clause "else {\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" (else "else") (compound_statement "{\n    sVar2 = 0xfffffffe;\n    if (param_3 == 0) goto LAB_0001a063;\n    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;\n  }" ({ "{") (expression_statement "sVar2 = 0xfffffffe;" (assignment_expression "sVar2 = 0xfffffffe" (identifier "sVar2") (= "=") (number_literal "0xfffffffe")) (; ";")) (if_statement "if (param_3 == 0) goto LAB_0001a063;" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_0001a063;" (goto "goto") (statement_identifier "LAB_0001a063") (; ";"))) (if_statement "if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;" (if "if") (parenthesized_expression "(param_1 == (wchar_t *)0x0)" (( "(") (binary_expression "param_1 == (wchar_t *)0x0" (identifier "param_1") (== "==") (cast_expression "(wchar_t *)0x0" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (goto_statement "goto LAB_0001a08b;" (goto "goto") (statement_identifier "LAB_0001a08b") (; ";"))) (} "}")))) (expression_statement "sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);" (assignment_expression "sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4)" (identifier "sVar2") (= "=") (call_expression "mbrtowc(param_1,(char *)param_2,param_3,param_4)" (identifier "mbrtowc") (argument_list "(param_1,(char *)param_2,param_3,param_4)" (( "(") (identifier "param_1") (, ",") (cast_expression "(char *)param_2" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "param_2")) (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (; ";")) (if_statement "if (0xfffffffd < sVar2) {\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }" (if "if") (parenthesized_expression "(0xfffffffd < sVar2)" (( "(") (binary_expression "0xfffffffd < sVar2" (number_literal "0xfffffffd") (< "<") (identifier "sVar2")) () ")")) (compound_statement "{\n    cVar1 = FUN_00028180(0);\n    if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }\n  }" ({ "{") (expression_statement "cVar1 = FUN_00028180(0);" (assignment_expression "cVar1 = FUN_00028180(0)" (identifier "cVar1") (= "=") (call_expression "FUN_00028180(0)" (identifier "FUN_00028180") (argument_list "(0)" (( "(") (number_literal "0") () ")")))) (; ";")) (if_statement "if (cVar1 == '\0') {\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }" (if "if") (parenthesized_expression "(cVar1 == '\0')" (( "(") (binary_expression "cVar1 == '\0'" (identifier "cVar1") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      sVar2 = 1;\n      *param_1 = (uint)*param_2;\n    }" ({ "{") (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" (identifier "sVar2") (= "=") (number_literal "1")) (; ";")) (expression_statement "*param_1 = (uint)*param_2;" (assignment_expression "*param_1 = (uint)*param_2" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (= "=") (binary_expression "(uint)*param_2" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (* "*") (identifier "param_2"))) (; ";")) (} "}"))) (} "}"))) (labeled_statement "LAB_0001a063:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\n  }" (statement_identifier "LAB_0001a063") (: ":") (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return sVar2;\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    return sVar2;\n  }" ({ "{") (return_statement "return sVar2;" (return "return") (identifier "sVar2") (; ";")) (} "}")))) (expression_statement "FUN_00028670();" (call_expression "FUN_00028670()" (identifier "FUN_00028670") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

size_t function_1(type_1 *var_4,char *var_2,size_t var_3,type_2 *ps)

{
  type_3 _Var1;
  size_t var_6;
  int var_1;
  type_1 wc;
  int var_8;
  type_4 uStack_14;
  
  uStack_14 = 0x1a019;
  var_8 = *(int *)(var_1 + 0x14);
  if (var_2 == (char *)0x0) {
    var_3 = 1;
    var_2 = "";
LAB_0001a08b:
    var_4 = &wc;
  }
  else {
    var_6 = 0xfffffffe;
    if (var_3 == 0) goto LAB_0001a063;
    if (var_4 == (type_1 *)0x0) goto LAB_0001a08b;
  }
  var_6 = var_5(var_4,var_2,var_3,(type_2 *)ps);
  if (0xfffffffd < var_6) {
    _Var1 = var_7(0);
    if (!_Var1) {
      var_6 = 1;
      *var_4 = (uint)(byte)*var_2;
    }
  }
LAB_0001a063:
  if (var_8 == *(int *)(var_1 + 0x14)) {
    return var_6;
  }
                    /* WARNING: Subroutine does not return */
  var_9();
}


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

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

size_t MASKED(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)

{
  char cVar1;
  size_t sVar2;
  int in_GS_OFFSET;
  wchar_t local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x1a019;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 == (byte *)0x0) {
    param_3 = 1;
    param_2 = (byte *)0x2ac97;
LAB_0001a08b:
    param_1 = &local_24;
  }
  else {
    sVar2 = 0xfffffffe;
    if (param_3 == 0) goto LAB_0001a063;
    if (param_1 == (wchar_t *)0x0) goto LAB_0001a08b;
  }
  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);
  if (0xfffffffd < sVar2) {
    cVar1 = FUN_00028180(0);
    if (cVar1 == '\0') {
      sVar2 = 1;
      *param_1 = (uint)*param_2;
    }
  }
LAB_0001a063:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return sVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_00028670();
}

