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

char * __regparm3 cmd_step_common(char *p,LWCHAR ch,int len,int *pwidth,int *bswidth)

{
  char *__s;
  int iVar1;
  LWCHAR ch1;
  size_t sVar2;
  char *local_20 [3];
  undefined4 uStack_14;
  
  uStack_14 = 0x16b3b;
  local_20[0] = p;
  if (len == 1) {
    __s = prchar(ch);
    sVar2 = strlen(__s);
  }
  else {
    __s = prutfchar(ch);
    iVar1 = is_composing_char(ch);
    sVar2 = 0;
    if (iVar1 == 0) {
      iVar1 = is_ubin_char(ch);
      if (iVar1 == 0) {
        ch1 = step_char(local_20,-1,cmdbuf);
        iVar1 = is_combining_char(ch1,ch);
        sVar2 = 0;
        if (iVar1 == 0) {
          iVar1 = is_wide_char(ch);
          sVar2 = (iVar1 != 0) + 1;
        }
      }
      else {
        sVar2 = strlen(__s);
      }
    }
  }
  *pwidth = sVar2;
  if (bswidth != (int *)0x0) {
    *bswidth = sVar2;
  }
  return __s;
}



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

char * __regparm3
FUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)

{
  char *__s;
  int iVar1;
  undefined4 uVar2;
  size_t sVar3;
  undefined1 local_20 [12];
  undefined4 uStack_14;
  
  uStack_14 = 0x16b3b;
  if (param_3 == 1) {
    __s = (char *)FUN_00016250(param_2);
    sVar3 = strlen(__s);
  }
  else {
    __s = (char *)FUN_00016930(param_2);
    iVar1 = FUN_00016810(param_2);
    sVar3 = 0;
    if (iVar1 == 0) {
      iVar1 = FUN_00016880(param_2);
      if (iVar1 == 0) {
        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);
        iVar1 = FUN_00016af0(uVar2,param_2);
        sVar3 = 0;
        if (iVar1 == 0) {
          iVar1 = FUN_00016a80(param_2);
          sVar3 = (iVar1 != 0) + 1;
        }
      }
      else {
        sVar3 = strlen(__s);
      }
    }
  }
  *param_4 = sVar3;
  if (param_5 != (size_t *)0x0) {
    *param_5 = sVar3;
  }
  return __s;
}


