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

{
  bool bVar1;
  uint uVar2;
  
  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';
  }
  if ((sbp == (uint8_t *)0x0) || (sb_len < 1)) {
    return false;
  }
  uVar2 = *sbp & 0x7f;
  if (3 < uVar2 - 0x70) {
    return false;
  }
  if (sshp != (sg_scsi_sense_hdr *)0x0) {
    sshp->response_code = (uint8_t)uVar2;
    if (uVar2 < 0x72) {
      if (2 < sb_len) {
        sshp->sense_key = sbp[2] & 0xf;
      }
      if (7 < sb_len) {
        bVar1 = sb_len < 0xd;
        if ((int)(sbp[7] + 7) < sb_len) {
          sb_len = sbp[7] + 8;
          bVar1 = (uint)sb_len < 0xd;
        }
        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {
          sshp->ascq = sbp[0xd];
          return true;
        }
      }
    }
    else {
      if (sb_len != 1) {
        sshp->sense_key = sbp[1] & 0xf;
        if (sb_len != 2) {
          sshp->asc = sbp[2];
        }
        if (3 < sb_len) {
          sshp->ascq = sbp[3];
        }
      }
      if (7 < sb_len) {
        sshp->additional_length = sbp[7];
        return true;
      }
    }
  }
  return true;
}



undefined4 sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)

{
  bool bVar1;
  uint uVar2;
  
  if (param_3 != (undefined1 *)0x0) {
    *param_3 = 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;
  }
  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {
    return 0;
  }
  uVar2 = *param_1 & 0x7f;
  if (3 < uVar2 - 0x70) {
    return 0;
  }
  if (param_3 != (undefined1 *)0x0) {
    *param_3 = (char)uVar2;
    if (uVar2 < 0x72) {
      if (2 < (int)param_2) {
        param_3[1] = param_1[2] & 0xf;
      }
      if (7 < (int)param_2) {
        bVar1 = (int)param_2 < 0xd;
        if ((int)(param_1[7] + 7) < (int)param_2) {
          param_2 = param_1[7] + 8;
          bVar1 = param_2 < 0xd;
        }
        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {
          param_3[3] = param_1[0xd];
          return 1;
        }
      }
    }
    else {
      if (param_2 != 1) {
        param_3[1] = param_1[1] & 0xf;
        if (param_2 != 2) {
          param_3[2] = param_1[2];
        }
        if (3 < (int)param_2) {
          param_3[3] = param_1[3];
        }
      }
      if (7 < (int)param_2) {
        param_3[7] = param_1[7];
        return 1;
      }
    }
  }
  return 1;
}


