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

{
  _Bool _Var1;
  size_t sVar2;
  long in_FS_OFFSET;
  wchar_t wc;
  long local_30;
  
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  if (pwc == (wchar_t *)0x0) {
    pwc = &wc;
  }
  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);
  if ((0xfffffffffffffffd < sVar2) && (n != 0)) {
    _Var1 = hard_locale(0);
    if (!_Var1) {
      *pwc = (uint)(byte)*s;
      sVar2 = 1;
    }
  }
  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {
    return sVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}



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

{
  char cVar1;
  size_t sVar2;
  long in_FS_OFFSET;
  wchar_t local_34;
  long local_30;
  
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  if (param_1 == (wchar_t *)0x0) {
    param_1 = &local_34;
  }
  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);
  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {
    cVar1 = FUN_00105845(0);
    if (cVar1 == '\0') {
      *param_1 = (uint)*param_2;
      sVar2 = 1;
    }
  }
  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {
    return sVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}


PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x18
MOV RBX,RDI
MOV R13,RSI
MOV R12,RDX
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x8],RAX
XOR EAX,EAX
LEA RAX,[RSP + 0x4]
TEST RDI,RDI
CMOVZ RBX,RAX
MOV RDI,RBX
CALL 0x00102140
MOV RBP,RAX
CMP RAX,-0x3
JBE 0x001057a3
TEST R12,R12
JNZ 0x001057c1
MOV RAX,RBP
MOV RDX,qword ptr [RSP + 0x8]
XOR RDX,qword ptr FS:[0x28]
JNZ 0x001057dd
ADD RSP,0x18
POP RBX
POP RBP
POP R12
POP R13
RET
MOV EDI,0x0
CALL 0x00105845
TEST AL,AL
JNZ 0x001057a3
MOVZX EAX,byte ptr [R13]
MOV dword ptr [RBX],EAX
MOV EBP,0x1
JMP 0x001057a3
CALL 0x00102120
(translation_unit "size_t FUN_0010575e(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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "size_t FUN_0010575e(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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" primitive_type (function_declarator "FUN_0010575e(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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t local_34;" type_identifier identifier ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }" 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)) )) (compound_statement "{\n    param_1 = &local_34;\n  }" { (expression_statement "param_1 = &local_34;" (assignment_expression "param_1 = &local_34" identifier = (pointer_expression "&local_34" & 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 ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }" if (parenthesized_expression "((0xfffffffffffffffd < sVar2) && (param_3 != 0))" ( (binary_expression "(0xfffffffffffffffd < sVar2) && (param_3 != 0)" (parenthesized_expression "(0xfffffffffffffffd < sVar2)" ( (binary_expression "0xfffffffffffffffd < sVar2" number_literal < identifier) )) && (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }" { (expression_statement "cVar1 = FUN_00105845(0);" (assignment_expression "cVar1 = FUN_00105845(0)" identifier = (call_expression "FUN_00105845(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }" { (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)) ;) (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) })) })) (if_statement "if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }" if (parenthesized_expression "(local_30 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_30 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return sVar2;\n  }" { (return_statement "return sVar2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "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  long in_FS_OFFSET;\n  wchar_t wc;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (pwc == (wchar_t *)0x0) {\n    pwc = &wc;\n  }\n  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);\n  if ((0xfffffffffffffffd < sVar2) && (n != 0)) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      *pwc = (uint)(byte)*s;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (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  long in_FS_OFFSET;\n  wchar_t wc;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (pwc == (wchar_t *)0x0) {\n    pwc = &wc;\n  }\n  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);\n  if ((0xfffffffffffffffd < sVar2) && (n != 0)) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      *pwc = (uint)(byte)*s;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\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  long in_FS_OFFSET;\n  wchar_t wc;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (pwc == (wchar_t *)0x0) {\n    pwc = &wc;\n  }\n  sVar2 = mbrtowc(pwc,s,n,(mbstate_t *)ps);\n  if ((0xfffffffffffffffd < sVar2) && (n != 0)) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      *pwc = (uint)(byte)*s;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "_Bool _Var1;" type_identifier identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t wc;" type_identifier identifier ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (pwc == (wchar_t *)0x0) {\n    pwc = &wc;\n  }" 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)) )) (compound_statement "{\n    pwc = &wc;\n  }" { (expression_statement "pwc = &wc;" (assignment_expression "pwc = &wc" identifier = (pointer_expression "&wc" & 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 ((0xfffffffffffffffd < sVar2) && (n != 0)) {\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      *pwc = (uint)(byte)*s;\n      sVar2 = 1;\n    }\n  }" if (parenthesized_expression "((0xfffffffffffffffd < sVar2) && (n != 0))" ( (binary_expression "(0xfffffffffffffffd < sVar2) && (n != 0)" (parenthesized_expression "(0xfffffffffffffffd < sVar2)" ( (binary_expression "0xfffffffffffffffd < sVar2" number_literal < identifier) )) && (parenthesized_expression "(n != 0)" ( (binary_expression "n != 0" identifier != number_literal) ))) )) (compound_statement "{\n    _Var1 = hard_locale(0);\n    if (!_Var1) {\n      *pwc = (uint)(byte)*s;\n      sVar2 = 1;\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      *pwc = (uint)(byte)*s;\n      sVar2 = 1;\n    }" if (parenthesized_expression "(!_Var1)" ( (unary_expression "!_Var1" ! identifier) )) (compound_statement "{\n      *pwc = (uint)(byte)*s;\n      sVar2 = 1;\n    }" { (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)) ;) (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) })) })) (if_statement "if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }" if (parenthesized_expression "(local_30 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_30 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return sVar2;\n  }" { (return_statement "return sVar2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "size_t FUN_0010575e(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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    \n  __stack_chk_fail();\n}\n\n" (function_definition "size_t FUN_0010575e(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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    \n  __stack_chk_fail();\n}" primitive_type (function_declarator "FUN_0010575e(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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    \n  __stack_chk_fail();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "wchar_t local_34;" type_identifier identifier ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (if_statement "if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }" 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)) )) (compound_statement "{\n    param_1 = &local_34;\n  }" { (expression_statement "param_1 = &local_34;" (assignment_expression "param_1 = &local_34" identifier = (pointer_expression "&local_34" & 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 ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }" if (parenthesized_expression "((0xfffffffffffffffd < sVar2) && (param_3 != 0))" ( (binary_expression "(0xfffffffffffffffd < sVar2) && (param_3 != 0)" (parenthesized_expression "(0xfffffffffffffffd < sVar2)" ( (binary_expression "0xfffffffffffffffd < sVar2" number_literal < identifier) )) && (parenthesized_expression "(param_3 != 0)" ( (binary_expression "param_3 != 0" identifier != number_literal) ))) )) (compound_statement "{\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }" { (expression_statement "cVar1 = FUN_00105845(0);" (assignment_expression "cVar1 = FUN_00105845(0)" identifier = (call_expression "FUN_00105845(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }" if (parenthesized_expression "(cVar1 == '\0')" ( (binary_expression "cVar1 == '\0'" identifier == (char_literal "'\0'" ' escape_sequence ')) )) (compound_statement "{\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }" { (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)) ;) (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) })) })) (if_statement "if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }" if (parenthesized_expression "(local_30 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_30 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return sVar2;\n  }" { (return_statement "return sVar2;" return identifier ;) })) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" 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 (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (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 = (pointer_expression & IDENT)) ;) })) (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 (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (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 (pointer_expression * IDENT) = (binary_expression (parenthesized_expression ( IDENT )) * IDENT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (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_0010575e(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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    \n  __stack_chk_fail();\n}" (primitive_type "size_t") (function_declarator "FUN_0010575e(wchar_t *param_1,byte *param_2,size_t param_3,mbstate_t *param_4)" (identifier "FUN_0010575e") (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  long in_FS_OFFSET;\n  wchar_t local_34;\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }\n  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);\n  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }\n                    \n  __stack_chk_fail();\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "wchar_t local_34;" (type_identifier "wchar_t") (identifier "local_34") (; ";")) (declaration "long local_30;" (sized_type_specifier "long" (long "long")) (identifier "local_30") (; ";")) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_30") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (if_statement "if (param_1 == (wchar_t *)0x0) {\n    param_1 = &local_34;\n  }" (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"))) () ")")) (compound_statement "{\n    param_1 = &local_34;\n  }" ({ "{") (expression_statement "param_1 = &local_34;" (assignment_expression "param_1 = &local_34" (identifier "param_1") (= "=") (pointer_expression "&local_34" (& "&") (identifier "local_34"))) (; ";")) (} "}"))) (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 ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }" (if "if") (parenthesized_expression "((0xfffffffffffffffd < sVar2) && (param_3 != 0))" (( "(") (binary_expression "(0xfffffffffffffffd < sVar2) && (param_3 != 0)" (parenthesized_expression "(0xfffffffffffffffd < sVar2)" (( "(") (binary_expression "0xfffffffffffffffd < sVar2" (number_literal "0xfffffffffffffffd") (< "<") (identifier "sVar2")) () ")")) (&& "&&") (parenthesized_expression "(param_3 != 0)" (( "(") (binary_expression "param_3 != 0" (identifier "param_3") (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n    cVar1 = FUN_00105845(0);\n    if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }\n  }" ({ "{") (expression_statement "cVar1 = FUN_00105845(0);" (assignment_expression "cVar1 = FUN_00105845(0)" (identifier "cVar1") (= "=") (call_expression "FUN_00105845(0)" (identifier "FUN_00105845") (argument_list "(0)" (( "(") (number_literal "0") () ")")))) (; ";")) (if_statement "if (cVar1 == '\0') {\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }" (if "if") (parenthesized_expression "(cVar1 == '\0')" (( "(") (binary_expression "cVar1 == '\0'" (identifier "cVar1") (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (compound_statement "{\n      *param_1 = (uint)*param_2;\n      sVar2 = 1;\n    }" ({ "{") (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"))) (; ";")) (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" (identifier "sVar2") (= "=") (number_literal "1")) (; ";")) (} "}"))) (} "}"))) (if_statement "if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return sVar2;\n  }" (if "if") (parenthesized_expression "(local_30 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_30 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_30") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n    return sVar2;\n  }" ({ "{") (return_statement "return sVar2;" (return "return") (identifier "sVar2") (; ";")) (} "}"))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

size_t function_1(type_1 *var_2,char *var_7,size_t var_5,type_2 *ps)

{
  type_3 _Var1;
  size_t var_4;
  long var_1;
  type_1 wc;
  long var_8;
  
  var_8 = *(long *)(var_1 + 0x28);
  if (var_2 == (type_1 *)0x0) {
    var_2 = &wc;
  }
  var_4 = var_3(var_2,var_7,var_5,(type_2 *)ps);
  if ((0xfffffffffffffffd < var_4) && (var_5 != 0)) {
    _Var1 = var_6(0);
    if (!_Var1) {
      *var_2 = (uint)(byte)*var_7;
      var_4 = 1;
    }
  }
  if (var_8 == *(long *)(var_1 + 0x28)) {
    return var_4;
  }
                    /* 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: (sized_type_specifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (sized_type_specifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) 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: (pointer_expression argument: (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: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) right: (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 (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (escape_sequence)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (parenthesized_expression (identifier)) right: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (sized_type_specifier) 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))))))

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

{
  char cVar1;
  size_t sVar2;
  long in_FS_OFFSET;
  wchar_t local_34;
  long local_30;
  
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  if (param_1 == (wchar_t *)0x0) {
    param_1 = &local_34;
  }
  sVar2 = mbrtowc(param_1,(char *)param_2,param_3,param_4);
  if ((0xfffffffffffffffd < sVar2) && (param_3 != 0)) {
    cVar1 = FUN_00105845(0);
    if (cVar1 == '\0') {
      *param_1 = (uint)*param_2;
      sVar2 = 1;
    }
  }
  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {
    return sVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