PUSH EBP
MOV EBP,EDX
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000129a0
ADD EBX,0x2535d
SUB ESP,0x1c
MOV dword ptr [ESP + 0xc],EAX
MOV ESI,dword ptr [ESP + 0x34]
CMP ECX,0x1
JZ 0x00016bb0
SUB ESP,0xc
PUSH EDX
CALL 0x00016930
MOV dword ptr [ESP],EBP
MOV EDI,EAX
CALL 0x00016810
ADD ESP,0x10
XOR EDX,EDX
TEST EAX,EAX
JZ 0x00016b88
MOV EAX,dword ptr [ESP + 0x30]
MOV dword ptr [EAX],EDX
TEST ESI,ESI
JZ 0x00016b79
MOV dword ptr [ESI],EDX
ADD ESP,0x1c
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH EBP
CALL 0x00016880
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00016bd0
SUB ESP,0xc
PUSH EDI
CALL 0x00012290
ADD ESP,0x10
MOV EDX,EAX
JMP 0x00016b6d
SUB ESP,0xc
PUSH EDX
CALL 0x00016250
MOV dword ptr [ESP],EAX
MOV EDI,EAX
CALL 0x00012290
ADD ESP,0x10
MOV EDX,EAX
JMP 0x00016b6d
MOV dword ptr [ESP + 0x8],EAX
SUB ESP,0x4
LEA EAX,[EBX + 0x2488]
PUSH EAX
PUSH -0x1
LEA EAX,[ESP + 0x18]
PUSH EAX
CALL 0x00016730
POP EDX
POP ECX
PUSH EBP
PUSH EAX
CALL 0x00016af0
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x8]
TEST EAX,EAX
JNZ 0x00016b6d
SUB ESP,0xc
PUSH EBP
CALL 0x00016a80
XOR EDX,EDX
ADD ESP,0x10
TEST EAX,EAX
SETNZ DL
ADD EDX,0x1
JMP 0x00016b6d
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)\n\n{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}\n\n" comment (function_definition "char * __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)\n\n{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}" primitive_type (pointer_declarator "* __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" * (ERROR "__regparm3" identifier) (function_declarator "FUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "size_t *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "size_t *param_5" primitive_type (pointer_declarator "*param_5" * identifier)) )))) (compound_statement "{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "undefined1 local_20 [12];" type_identifier (array_declarator "local_20 [12]" identifier [ number_literal ]) ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x16b3b;" (assignment_expression "uStack_14 = 0x16b3b" identifier = number_literal) ;) (if_statement "if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }" { (expression_statement "__s = (char *)FUN_00016250(param_2);" (assignment_expression "__s = (char *)FUN_00016250(param_2)" identifier = (cast_expression "(char *)FUN_00016250(param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00016250(param_2)" identifier (argument_list "(param_2)" ( identifier ))))) ;) (expression_statement "sVar3 = strlen(__s);" (assignment_expression "sVar3 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) }) (else_clause "else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" else (compound_statement "{\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" { (expression_statement "__s = (char *)FUN_00016930(param_2);" (assignment_expression "__s = (char *)FUN_00016930(param_2)" identifier = (cast_expression "(char *)FUN_00016930(param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00016930(param_2)" identifier (argument_list "(param_2)" ( identifier ))))) ;) (expression_statement "iVar1 = FUN_00016810(param_2);" (assignment_expression "iVar1 = FUN_00016810(param_2)" identifier = (call_expression "FUN_00016810(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }" { (expression_statement "iVar1 = FUN_00016880(param_2);" (assignment_expression "iVar1 = FUN_00016880(param_2)" identifier = (call_expression "FUN_00016880(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }" { (expression_statement "uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);" (assignment_expression "uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320)" identifier = (call_expression "FUN_00016730(local_20,0xffffffff,&DAT_0003e320)" identifier (argument_list "(local_20,0xffffffff,&DAT_0003e320)" ( identifier , number_literal , (pointer_expression "&DAT_0003e320" & identifier) )))) ;) (expression_statement "iVar1 = FUN_00016af0(uVar2,param_2);" (assignment_expression "iVar1 = FUN_00016af0(uVar2,param_2)" identifier = (call_expression "FUN_00016af0(uVar2,param_2)" identifier (argument_list "(uVar2,param_2)" ( identifier , identifier )))) ;) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }" { (expression_statement "iVar1 = FUN_00016a80(param_2);" (assignment_expression "iVar1 = FUN_00016a80(param_2)" identifier = (call_expression "FUN_00016a80(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "sVar3 = (iVar1 != 0) + 1;" (assignment_expression "sVar3 = (iVar1 != 0) + 1" identifier = (binary_expression "(iVar1 != 0) + 1" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) + number_literal)) ;) })) }) (else_clause "else {\n        sVar3 = strlen(__s);\n      }" else (compound_statement "{\n        sVar3 = strlen(__s);\n      }" { (expression_statement "sVar3 = strlen(__s);" (assignment_expression "sVar3 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) }))) })) }))) (expression_statement "*param_4 = sVar3;" (assignment_expression "*param_4 = sVar3" (pointer_expression "*param_4" * identifier) = identifier) ;) (if_statement "if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }" if (parenthesized_expression "(param_5 != (size_t *)0x0)" ( (binary_expression "param_5 != (size_t *)0x0" identifier != (cast_expression "(size_t *)0x0" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_5 = sVar3;\n  }" { (expression_statement "*param_5 = sVar3;" (assignment_expression "*param_5 = sVar3" (pointer_expression "*param_5" * identifier) = identifier) ;) })) (return_statement "return __s;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * __regparm3 cmd_step_common(char *p,LWCHAR ch,int len,int *pwidth,int *bswidth)\n\n{\n  char *__s;\n  int iVar1;\n  LWCHAR ch1;\n  size_t sVar2;\n  char *local_20 [3];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  local_20[0] = p;\n  if (len == 1) {\n    __s = prchar(ch);\n    sVar2 = strlen(__s);\n  }\n  else {\n    __s = prutfchar(ch);\n    iVar1 = is_composing_char(ch);\n    sVar2 = 0;\n    if (iVar1 == 0) {\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }\n  }\n  *pwidth = sVar2;\n  if (bswidth != (int *)0x0) {\n    *bswidth = sVar2;\n  }\n  return __s;\n}\n\n" comment (function_definition "char * __regparm3 cmd_step_common(char *p,LWCHAR ch,int len,int *pwidth,int *bswidth)\n\n{\n  char *__s;\n  int iVar1;\n  LWCHAR ch1;\n  size_t sVar2;\n  char *local_20 [3];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  local_20[0] = p;\n  if (len == 1) {\n    __s = prchar(ch);\n    sVar2 = strlen(__s);\n  }\n  else {\n    __s = prutfchar(ch);\n    iVar1 = is_composing_char(ch);\n    sVar2 = 0;\n    if (iVar1 == 0) {\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }\n  }\n  *pwidth = sVar2;\n  if (bswidth != (int *)0x0) {\n    *bswidth = sVar2;\n  }\n  return __s;\n}" primitive_type (pointer_declarator "* __regparm3 cmd_step_common(char *p,LWCHAR ch,int len,int *pwidth,int *bswidth)" * (ERROR "__regparm3" identifier) (function_declarator "cmd_step_common(char *p,LWCHAR ch,int len,int *pwidth,int *bswidth)" identifier (parameter_list "(char *p,LWCHAR ch,int len,int *pwidth,int *bswidth)" ( (parameter_declaration "char *p" primitive_type (pointer_declarator "*p" * identifier)) , (parameter_declaration "LWCHAR ch" type_identifier identifier) , (parameter_declaration "int len" primitive_type identifier) , (parameter_declaration "int *pwidth" primitive_type (pointer_declarator "*pwidth" * identifier)) , (parameter_declaration "int *bswidth" primitive_type (pointer_declarator "*bswidth" * identifier)) )))) (compound_statement "{\n  char *__s;\n  int iVar1;\n  LWCHAR ch1;\n  size_t sVar2;\n  char *local_20 [3];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  local_20[0] = p;\n  if (len == 1) {\n    __s = prchar(ch);\n    sVar2 = strlen(__s);\n  }\n  else {\n    __s = prutfchar(ch);\n    iVar1 = is_composing_char(ch);\n    sVar2 = 0;\n    if (iVar1 == 0) {\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }\n  }\n  *pwidth = sVar2;\n  if (bswidth != (int *)0x0) {\n    *bswidth = sVar2;\n  }\n  return __s;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "LWCHAR ch1;" type_identifier identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *local_20 [3];" primitive_type (pointer_declarator "*local_20 [3]" * (array_declarator "local_20 [3]" identifier [ number_literal ])) ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x16b3b;" (assignment_expression "uStack_14 = 0x16b3b" identifier = number_literal) ;) (expression_statement "local_20[0] = p;" (assignment_expression "local_20[0] = p" (subscript_expression "local_20[0]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (len == 1) {\n    __s = prchar(ch);\n    sVar2 = strlen(__s);\n  }\n  else {\n    __s = prutfchar(ch);\n    iVar1 = is_composing_char(ch);\n    sVar2 = 0;\n    if (iVar1 == 0) {\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }\n  }" if (parenthesized_expression "(len == 1)" ( (binary_expression "len == 1" identifier == number_literal) )) (compound_statement "{\n    __s = prchar(ch);\n    sVar2 = strlen(__s);\n  }" { (expression_statement "__s = prchar(ch);" (assignment_expression "__s = prchar(ch)" identifier = (call_expression "prchar(ch)" identifier (argument_list "(ch)" ( identifier )))) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) }) (else_clause "else {\n    __s = prutfchar(ch);\n    iVar1 = is_composing_char(ch);\n    sVar2 = 0;\n    if (iVar1 == 0) {\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }\n  }" else (compound_statement "{\n    __s = prutfchar(ch);\n    iVar1 = is_composing_char(ch);\n    sVar2 = 0;\n    if (iVar1 == 0) {\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }\n  }" { (expression_statement "__s = prutfchar(ch);" (assignment_expression "__s = prutfchar(ch)" identifier = (call_expression "prutfchar(ch)" identifier (argument_list "(ch)" ( identifier )))) ;) (expression_statement "iVar1 = is_composing_char(ch);" (assignment_expression "iVar1 = is_composing_char(ch)" identifier = (call_expression "is_composing_char(ch)" identifier (argument_list "(ch)" ( identifier )))) ;) (expression_statement "sVar2 = 0;" (assignment_expression "sVar2 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = is_ubin_char(ch);\n      if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }\n    }" { (expression_statement "iVar1 = is_ubin_char(ch);" (assignment_expression "iVar1 = is_ubin_char(ch)" identifier = (call_expression "is_ubin_char(ch)" identifier (argument_list "(ch)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar2 = strlen(__s);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        ch1 = step_char(local_20,-1,cmdbuf);\n        iVar1 = is_combining_char(ch1,ch);\n        sVar2 = 0;\n        if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }\n      }" { (expression_statement "ch1 = step_char(local_20,-1,cmdbuf);" (assignment_expression "ch1 = step_char(local_20,-1,cmdbuf)" identifier = (call_expression "step_char(local_20,-1,cmdbuf)" identifier (argument_list "(local_20,-1,cmdbuf)" ( identifier , number_literal , identifier )))) ;) (expression_statement "iVar1 = is_combining_char(ch1,ch);" (assignment_expression "iVar1 = is_combining_char(ch1,ch)" identifier = (call_expression "is_combining_char(ch1,ch)" identifier (argument_list "(ch1,ch)" ( identifier , identifier )))) ;) (expression_statement "sVar2 = 0;" (assignment_expression "sVar2 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = is_wide_char(ch);\n          sVar2 = (iVar1 != 0) + 1;\n        }" { (expression_statement "iVar1 = is_wide_char(ch);" (assignment_expression "iVar1 = is_wide_char(ch)" identifier = (call_expression "is_wide_char(ch)" identifier (argument_list "(ch)" ( identifier )))) ;) (expression_statement "sVar2 = (iVar1 != 0) + 1;" (assignment_expression "sVar2 = (iVar1 != 0) + 1" identifier = (binary_expression "(iVar1 != 0) + 1" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) + number_literal)) ;) })) }) (else_clause "else {\n        sVar2 = strlen(__s);\n      }" else (compound_statement "{\n        sVar2 = strlen(__s);\n      }" { (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) }))) })) }))) (expression_statement "*pwidth = sVar2;" (assignment_expression "*pwidth = sVar2" (pointer_expression "*pwidth" * identifier) = identifier) ;) (if_statement "if (bswidth != (int *)0x0) {\n    *bswidth = sVar2;\n  }" if (parenthesized_expression "(bswidth != (int *)0x0)" ( (binary_expression "bswidth != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *bswidth = sVar2;\n  }" { (expression_statement "*bswidth = sVar2;" (assignment_expression "*bswidth = sVar2" (pointer_expression "*bswidth" * identifier) = identifier) ;) })) (return_statement "return __s;" return identifier ;) })))
(translation_unit "char * __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)\n\n{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}\n\n" (function_definition "char * __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)\n\n{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}" primitive_type (pointer_declarator "* __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" * (ERROR "__regparm3" identifier) (function_declarator "FUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "size_t *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) , (parameter_declaration "size_t *param_5" primitive_type (pointer_declarator "*param_5" * identifier)) )))) (compound_statement "{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "undefined1 local_20 [12];" type_identifier (array_declarator "local_20 [12]" identifier [ number_literal ]) ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x16b3b;" (assignment_expression "uStack_14 = 0x16b3b" identifier = number_literal) ;) (if_statement "if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }" { (expression_statement "__s = (char *)FUN_00016250(param_2);" (assignment_expression "__s = (char *)FUN_00016250(param_2)" identifier = (cast_expression "(char *)FUN_00016250(param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00016250(param_2)" identifier (argument_list "(param_2)" ( identifier ))))) ;) (expression_statement "sVar3 = strlen(__s);" (assignment_expression "sVar3 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) }) (else_clause "else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" else (compound_statement "{\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" { (expression_statement "__s = (char *)FUN_00016930(param_2);" (assignment_expression "__s = (char *)FUN_00016930(param_2)" identifier = (cast_expression "(char *)FUN_00016930(param_2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00016930(param_2)" identifier (argument_list "(param_2)" ( identifier ))))) ;) (expression_statement "iVar1 = FUN_00016810(param_2);" (assignment_expression "iVar1 = FUN_00016810(param_2)" identifier = (call_expression "FUN_00016810(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }" { (expression_statement "iVar1 = FUN_00016880(param_2);" (assignment_expression "iVar1 = FUN_00016880(param_2)" identifier = (call_expression "FUN_00016880(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }" { (expression_statement "uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);" (assignment_expression "uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320)" identifier = (call_expression "FUN_00016730(local_20,0xffffffff,&DAT_0003e320)" identifier (argument_list "(local_20,0xffffffff,&DAT_0003e320)" ( identifier , number_literal , (pointer_expression "&DAT_0003e320" & identifier) )))) ;) (expression_statement "iVar1 = FUN_00016af0(uVar2,param_2);" (assignment_expression "iVar1 = FUN_00016af0(uVar2,param_2)" identifier = (call_expression "FUN_00016af0(uVar2,param_2)" identifier (argument_list "(uVar2,param_2)" ( identifier , identifier )))) ;) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" identifier = number_literal) ;) (if_statement "if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }" { (expression_statement "iVar1 = FUN_00016a80(param_2);" (assignment_expression "iVar1 = FUN_00016a80(param_2)" identifier = (call_expression "FUN_00016a80(param_2)" identifier (argument_list "(param_2)" ( identifier )))) ;) (expression_statement "sVar3 = (iVar1 != 0) + 1;" (assignment_expression "sVar3 = (iVar1 != 0) + 1" identifier = (binary_expression "(iVar1 != 0) + 1" (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) + number_literal)) ;) })) }) (else_clause "else {\n        sVar3 = strlen(__s);\n      }" else (compound_statement "{\n        sVar3 = strlen(__s);\n      }" { (expression_statement "sVar3 = strlen(__s);" (assignment_expression "sVar3 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) }))) })) }))) (expression_statement "*param_4 = sVar3;" (assignment_expression "*param_4 = sVar3" (pointer_expression "*param_4" * identifier) = identifier) ;) (if_statement "if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }" if (parenthesized_expression "(param_5 != (size_t *)0x0)" ( (binary_expression "param_5 != (size_t *)0x0" identifier != (cast_expression "(size_t *)0x0" ( (type_descriptor "size_t *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_5 = sVar3;\n  }" { (expression_statement "*param_5 = sVar3;" (assignment_expression "*param_5 = sVar3" (pointer_expression "*param_5" * identifier) = identifier) ;) })) (return_statement "return __s;" return identifier ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , LIT , (pointer_expression & IDENT) )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) + LIT)) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) }))) })) }))) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) (return_statement return IDENT ;) })))
(function_definition "char * __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)\n\n{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}" (primitive_type "char") (pointer_declarator "* __regparm3\nFUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" (* "*") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00016b30(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" (identifier "FUN_00016b30") (parameter_list "(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "size_t *param_4" (primitive_type "size_t") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) (, ",") (parameter_declaration "size_t *param_5" (primitive_type "size_t") (pointer_declarator "*param_5" (* "*") (identifier "param_5"))) () ")")))) (compound_statement "{\n  char *__s;\n  int iVar1;\n  undefined4 uVar2;\n  size_t sVar3;\n  undefined1 local_20 [12];\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x16b3b;\n  if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }\n  *param_4 = sVar3;\n  if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }\n  return __s;\n}" ({ "{") (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "size_t sVar3;" (primitive_type "size_t") (identifier "sVar3") (; ";")) (declaration "undefined1 local_20 [12];" (type_identifier "undefined1") (array_declarator "local_20 [12]" (identifier "local_20") ([ "[") (number_literal "12") (] "]")) (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x16b3b;" (assignment_expression "uStack_14 = 0x16b3b" (identifier "uStack_14") (= "=") (number_literal "0x16b3b")) (; ";")) (if_statement "if (param_3 == 1) {\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }\n  else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" (if "if") (parenthesized_expression "(param_3 == 1)" (( "(") (binary_expression "param_3 == 1" (identifier "param_3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n    __s = (char *)FUN_00016250(param_2);\n    sVar3 = strlen(__s);\n  }" ({ "{") (expression_statement "__s = (char *)FUN_00016250(param_2);" (assignment_expression "__s = (char *)FUN_00016250(param_2)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_00016250(param_2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00016250(param_2)" (identifier "FUN_00016250") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")"))))) (; ";")) (expression_statement "sVar3 = strlen(__s);" (assignment_expression "sVar3 = strlen(__s)" (identifier "sVar3") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (} "}")) (else_clause "else {\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" (else "else") (compound_statement "{\n    __s = (char *)FUN_00016930(param_2);\n    iVar1 = FUN_00016810(param_2);\n    sVar3 = 0;\n    if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }\n  }" ({ "{") (expression_statement "__s = (char *)FUN_00016930(param_2);" (assignment_expression "__s = (char *)FUN_00016930(param_2)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_00016930(param_2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00016930(param_2)" (identifier "FUN_00016930") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")"))))) (; ";")) (expression_statement "iVar1 = FUN_00016810(param_2);" (assignment_expression "iVar1 = FUN_00016810(param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_00016810(param_2)" (identifier "FUN_00016810") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" (identifier "sVar3") (= "=") (number_literal "0")) (; ";")) (if_statement "if (iVar1 == 0) {\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar1 = FUN_00016880(param_2);\n      if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }\n    }" ({ "{") (expression_statement "iVar1 = FUN_00016880(param_2);" (assignment_expression "iVar1 = FUN_00016880(param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_00016880(param_2)" (identifier "FUN_00016880") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }\n      else {\n        sVar3 = strlen(__s);\n      }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);\n        iVar1 = FUN_00016af0(uVar2,param_2);\n        sVar3 = 0;\n        if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }\n      }" ({ "{") (expression_statement "uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);" (assignment_expression "uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320)" (identifier "uVar2") (= "=") (call_expression "FUN_00016730(local_20,0xffffffff,&DAT_0003e320)" (identifier "FUN_00016730") (argument_list "(local_20,0xffffffff,&DAT_0003e320)" (( "(") (identifier "local_20") (, ",") (number_literal "0xffffffff") (, ",") (pointer_expression "&DAT_0003e320" (& "&") (identifier "DAT_0003e320")) () ")")))) (; ";")) (expression_statement "iVar1 = FUN_00016af0(uVar2,param_2);" (assignment_expression "iVar1 = FUN_00016af0(uVar2,param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_00016af0(uVar2,param_2)" (identifier "FUN_00016af0") (argument_list "(uVar2,param_2)" (( "(") (identifier "uVar2") (, ",") (identifier "param_2") () ")")))) (; ";")) (expression_statement "sVar3 = 0;" (assignment_expression "sVar3 = 0" (identifier "sVar3") (= "=") (number_literal "0")) (; ";")) (if_statement "if (iVar1 == 0) {\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n          iVar1 = FUN_00016a80(param_2);\n          sVar3 = (iVar1 != 0) + 1;\n        }" ({ "{") (expression_statement "iVar1 = FUN_00016a80(param_2);" (assignment_expression "iVar1 = FUN_00016a80(param_2)" (identifier "iVar1") (= "=") (call_expression "FUN_00016a80(param_2)" (identifier "FUN_00016a80") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")")))) (; ";")) (expression_statement "sVar3 = (iVar1 != 0) + 1;" (assignment_expression "sVar3 = (iVar1 != 0) + 1" (identifier "sVar3") (= "=") (binary_expression "(iVar1 != 0) + 1" (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (+ "+") (number_literal "1"))) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n        sVar3 = strlen(__s);\n      }" (else "else") (compound_statement "{\n        sVar3 = strlen(__s);\n      }" ({ "{") (expression_statement "sVar3 = strlen(__s);" (assignment_expression "sVar3 = strlen(__s)" (identifier "sVar3") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (} "}")))) (} "}"))) (} "}")))) (expression_statement "*param_4 = sVar3;" (assignment_expression "*param_4 = sVar3" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (= "=") (identifier "sVar3")) (; ";")) (if_statement "if (param_5 != (size_t *)0x0) {\n    *param_5 = sVar3;\n  }" (if "if") (parenthesized_expression "(param_5 != (size_t *)0x0)" (( "(") (binary_expression "param_5 != (size_t *)0x0" (identifier "param_5") (!= "!=") (cast_expression "(size_t *)0x0" (( "(") (type_descriptor "size_t *" (primitive_type "size_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    *param_5 = sVar3;\n  }" ({ "{") (expression_statement "*param_5 = sVar3;" (assignment_expression "*param_5 = sVar3" (pointer_expression "*param_5" (* "*") (identifier "param_5")) (= "=") (identifier "sVar3")) (; ";")) (} "}"))) (return_statement "return __s;" (return "return") (identifier "__s") (; ";")) (} "}")))

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

char * __regparm3 function_1(char *p,type_1 ch,int var_1,int *pwidth,int *var_11)

{
  char *__s;
  int var_6;
  type_1 ch1;
  size_t sVar2;
  char *local_20 [3];
  type_2 uStack_14;
  
  uStack_14 = 0x16b3b;
  local_20[0] = p;
  if (var_1 == 1) {
    __s = var_2(ch);
    sVar2 = var_3(__s);
  }
  else {
    __s = var_4(ch);
    var_6 = var_5(ch);
    sVar2 = 0;
    if (var_6 == 0) {
      var_6 = var_7(ch);
      if (var_6 == 0) {
        ch1 = var_8(local_20,-1,cmdbuf);
        var_6 = var_9(ch1,ch);
        sVar2 = 0;
        if (var_6 == 0) {
          var_6 = var_10(ch);
          sVar2 = (var_6 != 0) + 1;
        }
      }
      else {
        sVar2 = var_3(__s);
      }
    }
  }
  *pwidth = sVar2;
  if (var_11 != (int *)0x0) {
    *var_11 = sVar2;
  }
  return __s;
}


(translation_unit (function_definition type: (primitive_type) declarator: (pointer_declarator (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier)))))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal) (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (number_literal))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))))))))))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))))) (return_statement (identifier)))))

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

