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

int __regparm3
decode_sks(char *lip,uint8_t *descp,int add_d_len,int sense_key,_Bool *processedp,int blen,char *b)

{
  char *fmt;
  int iVar1;
  char *pcVar2;
  uint uVar3;
  int iVar4;
  ushort uVar5;
  
  if (lip == (char *)0x0) {
    lip = "";
  }
  switch(sense_key) {
  case 0:
  case 2:
    iVar4 = sg_scnpr(b,blen,"Progress indication: ");
    if (add_d_len < 6) break;
    uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;
    lip = (char *)((int)uVar3 >> 0x10);
    pcVar2 = "%d.%02d%%\n";
    uVar3 = (uVar3 & 0xffff) / 0x290;
    goto LAB_00017c06;
  case 1:
  case 3:
  case 4:
    iVar4 = sg_scnpr(b,blen,"Actual retry count: ");
    if (5 < add_d_len) {
      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",
                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));
      return iVar1 + iVar4;
    }
    break;
  case 5:
    if (5 < add_d_len) {
      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");
      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;
      pcVar2 = "Command";
      if ((descp[4] & 0x40) == 0) {
        pcVar2 = "Data parameters";
      }
      fmt = "%s        Error in %s: byte %d";
LAB_00017b57:
      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);
      iVar4 = iVar4 + iVar1;
      if ((descp[4] & 8) == 0) {
        pcVar2 = "\n";
      }
      else {
        pcVar2 = " bit %d\n";
      }
      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);
      return iVar1 + iVar4;
    }
    iVar4 = sg_scnpr(b,blen,"Field pointer: ");
    break;
  case 6:
    iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");
    uVar3 = descp[4] & 1;
    pcVar2 = "%s        overflow flag is %d\n";
LAB_00017c06:
    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);
    return iVar1 + iVar4;
  default:
    iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);
    *processedp = false;
    return iVar4;
  case 10:
    iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");
    if (5 < add_d_len) {
      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;
      pcVar2 = "segment descriptor";
      if ((descp[4] & 0x20) == 0) {
        pcVar2 = "parameter list";
      }
      fmt = "%s        Relative to start of %s, byte %d";
      goto LAB_00017b57;
    }
  }
  iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short");
  *processedp = false;
  return iVar1 + iVar4;
}



void __regparm2
FUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,
            undefined4 param_5)

