#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stderr;
int decode_ext_inq_vpd(unsigned char *buff, int len, int quiet) {
  if (len < 7) {
    fprintf(stderr,
            "Extended INQUIRY data VPD page length too "
            "short=%d\n",
            len);
    return 97;
  }
  if (quiet) {
    printf("spt=%d\n", ((buff[4] >> 3) & 0x7));
    printf("grd_chk=%d\n", !!(buff[4] & 0x4));
    printf("app_chk=%d\n", !!(buff[4] & 0x2));
    printf("ref_chk=%d\n", !!(buff[4] & 0x1));
    printf("GRP_SUP=%d\n", !!(buff[5] & 0x10));
    printf("prior_sup=%d\n", !!(buff[5] & 0x8));
    printf("headsup=%d\n", !!(buff[5] & 0x4));
    printf("ordsup=%d\n", !!(buff[5] & 0x2));
    printf("simpsup=%d\n", !!(buff[5] & 0x1));
    printf("corr_d_sup=%d\n", !!(buff[6] & 0x4));
    printf("nv_sup=%d\n", !!(buff[6] & 0x2));
    printf("v_sup=%d\n", !!(buff[6] & 0x1));
    printf("luiclr=%d\n", !!(buff[7] & 0x1));
  } else {
    printf("  SPT: %d  GRD_CHK: %d  APP_CHK: %d  REF_CHK: %d\n",
           ((buff[4] >> 3) & 0x7), !!(buff[4] & 0x4), !!(buff[4] & 0x2),
           !!(buff[4] & 0x1));
    printf("  GRP_SUP: %d  PRIOR_SUP: %d  HEADSUP: %d  ORDSUP: %d  "
           "SIMPSUP: %d\n",
           !!(buff[5] & 0x10), !!(buff[5] & 0x8), !!(buff[5] & 0x4),
           !!(buff[5] & 0x2), !!(buff[5] & 0x1));
    printf("  CORR_D_SUP: %d  NV_SUP: %d  V_SUP: %d  LUICLR: %d\n",
           !!(buff[6] & 0x4), !!(buff[6] & 0x2), !!(buff[6] & 0x1),
           !!(buff[7] & 0x1));
  }
  return 0;
}


