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

char * __regparm3 _sni_hostname(char *hostname)

{
  char cVar1;
  size_t sVar2;
  char *pcVar3;
  int iVar4;
  
  sVar2 = strlen(hostname);
  pcVar3 = (char *)xmemdup(hostname,sVar2 + 1);
  if (sVar2 != 0) {
    cVar1 = pcVar3[sVar2 - 1];
    iVar4 = sVar2 - 1;
    while ((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))) {
      iVar4 = iVar4 + -1;
      cVar1 = pcVar3[iVar4];
    }
  }
  return pcVar3;
}



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

void __regparm3 FUN_0004f9f0(char *param_1)

{
  char cVar1;
  size_t sVar2;
  int iVar3;
  int iVar4;
  
  sVar2 = strlen(param_1);
  iVar3 = FUN_0005af40(param_1,sVar2 + 1);
  if (sVar2 != 0) {
    cVar1 = *(char *)(iVar3 + -1 + sVar2);
    iVar4 = sVar2 - 1;
    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {
      iVar4 = iVar4 + -1;
      cVar1 = *(char *)(iVar3 + iVar4);
    }
  }
  return;
}


PUSH EDI
MOV EDI,EAX
PUSH ESI
PUSH EBX
CALL 0x00019070
ADD EBX,0x511d6
SUB ESP,0xc
PUSH EAX
CALL 0x000168c0
POP EDX
POP ECX
MOV ESI,EAX
ADD EAX,0x1
PUSH EAX
PUSH EDI
CALL 0x0005af40
ADD ESP,0x10
TEST ESI,ESI
JZ 0x0004fa42
CMP byte ptr [EAX + ESI*0x1 + -0x1],0x2e
LEA EDX,[ESI + -0x1]
JNZ 0x0004fa42
LEA ECX,[EAX + -0x1]
JMP 0x0004fa39
SUB EDX,0x1
CMP byte ptr [EAX + EDX*0x1],0x2e
JNZ 0x0004fa42
MOV byte ptr [ECX + EDX*0x1 + 0x1],0x0
TEST EDX,EDX
JNZ 0x0004fa30
POP EBX
POP ESI
POP EDI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid __regparm3 FUN_0004f9f0(char *param_1)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void __regparm3 FUN_0004f9f0(char *param_1)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0004f9f0(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "sVar2 = strlen(param_1);" (assignment_expression "sVar2 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "iVar3 = FUN_0005af40(param_1,sVar2 + 1);" (assignment_expression "iVar3 = FUN_0005af40(param_1,sVar2 + 1)" identifier = (call_expression "FUN_0005af40(param_1,sVar2 + 1)" identifier (argument_list "(param_1,sVar2 + 1)" ( identifier , (binary_expression "sVar2 + 1" identifier + number_literal) )))) ;) (if_statement "if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }" { (expression_statement "cVar1 = *(char *)(iVar3 + -1 + sVar2);" (assignment_expression "cVar1 = *(char *)(iVar3 + -1 + sVar2)" identifier = (pointer_expression "*(char *)(iVar3 + -1 + sVar2)" * (cast_expression "(char *)(iVar3 + -1 + sVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + -1 + sVar2)" ( (binary_expression "iVar3 + -1 + sVar2" (binary_expression "iVar3 + -1" identifier + number_literal) + identifier) ))))) ;) (expression_statement "iVar4 = sVar2 - 1;" (assignment_expression "iVar4 = sVar2 - 1" identifier = (binary_expression "sVar2 - 1" identifier - number_literal)) ;) (while_statement "while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }" while (parenthesized_expression "((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)))" ( (parenthesized_expression "(cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))" ( (binary_expression "cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)" (binary_expression "cVar1 == '.'" identifier == (char_literal "'.'" ' character ')) && (parenthesized_expression "(*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)" ( (comma_expression "*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0" (assignment_expression "*(undefined1 *)(iVar3 + iVar4) = 0" (pointer_expression "*(undefined1 *)(iVar3 + iVar4)" * (cast_expression "(undefined1 *)(iVar3 + iVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar4)" ( (binary_expression "iVar3 + iVar4" identifier + identifier) )))) = number_literal) , (binary_expression "iVar4 != 0" identifier != number_literal)) ))) )) )) (compound_statement "{\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }" { (expression_statement "iVar4 = iVar4 + -1;" (assignment_expression "iVar4 = iVar4 + -1" identifier = (binary_expression "iVar4 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *(char *)(iVar3 + iVar4);" (assignment_expression "cVar1 = *(char *)(iVar3 + iVar4)" identifier = (pointer_expression "*(char *)(iVar3 + iVar4)" * (cast_expression "(char *)(iVar3 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar4)" ( (binary_expression "iVar3 + iVar4" identifier + identifier) ))))) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nchar * __regparm3 _sni_hostname(char *hostname)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *pcVar3;\n  int iVar4;\n  \n  sVar2 = strlen(hostname);\n  pcVar3 = (char *)xmemdup(hostname,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = pcVar3[sVar2 - 1];\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = pcVar3[iVar4];\n    }\n  }\n  return pcVar3;\n}\n\n" comment (function_definition "char * __regparm3 _sni_hostname(char *hostname)\n\n{\n  char cVar1;\n  size_t sVar2;\n  char *pcVar3;\n  int iVar4;\n  \n  sVar2 = strlen(hostname);\n  pcVar3 = (char *)xmemdup(hostname,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = pcVar3[sVar2 - 1];\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = pcVar3[iVar4];\n    }\n  }\n  return pcVar3;\n}" primitive_type (pointer_declarator "* __regparm3 _sni_hostname(char *hostname)" * (ERROR "__regparm3" identifier) (function_declarator "_sni_hostname(char *hostname)" identifier (parameter_list "(char *hostname)" ( (parameter_declaration "char *hostname" primitive_type (pointer_declarator "*hostname" * identifier)) )))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  char *pcVar3;\n  int iVar4;\n  \n  sVar2 = strlen(hostname);\n  pcVar3 = (char *)xmemdup(hostname,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = pcVar3[sVar2 - 1];\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = pcVar3[iVar4];\n    }\n  }\n  return pcVar3;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "sVar2 = strlen(hostname);" (assignment_expression "sVar2 = strlen(hostname)" identifier = (call_expression "strlen(hostname)" identifier (argument_list "(hostname)" ( identifier )))) ;) (expression_statement "pcVar3 = (char *)xmemdup(hostname,sVar2 + 1);" (assignment_expression "pcVar3 = (char *)xmemdup(hostname,sVar2 + 1)" identifier = (cast_expression "(char *)xmemdup(hostname,sVar2 + 1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "xmemdup(hostname,sVar2 + 1)" identifier (argument_list "(hostname,sVar2 + 1)" ( identifier , (binary_expression "sVar2 + 1" identifier + number_literal) ))))) ;) (if_statement "if (sVar2 != 0) {\n    cVar1 = pcVar3[sVar2 - 1];\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = pcVar3[iVar4];\n    }\n  }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    cVar1 = pcVar3[sVar2 - 1];\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = pcVar3[iVar4];\n    }\n  }" { (expression_statement "cVar1 = pcVar3[sVar2 - 1];" (assignment_expression "cVar1 = pcVar3[sVar2 - 1]" identifier = (subscript_expression "pcVar3[sVar2 - 1]" identifier [ (binary_expression "sVar2 - 1" identifier - number_literal) ])) ;) (expression_statement "iVar4 = sVar2 - 1;" (assignment_expression "iVar4 = sVar2 - 1" identifier = (binary_expression "sVar2 - 1" identifier - number_literal)) ;) (while_statement "while ((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = pcVar3[iVar4];\n    }" while (parenthesized_expression "((cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0)))" ( (parenthesized_expression "(cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0))" ( (binary_expression "cVar1 == '.' && (pcVar3[iVar4] = '\0', iVar4 != 0)" (binary_expression "cVar1 == '.'" identifier == (char_literal "'.'" ' character ')) && (parenthesized_expression "(pcVar3[iVar4] = '\0', iVar4 != 0)" ( (comma_expression "pcVar3[iVar4] = '\0', iVar4 != 0" (assignment_expression "pcVar3[iVar4] = '\0'" (subscript_expression "pcVar3[iVar4]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) , (binary_expression "iVar4 != 0" identifier != number_literal)) ))) )) )) (compound_statement "{\n      iVar4 = iVar4 + -1;\n      cVar1 = pcVar3[iVar4];\n    }" { (expression_statement "iVar4 = iVar4 + -1;" (assignment_expression "iVar4 = iVar4 + -1" identifier = (binary_expression "iVar4 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = pcVar3[iVar4];" (assignment_expression "cVar1 = pcVar3[iVar4]" identifier = (subscript_expression "pcVar3[iVar4]" identifier [ identifier ])) ;) })) })) (return_statement "return pcVar3;" return identifier ;) })))
(translation_unit "void __regparm3 FUN_0004f9f0(char *param_1)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}\n\n" (function_definition "void __regparm3 FUN_0004f9f0(char *param_1)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "FUN_0004f9f0(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (expression_statement "sVar2 = strlen(param_1);" (assignment_expression "sVar2 = strlen(param_1)" identifier = (call_expression "strlen(param_1)" identifier (argument_list "(param_1)" ( identifier )))) ;) (expression_statement "iVar3 = FUN_0005af40(param_1,sVar2 + 1);" (assignment_expression "iVar3 = FUN_0005af40(param_1,sVar2 + 1)" identifier = (call_expression "FUN_0005af40(param_1,sVar2 + 1)" identifier (argument_list "(param_1,sVar2 + 1)" ( identifier , (binary_expression "sVar2 + 1" identifier + number_literal) )))) ;) (if_statement "if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }" if (parenthesized_expression "(sVar2 != 0)" ( (binary_expression "sVar2 != 0" identifier != number_literal) )) (compound_statement "{\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }" { (expression_statement "cVar1 = *(char *)(iVar3 + -1 + sVar2);" (assignment_expression "cVar1 = *(char *)(iVar3 + -1 + sVar2)" identifier = (pointer_expression "*(char *)(iVar3 + -1 + sVar2)" * (cast_expression "(char *)(iVar3 + -1 + sVar2)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + -1 + sVar2)" ( (binary_expression "iVar3 + -1 + sVar2" (binary_expression "iVar3 + -1" identifier + number_literal) + identifier) ))))) ;) (expression_statement "iVar4 = sVar2 - 1;" (assignment_expression "iVar4 = sVar2 - 1" identifier = (binary_expression "sVar2 - 1" identifier - number_literal)) ;) (while_statement "while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }" while (parenthesized_expression "((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)))" ( (parenthesized_expression "(cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))" ( (binary_expression "cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)" (binary_expression "cVar1 == '.'" identifier == (char_literal "'.'" ' character ')) && (parenthesized_expression "(*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)" ( (comma_expression "*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0" (assignment_expression "*(undefined1 *)(iVar3 + iVar4) = 0" (pointer_expression "*(undefined1 *)(iVar3 + iVar4)" * (cast_expression "(undefined1 *)(iVar3 + iVar4)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar4)" ( (binary_expression "iVar3 + iVar4" identifier + identifier) )))) = number_literal) , (binary_expression "iVar4 != 0" identifier != number_literal)) ))) )) )) (compound_statement "{\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }" { (expression_statement "iVar4 = iVar4 + -1;" (assignment_expression "iVar4 = iVar4 + -1" identifier = (binary_expression "iVar4 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *(char *)(iVar3 + iVar4);" (assignment_expression "cVar1 = *(char *)(iVar3 + iVar4)" identifier = (pointer_expression "*(char *)(iVar3 + iVar4)" * (cast_expression "(char *)(iVar3 + iVar4)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar3 + iVar4)" ( (binary_expression "iVar3 + iVar4" identifier + identifier) ))))) ;) })) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + LIT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT - LIT)) ;) (while_statement while (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT == (char_literal ' character ')) && (parenthesized_expression ( (comma_expression (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) )))) = LIT) , (binary_expression IDENT != LIT)) ))) )) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) })) })) (return_statement return ;) })))
(function_definition "void __regparm3 FUN_0004f9f0(char *param_1)\n\n{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}" (primitive_type "void") (ERROR "__regparm3" (identifier "__regparm3")) (function_declarator "FUN_0004f9f0(char *param_1)" (identifier "FUN_0004f9f0") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  char cVar1;\n  size_t sVar2;\n  int iVar3;\n  int iVar4;\n  \n  sVar2 = strlen(param_1);\n  iVar3 = FUN_0005af40(param_1,sVar2 + 1);\n  if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }\n  return;\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int iVar4;" (primitive_type "int") (identifier "iVar4") (; ";")) (expression_statement "sVar2 = strlen(param_1);" (assignment_expression "sVar2 = strlen(param_1)" (identifier "sVar2") (= "=") (call_expression "strlen(param_1)" (identifier "strlen") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")")))) (; ";")) (expression_statement "iVar3 = FUN_0005af40(param_1,sVar2 + 1);" (assignment_expression "iVar3 = FUN_0005af40(param_1,sVar2 + 1)" (identifier "iVar3") (= "=") (call_expression "FUN_0005af40(param_1,sVar2 + 1)" (identifier "FUN_0005af40") (argument_list "(param_1,sVar2 + 1)" (( "(") (identifier "param_1") (, ",") (binary_expression "sVar2 + 1" (identifier "sVar2") (+ "+") (number_literal "1")) () ")")))) (; ";")) (if_statement "if (sVar2 != 0) {\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }" (if "if") (parenthesized_expression "(sVar2 != 0)" (( "(") (binary_expression "sVar2 != 0" (identifier "sVar2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    cVar1 = *(char *)(iVar3 + -1 + sVar2);\n    iVar4 = sVar2 - 1;\n    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }\n  }" ({ "{") (expression_statement "cVar1 = *(char *)(iVar3 + -1 + sVar2);" (assignment_expression "cVar1 = *(char *)(iVar3 + -1 + sVar2)" (identifier "cVar1") (= "=") (pointer_expression "*(char *)(iVar3 + -1 + sVar2)" (* "*") (cast_expression "(char *)(iVar3 + -1 + sVar2)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + -1 + sVar2)" (( "(") (binary_expression "iVar3 + -1 + sVar2" (binary_expression "iVar3 + -1" (identifier "iVar3") (+ "+") (number_literal "-1")) (+ "+") (identifier "sVar2")) () ")"))))) (; ";")) (expression_statement "iVar4 = sVar2 - 1;" (assignment_expression "iVar4 = sVar2 - 1" (identifier "iVar4") (= "=") (binary_expression "sVar2 - 1" (identifier "sVar2") (- "-") (number_literal "1"))) (; ";")) (while_statement "while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }" (while "while") (parenthesized_expression "((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)))" (( "(") (parenthesized_expression "(cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))" (( "(") (binary_expression "cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)" (binary_expression "cVar1 == '.'" (identifier "cVar1") (== "==") (char_literal "'.'" (' "'") (character ".") (' "'"))) (&& "&&") (parenthesized_expression "(*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0)" (( "(") (comma_expression "*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0" (assignment_expression "*(undefined1 *)(iVar3 + iVar4) = 0" (pointer_expression "*(undefined1 *)(iVar3 + iVar4)" (* "*") (cast_expression "(undefined1 *)(iVar3 + iVar4)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + iVar4)" (( "(") (binary_expression "iVar3 + iVar4" (identifier "iVar3") (+ "+") (identifier "iVar4")) () ")")))) (= "=") (number_literal "0")) (, ",") (binary_expression "iVar4 != 0" (identifier "iVar4") (!= "!=") (number_literal "0"))) () ")"))) () ")")) () ")")) (compound_statement "{\n      iVar4 = iVar4 + -1;\n      cVar1 = *(char *)(iVar3 + iVar4);\n    }" ({ "{") (expression_statement "iVar4 = iVar4 + -1;" (assignment_expression "iVar4 = iVar4 + -1" (identifier "iVar4") (= "=") (binary_expression "iVar4 + -1" (identifier "iVar4") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "cVar1 = *(char *)(iVar3 + iVar4);" (assignment_expression "cVar1 = *(char *)(iVar3 + iVar4)" (identifier "cVar1") (= "=") (pointer_expression "*(char *)(iVar3 + iVar4)" (* "*") (cast_expression "(char *)(iVar3 + iVar4)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar3 + iVar4)" (( "(") (binary_expression "iVar3 + iVar4" (identifier "iVar3") (+ "+") (identifier "iVar4")) () ")"))))) (; ";")) (} "}"))) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

char * __regparm3 function_1(char *hostname)

{
  char var_4;
  size_t var_3;
  char *pcVar3;
  int var_5;
  
  var_3 = var_1(hostname);
  pcVar3 = (char *)var_2(hostname,var_3 + 1);
  if (var_3 != 0) {
    var_4 = pcVar3[var_3 - 1];
    var_5 = var_3 - 1;
    while ((var_4 == '.' && (pcVar3[var_5] = '\0', var_5 != 0))) {
      var_5 = var_5 + -1;
      var_4 = pcVar3[var_5];
    }
  }
  return pcVar3;
}


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

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

void __regparm3 MASKED(char *param_1)

{
  char cVar1;
  size_t sVar2;
  int iVar3;
  int iVar4;
  
  sVar2 = strlen(param_1);
  iVar3 = FUN_0005af40(param_1,sVar2 + 1);
  if (sVar2 != 0) {
    cVar1 = *(char *)(iVar3 + -1 + sVar2);
    iVar4 = sVar2 - 1;
    while ((cVar1 == '.' && (*(undefined1 *)(iVar3 + iVar4) = 0, iVar4 != 0))) {
      iVar4 = iVar4 + -1;
      cVar1 = *(char *)(iVar3 + iVar4);
    }
  }
  return;
}

