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

int sg_ll_inquiry_v2(int sg_fd,_Bool evpd,int pg_op,void *resp,int mx_resp_len,int timeout_secs,
                    int *residp,_Bool noisy,int verbose)

{
  sg_pt_base *ptvp;
  int iVar1;
  
  ptvp = construct_scsi_pt_obj_with_fd(sg_fd,verbose);
  if (ptvp != (sg_pt_base *)0x0) {
    iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,
                              verbose);
    destruct_scsi_pt_obj(ptvp);
    return iVar1;
  }
  iVar1 = sg_convert_errno(0xc);
  return iVar1;
}



undefined4 __regparm2
sg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                undefined1 param_9,undefined4 param_10)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 unaff_retaddr;
  
  entry(param_2,0x203b9);
  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);
  if (iVar1 != 0) {
    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);
    destruct_scsi_pt_obj(iVar1);
    return uVar2;
  }
  uVar2 = sg_convert_errno(0xc);
  return uVar2;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00017820
ADD EBX,0x289cf
SUB ESP,0x14
MOV EDI,dword ptr [ESP + 0x2c]
MOV EBP,dword ptr [ESP + 0x44]
PUSH dword ptr [ESP + 0x48]
PUSH dword ptr [ESP + 0x2c]
CALL 0x00017540
ADD ESP,0x10
TEST EAX,EAX
JZ 0x00020430
MOV ESI,EAX
MOV EAX,EDI
SUB ESP,0x4
XOR EDX,EDX
MOVZX ECX,AL
MOV EAX,EBP
PUSH dword ptr [ESP + 0x44]
MOVZX EBP,AL
MOV EAX,ESI
PUSH EBP
PUSH dword ptr [ESP + 0x44]
PUSH dword ptr [ESP + 0x44]
PUSH dword ptr [ESP + 0x44]
PUSH dword ptr [ESP + 0x44]
PUSH dword ptr [ESP + 0x44]
CALL 0x0001fb30
ADD ESP,0x14
PUSH ESI
MOV EDI,EAX
CALL 0x00017490
ADD ESP,0x10
MOV EAX,EDI
ADD ESP,0xc
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0xc
PUSH 0xc
CALL 0x00017560
ADD ESP,0x10
ADD ESP,0xc
MOV EDI,EAX
POP EBX
MOV EAX,EDI
POP ESI
POP EDI
POP EBP
RET
(translation_unit "undefined4 __regparm2\nsg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}\n\n" (function_definition "undefined4 __regparm2\nsg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}" type_identifier (ERROR "__regparm2" identifier) (function_declarator "sg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) , (parameter_declaration "undefined4 param_6" type_identifier identifier) , (parameter_declaration "undefined4 param_7" type_identifier identifier) , (parameter_declaration "undefined4 param_8" type_identifier identifier) , (parameter_declaration "undefined1 param_9" type_identifier identifier) , (parameter_declaration "undefined4 param_10" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "undefined4 unaff_retaddr;" type_identifier identifier ;) (expression_statement "entry(param_2,0x203b9);" (call_expression "entry(param_2,0x203b9)" identifier (argument_list "(param_2,0x203b9)" ( identifier , number_literal ))) ;) (expression_statement "iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);" (assignment_expression "iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10)" identifier = (call_expression "construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10)" identifier (argument_list "(unaff_retaddr,param_10)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }" { (expression_statement "uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);" (assignment_expression "uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" identifier = (call_expression "FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" identifier (argument_list "(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" ( identifier , identifier , identifier , identifier , identifier , identifier , identifier )))) ;) (expression_statement "destruct_scsi_pt_obj(iVar1);" (call_expression "destruct_scsi_pt_obj(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) (return_statement "return uVar2;" return identifier ;) })) (expression_statement "uVar2 = sg_convert_errno(0xc);" (assignment_expression "uVar2 = sg_convert_errno(0xc)" identifier = (call_expression "sg_convert_errno(0xc)" identifier (argument_list "(0xc)" ( number_literal )))) ;) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint sg_ll_inquiry_v2(int sg_fd,_Bool evpd,int pg_op,void *resp,int mx_resp_len,int timeout_secs,\n                    int *residp,_Bool noisy,int verbose)\n\n{\n  sg_pt_base *ptvp;\n  int iVar1;\n  \n  ptvp = construct_scsi_pt_obj_with_fd(sg_fd,verbose);\n  if (ptvp != (sg_pt_base *)0x0) {\n    iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose);\n    destruct_scsi_pt_obj(ptvp);\n    return iVar1;\n  }\n  iVar1 = sg_convert_errno(0xc);\n  return iVar1;\n}\n\n" comment comment (function_definition "int sg_ll_inquiry_v2(int sg_fd,_Bool evpd,int pg_op,void *resp,int mx_resp_len,int timeout_secs,\n                    int *residp,_Bool noisy,int verbose)\n\n{\n  sg_pt_base *ptvp;\n  int iVar1;\n  \n  ptvp = construct_scsi_pt_obj_with_fd(sg_fd,verbose);\n  if (ptvp != (sg_pt_base *)0x0) {\n    iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose);\n    destruct_scsi_pt_obj(ptvp);\n    return iVar1;\n  }\n  iVar1 = sg_convert_errno(0xc);\n  return iVar1;\n}" primitive_type (function_declarator "sg_ll_inquiry_v2(int sg_fd,_Bool evpd,int pg_op,void *resp,int mx_resp_len,int timeout_secs,\n                    int *residp,_Bool noisy,int verbose)" identifier (parameter_list "(int sg_fd,_Bool evpd,int pg_op,void *resp,int mx_resp_len,int timeout_secs,\n                    int *residp,_Bool noisy,int verbose)" ( (parameter_declaration "int sg_fd" primitive_type identifier) , (parameter_declaration "_Bool evpd" type_identifier identifier) , (parameter_declaration "int pg_op" primitive_type identifier) , (parameter_declaration "void *resp" primitive_type (pointer_declarator "*resp" * identifier)) , (parameter_declaration "int mx_resp_len" primitive_type identifier) , (parameter_declaration "int timeout_secs" primitive_type identifier) , (parameter_declaration "int *residp" primitive_type (pointer_declarator "*residp" * identifier)) , (parameter_declaration "_Bool noisy" type_identifier identifier) , (parameter_declaration "int verbose" primitive_type identifier) ))) (compound_statement "{\n  sg_pt_base *ptvp;\n  int iVar1;\n  \n  ptvp = construct_scsi_pt_obj_with_fd(sg_fd,verbose);\n  if (ptvp != (sg_pt_base *)0x0) {\n    iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose);\n    destruct_scsi_pt_obj(ptvp);\n    return iVar1;\n  }\n  iVar1 = sg_convert_errno(0xc);\n  return iVar1;\n}" { (declaration "sg_pt_base *ptvp;" type_identifier (pointer_declarator "*ptvp" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (expression_statement "ptvp = construct_scsi_pt_obj_with_fd(sg_fd,verbose);" (assignment_expression "ptvp = construct_scsi_pt_obj_with_fd(sg_fd,verbose)" identifier = (call_expression "construct_scsi_pt_obj_with_fd(sg_fd,verbose)" identifier (argument_list "(sg_fd,verbose)" ( identifier , identifier )))) ;) (if_statement "if (ptvp != (sg_pt_base *)0x0) {\n    iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose);\n    destruct_scsi_pt_obj(ptvp);\n    return iVar1;\n  }" if (parenthesized_expression "(ptvp != (sg_pt_base *)0x0)" ( (binary_expression "ptvp != (sg_pt_base *)0x0" identifier != (cast_expression "(sg_pt_base *)0x0" ( (type_descriptor "sg_pt_base *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose);\n    destruct_scsi_pt_obj(ptvp);\n    return iVar1;\n  }" { (expression_statement "iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose);" (assignment_expression "iVar1 = sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose)" identifier = (call_expression "sg_ll_inquiry_com(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose)" identifier (argument_list "(ptvp,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,\n                              verbose)" ( identifier , false , identifier , identifier , identifier , identifier , identifier , identifier , identifier , identifier )))) ;) (expression_statement "destruct_scsi_pt_obj(ptvp);" (call_expression "destruct_scsi_pt_obj(ptvp)" identifier (argument_list "(ptvp)" ( identifier ))) ;) (return_statement "return iVar1;" return identifier ;) })) (expression_statement "iVar1 = sg_convert_errno(0xc);" (assignment_expression "iVar1 = sg_convert_errno(0xc)" identifier = (call_expression "sg_convert_errno(0xc)" identifier (argument_list "(0xc)" ( number_literal )))) ;) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4 __regparm2\nsg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}\n\n" (function_definition "undefined4 __regparm2\nsg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}" type_identifier (ERROR "__regparm2" identifier) (function_declarator "sg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined4 param_3" type_identifier identifier) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) , (parameter_declaration "undefined4 param_6" type_identifier identifier) , (parameter_declaration "undefined4 param_7" type_identifier identifier) , (parameter_declaration "undefined4 param_8" type_identifier identifier) , (parameter_declaration "undefined1 param_9" type_identifier identifier) , (parameter_declaration "undefined4 param_10" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined4 uVar2;" type_identifier identifier ;) (declaration "undefined4 unaff_retaddr;" type_identifier identifier ;) (expression_statement "entry(param_2,0x203b9);" (call_expression "entry(param_2,0x203b9)" identifier (argument_list "(param_2,0x203b9)" ( identifier , number_literal ))) ;) (expression_statement "iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);" (assignment_expression "iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10)" identifier = (call_expression "construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10)" identifier (argument_list "(unaff_retaddr,param_10)" ( identifier , identifier )))) ;) (if_statement "if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }" if (parenthesized_expression "(iVar1 != 0)" ( (binary_expression "iVar1 != 0" identifier != number_literal) )) (compound_statement "{\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }" { (expression_statement "uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);" (assignment_expression "uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" identifier = (call_expression "FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" identifier (argument_list "(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" ( identifier , identifier , identifier , identifier , identifier , identifier , identifier )))) ;) (expression_statement "destruct_scsi_pt_obj(iVar1);" (call_expression "destruct_scsi_pt_obj(iVar1)" identifier (argument_list "(iVar1)" ( identifier ))) ;) (return_statement "return uVar2;" return identifier ;) })) (expression_statement "uVar2 = sg_convert_errno(0xc);" (assignment_expression "uVar2 = sg_convert_errno(0xc)" identifier = (call_expression "sg_convert_errno(0xc)" identifier (argument_list "(0xc)" ( number_literal )))) ;) (return_statement "return uVar2;" return identifier ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT , IDENT , IDENT , IDENT )))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return IDENT ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (return_statement return IDENT ;) })))
(function_definition "undefined4 __regparm2\nsg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)\n\n{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}" (type_identifier "undefined4") (ERROR "__regparm2" (identifier "__regparm2")) (function_declarator "sg_ll_inquiry_v2(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)" (identifier "sg_ll_inquiry_v2") (parameter_list "(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,\n                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,\n                undefined1 param_9,undefined4 param_10)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined4 param_3" (type_identifier "undefined4") (identifier "param_3")) (, ",") (parameter_declaration "undefined4 param_4" (type_identifier "undefined4") (identifier "param_4")) (, ",") (parameter_declaration "undefined4 param_5" (type_identifier "undefined4") (identifier "param_5")) (, ",") (parameter_declaration "undefined4 param_6" (type_identifier "undefined4") (identifier "param_6")) (, ",") (parameter_declaration "undefined4 param_7" (type_identifier "undefined4") (identifier "param_7")) (, ",") (parameter_declaration "undefined4 param_8" (type_identifier "undefined4") (identifier "param_8")) (, ",") (parameter_declaration "undefined1 param_9" (type_identifier "undefined1") (identifier "param_9")) (, ",") (parameter_declaration "undefined4 param_10" (type_identifier "undefined4") (identifier "param_10")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined4 uVar2;\n  undefined4 unaff_retaddr;\n  \n  entry(param_2,0x203b9);\n  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);\n  if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }\n  uVar2 = sg_convert_errno(0xc);\n  return uVar2;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined4 uVar2;" (type_identifier "undefined4") (identifier "uVar2") (; ";")) (declaration "undefined4 unaff_retaddr;" (type_identifier "undefined4") (identifier "unaff_retaddr") (; ";")) (expression_statement "entry(param_2,0x203b9);" (call_expression "entry(param_2,0x203b9)" (identifier "entry") (argument_list "(param_2,0x203b9)" (( "(") (identifier "param_2") (, ",") (number_literal "0x203b9") () ")"))) (; ";")) (expression_statement "iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);" (assignment_expression "iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10)" (identifier "iVar1") (= "=") (call_expression "construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10)" (identifier "construct_scsi_pt_obj_with_fd") (argument_list "(unaff_retaddr,param_10)" (( "(") (identifier "unaff_retaddr") (, ",") (identifier "param_10") () ")")))) (; ";")) (if_statement "if (iVar1 != 0) {\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }" (if "if") (parenthesized_expression "(iVar1 != 0)" (( "(") (binary_expression "iVar1 != 0" (identifier "iVar1") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);\n    destruct_scsi_pt_obj(iVar1);\n    return uVar2;\n  }" ({ "{") (expression_statement "uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);" (assignment_expression "uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" (identifier "uVar2") (= "=") (call_expression "FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" (identifier "FUN_0001fb30") (argument_list "(param_4,param_5,param_6,param_7,param_8,param_9,param_10)" (( "(") (identifier "param_4") (, ",") (identifier "param_5") (, ",") (identifier "param_6") (, ",") (identifier "param_7") (, ",") (identifier "param_8") (, ",") (identifier "param_9") (, ",") (identifier "param_10") () ")")))) (; ";")) (expression_statement "destruct_scsi_pt_obj(iVar1);" (call_expression "destruct_scsi_pt_obj(iVar1)" (identifier "destruct_scsi_pt_obj") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")"))) (; ";")) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}"))) (expression_statement "uVar2 = sg_convert_errno(0xc);" (assignment_expression "uVar2 = sg_convert_errno(0xc)" (identifier "uVar2") (= "=") (call_expression "sg_convert_errno(0xc)" (identifier "sg_convert_errno") (argument_list "(0xc)" (( "(") (number_literal "0xc") () ")")))) (; ";")) (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))

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