x86 assembly (clang, -O0):
<decode_ext_inq_vpd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x7,-0x14(%rbp)
jge    1160 <decode_ext_inq_vpd+0x40>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x61,-0x4(%rbp)
jmp    14e6 <decode_ext_inq_vpd+0x3c6>
cmpl   $0x0,-0x18(%rbp)
je     136b <decode_ext_inq_vpd+0x24b>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%esi
sar    $0x3,%esi
and    $0x7,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x7(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14df <decode_ext_inq_vpd+0x3bf>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%esi
sar    $0x3,%esi
and    $0x7,%esi
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%r8d
lea    0xcf3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%r8d
mov    -0x10(%rbp),%rax
movzbl 0x5(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%r9d
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%esi
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edx
mov    -0x10(%rbp),%rax
movzbl 0x6(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x10(%rbp),%rax
movzbl 0x7(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%r8d
lea    0xc60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_ext_inq_vpd>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x6,%esi
jg     114b <decode_ext_inq_vpd+0x2b>
mov    %esi,%eax
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%edi
lea    0xec6(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    $0x61,%ebp
jmp    1323 <decode_ext_inq_vpd+0x203>
mov    %rdi,%rbx
movzbl 0x4(%rdi),%r8d
test   %edx,%edx
je     128c <decode_ext_inq_vpd+0x16c>
shr    $0x3,%r8d
and    $0x7,%r8d
lea    0xeca(%rip),%rdi
xor    %ebp,%ebp
mov    %r8d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x4(%rbx),%esi
shr    $0x2,%esi
and    $0x1,%esi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x4(%rbx),%esi
shr    %esi
and    $0x1,%esi
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x4(%rbx),%esi
and    $0x1,%esi
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x5(%rbx),%esi
shr    $0x4,%esi
and    $0x1,%esi
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x5(%rbx),%esi
shr    $0x3,%esi
and    $0x1,%esi
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x5(%rbx),%esi
shr    $0x2,%esi
and    $0x1,%esi
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x5(%rbx),%esi
shr    %esi
and    $0x1,%esi
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x5(%rbx),%esi
and    $0x1,%esi
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x6(%rbx),%esi
shr    $0x2,%esi
and    $0x1,%esi
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x6(%rbx),%esi
shr    %esi
and    $0x1,%esi
lea    0xe56(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x6(%rbx),%esi
and    $0x1,%esi
lea    0xe42(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x7(%rbx),%esi
and    $0x1,%esi
lea    0xe37(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1323 <decode_ext_inq_vpd+0x203>
mov    %r8d,%esi
shr    $0x3,%esi
and    $0x7,%esi
mov    %r8d,%edx
shr    $0x2,%edx
and    $0x1,%edx
mov    %r8d,%ecx
shr    %ecx
and    $0x1,%ecx
and    $0x1,%r8d
lea    0xe11(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x5(%rbx),%r9d
mov    %r9d,%esi
shr    $0x4,%esi
and    $0x1,%esi
mov    %r9d,%edx
shr    $0x3,%edx
and    $0x1,%edx
mov    %r9d,%ecx
shr    $0x2,%ecx
and    $0x1,%ecx
mov    %r9d,%r8d
shr    %r8d
and    $0x1,%r8d
and    $0x1,%r9d
lea    0xe05(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movzbl 0x6(%rbx),%ecx
mov    %ecx,%esi
shr    $0x2,%esi
and    $0x1,%esi
mov    %ecx,%edx
shr    %edx
and    $0x1,%edx
and    $0x1,%ecx
movzbl 0x7(%rbx),%r8d
and    $0x1,%r8d
lea    0xe1c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [52 x i8] c"Extended INQUIRY data VPD page length too short=%d\0A\00"
@.str.1 = [8 x i8] c"spt=%d\0A\00"
@.str.2 = [12 x i8] c"grd_chk=%d\0A\00"
@.str.3 = [12 x i8] c"app_chk=%d\0A\00"
@.str.4 = [12 x i8] c"ref_chk=%d\0A\00"
@.str.5 = [12 x i8] c"GRP_SUP=%d\0A\00"
@.str.6 = [14 x i8] c"prior_sup=%d\0A\00"
@.str.7 = [12 x i8] c"headsup=%d\0A\00"
@.str.8 = [11 x i8] c"ordsup=%d\0A\00"
@.str.9 = [12 x i8] c"simpsup=%d\0A\00"
@.str.10 = [15 x i8] c"corr_d_sup=%d\0A\00"
@.str.11 = [11 x i8] c"nv_sup=%d\0A\00"
@.str.12 = [10 x i8] c"v_sup=%d\0A\00"
@.str.13 = [11 x i8] c"luiclr=%d\0A\00"
@.str.14 = [50 x i8] c" SPT: %d GRD_CHK: %d APP_CHK: %d REF_CHK: %d\0A\00"
@.str.15 = [68 x i8] c" GRP_SUP: %d PRIOR_SUP: %d HEADSUP: %d ORDSUP: %d SIMPSUP: %d\0A\00"
@.str.16 = [53 x i8] c" CORR_D_SUP: %d NV_SUP: %d V_SUP: %d LUICLR: %d\0A\00"
define i32 @decode_ext_inq_vpd(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = load i32, i32* %6
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %12)
store i32 97, i32* %4
br label %264
14: ; preds = %3
%15 = load i32, i32* %7
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %145
17: ; preds = %14
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = ashr i32 %21, 3
%23 = and i32 %22, 7
%24 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %23)
%25 = load i8*, i8** %5
%26 = getelementptr inbounds i8, i8* %25, i64 4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = and i32 %28, 4
%30 = icmp ne i32 %29, 0
%31 = xor i1 %30, true
%32 = xor i1 %31, true
%33 = zext i1 %32 to i32
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = load i8*, i8** %5
%36 = getelementptr inbounds i8, i8* %35, i64 4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = and i32 %38, 2
%40 = icmp ne i32 %39, 0
%41 = xor i1 %40, true
%42 = xor i1 %41, true
%43 = zext i1 %42 to i32
%44 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %43)
%45 = load i8*, i8** %5
%46 = getelementptr inbounds i8, i8* %45, i64 4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = and i32 %48, 1
%50 = icmp ne i32 %49, 0
%51 = xor i1 %50, true
%52 = xor i1 %51, true
%53 = zext i1 %52 to i32
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %53)
%55 = load i8*, i8** %5
%56 = getelementptr inbounds i8, i8* %55, i64 5
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = and i32 %58, 16
%60 = icmp ne i32 %59, 0
%61 = xor i1 %60, true
%62 = xor i1 %61, true
%63 = zext i1 %62 to i32
%64 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %63)
%65 = load i8*, i8** %5
%66 = getelementptr inbounds i8, i8* %65, i64 5
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = and i32 %68, 8
%70 = icmp ne i32 %69, 0
%71 = xor i1 %70, true
%72 = xor i1 %71, true
%73 = zext i1 %72 to i32
%74 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %73)
%75 = load i8*, i8** %5
%76 = getelementptr inbounds i8, i8* %75, i64 5
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = and i32 %78, 4
%80 = icmp ne i32 %79, 0
%81 = xor i1 %80, true
%82 = xor i1 %81, true
%83 = zext i1 %82 to i32
%84 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %83)
%85 = load i8*, i8** %5
%86 = getelementptr inbounds i8, i8* %85, i64 5
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = and i32 %88, 2
%90 = icmp ne i32 %89, 0
%91 = xor i1 %90, true
%92 = xor i1 %91, true
%93 = zext i1 %92 to i32
%94 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %93)
%95 = load i8*, i8** %5
%96 = getelementptr inbounds i8, i8* %95, i64 5
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = and i32 %98, 1
%100 = icmp ne i32 %99, 0
%101 = xor i1 %100, true
%102 = xor i1 %101, true
%103 = zext i1 %102 to i32
%104 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %103)
%105 = load i8*, i8** %5
%106 = getelementptr inbounds i8, i8* %105, i64 6
%107 = load i8, i8* %106
%108 = zext i8 %107 to i32
%109 = and i32 %108, 4
%110 = icmp ne i32 %109, 0
%111 = xor i1 %110, true
%112 = xor i1 %111, true
%113 = zext i1 %112 to i32
%114 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %113)
%115 = load i8*, i8** %5
%116 = getelementptr inbounds i8, i8* %115, i64 6
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = and i32 %118, 2
%120 = icmp ne i32 %119, 0
%121 = xor i1 %120, true
%122 = xor i1 %121, true
%123 = zext i1 %122 to i32
%124 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i32 %123)
%125 = load i8*, i8** %5
%126 = getelementptr inbounds i8, i8* %125, i64 6
%127 = load i8, i8* %126
%128 = zext i8 %127 to i32
%129 = and i32 %128, 1
%130 = icmp ne i32 %129, 0
%131 = xor i1 %130, true
%132 = xor i1 %131, true
%133 = zext i1 %132 to i32
%134 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %133)
%135 = load i8*, i8** %5
%136 = getelementptr inbounds i8, i8* %135, i64 7
%137 = load i8, i8* %136
%138 = zext i8 %137 to i32
%139 = and i32 %138, 1
%140 = icmp ne i32 %139, 0
%141 = xor i1 %140, true
%142 = xor i1 %141, true
%143 = zext i1 %142 to i32
%144 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %143)
br label %263
145: ; preds = %14
%146 = load i8*, i8** %5
%147 = getelementptr inbounds i8, i8* %146, i64 4
%148 = load i8, i8* %147
%149 = zext i8 %148 to i32
%150 = ashr i32 %149, 3
%151 = and i32 %150, 7
%152 = load i8*, i8** %5
%153 = getelementptr inbounds i8, i8* %152, i64 4
%154 = load i8, i8* %153
%155 = zext i8 %154 to i32
%156 = and i32 %155, 4
%157 = icmp ne i32 %156, 0
%158 = xor i1 %157, true
%159 = xor i1 %158, true
%160 = zext i1 %159 to i32
%161 = load i8*, i8** %5
%162 = getelementptr inbounds i8, i8* %161, i64 4
%163 = load i8, i8* %162
%164 = zext i8 %163 to i32
%165 = and i32 %164, 2
%166 = icmp ne i32 %165, 0
%167 = xor i1 %166, true
%168 = xor i1 %167, true
%169 = zext i1 %168 to i32
%170 = load i8*, i8** %5
%171 = getelementptr inbounds i8, i8* %170, i64 4
%172 = load i8, i8* %171
%173 = zext i8 %172 to i32
%174 = and i32 %173, 1
%175 = icmp ne i32 %174, 0
%176 = xor i1 %175, true
%177 = xor i1 %176, true
%178 = zext i1 %177 to i32
%179 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.14, i64 0, i64 0), i32 %151, i32 %160, i32 %169, i32 %178)
%180 = load i8*, i8** %5
%181 = getelementptr inbounds i8, i8* %180, i64 5
%182 = load i8, i8* %181
%183 = zext i8 %182 to i32
%184 = and i32 %183, 16
%185 = icmp ne i32 %184, 0
%186 = xor i1 %185, true
%187 = xor i1 %186, true
%188 = zext i1 %187 to i32
%189 = load i8*, i8** %5
%190 = getelementptr inbounds i8, i8* %189, i64 5
%191 = load i8, i8* %190
%192 = zext i8 %191 to i32
%193 = and i32 %192, 8
%194 = icmp ne i32 %193, 0
%195 = xor i1 %194, true
%196 = xor i1 %195, true
%197 = zext i1 %196 to i32
%198 = load i8*, i8** %5
%199 = getelementptr inbounds i8, i8* %198, i64 5
%200 = load i8, i8* %199
%201 = zext i8 %200 to i32
%202 = and i32 %201, 4
%203 = icmp ne i32 %202, 0
%204 = xor i1 %203, true
%205 = xor i1 %204, true
%206 = zext i1 %205 to i32
%207 = load i8*, i8** %5
%208 = getelementptr inbounds i8, i8* %207, i64 5
%209 = load i8, i8* %208
%210 = zext i8 %209 to i32
%211 = and i32 %210, 2
%212 = icmp ne i32 %211, 0
%213 = xor i1 %212, true
%214 = xor i1 %213, true
%215 = zext i1 %214 to i32
%216 = load i8*, i8** %5
%217 = getelementptr inbounds i8, i8* %216, i64 5
%218 = load i8, i8* %217
%219 = zext i8 %218 to i32
%220 = and i32 %219, 1
%221 = icmp ne i32 %220, 0
%222 = xor i1 %221, true
%223 = xor i1 %222, true
%224 = zext i1 %223 to i32
%225 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.15, i64 0, i64 0), i32 %188, i32 %197, i32 %206, i32 %215, i32 %224)
%226 = load i8*, i8** %5
%227 = getelementptr inbounds i8, i8* %226, i64 6
%228 = load i8, i8* %227
%229 = zext i8 %228 to i32
%230 = and i32 %229, 4
%231 = icmp ne i32 %230, 0
%232 = xor i1 %231, true
%233 = xor i1 %232, true
%234 = zext i1 %233 to i32
%235 = load i8*, i8** %5
%236 = getelementptr inbounds i8, i8* %235, i64 6
%237 = load i8, i8* %236
%238 = zext i8 %237 to i32
%239 = and i32 %238, 2
%240 = icmp ne i32 %239, 0
%241 = xor i1 %240, true
%242 = xor i1 %241, true
%243 = zext i1 %242 to i32
%244 = load i8*, i8** %5
%245 = getelementptr inbounds i8, i8* %244, i64 6
%246 = load i8, i8* %245
%247 = zext i8 %246 to i32
%248 = and i32 %247, 1
%249 = icmp ne i32 %248, 0
%250 = xor i1 %249, true
%251 = xor i1 %250, true
%252 = zext i1 %251 to i32
%253 = load i8*, i8** %5
%254 = getelementptr inbounds i8, i8* %253, i64 7
%255 = load i8, i8* %254
%256 = zext i8 %255 to i32
%257 = and i32 %256, 1
%258 = icmp ne i32 %257, 0
%259 = xor i1 %258, true
%260 = xor i1 %259, true
%261 = zext i1 %260 to i32
%262 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.16, i64 0, i64 0), i32 %234, i32 %243, i32 %252, i32 %261)
br label %263
263: ; preds = %145, %17
store i32 0, i32* %4
br label %264
264: ; preds = %263, %10
%265 = load i32, i32* %4
ret i32 %265
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [52 x i8] c"Extended INQUIRY data VPD page length too short=%d\0A\00"
@.str.1 = [8 x i8] c"spt=%d\0A\00"
@.str.2 = [12 x i8] c"grd_chk=%d\0A\00"
@.str.3 = [12 x i8] c"app_chk=%d\0A\00"
@.str.4 = [12 x i8] c"ref_chk=%d\0A\00"
@.str.5 = [12 x i8] c"GRP_SUP=%d\0A\00"
@.str.6 = [14 x i8] c"prior_sup=%d\0A\00"
@.str.7 = [12 x i8] c"headsup=%d\0A\00"
@.str.8 = [11 x i8] c"ordsup=%d\0A\00"
@.str.9 = [12 x i8] c"simpsup=%d\0A\00"
@.str.10 = [15 x i8] c"corr_d_sup=%d\0A\00"
@.str.11 = [11 x i8] c"nv_sup=%d\0A\00"
@.str.12 = [10 x i8] c"v_sup=%d\0A\00"
@.str.13 = [11 x i8] c"luiclr=%d\0A\00"
@.str.14 = [50 x i8] c" SPT: %d GRD_CHK: %d APP_CHK: %d REF_CHK: %d\0A\00"
@.str.15 = [68 x i8] c" GRP_SUP: %d PRIOR_SUP: %d HEADSUP: %d ORDSUP: %d SIMPSUP: %d\0A\00"
@.str.16 = [53 x i8] c" CORR_D_SUP: %d NV_SUP: %d V_SUP: %d LUICLR: %d\0A\00"
define i32 @decode_ext_inq_vpd(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, 7
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %112
8: ; preds = %3
%9 = icmp eq i32 %2, 0
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = load i8, i8* %10
br i1 %9, label %76, label %12
12: ; preds = %8
%13 = lshr i8 %11, 3
%14 = and i8 %13, 7
%15 = zext i8 %14 to i32
%16 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = load i8, i8* %10
%18 = lshr i8 %17, 2
%19 = and i8 %18, 1
%20 = zext i8 %19 to i32
%21 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load i8, i8* %10
%23 = lshr i8 %22, 1
%24 = and i8 %23, 1
%25 = zext i8 %24 to i32
%26 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %25)
%27 = load i8, i8* %10
%28 = and i8 %27, 1
%29 = zext i8 %28 to i32
%30 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds i8, i8* %0, i64 5
%32 = load i8, i8* %31
%33 = lshr i8 %32, 4
%34 = and i8 %33, 1
%35 = zext i8 %34 to i32
%36 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = load i8, i8* %31
%38 = lshr i8 %37, 3
%39 = and i8 %38, 1
%40 = zext i8 %39 to i32
%41 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %40)
%42 = load i8, i8* %31
%43 = lshr i8 %42, 2
%44 = and i8 %43, 1
%45 = zext i8 %44 to i32
%46 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %45)
%47 = load i8, i8* %31
%48 = lshr i8 %47, 1
%49 = and i8 %48, 1
%50 = zext i8 %49 to i32
%51 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 %50)
%52 = load i8, i8* %31
%53 = and i8 %52, 1
%54 = zext i8 %53 to i32
%55 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i32 %54)
%56 = getelementptr inbounds i8, i8* %0, i64 6
%57 = load i8, i8* %56
%58 = lshr i8 %57, 2
%59 = and i8 %58, 1
%60 = zext i8 %59 to i32
%61 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %60)
%62 = load i8, i8* %56
%63 = lshr i8 %62, 1
%64 = and i8 %63, 1
%65 = zext i8 %64 to i32
%66 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.11, i64 0, i64 0), i32 %65)
%67 = load i8, i8* %56
%68 = and i8 %67, 1
%69 = zext i8 %68 to i32
%70 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i32 %69)
%71 = getelementptr inbounds i8, i8* %0, i64 7
%72 = load i8, i8* %71
%73 = and i8 %72, 1
%74 = zext i8 %73 to i32
%75 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 %74)
br label %112
76: ; preds = %8
%77 = zext i8 %11 to i32
%78 = lshr i32 %77, 3
%79 = and i32 %78, 7
%80 = lshr i32 %77, 2
%81 = and i32 %80, 1
%82 = lshr i32 %77, 1
%83 = and i32 %82, 1
%84 = and i32 %77, 1
%85 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.14, i64 0, i64 0), i32 %79, i32 %81, i32 %83, i32 %84)
%86 = getelementptr inbounds i8, i8* %0, i64 5
%87 = load i8, i8* %86
%88 = zext i8 %87 to i32
%89 = lshr i32 %88, 4
%90 = and i32 %89, 1
%91 = lshr i32 %88, 3
%92 = and i32 %91, 1
%93 = lshr i32 %88, 2
%94 = and i32 %93, 1
%95 = lshr i32 %88, 1
%96 = and i32 %95, 1
%97 = and i32 %88, 1
%98 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.15, i64 0, i64 0), i32 %90, i32 %92, i32 %94, i32 %96, i32 %97)
%99 = getelementptr inbounds i8, i8* %0, i64 6
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = lshr i32 %101, 2
%103 = and i32 %102, 1
%104 = lshr i32 %101, 1
%105 = and i32 %104, 1
%106 = and i32 %101, 1
%107 = getelementptr inbounds i8, i8* %0, i64 7
%108 = load i8, i8* %107
%109 = and i8 %108, 1
%110 = zext i8 %109 to i32
%111 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.16, i64 0, i64 0), i32 %103, i32 %105, i32 %106, i32 %110)
br label %112
112: ; preds = %12, %76, %5
%113 = phi i32 [ 97, %5 ], [ 0, %76 ], [ 0, %12 ]
ret i32 %113
}