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

char * str_iconv(char *src,char *from_codeset,char *to_codeset)

{
  int iVar1;
  char *pcVar2;
  iconv_t cd;
  int *piVar3;
  int saved_errno;
  
  if ((*src == '\0') || (iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0)) {
    pcVar2 = strdup(src);
    if (pcVar2 != (char *)0x0) {
      return pcVar2;
    }
    piVar3 = __errno_location();
    *piVar3 = 0xc;
    return (char *)0x0;
  }
  cd = iconv_open(to_codeset,from_codeset);
  if (cd == (iconv_t)0xffffffff) {
    return (char *)0x0;
  }
  pcVar2 = str_cd_iconv(src,cd);
  if (pcVar2 != (char *)0x0) {
    iVar1 = iconv_close(cd);
    if (-1 < iVar1) {
      return pcVar2;
    }
    piVar3 = __errno_location();
    iVar1 = *piVar3;
    free(pcVar2);
    *piVar3 = iVar1;
    return (char *)0x0;
  }
  piVar3 = __errno_location();
  iVar1 = *piVar3;
  iconv_close(cd);
  *piVar3 = iVar1;
  return (char *)0x0;
}



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

char * FUN_00019220(char *param_1,char *param_2,char *param_3)

{
  int iVar1;
  char *pcVar2;
  iconv_t __cd;
  int *piVar3;
  
  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {
    pcVar2 = strdup(param_1);
    if (pcVar2 != (char *)0x0) {
      return pcVar2;
    }
    piVar3 = __errno_location();
    *piVar3 = 0xc;
    return (char *)0x0;
  }
  __cd = iconv_open(param_3,param_2);
  if (__cd == (iconv_t)0xffffffff) {
    return (char *)0x0;
  }
  pcVar2 = (char *)FUN_00019000(param_1,__cd);
  if (pcVar2 != (char *)0x0) {
    iVar1 = iconv_close(__cd);
    if (-1 < iVar1) {
      return pcVar2;
    }
    piVar3 = __errno_location();
    iVar1 = *piVar3;
    free(pcVar2);
    *piVar3 = iVar1;
    return (char *)0x0;
  }
  piVar3 = __errno_location();
  iVar1 = *piVar3;
  iconv_close(__cd);
  *piVar3 = iVar1;
  return (char *)0x0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000131a0
ADD EBX,0x5dd7
SUB ESP,0x1c
MOV ESI,dword ptr [ESP + 0x30]
MOV EBP,dword ptr [ESP + 0x34]
MOV EDI,dword ptr [ESP + 0x38]
CMP byte ptr [ESI],0x0
JZ 0x00019254
SUB ESP,0x8
PUSH EDI
PUSH EBP
CALL 0x00016f90
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00019270
SUB ESP,0xc
PUSH ESI
CALL 0x000120b0
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x000192c8
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x8
PUSH EBP
PUSH EDI
CALL 0x00012480
ADD ESP,0x10
MOV EDI,EAX
CMP EAX,-0x1
JZ 0x000192e0
SUB ESP,0x8
PUSH EAX
PUSH ESI
CALL 0x00019000
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x000192e8
SUB ESP,0xc
PUSH EDI
CALL 0x000122d0
ADD ESP,0x10
TEST EAX,EAX
JNS 0x00019266
CALL 0x00012330
SUB ESP,0xc
MOV EBP,dword ptr [EAX]
PUSH ESI
MOV EDI,EAX
XOR ESI,ESI
CALL 0x000120a0
MOV dword ptr [EDI],EBP
ADD ESP,0x10
JMP 0x00019266
CALL 0x00012330
MOV dword ptr [EAX],0xc
ADD ESP,0x1c
MOV EAX,ESI
POP EBX
POP ESI
POP EDI
POP EBP
RET
XOR ESI,ESI
JMP 0x00019266
CALL 0x00012330
SUB ESP,0xc
MOV EDX,dword ptr [EAX]
MOV EBP,EAX
MOV dword ptr [ESP + 0x18],EDX
PUSH EDI
CALL 0x000122d0
MOV EDX,dword ptr [ESP + 0x1c]
ADD ESP,0x10
MOV dword ptr [EBP],EDX
JMP 0x00019266
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * FUN_00019220(char *param_1,char *param_2,char *param_3)\n\n{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}\n\n" comment (function_definition "char * FUN_00019220(char *param_1,char *param_2,char *param_3)\n\n{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* FUN_00019220(char *param_1,char *param_2,char *param_3)" * (function_declarator "FUN_00019220(char *param_1,char *param_2,char *param_3)" identifier (parameter_list "(char *param_1,char *param_2,char *param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "char *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "iconv_t __cd;" type_identifier identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (if_statement "if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" if (parenthesized_expression "((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0))" ( (binary_expression "(*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)" (parenthesized_expression "(*param_1 == '\0')" ( (binary_expression "*param_1 == '\0'" (pointer_expression "*param_1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) || (parenthesized_expression "(iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)" ( (comma_expression "iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0" (assignment_expression "iVar1 = FUN_00016f90(param_2,param_3)" identifier = (call_expression "FUN_00016f90(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) , (binary_expression "iVar1 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" { (expression_statement "pcVar2 = strdup(param_1);" (assignment_expression "pcVar2 = strdup(param_1)" identifier = (call_expression "strdup(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }" if (parenthesized_expression "(pcVar2 != (char *)0x0)" ( (binary_expression "pcVar2 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return pcVar2;\n    }" { (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar3 = 0xc;" (assignment_expression "*piVar3 = 0xc" (pointer_expression "*piVar3" * identifier) = number_literal) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "__cd = iconv_open(param_3,param_2);" (assignment_expression "__cd = iconv_open(param_3,param_2)" identifier = (call_expression "iconv_open(param_3,param_2)" identifier (argument_list "(param_3,param_2)" ( identifier , identifier )))) ;) (if_statement "if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }" if (parenthesized_expression "(__cd == (iconv_t)0xffffffff)" ( (binary_expression "__cd == (iconv_t)0xffffffff" identifier == (cast_expression "(iconv_t)0xffffffff" ( (type_descriptor "iconv_t" type_identifier) ) number_literal)) )) (compound_statement "{\n    return (char *)0x0;\n  }" { (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pcVar2 = (char *)FUN_00019000(param_1,__cd);" (assignment_expression "pcVar2 = (char *)FUN_00019000(param_1,__cd)" identifier = (cast_expression "(char *)FUN_00019000(param_1,__cd)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00019000(param_1,__cd)" identifier (argument_list "(param_1,__cd)" ( identifier , identifier ))))) ;) (if_statement "if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" if (parenthesized_expression "(pcVar2 != (char *)0x0)" ( (binary_expression "pcVar2 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" { (expression_statement "iVar1 = iconv_close(__cd);" (assignment_expression "iVar1 = iconv_close(__cd)" identifier = (call_expression "iconv_close(__cd)" identifier (argument_list "(__cd)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n      return pcVar2;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      return pcVar2;\n    }" { (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "free(pcVar2);" (call_expression "free(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iconv_close(__cd);" (call_expression "iconv_close(__cd)" identifier (argument_list "(__cd)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * str_iconv(char *src,char *from_codeset,char *to_codeset)\n\n{\n  int iVar1;\n  char *pcVar2;\n  iconv_t cd;\n  int *piVar3;\n  int saved_errno;\n  \n  if ((*src == '\0') || (iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0)) {\n    pcVar2 = strdup(src);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  cd = iconv_open(to_codeset,from_codeset);\n  if (cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = str_cd_iconv(src,cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}\n\n" comment comment (function_definition "char * str_iconv(char *src,char *from_codeset,char *to_codeset)\n\n{\n  int iVar1;\n  char *pcVar2;\n  iconv_t cd;\n  int *piVar3;\n  int saved_errno;\n  \n  if ((*src == '\0') || (iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0)) {\n    pcVar2 = strdup(src);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  cd = iconv_open(to_codeset,from_codeset);\n  if (cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = str_cd_iconv(src,cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* str_iconv(char *src,char *from_codeset,char *to_codeset)" * (function_declarator "str_iconv(char *src,char *from_codeset,char *to_codeset)" identifier (parameter_list "(char *src,char *from_codeset,char *to_codeset)" ( (parameter_declaration "char *src" primitive_type (pointer_declarator "*src" * identifier)) , (parameter_declaration "char *from_codeset" primitive_type (pointer_declarator "*from_codeset" * identifier)) , (parameter_declaration "char *to_codeset" primitive_type (pointer_declarator "*to_codeset" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  char *pcVar2;\n  iconv_t cd;\n  int *piVar3;\n  int saved_errno;\n  \n  if ((*src == '\0') || (iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0)) {\n    pcVar2 = strdup(src);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  cd = iconv_open(to_codeset,from_codeset);\n  if (cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = str_cd_iconv(src,cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "iconv_t cd;" type_identifier identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (declaration "int saved_errno;" primitive_type identifier ;) (if_statement "if ((*src == '\0') || (iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0)) {\n    pcVar2 = strdup(src);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" if (parenthesized_expression "((*src == '\0') || (iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0))" ( (binary_expression "(*src == '\0') || (iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0)" (parenthesized_expression "(*src == '\0')" ( (binary_expression "*src == '\0'" (pointer_expression "*src" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) || (parenthesized_expression "(iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0)" ( (comma_expression "iVar1 = c_strcasecmp(from_codeset,to_codeset), iVar1 == 0" (assignment_expression "iVar1 = c_strcasecmp(from_codeset,to_codeset)" identifier = (call_expression "c_strcasecmp(from_codeset,to_codeset)" identifier (argument_list "(from_codeset,to_codeset)" ( identifier , identifier )))) , (binary_expression "iVar1 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    pcVar2 = strdup(src);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" { (expression_statement "pcVar2 = strdup(src);" (assignment_expression "pcVar2 = strdup(src)" identifier = (call_expression "strdup(src)" identifier (argument_list "(src)" ( identifier )))) ;) (if_statement "if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }" if (parenthesized_expression "(pcVar2 != (char *)0x0)" ( (binary_expression "pcVar2 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return pcVar2;\n    }" { (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar3 = 0xc;" (assignment_expression "*piVar3 = 0xc" (pointer_expression "*piVar3" * identifier) = number_literal) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "cd = iconv_open(to_codeset,from_codeset);" (assignment_expression "cd = iconv_open(to_codeset,from_codeset)" identifier = (call_expression "iconv_open(to_codeset,from_codeset)" identifier (argument_list "(to_codeset,from_codeset)" ( identifier , identifier )))) ;) (if_statement "if (cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }" if (parenthesized_expression "(cd == (iconv_t)0xffffffff)" ( (binary_expression "cd == (iconv_t)0xffffffff" identifier == (cast_expression "(iconv_t)0xffffffff" ( (type_descriptor "iconv_t" type_identifier) ) number_literal)) )) (compound_statement "{\n    return (char *)0x0;\n  }" { (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pcVar2 = str_cd_iconv(src,cd);" (assignment_expression "pcVar2 = str_cd_iconv(src,cd)" identifier = (call_expression "str_cd_iconv(src,cd)" identifier (argument_list "(src,cd)" ( identifier , identifier )))) ;) (if_statement "if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" if (parenthesized_expression "(pcVar2 != (char *)0x0)" ( (binary_expression "pcVar2 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = iconv_close(cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" { (expression_statement "iVar1 = iconv_close(cd);" (assignment_expression "iVar1 = iconv_close(cd)" identifier = (call_expression "iconv_close(cd)" identifier (argument_list "(cd)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n      return pcVar2;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      return pcVar2;\n    }" { (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "free(pcVar2);" (call_expression "free(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iconv_close(cd);" (call_expression "iconv_close(cd)" identifier (argument_list "(cd)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit "char * FUN_00019220(char *param_1,char *param_2,char *param_3)\n\n{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}\n\n" (function_definition "char * FUN_00019220(char *param_1,char *param_2,char *param_3)\n\n{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" primitive_type (pointer_declarator "* FUN_00019220(char *param_1,char *param_2,char *param_3)" * (function_declarator "FUN_00019220(char *param_1,char *param_2,char *param_3)" identifier (parameter_list "(char *param_1,char *param_2,char *param_3)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "char *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) , (parameter_declaration "char *param_3" primitive_type (pointer_declarator "*param_3" * identifier)) )))) (compound_statement "{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "iconv_t __cd;" type_identifier identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (if_statement "if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" if (parenthesized_expression "((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0))" ( (binary_expression "(*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)" (parenthesized_expression "(*param_1 == '\0')" ( (binary_expression "*param_1 == '\0'" (pointer_expression "*param_1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) || (parenthesized_expression "(iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)" ( (comma_expression "iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0" (assignment_expression "iVar1 = FUN_00016f90(param_2,param_3)" identifier = (call_expression "FUN_00016f90(param_2,param_3)" identifier (argument_list "(param_2,param_3)" ( identifier , identifier )))) , (binary_expression "iVar1 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" { (expression_statement "pcVar2 = strdup(param_1);" (assignment_expression "pcVar2 = strdup(param_1)" identifier = (call_expression "strdup(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (if_statement "if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }" if (parenthesized_expression "(pcVar2 != (char *)0x0)" ( (binary_expression "pcVar2 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      return pcVar2;\n    }" { (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar3 = 0xc;" (assignment_expression "*piVar3 = 0xc" (pointer_expression "*piVar3" * identifier) = number_literal) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "__cd = iconv_open(param_3,param_2);" (assignment_expression "__cd = iconv_open(param_3,param_2)" identifier = (call_expression "iconv_open(param_3,param_2)" identifier (argument_list "(param_3,param_2)" ( identifier , identifier )))) ;) (if_statement "if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }" if (parenthesized_expression "(__cd == (iconv_t)0xffffffff)" ( (binary_expression "__cd == (iconv_t)0xffffffff" identifier == (cast_expression "(iconv_t)0xffffffff" ( (type_descriptor "iconv_t" type_identifier) ) number_literal)) )) (compound_statement "{\n    return (char *)0x0;\n  }" { (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "pcVar2 = (char *)FUN_00019000(param_1,__cd);" (assignment_expression "pcVar2 = (char *)FUN_00019000(param_1,__cd)" identifier = (cast_expression "(char *)FUN_00019000(param_1,__cd)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00019000(param_1,__cd)" identifier (argument_list "(param_1,__cd)" ( identifier , identifier ))))) ;) (if_statement "if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" if (parenthesized_expression "(pcVar2 != (char *)0x0)" ( (binary_expression "pcVar2 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" { (expression_statement "iVar1 = iconv_close(__cd);" (assignment_expression "iVar1 = iconv_close(__cd)" identifier = (call_expression "iconv_close(__cd)" identifier (argument_list "(__cd)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n      return pcVar2;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      return pcVar2;\n    }" { (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "free(pcVar2);" (call_expression "free(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" identifier = (pointer_expression "*piVar3" * identifier)) ;) (expression_statement "iconv_close(__cd);" (call_expression "iconv_close(__cd)" identifier (argument_list "(__cd)" ( identifier ))) ;) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" * identifier) = identifier) ;) (return_statement "return (char *)0x0;" return (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' escape_sequence ')) )) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) , (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 != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE) ) LIT)) )) (compound_statement { (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( 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 IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (return_statement return (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) ;) })))
(function_definition "char * FUN_00019220(char *param_1,char *param_2,char *param_3)\n\n{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" (primitive_type "char") (pointer_declarator "* FUN_00019220(char *param_1,char *param_2,char *param_3)" (* "*") (function_declarator "FUN_00019220(char *param_1,char *param_2,char *param_3)" (identifier "FUN_00019220") (parameter_list "(char *param_1,char *param_2,char *param_3)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "char *param_2" (primitive_type "char") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) (, ",") (parameter_declaration "char *param_3" (primitive_type "char") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")")))) (compound_statement "{\n  int iVar1;\n  char *pcVar2;\n  iconv_t __cd;\n  int *piVar3;\n  \n  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }\n  __cd = iconv_open(param_3,param_2);\n  if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }\n  pcVar2 = (char *)FUN_00019000(param_1,__cd);\n  if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }\n  piVar3 = __errno_location();\n  iVar1 = *piVar3;\n  iconv_close(__cd);\n  *piVar3 = iVar1;\n  return (char *)0x0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "char *pcVar2;" (primitive_type "char") (pointer_declarator "*pcVar2" (* "*") (identifier "pcVar2")) (; ";")) (declaration "iconv_t __cd;" (type_identifier "iconv_t") (identifier "__cd") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (if_statement "if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" (if "if") (parenthesized_expression "((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0))" (( "(") (binary_expression "(*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)" (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 "(iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)" (( "(") (comma_expression "iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0" (assignment_expression "iVar1 = FUN_00016f90(param_2,param_3)" (identifier "iVar1") (= "=") (call_expression "FUN_00016f90(param_2,param_3)" (identifier "FUN_00016f90") (argument_list "(param_2,param_3)" (( "(") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (, ",") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n    pcVar2 = strdup(param_1);\n    if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    *piVar3 = 0xc;\n    return (char *)0x0;\n  }" ({ "{") (expression_statement "pcVar2 = strdup(param_1);" (assignment_expression "pcVar2 = strdup(param_1)" (identifier "pcVar2") (= "=") (call_expression "strdup(param_1)" (identifier "strdup") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (if_statement "if (pcVar2 != (char *)0x0) {\n      return pcVar2;\n    }" (if "if") (parenthesized_expression "(pcVar2 != (char *)0x0)" (( "(") (binary_expression "pcVar2 != (char *)0x0" (identifier "pcVar2") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      return pcVar2;\n    }" ({ "{") (return_statement "return pcVar2;" (return "return") (identifier "pcVar2") (; ";")) (} "}"))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "*piVar3 = 0xc;" (assignment_expression "*piVar3 = 0xc" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (number_literal "0xc")) (; ";")) (return_statement "return (char *)0x0;" (return "return") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))) (expression_statement "__cd = iconv_open(param_3,param_2);" (assignment_expression "__cd = iconv_open(param_3,param_2)" (identifier "__cd") (= "=") (call_expression "iconv_open(param_3,param_2)" (identifier "iconv_open") (argument_list "(param_3,param_2)" (( "(") (identifier "param_3") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (__cd == (iconv_t)0xffffffff) {\n    return (char *)0x0;\n  }" (if "if") (parenthesized_expression "(__cd == (iconv_t)0xffffffff)" (( "(") (binary_expression "__cd == (iconv_t)0xffffffff" (identifier "__cd") (== "==") (cast_expression "(iconv_t)0xffffffff" (( "(") (type_descriptor "iconv_t" (type_identifier "iconv_t")) () ")") (number_literal "0xffffffff"))) () ")")) (compound_statement "{\n    return (char *)0x0;\n  }" ({ "{") (return_statement "return (char *)0x0;" (return "return") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))) (expression_statement "pcVar2 = (char *)FUN_00019000(param_1,__cd);" (assignment_expression "pcVar2 = (char *)FUN_00019000(param_1,__cd)" (identifier "pcVar2") (= "=") (cast_expression "(char *)FUN_00019000(param_1,__cd)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00019000(param_1,__cd)" (identifier "FUN_00019000") (argument_list "(param_1,__cd)" (( "(") (identifier "param_1") (, ",") (identifier "__cd") () ")"))))) (; ";")) (if_statement "if (pcVar2 != (char *)0x0) {\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" (if "if") (parenthesized_expression "(pcVar2 != (char *)0x0)" (( "(") (binary_expression "pcVar2 != (char *)0x0" (identifier "pcVar2") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar1 = iconv_close(__cd);\n    if (-1 < iVar1) {\n      return pcVar2;\n    }\n    piVar3 = __errno_location();\n    iVar1 = *piVar3;\n    free(pcVar2);\n    *piVar3 = iVar1;\n    return (char *)0x0;\n  }" ({ "{") (expression_statement "iVar1 = iconv_close(__cd);" (assignment_expression "iVar1 = iconv_close(__cd)" (identifier "iVar1") (= "=") (call_expression "iconv_close(__cd)" (identifier "iconv_close") (argument_list "(__cd)" (( "(") (identifier "__cd") () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n      return pcVar2;\n    }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n      return pcVar2;\n    }" ({ "{") (return_statement "return pcVar2;" (return "return") (identifier "pcVar2") (; ";")) (} "}"))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" (identifier "iVar1") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "free(pcVar2);" (call_expression "free(pcVar2)" (identifier "free") (argument_list "(pcVar2)" (( "(") (identifier "pcVar2") () ")"))) (; ";")) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar1")) (; ";")) (return_statement "return (char *)0x0;" (return "return") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}"))) (expression_statement "piVar3 = __errno_location();" (assignment_expression "piVar3 = __errno_location()" (identifier "piVar3") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "iVar1 = *piVar3;" (assignment_expression "iVar1 = *piVar3" (identifier "iVar1") (= "=") (pointer_expression "*piVar3" (* "*") (identifier "piVar3"))) (; ";")) (expression_statement "iconv_close(__cd);" (call_expression "iconv_close(__cd)" (identifier "iconv_close") (argument_list "(__cd)" (( "(") (identifier "__cd") () ")"))) (; ";")) (expression_statement "*piVar3 = iVar1;" (assignment_expression "*piVar3 = iVar1" (pointer_expression "*piVar3" (* "*") (identifier "piVar3")) (= "=") (identifier "iVar1")) (; ";")) (return_statement "return (char *)0x0;" (return "return") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (; ";")) (} "}")))

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

char * function_1(char *src,char *from_codeset,char *to_codeset)

{
  int var_2;
  char *var_4;
  type_1 var_7;
  int *piVar3;
  int saved_errno;
  
  if ((*src == '\0') || (var_2 = var_1(from_codeset,to_codeset), var_2 == 0)) {
    var_4 = var_3(src);
    if (var_4 != (char *)0x0) {
      return var_4;
    }
    piVar3 = var_5();
    *piVar3 = 0xc;
    return (char *)0x0;
  }
  var_7 = var_6(to_codeset,from_codeset);
  if (var_7 == (type_1)0xffffffff) {
    return (char *)0x0;
  }
  var_4 = var_8(src,var_7);
  if (var_4 != (char *)0x0) {
    var_2 = var_9(var_7);
    if (-1 < var_2) {
      return var_4;
    }
    piVar3 = var_5();
    var_2 = *piVar3;
    var_10(var_4);
    *piVar3 = var_2;
    return (char *)0x0;
  }
  piVar3 = var_5();
  var_2 = *piVar3;
  var_9(var_7);
  *piVar3 = var_2;
  return (char *)0x0;
}


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

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

char * MASKED(char *param_1,char *param_2,char *param_3)

{
  int iVar1;
  char *pcVar2;
  iconv_t __cd;
  int *piVar3;
  
  if ((*param_1 == '\0') || (iVar1 = FUN_00016f90(param_2,param_3), iVar1 == 0)) {
    pcVar2 = strdup(param_1);
    if (pcVar2 != (char *)0x0) {
      return pcVar2;
    }
    piVar3 = __errno_location();
    *piVar3 = 0xc;
    return (char *)0x0;
  }
  __cd = iconv_open(param_3,param_2);
  if (__cd == (iconv_t)0xffffffff) {
    return (char *)0x0;
  }
  pcVar2 = (char *)FUN_00019000(param_1,__cd);
  if (pcVar2 != (char *)0x0) {
    iVar1 = iconv_close(__cd);
    if (-1 < iVar1) {
      return pcVar2;
    }
    piVar3 = __errno_location();
    iVar1 = *piVar3;
    free(pcVar2);
    *piVar3 = iVar1;
    return (char *)0x0;
  }
  piVar3 = __errno_location();
  iVar1 = *piVar3;
  iconv_close(__cd);
  *piVar3 = iVar1;
  return (char *)0x0;
}

