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

{
  char cVar1;
  undefined3 extraout_var;
  size_t sVar2;
  _Bool _Var7;
  undefined1 *puVar3;
  int iVar4;
  undefined1 *puVar5;
  undefined1 *puVar6;
  undefined *puVar8;
  wchar_t wc;
  int local_14;
  
  local_14 = *(int *)PTR___stack_chk_guard_000292ac;
  if (s == (char *)0x0) {
    n = 1;
    s = PTR_DAT_0002910c + -0x7720;
    pwc = &wc;
  }
  else {
    if (n == 0) {
      sVar2 = 0xfffffffe;
      goto LAB_00016b58;
    }
    if (pwc == (wchar_t *)0x0) {
      pwc = &wc;
    }
  }
  sVar2 = (*(code *)PTR_mbrtowc_0002927c)(pwc,s,n);
  if ((0xfffffffd < sVar2) && (_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0)) {
    *pwc = (uint)(byte)*s;
    sVar2 = 1;
  }
LAB_00016b58:
  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {
    return sVar2;
  }
  iVar4 = local_14;
  puVar8 = PTR___stack_chk_fail_0002929c;
  (*(code *)PTR___stack_chk_fail_0002929c)();
  puVar3 = (undefined1 *)xmalloc(0x21);
  (**(code **)(puVar8 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);
  puVar3[0x20] = 0;
  iVar4 = (**(code **)(puVar8 + 0x12674))(puVar3);
  puVar5 = puVar3 + iVar4;
  if (puVar3 < puVar5) {
    cVar1 = puVar5[-1];
    while (cVar1 == ' ') {
      puVar6 = puVar5 + -1;
      *puVar6 = 0;
      if (puVar3 == puVar6) {
        return (size_t)puVar3;
      }
      cVar1 = puVar5[-2];
      puVar5 = puVar6;
    }
  }
  return (size_t)puVar3;
}



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

{
  char cVar1;
  undefined1 *puVar2;
  undefined1 *puVar3;
  int iVar4;
  undefined1 *puVar5;
  undefined *puVar6;
  uint uStack_18;
  int local_14;
  
  local_14 = *(int *)PTR___stack_chk_guard_000292ac;
  if (param_2 == (byte *)0x0) {
    param_3 = 1;
    param_2 = PTR_DAT_0002910c + -0x7720;
    param_1 = &uStack_18;
  }
  else {
    if (param_3 == 0) {
      puVar2 = &SUB_fffffffe;
      goto LAB_00016b58;
    }
    if (param_1 == (uint *)0x0) {
      param_1 = &uStack_18;
    }
  }
  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);
  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {
    *param_1 = (uint)*param_2;
    puVar2 = (undefined1 *)0x1;
  }
LAB_00016b58:
  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {
    return puVar2;
  }
  iVar4 = local_14;
  puVar6 = PTR___stack_chk_fail_0002929c;
  (*(code *)PTR___stack_chk_fail_0002929c)();
  puVar3 = (undefined1 *)xmalloc(0x21);
  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);
  puVar3[0x20] = 0;
  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);
  puVar2 = puVar3 + iVar4;
  if (puVar3 < puVar2) {
    cVar1 = puVar2[-1];
    while (cVar1 == ' ') {
      puVar5 = puVar2 + -1;
      *puVar5 = 0;
      if (puVar3 == puVar5) {
        return puVar3;
      }
      cVar1 = puVar2[-2];
      puVar2 = puVar5;
    }
  }
  return puVar3;
}