char * __regparm3
MASKED(undefined4 param_1,undefined4 param_2,int param_3,size_t *param_4,size_t *param_5)

{
  char *__s;
  int iVar1;
  undefined4 uVar2;
  size_t sVar3;
  undefined1 local_20 [12];
  undefined4 uStack_14;
  
  uStack_14 = 0x16b3b;
  if (param_3 == 1) {
    __s = (char *)FUN_00016250(param_2);
    sVar3 = strlen(__s);
  }
  else {
    __s = (char *)FUN_00016930(param_2);
    iVar1 = FUN_00016810(param_2);
    sVar3 = 0;
    if (iVar1 == 0) {
      iVar1 = FUN_00016880(param_2);
      if (iVar1 == 0) {
        uVar2 = FUN_00016730(local_20,0xffffffff,&DAT_0003e320);
        iVar1 = FUN_00016af0(uVar2,param_2);
        sVar3 = 0;
        if (iVar1 == 0) {
          iVar1 = FUN_00016a80(param_2);
          sVar3 = (iVar1 != 0) + 1;
        }
      }
      else {
        sVar3 = strlen(__s);
      }
    }
  }
  *param_4 = sVar3;
  if (param_5 != (size_t *)0x0) {
    *param_5 = sVar3;
  }
  return __s;
}