beq a2,zero,0x00017f18
_nop
sb zero,0x0(a2)
sb zero,0x1(a2)
sb zero,0x2(a2)
sb zero,0x3(a2)
sb zero,0x4(a2)
sb zero,0x5(a2)
sb zero,0x6(a2)
sb zero,0x7(a2)
beq a0,zero,0x00017fac
_nop
blez a1,0x00017fac
_nop
lbu v0,0x0(a0)
andi v0,v0,0x7f
addiu v1,v0,-0x70
sltiu v1,v1,0x4
beq v1,zero,0x00017fa4
_nop
beq a2,zero,0x00017ffc
_sltiu v1,v0,0x72
bne v1,zero,0x00017fb4
_sb v0,0x0(a2)
li v0,0x1
beq a1,v0,0x00017f88
_li v1,0x2
lbu v0,0x1(a0)
andi v0,v0,0xf
beq a1,v1,0x00017f74
_sb v0,0x1(a2)
lbu v0,0x2(a0)
sb v0,0x2(a2)
slti v0,a1,0x4
bne v0,zero,0x00017f88
_nop
lbu v0,0x3(a0)
sb v0,0x3(a2)
slti a1,a1,0x8
bne a1,zero,0x00017ffc
_nop
lbu v1,0x7(a0)
li v0,0x1
jr ra
_sb v1,0x7(a2)
jr ra
_or v0,zero,zero
jr ra
_or v0,zero,zero
slti v0,a1,0x3
bne v0,zero,0x00017fd0
_slti v0,a1,0x8
lbu v0,0x2(a0)
andi v0,v0,0xf
sb v0,0x1(a2)
slti v0,a1,0x8
bne v0,zero,0x00017ffc
_nop
lbu v1,0x7(a0)
addiu v0,v1,0x7
slt v0,v0,a1
beq v0,zero,0x00017ff4
_slti v0,a1,0xd
addiu a1,v1,0x8
slti v0,a1,0xd
beq v0,zero,0x00018004
_nop
jr ra
_li v0,0x1
lbu v1,0xc(a0)
li v0,0xd
beq a1,v0,0x00017ffc
_sb v1,0x2(a2)
lbu v1,0xd(a0)
li v0,0x1
jr ra
_sb v1,0x3(a2)
(translation_unit "undefined4 sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)\n\n{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}\n\n" (function_definition "undefined4 sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)\n\n{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}" type_identifier (function_declarator "sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)" identifier (parameter_list "(byte *param_1,uint param_2,undefined1 *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "undefined1 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (if_statement "if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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 != (undefined1 *)0x0)" ( (binary_expression "param_3 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_3 = 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;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = 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) ;) })) (if_statement "if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }" if (parenthesized_expression "((param_1 == (byte *)0x0) || ((int)param_2 < 1))" ( (binary_expression "(param_1 == (byte *)0x0) || ((int)param_2 < 1)" (parenthesized_expression "(param_1 == (byte *)0x0)" ( (binary_expression "param_1 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "((int)param_2 < 1)" ( (binary_expression "(int)param_2 < 1" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) ))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar2 = *param_1 & 0x7f;" (assignment_expression "uVar2 = *param_1 & 0x7f" identifier = (binary_expression "*param_1 & 0x7f" (pointer_expression "*param_1" * identifier) & number_literal)) ;) (if_statement "if (3 < uVar2 - 0x70) {\n    return 0;\n  }" if (parenthesized_expression "(3 < uVar2 - 0x70)" ( (binary_expression "3 < uVar2 - 0x70" number_literal < (binary_expression "uVar2 - 0x70" identifier - number_literal)) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }" if (parenthesized_expression "(param_3 != (undefined1 *)0x0)" ( (binary_expression "param_3 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }" { (expression_statement "*param_3 = (char)uVar2;" (assignment_expression "*param_3 = (char)uVar2" (pointer_expression "*param_3" * identifier) = (cast_expression "(char)uVar2" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (if_statement "if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" if (parenthesized_expression "(uVar2 < 0x72)" ( (binary_expression "uVar2 < 0x72" identifier < number_literal) )) (compound_statement "{\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }" { (if_statement "if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }" if (parenthesized_expression "(2 < (int)param_2)" ( (binary_expression "2 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) 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 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }" if (parenthesized_expression "(7 < (int)param_2)" ( (binary_expression "7 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }" { (expression_statement "bVar1 = (int)param_2 < 0xd;" (assignment_expression "bVar1 = (int)param_2 < 0xd" identifier = (binary_expression "(int)param_2 < 0xd" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal)) ;) (if_statement "if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }" if (parenthesized_expression "((int)(param_1[7] + 7) < (int)param_2)" ( (binary_expression "(int)(param_1[7] + 7) < (int)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) ))) < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\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)) ;) (expression_statement "bVar1 = param_2 < 0xd;" (assignment_expression "bVar1 = param_2 < 0xd" identifier = (binary_expression "param_2 < 0xd" identifier < number_literal)) ;) })) (if_statement "if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }" if (parenthesized_expression "((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd))" ( (binary_expression "(!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)" (parenthesized_expression "(!bVar1)" ( (unary_expression "!bVar1" ! 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 1;\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 1;" return number_literal ;) })) })) }) (else_clause "else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" else (compound_statement "{\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" { (if_statement "if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }" { (expression_statement "param_3[1] = param_1[1] & 0xf;" (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)) ;) (if_statement "if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }" if (parenthesized_expression "(param_2 != 2)" ( (binary_expression "param_2 != 2" identifier != number_literal) )) (compound_statement "{\n          param_3[2] = param_1[2];\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 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }" if (parenthesized_expression "(3 < (int)param_2)" ( (binary_expression "3 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) 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 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }" if (parenthesized_expression "(7 < (int)param_2)" ( (binary_expression "7 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n        param_3[7] = param_1[7];\n        return 1;\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 ])) ;) (return_statement "return 1;" return number_literal ;) })) }))) })) (return_statement "return 1;" return number_literal ;) })))
(translation_unit "_Bool sg_scsi_normalize_sense(uint8_t *sbp,int sb_len,sg_scsi_sense_hdr *sshp)\n\n{\n  bool bVar1;\n  uint uVar2;\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  if ((sbp == (uint8_t *)0x0) || (sb_len < 1)) {\n    return false;\n  }\n  uVar2 = *sbp & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return false;\n  }\n  if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = (uint8_t)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < sb_len) {\n        sshp->sense_key = sbp[2] & 0xf;\n      }\n      if (7 < sb_len) {\n        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }\n      }\n    }\n    else {\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\n      }\n    }\n  }\n  return true;\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  uint uVar2;\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  if ((sbp == (uint8_t *)0x0) || (sb_len < 1)) {\n    return false;\n  }\n  uVar2 = *sbp & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return false;\n  }\n  if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = (uint8_t)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < sb_len) {\n        sshp->sense_key = sbp[2] & 0xf;\n      }\n      if (7 < sb_len) {\n        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }\n      }\n    }\n    else {\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\n      }\n    }\n  }\n  return true;\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  uint uVar2;\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  if ((sbp == (uint8_t *)0x0) || (sb_len < 1)) {\n    return false;\n  }\n  uVar2 = *sbp & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return false;\n  }\n  if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = (uint8_t)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < sb_len) {\n        sshp->sense_key = sbp[2] & 0xf;\n      }\n      if (7 < sb_len) {\n        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }\n      }\n    }\n    else {\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\n      }\n    }\n  }\n  return true;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "uint uVar2;" 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 ')) ;) })) (if_statement "if ((sbp == (uint8_t *)0x0) || (sb_len < 1)) {\n    return false;\n  }" if (parenthesized_expression "((sbp == (uint8_t *)0x0) || (sb_len < 1))" ( (binary_expression "(sbp == (uint8_t *)0x0) || (sb_len < 1)" (parenthesized_expression "(sbp == (uint8_t *)0x0)" ( (binary_expression "sbp == (uint8_t *)0x0" identifier == (cast_expression "(uint8_t *)0x0" ( (type_descriptor "uint8_t *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "(sb_len < 1)" ( (binary_expression "sb_len < 1" identifier < number_literal) ))) )) (compound_statement "{\n    return false;\n  }" { (return_statement "return false;" return false ;) })) (expression_statement "uVar2 = *sbp & 0x7f;" (assignment_expression "uVar2 = *sbp & 0x7f" identifier = (binary_expression "*sbp & 0x7f" (pointer_expression "*sbp" * identifier) & number_literal)) ;) (if_statement "if (3 < uVar2 - 0x70) {\n    return false;\n  }" if (parenthesized_expression "(3 < uVar2 - 0x70)" ( (binary_expression "3 < uVar2 - 0x70" number_literal < (binary_expression "uVar2 - 0x70" identifier - number_literal)) )) (compound_statement "{\n    return false;\n  }" { (return_statement "return false;" return false ;) })) (if_statement "if (sshp != (sg_scsi_sense_hdr *)0x0) {\n    sshp->response_code = (uint8_t)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < sb_len) {\n        sshp->sense_key = sbp[2] & 0xf;\n      }\n      if (7 < sb_len) {\n        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }\n      }\n    }\n    else {\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\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 = (uint8_t)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < sb_len) {\n        sshp->sense_key = sbp[2] & 0xf;\n      }\n      if (7 < sb_len) {\n        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }\n      }\n    }\n    else {\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\n      }\n    }\n  }" { (expression_statement "sshp->response_code = (uint8_t)uVar2;" (assignment_expression "sshp->response_code = (uint8_t)uVar2" (field_expression "sshp->response_code" identifier -> field_identifier) = (cast_expression "(uint8_t)uVar2" ( (type_descriptor "uint8_t" primitive_type) ) identifier)) ;) (if_statement "if (uVar2 < 0x72) {\n      if (2 < sb_len) {\n        sshp->sense_key = sbp[2] & 0xf;\n      }\n      if (7 < sb_len) {\n        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }\n      }\n    }\n    else {\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\n      }\n    }" if (parenthesized_expression "(uVar2 < 0x72)" ( (binary_expression "uVar2 < 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        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (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        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (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        bVar1 = sb_len < 0xd;\n        if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\n        }\n        if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }\n      }" { (expression_statement "bVar1 = sb_len < 0xd;" (assignment_expression "bVar1 = sb_len < 0xd" identifier = (binary_expression "sb_len < 0xd" identifier < number_literal)) ;) (if_statement "if ((int)(sbp[7] + 7) < sb_len) {\n          sb_len = sbp[7] + 8;\n          bVar1 = (uint)sb_len < 0xd;\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          bVar1 = (uint)sb_len < 0xd;\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)) ;) (expression_statement "bVar1 = (uint)sb_len < 0xd;" (assignment_expression "bVar1 = (uint)sb_len < 0xd" identifier = (binary_expression "(uint)sb_len < 0xd" (cast_expression "(uint)sb_len" ( (type_descriptor "uint" type_identifier) ) identifier) < number_literal)) ;) })) (if_statement "if ((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)) {\n          sshp->ascq = sbp[0xd];\n          return true;\n        }" if (parenthesized_expression "((!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd))" ( (binary_expression "(!bVar1) && (sshp->asc = sbp[0xc], sb_len != 0xd)" (parenthesized_expression "(!bVar1)" ( (unary_expression "!bVar1" ! 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 {\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\n      }\n    }" else (compound_statement "{\n      if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }\n      if (7 < sb_len) {\n        sshp->additional_length = sbp[7];\n        return true;\n      }\n    }" { (if_statement "if (sb_len != 1) {\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }" if (parenthesized_expression "(sb_len != 1)" ( (binary_expression "sb_len != 1" identifier != number_literal) )) (compound_statement "{\n        sshp->sense_key = sbp[1] & 0xf;\n        if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }\n        if (3 < sb_len) {\n          sshp->ascq = sbp[3];\n        }\n      }" { (expression_statement "sshp->sense_key = sbp[1] & 0xf;" (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)) ;) (if_statement "if (sb_len != 2) {\n          sshp->asc = sbp[2];\n        }" if (parenthesized_expression "(sb_len != 2)" ( (binary_expression "sb_len != 2" identifier != number_literal) )) (compound_statement "{\n          sshp->asc = sbp[2];\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        return true;\n      }" if (parenthesized_expression "(7 < sb_len)" ( (binary_expression "7 < sb_len" number_literal < identifier) )) (compound_statement "{\n        sshp->additional_length = sbp[7];\n        return true;\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 ])) ;) (return_statement "return true;" return true ;) })) }))) })) (return_statement "return true;" return true ;) })))
(translation_unit "undefined4 sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)\n\n{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}\n\n" (function_definition "undefined4 sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)\n\n{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}" type_identifier (function_declarator "sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)" identifier (parameter_list "(byte *param_1,uint param_2,undefined1 *param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "undefined1 *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) ))) (compound_statement "{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}" { (declaration "bool bVar1;" primitive_type identifier ;) (declaration "uint uVar2;" type_identifier identifier ;) (if_statement "if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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 != (undefined1 *)0x0)" ( (binary_expression "param_3 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_3 = 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;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" * identifier) = 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) ;) })) (if_statement "if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }" if (parenthesized_expression "((param_1 == (byte *)0x0) || ((int)param_2 < 1))" ( (binary_expression "(param_1 == (byte *)0x0) || ((int)param_2 < 1)" (parenthesized_expression "(param_1 == (byte *)0x0)" ( (binary_expression "param_1 == (byte *)0x0" identifier == (cast_expression "(byte *)0x0" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) || (parenthesized_expression "((int)param_2 < 1)" ( (binary_expression "(int)param_2 < 1" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal) ))) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (expression_statement "uVar2 = *param_1 & 0x7f;" (assignment_expression "uVar2 = *param_1 & 0x7f" identifier = (binary_expression "*param_1 & 0x7f" (pointer_expression "*param_1" * identifier) & number_literal)) ;) (if_statement "if (3 < uVar2 - 0x70) {\n    return 0;\n  }" if (parenthesized_expression "(3 < uVar2 - 0x70)" ( (binary_expression "3 < uVar2 - 0x70" number_literal < (binary_expression "uVar2 - 0x70" identifier - number_literal)) )) (compound_statement "{\n    return 0;\n  }" { (return_statement "return 0;" return number_literal ;) })) (if_statement "if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }" if (parenthesized_expression "(param_3 != (undefined1 *)0x0)" ( (binary_expression "param_3 != (undefined1 *)0x0" identifier != (cast_expression "(undefined1 *)0x0" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }" { (expression_statement "*param_3 = (char)uVar2;" (assignment_expression "*param_3 = (char)uVar2" (pointer_expression "*param_3" * identifier) = (cast_expression "(char)uVar2" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (if_statement "if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" if (parenthesized_expression "(uVar2 < 0x72)" ( (binary_expression "uVar2 < 0x72" identifier < number_literal) )) (compound_statement "{\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }" { (if_statement "if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }" if (parenthesized_expression "(2 < (int)param_2)" ( (binary_expression "2 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) 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 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }" if (parenthesized_expression "(7 < (int)param_2)" ( (binary_expression "7 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }" { (expression_statement "bVar1 = (int)param_2 < 0xd;" (assignment_expression "bVar1 = (int)param_2 < 0xd" identifier = (binary_expression "(int)param_2 < 0xd" (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier) < number_literal)) ;) (if_statement "if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }" if (parenthesized_expression "((int)(param_1[7] + 7) < (int)param_2)" ( (binary_expression "(int)(param_1[7] + 7) < (int)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) ))) < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\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)) ;) (expression_statement "bVar1 = param_2 < 0xd;" (assignment_expression "bVar1 = param_2 < 0xd" identifier = (binary_expression "param_2 < 0xd" identifier < number_literal)) ;) })) (if_statement "if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }" if (parenthesized_expression "((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd))" ( (binary_expression "(!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)" (parenthesized_expression "(!bVar1)" ( (unary_expression "!bVar1" ! 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 1;\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 1;" return number_literal ;) })) })) }) (else_clause "else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" else (compound_statement "{\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" { (if_statement "if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }" if (parenthesized_expression "(param_2 != 1)" ( (binary_expression "param_2 != 1" identifier != number_literal) )) (compound_statement "{\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }" { (expression_statement "param_3[1] = param_1[1] & 0xf;" (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)) ;) (if_statement "if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }" if (parenthesized_expression "(param_2 != 2)" ( (binary_expression "param_2 != 2" identifier != number_literal) )) (compound_statement "{\n          param_3[2] = param_1[2];\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 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }" if (parenthesized_expression "(3 < (int)param_2)" ( (binary_expression "3 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) 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 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }" if (parenthesized_expression "(7 < (int)param_2)" ( (binary_expression "7 < (int)param_2" number_literal < (cast_expression "(int)param_2" ( (type_descriptor "int" primitive_type) ) identifier)) )) (compound_statement "{\n        param_3[7] = param_1[7];\n        return 1;\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 ])) ;) (return_statement "return 1;" return number_literal ;) })) }))) })) (return_statement "return 1;" return number_literal ;) })))
(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 (pointer_expression * IDENT) = 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) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) || (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT) ))) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (assignment_expression IDENT = (binary_expression (pointer_expression * IDENT) & LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < (binary_expression IDENT - LIT)) )) (compound_statement { (return_statement return LIT ;) })) (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) = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) 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 < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) < LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) + LIT) ))) < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (subscript_expression IDENT [ LIT ]) + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT < LIT)) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (unary_expression ! 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 LIT ;) })) })) }) (else_clause else (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression (subscript_expression IDENT [ LIT ]) & LIT)) ;) (if_statement if (parenthesized_expression ( (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 < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) })) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < (cast_expression ( (type_descriptor TYPE) ) IDENT)) )) (compound_statement { (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (return_statement return LIT ;) })) }))) })) (return_statement return LIT ;) })))
(function_definition "undefined4 sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)\n\n{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}" (type_identifier "undefined4") (function_declarator "sg_scsi_normalize_sense(byte *param_1,uint param_2,undefined1 *param_3)" (identifier "sg_scsi_normalize_sense") (parameter_list "(byte *param_1,uint param_2,undefined1 *param_3)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "undefined1 *param_3" (type_identifier "undefined1") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) () ")"))) (compound_statement "{\n  bool bVar1;\n  uint uVar2;\n  \n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }\n  uVar2 = *param_1 & 0x7f;\n  if (3 < uVar2 - 0x70) {\n    return 0;\n  }\n  if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }\n  return 1;\n}" ({ "{") (declaration "bool bVar1;" (primitive_type "bool") (identifier "bVar1") (; ";")) (declaration "uint uVar2;" (type_identifier "uint") (identifier "uVar2") (; ";")) (if_statement "if (param_3 != (undefined1 *)0x0) {\n    *param_3 = 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 != (undefined1 *)0x0)" (( "(") (binary_expression "param_3 != (undefined1 *)0x0" (identifier "param_3") (!= "!=") (cast_expression "(undefined1 *)0x0" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    *param_3 = 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;" (assignment_expression "*param_3 = 0" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (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")) (; ";")) (} "}"))) (if_statement "if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {\n    return 0;\n  }" (if "if") (parenthesized_expression "((param_1 == (byte *)0x0) || ((int)param_2 < 1))" (( "(") (binary_expression "(param_1 == (byte *)0x0) || ((int)param_2 < 1)" (parenthesized_expression "(param_1 == (byte *)0x0)" (( "(") (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"))) () ")")) (|| "||") (parenthesized_expression "((int)param_2 < 1)" (( "(") (binary_expression "(int)param_2 < 1" (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2")) (< "<") (number_literal "1")) () ")"))) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "uVar2 = *param_1 & 0x7f;" (assignment_expression "uVar2 = *param_1 & 0x7f" (identifier "uVar2") (= "=") (binary_expression "*param_1 & 0x7f" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (& "&") (number_literal "0x7f"))) (; ";")) (if_statement "if (3 < uVar2 - 0x70) {\n    return 0;\n  }" (if "if") (parenthesized_expression "(3 < uVar2 - 0x70)" (( "(") (binary_expression "3 < uVar2 - 0x70" (number_literal "3") (< "<") (binary_expression "uVar2 - 0x70" (identifier "uVar2") (- "-") (number_literal "0x70"))) () ")")) (compound_statement "{\n    return 0;\n  }" ({ "{") (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (if_statement "if (param_3 != (undefined1 *)0x0) {\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }" (if "if") (parenthesized_expression "(param_3 != (undefined1 *)0x0)" (( "(") (binary_expression "param_3 != (undefined1 *)0x0" (identifier "param_3") (!= "!=") (cast_expression "(undefined1 *)0x0" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    *param_3 = (char)uVar2;\n    if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }\n  }" ({ "{") (expression_statement "*param_3 = (char)uVar2;" (assignment_expression "*param_3 = (char)uVar2" (pointer_expression "*param_3" (* "*") (identifier "param_3")) (= "=") (cast_expression "(char)uVar2" (( "(") (type_descriptor "char" (primitive_type "char")) () ")") (identifier "uVar2"))) (; ";")) (if_statement "if (uVar2 < 0x72) {\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }\n    else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" (if "if") (parenthesized_expression "(uVar2 < 0x72)" (( "(") (binary_expression "uVar2 < 0x72" (identifier "uVar2") (< "<") (number_literal "0x72")) () ")")) (compound_statement "{\n      if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }\n      if (7 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }\n    }" ({ "{") (if_statement "if (2 < (int)param_2) {\n        param_3[1] = param_1[2] & 0xf;\n      }" (if "if") (parenthesized_expression "(2 < (int)param_2)" (( "(") (binary_expression "2 < (int)param_2" (number_literal "2") (< "<") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (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 < (int)param_2) {\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }" (if "if") (parenthesized_expression "(7 < (int)param_2)" (( "(") (binary_expression "7 < (int)param_2" (number_literal "7") (< "<") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2"))) () ")")) (compound_statement "{\n        bVar1 = (int)param_2 < 0xd;\n        if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }\n        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }\n      }" ({ "{") (expression_statement "bVar1 = (int)param_2 < 0xd;" (assignment_expression "bVar1 = (int)param_2 < 0xd" (identifier "bVar1") (= "=") (binary_expression "(int)param_2 < 0xd" (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2")) (< "<") (number_literal "0xd"))) (; ";")) (if_statement "if ((int)(param_1[7] + 7) < (int)param_2) {\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\n        }" (if "if") (parenthesized_expression "((int)(param_1[7] + 7) < (int)param_2)" (( "(") (binary_expression "(int)(param_1[7] + 7) < (int)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")) () ")"))) (< "<") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2"))) () ")")) (compound_statement "{\n          param_2 = param_1[7] + 8;\n          bVar1 = param_2 < 0xd;\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"))) (; ";")) (expression_statement "bVar1 = param_2 < 0xd;" (assignment_expression "bVar1 = param_2 < 0xd" (identifier "bVar1") (= "=") (binary_expression "param_2 < 0xd" (identifier "param_2") (< "<") (number_literal "0xd"))) (; ";")) (} "}"))) (if_statement "if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {\n          param_3[3] = param_1[0xd];\n          return 1;\n        }" (if "if") (parenthesized_expression "((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd))" (( "(") (binary_expression "(!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)" (parenthesized_expression "(!bVar1)" (( "(") (unary_expression "!bVar1" (! "!") (identifier "bVar1")) () ")")) (&& "&&") (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 1;\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 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (} "}"))) (} "}")) (else_clause "else {\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" (else "else") (compound_statement "{\n      if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }\n      if (7 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }\n    }" ({ "{") (if_statement "if (param_2 != 1) {\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }" (if "if") (parenthesized_expression "(param_2 != 1)" (( "(") (binary_expression "param_2 != 1" (identifier "param_2") (!= "!=") (number_literal "1")) () ")")) (compound_statement "{\n        param_3[1] = param_1[1] & 0xf;\n        if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }\n        if (3 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }\n      }" ({ "{") (expression_statement "param_3[1] = param_1[1] & 0xf;" (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"))) (; ";")) (if_statement "if (param_2 != 2) {\n          param_3[2] = param_1[2];\n        }" (if "if") (parenthesized_expression "(param_2 != 2)" (( "(") (binary_expression "param_2 != 2" (identifier "param_2") (!= "!=") (number_literal "2")) () ")")) (compound_statement "{\n          param_3[2] = param_1[2];\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 < (int)param_2) {\n          param_3[3] = param_1[3];\n        }" (if "if") (parenthesized_expression "(3 < (int)param_2)" (( "(") (binary_expression "3 < (int)param_2" (number_literal "3") (< "<") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (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 < (int)param_2) {\n        param_3[7] = param_1[7];\n        return 1;\n      }" (if "if") (parenthesized_expression "(7 < (int)param_2)" (( "(") (binary_expression "7 < (int)param_2" (number_literal "7") (< "<") (cast_expression "(int)param_2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_2"))) () ")")) (compound_statement "{\n        param_3[7] = param_1[7];\n        return 1;\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") (] "]"))) (; ";")) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (} "}")))) (} "}"))) (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}")))
(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) 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: (pointer_expression argument: (identifier)) 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))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) right: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal))))) consequence: (compound_statement (return_statement (number_literal)))) (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: (number_literal) right: (binary_expression left: (identifier) right: (number_literal)))) consequence: (compound_statement (return_statement (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (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: (cast_expression type: (type_descriptor type: (primitive_type)) value: (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: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal)))) (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: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (unary_expression argument: (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 (number_literal))))))) alternative: (else_clause (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) 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: (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: (cast_expression type: (type_descriptor type: (primitive_type)) value: (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: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)))) 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 (number_literal))))))))) (return_statement (number_literal)))))