int function_1(int sg_fd,type_1 evpd,int pg_op,void *resp,int mx_resp_len,int timeout_secs,
                    int *residp,type_1 noisy,int verbose)

{
  type_2 *var_2;
  int iVar1;
  
  var_2 = var_1(sg_fd,verbose);
  if (var_2 != (type_2 *)0x0) {
    iVar1 = var_3(var_2,false,evpd,pg_op,resp,mx_resp_len,timeout_secs,residp,noisy,
                              verbose);
    var_4(var_2);
    return iVar1;
  }
  iVar1 = var_5(0xc);
  return iVar1;
}


(translation_unit (function_definition type: (type_identifier) (ERROR (identifier)) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier) (identifier) (identifier) (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal))))) (return_statement (identifier)))))

undefined4 __regparm2
MASKED(undefined4 param_1,undefined4 param_2,undefined4 param_3,undefined4 param_4,
                undefined4 param_5,undefined4 param_6,undefined4 param_7,undefined4 param_8,
                undefined1 param_9,undefined4 param_10)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 unaff_retaddr;
  
  entry(param_2,0x203b9);
  iVar1 = construct_scsi_pt_obj_with_fd(unaff_retaddr,param_10);
  if (iVar1 != 0) {
    uVar2 = FUN_0001fb30(param_4,param_5,param_6,param_7,param_8,param_9,param_10);
    destruct_scsi_pt_obj(iVar1);
    return uVar2;
  }
  uVar2 = sg_convert_errno(0xc);
  return uVar2;
}

