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

char * canon_host_r(char *host,int *cherror)

{
  addrinfo *__ai;
  int iVar1;
  char *pcVar2;
  int in_GS_OFFSET;
  addrinfo *res;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x12fe9;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  res = (addrinfo *)0x0;
  canon_host_r::hints.ai_flags = 2;
  iVar1 = getaddrinfo(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res);
  __ai = res;
  if (iVar1 == 0) {
    pcVar2 = res->ai_canonname;
    if (res->ai_canonname == (char *)0x0) {
      pcVar2 = host;
    }
    pcVar2 = strdup(pcVar2);
    if ((pcVar2 == (char *)0x0) && (cherror != (int *)0x0)) {
      *cherror = -10;
    }
    freeaddrinfo((addrinfo *)__ai);
  }
  else {
    pcVar2 = (char *)0x0;
    if (cherror != (int *)0x0) {
      *cherror = iVar1;
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return pcVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

char * FUN_00012fe0(char *param_1,int *param_2)

{
  addrinfo *__ai;
  int iVar1;
  char *pcVar2;
  int in_GS_OFFSET;
  addrinfo *local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x12fe9;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_24 = (addrinfo *)0x0;
  DAT_00021240 = 2;
  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);
  __ai = local_24;
  if (iVar1 == 0) {
    pcVar2 = local_24->ai_canonname;
    if (local_24->ai_canonname == (char *)0x0) {
      pcVar2 = param_1;
    }
    pcVar2 = strdup(pcVar2);
    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {
      *param_2 = -10;
    }
    freeaddrinfo(__ai);
  }
  else {
    pcVar2 = (char *)0x0;
    if (param_2 != (int *)0x0) {
      *param_2 = iVar1;
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return pcVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0001a090();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000118f0
ADD EBX,0xe017
SUB ESP,0x1c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0xc],EAX
XOR EAX,EAX
MOV ESI,dword ptr [ESP + 0x30]
LEA EAX,[ESP + 0x8]
MOV EDI,dword ptr [ESP + 0x34]
MOV dword ptr [ESP + 0x8],0x0
PUSH EAX
MOV dword ptr [EBX + 0x240],0x2
LEA EAX,[EBX + 0x240]
PUSH EAX
PUSH 0x0
PUSH ESI
CALL 0x000113b0
ADD ESP,0x10
TEST EAX,EAX
JNZ 0x00013080
MOV EBP,dword ptr [ESP + 0x8]
MOV EAX,dword ptr [EBP + 0x18]
TEST EAX,EAX
CMOVZ EAX,ESI
SUB ESP,0xc
PUSH EAX
CALL 0x00011080
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JNZ 0x0001305b
TEST EDI,EDI
JZ 0x0001305b
MOV dword ptr [EDI],0xfffffff6
SUB ESP,0xc
PUSH EBP
CALL 0x00011330
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0xc]
XOR EDX,dword ptr GS:[0x14]
MOV EAX,ESI
JNZ 0x0001308a
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
XOR ESI,ESI
TEST EDI,EDI
JZ 0x00013067
MOV dword ptr [EDI],EAX
JMP 0x00013067
CALL 0x0001a090
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * FUN_00012fe0(char *param_1,int *param_2)\n\n{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0001a090();\n}\n\n" comment (function_definition "char * FUN_00012fe0(char *param_1,int *param_2)\n\n{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0001a090();\n}" primitive_type (pointer_declarator "* FUN_00012fe0(char *param_1,int *param_2)" * (function_declarator "FUN_00012fe0(char *param_1,int *param_2)" identifier (parameter_list "(char *param_1,int *param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0001a090();\n}" { (declaration "addrinfo *__ai;" type_identifier (pointer_declarator "*__ai" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "addrinfo *local_24;" type_identifier (pointer_declarator "*local_24" * identifier) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x12fe9;" (assignment_expression "uStack_14 = 0x12fe9" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "local_24 = (addrinfo *)0x0;" (assignment_expression "local_24 = (addrinfo *)0x0" identifier = (cast_expression "(addrinfo *)0x0" ( (type_descriptor "addrinfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "DAT_00021240 = 2;" (assignment_expression "DAT_00021240 = 2" identifier = number_literal) ;) (expression_statement "iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);" (assignment_expression "iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" identifier = (call_expression "getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" identifier (argument_list "(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , (cast_expression "(addrinfo *)&DAT_00021240" ( (type_descriptor "addrinfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_00021240" & identifier)) , (pointer_expression "&local_24" & identifier) )))) ;) (expression_statement "__ai = local_24;" (assignment_expression "__ai = local_24" identifier = identifier) ;) (if_statement "if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }" { (expression_statement "pcVar2 = local_24->ai_canonname;" (assignment_expression "pcVar2 = local_24->ai_canonname" identifier = (field_expression "local_24->ai_canonname" identifier -> field_identifier)) ;) (if_statement "if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }" if (parenthesized_expression "(local_24->ai_canonname == (char *)0x0)" ( (binary_expression "local_24->ai_canonname == (char *)0x0" (field_expression "local_24->ai_canonname" identifier -> field_identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pcVar2 = param_1;\n    }" { (expression_statement "pcVar2 = param_1;" (assignment_expression "pcVar2 = param_1" identifier = identifier) ;) })) (expression_statement "pcVar2 = strdup(pcVar2);" (assignment_expression "pcVar2 = strdup(pcVar2)" identifier = (call_expression "strdup(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier )))) ;) (if_statement "if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }" if (parenthesized_expression "((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0))" ( (binary_expression "(pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)" (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)) )) && (parenthesized_expression "(param_2 != (int *)0x0)" ( (binary_expression "param_2 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n      *param_2 = -10;\n    }" { (expression_statement "*param_2 = -10;" (assignment_expression "*param_2 = -10" (pointer_expression "*param_2" * identifier) = number_literal) ;) })) (expression_statement "freeaddrinfo(__ai);" (call_expression "freeaddrinfo(__ai)" identifier (argument_list "(__ai)" ( identifier ))) ;) }) (else_clause "else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" else (compound_statement "{\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" { (expression_statement "pcVar2 = (char *)0x0;" (assignment_expression "pcVar2 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (if_statement "if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }" if (parenthesized_expression "(param_2 != (int *)0x0)" ( (binary_expression "param_2 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *param_2 = iVar1;\n    }" { (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) })) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return pcVar2;\n  }" { (return_statement "return pcVar2;" return identifier ;) })) comment (expression_statement "FUN_0001a090();" (call_expression "FUN_0001a090()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nchar * canon_host_r(char *host,int *cherror)\n\n{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *res;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  res = (addrinfo *)0x0;\n  canon_host_r::hints.ai_flags = 2;\n  iVar1 = getaddrinfo(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res);\n  __ai = res;\n  if (iVar1 == 0) {\n    pcVar2 = res->ai_canonname;\n    if (res->ai_canonname == (char *)0x0) {\n      pcVar2 = host;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (cherror != (int *)0x0)) {\n      *cherror = -10;\n    }\n    freeaddrinfo((addrinfo *)__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (cherror != (int *)0x0) {\n      *cherror = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "char * canon_host_r(char *host,int *cherror)\n\n{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *res;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  res = (addrinfo *)0x0;\n  canon_host_r::hints.ai_flags = 2;\n  iVar1 = getaddrinfo(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res);\n  __ai = res;\n  if (iVar1 == 0) {\n    pcVar2 = res->ai_canonname;\n    if (res->ai_canonname == (char *)0x0) {\n      pcVar2 = host;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (cherror != (int *)0x0)) {\n      *cherror = -10;\n    }\n    freeaddrinfo((addrinfo *)__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (cherror != (int *)0x0) {\n      *cherror = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (pointer_declarator "* canon_host_r(char *host,int *cherror)" * (function_declarator "canon_host_r(char *host,int *cherror)" identifier (parameter_list "(char *host,int *cherror)" ( (parameter_declaration "char *host" primitive_type (pointer_declarator "*host" * identifier)) , (parameter_declaration "int *cherror" primitive_type (pointer_declarator "*cherror" * identifier)) )))) (compound_statement "{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *res;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  res = (addrinfo *)0x0;\n  canon_host_r::hints.ai_flags = 2;\n  iVar1 = getaddrinfo(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res);\n  __ai = res;\n  if (iVar1 == 0) {\n    pcVar2 = res->ai_canonname;\n    if (res->ai_canonname == (char *)0x0) {\n      pcVar2 = host;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (cherror != (int *)0x0)) {\n      *cherror = -10;\n    }\n    freeaddrinfo((addrinfo *)__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (cherror != (int *)0x0) {\n      *cherror = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "addrinfo *__ai;" type_identifier (pointer_declarator "*__ai" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "addrinfo *res;" type_identifier (pointer_declarator "*res" * identifier) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x12fe9;" (assignment_expression "uStack_14 = 0x12fe9" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "res = (addrinfo *)0x0;" (assignment_expression "res = (addrinfo *)0x0" identifier = (cast_expression "(addrinfo *)0x0" ( (type_descriptor "addrinfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (labeled_statement "canon_host_r::hints.ai_flags = 2;" statement_identifier : (ERROR ":" :) (expression_statement "hints.ai_flags = 2;" (assignment_expression "hints.ai_flags = 2" (field_expression "hints.ai_flags" identifier . field_identifier) = number_literal) ;)) (expression_statement "iVar1 = getaddrinfo(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res);" (assignment_expression "iVar1 = getaddrinfo(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res)" identifier = (call_expression "getaddrinfo(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res)" identifier (argument_list "(host,(char *)0x0,(addrinfo *)&canon_host_r::hints,(addrinfo **)&res)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , (cast_expression "(addrinfo *)&canon_host_r" ( (type_descriptor "addrinfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&canon_host_r" & identifier)) (ERROR "::hints" : : identifier) , (cast_expression "(addrinfo **)&res" ( (type_descriptor "addrinfo **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (pointer_expression "&res" & identifier)) )))) ;) (expression_statement "__ai = res;" (assignment_expression "__ai = res" identifier = identifier) ;) (if_statement "if (iVar1 == 0) {\n    pcVar2 = res->ai_canonname;\n    if (res->ai_canonname == (char *)0x0) {\n      pcVar2 = host;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (cherror != (int *)0x0)) {\n      *cherror = -10;\n    }\n    freeaddrinfo((addrinfo *)__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (cherror != (int *)0x0) {\n      *cherror = iVar1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    pcVar2 = res->ai_canonname;\n    if (res->ai_canonname == (char *)0x0) {\n      pcVar2 = host;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (cherror != (int *)0x0)) {\n      *cherror = -10;\n    }\n    freeaddrinfo((addrinfo *)__ai);\n  }" { (expression_statement "pcVar2 = res->ai_canonname;" (assignment_expression "pcVar2 = res->ai_canonname" identifier = (field_expression "res->ai_canonname" identifier -> field_identifier)) ;) (if_statement "if (res->ai_canonname == (char *)0x0) {\n      pcVar2 = host;\n    }" if (parenthesized_expression "(res->ai_canonname == (char *)0x0)" ( (binary_expression "res->ai_canonname == (char *)0x0" (field_expression "res->ai_canonname" identifier -> field_identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pcVar2 = host;\n    }" { (expression_statement "pcVar2 = host;" (assignment_expression "pcVar2 = host" identifier = identifier) ;) })) (expression_statement "pcVar2 = strdup(pcVar2);" (assignment_expression "pcVar2 = strdup(pcVar2)" identifier = (call_expression "strdup(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier )))) ;) (if_statement "if ((pcVar2 == (char *)0x0) && (cherror != (int *)0x0)) {\n      *cherror = -10;\n    }" if (parenthesized_expression "((pcVar2 == (char *)0x0) && (cherror != (int *)0x0))" ( (binary_expression "(pcVar2 == (char *)0x0) && (cherror != (int *)0x0)" (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)) )) && (parenthesized_expression "(cherror != (int *)0x0)" ( (binary_expression "cherror != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n      *cherror = -10;\n    }" { (expression_statement "*cherror = -10;" (assignment_expression "*cherror = -10" (pointer_expression "*cherror" * identifier) = number_literal) ;) })) (expression_statement "freeaddrinfo((addrinfo *)__ai);" (call_expression "freeaddrinfo((addrinfo *)__ai)" identifier (argument_list "((addrinfo *)__ai)" ( (cast_expression "(addrinfo *)__ai" ( (type_descriptor "addrinfo *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) ))) ;) }) (else_clause "else {\n    pcVar2 = (char *)0x0;\n    if (cherror != (int *)0x0) {\n      *cherror = iVar1;\n    }\n  }" else (compound_statement "{\n    pcVar2 = (char *)0x0;\n    if (cherror != (int *)0x0) {\n      *cherror = iVar1;\n    }\n  }" { (expression_statement "pcVar2 = (char *)0x0;" (assignment_expression "pcVar2 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (if_statement "if (cherror != (int *)0x0) {\n      *cherror = iVar1;\n    }" if (parenthesized_expression "(cherror != (int *)0x0)" ( (binary_expression "cherror != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *cherror = iVar1;\n    }" { (expression_statement "*cherror = iVar1;" (assignment_expression "*cherror = iVar1" (pointer_expression "*cherror" * identifier) = identifier) ;) })) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return pcVar2;\n  }" { (return_statement "return pcVar2;" return identifier ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "char * FUN_00012fe0(char *param_1,int *param_2)\n\n{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    \n  FUN_0001a090();\n}\n\n" (function_definition "char * FUN_00012fe0(char *param_1,int *param_2)\n\n{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    \n  FUN_0001a090();\n}" primitive_type (pointer_declarator "* FUN_00012fe0(char *param_1,int *param_2)" * (function_declarator "FUN_00012fe0(char *param_1,int *param_2)" identifier (parameter_list "(char *param_1,int *param_2)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int *param_2" primitive_type (pointer_declarator "*param_2" * identifier)) )))) (compound_statement "{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    \n  FUN_0001a090();\n}" { (declaration "addrinfo *__ai;" type_identifier (pointer_declarator "*__ai" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "addrinfo *local_24;" type_identifier (pointer_declarator "*local_24" * identifier) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x12fe9;" (assignment_expression "uStack_14 = 0x12fe9" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "local_24 = (addrinfo *)0x0;" (assignment_expression "local_24 = (addrinfo *)0x0" identifier = (cast_expression "(addrinfo *)0x0" ( (type_descriptor "addrinfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "DAT_00021240 = 2;" (assignment_expression "DAT_00021240 = 2" identifier = number_literal) ;) (expression_statement "iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);" (assignment_expression "iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" identifier = (call_expression "getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" identifier (argument_list "(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) , (cast_expression "(addrinfo *)&DAT_00021240" ( (type_descriptor "addrinfo *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&DAT_00021240" & identifier)) , (pointer_expression "&local_24" & identifier) )))) ;) (expression_statement "__ai = local_24;" (assignment_expression "__ai = local_24" identifier = identifier) ;) (if_statement "if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }" { (expression_statement "pcVar2 = local_24->ai_canonname;" (assignment_expression "pcVar2 = local_24->ai_canonname" identifier = (field_expression "local_24->ai_canonname" identifier -> field_identifier)) ;) (if_statement "if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }" if (parenthesized_expression "(local_24->ai_canonname == (char *)0x0)" ( (binary_expression "local_24->ai_canonname == (char *)0x0" (field_expression "local_24->ai_canonname" identifier -> field_identifier) == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      pcVar2 = param_1;\n    }" { (expression_statement "pcVar2 = param_1;" (assignment_expression "pcVar2 = param_1" identifier = identifier) ;) })) (expression_statement "pcVar2 = strdup(pcVar2);" (assignment_expression "pcVar2 = strdup(pcVar2)" identifier = (call_expression "strdup(pcVar2)" identifier (argument_list "(pcVar2)" ( identifier )))) ;) (if_statement "if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }" if (parenthesized_expression "((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0))" ( (binary_expression "(pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)" (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)) )) && (parenthesized_expression "(param_2 != (int *)0x0)" ( (binary_expression "param_2 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n      *param_2 = -10;\n    }" { (expression_statement "*param_2 = -10;" (assignment_expression "*param_2 = -10" (pointer_expression "*param_2" * identifier) = number_literal) ;) })) (expression_statement "freeaddrinfo(__ai);" (call_expression "freeaddrinfo(__ai)" identifier (argument_list "(__ai)" ( identifier ))) ;) }) (else_clause "else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" else (compound_statement "{\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" { (expression_statement "pcVar2 = (char *)0x0;" (assignment_expression "pcVar2 = (char *)0x0" identifier = (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (if_statement "if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }" if (parenthesized_expression "(param_2 != (int *)0x0)" ( (binary_expression "param_2 != (int *)0x0" identifier != (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *param_2 = iVar1;\n    }" { (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" * identifier) = identifier) ;) })) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return pcVar2;\n  }" { (return_statement "return pcVar2;" return identifier ;) })) (expression_statement "FUN_0001a090();" (call_expression "FUN_0001a090()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) )))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (pointer_expression & IDENT)) , (pointer_expression & IDENT) )))) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (field_expression IDENT -> field_identifier)) ;) (if_statement if (parenthesized_expression ( (binary_expression (field_expression IDENT -> field_identifier) == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) && (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) })) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "char * FUN_00012fe0(char *param_1,int *param_2)\n\n{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    \n  FUN_0001a090();\n}" (primitive_type "char") (pointer_declarator "* FUN_00012fe0(char *param_1,int *param_2)" (* "*") (function_declarator "FUN_00012fe0(char *param_1,int *param_2)" (identifier "FUN_00012fe0") (parameter_list "(char *param_1,int *param_2)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int *param_2" (primitive_type "int") (pointer_declarator "*param_2" (* "*") (identifier "param_2"))) () ")")))) (compound_statement "{\n  addrinfo *__ai;\n  int iVar1;\n  char *pcVar2;\n  int in_GS_OFFSET;\n  addrinfo *local_24;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x12fe9;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  local_24 = (addrinfo *)0x0;\n  DAT_00021240 = 2;\n  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);\n  __ai = local_24;\n  if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }\n                    \n  FUN_0001a090();\n}" ({ "{") (declaration "addrinfo *__ai;" (type_identifier "addrinfo") (pointer_declarator "*__ai" (* "*") (identifier "__ai")) (; ";")) (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "char *pcVar2;" (primitive_type "char") (pointer_declarator "*pcVar2" (* "*") (identifier "pcVar2")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "addrinfo *local_24;" (type_identifier "addrinfo") (pointer_declarator "*local_24" (* "*") (identifier "local_24")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x12fe9;" (assignment_expression "uStack_14 = 0x12fe9" (identifier "uStack_14") (= "=") (number_literal "0x12fe9")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "local_24 = (addrinfo *)0x0;" (assignment_expression "local_24 = (addrinfo *)0x0" (identifier "local_24") (= "=") (cast_expression "(addrinfo *)0x0" (( "(") (type_descriptor "addrinfo *" (type_identifier "addrinfo") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (expression_statement "DAT_00021240 = 2;" (assignment_expression "DAT_00021240 = 2" (identifier "DAT_00021240") (= "=") (number_literal "2")) (; ";")) (expression_statement "iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);" (assignment_expression "iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" (identifier "iVar1") (= "=") (call_expression "getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" (identifier "getaddrinfo") (argument_list "(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24)" (( "(") (identifier "param_1") (, ",") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (, ",") (cast_expression "(addrinfo *)&DAT_00021240" (( "(") (type_descriptor "addrinfo *" (type_identifier "addrinfo") (abstract_pointer_declarator "*" (* "*"))) () ")") (pointer_expression "&DAT_00021240" (& "&") (identifier "DAT_00021240"))) (, ",") (pointer_expression "&local_24" (& "&") (identifier "local_24")) () ")")))) (; ";")) (expression_statement "__ai = local_24;" (assignment_expression "__ai = local_24" (identifier "__ai") (= "=") (identifier "local_24")) (; ";")) (if_statement "if (iVar1 == 0) {\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }\n  else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    pcVar2 = local_24->ai_canonname;\n    if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }\n    pcVar2 = strdup(pcVar2);\n    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }\n    freeaddrinfo(__ai);\n  }" ({ "{") (expression_statement "pcVar2 = local_24->ai_canonname;" (assignment_expression "pcVar2 = local_24->ai_canonname" (identifier "pcVar2") (= "=") (field_expression "local_24->ai_canonname" (identifier "local_24") (-> "->") (field_identifier "ai_canonname"))) (; ";")) (if_statement "if (local_24->ai_canonname == (char *)0x0) {\n      pcVar2 = param_1;\n    }" (if "if") (parenthesized_expression "(local_24->ai_canonname == (char *)0x0)" (( "(") (binary_expression "local_24->ai_canonname == (char *)0x0" (field_expression "local_24->ai_canonname" (identifier "local_24") (-> "->") (field_identifier "ai_canonname")) (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      pcVar2 = param_1;\n    }" ({ "{") (expression_statement "pcVar2 = param_1;" (assignment_expression "pcVar2 = param_1" (identifier "pcVar2") (= "=") (identifier "param_1")) (; ";")) (} "}"))) (expression_statement "pcVar2 = strdup(pcVar2);" (assignment_expression "pcVar2 = strdup(pcVar2)" (identifier "pcVar2") (= "=") (call_expression "strdup(pcVar2)" (identifier "strdup") (argument_list "(pcVar2)" (( "(") (identifier "pcVar2") () ")")))) (; ";")) (if_statement "if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {\n      *param_2 = -10;\n    }" (if "if") (parenthesized_expression "((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0))" (( "(") (binary_expression "(pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)" (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"))) () ")")) (&& "&&") (parenthesized_expression "(param_2 != (int *)0x0)" (( "(") (binary_expression "param_2 != (int *)0x0" (identifier "param_2") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")"))) () ")")) (compound_statement "{\n      *param_2 = -10;\n    }" ({ "{") (expression_statement "*param_2 = -10;" (assignment_expression "*param_2 = -10" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (number_literal "-10")) (; ";")) (} "}"))) (expression_statement "freeaddrinfo(__ai);" (call_expression "freeaddrinfo(__ai)" (identifier "freeaddrinfo") (argument_list "(__ai)" (( "(") (identifier "__ai") () ")"))) (; ";")) (} "}")) (else_clause "else {\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" (else "else") (compound_statement "{\n    pcVar2 = (char *)0x0;\n    if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }\n  }" ({ "{") (expression_statement "pcVar2 = (char *)0x0;" (assignment_expression "pcVar2 = (char *)0x0" (identifier "pcVar2") (= "=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (if_statement "if (param_2 != (int *)0x0) {\n      *param_2 = iVar1;\n    }" (if "if") (parenthesized_expression "(param_2 != (int *)0x0)" (( "(") (binary_expression "param_2 != (int *)0x0" (identifier "param_2") (!= "!=") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      *param_2 = iVar1;\n    }" ({ "{") (expression_statement "*param_2 = iVar1;" (assignment_expression "*param_2 = iVar1" (pointer_expression "*param_2" (* "*") (identifier "param_2")) (= "=") (identifier "iVar1")) (; ";")) (} "}"))) (} "}")))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pcVar2;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return pcVar2;\n  }" ({ "{") (return_statement "return pcVar2;" (return "return") (identifier "pcVar2") (; ";")) (} "}"))) (expression_statement "FUN_0001a090();" (call_expression "FUN_0001a090()" (identifier "FUN_0001a090") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

char * function_1(char *host,int *var_6)

{
  type_1 *__ai;
  int var_3;
  char *var_5;
  int var_1;
  type_1 *res;
  int var_8;
  type_2 uStack_14;
  
  uStack_14 = 0x12fe9;
  var_8 = *(int *)(var_1 + 0x14);
  res = (type_1 *)0x0;
  canon_host_r::hints.ai_flags = 2;
  var_3 = var_2(host,(char *)0x0,(type_1 *)&function_1::hints,(type_1 **)&res);
  __ai = res;
  if (var_3 == 0) {
    var_5 = res->ai_canonname;
    if (res->ai_canonname == (char *)0x0) {
      var_5 = host;
    }
    var_5 = var_4(var_5);
    if ((var_5 == (char *)0x0) && (var_6 != (int *)0x0)) {
      *var_6 = -10;
    }
    var_7((type_1 *)__ai);
  }
  else {
    var_5 = (char *)0x0;
    if (var_6 != (int *)0x0) {
      *var_6 = var_3;
    }
  }
  if (var_8 == *(int *)(var_1 + 0x14)) {
    return var_5;
  }
                    /* WARNING: Subroutine does not return */
  var_9();
}


(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)))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (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: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)) (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (pointer_expression argument: (identifier))) (pointer_expression argument: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (field_expression argument: (identifier) field: (field_identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (field_expression argument: (identifier) field: (field_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: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (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: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

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

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

{
  addrinfo *__ai;
  int iVar1;
  char *pcVar2;
  int in_GS_OFFSET;
  addrinfo *local_24;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x12fe9;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_24 = (addrinfo *)0x0;
  DAT_00021240 = 2;
  iVar1 = getaddrinfo(param_1,(char *)0x0,(addrinfo *)&DAT_00021240,&local_24);
  __ai = local_24;
  if (iVar1 == 0) {
    pcVar2 = local_24->ai_canonname;
    if (local_24->ai_canonname == (char *)0x0) {
      pcVar2 = param_1;
    }
    pcVar2 = strdup(pcVar2);
    if ((pcVar2 == (char *)0x0) && (param_2 != (int *)0x0)) {
      *param_2 = -10;
    }
    freeaddrinfo(__ai);
  }
  else {
    pcVar2 = (char *)0x0;
    if (param_2 != (int *)0x0) {
      *param_2 = iVar1;
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return pcVar2;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0001a090();
}