{
  int unaff_EBX;
  uint unaff_retaddr;
  
  entry(param_2,0x17acd);
  if (unaff_retaddr < 0xb) {
                    /* WARNING: Could not recover jumptable at 0x00017af7. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +
              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();
    return;
  }
  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);
  *param_3 = 0;
  return;
}


PUSH EBP
MOV EBP,EDX
PUSH EDI
MOV EDI,EAX
PUSH ESI
PUSH EBX
CALL 0x00017820
ADD EBX,0x312bb
SUB ESP,0x1c
TEST EDI,EDI
MOV EAX,dword ptr [ESP + 0x30]
LEA EDX,[EBX + 0xfffe7c4d]
CMOVZ EDI,EDX
CMP EAX,0xa
JA 0x00017d10
MOV EDX,dword ptr [EBX + EAX*0x4 + 0xfffe92b8]
ADD EDX,EBX
JMP EDX
PUSH EAX
LEA EAX,[EBX + 0xfffe730c]
PUSH EAX
PUSH dword ptr [ESP + 0x40]
PUSH dword ptr [ESP + 0x48]
CALL 0x000175e0
MOV EDI,dword ptr [ESP + 0x44]
ADD ESP,0x10
MOV byte ptr [EDI],0x0
ADD ESP,0x1c
POP EBX
POP ESI
POP EDI
POP EBP
RET
(translation_unit "void __regparm2\nFUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)\n\n{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    /* WARNING: Could not recover jumptable at 0x00017af7. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}\n\n" (function_definition "void __regparm2\nFUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)\n\n{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    /* WARNING: Could not recover jumptable at 0x00017af7. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined1 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) ))) (compound_statement "{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    /* WARNING: Could not recover jumptable at 0x00017af7. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}" { (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "uint unaff_retaddr;" type_identifier identifier ;) (expression_statement "entry(param_2,0x17acd);" (call_expression "entry(param_2,0x17acd)" identifier (argument_list "(param_2,0x17acd)" ( identifier , number_literal ))) ;) (if_statement "if (unaff_retaddr < 0xb) {\n                    /* WARNING: Could not recover jumptable at 0x00017af7. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }" if (parenthesized_expression "(unaff_retaddr < 0xb)" ( (binary_expression "unaff_retaddr < 0xb" identifier < number_literal) )) (compound_statement "{\n                    /* WARNING: Could not recover jumptable at 0x00017af7. Too many branches */\n                    /* WARNING: Treating indirect jump as call */\n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }" { comment comment (expression_statement "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();" (call_expression "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))()" (parenthesized_expression "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))" ( (pointer_expression "*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" * (cast_expression "(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" ( (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7" (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX" (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" (string_literal ""%s      Vendor Specific Extension Identifier: 0x%llx\n"" " string_content escape_sequence ") + (pointer_expression "*(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" * (cast_expression "(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" ( (binary_expression "&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX" (binary_expression "&UNK_0001a573 + unaff_retaddr * 4" (pointer_expression "&UNK_0001a573" & identifier) + (binary_expression "unaff_retaddr * 4" identifier * number_literal)) + identifier) ))))) + identifier) + number_literal) )))) )) (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) (expression_statement "sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);" (call_expression "sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr)" identifier (argument_list "(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr)" ( identifier , identifier , (binary_expression "unaff_EBX + 0x185c7" identifier + number_literal) , identifier ))) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint __regparm3\ndecode_sks(char *lip,uint8_t *descp,int add_d_len,int sense_key,_Bool *processedp,int blen,char *b)\n\n{\n  char *fmt;\n  int iVar1;\n  char *pcVar2;\n  uint uVar3;\n  int iVar4;\n  ushort uVar5;\n  \n  if (lip == (char *)0x0) {\n    lip = "";\n  }\n  switch(sense_key) {\n  case 0:\n  case 2:\n    iVar4 = sg_scnpr(b,blen,"Progress indication: ");\n    if (add_d_len < 6) break;\n    uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;\n    lip = (char *)((int)uVar3 >> 0x10);\n    pcVar2 = "%d.%02d%%\n";\n    uVar3 = (uVar3 & 0xffff) / 0x290;\n    goto LAB_00017c06;\n  case 1:\n  case 3:\n  case 4:\n    iVar4 = sg_scnpr(b,blen,"Actual retry count: ");\n    if (5 < add_d_len) {\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }\n    break;\n  case 5:\n    if (5 < add_d_len) {\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }\n    iVar4 = sg_scnpr(b,blen,"Field pointer: ");\n    break;\n  case 6:\n    iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");\n    uVar3 = descp[4] & 1;\n    pcVar2 = "%s        overflow flag is %d\n";\nLAB_00017c06:\n    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);\n    return iVar1 + iVar4;\n  default:\n    iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);\n    *processedp = false;\n    return iVar4;\n  case 10:\n    iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");\n    if (5 < add_d_len) {\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }\n  }\n  iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short");\n  *processedp = false;\n  return iVar1 + iVar4;\n}\n\n" comment (function_definition "int __regparm3\ndecode_sks(char *lip,uint8_t *descp,int add_d_len,int sense_key,_Bool *processedp,int blen,char *b)\n\n{\n  char *fmt;\n  int iVar1;\n  char *pcVar2;\n  uint uVar3;\n  int iVar4;\n  ushort uVar5;\n  \n  if (lip == (char *)0x0) {\n    lip = "";\n  }\n  switch(sense_key) {\n  case 0:\n  case 2:\n    iVar4 = sg_scnpr(b,blen,"Progress indication: ");\n    if (add_d_len < 6) break;\n    uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;\n    lip = (char *)((int)uVar3 >> 0x10);\n    pcVar2 = "%d.%02d%%\n";\n    uVar3 = (uVar3 & 0xffff) / 0x290;\n    goto LAB_00017c06;\n  case 1:\n  case 3:\n  case 4:\n    iVar4 = sg_scnpr(b,blen,"Actual retry count: ");\n    if (5 < add_d_len) {\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }\n    break;\n  case 5:\n    if (5 < add_d_len) {\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }\n    iVar4 = sg_scnpr(b,blen,"Field pointer: ");\n    break;\n  case 6:\n    iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");\n    uVar3 = descp[4] & 1;\n    pcVar2 = "%s        overflow flag is %d\n";\nLAB_00017c06:\n    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);\n    return iVar1 + iVar4;\n  default:\n    iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);\n    *processedp = false;\n    return iVar4;\n  case 10:\n    iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");\n    if (5 < add_d_len) {\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }\n  }\n  iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short");\n  *processedp = false;\n  return iVar1 + iVar4;\n}" primitive_type (ERROR "__regparm3" identifier) (function_declarator "decode_sks(char *lip,uint8_t *descp,int add_d_len,int sense_key,_Bool *processedp,int blen,char *b)" identifier (parameter_list "(char *lip,uint8_t *descp,int add_d_len,int sense_key,_Bool *processedp,int blen,char *b)" ( (parameter_declaration "char *lip" primitive_type (pointer_declarator "*lip" * identifier)) , (parameter_declaration "uint8_t *descp" primitive_type (pointer_declarator "*descp" * identifier)) , (parameter_declaration "int add_d_len" primitive_type identifier) , (parameter_declaration "int sense_key" primitive_type identifier) , (parameter_declaration "_Bool *processedp" type_identifier (pointer_declarator "*processedp" * identifier)) , (parameter_declaration "int blen" primitive_type identifier) , (parameter_declaration "char *b" primitive_type (pointer_declarator "*b" * identifier)) ))) (compound_statement "{\n  char *fmt;\n  int iVar1;\n  char *pcVar2;\n  uint uVar3;\n  int iVar4;\n  ushort uVar5;\n  \n  if (lip == (char *)0x0) {\n    lip = "";\n  }\n  switch(sense_key) {\n  case 0:\n  case 2:\n    iVar4 = sg_scnpr(b,blen,"Progress indication: ");\n    if (add_d_len < 6) break;\n    uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;\n    lip = (char *)((int)uVar3 >> 0x10);\n    pcVar2 = "%d.%02d%%\n";\n    uVar3 = (uVar3 & 0xffff) / 0x290;\n    goto LAB_00017c06;\n  case 1:\n  case 3:\n  case 4:\n    iVar4 = sg_scnpr(b,blen,"Actual retry count: ");\n    if (5 < add_d_len) {\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }\n    break;\n  case 5:\n    if (5 < add_d_len) {\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }\n    iVar4 = sg_scnpr(b,blen,"Field pointer: ");\n    break;\n  case 6:\n    iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");\n    uVar3 = descp[4] & 1;\n    pcVar2 = "%s        overflow flag is %d\n";\nLAB_00017c06:\n    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);\n    return iVar1 + iVar4;\n  default:\n    iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);\n    *processedp = false;\n    return iVar4;\n  case 10:\n    iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");\n    if (5 < add_d_len) {\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }\n  }\n  iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short");\n  *processedp = false;\n  return iVar1 + iVar4;\n}" { (declaration "char *fmt;" primitive_type (pointer_declarator "*fmt" * identifier) ;) (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "uint uVar3;" type_identifier identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "ushort uVar5;" type_identifier identifier ;) (if_statement "if (lip == (char *)0x0) {\n    lip = "";\n  }" if (parenthesized_expression "(lip == (char *)0x0)" ( (binary_expression "lip == (char *)0x0" identifier == (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    lip = "";\n  }" { (expression_statement "lip = "";" (assignment_expression "lip = """ identifier = (string_literal """" " ")) ;) })) (switch_statement "switch(sense_key) {\n  case 0:\n  case 2:\n    iVar4 = sg_scnpr(b,blen,"Progress indication: ");\n    if (add_d_len < 6) break;\n    uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;\n    lip = (char *)((int)uVar3 >> 0x10);\n    pcVar2 = "%d.%02d%%\n";\n    uVar3 = (uVar3 & 0xffff) / 0x290;\n    goto LAB_00017c06;\n  case 1:\n  case 3:\n  case 4:\n    iVar4 = sg_scnpr(b,blen,"Actual retry count: ");\n    if (5 < add_d_len) {\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }\n    break;\n  case 5:\n    if (5 < add_d_len) {\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }\n    iVar4 = sg_scnpr(b,blen,"Field pointer: ");\n    break;\n  case 6:\n    iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");\n    uVar3 = descp[4] & 1;\n    pcVar2 = "%s        overflow flag is %d\n";\nLAB_00017c06:\n    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);\n    return iVar1 + iVar4;\n  default:\n    iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);\n    *processedp = false;\n    return iVar4;\n  case 10:\n    iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");\n    if (5 < add_d_len) {\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }\n  }" switch (parenthesized_expression "(sense_key)" ( identifier )) (compound_statement "{\n  case 0:\n  case 2:\n    iVar4 = sg_scnpr(b,blen,"Progress indication: ");\n    if (add_d_len < 6) break;\n    uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;\n    lip = (char *)((int)uVar3 >> 0x10);\n    pcVar2 = "%d.%02d%%\n";\n    uVar3 = (uVar3 & 0xffff) / 0x290;\n    goto LAB_00017c06;\n  case 1:\n  case 3:\n  case 4:\n    iVar4 = sg_scnpr(b,blen,"Actual retry count: ");\n    if (5 < add_d_len) {\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }\n    break;\n  case 5:\n    if (5 < add_d_len) {\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }\n    iVar4 = sg_scnpr(b,blen,"Field pointer: ");\n    break;\n  case 6:\n    iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");\n    uVar3 = descp[4] & 1;\n    pcVar2 = "%s        overflow flag is %d\n";\nLAB_00017c06:\n    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);\n    return iVar1 + iVar4;\n  default:\n    iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);\n    *processedp = false;\n    return iVar4;\n  case 10:\n    iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");\n    if (5 < add_d_len) {\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }\n  }" { (case_statement "case 0:" case number_literal :) (case_statement "case 2:\n    iVar4 = sg_scnpr(b,blen,"Progress indication: ");\n    if (add_d_len < 6) break;\n    uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;\n    lip = (char *)((int)uVar3 >> 0x10);\n    pcVar2 = "%d.%02d%%\n";\n    uVar3 = (uVar3 & 0xffff) / 0x290;\n    goto LAB_00017c06;" case number_literal : (expression_statement "iVar4 = sg_scnpr(b,blen,"Progress indication: ");" (assignment_expression "iVar4 = sg_scnpr(b,blen,"Progress indication: ")" identifier = (call_expression "sg_scnpr(b,blen,"Progress indication: ")" identifier (argument_list "(b,blen,"Progress indication: ")" ( identifier , identifier , (string_literal ""Progress indication: "" " string_content ") )))) ;) (if_statement "if (add_d_len < 6) break;" if (parenthesized_expression "(add_d_len < 6)" ( (binary_expression "add_d_len < 6" identifier < number_literal) )) (break_statement "break;" break ;)) (expression_statement "uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100;" (assignment_expression "uVar3 = (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100" identifier = (binary_expression "(uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8) * 100" (call_expression "(uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8)" (call_expression "(uint)(ushort)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(ushort)" ( identifier ))) (argument_list "(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8)" ( (binary_expression "*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8" (binary_expression "*(ushort *)(descp + 5) << 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) << number_literal) | (binary_expression "*(ushort *)(descp + 5) >> 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) >> number_literal)) ))) * number_literal)) ;) (expression_statement "lip = (char *)((int)uVar3 >> 0x10);" (assignment_expression "lip = (char *)((int)uVar3 >> 0x10)" identifier = (cast_expression "(char *)((int)uVar3 >> 0x10)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)uVar3 >> 0x10)" ( (binary_expression "(int)uVar3 >> 0x10" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) >> number_literal) )))) ;) (expression_statement "pcVar2 = "%d.%02d%%\n";" (assignment_expression "pcVar2 = "%d.%02d%%\n"" identifier = (string_literal ""%d.%02d%%\n"" " string_content escape_sequence ")) ;) (expression_statement "uVar3 = (uVar3 & 0xffff) / 0x290;" (assignment_expression "uVar3 = (uVar3 & 0xffff) / 0x290" identifier = (binary_expression "(uVar3 & 0xffff) / 0x290" (parenthesized_expression "(uVar3 & 0xffff)" ( (binary_expression "uVar3 & 0xffff" identifier & number_literal) )) / number_literal)) ;) (goto_statement "goto LAB_00017c06;" goto statement_identifier ;)) (case_statement "case 1:" case number_literal :) (case_statement "case 3:" case number_literal :) (case_statement "case 4:\n    iVar4 = sg_scnpr(b,blen,"Actual retry count: ");\n    if (5 < add_d_len) {\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }\n    break;" case number_literal : (expression_statement "iVar4 = sg_scnpr(b,blen,"Actual retry count: ");" (assignment_expression "iVar4 = sg_scnpr(b,blen,"Actual retry count: ")" identifier = (call_expression "sg_scnpr(b,blen,"Actual retry count: ")" identifier (argument_list "(b,blen,"Actual retry count: ")" ( identifier , identifier , (string_literal ""Actual retry count: "" " string_content ") )))) ;) (if_statement "if (5 < add_d_len) {\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }" if (parenthesized_expression "(5 < add_d_len)" ( (binary_expression "5 < add_d_len" number_literal < identifier) )) (compound_statement "{\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));\n      return iVar1 + iVar4;\n    }" { (expression_statement "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8));" (assignment_expression "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8))" identifier = (call_expression "sg_scnpr(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8))" identifier (argument_list "(b + iVar4,blen - iVar4,"%u\n",\n                       (uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8))" ( (binary_expression "b + iVar4" identifier + identifier) , (binary_expression "blen - iVar4" identifier - identifier) , (string_literal ""%u\n"" " string_content escape_sequence ") , (call_expression "(uint)(ushort)(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8)" (call_expression "(uint)(ushort)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(ushort)" ( identifier ))) (argument_list "(*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8)" ( (binary_expression "*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8" (binary_expression "*(ushort *)(descp + 5) << 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) << number_literal) | (binary_expression "*(ushort *)(descp + 5) >> 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) >> number_literal)) ))) )))) ;) (return_statement "return iVar1 + iVar4;" return (binary_expression "iVar1 + iVar4" identifier + identifier) ;) })) (break_statement "break;" break ;)) (case_statement "case 5:\n    if (5 < add_d_len) {\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }\n    iVar4 = sg_scnpr(b,blen,"Field pointer: ");\n    break;" case number_literal : (if_statement "if (5 < add_d_len) {\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }" if (parenthesized_expression "(5 < add_d_len)" ( (binary_expression "5 < add_d_len" number_literal < identifier) )) (compound_statement "{\n      iVar4 = sg_scnpr(b,blen,"Field pointer:\n");\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "Command";\n      if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }\n      fmt = "%s        Error in %s: byte %d";\nLAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);\n      iVar4 = iVar4 + iVar1;\n      if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);\n      return iVar1 + iVar4;\n    }" { (expression_statement "iVar4 = sg_scnpr(b,blen,"Field pointer:\n");" (assignment_expression "iVar4 = sg_scnpr(b,blen,"Field pointer:\n")" identifier = (call_expression "sg_scnpr(b,blen,"Field pointer:\n")" identifier (argument_list "(b,blen,"Field pointer:\n")" ( identifier , identifier , (string_literal ""Field pointer:\n"" " string_content escape_sequence ") )))) ;) (expression_statement "uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;" (assignment_expression "uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8" identifier = (binary_expression "*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8" (binary_expression "*(ushort *)(descp + 5) << 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) << number_literal) | (binary_expression "*(ushort *)(descp + 5) >> 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) >> number_literal))) ;) (expression_statement "pcVar2 = "Command";" (assignment_expression "pcVar2 = "Command"" identifier = (string_literal ""Command"" " string_content ")) ;) (if_statement "if ((descp[4] & 0x40) == 0) {\n        pcVar2 = "Data parameters";\n      }" if (parenthesized_expression "((descp[4] & 0x40) == 0)" ( (binary_expression "(descp[4] & 0x40) == 0" (parenthesized_expression "(descp[4] & 0x40)" ( (binary_expression "descp[4] & 0x40" (subscript_expression "descp[4]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n        pcVar2 = "Data parameters";\n      }" { (expression_statement "pcVar2 = "Data parameters";" (assignment_expression "pcVar2 = "Data parameters"" identifier = (string_literal ""Data parameters"" " string_content ")) ;) })) (expression_statement "fmt = "%s        Error in %s: byte %d";" (assignment_expression "fmt = "%s        Error in %s: byte %d"" identifier = (string_literal ""%s        Error in %s: byte %d"" " string_content ")) ;) (labeled_statement "LAB_00017b57:\n      iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);" statement_identifier : (expression_statement "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5);" (assignment_expression "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5)" identifier = (call_expression "sg_scnpr(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5)" identifier (argument_list "(b + iVar4,blen - iVar4,fmt,lip,pcVar2,(uint)uVar5)" ( (binary_expression "b + iVar4" identifier + identifier) , (binary_expression "blen - iVar4" identifier - identifier) , identifier , identifier , identifier , (cast_expression "(uint)uVar5" ( (type_descriptor "uint" type_identifier) ) identifier) )))) ;)) (expression_statement "iVar4 = iVar4 + iVar1;" (assignment_expression "iVar4 = iVar4 + iVar1" identifier = (binary_expression "iVar4 + iVar1" identifier + identifier)) ;) (if_statement "if ((descp[4] & 8) == 0) {\n        pcVar2 = "\n";\n      }\n      else {\n        pcVar2 = " bit %d\n";\n      }" if (parenthesized_expression "((descp[4] & 8) == 0)" ( (binary_expression "(descp[4] & 8) == 0" (parenthesized_expression "(descp[4] & 8)" ( (binary_expression "descp[4] & 8" (subscript_expression "descp[4]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n        pcVar2 = "\n";\n      }" { (expression_statement "pcVar2 = "\n";" (assignment_expression "pcVar2 = "\n"" identifier = (string_literal ""\n"" " escape_sequence ")) ;) }) (else_clause "else {\n        pcVar2 = " bit %d\n";\n      }" else (compound_statement "{\n        pcVar2 = " bit %d\n";\n      }" { (expression_statement "pcVar2 = " bit %d\n";" (assignment_expression "pcVar2 = " bit %d\n"" identifier = (string_literal "" bit %d\n"" " string_content escape_sequence ")) ;) }))) (expression_statement "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2);" (assignment_expression "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2)" identifier = (call_expression "sg_scnpr(b + iVar4,blen - iVar4,pcVar2)" identifier (argument_list "(b + iVar4,blen - iVar4,pcVar2)" ( (binary_expression "b + iVar4" identifier + identifier) , (binary_expression "blen - iVar4" identifier - identifier) , identifier )))) ;) (return_statement "return iVar1 + iVar4;" return (binary_expression "iVar1 + iVar4" identifier + identifier) ;) })) (expression_statement "iVar4 = sg_scnpr(b,blen,"Field pointer: ");" (assignment_expression "iVar4 = sg_scnpr(b,blen,"Field pointer: ")" identifier = (call_expression "sg_scnpr(b,blen,"Field pointer: ")" identifier (argument_list "(b,blen,"Field pointer: ")" ( identifier , identifier , (string_literal ""Field pointer: "" " string_content ") )))) ;) (break_statement "break;" break ;)) (case_statement "case 6:\n    iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");\n    uVar3 = descp[4] & 1;\n    pcVar2 = "%s        overflow flag is %d\n";\nLAB_00017c06:\n    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);\n    return iVar1 + iVar4;" case number_literal : (expression_statement "iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n");" (assignment_expression "iVar4 = sg_scnpr(b,blen,"Unit attention condition queue:\n")" identifier = (call_expression "sg_scnpr(b,blen,"Unit attention condition queue:\n")" identifier (argument_list "(b,blen,"Unit attention condition queue:\n")" ( identifier , identifier , (string_literal ""Unit attention condition queue:\n"" " string_content escape_sequence ") )))) ;) (expression_statement "uVar3 = descp[4] & 1;" (assignment_expression "uVar3 = descp[4] & 1" identifier = (binary_expression "descp[4] & 1" (subscript_expression "descp[4]" identifier [ number_literal ]) & number_literal)) ;) (expression_statement "pcVar2 = "%s        overflow flag is %d\n";" (assignment_expression "pcVar2 = "%s        overflow flag is %d\n"" identifier = (string_literal ""%s        overflow flag is %d\n"" " string_content escape_sequence ")) ;) (labeled_statement "LAB_00017c06:\n    iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);" statement_identifier : (expression_statement "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3);" (assignment_expression "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3)" identifier = (call_expression "sg_scnpr(b + iVar4,blen - iVar4,pcVar2,lip,uVar3)" identifier (argument_list "(b + iVar4,blen - iVar4,pcVar2,lip,uVar3)" ( (binary_expression "b + iVar4" identifier + identifier) , (binary_expression "blen - iVar4" identifier - identifier) , identifier , identifier , identifier )))) ;)) (return_statement "return iVar1 + iVar4;" return (binary_expression "iVar1 + iVar4" identifier + identifier) ;)) (case_statement "default:\n    iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);\n    *processedp = false;\n    return iVar4;" default : (expression_statement "iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key);" (assignment_expression "iVar4 = sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key)" identifier = (call_expression "sg_scnpr(b,blen,"Sense_key: 0x%x unexpected\n",sense_key)" identifier (argument_list "(b,blen,"Sense_key: 0x%x unexpected\n",sense_key)" ( identifier , identifier , (string_literal ""Sense_key: 0x%x unexpected\n"" " string_content escape_sequence ") , identifier )))) ;) (expression_statement "*processedp = false;" (assignment_expression "*processedp = false" (pointer_expression "*processedp" * identifier) = false) ;) (return_statement "return iVar4;" return identifier ;)) (case_statement "case 10:\n    iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");\n    if (5 < add_d_len) {\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }" case number_literal : (expression_statement "iVar4 = sg_scnpr(b,blen,"Segment pointer:\n");" (assignment_expression "iVar4 = sg_scnpr(b,blen,"Segment pointer:\n")" identifier = (call_expression "sg_scnpr(b,blen,"Segment pointer:\n")" identifier (argument_list "(b,blen,"Segment pointer:\n")" ( identifier , identifier , (string_literal ""Segment pointer:\n"" " string_content escape_sequence ") )))) ;) (if_statement "if (5 < add_d_len) {\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }" if (parenthesized_expression "(5 < add_d_len)" ( (binary_expression "5 < add_d_len" number_literal < identifier) )) (compound_statement "{\n      uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;\n      pcVar2 = "segment descriptor";\n      if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }\n      fmt = "%s        Relative to start of %s, byte %d";\n      goto LAB_00017b57;\n    }" { (expression_statement "uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8;" (assignment_expression "uVar5 = *(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8" identifier = (binary_expression "*(ushort *)(descp + 5) << 8 | *(ushort *)(descp + 5) >> 8" (binary_expression "*(ushort *)(descp + 5) << 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) << number_literal) | (binary_expression "*(ushort *)(descp + 5) >> 8" (pointer_expression "*(ushort *)(descp + 5)" * (cast_expression "(ushort *)(descp + 5)" ( (type_descriptor "ushort *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(descp + 5)" ( (binary_expression "descp + 5" identifier + number_literal) )))) >> number_literal))) ;) (expression_statement "pcVar2 = "segment descriptor";" (assignment_expression "pcVar2 = "segment descriptor"" identifier = (string_literal ""segment descriptor"" " string_content ")) ;) (if_statement "if ((descp[4] & 0x20) == 0) {\n        pcVar2 = "parameter list";\n      }" if (parenthesized_expression "((descp[4] & 0x20) == 0)" ( (binary_expression "(descp[4] & 0x20) == 0" (parenthesized_expression "(descp[4] & 0x20)" ( (binary_expression "descp[4] & 0x20" (subscript_expression "descp[4]" identifier [ number_literal ]) & number_literal) )) == number_literal) )) (compound_statement "{\n        pcVar2 = "parameter list";\n      }" { (expression_statement "pcVar2 = "parameter list";" (assignment_expression "pcVar2 = "parameter list"" identifier = (string_literal ""parameter list"" " string_content ")) ;) })) (expression_statement "fmt = "%s        Relative to start of %s, byte %d";" (assignment_expression "fmt = "%s        Relative to start of %s, byte %d"" identifier = (string_literal ""%s        Relative to start of %s, byte %d"" " string_content ")) ;) (goto_statement "goto LAB_00017b57;" goto statement_identifier ;) }))) })) (expression_statement "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short");" (assignment_expression "iVar1 = sg_scnpr(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short")" identifier = (call_expression "sg_scnpr(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short")" identifier (argument_list "(b + iVar4,blen - iVar4,"%s\n","   >> descriptor too short")" ( (binary_expression "b + iVar4" identifier + identifier) , (binary_expression "blen - iVar4" identifier - identifier) , (string_literal ""%s\n"" " string_content escape_sequence ") , (string_literal ""   >> descriptor too short"" " string_content ") )))) ;) (expression_statement "*processedp = false;" (assignment_expression "*processedp = false" (pointer_expression "*processedp" * identifier) = false) ;) (return_statement "return iVar1 + iVar4;" return (binary_expression "iVar1 + iVar4" identifier + identifier) ;) })))
(translation_unit "void __regparm2\nFUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)\n\n{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}\n\n" (function_definition "void __regparm2\nFUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)\n\n{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}" primitive_type (ERROR "__regparm2" identifier) (function_declarator "FUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)" identifier (parameter_list "(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)" ( (parameter_declaration "undefined4 param_1" type_identifier identifier) , (parameter_declaration "undefined4 param_2" type_identifier identifier) , (parameter_declaration "undefined1 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "undefined4 param_4" type_identifier identifier) , (parameter_declaration "undefined4 param_5" type_identifier identifier) ))) (compound_statement "{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}" { (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "uint unaff_retaddr;" type_identifier identifier ;) (expression_statement "entry(param_2,0x17acd);" (call_expression "entry(param_2,0x17acd)" identifier (argument_list "(param_2,0x17acd)" ( identifier , number_literal ))) ;) (if_statement "if (unaff_retaddr < 0xb) {\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }" if (parenthesized_expression "(unaff_retaddr < 0xb)" ( (binary_expression "unaff_retaddr < 0xb" identifier < number_literal) )) (compound_statement "{\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }" { (expression_statement "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();" (call_expression "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))()" (parenthesized_expression "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))" ( (pointer_expression "*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" * (cast_expression "(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" ( (type_descriptor "code *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" ( (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7" (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX" (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" (string_literal ""%s      Vendor Specific Extension Identifier: 0x%llx\n"" " string_content escape_sequence ") + (pointer_expression "*(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" * (cast_expression "(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" ( (binary_expression "&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX" (binary_expression "&UNK_0001a573 + unaff_retaddr * 4" (pointer_expression "&UNK_0001a573" & identifier) + (binary_expression "unaff_retaddr * 4" identifier * number_literal)) + identifier) ))))) + identifier) + number_literal) )))) )) (argument_list "()" ( ))) ;) (return_statement "return;" return ;) })) (expression_statement "sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);" (call_expression "sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr)" identifier (argument_list "(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr)" ( identifier , identifier , (binary_expression "unaff_EBX + 0x185c7" identifier + number_literal) , identifier ))) ;) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = number_literal) ;) (return_statement "return;" return ;) })))
(translation_unit (function_definition TYPE (ERROR IDENT) (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , LIT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (binary_expression (string_literal " string_content escape_sequence ") + (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression (pointer_expression & IDENT) + (binary_expression IDENT * LIT)) + IDENT) ))))) + IDENT) + LIT) )))) )) (argument_list ( ))) ;) (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (binary_expression IDENT + LIT) , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = LIT) ;) (return_statement return ;) })))
(function_definition "void __regparm2\nFUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)\n\n{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}" (primitive_type "void") (ERROR "__regparm2" (identifier "__regparm2")) (function_declarator "FUN_00017ac0(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)" (identifier "FUN_00017ac0") (parameter_list "(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,\n            undefined4 param_5)" (( "(") (parameter_declaration "undefined4 param_1" (type_identifier "undefined4") (identifier "param_1")) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) (, ",") (parameter_declaration "undefined1 *param_3" (type_identifier "undefined1") (pointer_declarator "*param_3" (* "*") (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")) () ")"))) (compound_statement "{\n  int unaff_EBX;\n  uint unaff_retaddr;\n  \n  entry(param_2,0x17acd);\n  if (unaff_retaddr < 0xb) {\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }\n  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);\n  *param_3 = 0;\n  return;\n}" ({ "{") (declaration "int unaff_EBX;" (primitive_type "int") (identifier "unaff_EBX") (; ";")) (declaration "uint unaff_retaddr;" (type_identifier "uint") (identifier "unaff_retaddr") (; ";")) (expression_statement "entry(param_2,0x17acd);" (call_expression "entry(param_2,0x17acd)" (identifier "entry") (argument_list "(param_2,0x17acd)" (( "(") (identifier "param_2") (, ",") (number_literal "0x17acd") () ")"))) (; ";")) (if_statement "if (unaff_retaddr < 0xb) {\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }" (if "if") (parenthesized_expression "(unaff_retaddr < 0xb)" (( "(") (binary_expression "unaff_retaddr < 0xb" (identifier "unaff_retaddr") (< "<") (number_literal "0xb")) () ")")) (compound_statement "{\n                    \n                    \n    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();\n    return;\n  }" ({ "{") (expression_statement "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();" (call_expression "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))()" (parenthesized_expression "(*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))" (( "(") (pointer_expression "*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" (* "*") (cast_expression "(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" (( "(") (type_descriptor "code *" (type_identifier "code") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "("%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7)" (( "(") (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7" (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX" (binary_expression ""%s      Vendor Specific Extension Identifier: 0x%llx\n" +\n              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" (string_literal ""%s      Vendor Specific Extension Identifier: 0x%llx\n"" (" """) (string_content "%s      Vendor Specific Extension Identifier: 0x%llx") (escape_sequence "\n") (" """)) (+ "+") (pointer_expression "*(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" (* "*") (cast_expression "(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX)" (( "(") (binary_expression "&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX" (binary_expression "&UNK_0001a573 + unaff_retaddr * 4" (pointer_expression "&UNK_0001a573" (& "&") (identifier "UNK_0001a573")) (+ "+") (binary_expression "unaff_retaddr * 4" (identifier "unaff_retaddr") (* "*") (number_literal "4"))) (+ "+") (identifier "unaff_EBX")) () ")"))))) (+ "+") (identifier "unaff_EBX")) (+ "+") (number_literal "7")) () ")")))) () ")")) (argument_list "()" (( "(") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);" (call_expression "sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr)" (identifier "sg_scnpr") (argument_list "(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr)" (( "(") (identifier "param_5") (, ",") (identifier "param_4") (, ",") (binary_expression "unaff_EBX + 0x185c7" (identifier "unaff_EBX") (+ "+") (number_literal "0x185c7")) (, ",") (identifier "unaff_retaddr") () ")"))) (; ";")) (expression_statement "*param_3 = 0;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (number_literal "0")) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}")))

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