lui gp,0x2
addiu gp,gp,-0x5a10
addu gp,gp,t9
addiu sp,sp,-0x30
sw ra,0x2c(sp)
sw s2,0x28(sp)
sw s1,0x24(sp)
sw s0,0x20(sp)
sw gp,0x10(sp)
lw v0,-0x7e24(gp)
lw v0,0x0(v0)
sw v0,0x1c(sp)
beq a1,zero,0x00016b88
_nop
or s2,a0,zero
beq a2,zero,0x00016bc4
_or s0,a1,zero
beq a0,zero,0x00016b80
_nop
or a1,s0,zero
or a0,s2,zero
lw t9,-0x7e54(gp)
jalr t9
_nop
lw gp,0x10(sp)
or s1,v0,zero
sltiu v0,v0,-0x2
beq v0,zero,0x00016b9c
_or a0,zero,zero
or v0,s1,zero
lw a0,0x1c(sp)
lw v1,-0x7e24(gp)
lw v1,0x0(v1)
bne a0,v1,0x00016bcc
_lw ra,0x2c(sp)
lw s2,0x28(sp)
lw s1,0x24(sp)
lw s0,0x20(sp)
jr ra
_addiu sp,sp,0x30
b 0x00016b2c
_addiu s2,sp,0x18
li a2,0x1
lw s0,-0x7fc4(gp)
addiu s0,s0,-0x7720
b 0x00016b2c
_addiu s2,sp,0x18
lw t9,-0x7f14(gp)
bal 0x00016ff0
_nop
lw gp,0x10(sp)
bne v0,zero,0x00016b58
_or v0,s1,zero
lbu v0,0x0(s0)
sw v0,0x0(s2)
b 0x00016b54
_li s1,0x1
b 0x00016b54
_li s1,-0x2
lw t9,-0x7e34(gp)
jalr t9
_nop
nop
nop
(translation_unit "undefined1 * rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}\n\n" (function_definition "undefined1 * rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}" type_identifier (pointer_declarator "* rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)" * (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  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "undefined1 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "undefined *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "uint uStack_18;" type_identifier identifier ;) (declaration "int local_14;" primitive_type identifier ;) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_000292ac;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_000292ac" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" * (cast_expression "(int *)PTR___stack_chk_guard_000292ac" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" if (parenthesized_expression "(param_2 == (byte *)0x0)" ( (binary_expression "param_2 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }" { (expression_statement "param_3 = 1;" (assignment_expression "param_3 = 1" identifier = number_literal) ;) (expression_statement "param_2 = PTR_DAT_0002910c + -0x7720;" (assignment_expression "param_2 = PTR_DAT_0002910c + -0x7720" identifier = (binary_expression "PTR_DAT_0002910c + -0x7720" identifier + number_literal)) ;) (expression_statement "param_1 = &uStack_18;" (assignment_expression "param_1 = &uStack_18" identifier = (pointer_expression "&uStack_18" & identifier)) ;) }) (else_clause "else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" else (compound_statement "{\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" { (if_statement "if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }" { (expression_statement "puVar2 = &SUB_fffffffe;" (assignment_expression "puVar2 = &SUB_fffffffe" identifier = (pointer_expression "&SUB_fffffffe" & identifier)) ;) (goto_statement "goto LAB_00016b58;" goto statement_identifier ;) })) (if_statement "if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }" 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)) )) (compound_statement "{\n      param_1 = &uStack_18;\n    }" { (expression_statement "param_1 = &uStack_18;" (assignment_expression "param_1 = &uStack_18" identifier = (pointer_expression "&uStack_18" & identifier)) ;) })) }))) (expression_statement "puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);" (assignment_expression "puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" identifier = (cast_expression "(undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002927c)" ( (pointer_expression "*(code *)PTR_mbrtowc_0002927c" * (cast_expression "(code *)PTR_mbrtowc_0002927c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier ))))) ;) (if_statement "if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }" if (parenthesized_expression "(((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0))" ( (binary_expression "((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)" (parenthesized_expression "((undefined1 *)0xfffffffd < puVar2)" ( (binary_expression "(undefined1 *)0xfffffffd < puVar2" (cast_expression "(undefined1 *)0xfffffffd" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) < identifier) )) && (parenthesized_expression "(iVar4 = hard_locale(0), iVar4 == 0)" ( (comma_expression "iVar4 = hard_locale(0), iVar4 == 0" (assignment_expression "iVar4 = hard_locale(0)" identifier = (call_expression "hard_locale(0)" identifier (argument_list "(0)" ( number_literal )))) , (binary_expression "iVar4 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\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 "puVar2 = (undefined1 *)0x1;" (assignment_expression "puVar2 = (undefined1 *)0x1" identifier = (cast_expression "(undefined1 *)0x1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) (labeled_statement "LAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }" statement_identifier : (if_statement "if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }" if (parenthesized_expression "(local_14 == *(int *)PTR___stack_chk_guard_000292ac)" ( (binary_expression "local_14 == *(int *)PTR___stack_chk_guard_000292ac" identifier == (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" * (cast_expression "(int *)PTR___stack_chk_guard_000292ac" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return puVar2;\n  }" { (return_statement "return puVar2;" return identifier ;) }))) (expression_statement "iVar4 = local_14;" (assignment_expression "iVar4 = local_14" identifier = identifier) ;) (expression_statement "puVar6 = PTR___stack_chk_fail_0002929c;" (assignment_expression "puVar6 = PTR___stack_chk_fail_0002929c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0002929c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002929c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002929c)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002929c" * (cast_expression "(code *)PTR___stack_chk_fail_0002929c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "puVar3 = (undefined1 *)xmalloc(0x21);" (assignment_expression "puVar3 = (undefined1 *)xmalloc(0x21)" identifier = (cast_expression "(undefined1 *)xmalloc(0x21)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x21)" identifier (argument_list "(0x21)" ( number_literal ))))) ;) (expression_statement "(**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);" (call_expression "(**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20)" (parenthesized_expression "(**(code **)(puVar6 + 0x1265c))" ( (pointer_expression "**(code **)(puVar6 + 0x1265c)" * (pointer_expression "*(code **)(puVar6 + 0x1265c)" * (cast_expression "(code **)(puVar6 + 0x1265c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x1265c)" ( (binary_expression "puVar6 + 0x1265c" identifier + number_literal) ))))) )) (argument_list "(puVar3,iVar4 + 0x2c,0x20)" ( identifier , (binary_expression "iVar4 + 0x2c" identifier + number_literal) , number_literal ))) ;) (expression_statement "puVar3[0x20] = 0;" (assignment_expression "puVar3[0x20] = 0" (subscript_expression "puVar3[0x20]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);" (assignment_expression "iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3)" identifier = (call_expression "(**(code **)(puVar6 + 0x12674))(puVar3)" (parenthesized_expression "(**(code **)(puVar6 + 0x12674))" ( (pointer_expression "**(code **)(puVar6 + 0x12674)" * (pointer_expression "*(code **)(puVar6 + 0x12674)" * (cast_expression "(code **)(puVar6 + 0x12674)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x12674)" ( (binary_expression "puVar6 + 0x12674" identifier + number_literal) ))))) )) (argument_list "(puVar3)" ( identifier )))) ;) (expression_statement "puVar2 = puVar3 + iVar4;" (assignment_expression "puVar2 = puVar3 + iVar4" identifier = (binary_expression "puVar3 + iVar4" identifier + identifier)) ;) (if_statement "if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }" if (parenthesized_expression "(puVar3 < puVar2)" ( (binary_expression "puVar3 < puVar2" identifier < identifier) )) (compound_statement "{\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }" { (expression_statement "cVar1 = puVar2[-1];" (assignment_expression "cVar1 = puVar2[-1]" identifier = (subscript_expression "puVar2[-1]" identifier [ number_literal ])) ;) (while_statement "while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }" while (parenthesized_expression "(cVar1 == ' ')" ( (binary_expression "cVar1 == ' '" identifier == (char_literal "' '" ' character ')) )) (compound_statement "{\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }" { (expression_statement "puVar5 = puVar2 + -1;" (assignment_expression "puVar5 = puVar2 + -1" identifier = (binary_expression "puVar2 + -1" identifier + number_literal)) ;) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (if_statement "if (puVar3 == puVar5) {\n        return puVar3;\n      }" if (parenthesized_expression "(puVar3 == puVar5)" ( (binary_expression "puVar3 == puVar5" identifier == identifier) )) (compound_statement "{\n        return puVar3;\n      }" { (return_statement "return puVar3;" return identifier ;) })) (expression_statement "cVar1 = puVar2[-2];" (assignment_expression "cVar1 = puVar2[-2]" identifier = (subscript_expression "puVar2[-2]" identifier [ number_literal ])) ;) (expression_statement "puVar2 = puVar5;" (assignment_expression "puVar2 = puVar5" identifier = identifier) ;) })) })) (return_statement "return puVar3;" return identifier ;) })))
(translation_unit "size_t rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)\n\n{\n  char cVar1;\n  undefined3 extraout_var;\n  size_t sVar2;\n  _Bool _Var7;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined1 *puVar6;\n  undefined *puVar8;\n  wchar_t wc;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (s == (char *)0x0) {\n    n = 1;\n    s = PTR_DAT_0002910c + -0x7720;\n    pwc = &wc;\n  }\n  else {\n    if (n == 0) {\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }\n    if (pwc == (wchar_t *)0x0) {\n      pwc = &wc;\n    }\n  }\n  sVar2 = (*(code *)PTR_mbrtowc_0002927c)(pwc,s,n);\n  if ((0xfffffffd < sVar2) && (_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0)) {\n    *pwc = (uint)(byte)*s;\n    sVar2 = 1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return sVar2;\n  }\n  iVar4 = local_14;\n  puVar8 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar8 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar8 + 0x12674))(puVar3);\n  puVar5 = puVar3 + iVar4;\n  if (puVar3 < puVar5) {\n    cVar1 = puVar5[-1];\n    while (cVar1 == ' ') {\n      puVar6 = puVar5 + -1;\n      *puVar6 = 0;\n      if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }\n      cVar1 = puVar5[-2];\n      puVar5 = puVar6;\n    }\n  }\n  return (size_t)puVar3;\n}\n\n" (function_definition "size_t rpl_mbrtowc(wchar_t *pwc,char *s,size_t n,mbstate_t *ps)\n\n{\n  char cVar1;\n  undefined3 extraout_var;\n  size_t sVar2;\n  _Bool _Var7;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined1 *puVar6;\n  undefined *puVar8;\n  wchar_t wc;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (s == (char *)0x0) {\n    n = 1;\n    s = PTR_DAT_0002910c + -0x7720;\n    pwc = &wc;\n  }\n  else {\n    if (n == 0) {\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }\n    if (pwc == (wchar_t *)0x0) {\n      pwc = &wc;\n    }\n  }\n  sVar2 = (*(code *)PTR_mbrtowc_0002927c)(pwc,s,n);\n  if ((0xfffffffd < sVar2) && (_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0)) {\n    *pwc = (uint)(byte)*s;\n    sVar2 = 1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return sVar2;\n  }\n  iVar4 = local_14;\n  puVar8 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar8 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar8 + 0x12674))(puVar3);\n  puVar5 = puVar3 + iVar4;\n  if (puVar3 < puVar5) {\n    cVar1 = puVar5[-1];\n    while (cVar1 == ' ') {\n      puVar6 = puVar5 + -1;\n      *puVar6 = 0;\n      if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }\n      cVar1 = puVar5[-2];\n      puVar5 = puVar6;\n    }\n  }\n  return (size_t)puVar3;\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  char cVar1;\n  undefined3 extraout_var;\n  size_t sVar2;\n  _Bool _Var7;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined1 *puVar6;\n  undefined *puVar8;\n  wchar_t wc;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (s == (char *)0x0) {\n    n = 1;\n    s = PTR_DAT_0002910c + -0x7720;\n    pwc = &wc;\n  }\n  else {\n    if (n == 0) {\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }\n    if (pwc == (wchar_t *)0x0) {\n      pwc = &wc;\n    }\n  }\n  sVar2 = (*(code *)PTR_mbrtowc_0002927c)(pwc,s,n);\n  if ((0xfffffffd < sVar2) && (_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0)) {\n    *pwc = (uint)(byte)*s;\n    sVar2 = 1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return sVar2;\n  }\n  iVar4 = local_14;\n  puVar8 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar8 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar8 + 0x12674))(puVar3);\n  puVar5 = puVar3 + iVar4;\n  if (puVar3 < puVar5) {\n    cVar1 = puVar5[-1];\n    while (cVar1 == ' ') {\n      puVar6 = puVar5 + -1;\n      *puVar6 = 0;\n      if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }\n      cVar1 = puVar5[-2];\n      puVar5 = puVar6;\n    }\n  }\n  return (size_t)puVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "undefined3 extraout_var;" type_identifier identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "_Bool _Var7;" type_identifier identifier ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "undefined1 *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "undefined *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "wchar_t wc;" type_identifier identifier ;) (declaration "int local_14;" primitive_type identifier ;) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_000292ac;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_000292ac" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" * (cast_expression "(int *)PTR___stack_chk_guard_000292ac" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (s == (char *)0x0) {\n    n = 1;\n    s = PTR_DAT_0002910c + -0x7720;\n    pwc = &wc;\n  }\n  else {\n    if (n == 0) {\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }\n    if (pwc == (wchar_t *)0x0) {\n      pwc = &wc;\n    }\n  }" if (parenthesized_expression "(s == (char *)0x0)" ( (binary_expression "s == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    n = 1;\n    s = PTR_DAT_0002910c + -0x7720;\n    pwc = &wc;\n  }" { (expression_statement "n = 1;" (assignment_expression "n = 1" identifier = number_literal) ;) (expression_statement "s = PTR_DAT_0002910c + -0x7720;" (assignment_expression "s = PTR_DAT_0002910c + -0x7720" identifier = (binary_expression "PTR_DAT_0002910c + -0x7720" identifier + number_literal)) ;) (expression_statement "pwc = &wc;" (assignment_expression "pwc = &wc" identifier = (pointer_expression "&wc" & identifier)) ;) }) (else_clause "else {\n    if (n == 0) {\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }\n    if (pwc == (wchar_t *)0x0) {\n      pwc = &wc;\n    }\n  }" else (compound_statement "{\n    if (n == 0) {\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }\n    if (pwc == (wchar_t *)0x0) {\n      pwc = &wc;\n    }\n  }" { (if_statement "if (n == 0) {\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }" if (parenthesized_expression "(n == 0)" ( (binary_expression "n == 0" identifier == number_literal) )) (compound_statement "{\n      sVar2 = 0xfffffffe;\n      goto LAB_00016b58;\n    }" { (expression_statement "sVar2 = 0xfffffffe;" (assignment_expression "sVar2 = 0xfffffffe" identifier = number_literal) ;) (goto_statement "goto LAB_00016b58;" goto statement_identifier ;) })) (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 = (*(code *)PTR_mbrtowc_0002927c)(pwc,s,n);" (assignment_expression "sVar2 = (*(code *)PTR_mbrtowc_0002927c)(pwc,s,n)" identifier = (call_expression "(*(code *)PTR_mbrtowc_0002927c)(pwc,s,n)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002927c)" ( (pointer_expression "*(code *)PTR_mbrtowc_0002927c" * (cast_expression "(code *)PTR_mbrtowc_0002927c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(pwc,s,n)" ( identifier , identifier , identifier )))) ;) (if_statement "if ((0xfffffffd < sVar2) && (_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0)) {\n    *pwc = (uint)(byte)*s;\n    sVar2 = 1;\n  }" if (parenthesized_expression "((0xfffffffd < sVar2) && (_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0))" ( (binary_expression "(0xfffffffd < sVar2) && (_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0)" (parenthesized_expression "(0xfffffffd < sVar2)" ( (binary_expression "0xfffffffd < sVar2" number_literal < identifier) )) && (parenthesized_expression "(_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0)" ( (comma_expression "_Var7 = hard_locale(0), CONCAT31(extraout_var,_Var7) == 0" (assignment_expression "_Var7 = hard_locale(0)" identifier = (call_expression "hard_locale(0)" identifier (argument_list "(0)" ( number_literal )))) , (binary_expression "CONCAT31(extraout_var,_Var7) == 0" (call_expression "CONCAT31(extraout_var,_Var7)" identifier (argument_list "(extraout_var,_Var7)" ( identifier , identifier ))) == number_literal)) ))) )) (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) ;) })) (labeled_statement "LAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return sVar2;\n  }" statement_identifier : (if_statement "if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return sVar2;\n  }" if (parenthesized_expression "(local_14 == *(int *)PTR___stack_chk_guard_000292ac)" ( (binary_expression "local_14 == *(int *)PTR___stack_chk_guard_000292ac" identifier == (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" * (cast_expression "(int *)PTR___stack_chk_guard_000292ac" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return sVar2;\n  }" { (return_statement "return sVar2;" return identifier ;) }))) (expression_statement "iVar4 = local_14;" (assignment_expression "iVar4 = local_14" identifier = identifier) ;) (expression_statement "puVar8 = PTR___stack_chk_fail_0002929c;" (assignment_expression "puVar8 = PTR___stack_chk_fail_0002929c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0002929c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002929c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002929c)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002929c" * (cast_expression "(code *)PTR___stack_chk_fail_0002929c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "puVar3 = (undefined1 *)xmalloc(0x21);" (assignment_expression "puVar3 = (undefined1 *)xmalloc(0x21)" identifier = (cast_expression "(undefined1 *)xmalloc(0x21)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x21)" identifier (argument_list "(0x21)" ( number_literal ))))) ;) (expression_statement "(**(code **)(puVar8 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);" (call_expression "(**(code **)(puVar8 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20)" (parenthesized_expression "(**(code **)(puVar8 + 0x1265c))" ( (pointer_expression "**(code **)(puVar8 + 0x1265c)" * (pointer_expression "*(code **)(puVar8 + 0x1265c)" * (cast_expression "(code **)(puVar8 + 0x1265c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar8 + 0x1265c)" ( (binary_expression "puVar8 + 0x1265c" identifier + number_literal) ))))) )) (argument_list "(puVar3,iVar4 + 0x2c,0x20)" ( identifier , (binary_expression "iVar4 + 0x2c" identifier + number_literal) , number_literal ))) ;) (expression_statement "puVar3[0x20] = 0;" (assignment_expression "puVar3[0x20] = 0" (subscript_expression "puVar3[0x20]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "iVar4 = (**(code **)(puVar8 + 0x12674))(puVar3);" (assignment_expression "iVar4 = (**(code **)(puVar8 + 0x12674))(puVar3)" identifier = (call_expression "(**(code **)(puVar8 + 0x12674))(puVar3)" (parenthesized_expression "(**(code **)(puVar8 + 0x12674))" ( (pointer_expression "**(code **)(puVar8 + 0x12674)" * (pointer_expression "*(code **)(puVar8 + 0x12674)" * (cast_expression "(code **)(puVar8 + 0x12674)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar8 + 0x12674)" ( (binary_expression "puVar8 + 0x12674" identifier + number_literal) ))))) )) (argument_list "(puVar3)" ( identifier )))) ;) (expression_statement "puVar5 = puVar3 + iVar4;" (assignment_expression "puVar5 = puVar3 + iVar4" identifier = (binary_expression "puVar3 + iVar4" identifier + identifier)) ;) (if_statement "if (puVar3 < puVar5) {\n    cVar1 = puVar5[-1];\n    while (cVar1 == ' ') {\n      puVar6 = puVar5 + -1;\n      *puVar6 = 0;\n      if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }\n      cVar1 = puVar5[-2];\n      puVar5 = puVar6;\n    }\n  }" if (parenthesized_expression "(puVar3 < puVar5)" ( (binary_expression "puVar3 < puVar5" identifier < identifier) )) (compound_statement "{\n    cVar1 = puVar5[-1];\n    while (cVar1 == ' ') {\n      puVar6 = puVar5 + -1;\n      *puVar6 = 0;\n      if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }\n      cVar1 = puVar5[-2];\n      puVar5 = puVar6;\n    }\n  }" { (expression_statement "cVar1 = puVar5[-1];" (assignment_expression "cVar1 = puVar5[-1]" identifier = (subscript_expression "puVar5[-1]" identifier [ number_literal ])) ;) (while_statement "while (cVar1 == ' ') {\n      puVar6 = puVar5 + -1;\n      *puVar6 = 0;\n      if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }\n      cVar1 = puVar5[-2];\n      puVar5 = puVar6;\n    }" while (parenthesized_expression "(cVar1 == ' ')" ( (binary_expression "cVar1 == ' '" identifier == (char_literal "' '" ' character ')) )) (compound_statement "{\n      puVar6 = puVar5 + -1;\n      *puVar6 = 0;\n      if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }\n      cVar1 = puVar5[-2];\n      puVar5 = puVar6;\n    }" { (expression_statement "puVar6 = puVar5 + -1;" (assignment_expression "puVar6 = puVar5 + -1" identifier = (binary_expression "puVar5 + -1" identifier + number_literal)) ;) (expression_statement "*puVar6 = 0;" (assignment_expression "*puVar6 = 0" (pointer_expression "*puVar6" * identifier) = number_literal) ;) (if_statement "if (puVar3 == puVar6) {\n        return (size_t)puVar3;\n      }" if (parenthesized_expression "(puVar3 == puVar6)" ( (binary_expression "puVar3 == puVar6" identifier == identifier) )) (compound_statement "{\n        return (size_t)puVar3;\n      }" { (return_statement "return (size_t)puVar3;" return (cast_expression "(size_t)puVar3" ( (type_descriptor "size_t" primitive_type) ) identifier) ;) })) (expression_statement "cVar1 = puVar5[-2];" (assignment_expression "cVar1 = puVar5[-2]" identifier = (subscript_expression "puVar5[-2]" identifier [ number_literal ])) ;) (expression_statement "puVar5 = puVar6;" (assignment_expression "puVar5 = puVar6" identifier = identifier) ;) })) })) (return_statement "return (size_t)puVar3;" return (cast_expression "(size_t)puVar3" ( (type_descriptor "size_t" primitive_type) ) identifier) ;) })))
(translation_unit "undefined1 * rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}\n\n" (function_definition "undefined1 * rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}" type_identifier (pointer_declarator "* rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)" * (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  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "undefined1 *puVar2;" type_identifier (pointer_declarator "*puVar2" * identifier) ;) (declaration "undefined1 *puVar3;" type_identifier (pointer_declarator "*puVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "undefined1 *puVar5;" type_identifier (pointer_declarator "*puVar5" * identifier) ;) (declaration "undefined *puVar6;" type_identifier (pointer_declarator "*puVar6" * identifier) ;) (declaration "uint uStack_18;" type_identifier identifier ;) (declaration "int local_14;" primitive_type identifier ;) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_000292ac;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_000292ac" identifier = (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" * (cast_expression "(int *)PTR___stack_chk_guard_000292ac" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) ;) (if_statement "if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" if (parenthesized_expression "(param_2 == (byte *)0x0)" ( (binary_expression "param_2 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }" { (expression_statement "param_3 = 1;" (assignment_expression "param_3 = 1" identifier = number_literal) ;) (expression_statement "param_2 = PTR_DAT_0002910c + -0x7720;" (assignment_expression "param_2 = PTR_DAT_0002910c + -0x7720" identifier = (binary_expression "PTR_DAT_0002910c + -0x7720" identifier + number_literal)) ;) (expression_statement "param_1 = &uStack_18;" (assignment_expression "param_1 = &uStack_18" identifier = (pointer_expression "&uStack_18" & identifier)) ;) }) (else_clause "else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" else (compound_statement "{\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" { (if_statement "if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }" { (expression_statement "puVar2 = &SUB_fffffffe;" (assignment_expression "puVar2 = &SUB_fffffffe" identifier = (pointer_expression "&SUB_fffffffe" & identifier)) ;) (goto_statement "goto LAB_00016b58;" goto statement_identifier ;) })) (if_statement "if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }" 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)) )) (compound_statement "{\n      param_1 = &uStack_18;\n    }" { (expression_statement "param_1 = &uStack_18;" (assignment_expression "param_1 = &uStack_18" identifier = (pointer_expression "&uStack_18" & identifier)) ;) })) }))) (expression_statement "puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);" (assignment_expression "puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" identifier = (cast_expression "(undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002927c)" ( (pointer_expression "*(code *)PTR_mbrtowc_0002927c" * (cast_expression "(code *)PTR_mbrtowc_0002927c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier ))))) ;) (if_statement "if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }" if (parenthesized_expression "(((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0))" ( (binary_expression "((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)" (parenthesized_expression "((undefined1 *)0xfffffffd < puVar2)" ( (binary_expression "(undefined1 *)0xfffffffd < puVar2" (cast_expression "(undefined1 *)0xfffffffd" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) < identifier) )) && (parenthesized_expression "(iVar4 = hard_locale(0), iVar4 == 0)" ( (comma_expression "iVar4 = hard_locale(0), iVar4 == 0" (assignment_expression "iVar4 = hard_locale(0)" identifier = (call_expression "hard_locale(0)" identifier (argument_list "(0)" ( number_literal )))) , (binary_expression "iVar4 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\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 "puVar2 = (undefined1 *)0x1;" (assignment_expression "puVar2 = (undefined1 *)0x1" identifier = (cast_expression "(undefined1 *)0x1" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) })) (labeled_statement "LAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }" statement_identifier : (if_statement "if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }" if (parenthesized_expression "(local_14 == *(int *)PTR___stack_chk_guard_000292ac)" ( (binary_expression "local_14 == *(int *)PTR___stack_chk_guard_000292ac" identifier == (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" * (cast_expression "(int *)PTR___stack_chk_guard_000292ac" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) identifier))) )) (compound_statement "{\n    return puVar2;\n  }" { (return_statement "return puVar2;" return identifier ;) }))) (expression_statement "iVar4 = local_14;" (assignment_expression "iVar4 = local_14" identifier = identifier) ;) (expression_statement "puVar6 = PTR___stack_chk_fail_0002929c;" (assignment_expression "puVar6 = PTR___stack_chk_fail_0002929c" identifier = identifier) ;) (expression_statement "(*(code *)PTR___stack_chk_fail_0002929c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002929c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002929c)" ( (pointer_expression "*(code *)PTR___stack_chk_fail_0002929c" * (cast_expression "(code *)PTR___stack_chk_fail_0002929c" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier)) )) (argument_list "()" ( ))) ;) (expression_statement "puVar3 = (undefined1 *)xmalloc(0x21);" (assignment_expression "puVar3 = (undefined1 *)xmalloc(0x21)" identifier = (cast_expression "(undefined1 *)xmalloc(0x21)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(0x21)" identifier (argument_list "(0x21)" ( number_literal ))))) ;) (expression_statement "(**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);" (call_expression "(**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20)" (parenthesized_expression "(**(code **)(puVar6 + 0x1265c))" ( (pointer_expression "**(code **)(puVar6 + 0x1265c)" * (pointer_expression "*(code **)(puVar6 + 0x1265c)" * (cast_expression "(code **)(puVar6 + 0x1265c)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x1265c)" ( (binary_expression "puVar6 + 0x1265c" identifier + number_literal) ))))) )) (argument_list "(puVar3,iVar4 + 0x2c,0x20)" ( identifier , (binary_expression "iVar4 + 0x2c" identifier + number_literal) , number_literal ))) ;) (expression_statement "puVar3[0x20] = 0;" (assignment_expression "puVar3[0x20] = 0" (subscript_expression "puVar3[0x20]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);" (assignment_expression "iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3)" identifier = (call_expression "(**(code **)(puVar6 + 0x12674))(puVar3)" (parenthesized_expression "(**(code **)(puVar6 + 0x12674))" ( (pointer_expression "**(code **)(puVar6 + 0x12674)" * (pointer_expression "*(code **)(puVar6 + 0x12674)" * (cast_expression "(code **)(puVar6 + 0x12674)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(puVar6 + 0x12674)" ( (binary_expression "puVar6 + 0x12674" identifier + number_literal) ))))) )) (argument_list "(puVar3)" ( identifier )))) ;) (expression_statement "puVar2 = puVar3 + iVar4;" (assignment_expression "puVar2 = puVar3 + iVar4" identifier = (binary_expression "puVar3 + iVar4" identifier + identifier)) ;) (if_statement "if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }" if (parenthesized_expression "(puVar3 < puVar2)" ( (binary_expression "puVar3 < puVar2" identifier < identifier) )) (compound_statement "{\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }" { (expression_statement "cVar1 = puVar2[-1];" (assignment_expression "cVar1 = puVar2[-1]" identifier = (subscript_expression "puVar2[-1]" identifier [ number_literal ])) ;) (while_statement "while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }" while (parenthesized_expression "(cVar1 == ' ')" ( (binary_expression "cVar1 == ' '" identifier == (char_literal "' '" ' character ')) )) (compound_statement "{\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }" { (expression_statement "puVar5 = puVar2 + -1;" (assignment_expression "puVar5 = puVar2 + -1" identifier = (binary_expression "puVar2 + -1" identifier + number_literal)) ;) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" * identifier) = number_literal) ;) (if_statement "if (puVar3 == puVar5) {\n        return puVar3;\n      }" if (parenthesized_expression "(puVar3 == puVar5)" ( (binary_expression "puVar3 == puVar5" identifier == identifier) )) (compound_statement "{\n        return puVar3;\n      }" { (return_statement "return puVar3;" return identifier ;) })) (expression_statement "cVar1 = puVar2[-2];" (assignment_expression "cVar1 = puVar2[-2]" identifier = (subscript_expression "puVar2[-2]" identifier [ number_literal ])) ;) (expression_statement "puVar2 = puVar5;" (assignment_expression "puVar2 = puVar5" identifier = identifier) ;) })) })) (return_statement "return puVar3;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (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 IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE 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 = LIT) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression & IDENT)) ;) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression & IDENT)) ;) (goto_statement goto statement_identifier ;) })) (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 = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( IDENT , IDENT , IDENT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) < IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) , (binary_expression IDENT == LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = (binary_expression (parenthesized_expression ( IDENT )) * IDENT)) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) })) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) IDENT)) )) (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT ))))) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( IDENT , (binary_expression IDENT + LIT) , LIT ))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (while_statement while (parenthesized_expression ( (binary_expression IDENT == (char_literal ' character ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) })) })) (return_statement return IDENT ;) })))
(function_definition "undefined1 * rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)\n\n{\n  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}" (type_identifier "undefined1") (pointer_declarator "* rpl_mbrtowc(uint *param_1,byte *param_2,int param_3)" (* "*") (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  char cVar1;\n  undefined1 *puVar2;\n  undefined1 *puVar3;\n  int iVar4;\n  undefined1 *puVar5;\n  undefined *puVar6;\n  uint uStack_18;\n  int local_14;\n  \n  local_14 = *(int *)PTR___stack_chk_guard_000292ac;\n  if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }\n  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);\n  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }\nLAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }\n  iVar4 = local_14;\n  puVar6 = PTR___stack_chk_fail_0002929c;\n  (*(code *)PTR___stack_chk_fail_0002929c)();\n  puVar3 = (undefined1 *)xmalloc(0x21);\n  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);\n  puVar3[0x20] = 0;\n  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);\n  puVar2 = puVar3 + iVar4;\n  if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }\n  return puVar3;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "undefined1 *puVar2;" (type_identifier "undefined1") (pointer_declarator "*puVar2" (* "*") (identifier "puVar2")) (; ";")) (declaration "undefined1 *puVar3;" (type_identifier "undefined1") (pointer_declarator "*puVar3" (* "*") (identifier "puVar3")) (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (declaration "undefined1 *puVar5;" (type_identifier "undefined1") (pointer_declarator "*puVar5" (* "*") (identifier "puVar5")) (; ";")) (declaration "undefined *puVar6;" (type_identifier "undefined") (pointer_declarator "*puVar6" (* "*") (identifier "puVar6")) (; ";")) (declaration "uint uStack_18;" (type_identifier "uint") (identifier "uStack_18") (; ";")) (declaration "int local_14;" (primitive_type "int") (identifier "local_14") (; ";")) (expression_statement "local_14 = *(int *)PTR___stack_chk_guard_000292ac;" (assignment_expression "local_14 = *(int *)PTR___stack_chk_guard_000292ac" (identifier "local_14") (= "=") (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_000292ac" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_000292ac")))) (; ";")) (if_statement "if (param_2 == (byte *)0x0) {\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }\n  else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" (if "if") (parenthesized_expression "(param_2 == (byte *)0x0)" (( "(") (binary_expression "param_2 == (byte *)0x0" (identifier "param_2") (== "==") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    param_3 = 1;\n    param_2 = PTR_DAT_0002910c + -0x7720;\n    param_1 = &uStack_18;\n  }" ({ "{") (expression_statement "param_3 = 1;" (assignment_expression "param_3 = 1" (identifier "param_3") (= "=") (number_literal "1")) (; ";")) (expression_statement "param_2 = PTR_DAT_0002910c + -0x7720;" (assignment_expression "param_2 = PTR_DAT_0002910c + -0x7720" (identifier "param_2") (= "=") (binary_expression "PTR_DAT_0002910c + -0x7720" (identifier "PTR_DAT_0002910c") (+ "+") (number_literal "-0x7720"))) (; ";")) (expression_statement "param_1 = &uStack_18;" (assignment_expression "param_1 = &uStack_18" (identifier "param_1") (= "=") (pointer_expression "&uStack_18" (& "&") (identifier "uStack_18"))) (; ";")) (} "}")) (else_clause "else {\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" (else "else") (compound_statement "{\n    if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }\n    if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }\n  }" ({ "{") (if_statement "if (param_3 == 0) {\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      puVar2 = &SUB_fffffffe;\n      goto LAB_00016b58;\n    }" ({ "{") (expression_statement "puVar2 = &SUB_fffffffe;" (assignment_expression "puVar2 = &SUB_fffffffe" (identifier "puVar2") (= "=") (pointer_expression "&SUB_fffffffe" (& "&") (identifier "SUB_fffffffe"))) (; ";")) (goto_statement "goto LAB_00016b58;" (goto "goto") (statement_identifier "LAB_00016b58") (; ";")) (} "}"))) (if_statement "if (param_1 == (uint *)0x0) {\n      param_1 = &uStack_18;\n    }" (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"))) () ")")) (compound_statement "{\n      param_1 = &uStack_18;\n    }" ({ "{") (expression_statement "param_1 = &uStack_18;" (assignment_expression "param_1 = &uStack_18" (identifier "param_1") (= "=") (pointer_expression "&uStack_18" (& "&") (identifier "uStack_18"))) (; ";")) (} "}"))) (} "}")))) (expression_statement "puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);" (assignment_expression "puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" (identifier "puVar2") (= "=") (cast_expression "(undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3)" (parenthesized_expression "(*(code *)PTR_mbrtowc_0002927c)" (( "(") (pointer_expression "*(code *)PTR_mbrtowc_0002927c" (* "*") (cast_expression "(code *)PTR_mbrtowc_0002927c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR_mbrtowc_0002927c"))) () ")")) (argument_list "(param_1,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")"))))) (; ";")) (if_statement "if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\n  }" (if "if") (parenthesized_expression "(((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0))" (( "(") (binary_expression "((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)" (parenthesized_expression "((undefined1 *)0xfffffffd < puVar2)" (( "(") (binary_expression "(undefined1 *)0xfffffffd < puVar2" (cast_expression "(undefined1 *)0xfffffffd" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0xfffffffd")) (< "<") (identifier "puVar2")) () ")")) (&& "&&") (parenthesized_expression "(iVar4 = hard_locale(0), iVar4 == 0)" (( "(") (comma_expression "iVar4 = hard_locale(0), iVar4 == 0" (assignment_expression "iVar4 = hard_locale(0)" (identifier "iVar4") (= "=") (call_expression "hard_locale(0)" (identifier "hard_locale") (argument_list "(0)" (( "(") (number_literal "0") () ")")))) (, ",") (binary_expression "iVar4 == 0" (identifier "iVar4") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    *param_1 = (uint)*param_2;\n    puVar2 = (undefined1 *)0x1;\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 "puVar2 = (undefined1 *)0x1;" (assignment_expression "puVar2 = (undefined1 *)0x1" (identifier "puVar2") (= "=") (cast_expression "(undefined1 *)0x1" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x1"))) (; ";")) (} "}"))) (labeled_statement "LAB_00016b58:\n  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }" (statement_identifier "LAB_00016b58") (: ":") (if_statement "if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {\n    return puVar2;\n  }" (if "if") (parenthesized_expression "(local_14 == *(int *)PTR___stack_chk_guard_000292ac)" (( "(") (binary_expression "local_14 == *(int *)PTR___stack_chk_guard_000292ac" (identifier "local_14") (== "==") (pointer_expression "*(int *)PTR___stack_chk_guard_000292ac" (* "*") (cast_expression "(int *)PTR___stack_chk_guard_000292ac" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_guard_000292ac")))) () ")")) (compound_statement "{\n    return puVar2;\n  }" ({ "{") (return_statement "return puVar2;" (return "return") (identifier "puVar2") (; ";")) (} "}")))) (expression_statement "iVar4 = local_14;" (assignment_expression "iVar4 = local_14" (identifier "iVar4") (= "=") (identifier "local_14")) (; ";")) (expression_statement "puVar6 = PTR___stack_chk_fail_0002929c;" (assignment_expression "puVar6 = PTR___stack_chk_fail_0002929c" (identifier "puVar6") (= "=") (identifier "PTR___stack_chk_fail_0002929c")) (; ";")) (expression_statement "(*(code *)PTR___stack_chk_fail_0002929c)();" (call_expression "(*(code *)PTR___stack_chk_fail_0002929c)()" (parenthesized_expression "(*(code *)PTR___stack_chk_fail_0002929c)" (( "(") (pointer_expression "*(code *)PTR___stack_chk_fail_0002929c" (* "*") (cast_expression "(code *)PTR___stack_chk_fail_0002929c" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (identifier "PTR___stack_chk_fail_0002929c"))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "puVar3 = (undefined1 *)xmalloc(0x21);" (assignment_expression "puVar3 = (undefined1 *)xmalloc(0x21)" (identifier "puVar3") (= "=") (cast_expression "(undefined1 *)xmalloc(0x21)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(0x21)" (identifier "xmalloc") (argument_list "(0x21)" (( "(") (number_literal "0x21") () ")"))))) (; ";")) (expression_statement "(**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);" (call_expression "(**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20)" (parenthesized_expression "(**(code **)(puVar6 + 0x1265c))" (( "(") (pointer_expression "**(code **)(puVar6 + 0x1265c)" (* "*") (pointer_expression "*(code **)(puVar6 + 0x1265c)" (* "*") (cast_expression "(code **)(puVar6 + 0x1265c)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar6 + 0x1265c)" (( "(") (binary_expression "puVar6 + 0x1265c" (identifier "puVar6") (+ "+") (number_literal "0x1265c")) () ")"))))) () ")")) (argument_list "(puVar3,iVar4 + 0x2c,0x20)" (( "(") (identifier "puVar3") (, ",") (binary_expression "iVar4 + 0x2c" (identifier "iVar4") (+ "+") (number_literal "0x2c")) (, ",") (number_literal "0x20") () ")"))) (; ";")) (expression_statement "puVar3[0x20] = 0;" (assignment_expression "puVar3[0x20] = 0" (subscript_expression "puVar3[0x20]" (identifier "puVar3") ([ "[") (number_literal "0x20") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);" (assignment_expression "iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3)" (identifier "iVar4") (= "=") (call_expression "(**(code **)(puVar6 + 0x12674))(puVar3)" (parenthesized_expression "(**(code **)(puVar6 + 0x12674))" (( "(") (pointer_expression "**(code **)(puVar6 + 0x12674)" (* "*") (pointer_expression "*(code **)(puVar6 + 0x12674)" (* "*") (cast_expression "(code **)(puVar6 + 0x12674)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(puVar6 + 0x12674)" (( "(") (binary_expression "puVar6 + 0x12674" (identifier "puVar6") (+ "+") (number_literal "0x12674")) () ")"))))) () ")")) (argument_list "(puVar3)" (( "(") (identifier "puVar3") () ")")))) (; ";")) (expression_statement "puVar2 = puVar3 + iVar4;" (assignment_expression "puVar2 = puVar3 + iVar4" (identifier "puVar2") (= "=") (binary_expression "puVar3 + iVar4" (identifier "puVar3") (+ "+") (identifier "iVar4"))) (; ";")) (if_statement "if (puVar3 < puVar2) {\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }" (if "if") (parenthesized_expression "(puVar3 < puVar2)" (( "(") (binary_expression "puVar3 < puVar2" (identifier "puVar3") (< "<") (identifier "puVar2")) () ")")) (compound_statement "{\n    cVar1 = puVar2[-1];\n    while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }\n  }" ({ "{") (expression_statement "cVar1 = puVar2[-1];" (assignment_expression "cVar1 = puVar2[-1]" (identifier "cVar1") (= "=") (subscript_expression "puVar2[-1]" (identifier "puVar2") ([ "[") (number_literal "-1") (] "]"))) (; ";")) (while_statement "while (cVar1 == ' ') {\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }" (while "while") (parenthesized_expression "(cVar1 == ' ')" (( "(") (binary_expression "cVar1 == ' '" (identifier "cVar1") (== "==") (char_literal "' '" (' "'") (character " ") (' "'"))) () ")")) (compound_statement "{\n      puVar5 = puVar2 + -1;\n      *puVar5 = 0;\n      if (puVar3 == puVar5) {\n        return puVar3;\n      }\n      cVar1 = puVar2[-2];\n      puVar2 = puVar5;\n    }" ({ "{") (expression_statement "puVar5 = puVar2 + -1;" (assignment_expression "puVar5 = puVar2 + -1" (identifier "puVar5") (= "=") (binary_expression "puVar2 + -1" (identifier "puVar2") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "*puVar5 = 0;" (assignment_expression "*puVar5 = 0" (pointer_expression "*puVar5" (* "*") (identifier "puVar5")) (= "=") (number_literal "0")) (; ";")) (if_statement "if (puVar3 == puVar5) {\n        return puVar3;\n      }" (if "if") (parenthesized_expression "(puVar3 == puVar5)" (( "(") (binary_expression "puVar3 == puVar5" (identifier "puVar3") (== "==") (identifier "puVar5")) () ")")) (compound_statement "{\n        return puVar3;\n      }" ({ "{") (return_statement "return puVar3;" (return "return") (identifier "puVar3") (; ";")) (} "}"))) (expression_statement "cVar1 = puVar2[-2];" (assignment_expression "cVar1 = puVar2[-2]" (identifier "cVar1") (= "=") (subscript_expression "puVar2[-2]" (identifier "puVar2") ([ "[") (number_literal "-2") (] "]"))) (; ";")) (expression_statement "puVar2 = puVar5;" (assignment_expression "puVar2 = puVar5" (identifier "puVar2") (= "=") (identifier "puVar5")) (; ";")) (} "}"))) (} "}"))) (return_statement "return puVar3;" (return "return") (identifier "puVar3") (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator 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: (primitive_type) declarator: (identifier)) (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: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (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: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (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: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (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) (identifier)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)) right: (identifier))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal)))) right: (binary_expression left: (identifier) right: (number_literal)))))) 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: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (identifier))))) consequence: (compound_statement (return_statement (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (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))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (number_literal)) (number_literal)))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (char_literal (character)))) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))))) (return_statement (identifier)))))

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