undefined4 MASKED(byte *param_1,uint param_2,undefined1 *param_3)

{
  bool bVar1;
  uint uVar2;
  
  if (param_3 != (undefined1 *)0x0) {
    *param_3 = 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;
  }
  if ((param_1 == (byte *)0x0) || ((int)param_2 < 1)) {
    return 0;
  }
  uVar2 = *param_1 & 0x7f;
  if (3 < uVar2 - 0x70) {
    return 0;
  }
  if (param_3 != (undefined1 *)0x0) {
    *param_3 = (char)uVar2;
    if (uVar2 < 0x72) {
      if (2 < (int)param_2) {
        param_3[1] = param_1[2] & 0xf;
      }
      if (7 < (int)param_2) {
        bVar1 = (int)param_2 < 0xd;
        if ((int)(param_1[7] + 7) < (int)param_2) {
          param_2 = param_1[7] + 8;
          bVar1 = param_2 < 0xd;
        }
        if ((!bVar1) && (param_3[2] = param_1[0xc], param_2 != 0xd)) {
          param_3[3] = param_1[0xd];
          return 1;
        }
      }
    }
    else {
      if (param_2 != 1) {
        param_3[1] = param_1[1] & 0xf;
        if (param_2 != 2) {
          param_3[2] = param_1[2];
        }
        if (3 < (int)param_2) {
          param_3[3] = param_1[3];
        }
      }
      if (7 < (int)param_2) {
        param_3[7] = param_1[7];
        return 1;
      }
    }
  }
  return 1;
}

