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

int __regparm3 displen(char *s)

{
  size_t sVar1;
  wchar_t *__pwcs;
  size_t bytes;
  size_t __n;
  
  sVar1 = mbstowcs((wchar_t *)0x0,s,0);
  if (sVar1 == 0xffffffff) {
    bytes = 4;
    __n = 1;
    sVar1 = 0;
  }
  else {
    __n = sVar1 + 1;
    bytes = __n * 4;
  }
  __pwcs = (wchar_t *)xmalloc(bytes);
  mbstowcs(__pwcs,s,__n);
  sVar1 = wcswidth(__pwcs,sVar1);
  free(__pwcs);
  if (((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')) &&
     ((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')))) {
    sVar1 = strlen(s);
  }
  return sVar1;
}



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

size_t __regparm3 FUN_00047250(char *param_1)

{
  size_t sVar1;
  wchar_t *__pwcs;
  int iVar2;
  size_t __n;
  
  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);
  if (sVar1 == 0xffffffff) {
    iVar2 = 4;
    __n = 1;
    sVar1 = 0;
  }
  else {
    __n = sVar1 + 1;
    iVar2 = __n * 4;
  }
  __pwcs = (wchar_t *)xmalloc(iVar2);
  mbstowcs(__pwcs,param_1,__n);
  sVar1 = wcswidth(__pwcs,sVar1);
  free(__pwcs);
  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&
     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {
    sVar1 = strlen(param_1);
  }
  return sVar1;
}


PUSH EBP
PUSH EDI
MOV EDI,EAX
PUSH ESI
PUSH EBX
CALL 0x00031ed0
ADD EBX,0x102da5
SUB ESP,0x20
PUSH 0x0
PUSH EAX
PUSH 0x0
CALL 0x0002faf0
ADD ESP,0x10
CMP EAX,-0x1
JZ 0x00047308
LEA EDX,[EAX + 0x1]
MOV EBP,EAX
LEA EAX,[EDX*0x4 + 0x0]
MOV dword ptr [ESP + 0xc],EDX
SUB ESP,0xc
PUSH EAX
CALL 0x00099200
ADD ESP,0xc
MOV EDX,dword ptr [ESP + 0x10]
MOV ESI,EAX
PUSH EDX
PUSH EDI
PUSH EAX
CALL 0x0002faf0
POP EAX
POP EDX
PUSH EBP
PUSH ESI
CALL 0x0002fa10
MOV dword ptr [ESP],ESI
MOV EBP,EAX
CALL 0x0002f200
ADD ESP,0x10
TEST EBP,EBP
JS 0x000472d0
ADD ESP,0x1c
MOV EAX,EBP
POP EBX
POP ESI
POP EDI
POP EBP
RET
XOR EBP,EBP
TEST EDI,EDI
JZ 0x000472be
CMP byte ptr [EDI],0x0
JZ 0x000472be
CMP byte ptr [EDI + 0x1],0x0
MOV EBP,0x1
JZ 0x000472be
CMP byte ptr [EDI + 0x2],0x0
MOV EBP,0x2
JZ 0x000472be
SUB ESP,0xc
PUSH EDI
CALL 0x0002f760
ADD ESP,0x10
MOV EBP,EAX
JMP 0x000472be
MOV EAX,0x4
MOV EDX,0x1
XOR EBP,EBP
JMP 0x00047286
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nsize_t __regparm3 FUN_00047250(char *param_1)\n\n{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}\n\n" comment (function_definition "size_t __regparm3 FUN_00047250(char *param_1)\n\n{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00047250(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "wchar_t *__pwcs;" type_identifier (pointer_declarator "*__pwcs" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);" (assignment_expression "sVar1 = mbstowcs((wchar_t *)0x0,param_1,0)" identifier = (call_expression "mbstowcs((wchar_t *)0x0,param_1,0)" identifier (argument_list "((wchar_t *)0x0,param_1,0)" ( (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , number_literal )))) ;) (if_statement "if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" if (parenthesized_expression "(sVar1 == 0xffffffff)" ( (binary_expression "sVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }" { (expression_statement "iVar2 = 4;" (assignment_expression "iVar2 = 4" identifier = number_literal) ;) (expression_statement "__n = 1;" (assignment_expression "__n = 1" identifier = number_literal) ;) (expression_statement "sVar1 = 0;" (assignment_expression "sVar1 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" else (compound_statement "{\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" { (expression_statement "__n = sVar1 + 1;" (assignment_expression "__n = sVar1 + 1" identifier = (binary_expression "sVar1 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = __n * 4;" (assignment_expression "iVar2 = __n * 4" identifier = (binary_expression "__n * 4" identifier * number_literal)) ;) }))) (expression_statement "__pwcs = (wchar_t *)xmalloc(iVar2);" (assignment_expression "__pwcs = (wchar_t *)xmalloc(iVar2)" identifier = (cast_expression "(wchar_t *)xmalloc(iVar2)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))))) ;) (expression_statement "mbstowcs(__pwcs,param_1,__n);" (call_expression "mbstowcs(__pwcs,param_1,__n)" identifier (argument_list "(__pwcs,param_1,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "sVar1 = wcswidth(__pwcs,sVar1);" (assignment_expression "sVar1 = wcswidth(__pwcs,sVar1)" identifier = (call_expression "wcswidth(__pwcs,sVar1)" identifier (argument_list "(__pwcs,sVar1)" ( identifier , identifier )))) ;) (expression_statement "free(__pwcs);" (call_expression "free(__pwcs)" identifier (argument_list "(__pwcs)" ( identifier ))) ;) (if_statement "if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }" if (parenthesized_expression "(((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0'))))" ( (binary_expression "((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))" (parenthesized_expression "((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0'))" ( (binary_expression "(((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')" (parenthesized_expression "(((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0))" ( (binary_expression "((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)" (parenthesized_expression "((int)sVar1 < 0)" ( (binary_expression "(int)sVar1 < 0" (cast_expression "(int)sVar1" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) && (parenthesized_expression "(sVar1 = 0, param_1 != (char *)0x0)" ( (comma_expression "sVar1 = 0, param_1 != (char *)0x0" (assignment_expression "sVar1 = 0" identifier = number_literal) , (binary_expression "param_1 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) && (parenthesized_expression "(*param_1 != '\0')" ( (binary_expression "*param_1 != '\0'" (pointer_expression "*param_1" * identifier) != (char_literal "'\0'" ' escape_sequence ')) ))) )) && (parenthesized_expression "((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))" ( (parenthesized_expression "(sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0'))" ( (comma_expression "sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')" (assignment_expression "sVar1 = 1" identifier = number_literal) , (binary_expression "param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')" (binary_expression "param_1[1] != '\0'" (subscript_expression "param_1[1]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence ')) && (parenthesized_expression "(sVar1 = 2, param_1[2] != '\0')" ( (comma_expression "sVar1 = 2, param_1[2] != '\0'" (assignment_expression "sVar1 = 2" identifier = number_literal) , (binary_expression "param_1[2] != '\0'" (subscript_expression "param_1[2]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence '))) )))) )) ))) )) (compound_statement "{\n    sVar1 = strlen(param_1);\n  }" { (expression_statement "sVar1 = strlen(param_1);" (assignment_expression "sVar1 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) })) (return_statement "return sVar1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3 displen(char *s)\n\n{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  size_t bytes;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,s,0);\n  if (sVar1 == 0xffffffff) {\n    bytes = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    bytes = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(bytes);\n  mbstowcs(__pwcs,s,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')) &&\n     ((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')))) {\n    sVar1 = strlen(s);\n  }\n  return sVar1;\n}\n\n" comment (function_definition "int __regparm3 displen(char *s)\n\n{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  size_t bytes;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,s,0);\n  if (sVar1 == 0xffffffff) {\n    bytes = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    bytes = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(bytes);\n  mbstowcs(__pwcs,s,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')) &&\n     ((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')))) {\n    sVar1 = strlen(s);\n  }\n  return sVar1;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "displen(char *s)" identifier (parameter_list "(char *s)" ( (parameter_declaration "char *s" primitive_type (pointer_declarator "*s" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  size_t bytes;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,s,0);\n  if (sVar1 == 0xffffffff) {\n    bytes = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    bytes = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(bytes);\n  mbstowcs(__pwcs,s,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')) &&\n     ((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')))) {\n    sVar1 = strlen(s);\n  }\n  return sVar1;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "wchar_t *__pwcs;" type_identifier (pointer_declarator "*__pwcs" * identifier) ;) (declaration "size_t bytes;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "sVar1 = mbstowcs((wchar_t *)0x0,s,0);" (assignment_expression "sVar1 = mbstowcs((wchar_t *)0x0,s,0)" identifier = (call_expression "mbstowcs((wchar_t *)0x0,s,0)" identifier (argument_list "((wchar_t *)0x0,s,0)" ( (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , number_literal )))) ;) (if_statement "if (sVar1 == 0xffffffff) {\n    bytes = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    bytes = __n * 4;\n  }" if (parenthesized_expression "(sVar1 == 0xffffffff)" ( (binary_expression "sVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n    bytes = 4;\n    __n = 1;\n    sVar1 = 0;\n  }" { (expression_statement "bytes = 4;" (assignment_expression "bytes = 4" identifier = number_literal) ;) (expression_statement "__n = 1;" (assignment_expression "__n = 1" identifier = number_literal) ;) (expression_statement "sVar1 = 0;" (assignment_expression "sVar1 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    __n = sVar1 + 1;\n    bytes = __n * 4;\n  }" else (compound_statement "{\n    __n = sVar1 + 1;\n    bytes = __n * 4;\n  }" { (expression_statement "__n = sVar1 + 1;" (assignment_expression "__n = sVar1 + 1" identifier = (binary_expression "sVar1 + 1" identifier + number_literal)) ;) (expression_statement "bytes = __n * 4;" (assignment_expression "bytes = __n * 4" identifier = (binary_expression "__n * 4" identifier * number_literal)) ;) }))) (expression_statement "__pwcs = (wchar_t *)xmalloc(bytes);" (assignment_expression "__pwcs = (wchar_t *)xmalloc(bytes)" identifier = (cast_expression "(wchar_t *)xmalloc(bytes)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(bytes)" identifier (argument_list "(bytes)" ( identifier ))))) ;) (expression_statement "mbstowcs(__pwcs,s,__n);" (call_expression "mbstowcs(__pwcs,s,__n)" identifier (argument_list "(__pwcs,s,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "sVar1 = wcswidth(__pwcs,sVar1);" (assignment_expression "sVar1 = wcswidth(__pwcs,sVar1)" identifier = (call_expression "wcswidth(__pwcs,sVar1)" identifier (argument_list "(__pwcs,sVar1)" ( identifier , identifier )))) ;) (expression_statement "free(__pwcs);" (call_expression "free(__pwcs)" identifier (argument_list "(__pwcs)" ( identifier ))) ;) (if_statement "if (((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')) &&\n     ((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')))) {\n    sVar1 = strlen(s);\n  }" if (parenthesized_expression "(((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')) &&\n     ((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0'))))" ( (binary_expression "((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')) &&\n     ((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')))" (parenthesized_expression "((((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0'))" ( (binary_expression "(((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)) && (*s != '\0')" (parenthesized_expression "(((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0))" ( (binary_expression "((int)sVar1 < 0) && (sVar1 = 0, s != (char *)0x0)" (parenthesized_expression "((int)sVar1 < 0)" ( (binary_expression "(int)sVar1 < 0" (cast_expression "(int)sVar1" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) && (parenthesized_expression "(sVar1 = 0, s != (char *)0x0)" ( (comma_expression "sVar1 = 0, s != (char *)0x0" (assignment_expression "sVar1 = 0" identifier = number_literal) , (binary_expression "s != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) && (parenthesized_expression "(*s != '\0')" ( (binary_expression "*s != '\0'" (pointer_expression "*s" * identifier) != (char_literal "'\0'" ' escape_sequence ')) ))) )) && (parenthesized_expression "((sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')))" ( (parenthesized_expression "(sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0'))" ( (comma_expression "sVar1 = 1, s[1] != '\0' && (sVar1 = 2, s[2] != '\0')" (assignment_expression "sVar1 = 1" identifier = number_literal) , (binary_expression "s[1] != '\0' && (sVar1 = 2, s[2] != '\0')" (binary_expression "s[1] != '\0'" (subscript_expression "s[1]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence ')) && (parenthesized_expression "(sVar1 = 2, s[2] != '\0')" ( (comma_expression "sVar1 = 2, s[2] != '\0'" (assignment_expression "sVar1 = 2" identifier = number_literal) , (binary_expression "s[2] != '\0'" (subscript_expression "s[2]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence '))) )))) )) ))) )) (compound_statement "{\n    sVar1 = strlen(s);\n  }" { (expression_statement "sVar1 = strlen(s);" (assignment_expression "sVar1 = strlen(s)" identifier = (call_expression "strlen(s)" identifier (argument_list "(s)" ( identifier )))) ;) })) (return_statement "return sVar1;" return identifier ;) })))
(translation_unit "size_t __regparm3 FUN_00047250(char *param_1)\n\n{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}\n\n" (function_definition "size_t __regparm3 FUN_00047250(char *param_1)\n\n{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_00047250(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}" { (declaration "size_t sVar1;" primitive_type identifier ;) (declaration "wchar_t *__pwcs;" type_identifier (pointer_declarator "*__pwcs" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "size_t __n;" primitive_type identifier ;) (expression_statement "sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);" (assignment_expression "sVar1 = mbstowcs((wchar_t *)0x0,param_1,0)" identifier = (call_expression "mbstowcs((wchar_t *)0x0,param_1,0)" identifier (argument_list "((wchar_t *)0x0,param_1,0)" ( (cast_expression "(wchar_t *)0x0" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , number_literal )))) ;) (if_statement "if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" if (parenthesized_expression "(sVar1 == 0xffffffff)" ( (binary_expression "sVar1 == 0xffffffff" identifier == number_literal) )) (compound_statement "{\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }" { (expression_statement "iVar2 = 4;" (assignment_expression "iVar2 = 4" identifier = number_literal) ;) (expression_statement "__n = 1;" (assignment_expression "__n = 1" identifier = number_literal) ;) (expression_statement "sVar1 = 0;" (assignment_expression "sVar1 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" else (compound_statement "{\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" { (expression_statement "__n = sVar1 + 1;" (assignment_expression "__n = sVar1 + 1" identifier = (binary_expression "sVar1 + 1" identifier + number_literal)) ;) (expression_statement "iVar2 = __n * 4;" (assignment_expression "iVar2 = __n * 4" identifier = (binary_expression "__n * 4" identifier * number_literal)) ;) }))) (expression_statement "__pwcs = (wchar_t *)xmalloc(iVar2);" (assignment_expression "__pwcs = (wchar_t *)xmalloc(iVar2)" identifier = (cast_expression "(wchar_t *)xmalloc(iVar2)" ( (type_descriptor "wchar_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "xmalloc(iVar2)" identifier (argument_list "(iVar2)" ( identifier ))))) ;) (expression_statement "mbstowcs(__pwcs,param_1,__n);" (call_expression "mbstowcs(__pwcs,param_1,__n)" identifier (argument_list "(__pwcs,param_1,__n)" ( identifier , identifier , identifier ))) ;) (expression_statement "sVar1 = wcswidth(__pwcs,sVar1);" (assignment_expression "sVar1 = wcswidth(__pwcs,sVar1)" identifier = (call_expression "wcswidth(__pwcs,sVar1)" identifier (argument_list "(__pwcs,sVar1)" ( identifier , identifier )))) ;) (expression_statement "free(__pwcs);" (call_expression "free(__pwcs)" identifier (argument_list "(__pwcs)" ( identifier ))) ;) (if_statement "if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }" if (parenthesized_expression "(((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0'))))" ( (binary_expression "((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))" (parenthesized_expression "((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0'))" ( (binary_expression "(((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')" (parenthesized_expression "(((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0))" ( (binary_expression "((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)" (parenthesized_expression "((int)sVar1 < 0)" ( (binary_expression "(int)sVar1 < 0" (cast_expression "(int)sVar1" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) )) && (parenthesized_expression "(sVar1 = 0, param_1 != (char *)0x0)" ( (comma_expression "sVar1 = 0, param_1 != (char *)0x0" (assignment_expression "sVar1 = 0" identifier = number_literal) , (binary_expression "param_1 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal))) ))) )) && (parenthesized_expression "(*param_1 != '\0')" ( (binary_expression "*param_1 != '\0'" (pointer_expression "*param_1" * identifier) != (char_literal "'\0'" ' escape_sequence ')) ))) )) && (parenthesized_expression "((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))" ( (parenthesized_expression "(sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0'))" ( (comma_expression "sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')" (assignment_expression "sVar1 = 1" identifier = number_literal) , (binary_expression "param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')" (binary_expression "param_1[1] != '\0'" (subscript_expression "param_1[1]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence ')) && (parenthesized_expression "(sVar1 = 2, param_1[2] != '\0')" ( (comma_expression "sVar1 = 2, param_1[2] != '\0'" (assignment_expression "sVar1 = 2" identifier = number_literal) , (binary_expression "param_1[2] != '\0'" (subscript_expression "param_1[2]" identifier [ number_literal ]) != (char_literal "'\0'" ' escape_sequence '))) )))) )) ))) )) (compound_statement "{\n    sVar1 = strlen(param_1);\n  }" { (expression_statement "sVar1 = strlen(param_1);" (assignment_expression "sVar1 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) })) (return_statement "return sVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) , IDENT , LIT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT * LIT)) ;) }))) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( IDENT ))))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = LIT) , (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT))) ))) )) && (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != (char_literal ' escape_sequence ')) ))) )) && (parenthesized_expression ( (parenthesized_expression ( (comma_expression (assignment_expression IDENT = LIT) , (binary_expression (binary_expression (subscript_expression IDENT [ LIT ]) != (char_literal ' escape_sequence ')) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = LIT) , (binary_expression (subscript_expression IDENT [ LIT ]) != (char_literal ' escape_sequence '))) )))) )) ))) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) })) (return_statement return IDENT ;) })))
(function_definition "size_t __regparm3 FUN_00047250(char *param_1)\n\n{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}" (primitive_type "size_t") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_00047250(char *param_1)" (identifier "FUN_00047250") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  size_t sVar1;\n  wchar_t *__pwcs;\n  int iVar2;\n  size_t __n;\n  \n  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);\n  if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }\n  __pwcs = (wchar_t *)xmalloc(iVar2);\n  mbstowcs(__pwcs,param_1,__n);\n  sVar1 = wcswidth(__pwcs,sVar1);\n  free(__pwcs);\n  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }\n  return sVar1;\n}" ({ "{") (declaration "size_t sVar1;" (primitive_type "size_t") (identifier "sVar1") (; ";")) (declaration "wchar_t *__pwcs;" (type_identifier "wchar_t") (pointer_declarator "*__pwcs" (* "*") (identifier "__pwcs")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "size_t __n;" (primitive_type "size_t") (identifier "__n") (; ";")) (expression_statement "sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);" (assignment_expression "sVar1 = mbstowcs((wchar_t *)0x0,param_1,0)" (identifier "sVar1") (= "=") (call_expression "mbstowcs((wchar_t *)0x0,param_1,0)" (identifier "mbstowcs") (argument_list "((wchar_t *)0x0,param_1,0)" (( "(") (cast_expression "(wchar_t *)0x0" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (, ",") (identifier "param_1") (, ",") (number_literal "0") () ")")))) (; ";")) (if_statement "if (sVar1 == 0xffffffff) {\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }\n  else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" (if "if") (parenthesized_expression "(sVar1 == 0xffffffff)" (( "(") (binary_expression "sVar1 == 0xffffffff" (identifier "sVar1") (== "==") (number_literal "0xffffffff")) () ")")) (compound_statement "{\n    iVar2 = 4;\n    __n = 1;\n    sVar1 = 0;\n  }" ({ "{") (expression_statement "iVar2 = 4;" (assignment_expression "iVar2 = 4" (identifier "iVar2") (= "=") (number_literal "4")) (; ";")) (expression_statement "__n = 1;" (assignment_expression "__n = 1" (identifier "__n") (= "=") (number_literal "1")) (; ";")) (expression_statement "sVar1 = 0;" (assignment_expression "sVar1 = 0" (identifier "sVar1") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" (else "else") (compound_statement "{\n    __n = sVar1 + 1;\n    iVar2 = __n * 4;\n  }" ({ "{") (expression_statement "__n = sVar1 + 1;" (assignment_expression "__n = sVar1 + 1" (identifier "__n") (= "=") (binary_expression "sVar1 + 1" (identifier "sVar1") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "iVar2 = __n * 4;" (assignment_expression "iVar2 = __n * 4" (identifier "iVar2") (= "=") (binary_expression "__n * 4" (identifier "__n") (* "*") (number_literal "4"))) (; ";")) (} "}")))) (expression_statement "__pwcs = (wchar_t *)xmalloc(iVar2);" (assignment_expression "__pwcs = (wchar_t *)xmalloc(iVar2)" (identifier "__pwcs") (= "=") (cast_expression "(wchar_t *)xmalloc(iVar2)" (( "(") (type_descriptor "wchar_t *" (type_identifier "wchar_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "xmalloc(iVar2)" (identifier "xmalloc") (argument_list "(iVar2)" (( "(") (identifier "iVar2") () ")"))))) (; ";")) (expression_statement "mbstowcs(__pwcs,param_1,__n);" (call_expression "mbstowcs(__pwcs,param_1,__n)" (identifier "mbstowcs") (argument_list "(__pwcs,param_1,__n)" (( "(") (identifier "__pwcs") (, ",") (identifier "param_1") (, ",") (identifier "__n") () ")"))) (; ";")) (expression_statement "sVar1 = wcswidth(__pwcs,sVar1);" (assignment_expression "sVar1 = wcswidth(__pwcs,sVar1)" (identifier "sVar1") (= "=") (call_expression "wcswidth(__pwcs,sVar1)" (identifier "wcswidth") (argument_list "(__pwcs,sVar1)" (( "(") (identifier "__pwcs") (, ",") (identifier "sVar1") () ")")))) (; ";")) (expression_statement "free(__pwcs);" (call_expression "free(__pwcs)" (identifier "free") (argument_list "(__pwcs)" (( "(") (identifier "__pwcs") () ")"))) (; ";")) (if_statement "if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {\n    sVar1 = strlen(param_1);\n  }" (if "if") (parenthesized_expression "(((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0'))))" (( "(") (binary_expression "((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&\n     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))" (parenthesized_expression "((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0'))" (( "(") (binary_expression "(((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')" (parenthesized_expression "(((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0))" (( "(") (binary_expression "((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)" (parenthesized_expression "((int)sVar1 < 0)" (( "(") (binary_expression "(int)sVar1 < 0" (cast_expression "(int)sVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "sVar1")) (< "<") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(sVar1 = 0, param_1 != (char *)0x0)" (( "(") (comma_expression "sVar1 = 0, param_1 != (char *)0x0" (assignment_expression "sVar1 = 0" (identifier "sVar1") (= "=") (number_literal "0")) (, ",") (binary_expression "param_1 != (char *)0x0" (identifier "param_1") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "(*param_1 != '\0')" (( "(") (binary_expression "*param_1 != '\0'" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))" (( "(") (parenthesized_expression "(sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0'))" (( "(") (comma_expression "sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')" (assignment_expression "sVar1 = 1" (identifier "sVar1") (= "=") (number_literal "1")) (, ",") (binary_expression "param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')" (binary_expression "param_1[1] != '\0'" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) (&& "&&") (parenthesized_expression "(sVar1 = 2, param_1[2] != '\0')" (( "(") (comma_expression "sVar1 = 2, param_1[2] != '\0'" (assignment_expression "sVar1 = 2" (identifier "sVar1") (= "=") (number_literal "2")) (, ",") (binary_expression "param_1[2] != '\0'" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'")))) () ")")))) () ")")) () ")"))) () ")")) (compound_statement "{\n    sVar1 = strlen(param_1);\n  }" ({ "{") (expression_statement "sVar1 = strlen(param_1);" (assignment_expression "sVar1 = strlen(param_1)" (identifier "sVar1") (= "=") (call_expression "strlen(param_1)" (identifier "strlen") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (} "}"))) (return_statement "return sVar1;" (return "return") (identifier "sVar1") (; ";")) (} "}")))

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

int __regparm3 function_1(char *var_7)

{
  size_t var_2;
  type_1 *__pwcs;
  size_t bytes;
  size_t var_3;
  
  var_2 = var_1((type_1 *)0x0,var_7,0);
  if (var_2 == 0xffffffff) {
    bytes = 4;
    var_3 = 1;
    var_2 = 0;
  }
  else {
    var_3 = var_2 + 1;
    bytes = var_3 * 4;
  }
  __pwcs = (type_1 *)var_4(bytes);
  var_1(__pwcs,var_7,var_3);
  var_2 = var_5(__pwcs,var_2);
  var_6(__pwcs);
  if (((((int)var_2 < 0) && (var_2 = 0, var_7 != (char *)0x0)) && (*var_7 != '\0')) &&
     ((var_2 = 1, var_7[1] != '\0' && (var_2 = 2, var_7[2] != '\0')))) {
    var_2 = var_8(var_7);
  }
  return var_2;
}


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

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

size_t __regparm3 MASKED(char *param_1)

{
  size_t sVar1;
  wchar_t *__pwcs;
  int iVar2;
  size_t __n;
  
  sVar1 = mbstowcs((wchar_t *)0x0,param_1,0);
  if (sVar1 == 0xffffffff) {
    iVar2 = 4;
    __n = 1;
    sVar1 = 0;
  }
  else {
    __n = sVar1 + 1;
    iVar2 = __n * 4;
  }
  __pwcs = (wchar_t *)xmalloc(iVar2);
  mbstowcs(__pwcs,param_1,__n);
  sVar1 = wcswidth(__pwcs,sVar1);
  free(__pwcs);
  if (((((int)sVar1 < 0) && (sVar1 = 0, param_1 != (char *)0x0)) && (*param_1 != '\0')) &&
     ((sVar1 = 1, param_1[1] != '\0' && (sVar1 = 2, param_1[2] != '\0')))) {
    sVar1 = strlen(param_1);
  }
  return sVar1;
}

