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

{
  undefined *puVar1;
  byte *pbVar2;
  undefined3 extraout_var;
  _Bool _Var3;
  uint uVar4;
  wchar_t wc;
  int local_1c;
  
  puVar1 = PTR___stack_chk_guard_0002c2f0;
  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;
  if (s == (char *)0x0) {
    pwc = &wc;
    s = PTR_DAT_0002c108 + -0x47c0;
  }
  else {
    uVar4 = 0xfffffffe;
    pbVar2 = PTR_DAT_0002c108;
    if (n == 0) goto LAB_00018390;
    if (pwc == (wchar_t *)0x0) goto LAB_000183fc;
  }
  while( true ) {
    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s);
    pbVar2 = (byte *)s;
    if (0xfffffffd < uVar4) {
      _Var3 = hard_locale(0);
      if (CONCAT31(extraout_var,_Var3) == 0) {
        uVar4 = 1;
        *pwc = (uint)(byte)*s;
      }
    }
LAB_00018390:
    s = (char *)pbVar2;
    if (local_1c == *(int *)puVar1) break;
    (*(code *)PTR___stack_chk_fail_0002c2dc)();
LAB_000183fc:
    pwc = &wc;
  }
  return uVar4;
}



uint rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)

{
  undefined *puVar1;
  byte *pbVar2;
  int iVar3;
  uint uVar4;
  uint uStack_20;
  int local_1c;
  
  puVar1 = PTR___stack_chk_guard_0002c2f0;
  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;
  if (param_2 == (byte *)0x0) {
    param_1 = &uStack_20;
    param_2 = PTR_DAT_0002c108 + -0x47c0;
  }
  else {
    uVar4 = 0xfffffffe;
    pbVar2 = PTR_DAT_0002c108;
    if (param_3 == 0) goto LAB_00018390;
    if (param_1 == (uint *)0x0) goto LAB_000183fc;
  }
  while( true ) {
    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);
    pbVar2 = param_2;
    if (0xfffffffd < uVar4) {
      iVar3 = hard_locale(0);
      if (iVar3 == 0) {
        uVar4 = 1;
        *param_1 = (uint)*param_2;
      }
    }
LAB_00018390:
    param_2 = pbVar2;
    if (local_1c == *(int *)puVar1) break;
    (*(code *)PTR___stack_chk_fail_0002c2dc)();
LAB_000183fc:
    param_1 = &uStack_20;
  }
  return uVar4;
}


