
_Bool sg_scsi_normalize_sense(uint8_t *sbp,int sb_len,sg_scsi_sense_hdr *sshp)

{
  bool bVar1;
  byte bVar2;
  
  if (sshp != (sg_scsi_sense_hdr *)0x0) {
    sshp->response_code = '\0';
    sshp->sense_key = '\0';
    sshp->asc = '\0';
    sshp->ascq = '\0';
    sshp->byte4 = '\0';
    sshp->byte5 = '\0';
    sshp->byte6 = '\0';
    sshp->additional_length = '\0';
  }
  bVar1 = sbp == (uint8_t *)0x0 || sb_len < 1;
  if (bVar1) {
    return false;
  }
  bVar2 = *sbp & 0x7f;
  if ((byte)(bVar2 + 0x90) < 4) {
    if (sshp != (sg_scsi_sense_hdr *)0x0) {
      sshp->response_code = bVar2;
      if (bVar2 < 0x72) {
        if (2 < sb_len) {
          sshp->sense_key = sbp[2] & 0xf;
        }
        if (7 < sb_len) {
          if ((int)(sbp[7] + 7) < sb_len) {
            sb_len = sbp[7] + 8;
          }
          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {
            sshp->ascq = sbp[0xd];
            return true;
          }
        }
      }
      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {
        sshp->asc = sbp[2];
        if (3 < sb_len) {
          sshp->ascq = sbp[3];
        }
        if (7 < sb_len) {
          sshp->additional_length = sbp[7];
        }
      }
    }
    bVar1 = true;
  }
  return bVar1;
}



bool sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)