{
  char cVar1;
  undefined1 *puVar2;
  undefined1 *puVar3;
  int iVar4;
  undefined1 *puVar5;
  undefined *puVar6;
  uint uStack_18;
  int local_14;
  
  local_14 = *(int *)PTR___stack_chk_guard_000292ac;
  if (param_2 == (byte *)0x0) {
    param_3 = 1;
    param_2 = PTR_DAT_0002910c + -0x7720;
    param_1 = &uStack_18;
  }
  else {
    if (param_3 == 0) {
      puVar2 = &SUB_fffffffe;
      goto LAB_00016b58;
    }
    if (param_1 == (uint *)0x0) {
      param_1 = &uStack_18;
    }
  }
  puVar2 = (undefined1 *)(*(code *)PTR_mbrtowc_0002927c)(param_1,param_2,param_3);
  if (((undefined1 *)0xfffffffd < puVar2) && (iVar4 = hard_locale(0), iVar4 == 0)) {
    *param_1 = (uint)*param_2;
    puVar2 = (undefined1 *)0x1;
  }
LAB_00016b58:
  if (local_14 == *(int *)PTR___stack_chk_guard_000292ac) {
    return puVar2;
  }
  iVar4 = local_14;
  puVar6 = PTR___stack_chk_fail_0002929c;
  (*(code *)PTR___stack_chk_fail_0002929c)();
  puVar3 = (undefined1 *)xmalloc(0x21);
  (**(code **)(puVar6 + 0x1265c))(puVar3,iVar4 + 0x2c,0x20);
  puVar3[0x20] = 0;
  iVar4 = (**(code **)(puVar6 + 0x12674))(puVar3);
  puVar2 = puVar3 + iVar4;
  if (puVar3 < puVar2) {
    cVar1 = puVar2[-1];
    while (cVar1 == ' ') {
      puVar5 = puVar2 + -1;
      *puVar5 = 0;
      if (puVar3 == puVar5) {
        return puVar3;
      }
      cVar1 = puVar2[-2];
      puVar2 = puVar5;
    }
  }
  return puVar3;
}