lui gp,0x2
addiu gp,gp,-0x4250
addu gp,gp,t9
addiu sp,sp,-0x38
sw s1,0x28(sp)
lw s1,-0x7de0(gp)
sw gp,0x10(sp)
sw ra,0x34(sp)
sw s3,0x30(sp)
sw s2,0x2c(sp)
sw s0,0x24(sp)
lw v0,0x0(s1)
sw v0,0x1c(sp)
beq a1,zero,0x000183bc
_lw s0,-0x7fc8(gp)
beq a2,zero,0x00018390
_li s2,-0x2
or s0,a1,zero
beq a0,zero,0x000183fc
_or s3,a0,zero
lw t9,-0x7e18(gp)
or a1,s0,zero
jalr t9
_or a0,s3,zero
or s2,v0,zero
sltiu v0,v0,-0x2
beq v0,zero,0x000183cc
_lw gp,0x10(sp)
lw a0,0x1c(sp)
or v0,s2,zero
lw v1,0x0(s1)
bne a0,v1,0x000183f0
_lw ra,0x34(sp)
lw s3,0x30(sp)
lw s2,0x2c(sp)
lw s1,0x28(sp)
lw s0,0x24(sp)
jr ra
_addiu sp,sp,0x38
li a2,0x1
addiu s3,sp,0x18
b 0x00018370
_addiu s0,s0,-0x47c0
lw t9,-0x7f84(gp)
bal 0x00013f70
_or a0,zero,zero
bne v0,zero,0x00018390
_lw gp,0x10(sp)
lbu v0,0x0(s0)
li s2,0x1
b 0x00018390
_sw v0,0x0(s3)
lw t9,-0x7df4(gp)
jalr t9
_nop
b 0x00018370
_addiu s3,sp,0x18
(translation_unit "uint rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}\n\n" (function_definition "uint rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}" type_identifier (function_declarator "rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)" identifier (parameter_list "(uint *param_1,byte *param_2,int param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "byte *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "byte *pbVar2;" type_identifier (pointer_declarator "*pbVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "uint uStack_20;" type_identifier identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2f0;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2f0" identifier = identifier) ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0002c2f0" * (cast_expression "(int *)PTR___stack_chk_guard_0002c2f0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\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_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }" { (expression_statement "param_1 = &uStack_20;" (assignment_expression "param_1 = &uStack_20" identifier = (pointer_expression "&uStack_20" & identifier)) ;) (expression_statement "param_2 = PTR_DAT_0002c108 + -0x47c0;" (assignment_expression "param_2 = PTR_DAT_0002c108 + -0x47c0" identifier = (binary_expression "PTR_DAT_0002c108 + -0x47c0" identifier + number_literal)) ;) }) (else_clause "else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }" else (compound_statement "{\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }" { (expression_statement "uVar4 = 0xfffffffe;" (assignment_expression "uVar4 = 0xfffffffe" identifier = number_literal) ;) (expression_statement "pbVar2 = PTR_DAT_0002c108;" (assignment_expression "pbVar2 = PTR_DAT_0002c108" identifier = identifier) ;) (if_statement "if (param_3 == 0) goto LAB_00018390;" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00018390;" goto statement_identifier ;)) (if_statement "if (param_1 == (uint *)0x0) goto LAB_000183fc;" if (parenthesized_expression "(param_1 == (uint *)0x0)" ( (binary_expression "param_1 == (uint *)0x0" identifier == (cast_expression "(uint *)0x0" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_000183fc;" goto statement_identifier ;)) }))) (while_statement "while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }" { (expression_statement "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);" (assignment_expression "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2)" identifier = (call_expression "(*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002c2b8)" ( (pointer_expression "*(code *)PTR_mbrtowc_0002c2b8" * (cast_expression "(code *)PTR_mbrtowc_0002c2b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "pbVar2 = param_2;" (assignment_expression "pbVar2 = param_2" identifier = identifier) ;) (if_statement "if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }" if (parenthesized_expression "(0xfffffffd < uVar4)" ( (binary_expression "0xfffffffd < uVar4" number_literal < identifier) )) (compound_statement "{\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }" { (expression_statement "iVar3 = hard_locale(0);" (assignment_expression "iVar3 = hard_locale(0)" identifier = (call_expression "hard_locale(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }" { (expression_statement "uVar4 = 1;" (assignment_expression "uVar4 = 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_00018390:\n    param_2 = pbVar2;" statement_identifier : (expression_statement "param_2 = pbVar2;" (assignment_expression "param_2 = pbVar2" identifier = identifier) ;)) (if_statement "if (local_1c == *(int *)puVar1) break;" if (parenthesized_expression "(local_1c == *(int *)puVar1)" ( (binary_expression "local_1c == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (break_statement "break;" break ;)) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2dc" * (cast_expression "(code *)PTR___stack_chk_fail_0002c2dc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (labeled_statement "LAB_000183fc:\n    param_1 = &uStack_20;" statement_identifier : (expression_statement "param_1 = &uStack_20;" (assignment_expression "param_1 = &uStack_20" identifier = (pointer_expression "&uStack_20" & identifier)) ;)) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "size_t rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)\n\n{\n  undefined *puVar1;\n  byte *pbVar2;\n  undefined3 extraout_var;\n  _Bool _Var3;\n  uint uVar4;\n  wchar_t wc;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (s == (char *)0x0) {\n    pwc = &wc;\n    s = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (n == 0) goto LAB_00018390;\n    if (pwc == (wchar_t *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s);\n    pbVar2 = (byte *)s;\n    if (0xfffffffd < uVar4) {\n      _Var3 = hard_locale(0);\n      if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }\n    }\nLAB_00018390:\n    s = (char *)pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    pwc = &wc;\n  }\n  return uVar4;\n}\n\n" (function_definition "size_t rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)\n\n{\n  undefined *puVar1;\n  byte *pbVar2;\n  undefined3 extraout_var;\n  _Bool _Var3;\n  uint uVar4;\n  wchar_t wc;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (s == (char *)0x0) {\n    pwc = &wc;\n    s = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (n == 0) goto LAB_00018390;\n    if (pwc == (wchar_t *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s);\n    pbVar2 = (byte *)s;\n    if (0xfffffffd < uVar4) {\n      _Var3 = hard_locale(0);\n      if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }\n    }\nLAB_00018390:\n    s = (char *)pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    pwc = &wc;\n  }\n  return uVar4;\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  undefined *puVar1;\n  byte *pbVar2;\n  undefined3 extraout_var;\n  _Bool _Var3;\n  uint uVar4;\n  wchar_t wc;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (s == (char *)0x0) {\n    pwc = &wc;\n    s = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (n == 0) goto LAB_00018390;\n    if (pwc == (wchar_t *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s);\n    pbVar2 = (byte *)s;\n    if (0xfffffffd < uVar4) {\n      _Var3 = hard_locale(0);\n      if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }\n    }\nLAB_00018390:\n    s = (char *)pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    pwc = &wc;\n  }\n  return uVar4;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "byte *pbVar2;" type_identifier (pointer_declarator "*pbVar2" * identifier) ;) (declaration "undefined3 extraout_var;" type_identifier identifier ;) (declaration "_Bool _Var3;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "wchar_t wc;" type_identifier identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2f0;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2f0" identifier = identifier) ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0002c2f0" * (cast_expression "(int *)PTR___stack_chk_guard_0002c2f0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (s == (char *)0x0) {\n    pwc = &wc;\n    s = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (n == 0) goto LAB_00018390;\n    if (pwc == (wchar_t *)0x0) goto LAB_000183fc;\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    pwc = &wc;\n    s = PTR_DAT_0002c108 + -0x47c0;\n  }" { (expression_statement "pwc = &wc;" (assignment_expression "pwc = &wc" identifier = (pointer_expression "&wc" & identifier)) ;) (expression_statement "s = PTR_DAT_0002c108 + -0x47c0;" (assignment_expression "s = PTR_DAT_0002c108 + -0x47c0" identifier = (binary_expression "PTR_DAT_0002c108 + -0x47c0" identifier + number_literal)) ;) }) (else_clause "else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (n == 0) goto LAB_00018390;\n    if (pwc == (wchar_t *)0x0) goto LAB_000183fc;\n  }" else (compound_statement "{\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (n == 0) goto LAB_00018390;\n    if (pwc == (wchar_t *)0x0) goto LAB_000183fc;\n  }" { (expression_statement "uVar4 = 0xfffffffe;" (assignment_expression "uVar4 = 0xfffffffe" identifier = number_literal) ;) (expression_statement "pbVar2 = PTR_DAT_0002c108;" (assignment_expression "pbVar2 = PTR_DAT_0002c108" identifier = identifier) ;) (if_statement "if (n == 0) goto LAB_00018390;" if (parenthesized_expression "(n == 0)" ( (binary_expression "n == 0" identifier == number_literal) )) (goto_statement "goto LAB_00018390;" goto statement_identifier ;)) (if_statement "if (pwc == (wchar_t *)0x0) goto LAB_000183fc;" 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_000183fc;" goto statement_identifier ;)) }))) (while_statement "while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s);\n    pbVar2 = (byte *)s;\n    if (0xfffffffd < uVar4) {\n      _Var3 = hard_locale(0);\n      if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }\n    }\nLAB_00018390:\n    s = (char *)pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    pwc = &wc;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s);\n    pbVar2 = (byte *)s;\n    if (0xfffffffd < uVar4) {\n      _Var3 = hard_locale(0);\n      if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }\n    }\nLAB_00018390:\n    s = (char *)pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    pwc = &wc;\n  }" { (expression_statement "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s);" (assignment_expression "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(pwc,s)" identifier = (call_expression "(*(code *)PTR_mbrtowc_0002c2b8)(pwc,s)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002c2b8)" ( (pointer_expression "*(code *)PTR_mbrtowc_0002c2b8" * (cast_expression "(code *)PTR_mbrtowc_0002c2b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pwc,s)" ( identifier , identifier )))) ;) (expression_statement "pbVar2 = (byte *)s;" (assignment_expression "pbVar2 = (byte *)s" identifier = (cast_expression "(byte *)s" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) ;) (if_statement "if (0xfffffffd < uVar4) {\n      _Var3 = hard_locale(0);\n      if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }\n    }" if (parenthesized_expression "(0xfffffffd < uVar4)" ( (binary_expression "0xfffffffd < uVar4" number_literal < identifier) )) (compound_statement "{\n      _Var3 = hard_locale(0);\n      if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }\n    }" { (expression_statement "_Var3 = hard_locale(0);" (assignment_expression "_Var3 = hard_locale(0)" identifier = (call_expression "hard_locale(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (CONCAT31(extraout_var,_Var3) == 0) {\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }" if (parenthesized_expression "(CONCAT31(extraout_var,_Var3) == 0)" ( (binary_expression "CONCAT31(extraout_var,_Var3) == 0" (call_expression "CONCAT31(extraout_var,_Var3)" identifier (argument_list "(extraout_var,_Var3)" ( identifier , identifier ))) == number_literal) )) (compound_statement "{\n        uVar4 = 1;\n        *pwc = (uint)(byte)*s;\n      }" { (expression_statement "uVar4 = 1;" (assignment_expression "uVar4 = 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_00018390:\n    s = (char *)pbVar2;" statement_identifier : (expression_statement "s = (char *)pbVar2;" (assignment_expression "s = (char *)pbVar2" identifier = (cast_expression "(char *)pbVar2" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier)) ;)) (if_statement "if (local_1c == *(int *)puVar1) break;" if (parenthesized_expression "(local_1c == *(int *)puVar1)" ( (binary_expression "local_1c == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (break_statement "break;" break ;)) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2dc" * (cast_expression "(code *)PTR___stack_chk_fail_0002c2dc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (labeled_statement "LAB_000183fc:\n    pwc = &wc;" statement_identifier : (expression_statement "pwc = &wc;" (assignment_expression "pwc = &wc" identifier = (pointer_expression "&wc" & identifier)) ;)) })) (return_statement "return uVar4;" return identifier ;) })))
(translation_unit "uint rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}\n\n" (function_definition "uint rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}" type_identifier (function_declarator "rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)" identifier (parameter_list "(uint *param_1,byte *param_2,int param_3)" ( (parameter_declaration "uint *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "byte *param_2" type_identifier (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}" { (declaration "undefined *puVar1;" type_identifier (pointer_declarator "*puVar1" * identifier) ;) (declaration "byte *pbVar2;" type_identifier (pointer_declarator "*pbVar2" * identifier) ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (declaration "uint uStack_20;" type_identifier identifier ;) (declaration "int local_1c;" primitive_type identifier ;) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2f0;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2f0" identifier = identifier) ;) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_0002c2f0" * (cast_expression "(int *)PTR___stack_chk_guard_0002c2f0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\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_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }" { (expression_statement "param_1 = &uStack_20;" (assignment_expression "param_1 = &uStack_20" identifier = (pointer_expression "&uStack_20" & identifier)) ;) (expression_statement "param_2 = PTR_DAT_0002c108 + -0x47c0;" (assignment_expression "param_2 = PTR_DAT_0002c108 + -0x47c0" identifier = (binary_expression "PTR_DAT_0002c108 + -0x47c0" identifier + number_literal)) ;) }) (else_clause "else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }" else (compound_statement "{\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }" { (expression_statement "uVar4 = 0xfffffffe;" (assignment_expression "uVar4 = 0xfffffffe" identifier = number_literal) ;) (expression_statement "pbVar2 = PTR_DAT_0002c108;" (assignment_expression "pbVar2 = PTR_DAT_0002c108" identifier = identifier) ;) (if_statement "if (param_3 == 0) goto LAB_00018390;" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00018390;" goto statement_identifier ;)) (if_statement "if (param_1 == (uint *)0x0) goto LAB_000183fc;" if (parenthesized_expression "(param_1 == (uint *)0x0)" ( (binary_expression "param_1 == (uint *)0x0" identifier == (cast_expression "(uint *)0x0" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (goto_statement "goto LAB_000183fc;" goto statement_identifier ;)) }))) (while_statement "while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }" while (parenthesized_expression "( true )" ( true )) (compound_statement "{\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }" { (expression_statement "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);" (assignment_expression "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2)" identifier = (call_expression "(*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002c2b8)" ( (pointer_expression "*(code *)PTR_mbrtowc_0002c2b8" * (cast_expression "(code *)PTR_mbrtowc_0002c2b8" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2)" ( identifier , identifier )))) ;) (expression_statement "pbVar2 = param_2;" (assignment_expression "pbVar2 = param_2" identifier = identifier) ;) (if_statement "if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }" if (parenthesized_expression "(0xfffffffd < uVar4)" ( (binary_expression "0xfffffffd < uVar4" number_literal < identifier) )) (compound_statement "{\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }" { (expression_statement "iVar3 = hard_locale(0);" (assignment_expression "iVar3 = hard_locale(0)" identifier = (call_expression "hard_locale(0)" identifier (argument_list "(0)" ( number_literal )))) ;) (if_statement "if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }" if (parenthesized_expression "(iVar3 == 0)" ( (binary_expression "iVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }" { (expression_statement "uVar4 = 1;" (assignment_expression "uVar4 = 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_00018390:\n    param_2 = pbVar2;" statement_identifier : (expression_statement "param_2 = pbVar2;" (assignment_expression "param_2 = pbVar2" identifier = identifier) ;)) (if_statement "if (local_1c == *(int *)puVar1) break;" if (parenthesized_expression "(local_1c == *(int *)puVar1)" ( (binary_expression "local_1c == *(int *)puVar1" identifier == (pointer_expression "*(int *)puVar1" * (cast_expression "(int *)puVar1" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (break_statement "break;" break ;)) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2dc" * (cast_expression "(code *)PTR___stack_chk_fail_0002c2dc" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (labeled_statement "LAB_000183fc:\n    param_1 = &uStack_20;" statement_identifier : (expression_statement "param_1 = &uStack_20;" (assignment_expression "param_1 = &uStack_20" identifier = (pointer_expression "&uStack_20" & identifier)) ;)) })) (return_statement "return uVar4;" return identifier ;) })))
(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) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) ;) (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 = (binary_expression IDENT + LIT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (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 ;)) }))) (while_statement while (parenthesized_expression ( BOOL )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression 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 == LIT) )) (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 : (expression_statement (assignment_expression IDENT = IDENT) ;)) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (break_statement break ;)) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (labeled_statement statement_identifier : (expression_statement (assignment_expression IDENT = (pointer_expression & IDENT)) ;)) })) (return_statement return IDENT ;) })))
(function_definition "uint rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}" (type_identifier "uint") (function_declarator "rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)" (identifier "rpl_mbrtowc") (parameter_list "(uint *param_1,byte *param_2,int param_3)" (( "(") (parameter_declaration "uint *param_1" (type_identifier "uint") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "byte *param_2" (type_identifier "byte") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined *puVar1;\n  byte *pbVar2;\n  int iVar3;\n  uint uVar4;\n  uint uStack_20;\n  int local_1c;\n  \n  puVar1 = PTR___stack_chk_guard_0002c2f0;\n  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;\n  if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }\n  while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }\n  return uVar4;\n}" ({ "{") (declaration "undefined *puVar1;" (type_identifier "undefined") (pointer_declarator "*puVar1" (* "*") (identifier "puVar1")) (; ";")) (declaration "byte *pbVar2;" (type_identifier "byte") (pointer_declarator "*pbVar2" (* "*") (identifier "pbVar2")) (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "uint uVar4;" (type_identifier "uint") (identifier "uVar4") (; ";")) (declaration "uint uStack_20;" (type_identifier "uint") (identifier "uStack_20") (; ";")) (declaration "int local_1c;" (primitive_type "int") (identifier "local_1c") (; ";")) (expression_statement "puVar1 = PTR___stack_chk_guard_0002c2f0;" (assignment_expression "puVar1 = PTR___stack_chk_guard_0002c2f0" (identifier "puVar1") (= "=") (identifier "PTR___stack_chk_guard_0002c2f0")) (; ";")) (expression_statement "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;" (assignment_expression "local_1c = *(int *)PTR___stack_chk_guard_0002c2f0" (identifier "local_1c") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_0002c2f0" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_0002c2f0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_0002c2f0")))) (; ";")) (if_statement "if (param_2 == (byte *)0x0) {\n    param_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }\n  else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\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_1 = &uStack_20;\n    param_2 = PTR_DAT_0002c108 + -0x47c0;\n  }" ({ "{") (expression_statement "param_1 = &uStack_20;" (assignment_expression "param_1 = &uStack_20" (identifier "param_1") (= "=") (pointer_expression "&uStack_20" (& "&") (identifier "uStack_20"))) (; ";")) (expression_statement "param_2 = PTR_DAT_0002c108 + -0x47c0;" (assignment_expression "param_2 = PTR_DAT_0002c108 + -0x47c0" (identifier "param_2") (= "=") (binary_expression "PTR_DAT_0002c108 + -0x47c0" (identifier "PTR_DAT_0002c108") (+ "+") (number_literal "-0x47c0"))) (; ";")) (} "}")) (else_clause "else {\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }" (else "else") (compound_statement "{\n    uVar4 = 0xfffffffe;\n    pbVar2 = PTR_DAT_0002c108;\n    if (param_3 == 0) goto LAB_00018390;\n    if (param_1 == (uint *)0x0) goto LAB_000183fc;\n  }" ({ "{") (expression_statement "uVar4 = 0xfffffffe;" (assignment_expression "uVar4 = 0xfffffffe" (identifier "uVar4") (= "=") (number_literal "0xfffffffe")) (; ";")) (expression_statement "pbVar2 = PTR_DAT_0002c108;" (assignment_expression "pbVar2 = PTR_DAT_0002c108" (identifier "pbVar2") (= "=") (identifier "PTR_DAT_0002c108")) (; ";")) (if_statement "if (param_3 == 0) goto LAB_00018390;" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_00018390;" (goto "goto") (statement_identifier "LAB_00018390") (; ";"))) (if_statement "if (param_1 == (uint *)0x0) goto LAB_000183fc;" (if "if") (parenthesized_expression "(param_1 == (uint *)0x0)" (( "(") (binary_expression "param_1 == (uint *)0x0" (identifier "param_1") (== "==") (cast_expression "(uint *)0x0" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (goto_statement "goto LAB_000183fc;" (goto "goto") (statement_identifier "LAB_000183fc") (; ";"))) (} "}")))) (while_statement "while( true ) {\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }" (while "while") (parenthesized_expression "( true )" (( "(") (true "true") () ")")) (compound_statement "{\n    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);\n    pbVar2 = param_2;\n    if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }\nLAB_00018390:\n    param_2 = pbVar2;\n    if (local_1c == *(int *)puVar1) break;\n    (*(code *)PTR___stack_chk_fail_0002c2dc)();\nLAB_000183fc:\n    param_1 = &uStack_20;\n  }" ({ "{") (expression_statement "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);" (assignment_expression "uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2)" (identifier "uVar4") (= "=") (call_expression "(*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002c2b8)" (( "(") (pointer_expression "*(code *)PTR_mbrtowc_0002c2b8" (* "*") (cast_expression "(code *)PTR_mbrtowc_0002c2b8" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_mbrtowc_0002c2b8"))) () ")")) (argument_list "(param_1,param_2)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (expression_statement "pbVar2 = param_2;" (assignment_expression "pbVar2 = param_2" (identifier "pbVar2") (= "=") (identifier "param_2")) (; ";")) (if_statement "if (0xfffffffd < uVar4) {\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }" (if "if") (parenthesized_expression "(0xfffffffd < uVar4)" (( "(") (binary_expression "0xfffffffd < uVar4" (number_literal "0xfffffffd") (< "<") (identifier "uVar4")) () ")")) (compound_statement "{\n      iVar3 = hard_locale(0);\n      if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }\n    }" ({ "{") (expression_statement "iVar3 = hard_locale(0);" (assignment_expression "iVar3 = hard_locale(0)" (identifier "iVar3") (= "=") (call_expression "hard_locale(0)" (identifier "hard_locale") (argument_list "(0)" (( "(") (number_literal "0") () ")")))) (; ";")) (if_statement "if (iVar3 == 0) {\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }" (if "if") (parenthesized_expression "(iVar3 == 0)" (( "(") (binary_expression "iVar3 == 0" (identifier "iVar3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        uVar4 = 1;\n        *param_1 = (uint)*param_2;\n      }" ({ "{") (expression_statement "uVar4 = 1;" (assignment_expression "uVar4 = 1" (identifier "uVar4") (= "=") (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_00018390:\n    param_2 = pbVar2;" (statement_identifier "LAB_00018390") (: ":") (expression_statement "param_2 = pbVar2;" (assignment_expression "param_2 = pbVar2" (identifier "param_2") (= "=") (identifier "pbVar2")) (; ";"))) (if_statement "if (local_1c == *(int *)puVar1) break;" (if "if") (parenthesized_expression "(local_1c == *(int *)puVar1)" (( "(") (binary_expression "local_1c == *(int *)puVar1" (identifier "local_1c") (== "==") (pointer_expression "*(int *)puVar1" (* "*") (cast_expression "(int *)puVar1" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "puVar1")))) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "(*(code *)PTR___stack_chk_fail_0002c2dc)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002c2dc)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_0002c2dc" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_0002c2dc" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_0002c2dc"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (labeled_statement "LAB_000183fc:\n    param_1 = &uStack_20;" (statement_identifier "LAB_000183fc") (: ":") (expression_statement "param_1 = &uStack_20;" (assignment_expression "param_1 = &uStack_20" (identifier "param_1") (= "=") (pointer_expression "&uStack_20" (& "&") (identifier "uStack_20"))) (; ";"))) (} "}"))) (return_statement "return uVar4;" (return "return") (identifier "uVar4") (; ";")) (} "}")))

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

{
  type_3 *puVar1;
  type_4 *pbVar2;
  type_5 extraout_var;
  type_6 _Var3;
  type_7 var_5;
  type_1 wc;
  int var_8;
  
  puVar1 = PTR___stack_chk_guard_0002c2f0;
  var_8 = *(int *)PTR___stack_chk_guard_0002c2f0;
  if (var_1 == (char *)0x0) {
    var_4 = &wc;
    var_1 = var_2 + -0x47c0;
  }
  else {
    var_5 = 0xfffffffe;
    pbVar2 = var_2;
    if (var_3 == 0) goto LAB_00018390;
    if (var_4 == (type_1 *)0x0) goto LAB_000183fc;
  }
  while( true ) {
    var_5 = (*(type_8 *)PTR_mbrtowc_0002c2b8)(var_4,var_1);
    pbVar2 = (type_4 *)var_1;
    if (0xfffffffd < var_5) {
      _Var3 = var_6(0);
      if (var_7(extraout_var,_Var3) == 0) {
        var_5 = 1;
        *var_4 = (type_7)(type_4)*var_1;
      }
    }
LAB_00018390:
    var_1 = (char *)pbVar2;
    if (var_8 == *(int *)puVar1) break;
    (*(type_8 *)PTR___stack_chk_fail_0002c2dc)();
LAB_000183fc:
    var_4 = &wc;
  }
  return var_5;
}


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

uint MASKED(uint *param_1,byte *param_2,int param_3)

{
  undefined *puVar1;
  byte *pbVar2;
  int iVar3;
  uint uVar4;
  uint uStack_20;
  int local_1c;
  
  puVar1 = PTR___stack_chk_guard_0002c2f0;
  local_1c = *(int *)PTR___stack_chk_guard_0002c2f0;
  if (param_2 == (byte *)0x0) {
    param_1 = &uStack_20;
    param_2 = PTR_DAT_0002c108 + -0x47c0;
  }
  else {
    uVar4 = 0xfffffffe;
    pbVar2 = PTR_DAT_0002c108;
    if (param_3 == 0) goto LAB_00018390;
    if (param_1 == (uint *)0x0) goto LAB_000183fc;
  }
  while( true ) {
    uVar4 = (*(code *)PTR_mbrtowc_0002c2b8)(param_1,param_2);
    pbVar2 = param_2;
    if (0xfffffffd < uVar4) {
      iVar3 = hard_locale(0);
      if (iVar3 == 0) {
        uVar4 = 1;
        *param_1 = (uint)*param_2;
      }
    }
LAB_00018390:
    param_2 = pbVar2;
    if (local_1c == *(int *)puVar1) break;
    (*(code *)PTR___stack_chk_fail_0002c2dc)();
LAB_000183fc:
    param_1 = &uStack_20;
  }
  return uVar4;
}