{
  bool bVar1;
  byte bVar2;
  
  if (param_3 != (byte *)0x0) {
    param_3[0] = 0;
    param_3[1] = 0;
    param_3[2] = 0;
    param_3[3] = 0;
    param_3[4] = 0;
    param_3[5] = 0;
    param_3[6] = 0;
    param_3[7] = 0;
  }
  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;
  if (bVar1) {
    return false;
  }
  bVar2 = *param_1 & 0x7f;
  if ((byte)(bVar2 + 0x90) < 4) {
    if (param_3 != (byte *)0x0) {
      *param_3 = bVar2;
      if (bVar2 < 0x72) {
        if (2 < param_2) {
          param_3[1] = param_1[2] & 0xf;
        }
        if (7 < param_2) {
          if ((int)(param_1[7] + 7) < param_2) {
            param_2 = param_1[7] + 8;
          }
          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {
            param_3[3] = param_1[0xd];
            return true;
          }
        }
      }
      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {
        param_3[2] = param_1[2];
        if (3 < param_2) {
          param_3[3] = param_1[3];
        }
        if (7 < param_2) {
          param_3[7] = param_1[7];
        }
      }
    }
    bVar1 = true;
  }
  return bVar1;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
MOV EDX,dword ptr [ESP + 0x1c]
MOV EBX,dword ptr [ESP + 0x14]
MOV ESI,dword ptr [ESP + 0x18]
TEST EDX,EDX
JZ 0x00018b41
MOV dword ptr [EDX],0x0
MOV dword ptr [EDX + 0x4],0x0
TEST EBX,EBX
SETZ AL
TEST ESI,ESI
SETLE CL
OR AL,CL
JNZ 0x00018bb0
MOVZX ECX,byte ptr [EBX]
AND ECX,0x7f
MOV EBP,ECX
LEA EDI,[EBP + -0x70]
MOV ECX,EDI
CMP CL,0x3
JA 0x00018ba5
TEST EDX,EDX
JZ 0x00018ba0
MOV EAX,EBP
MOV byte ptr [EDX],AL
CMP AL,0x71
JBE 0x00018bc0
CMP ESI,0x1
JZ 0x00018ba0
MOVZX EAX,byte ptr [EBX + 0x1]
AND EAX,0xf
MOV byte ptr [EDX + 0x1],AL
CMP ESI,0x2
JZ 0x00018ba0
MOVZX EAX,byte ptr [EBX + 0x2]
MOV byte ptr [EDX + 0x2],AL
CMP ESI,0x3
JLE 0x00018b94
MOVZX EAX,byte ptr [EBX + 0x3]
MOV byte ptr [EDX + 0x3],AL
CMP ESI,0x7
JLE 0x00018ba0
MOVZX EAX,byte ptr [EBX + 0x7]
MOV byte ptr [EDX + 0x7],AL
MOV EAX,0x1
POP EBX
POP ESI
POP EDI
POP EBP
RET
POP EBX
XOR EAX,EAX
POP ESI
POP EDI
POP EBP
RET
CMP ESI,0x2
JLE 0x00018bcf
MOVZX EAX,byte ptr [EBX + 0x2]
AND EAX,0xf
MOV byte ptr [EDX + 0x1],AL
CMP ESI,0x7
JLE 0x00018ba0
MOVZX EAX,byte ptr [EBX + 0x7]
LEA ECX,[EAX + 0x7]
ADD EAX,0x8
CMP ESI,ECX
CMOVG ESI,EAX
CMP ESI,0xc
JLE 0x00018ba0
MOVZX EAX,byte ptr [EBX + 0xc]
MOV byte ptr [EDX + 0x2],AL
CMP ESI,0xd
JZ 0x00018ba0
MOVZX EAX,byte ptr [EBX + 0xd]
MOV byte ptr [EDX + 0x3],AL
MOV EAX,0x1
JMP 0x00018ba5
(translation_unit "bool sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)\n\n{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}\n\n" (function_definition "bool sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)\n\n{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" primitive_type (function_declarator "sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)" identifier (parameter_list "(byte *param_1,int param_2,byte *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "byte *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "byte bVar2;" type_identifier identifier ;) (if_statement "if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }" if (parenthesized_expression "(param_3 != (byte *)0x0)" ( (binary_expression "param_3 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }" { (expression_statement "param_3[0] = 0;" (assignment_expression "param_3[0] = 0" (subscript_expression "param_3[0]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[3] = 0;" (assignment_expression "param_3[3] = 0" (subscript_expression "param_3[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[4] = 0;" (assignment_expression "param_3[4] = 0" (subscript_expression "param_3[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[5] = 0;" (assignment_expression "param_3[5] = 0" (subscript_expression "param_3[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[6] = 0;" (assignment_expression "param_3[6] = 0" (subscript_expression "param_3[6]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[7] = 0;" (assignment_expression "param_3[7] = 0" (subscript_expression "param_3[7]" identifier [ number_literal ]) = number_literal) ;) })) (expression_statement "bVar1 = param_1 == (byte *)0x0 || param_2 < 1;" (assignment_expression "bVar1 = param_1 == (byte *)0x0 || param_2 < 1" identifier = (binary_expression "param_1 == (byte *)0x0 || param_2 < 1" (binary_expression "param_1 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) || (binary_expression "param_2 < 1" identifier < number_literal))) ;) (if_statement "if (bVar1) {\n    return false;\n  }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n    return false;\n  }" { (return_statement "return false;" return false ;) })) (expression_statement "bVar2 = *param_1 & 0x7f;" (assignment_expression "bVar2 = *param_1 & 0x7f" identifier = (binary_expression "*param_1 & 0x7f" (pointer_expression "*param_1" * identifier) & number_literal)) ;) (if_statement "if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" if (parenthesized_expression "((byte)(bVar2 + 0x90) < 4)" ( (binary_expression "(byte)(bVar2 + 0x90) < 4" (call_expression "(byte)(bVar2 + 0x90)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(bVar2 + 0x90)" ( (binary_expression "bVar2 + 0x90" identifier + number_literal) ))) < number_literal) )) (compound_statement "{\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" { (if_statement "if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }" if (parenthesized_expression "(param_3 != (byte *)0x0)" ( (binary_expression "param_3 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }" { (expression_statement "*param_3 = bVar2;" (assignment_expression "*param_3 = bVar2" (pointer_expression "*param_3" * identifier) = identifier) ;) (if_statement "if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" if (parenthesized_expression "(bVar2 < 0x72)" ( (binary_expression "bVar2 < 0x72" identifier < number_literal) )) (compound_statement "{\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }" { (if_statement "if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }" if (parenthesized_expression "(2 < param_2)" ( (binary_expression "2 < param_2" number_literal < identifier) )) (compound_statement "{\n          param_3[1] = param_1[2] & 0xf;\n        }" { (expression_statement "param_3[1] = param_1[2] & 0xf;" (assignment_expression "param_3[1] = param_1[2] & 0xf" (subscript_expression "param_3[1]" identifier [ number_literal ]) = (binary_expression "param_1[2] & 0xf" (subscript_expression "param_1[2]" identifier [ number_literal ]) & number_literal)) ;) })) (if_statement "if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }" if (parenthesized_expression "(7 < param_2)" ( (binary_expression "7 < param_2" number_literal < identifier) )) (compound_statement "{\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }" { (if_statement "if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }" if (parenthesized_expression "((int)(param_1[7] + 7) < param_2)" ( (binary_expression "(int)(param_1[7] + 7) < param_2" (cast_expression "(int)(param_1[7] + 7)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(param_1[7] + 7)" ( (binary_expression "param_1[7] + 7" (subscript_expression "param_1[7]" identifier [ number_literal ]) + number_literal) ))) < identifier) )) (compound_statement "{\n            param_2 = param_1[7] + 8;\n          }" { (expression_statement "param_2 = param_1[7] + 8;" (assignment_expression "param_2 = param_1[7] + 8" identifier = (binary_expression "param_1[7] + 8" (subscript_expression "param_1[7]" identifier [ number_literal ]) + number_literal)) ;) })) (if_statement "if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }" if (parenthesized_expression "((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd))" ( (binary_expression "(0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)" (parenthesized_expression "(0xc < param_2)" ( (binary_expression "0xc < param_2" number_literal < identifier) )) && (parenthesized_expression "(param_3[2] = param_1[0xc], param_2 != 0xd)" ( (comma_expression "param_3[2] = param_1[0xc], param_2 != 0xd" (assignment_expression "param_3[2] = param_1[0xc]" (subscript_expression "param_3[2]" identifier [ number_literal ]) = (subscript_expression "param_1[0xc]" identifier [ number_literal ])) , (binary_expression "param_2 != 0xd" identifier != number_literal)) ))) )) (compound_statement "{\n            param_3[3] = param_1[0xd];\n            return true;\n          }" { (expression_statement "param_3[3] = param_1[0xd];" (assignment_expression "param_3[3] = param_1[0xd]" (subscript_expression "param_3[3]" identifier [ number_literal ]) = (subscript_expression "param_1[0xd]" identifier [ number_literal ])) ;) (return_statement "return true;" return true ;) })) })) }) (else_clause "else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" else (if_statement "if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" if (parenthesized_expression "((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2))" ( (binary_expression "(param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)" (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) && (parenthesized_expression "(param_3[1] = param_1[1] & 0xf, param_2 != 2)" ( (comma_expression "param_3[1] = param_1[1] & 0xf, param_2 != 2" (assignment_expression "param_3[1] = param_1[1] & 0xf" (subscript_expression "param_3[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] & 0xf" (subscript_expression "param_1[1]" identifier [ number_literal ]) & number_literal)) , (binary_expression "param_2 != 2" identifier != number_literal)) ))) )) (compound_statement "{\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" { (expression_statement "param_3[2] = param_1[2];" (assignment_expression "param_3[2] = param_1[2]" (subscript_expression "param_3[2]" identifier [ number_literal ]) = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (if_statement "if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }" if (parenthesized_expression "(3 < param_2)" ( (binary_expression "3 < param_2" number_literal < identifier) )) (compound_statement "{\n          param_3[3] = param_1[3];\n        }" { (expression_statement "param_3[3] = param_1[3];" (assignment_expression "param_3[3] = param_1[3]" (subscript_expression "param_3[3]" identifier [ number_literal ]) = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) })) (if_statement "if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }" if (parenthesized_expression "(7 < param_2)" ( (binary_expression "7 < param_2" number_literal < identifier) )) (compound_statement "{\n          param_3[7] = param_1[7];\n        }" { (expression_statement "param_3[7] = param_1[7];" (assignment_expression "param_3[7] = param_1[7]" (subscript_expression "param_3[7]" identifier [ number_literal ]) = (subscript_expression "param_1[7]" identifier [ number_literal ])) ;) })) })))) })) (expression_statement "bVar1 = true;" (assignment_expression "bVar1 = true" identifier = true) ;) })) (return_statement "return bVar1;" return identifier ;) })))
(translation_unit "_Bool sg_scsi_normalize_sense(uint8_t *sbp,int sb_len,sg_scsi_sense_hdr *sshp)\n\n{\n  bool bVar1;\n  byte bVar2;\n  \n  if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = '\0';\n    sshp->sense_key = '\0';\n    sshp->asc = '\0';\n    sshp->ascq = '\0';\n    sshp->byte4 = '\0';\n    sshp->byte5 = '\0';\n    sshp->byte6 = '\0';\n    sshp->additional_length = '\0';\n  }\n  bVar1 = sbp == (uint8_t *)0x0 || sb_len < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *sbp & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (sshp != (sg_scsi_sense_hdr *)0x0) {\n      sshp->response_code = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}\n\n" (function_definition "_Bool sg_scsi_normalize_sense(uint8_t *sbp,int sb_len,sg_scsi_sense_hdr *sshp)\n\n{\n  bool bVar1;\n  byte bVar2;\n  \n  if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = '\0';\n    sshp->sense_key = '\0';\n    sshp->asc = '\0';\n    sshp->ascq = '\0';\n    sshp->byte4 = '\0';\n    sshp->byte5 = '\0';\n    sshp->byte6 = '\0';\n    sshp->additional_length = '\0';\n  }\n  bVar1 = sbp == (uint8_t *)0x0 || sb_len < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *sbp & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (sshp != (sg_scsi_sense_hdr *)0x0) {\n      sshp->response_code = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" type_identifier (function_declarator "sg_scsi_normalize_sense(uint8_t *sbp,int sb_len,sg_scsi_sense_hdr *sshp)" identifier (parameter_list "(uint8_t *sbp,int sb_len,sg_scsi_sense_hdr *sshp)" ( (parameter_declaration "uint8_t *sbp" primitive_type (pointer_declarator "*sbp" * identifier)) , (parameter_declaration "int sb_len" primitive_type identifier) , (parameter_declaration "sg_scsi_sense_hdr *sshp" type_identifier (pointer_declarator "*sshp" * identifier)) ))) (compound_statement "{\n  bool bVar1;\n  byte bVar2;\n  \n  if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = '\0';\n    sshp->sense_key = '\0';\n    sshp->asc = '\0';\n    sshp->ascq = '\0';\n    sshp->byte4 = '\0';\n    sshp->byte5 = '\0';\n    sshp->byte6 = '\0';\n    sshp->additional_length = '\0';\n  }\n  bVar1 = sbp == (uint8_t *)0x0 || sb_len < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *sbp & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (sshp != (sg_scsi_sense_hdr *)0x0) {\n      sshp->response_code = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "byte bVar2;" type_identifier identifier ;) (if_statement "if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = '\0';\n    sshp->sense_key = '\0';\n    sshp->asc = '\0';\n    sshp->ascq = '\0';\n    sshp->byte4 = '\0';\n    sshp->byte5 = '\0';\n    sshp->byte6 = '\0';\n    sshp->additional_length = '\0';\n  }" if (parenthesized_expression "(sshp != (sg_scsi_sense_hdr *)0x0)" ( (binary_expression "sshp != (sg_scsi_sense_hdr *)0x0" identifier != (cast_expression "(sg_scsi_sense_hdr *)0x0" ( (type_descriptor "sg_scsi_sense_hdr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    sshp->response_code = '\0';\n    sshp->sense_key = '\0';\n    sshp->asc = '\0';\n    sshp->ascq = '\0';\n    sshp->byte4 = '\0';\n    sshp->byte5 = '\0';\n    sshp->byte6 = '\0';\n    sshp->additional_length = '\0';\n  }" { (expression_statement "sshp->response_code = '\0';" (assignment_expression "sshp->response_code = '\0'" (field_expression "sshp->response_code" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "sshp->sense_key = '\0';" (assignment_expression "sshp->sense_key = '\0'" (field_expression "sshp->sense_key" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "sshp->asc = '\0';" (assignment_expression "sshp->asc = '\0'" (field_expression "sshp->asc" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "sshp->ascq = '\0';" (assignment_expression "sshp->ascq = '\0'" (field_expression "sshp->ascq" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "sshp->byte4 = '\0';" (assignment_expression "sshp->byte4 = '\0'" (field_expression "sshp->byte4" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "sshp->byte5 = '\0';" (assignment_expression "sshp->byte5 = '\0'" (field_expression "sshp->byte5" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "sshp->byte6 = '\0';" (assignment_expression "sshp->byte6 = '\0'" (field_expression "sshp->byte6" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "sshp->additional_length = '\0';" (assignment_expression "sshp->additional_length = '\0'" (field_expression "sshp->additional_length" identifier -> field_identifier) = (char_literal "'\0'" ' escape_sequence ')) ;) })) (expression_statement "bVar1 = sbp == (uint8_t *)0x0 || sb_len < 1;" (assignment_expression "bVar1 = sbp == (uint8_t *)0x0 || sb_len < 1" identifier = (binary_expression "sbp == (uint8_t *)0x0 || sb_len < 1" (binary_expression "sbp == (uint8_t *)0x0" identifier == (cast_expression "(uint8_t *)0x0" ( (type_descriptor "uint8_t *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) || (binary_expression "sb_len < 1" identifier < number_literal))) ;) (if_statement "if (bVar1) {\n    return false;\n  }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n    return false;\n  }" { (return_statement "return false;" return false ;) })) (expression_statement "bVar2 = *sbp & 0x7f;" (assignment_expression "bVar2 = *sbp & 0x7f" identifier = (binary_expression "*sbp & 0x7f" (pointer_expression "*sbp" * identifier) & number_literal)) ;) (if_statement "if ((byte)(bVar2 + 0x90) < 4) {\n    if (sshp != (sg_scsi_sense_hdr *)0x0) {\n      sshp->response_code = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" if (parenthesized_expression "((byte)(bVar2 + 0x90) < 4)" ( (binary_expression "(byte)(bVar2 + 0x90) < 4" (call_expression "(byte)(bVar2 + 0x90)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(bVar2 + 0x90)" ( (binary_expression "bVar2 + 0x90" identifier + number_literal) ))) < number_literal) )) (compound_statement "{\n    if (sshp != (sg_scsi_sense_hdr *)0x0) {\n      sshp->response_code = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" { (if_statement "if (sshp != (sg_scsi_sense_hdr *)0x0) {\n      sshp->response_code = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }\n    }" if (parenthesized_expression "(sshp != (sg_scsi_sense_hdr *)0x0)" ( (binary_expression "sshp != (sg_scsi_sense_hdr *)0x0" identifier != (cast_expression "(sg_scsi_sense_hdr *)0x0" ( (type_descriptor "sg_scsi_sense_hdr *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      sshp->response_code = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }\n    }" { (expression_statement "sshp->response_code = bVar2;" (assignment_expression "sshp->response_code = bVar2" (field_expression "sshp->response_code" identifier -> field_identifier) = identifier) ;) (if_statement "if (bVar2 < 0x72) {\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }" if (parenthesized_expression "(bVar2 < 0x72)" ( (binary_expression "bVar2 < 0x72" identifier < number_literal) )) (compound_statement "{\n        if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }\n        if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }\n      }" { (if_statement "if (2 < sb_len) {\n          sshp->sense_key = sbp[2] & 0xf;\n        }" if (parenthesized_expression "(2 < sb_len)" ( (binary_expression "2 < sb_len" number_literal < identifier) )) (compound_statement "{\n          sshp->sense_key = sbp[2] & 0xf;\n        }" { (expression_statement "sshp->sense_key = sbp[2] & 0xf;" (assignment_expression "sshp->sense_key = sbp[2] & 0xf" (field_expression "sshp->sense_key" identifier -> field_identifier) = (binary_expression "sbp[2] & 0xf" (subscript_expression "sbp[2]" identifier [ number_literal ]) & number_literal)) ;) })) (if_statement "if (7 < sb_len) {\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }" if (parenthesized_expression "(7 < sb_len)" ( (binary_expression "7 < sb_len" number_literal < identifier) )) (compound_statement "{\n          if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }\n          if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }\n        }" { (if_statement "if ((int)(sbp[7] + 7) < sb_len) {\n            sb_len = sbp[7] + 8;\n          }" if (parenthesized_expression "((int)(sbp[7] + 7) < sb_len)" ( (binary_expression "(int)(sbp[7] + 7) < sb_len" (cast_expression "(int)(sbp[7] + 7)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(sbp[7] + 7)" ( (binary_expression "sbp[7] + 7" (subscript_expression "sbp[7]" identifier [ number_literal ]) + number_literal) ))) < identifier) )) (compound_statement "{\n            sb_len = sbp[7] + 8;\n          }" { (expression_statement "sb_len = sbp[7] + 8;" (assignment_expression "sb_len = sbp[7] + 8" identifier = (binary_expression "sbp[7] + 8" (subscript_expression "sbp[7]" identifier [ number_literal ]) + number_literal)) ;) })) (if_statement "if ((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n            sshp->ascq = sbp[0xd];\n            return true;\n          }" if (parenthesized_expression "((0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd))" ( (binary_expression "(0xc < sb_len) && (sshp->asc = sbp[0xc], sb_len != 0xd)" (parenthesized_expression "(0xc < sb_len)" ( (binary_expression "0xc < sb_len" number_literal < identifier) )) && (parenthesized_expression "(sshp->asc = sbp[0xc], sb_len != 0xd)" ( (comma_expression "sshp->asc = sbp[0xc], sb_len != 0xd" (assignment_expression "sshp->asc = sbp[0xc]" (field_expression "sshp->asc" identifier -> field_identifier) = (subscript_expression "sbp[0xc]" identifier [ number_literal ])) , (binary_expression "sb_len != 0xd" identifier != number_literal)) ))) )) (compound_statement "{\n            sshp->ascq = sbp[0xd];\n            return true;\n          }" { (expression_statement "sshp->ascq = sbp[0xd];" (assignment_expression "sshp->ascq = sbp[0xd]" (field_expression "sshp->ascq" identifier -> field_identifier) = (subscript_expression "sbp[0xd]" identifier [ number_literal ])) ;) (return_statement "return true;" return true ;) })) })) }) (else_clause "else if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }" else (if_statement "if ((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)) {\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }" if (parenthesized_expression "((sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2))" ( (binary_expression "(sb_len != 1) && (sshp->sense_key = sbp[1] & 0xf, sb_len != 2)" (parenthesized_expression "(sb_len != 1)" ( (binary_expression "sb_len != 1" identifier != number_literal) )) && (parenthesized_expression "(sshp->sense_key = sbp[1] & 0xf, sb_len != 2)" ( (comma_expression "sshp->sense_key = sbp[1] & 0xf, sb_len != 2" (assignment_expression "sshp->sense_key = sbp[1] & 0xf" (field_expression "sshp->sense_key" identifier -> field_identifier) = (binary_expression "sbp[1] & 0xf" (subscript_expression "sbp[1]" identifier [ number_literal ]) & number_literal)) , (binary_expression "sb_len != 2" identifier != number_literal)) ))) )) (compound_statement "{\n        sshp->asc = sbp[2];\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n        if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }\n      }" { (expression_statement "sshp->asc = sbp[2];" (assignment_expression "sshp->asc = sbp[2]" (field_expression "sshp->asc" identifier -> field_identifier) = (subscript_expression "sbp[2]" identifier [ number_literal ])) ;) (if_statement "if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }" if (parenthesized_expression "(3 < sb_len)" ( (binary_expression "3 < sb_len" number_literal < identifier) )) (compound_statement "{\n          sshp->ascq = sbp[3];\n        }" { (expression_statement "sshp->ascq = sbp[3];" (assignment_expression "sshp->ascq = sbp[3]" (field_expression "sshp->ascq" identifier -> field_identifier) = (subscript_expression "sbp[3]" identifier [ number_literal ])) ;) })) (if_statement "if (7 < sb_len) {\n          sshp->additional_length = sbp[7];\n        }" if (parenthesized_expression "(7 < sb_len)" ( (binary_expression "7 < sb_len" number_literal < identifier) )) (compound_statement "{\n          sshp->additional_length = sbp[7];\n        }" { (expression_statement "sshp->additional_length = sbp[7];" (assignment_expression "sshp->additional_length = sbp[7]" (field_expression "sshp->additional_length" identifier -> field_identifier) = (subscript_expression "sbp[7]" identifier [ number_literal ])) ;) })) })))) })) (expression_statement "bVar1 = true;" (assignment_expression "bVar1 = true" identifier = true) ;) })) (return_statement "return bVar1;" return identifier ;) })))
(translation_unit "bool sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)\n\n{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}\n\n" (function_definition "bool sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)\n\n{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" primitive_type (function_declarator "sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)" identifier (parameter_list "(byte *param_1,int param_2,byte *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "byte *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "byte bVar2;" type_identifier identifier ;) (if_statement "if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }" if (parenthesized_expression "(param_3 != (byte *)0x0)" ( (binary_expression "param_3 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }" { (expression_statement "param_3[0] = 0;" (assignment_expression "param_3[0] = 0" (subscript_expression "param_3[0]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[3] = 0;" (assignment_expression "param_3[3] = 0" (subscript_expression "param_3[3]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[4] = 0;" (assignment_expression "param_3[4] = 0" (subscript_expression "param_3[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[5] = 0;" (assignment_expression "param_3[5] = 0" (subscript_expression "param_3[5]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[6] = 0;" (assignment_expression "param_3[6] = 0" (subscript_expression "param_3[6]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "param_3[7] = 0;" (assignment_expression "param_3[7] = 0" (subscript_expression "param_3[7]" identifier [ number_literal ]) = number_literal) ;) })) (expression_statement "bVar1 = param_1 == (byte *)0x0 || param_2 < 1;" (assignment_expression "bVar1 = param_1 == (byte *)0x0 || param_2 < 1" identifier = (binary_expression "param_1 == (byte *)0x0 || param_2 < 1" (binary_expression "param_1 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) || (binary_expression "param_2 < 1" identifier < number_literal))) ;) (if_statement "if (bVar1) {\n    return false;\n  }" if (parenthesized_expression "(bVar1)" ( identifier )) (compound_statement "{\n    return false;\n  }" { (return_statement "return false;" return false ;) })) (expression_statement "bVar2 = *param_1 & 0x7f;" (assignment_expression "bVar2 = *param_1 & 0x7f" identifier = (binary_expression "*param_1 & 0x7f" (pointer_expression "*param_1" * identifier) & number_literal)) ;) (if_statement "if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" if (parenthesized_expression "((byte)(bVar2 + 0x90) < 4)" ( (binary_expression "(byte)(bVar2 + 0x90) < 4" (call_expression "(byte)(bVar2 + 0x90)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(bVar2 + 0x90)" ( (binary_expression "bVar2 + 0x90" identifier + number_literal) ))) < number_literal) )) (compound_statement "{\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" { (if_statement "if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }" if (parenthesized_expression "(param_3 != (byte *)0x0)" ( (binary_expression "param_3 != (byte *)0x0" identifier != (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }" { (expression_statement "*param_3 = bVar2;" (assignment_expression "*param_3 = bVar2" (pointer_expression "*param_3" * identifier) = identifier) ;) (if_statement "if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" if (parenthesized_expression "(bVar2 < 0x72)" ( (binary_expression "bVar2 < 0x72" identifier < number_literal) )) (compound_statement "{\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }" { (if_statement "if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }" if (parenthesized_expression "(2 < param_2)" ( (binary_expression "2 < param_2" number_literal < identifier) )) (compound_statement "{\n          param_3[1] = param_1[2] & 0xf;\n        }" { (expression_statement "param_3[1] = param_1[2] & 0xf;" (assignment_expression "param_3[1] = param_1[2] & 0xf" (subscript_expression "param_3[1]" identifier [ number_literal ]) = (binary_expression "param_1[2] & 0xf" (subscript_expression "param_1[2]" identifier [ number_literal ]) & number_literal)) ;) })) (if_statement "if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }" if (parenthesized_expression "(7 < param_2)" ( (binary_expression "7 < param_2" number_literal < identifier) )) (compound_statement "{\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }" { (if_statement "if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }" if (parenthesized_expression "((int)(param_1[7] + 7) < param_2)" ( (binary_expression "(int)(param_1[7] + 7) < param_2" (cast_expression "(int)(param_1[7] + 7)" ( (type_descriptor "int" primitive_type) ) (parenthesized_expression "(param_1[7] + 7)" ( (binary_expression "param_1[7] + 7" (subscript_expression "param_1[7]" identifier [ number_literal ]) + number_literal) ))) < identifier) )) (compound_statement "{\n            param_2 = param_1[7] + 8;\n          }" { (expression_statement "param_2 = param_1[7] + 8;" (assignment_expression "param_2 = param_1[7] + 8" identifier = (binary_expression "param_1[7] + 8" (subscript_expression "param_1[7]" identifier [ number_literal ]) + number_literal)) ;) })) (if_statement "if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }" if (parenthesized_expression "((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd))" ( (binary_expression "(0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)" (parenthesized_expression "(0xc < param_2)" ( (binary_expression "0xc < param_2" number_literal < identifier) )) && (parenthesized_expression "(param_3[2] = param_1[0xc], param_2 != 0xd)" ( (comma_expression "param_3[2] = param_1[0xc], param_2 != 0xd" (assignment_expression "param_3[2] = param_1[0xc]" (subscript_expression "param_3[2]" identifier [ number_literal ]) = (subscript_expression "param_1[0xc]" identifier [ number_literal ])) , (binary_expression "param_2 != 0xd" identifier != number_literal)) ))) )) (compound_statement "{\n            param_3[3] = param_1[0xd];\n            return true;\n          }" { (expression_statement "param_3[3] = param_1[0xd];" (assignment_expression "param_3[3] = param_1[0xd]" (subscript_expression "param_3[3]" identifier [ number_literal ]) = (subscript_expression "param_1[0xd]" identifier [ number_literal ])) ;) (return_statement "return true;" return true ;) })) })) }) (else_clause "else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" else (if_statement "if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" if (parenthesized_expression "((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2))" ( (binary_expression "(param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)" (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) && (parenthesized_expression "(param_3[1] = param_1[1] & 0xf, param_2 != 2)" ( (comma_expression "param_3[1] = param_1[1] & 0xf, param_2 != 2" (assignment_expression "param_3[1] = param_1[1] & 0xf" (subscript_expression "param_3[1]" identifier [ number_literal ]) = (binary_expression "param_1[1] & 0xf" (subscript_expression "param_1[1]" identifier [ number_literal ]) & number_literal)) , (binary_expression "param_2 != 2" identifier != number_literal)) ))) )) (compound_statement "{\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" { (expression_statement "param_3[2] = param_1[2];" (assignment_expression "param_3[2] = param_1[2]" (subscript_expression "param_3[2]" identifier [ number_literal ]) = (subscript_expression "param_1[2]" identifier [ number_literal ])) ;) (if_statement "if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }" if (parenthesized_expression "(3 < param_2)" ( (binary_expression "3 < param_2" number_literal < identifier) )) (compound_statement "{\n          param_3[3] = param_1[3];\n        }" { (expression_statement "param_3[3] = param_1[3];" (assignment_expression "param_3[3] = param_1[3]" (subscript_expression "param_3[3]" identifier [ number_literal ]) = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) })) (if_statement "if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }" if (parenthesized_expression "(7 < param_2)" ( (binary_expression "7 < param_2" number_literal < identifier) )) (compound_statement "{\n          param_3[7] = param_1[7];\n        }" { (expression_statement "param_3[7] = param_1[7];" (assignment_expression "param_3[7] = param_1[7]" (subscript_expression "param_3[7]" identifier [ number_literal ]) = (subscript_expression "param_1[7]" identifier [ number_literal ])) ;) })) })))) })) (expression_statement "bVar1 = true;" (assignment_expression "bVar1 = true" identifier = true) ;) })) (return_statement "return bVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = LIT) ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) || (binary_expression IDENT < LIT))) ;) (if_statement if (parenthesized_expression ( IDENT )) (compound_statement { (return_statement return BOOL ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * IDENT) & LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT + LIT) ))) < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) & LIT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) ))) < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression LIT < IDENT) )) && (parenthesized_expression ( (comma_expression (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) , (binary_expression IDENT != LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (return_statement return BOOL ;) })) })) }) (else_clause else (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT != LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) & LIT)) , (binary_expression IDENT != LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) })) })))) })) (expression_statement (assignment_expression IDENT = BOOL) ;) })) (return_statement return IDENT ;) })))
(function_definition "bool sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)\n\n{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" (primitive_type "bool") (function_declarator "sg_scsi_normalize_sense(byte *param_1,int param_2,byte *param_3)" (identifier "sg_scsi_normalize_sense") (parameter_list "(byte *param_1,int param_2,byte *param_3)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "byte *param_3" (type_identifier "byte") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  bool bVar1;\n  byte bVar2;\n  \n  if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }\n  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;\n  if (bVar1) {\n    return false;\n  }\n  bVar2 = *param_1 & 0x7f;\n  if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }\n  return bVar1;\n}" ({ "{") (declaration "bool bVar1;" (primitive_type "bool") (identifier "bVar1") (; ";")) (declaration "byte bVar2;" (type_identifier "byte") (identifier "bVar2") (; ";")) (if_statement "if (param_3 != (byte *)0x0) {\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }" (if "if") (parenthesized_expression "(param_3 != (byte *)0x0)" (( "(") (binary_expression "param_3 != (byte *)0x0" (identifier "param_3") (!= "!=") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    param_3[0] = 0;\n    param_3[1] = 0;\n    param_3[2] = 0;\n    param_3[3] = 0;\n    param_3[4] = 0;\n    param_3[5] = 0;\n    param_3[6] = 0;\n    param_3[7] = 0;\n  }" ({ "{") (expression_statement "param_3[0] = 0;" (assignment_expression "param_3[0] = 0" (subscript_expression "param_3[0]" (identifier "param_3") ([ "[") (number_literal "0") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[1] = 0;" (assignment_expression "param_3[1] = 0" (subscript_expression "param_3[1]" (identifier "param_3") ([ "[") (number_literal "1") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[2] = 0;" (assignment_expression "param_3[2] = 0" (subscript_expression "param_3[2]" (identifier "param_3") ([ "[") (number_literal "2") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[3] = 0;" (assignment_expression "param_3[3] = 0" (subscript_expression "param_3[3]" (identifier "param_3") ([ "[") (number_literal "3") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[4] = 0;" (assignment_expression "param_3[4] = 0" (subscript_expression "param_3[4]" (identifier "param_3") ([ "[") (number_literal "4") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[5] = 0;" (assignment_expression "param_3[5] = 0" (subscript_expression "param_3[5]" (identifier "param_3") ([ "[") (number_literal "5") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[6] = 0;" (assignment_expression "param_3[6] = 0" (subscript_expression "param_3[6]" (identifier "param_3") ([ "[") (number_literal "6") (] "]")) (= "=") (number_literal "0")) (; ";")) (expression_statement "param_3[7] = 0;" (assignment_expression "param_3[7] = 0" (subscript_expression "param_3[7]" (identifier "param_3") ([ "[") (number_literal "7") (] "]")) (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "bVar1 = param_1 == (byte *)0x0 || param_2 < 1;" (assignment_expression "bVar1 = param_1 == (byte *)0x0 || param_2 < 1" (identifier "bVar1") (= "=") (binary_expression "param_1 == (byte *)0x0 || param_2 < 1" (binary_expression "param_1 == (byte *)0x0" (identifier "param_1") (== "==") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (|| "||") (binary_expression "param_2 < 1" (identifier "param_2") (< "<") (number_literal "1")))) (; ";")) (if_statement "if (bVar1) {\n    return false;\n  }" (if "if") (parenthesized_expression "(bVar1)" (( "(") (identifier "bVar1") () ")")) (compound_statement "{\n    return false;\n  }" ({ "{") (return_statement "return false;" (return "return") (false "false") (; ";")) (} "}"))) (expression_statement "bVar2 = *param_1 & 0x7f;" (assignment_expression "bVar2 = *param_1 & 0x7f" (identifier "bVar2") (= "=") (binary_expression "*param_1 & 0x7f" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (& "&") (number_literal "0x7f"))) (; ";")) (if_statement "if ((byte)(bVar2 + 0x90) < 4) {\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" (if "if") (parenthesized_expression "((byte)(bVar2 + 0x90) < 4)" (( "(") (binary_expression "(byte)(bVar2 + 0x90) < 4" (call_expression "(byte)(bVar2 + 0x90)" (parenthesized_expression "(byte)" (( "(") (identifier "byte") () ")")) (argument_list "(bVar2 + 0x90)" (( "(") (binary_expression "bVar2 + 0x90" (identifier "bVar2") (+ "+") (number_literal "0x90")) () ")"))) (< "<") (number_literal "4")) () ")")) (compound_statement "{\n    if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }\n    bVar1 = true;\n  }" ({ "{") (if_statement "if (param_3 != (byte *)0x0) {\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }" (if "if") (parenthesized_expression "(param_3 != (byte *)0x0)" (( "(") (binary_expression "param_3 != (byte *)0x0" (identifier "param_3") (!= "!=") (cast_expression "(byte *)0x0" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n      *param_3 = bVar2;\n      if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }\n    }" ({ "{") (expression_statement "*param_3 = bVar2;" (assignment_expression "*param_3 = bVar2" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (identifier "bVar2")) (; ";")) (if_statement "if (bVar2 < 0x72) {\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }\n      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" (if "if") (parenthesized_expression "(bVar2 < 0x72)" (( "(") (binary_expression "bVar2 < 0x72" (identifier "bVar2") (< "<") (number_literal "0x72")) () ")")) (compound_statement "{\n        if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }\n        if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }\n      }" ({ "{") (if_statement "if (2 < param_2) {\n          param_3[1] = param_1[2] & 0xf;\n        }" (if "if") (parenthesized_expression "(2 < param_2)" (( "(") (binary_expression "2 < param_2" (number_literal "2") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n          param_3[1] = param_1[2] & 0xf;\n        }" ({ "{") (expression_statement "param_3[1] = param_1[2] & 0xf;" (assignment_expression "param_3[1] = param_1[2] & 0xf" (subscript_expression "param_3[1]" (identifier "param_3") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "param_1[2] & 0xf" (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]")) (& "&") (number_literal "0xf"))) (; ";")) (} "}"))) (if_statement "if (7 < param_2) {\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }" (if "if") (parenthesized_expression "(7 < param_2)" (( "(") (binary_expression "7 < param_2" (number_literal "7") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n          if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }\n          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }\n        }" ({ "{") (if_statement "if ((int)(param_1[7] + 7) < param_2) {\n            param_2 = param_1[7] + 8;\n          }" (if "if") (parenthesized_expression "((int)(param_1[7] + 7) < param_2)" (( "(") (binary_expression "(int)(param_1[7] + 7) < param_2" (cast_expression "(int)(param_1[7] + 7)" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (parenthesized_expression "(param_1[7] + 7)" (( "(") (binary_expression "param_1[7] + 7" (subscript_expression "param_1[7]" (identifier "param_1") ([ "[") (number_literal "7") (] "]")) (+ "+") (number_literal "7")) () ")"))) (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n            param_2 = param_1[7] + 8;\n          }" ({ "{") (expression_statement "param_2 = param_1[7] + 8;" (assignment_expression "param_2 = param_1[7] + 8" (identifier "param_2") (= "=") (binary_expression "param_1[7] + 8" (subscript_expression "param_1[7]" (identifier "param_1") ([ "[") (number_literal "7") (] "]")) (+ "+") (number_literal "8"))) (; ";")) (} "}"))) (if_statement "if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n            param_3[3] = param_1[0xd];\n            return true;\n          }" (if "if") (parenthesized_expression "((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd))" (( "(") (binary_expression "(0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)" (parenthesized_expression "(0xc < param_2)" (( "(") (binary_expression "0xc < param_2" (number_literal "0xc") (< "<") (identifier "param_2")) () ")")) (&& "&&") (parenthesized_expression "(param_3[2] = param_1[0xc], param_2 != 0xd)" (( "(") (comma_expression "param_3[2] = param_1[0xc], param_2 != 0xd" (assignment_expression "param_3[2] = param_1[0xc]" (subscript_expression "param_3[2]" (identifier "param_3") ([ "[") (number_literal "2") (] "]")) (= "=") (subscript_expression "param_1[0xc]" (identifier "param_1") ([ "[") (number_literal "0xc") (] "]"))) (, ",") (binary_expression "param_2 != 0xd" (identifier "param_2") (!= "!=") (number_literal "0xd"))) () ")"))) () ")")) (compound_statement "{\n            param_3[3] = param_1[0xd];\n            return true;\n          }" ({ "{") (expression_statement "param_3[3] = param_1[0xd];" (assignment_expression "param_3[3] = param_1[0xd]" (subscript_expression "param_3[3]" (identifier "param_3") ([ "[") (number_literal "3") (] "]")) (= "=") (subscript_expression "param_1[0xd]" (identifier "param_1") ([ "[") (number_literal "0xd") (] "]"))) (; ";")) (return_statement "return true;" (return "return") (true "true") (; ";")) (} "}"))) (} "}"))) (} "}")) (else_clause "else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" (else "else") (if_statement "if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" (if "if") (parenthesized_expression "((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2))" (( "(") (binary_expression "(param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)" (parenthesized_expression "(param_2 != 1)" (( "(") (binary_expression "param_2 != 1" (identifier "param_2") (!= "!=") (number_literal "1")) () ")")) (&& "&&") (parenthesized_expression "(param_3[1] = param_1[1] & 0xf, param_2 != 2)" (( "(") (comma_expression "param_3[1] = param_1[1] & 0xf, param_2 != 2" (assignment_expression "param_3[1] = param_1[1] & 0xf" (subscript_expression "param_3[1]" (identifier "param_3") ([ "[") (number_literal "1") (] "]")) (= "=") (binary_expression "param_1[1] & 0xf" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (& "&") (number_literal "0xf"))) (, ",") (binary_expression "param_2 != 2" (identifier "param_2") (!= "!=") (number_literal "2"))) () ")"))) () ")")) (compound_statement "{\n        param_3[2] = param_1[2];\n        if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }\n        if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }\n      }" ({ "{") (expression_statement "param_3[2] = param_1[2];" (assignment_expression "param_3[2] = param_1[2]" (subscript_expression "param_3[2]" (identifier "param_3") ([ "[") (number_literal "2") (] "]")) (= "=") (subscript_expression "param_1[2]" (identifier "param_1") ([ "[") (number_literal "2") (] "]"))) (; ";")) (if_statement "if (3 < param_2) {\n          param_3[3] = param_1[3];\n        }" (if "if") (parenthesized_expression "(3 < param_2)" (( "(") (binary_expression "3 < param_2" (number_literal "3") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n          param_3[3] = param_1[3];\n        }" ({ "{") (expression_statement "param_3[3] = param_1[3];" (assignment_expression "param_3[3] = param_1[3]" (subscript_expression "param_3[3]" (identifier "param_3") ([ "[") (number_literal "3") (] "]")) (= "=") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (; ";")) (} "}"))) (if_statement "if (7 < param_2) {\n          param_3[7] = param_1[7];\n        }" (if "if") (parenthesized_expression "(7 < param_2)" (( "(") (binary_expression "7 < param_2" (number_literal "7") (< "<") (identifier "param_2")) () ")")) (compound_statement "{\n          param_3[7] = param_1[7];\n        }" ({ "{") (expression_statement "param_3[7] = param_1[7];" (assignment_expression "param_3[7] = param_1[7]" (subscript_expression "param_3[7]" (identifier "param_3") ([ "[") (number_literal "7") (] "]")) (= "=") (subscript_expression "param_1[7]" (identifier "param_1") ([ "[") (number_literal "7") (] "]"))) (; ";")) (} "}"))) (} "}"))))) (} "}"))) (expression_statement "bVar1 = true;" (assignment_expression "bVar1 = true" (identifier "bVar1") (= "=") (true "true")) (; ";")) (} "}"))) (return_statement "return bVar1;" (return "return") (identifier "bVar1") (; ";")) (} "}")))

type_1 function_1(uint8_t *var_2,int var_3,type_2 *var_1)

{
  bool bVar1;
  type_3 var_4;
  
  if (var_1 != (type_2 *)0x0) {
    var_1->response_code = '\0';
    var_1->sense_key = '\0';
    var_1->asc = '\0';
    var_1->ascq = '\0';
    var_1->byte4 = '\0';
    var_1->byte5 = '\0';
    var_1->byte6 = '\0';
    var_1->additional_length = '\0';
  }
  bVar1 = var_2 == (uint8_t *)0x0 || var_3 < 1;
  if (bVar1) {
    return false;
  }
  var_4 = *var_2 & 0x7f;
  if ((type_3)(var_4 + 0x90) < 4) {
    if (var_1 != (type_2 *)0x0) {
      var_1->response_code = var_4;
      if (var_4 < 0x72) {
        if (2 < var_3) {
          var_1->sense_key = var_2[2] & 0xf;
        }
        if (7 < var_3) {
          if ((int)(var_2[7] + 7) < var_3) {
            var_3 = var_2[7] + 8;
          }
          if ((0xc < var_3) && (var_1->asc = var_2[0xc], var_3 != 0xd)) {
            var_1->ascq = var_2[0xd];
            return true;
          }
        }
      }
      else if ((var_3 != 1) && (var_1->sense_key = var_2[1] & 0xf, var_3 != 2)) {
        var_1->asc = var_2[2];
        if (3 < var_3) {
          var_1->ascq = var_2[3];
        }
        if (7 < var_3) {
          var_1->additional_length = var_2[7];
        }
      }
    }
    bVar1 = true;
  }
  return bVar1;
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal))) right: (binary_expression left: (identifier) right: (number_literal))))) (if_statement condition: (parenthesized_expression (identifier)) consequence: (compound_statement (return_statement (false)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)))) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (return_statement (true))))))) alternative: (else_clause (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) right: (binary_expression left: (identifier) right: (number_literal)))))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (subscript_expression argument: (identifier) index: (number_literal)))))))))))) (expression_statement (assignment_expression left: (identifier) right: (true))))) (return_statement (identifier)))))

