
int net_service_lookup(char *service)

{
  ushort uVar1;
  servent *psVar2;
  uint uVar3;
  
  psVar2 = getservbyname(service,(char *)0x0);
  uVar3 = 0;
  if (psVar2 != (servent *)0x0) {
    uVar1 = (ushort)psVar2->s_port;
    uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8);
  }
  return uVar3;
}



ushort FUN_00152425(char *param_1)

{
  servent *psVar1;
  ushort uVar2;
  
  psVar1 = getservbyname(param_1,(char *)0x0);
  uVar2 = 0;
  if (psVar1 != (servent *)0x0) {
    uVar2 = (ushort)psVar1->s_port;
    uVar2 = uVar2 << 8 | uVar2 >> 8;
  }
  return uVar2;
}


SUB RSP,0x8
MOV ESI,0x0
CALL 0x001100b0
MOV EDX,0x0
TEST RAX,RAX
JZ 0x00152448
MOVZX EDX,word ptr [RAX + 0x10]
ROL DX,0x8
MOVZX EDX,DX
MOV EAX,EDX
ADD RSP,0x8
RET
(translation_unit "ushort FUN_00152425(char *param_1)\n\n{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}\n\n" (function_definition "ushort FUN_00152425(char *param_1)\n\n{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00152425(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}" { (declaration "servent *psVar1;" type_identifier (pointer_declarator "*psVar1" * identifier) ;) (declaration "ushort uVar2;" type_identifier identifier ;) (expression_statement "psVar1 = getservbyname(param_1,(char *)0x0);" (assignment_expression "psVar1 = getservbyname(param_1,(char *)0x0)" identifier = (call_expression "getservbyname(param_1,(char *)0x0)" identifier (argument_list "(param_1,(char *)0x0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) (if_statement "if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }" if (parenthesized_expression "(psVar1 != (servent *)0x0)" ( (binary_expression "psVar1 != (servent *)0x0" identifier != (cast_expression "(servent *)0x0" ( (type_descriptor "servent *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }" { (expression_statement "uVar2 = (ushort)psVar1->s_port;" (assignment_expression "uVar2 = (ushort)psVar1->s_port" identifier = (cast_expression "(ushort)psVar1->s_port" ( (type_descriptor "ushort" type_identifier) ) (field_expression "psVar1->s_port" identifier -> field_identifier))) ;) (expression_statement "uVar2 = uVar2 << 8 | uVar2 >> 8;" (assignment_expression "uVar2 = uVar2 << 8 | uVar2 >> 8" identifier = (binary_expression "uVar2 << 8 | uVar2 >> 8" (binary_expression "uVar2 << 8" identifier << number_literal) | (binary_expression "uVar2 >> 8" identifier >> number_literal))) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "int net_service_lookup(char *service)\n\n{\n  ushort uVar1;\n  servent *psVar2;\n  uint uVar3;\n  \n  psVar2 = getservbyname(service,(char *)0x0);\n  uVar3 = 0;\n  if (psVar2 != (servent *)0x0) {\n    uVar1 = (ushort)psVar2->s_port;\n    uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8);\n  }\n  return uVar3;\n}\n\n" (function_definition "int net_service_lookup(char *service)\n\n{\n  ushort uVar1;\n  servent *psVar2;\n  uint uVar3;\n  \n  psVar2 = getservbyname(service,(char *)0x0);\n  uVar3 = 0;\n  if (psVar2 != (servent *)0x0) {\n    uVar1 = (ushort)psVar2->s_port;\n    uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8);\n  }\n  return uVar3;\n}" primitive_type (function_declarator "net_service_lookup(char *service)" identifier (parameter_list "(char *service)" ( (parameter_declaration "char *service" primitive_type (pointer_declarator "*service" * identifier)) ))) (compound_statement "{\n  ushort uVar1;\n  servent *psVar2;\n  uint uVar3;\n  \n  psVar2 = getservbyname(service,(char *)0x0);\n  uVar3 = 0;\n  if (psVar2 != (servent *)0x0) {\n    uVar1 = (ushort)psVar2->s_port;\n    uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8);\n  }\n  return uVar3;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (declaration "servent *psVar2;" type_identifier (pointer_declarator "*psVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (expression_statement "psVar2 = getservbyname(service,(char *)0x0);" (assignment_expression "psVar2 = getservbyname(service,(char *)0x0)" identifier = (call_expression "getservbyname(service,(char *)0x0)" identifier (argument_list "(service,(char *)0x0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (expression_statement "uVar3 = 0;" (assignment_expression "uVar3 = 0" identifier = number_literal) ;) (if_statement "if (psVar2 != (servent *)0x0) {\n    uVar1 = (ushort)psVar2->s_port;\n    uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8);\n  }" if (parenthesized_expression "(psVar2 != (servent *)0x0)" ( (binary_expression "psVar2 != (servent *)0x0" identifier != (cast_expression "(servent *)0x0" ( (type_descriptor "servent *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar1 = (ushort)psVar2->s_port;\n    uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8);\n  }" { (expression_statement "uVar1 = (ushort)psVar2->s_port;" (assignment_expression "uVar1 = (ushort)psVar2->s_port" identifier = (cast_expression "(ushort)psVar2->s_port" ( (type_descriptor "ushort" type_identifier) ) (field_expression "psVar2->s_port" identifier -> field_identifier))) ;) (expression_statement "uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8);" (assignment_expression "uVar3 = (uint)(ushort)(uVar1 << 8 | uVar1 >> 8)" identifier = (call_expression "(uint)(ushort)(uVar1 << 8 | uVar1 >> 8)" (call_expression "(uint)(ushort)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(ushort)" ( identifier ))) (argument_list "(uVar1 << 8 | uVar1 >> 8)" ( (binary_expression "uVar1 << 8 | uVar1 >> 8" (binary_expression "uVar1 << 8" identifier << number_literal) | (binary_expression "uVar1 >> 8" identifier >> number_literal)) )))) ;) })) (return_statement "return uVar3;" return identifier ;) })))
(translation_unit "ushort FUN_00152425(char *param_1)\n\n{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}\n\n" (function_definition "ushort FUN_00152425(char *param_1)\n\n{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}" type_identifier (function_declarator "FUN_00152425(char *param_1)" identifier (parameter_list "(char *param_1)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) ))) (compound_statement "{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}" { (declaration "servent *psVar1;" type_identifier (pointer_declarator "*psVar1" * identifier) ;) (declaration "ushort uVar2;" type_identifier identifier ;) (expression_statement "psVar1 = getservbyname(param_1,(char *)0x0);" (assignment_expression "psVar1 = getservbyname(param_1,(char *)0x0)" identifier = (call_expression "getservbyname(param_1,(char *)0x0)" identifier (argument_list "(param_1,(char *)0x0)" ( identifier , (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) )))) ;) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" identifier = number_literal) ;) (if_statement "if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }" if (parenthesized_expression "(psVar1 != (servent *)0x0)" ( (binary_expression "psVar1 != (servent *)0x0" identifier != (cast_expression "(servent *)0x0" ( (type_descriptor "servent *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }" { (expression_statement "uVar2 = (ushort)psVar1->s_port;" (assignment_expression "uVar2 = (ushort)psVar1->s_port" identifier = (cast_expression "(ushort)psVar1->s_port" ( (type_descriptor "ushort" type_identifier) ) (field_expression "psVar1->s_port" identifier -> field_identifier))) ;) (expression_statement "uVar2 = uVar2 << 8 | uVar2 >> 8;" (assignment_expression "uVar2 = uVar2 << 8 | uVar2 >> 8" identifier = (binary_expression "uVar2 << 8 | uVar2 >> 8" (binary_expression "uVar2 << 8" identifier << number_literal) | (binary_expression "uVar2 >> 8" identifier >> number_literal))) ;) })) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) )))) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) (field_expression IDENT -> field_identifier))) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT << LIT) | (binary_expression IDENT >> LIT))) ;) })) (return_statement return IDENT ;) })))
(function_definition "ushort FUN_00152425(char *param_1)\n\n{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}" (type_identifier "ushort") (function_declarator "FUN_00152425(char *param_1)" (identifier "FUN_00152425") (parameter_list "(char *param_1)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) () ")"))) (compound_statement "{\n  servent *psVar1;\n  ushort uVar2;\n  \n  psVar1 = getservbyname(param_1,(char *)0x0);\n  uVar2 = 0;\n  if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }\n  return uVar2;\n}" ({ "{") (declaration "servent *psVar1;" (type_identifier "servent") (pointer_declarator "*psVar1" (* "*") (identifier "psVar1")) (; ";")) (declaration "ushort uVar2;" (type_identifier "ushort") (identifier "uVar2") (; ";")) (expression_statement "psVar1 = getservbyname(param_1,(char *)0x0);" (assignment_expression "psVar1 = getservbyname(param_1,(char *)0x0)" (identifier "psVar1") (= "=") (call_expression "getservbyname(param_1,(char *)0x0)" (identifier "getservbyname") (argument_list "(param_1,(char *)0x0)" (( "(") (identifier "param_1") (, ",") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) () ")")))) (; ";")) (expression_statement "uVar2 = 0;" (assignment_expression "uVar2 = 0" (identifier "uVar2") (= "=") (number_literal "0")) (; ";")) (if_statement "if (psVar1 != (servent *)0x0) {\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }" (if "if") (parenthesized_expression "(psVar1 != (servent *)0x0)" (( "(") (binary_expression "psVar1 != (servent *)0x0" (identifier "psVar1") (!= "!=") (cast_expression "(servent *)0x0" (( "(") (type_descriptor "servent *" (type_identifier "servent") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    uVar2 = (ushort)psVar1->s_port;\n    uVar2 = uVar2 << 8 | uVar2 >> 8;\n  }" ({ "{") (expression_statement "uVar2 = (ushort)psVar1->s_port;" (assignment_expression "uVar2 = (ushort)psVar1->s_port" (identifier "uVar2") (= "=") (cast_expression "(ushort)psVar1->s_port" (( "(") (type_descriptor "ushort" (type_identifier "ushort")) () ")") (field_expression "psVar1->s_port" (identifier "psVar1") (-> "->") (field_identifier "s_port")))) (; ";")) (expression_statement "uVar2 = uVar2 << 8 | uVar2 >> 8;" (assignment_expression "uVar2 = uVar2 << 8 | uVar2 >> 8" (identifier "uVar2") (= "=") (binary_expression "uVar2 << 8 | uVar2 >> 8" (binary_expression "uVar2 << 8" (identifier "uVar2") (<< "<<") (number_literal "8")) (| "|") (binary_expression "uVar2 >> 8" (identifier "uVar2") (>> ">>") (number_literal "8")))) (; ";")) (} "}"))) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

int function_1(char *service)

{
  type_1 var_3;
  type_2 *var_2;
  type_3 uVar3;
  
  var_2 = var_1(service,(char *)0x0);
  uVar3 = 0;
  if (var_2 != (type_2 *)0x0) {
    var_3 = (type_1)var_2->s_port;
    uVar3 = (type_3)(type_1)(var_3 << 8 | var_3 >> 8);
  }
  return uVar3;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (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)))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (field_expression argument: (identifier) field: (field_identifier))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal))))))) (return_statement (identifier)))))

ushort MASKED(char *param_1)

{
  servent *psVar1;
  ushort uVar2;
  
  psVar1 = getservbyname(param_1,(char *)0x0);
  uVar2 = 0;
  if (psVar1 != (servent *)0x0) {
    uVar2 = (ushort)psVar1->s_port;
    uVar2 = uVar2 << 8 | uVar2 >> 8;
  }
  return uVar2;
}