int __regparm3
function_1(char *var_1,uint8_t *var_4,int var_3,int sense_key,type_1 *processedp,int var_8,char *var_6)

{
  char *fmt;
  int var_9;
  char *pcVar2;
  type_2 var_5;
  int var_7;
  type_3 uVar5;
  
  if (var_1 == (char *)0x0) {
    var_1 = "";
  }
  switch(sense_key) {
  case 0:
  case 2:
    var_7 = var_2(var_6,var_8,"Progress indication: ");
    if (var_3 < 6) break;
    var_5 = (type_2)(type_3)(*(type_3 *)(var_4 + 5) << 8 | *(type_3 *)(var_4 + 5) >> 8) * 100;
    var_1 = (char *)((int)var_5 >> 0x10);
    pcVar2 = "%d.%02d%%\n";
    var_5 = (var_5 & 0xffff) / 0x290;
    goto LAB_00017c06;
  case 1:
  case 3:
  case 4:
    var_7 = var_2(var_6,var_8,"Actual retry count: ");
    if (5 < var_3) {
      var_9 = var_2(var_6 + var_7,var_8 - var_7,"%u\n",
                       (type_2)(type_3)(*(type_3 *)(var_4 + 5) << 8 | *(type_3 *)(var_4 + 5) >> 8));
      return var_9 + var_7;
    }
    break;
  case 5:
    if (5 < var_3) {
      var_7 = var_2(var_6,var_8,"Field pointer:\n");
      uVar5 = *(type_3 *)(var_4 + 5) << 8 | *(type_3 *)(var_4 + 5) >> 8;
      pcVar2 = "Command";
      if ((var_4[4] & 0x40) == 0) {
        pcVar2 = "Data parameters";
      }
      fmt = "%s        Error in %s: byte %d";
LAB_00017b57:
      var_9 = var_2(var_6 + var_7,var_8 - var_7,fmt,var_1,pcVar2,(type_2)uVar5);
      var_7 = var_7 + var_9;
      if ((var_4[4] & 8) == 0) {
        pcVar2 = "\n";
      }
      else {
        pcVar2 = " bit %d\n";
      }
      var_9 = var_2(var_6 + var_7,var_8 - var_7,pcVar2);
      return var_9 + var_7;
    }
    var_7 = var_2(var_6,var_8,"Field pointer: ");
    break;
  case 6:
    var_7 = var_2(var_6,var_8,"Unit attention condition queue:\n");
    var_5 = var_4[4] & 1;
    pcVar2 = "%s        overflow flag is %d\n";
LAB_00017c06:
    var_9 = var_2(var_6 + var_7,var_8 - var_7,pcVar2,var_1,var_5);
    return var_9 + var_7;
  default:
    var_7 = var_2(var_6,var_8,"Sense_key: 0x%x unexpected\n",sense_key);
    *processedp = false;
    return var_7;
  case 10:
    var_7 = var_2(var_6,var_8,"Segment pointer:\n");
    if (5 < var_3) {
      uVar5 = *(type_3 *)(var_4 + 5) << 8 | *(type_3 *)(var_4 + 5) >> 8;
      pcVar2 = "segment descriptor";
      if ((var_4[4] & 0x20) == 0) {
        pcVar2 = "parameter list";
      }
      fmt = "%s        Relative to start of %s, byte %d";
      goto LAB_00017b57;
    }
  }
  var_9 = var_2(var_6 + var_7,var_8 - var_7,"%s\n","   >> descriptor too short");
  *processedp = false;
  return var_9 + var_7;
}


(translation_unit (function_definition type: (primitive_type) (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: (pointer_declarator 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)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (string_literal (string_content) (escape_sequence)) 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: (pointer_expression argument: (identifier)) right: (binary_expression left: (identifier) right: (number_literal))) right: (identifier)))))) right: (identifier)) right: (number_literal)))))) arguments: (argument_list))) (return_statement))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (binary_expression left: (identifier) right: (number_literal)) (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) (return_statement))))

void __regparm2
MASKED(undefined4 param_1,undefined4 param_2,undefined1 *param_3,undefined4 param_4,
            undefined4 param_5)

{
  int unaff_EBX;
  uint unaff_retaddr;
  
  entry(param_2,0x17acd);
  if (unaff_retaddr < 0xb) {
                    /* WARNING: Could not recover jumptable at 0x00017af7. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (*(code *)("%s      Vendor Specific Extension Identifier: 0x%llx\n" +
              *(int *)(&UNK_0001a573 + unaff_retaddr * 4 + unaff_EBX) + unaff_EBX + 7))();
    return;
  }
  sg_scnpr(param_5,param_4,unaff_EBX + 0x185c7,unaff_retaddr);
  *param_3 = 0;
  return;
}