bool MASKED(byte *param_1,int param_2,byte *param_3)

{
  bool bVar1;
  byte bVar2;
  
  if (param_3 != (byte *)0x0) {
    param_3[0] = 0;
    param_3[1] = 0;
    param_3[2] = 0;
    param_3[3] = 0;
    param_3[4] = 0;
    param_3[5] = 0;
    param_3[6] = 0;
    param_3[7] = 0;
  }
  bVar1 = param_1 == (byte *)0x0 || param_2 < 1;
  if (bVar1) {
    return false;
  }
  bVar2 = *param_1 & 0x7f;
  if ((byte)(bVar2 + 0x90) < 4) {
    if (param_3 != (byte *)0x0) {
      *param_3 = bVar2;
      if (bVar2 < 0x72) {
        if (2 < param_2) {
          param_3[1] = param_1[2] & 0xf;
        }
        if (7 < param_2) {
          if ((int)(param_1[7] + 7) < param_2) {
            param_2 = param_1[7] + 8;
          }
          if ((0xc < param_2) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {
            param_3[3] = param_1[0xd];
            return true;
          }
        }
      }
      else if ((param_2 != 1) && (param_3[1] = param_1[1] & 0xf, param_2 != 2)) {
        param_3[2] = param_1[2];
        if (3 < param_2) {
          param_3[3] = param_1[3];
        }
        if (7 < param_2) {
          param_3[7] = param_1[7];
        }
      }
    }
    bVar1 = true;
  }
  return bVar1;
}

