
/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */
/* WARNING: Unknown calling convention */

void sg_get_command_name(uint8_t *cmdp,int peri_type,int buff_len,char *buff)

{
  uint service_action;
  
  if ((buff != (char *)0x0) && (0 < buff_len)) {
    if (buff_len == 1) {
      *buff = '\0';
      return;
    }
    if (cmdp == (uint8_t *)0x0) {
      sg_scnpr(buff,buff_len,"%s","<null> command pointer");
    }
    else {
      if (*cmdp == '\x7f') {
        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);
      }
      else {
        service_action = cmdp[1] & 0x1f;
      }
      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);
    }
  }
  return;
}



/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

void sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)

{
  ushort uVar1;
  
  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {
    if (param_3 == 1) {
      *param_4 = 0;
      return;
    }
    if (param_1 == (char *)0x0) {
      sg_scnpr(param_4,param_3,"%s","<null> command pointer");
    }
    else {
      if (*param_1 == '\x7f') {
        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;
      }
      else {
        uVar1 = (byte)param_1[1] & 0x1f;
      }
      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);
    }
  }
  return;
}


PUSH ESI
CALL 0x0001f34d
ADD ESI,0x2fdf2
PUSH EBX
SUB ESP,0x4
MOV EDX,dword ptr [ESP + 0x1c]
MOV ECX,dword ptr [ESP + 0x10]
MOV EAX,dword ptr [ESP + 0x18]
TEST EDX,EDX
JZ 0x00018fe4
TEST EAX,EAX
JLE 0x00018fe4
CMP EAX,0x1
JZ 0x00019020
TEST ECX,ECX
JZ 0x00018ff0
MOVZX EBX,byte ptr [ECX]
CMP BL,0x7f
JZ 0x00019010
MOVZX ECX,byte ptr [ECX + 0x1]
AND ECX,0x1f
SUB ESP,0xc
PUSH EDX
PUSH EAX
MOVZX EAX,BL
MOV EBX,ESI
PUSH dword ptr [ESP + 0x28]
PUSH ECX
PUSH EAX
CALL 0x000176b0
ADD ESP,0x20
ADD ESP,0x4
POP EBX
POP ESI
RET
LEA ECX,[ESI + 0xfffe7456]
MOV EBX,ESI
PUSH ECX
LEA ECX,[ESI + 0xfffe743c]
PUSH ECX
PUSH EAX
PUSH EDX
CALL 0x000175e0
ADD ESP,0x10
JMP 0x00018fe4
MOVZX ECX,word ptr [ECX + 0x8]
ROL CX,0x8
MOVZX ECX,CX
JMP 0x00018fcc
MOV byte ptr [EDX],0x0
ADD ESP,0x4
POP EBX
POP ESI
RET
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n\nvoid sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)\n\n{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}\n\n" comment (function_definition "void sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)\n\n{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}" primitive_type (function_declarator "sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)" identifier (parameter_list "(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined1 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (if_statement "if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }" if (parenthesized_expression "((param_4 != (undefined1 *)0x0) && (0 < param_3))" ( (binary_expression "(param_4 != (undefined1 *)0x0) && (0 < param_3)" (parenthesized_expression "(param_4 != (undefined1 *)0x0)" ( (binary_expression "param_4 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(0 < param_3)" ( (binary_expression "0 < param_3" number_literal < identifier) ))) )) (compound_statement "{\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }" { (if_statement "if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      *param_4 = 0;\n      return;\n    }" { (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" * identifier) = number_literal) ;) (return_statement "return;" return ;) })) (if_statement "if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" if (parenthesized_expression "(param_1 == (char *)0x0)" ( (binary_expression "param_1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }" { (expression_statement "sg_scnpr(param_4,param_3,"%s","<null> command pointer");" (call_expression "sg_scnpr(param_4,param_3,"%s","<null> command pointer")" identifier (argument_list "(param_4,param_3,"%s","<null> command pointer")" ( identifier , identifier , (string_literal ""%s"" " string_content ") , (string_literal ""<null> command pointer"" " string_content ") ))) ;) }) (else_clause "else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" else (compound_statement "{\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" { (if_statement "if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" if (parenthesized_expression "(*param_1 == '\x7f')" ( (binary_expression "*param_1 == '\x7f'" (pointer_expression "*param_1" * identifier) == (char_literal "'\x7f'" ' escape_sequence ')) )) (compound_statement "{\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }" { (expression_statement "uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;" (assignment_expression "uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8" identifier = (binary_expression "*(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8" (binary_expression "*(ushort *)(param_1 + 8) << 8" (pointer_expression "*(ushort *)(param_1 + 8)" * (cast_expression "(ushort *)(param_1 + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) << number_literal) | (binary_expression "*(ushort *)(param_1 + 8) >> 8" (pointer_expression "*(ushort *)(param_1 + 8)" * (cast_expression "(ushort *)(param_1 + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) >> number_literal))) ;) }) (else_clause "else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" else (compound_statement "{\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" { (expression_statement "uVar1 = (byte)param_1[1] & 0x1f;" (assignment_expression "uVar1 = (byte)param_1[1] & 0x1f" identifier = (binary_expression "(byte)param_1[1] & 0x1f" (cast_expression "(byte)param_1[1]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) & number_literal)) ;) }))) (expression_statement "sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);" (call_expression "sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4)" identifier (argument_list "(*param_1,uVar1,param_2,param_3,param_4)" ( (pointer_expression "*param_1" * identifier) , identifier , identifier , identifier , identifier ))) ;) }))) })) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n/* WARNING: Unknown calling convention */\n\nvoid sg_get_command_name(uint8_t *cmdp,int peri_type,int buff_len,char *buff)\n\n{\n  uint service_action;\n  \n  if ((buff != (char *)0x0) && (0 < buff_len)) {\n    if (buff_len == 1) {\n      *buff = '\0';\n      return;\n    }\n    if (cmdp == (uint8_t *)0x0) {\n      sg_scnpr(buff,buff_len,"%s","<null> command pointer");\n    }\n    else {\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }\n  }\n  return;\n}\n\n" comment comment (function_definition "void sg_get_command_name(uint8_t *cmdp,int peri_type,int buff_len,char *buff)\n\n{\n  uint service_action;\n  \n  if ((buff != (char *)0x0) && (0 < buff_len)) {\n    if (buff_len == 1) {\n      *buff = '\0';\n      return;\n    }\n    if (cmdp == (uint8_t *)0x0) {\n      sg_scnpr(buff,buff_len,"%s","<null> command pointer");\n    }\n    else {\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }\n  }\n  return;\n}" primitive_type (function_declarator "sg_get_command_name(uint8_t *cmdp,int peri_type,int buff_len,char *buff)" identifier (parameter_list "(uint8_t *cmdp,int peri_type,int buff_len,char *buff)" ( (parameter_declaration "uint8_t *cmdp" primitive_type (pointer_declarator "*cmdp" * identifier)) , (parameter_declaration "int peri_type" primitive_type identifier) , (parameter_declaration "int buff_len" primitive_type identifier) , (parameter_declaration "char *buff" primitive_type (pointer_declarator "*buff" * identifier)) ))) (compound_statement "{\n  uint service_action;\n  \n  if ((buff != (char *)0x0) && (0 < buff_len)) {\n    if (buff_len == 1) {\n      *buff = '\0';\n      return;\n    }\n    if (cmdp == (uint8_t *)0x0) {\n      sg_scnpr(buff,buff_len,"%s","<null> command pointer");\n    }\n    else {\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }\n  }\n  return;\n}" { (declaration "uint service_action;" type_identifier identifier ;) (if_statement "if ((buff != (char *)0x0) && (0 < buff_len)) {\n    if (buff_len == 1) {\n      *buff = '\0';\n      return;\n    }\n    if (cmdp == (uint8_t *)0x0) {\n      sg_scnpr(buff,buff_len,"%s","<null> command pointer");\n    }\n    else {\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }\n  }" if (parenthesized_expression "((buff != (char *)0x0) && (0 < buff_len))" ( (binary_expression "(buff != (char *)0x0) && (0 < buff_len)" (parenthesized_expression "(buff != (char *)0x0)" ( (binary_expression "buff != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(0 < buff_len)" ( (binary_expression "0 < buff_len" number_literal < identifier) ))) )) (compound_statement "{\n    if (buff_len == 1) {\n      *buff = '\0';\n      return;\n    }\n    if (cmdp == (uint8_t *)0x0) {\n      sg_scnpr(buff,buff_len,"%s","<null> command pointer");\n    }\n    else {\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }\n  }" { (if_statement "if (buff_len == 1) {\n      *buff = '\0';\n      return;\n    }" if (parenthesized_expression "(buff_len == 1)" ( (binary_expression "buff_len == 1" identifier == number_literal) )) (compound_statement "{\n      *buff = '\0';\n      return;\n    }" { (expression_statement "*buff = '\0';" (assignment_expression "*buff = '\0'" (pointer_expression "*buff" * identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (return_statement "return;" return ;) })) (if_statement "if (cmdp == (uint8_t *)0x0) {\n      sg_scnpr(buff,buff_len,"%s","<null> command pointer");\n    }\n    else {\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }" if (parenthesized_expression "(cmdp == (uint8_t *)0x0)" ( (binary_expression "cmdp == (uint8_t *)0x0" identifier == (cast_expression "(uint8_t *)0x0" ( (type_descriptor "uint8_t *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sg_scnpr(buff,buff_len,"%s","<null> command pointer");\n    }" { (expression_statement "sg_scnpr(buff,buff_len,"%s","<null> command pointer");" (call_expression "sg_scnpr(buff,buff_len,"%s","<null> command pointer")" identifier (argument_list "(buff,buff_len,"%s","<null> command pointer")" ( identifier , identifier , (string_literal ""%s"" " string_content ") , (string_literal ""<null> command pointer"" " string_content ") ))) ;) }) (else_clause "else {\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }" else (compound_statement "{\n      if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);\n    }" { (if_statement "if (*cmdp == '\x7f') {\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }\n      else {\n        service_action = cmdp[1] & 0x1f;\n      }" if (parenthesized_expression "(*cmdp == '\x7f')" ( (binary_expression "*cmdp == '\x7f'" (pointer_expression "*cmdp" * identifier) == (char_literal "'\x7f'" ' escape_sequence ')) )) (compound_statement "{\n        service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);\n      }" { (expression_statement "service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8);" (assignment_expression "service_action = (uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8)" identifier = (call_expression "(uint)(ushort)(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8)" (call_expression "(uint)(ushort)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(ushort)" ( identifier ))) (argument_list "(*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8)" ( (binary_expression "*(ushort *)(cmdp + 8) << 8 | *(ushort *)(cmdp + 8) >> 8" (binary_expression "*(ushort *)(cmdp + 8) << 8" (pointer_expression "*(ushort *)(cmdp + 8)" * (cast_expression "(ushort *)(cmdp + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(cmdp + 8)" ( (binary_expression "cmdp + 8" identifier + number_literal) )))) << number_literal) | (binary_expression "*(ushort *)(cmdp + 8) >> 8" (pointer_expression "*(ushort *)(cmdp + 8)" * (cast_expression "(ushort *)(cmdp + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(cmdp + 8)" ( (binary_expression "cmdp + 8" identifier + number_literal) )))) >> number_literal)) )))) ;) }) (else_clause "else {\n        service_action = cmdp[1] & 0x1f;\n      }" else (compound_statement "{\n        service_action = cmdp[1] & 0x1f;\n      }" { (expression_statement "service_action = cmdp[1] & 0x1f;" (assignment_expression "service_action = cmdp[1] & 0x1f" identifier = (binary_expression "cmdp[1] & 0x1f" (subscript_expression "cmdp[1]" identifier [ number_literal ]) & number_literal)) ;) }))) (expression_statement "sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff);" (call_expression "sg_get_opcode_sa_name(*cmdp,service_action,peri_type,buff_len,buff)" identifier (argument_list "(*cmdp,service_action,peri_type,buff_len,buff)" ( (pointer_expression "*cmdp" * identifier) , identifier , identifier , identifier , identifier ))) ;) }))) })) (return_statement "return;" return ;) })))
(translation_unit "void sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)\n\n{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}\n\n" (function_definition "void sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)\n\n{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}" primitive_type (function_declarator "sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)" identifier (parameter_list "(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)" ( (parameter_declaration "char *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) , (parameter_declaration "undefined1 *param_4" type_identifier (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}" { (declaration "ushort uVar1;" type_identifier identifier ;) (if_statement "if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }" if (parenthesized_expression "((param_4 != (undefined1 *)0x0) && (0 < param_3))" ( (binary_expression "(param_4 != (undefined1 *)0x0) && (0 < param_3)" (parenthesized_expression "(param_4 != (undefined1 *)0x0)" ( (binary_expression "param_4 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) && (parenthesized_expression "(0 < param_3)" ( (binary_expression "0 < param_3" number_literal < identifier) ))) )) (compound_statement "{\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }" { (if_statement "if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }" if (parenthesized_expression "(param_3 == 1)" ( (binary_expression "param_3 == 1" identifier == number_literal) )) (compound_statement "{\n      *param_4 = 0;\n      return;\n    }" { (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" * identifier) = number_literal) ;) (return_statement "return;" return ;) })) (if_statement "if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" if (parenthesized_expression "(param_1 == (char *)0x0)" ( (binary_expression "param_1 == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }" { (expression_statement "sg_scnpr(param_4,param_3,"%s","<null> command pointer");" (call_expression "sg_scnpr(param_4,param_3,"%s","<null> command pointer")" identifier (argument_list "(param_4,param_3,"%s","<null> command pointer")" ( identifier , identifier , (string_literal ""%s"" " string_content ") , (string_literal ""<null> command pointer"" " string_content ") ))) ;) }) (else_clause "else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" else (compound_statement "{\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" { (if_statement "if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" if (parenthesized_expression "(*param_1 == '\x7f')" ( (binary_expression "*param_1 == '\x7f'" (pointer_expression "*param_1" * identifier) == (char_literal "'\x7f'" ' escape_sequence ')) )) (compound_statement "{\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }" { (expression_statement "uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;" (assignment_expression "uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8" identifier = (binary_expression "*(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8" (binary_expression "*(ushort *)(param_1 + 8) << 8" (pointer_expression "*(ushort *)(param_1 + 8)" * (cast_expression "(ushort *)(param_1 + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) << number_literal) | (binary_expression "*(ushort *)(param_1 + 8) >> 8" (pointer_expression "*(ushort *)(param_1 + 8)" * (cast_expression "(ushort *)(param_1 + 8)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) >> number_literal))) ;) }) (else_clause "else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" else (compound_statement "{\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" { (expression_statement "uVar1 = (byte)param_1[1] & 0x1f;" (assignment_expression "uVar1 = (byte)param_1[1] & 0x1f" identifier = (binary_expression "(byte)param_1[1] & 0x1f" (cast_expression "(byte)param_1[1]" ( (type_descriptor "byte" type_identifier) ) (subscript_expression "param_1[1]" identifier [ number_literal ])) & number_literal)) ;) }))) (expression_statement "sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);" (call_expression "sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4)" identifier (argument_list "(*param_1,uVar1,param_2,param_3,param_4)" ( (pointer_expression "*param_1" * identifier) , identifier , identifier , identifier , identifier ))) ;) }))) })) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE 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 LIT < IDENT) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return ;) })) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (string_literal " string_content ") , (string_literal " string_content ") ))) ;) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' escape_sequence ')) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) << LIT) | (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) >> LIT))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression IDENT [ LIT ])) & LIT)) ;) }))) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * IDENT) , IDENT , IDENT , IDENT , IDENT ))) ;) }))) })) (return_statement return ;) })))
(function_definition "void sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)\n\n{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}" (primitive_type "void") (function_declarator "sg_get_command_name(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)" (identifier "sg_get_command_name") (parameter_list "(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)" (( "(") (parameter_declaration "char *param_1" (primitive_type "char") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) (, ",") (parameter_declaration "undefined1 *param_4" (type_identifier "undefined1") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  ushort uVar1;\n  \n  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }\n  return;\n}" ({ "{") (declaration "ushort uVar1;" (type_identifier "ushort") (identifier "uVar1") (; ";")) (if_statement "if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }" (if "if") (parenthesized_expression "((param_4 != (undefined1 *)0x0) && (0 < param_3))" (( "(") (binary_expression "(param_4 != (undefined1 *)0x0) && (0 < param_3)" (parenthesized_expression "(param_4 != (undefined1 *)0x0)" (( "(") (binary_expression "param_4 != (undefined1 *)0x0" (identifier "param_4") (!= "!=") (cast_expression "(undefined1 *)0x0" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (&& "&&") (parenthesized_expression "(0 < param_3)" (( "(") (binary_expression "0 < param_3" (number_literal "0") (< "<") (identifier "param_3")) () ")"))) () ")")) (compound_statement "{\n    if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }\n    if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }\n  }" ({ "{") (if_statement "if (param_3 == 1) {\n      *param_4 = 0;\n      return;\n    }" (if "if") (parenthesized_expression "(param_3 == 1)" (( "(") (binary_expression "param_3 == 1" (identifier "param_3") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      *param_4 = 0;\n      return;\n    }" ({ "{") (expression_statement "*param_4 = 0;" (assignment_expression "*param_4 = 0" (pointer_expression "*param_4" (* "*") (identifier "param_4")) (= "=") (number_literal "0")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (if_statement "if (param_1 == (char *)0x0) {\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }\n    else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" (if "if") (parenthesized_expression "(param_1 == (char *)0x0)" (( "(") (binary_expression "param_1 == (char *)0x0" (identifier "param_1") (== "==") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      sg_scnpr(param_4,param_3,"%s","<null> command pointer");\n    }" ({ "{") (expression_statement "sg_scnpr(param_4,param_3,"%s","<null> command pointer");" (call_expression "sg_scnpr(param_4,param_3,"%s","<null> command pointer")" (identifier "sg_scnpr") (argument_list "(param_4,param_3,"%s","<null> command pointer")" (( "(") (identifier "param_4") (, ",") (identifier "param_3") (, ",") (string_literal ""%s"" (" """) (string_content "%s") (" """)) (, ",") (string_literal ""<null> command pointer"" (" """) (string_content "<null> command pointer") (" """)) () ")"))) (; ";")) (} "}")) (else_clause "else {\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" (else "else") (compound_statement "{\n      if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }\n      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);\n    }" ({ "{") (if_statement "if (*param_1 == '\x7f') {\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }\n      else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" (if "if") (parenthesized_expression "(*param_1 == '\x7f')" (( "(") (binary_expression "*param_1 == '\x7f'" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (== "==") (char_literal "'\x7f'" (' "'") (escape_sequence "\x7f") (' "'"))) () ")")) (compound_statement "{\n        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;\n      }" ({ "{") (expression_statement "uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;" (assignment_expression "uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8" (identifier "uVar1") (= "=") (binary_expression "*(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8" (binary_expression "*(ushort *)(param_1 + 8) << 8" (pointer_expression "*(ushort *)(param_1 + 8)" (* "*") (cast_expression "(ushort *)(param_1 + 8)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (<< "<<") (number_literal "8")) (| "|") (binary_expression "*(ushort *)(param_1 + 8) >> 8" (pointer_expression "*(ushort *)(param_1 + 8)" (* "*") (cast_expression "(ushort *)(param_1 + 8)" (( "(") (type_descriptor "ushort *" (type_identifier "ushort") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (>> ">>") (number_literal "8")))) (; ";")) (} "}")) (else_clause "else {\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" (else "else") (compound_statement "{\n        uVar1 = (byte)param_1[1] & 0x1f;\n      }" ({ "{") (expression_statement "uVar1 = (byte)param_1[1] & 0x1f;" (assignment_expression "uVar1 = (byte)param_1[1] & 0x1f" (identifier "uVar1") (= "=") (binary_expression "(byte)param_1[1] & 0x1f" (cast_expression "(byte)param_1[1]" (( "(") (type_descriptor "byte" (type_identifier "byte")) () ")") (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]"))) (& "&") (number_literal "0x1f"))) (; ";")) (} "}")))) (expression_statement "sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);" (call_expression "sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4)" (identifier "sg_get_opcode_sa_name") (argument_list "(*param_1,uVar1,param_2,param_3,param_4)" (( "(") (pointer_expression "*param_1" (* "*") (identifier "param_1")) (, ",") (identifier "uVar1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")"))) (; ";")) (} "}")))) (} "}"))) (return_statement "return;" (return "return") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */
/* WARNING: Unknown calling convention */

void function_1(uint8_t *var_3,int peri_type,int var_2,char *var_1)

{
  type_1 service_action;
  
  if ((var_1 != (char *)0x0) && (0 < var_2)) {
    if (var_2 == 1) {
      *var_1 = '\0';
      return;
    }
    if (var_3 == (uint8_t *)0x0) {
      var_4(var_1,var_2,"%s","<null> command pointer");
    }
    else {
      if (*var_3 == '\x7f') {
        service_action = (type_1)(type_2)(*(type_2 *)(var_3 + 8) << 8 | *(type_2 *)(var_3 + 8) >> 8);
      }
      else {
        service_action = var_3[1] & 0x1f;
      }
      var_5(*var_3,service_action,peri_type,var_2,var_1);
    }
  }
  return;
}


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

/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

void MASKED(char *param_1,undefined4 param_2,int param_3,undefined1 *param_4)

{
  ushort uVar1;
  
  if ((param_4 != (undefined1 *)0x0) && (0 < param_3)) {
    if (param_3 == 1) {
      *param_4 = 0;
      return;
    }
    if (param_1 == (char *)0x0) {
      sg_scnpr(param_4,param_3,"%s","<null> command pointer");
    }
    else {
      if (*param_1 == '\x7f') {
        uVar1 = *(ushort *)(param_1 + 8) << 8 | *(ushort *)(param_1 + 8) >> 8;
      }
      else {
        uVar1 = (byte)param_1[1] & 0x1f;
      }
      sg_get_opcode_sa_name(*param_1,uVar1,param_2,param_3,param_4);
    }
  }
  return;
}

