#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 *, unsigned char, ...);
int /*<<< orphan*/ memcpy(char *, unsigned char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
void decode_rdac_vpd_c2(unsigned char *buff, int len) {
  int i, n, v, r, m, p, num_part;
  char part[5];
  if (len < 3) {
    fprintf(stderr,
            "Software Version VPD page length too "
            "short=%d\n",
            len);
    return;
  }
  if (buff[4] != 's' && buff[5] != 'w' && buff[6] != 'r') {
    fprintf(stderr,
            "Invalid page identifier %c%c%c%c, decoding "
            "not possible.\n",
            buff[4], buff[5], buff[6], buff[7]);
    return;
  }
  printf("  Software Version: %d.%d.%d\n", buff[8], buff[9], buff[10]);
  printf("  Software Date: %02x/%02x/%02x\n", buff[11], buff[12], buff[13]);
  printf("  Features:");
  if (buff[14] & 0x01)
    printf(" Dual Active,");
  if (buff[14] & 0x02)
    printf(" Series 3,");
  if (buff[14] & 0x04)
    printf(" Multiple Sub-enclosures,");
  if (buff[14] & 0x08)
    printf(" DCE/DRM,");
  if (buff[14] & 0x10)
    printf(" AVT,");
  printf("\n");
  printf("  Max. #of LUNS: %d\n", buff[15]);
  num_part = (len - 12) / 16;
  n = 16;
  printf("  Partitions: %d\n", num_part);
  for (i = 0; i < num_part; i++) {
    memset(part, 0, 5);
    memcpy(part, &buff[n], 4);
    printf("    Name: %s\n", part);
    n += 4;
    v = buff[n++];
    r = buff[n++];
    m = buff[n++];
    p = buff[n++];
    printf("    Version: %d.%d.%d.%d\n", v, r, m, p);
    n += 3;
    n += 5;
  }
  return;
}


x86 assembly (clang, -O0):
<decode_rdac_vpd_c2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    117b <decode_rdac_vpd_c2+0x3b>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%eax
lea    0xe94(%rip),%rsi
movzbl %al,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    143a <decode_rdac_vpd_c2+0x2fa>
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0x73,%eax
je     11ee <decode_rdac_vpd_c2+0xae>
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
cmp    $0x77,%eax
je     11ee <decode_rdac_vpd_c2+0xae>
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
cmp    $0x72,%eax
je     11ee <decode_rdac_vpd_c2+0xae>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%al
mov    -0x8(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
mov    -0x8(%rbp),%rdx
movzbl 0x6(%rdx),%r8d
mov    -0x8(%rbp),%rdx
movzbl 0x7(%rdx),%r9d
lea    0xe50(%rip),%rsi
movzbl %al,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    143a <decode_rdac_vpd_c2+0x2fa>
mov    -0x8(%rbp),%rax
movzbl 0x8(%rax),%esi
mov    -0x8(%rbp),%rax
movzbl 0x9(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0xa(%rax),%ecx
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xb(%rax),%esi
mov    -0x8(%rbp),%rax
movzbl 0xc(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0xd(%rax),%ecx
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     126a <decode_rdac_vpd_c2+0x12a>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     128c <decode_rdac_vpd_c2+0x14c>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     12ae <decode_rdac_vpd_c2+0x16e>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     12d0 <decode_rdac_vpd_c2+0x190>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xe(%rax),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     12f2 <decode_rdac_vpd_c2+0x1b2>
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl 0xf(%rax),%esi
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,-0x28(%rbp)
movl   $0x10,-0x14(%rbp)
mov    -0x28(%rbp),%esi
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1435 <decode_rdac_vpd_c2+0x2f5>
lea    -0x2d(%rbp),%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <memset@plt>
lea    -0x2d(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    $0x4,%edx
call   1060 <memcpy@plt>
lea    -0x2d(%rbp),%rsi
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xd1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1346 <decode_rdac_vpd_c2+0x206>
jmp    143a <decode_rdac_vpd_c2+0x2fa>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_rdac_vpd_c2>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %esi,%r14d
cmp    $0x2,%esi
jg     118b <decode_rdac_vpd_c2+0x3b>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
movzbl %r14b,%edx
lea    0xe88(%rip),%rsi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fprintf@plt>
mov    %rdi,%rbx
mov    0x4(%rdi),%al
cmp    $0x73,%al
je     11ad <decode_rdac_vpd_c2+0x5d>
movzbl 0x5(%rbx),%ecx
cmp    $0x77,%ecx
je     11ad <decode_rdac_vpd_c2+0x5d>
movzbl 0x6(%rbx),%r8d
cmp    $0x72,%r8d
jne    1356 <decode_rdac_vpd_c2+0x206>
movzbl 0x8(%rbx),%esi
movzbl 0x9(%rbx),%edx
movzbl 0xa(%rbx),%ecx
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xb(%rbx),%esi
movzbl 0xc(%rbx),%edx
movzbl 0xd(%rbx),%ecx
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xe(%rbx),%al
test   $0x1,%al
jne    12ed <decode_rdac_vpd_c2+0x19d>
test   $0x2,%al
jne    1306 <decode_rdac_vpd_c2+0x1b6>
test   $0x4,%al
jne    131f <decode_rdac_vpd_c2+0x1cf>
test   $0x8,%al
jne    1338 <decode_rdac_vpd_c2+0x1e8>
test   $0x10,%al
je     1224 <decode_rdac_vpd_c2+0xd4>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movzbl 0xf(%rbx),%esi
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    -0xc(%r14),%eax
lea    0x3(%r14),%r15d
test   %eax,%eax
cmovns %eax,%r15d
sar    $0x4,%r15d
lea    0xeb3(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1c,%r14d
jb     12e0 <decode_rdac_vpd_c2+0x190>
cmp    $0x2,%r15d
mov    $0x1,%ebp
cmovge %r15d,%ebp
add    $0x10,%rbx
lea    0xb(%rsp),%r14
lea    0xe98(%rip),%r15
lea    0xe9f(%rip),%r12
nopl   (%rax)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1070 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x4(%rbx),%esi
movzbl 0x5(%rbx),%edx
movzbl 0x6(%rbx),%ecx
movzbl 0x7(%rbx),%r8d
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x10,%rbx
add    $0xffffffff,%ebp
jne    1290 <decode_rdac_vpd_c2+0x140>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdc0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xe(%rbx),%al
test   $0x2,%al
je     1202 <decode_rdac_vpd_c2+0xb2>
lea    0xdb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xe(%rbx),%al
test   $0x4,%al
je     120a <decode_rdac_vpd_c2+0xba>
lea    0xda7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xe(%rbx),%al
test   $0x8,%al
je     1212 <decode_rdac_vpd_c2+0xc2>
lea    0xda8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xe(%rbx),%al
test   $0x10,%al
jne    1216 <decode_rdac_vpd_c2+0xc6>
jmp    1224 <decode_rdac_vpd_c2+0xd4>
mov    0x2c83(%rip),%rdx
mov    (%rdx),%edi
movzbl 0x7(%rbx),%r9d
movzbl %al,%edx
lea    0xcc1(%rip),%rsi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Software Version VPD page length too short=%d\0A\00"
@.str.1 = [58 x i8] c"Invalid page identifier %c%c%c%c, decoding not possible.\0A\00"
@.str.2 = [30 x i8] c" Software Version: %d.%d.%d\0A\00"
@.str.3 = [33 x i8] c" Software Date: %02x/%02x/%02x\0A\00"
@.str.4 = [12 x i8] c" Features:\00"
@.str.5 = [14 x i8] c" Dual Active,\00"
@.str.6 = [11 x i8] c" Series 3,\00"
@.str.7 = [26 x i8] c" Multiple Sub-enclosures,\00"
@.str.8 = [10 x i8] c" DCE/DRM,\00"
@.str.9 = [6 x i8] c" AVT,\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [21 x i8] c" Max. #of LUNS: %d\0A\00"
@.str.12 = [18 x i8] c" Partitions: %d\0A\00"
@.str.13 = [14 x i8] c" Name: %s\0A\00"
@.str.14 = [26 x i8] c" Version: %d.%d.%d.%d\0A\00"
define void @decode_rdac_vpd_c2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [5 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %20
15: ; preds = %2
%16 = load i32, i32* @stderr
%17 = load i32, i32* %4
%18 = trunc i32 %17 to i8
%19 = call i32 (i32, i8*, i8, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8 zeroext %18)
br label %198
20: ; preds = %2
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 4
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = icmp ne i32 %24, 115
br i1 %25, label %26, label %56
26: ; preds = %20
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 5
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = icmp ne i32 %30, 119
br i1 %31, label %32, label %56
32: ; preds = %26
%33 = load i8*, i8** %3
%34 = getelementptr inbounds i8, i8* %33, i64 6
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = icmp ne i32 %36, 114
br i1 %37, label %38, label %56
38: ; preds = %32
%39 = load i32, i32* @stderr
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i64 4
%42 = load i8, i8* %41
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i64 5
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 6
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i64 7
%53 = load i8, i8* %52
%54 = zext i8 %53 to i32
%55 = call i32 (i32, i8*, i8, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %42, i32 %46, i32 %50, i32 %54)
br label %198
56: ; preds = %32, %26, %20
%57 = load i8*, i8** %3
%58 = getelementptr inbounds i8, i8* %57, i64 8
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = load i8*, i8** %3
%62 = getelementptr inbounds i8, i8* %61, i64 9
%63 = load i8, i8* %62
%64 = zext i8 %63 to i32
%65 = load i8*, i8** %3
%66 = getelementptr inbounds i8, i8* %65, i64 10
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %60, i32 %64, i32 %68)
%70 = load i8*, i8** %3
%71 = getelementptr inbounds i8, i8* %70, i64 11
%72 = load i8, i8* %71
%73 = zext i8 %72 to i32
%74 = load i8*, i8** %3
%75 = getelementptr inbounds i8, i8* %74, i64 12
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = load i8*, i8** %3
%79 = getelementptr inbounds i8, i8* %78, i64 13
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %73, i32 %77, i32 %81)
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%84 = load i8*, i8** %3
%85 = getelementptr inbounds i8, i8* %84, i64 14
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = and i32 %87, 1
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %92
90: ; preds = %56
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
br label %92
92: ; preds = %90, %56
%93 = load i8*, i8** %3
%94 = getelementptr inbounds i8, i8* %93, i64 14
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = and i32 %96, 2
%98 = icmp ne i32 %97, 0
br i1 %98, label %99, label %101
99: ; preds = %92
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
br label %101
101: ; preds = %99, %92
%102 = load i8*, i8** %3
%103 = getelementptr inbounds i8, i8* %102, i64 14
%104 = load i8, i8* %103
%105 = zext i8 %104 to i32
%106 = and i32 %105, 4
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %110
108: ; preds = %101
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
br label %110
110: ; preds = %108, %101
%111 = load i8*, i8** %3
%112 = getelementptr inbounds i8, i8* %111, i64 14
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = and i32 %114, 8
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %119
117: ; preds = %110
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
br label %119
119: ; preds = %117, %110
%120 = load i8*, i8** %3
%121 = getelementptr inbounds i8, i8* %120, i64 14
%122 = load i8, i8* %121
%123 = zext i8 %122 to i32
%124 = and i32 %123, 16
%125 = icmp ne i32 %124, 0
br i1 %125, label %126, label %128
126: ; preds = %119
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %128
128: ; preds = %126, %119
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%130 = load i8*, i8** %3
%131 = getelementptr inbounds i8, i8* %130, i64 15
%132 = load i8, i8* %131
%133 = zext i8 %132 to i32
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %133)
%135 = load i32, i32* %4
%136 = sub nsw i32 %135, 12
%137 = sdiv i32 %136, 16
store i32 %137, i32* %11
store i32 16, i32* %6
%138 = load i32, i32* %11
%139 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %138)
store i32 0, i32* %5
br label %140
140: ; preds = %194, %128
%141 = load i32, i32* %5
%142 = load i32, i32* %11
%143 = icmp slt i32 %141, %142
br i1 %143, label %144, label %197
144: ; preds = %140
%145 = getelementptr inbounds [5 x i8], [5 x i8]* %12, i64 0, i64 0
%146 = call i32 @memset(i8* %145, i32 0, i32 5)
%147 = getelementptr inbounds [5 x i8], [5 x i8]* %12, i64 0, i64 0
%148 = load i8*, i8** %3
%149 = load i32, i32* %6
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8, i8* %148, i64 %150
%152 = call i32 @memcpy(i8* %147, i8* %151, i32 4)
%153 = getelementptr inbounds [5 x i8], [5 x i8]* %12, i64 0, i64 0
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i8* %153)
%155 = load i32, i32* %6
%156 = add nsw i32 %155, 4
store i32 %156, i32* %6
%157 = load i8*, i8** %3
%158 = load i32, i32* %6
%159 = add nsw i32 %158, 1
store i32 %159, i32* %6
%160 = sext i32 %158 to i64
%161 = getelementptr inbounds i8, i8* %157, i64 %160
%162 = load i8, i8* %161
%163 = zext i8 %162 to i32
store i32 %163, i32* %7
%164 = load i8*, i8** %3
%165 = load i32, i32* %6
%166 = add nsw i32 %165, 1
store i32 %166, i32* %6
%167 = sext i32 %165 to i64
%168 = getelementptr inbounds i8, i8* %164, i64 %167
%169 = load i8, i8* %168
%170 = zext i8 %169 to i32
store i32 %170, i32* %8
%171 = load i8*, i8** %3
%172 = load i32, i32* %6
%173 = add nsw i32 %172, 1
store i32 %173, i32* %6
%174 = sext i32 %172 to i64
%175 = getelementptr inbounds i8, i8* %171, i64 %174
%176 = load i8, i8* %175
%177 = zext i8 %176 to i32
store i32 %177, i32* %9
%178 = load i8*, i8** %3
%179 = load i32, i32* %6
%180 = add nsw i32 %179, 1
store i32 %180, i32* %6
%181 = sext i32 %179 to i64
%182 = getelementptr inbounds i8, i8* %178, i64 %181
%183 = load i8, i8* %182
%184 = zext i8 %183 to i32
store i32 %184, i32* %10
%185 = load i32, i32* %7
%186 = load i32, i32* %8
%187 = load i32, i32* %9
%188 = load i32, i32* %10
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %185, i32 %186, i32 %187, i32 %188)
%190 = load i32, i32* %6
%191 = add nsw i32 %190, 3
store i32 %191, i32* %6
%192 = load i32, i32* %6
%193 = add nsw i32 %192, 5
store i32 %193, i32* %6
br label %194
194: ; preds = %144
%195 = load i32, i32* %5
%196 = add nsw i32 %195, 1
store i32 %196, i32* %5
br label %140
197: ; preds = %140
br label %198
198: ; preds = %197, %38, %15
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Software Version VPD page length too short=%d\0A\00"
@.str.1 = [58 x i8] c"Invalid page identifier %c%c%c%c, decoding not possible.\0A\00"
@.str.2 = [30 x i8] c" Software Version: %d.%d.%d\0A\00"
@.str.3 = [33 x i8] c" Software Date: %02x/%02x/%02x\0A\00"
@.str.4 = [12 x i8] c" Features:\00"
@.str.5 = [14 x i8] c" Dual Active,\00"
@.str.6 = [11 x i8] c" Series 3,\00"
@.str.7 = [26 x i8] c" Multiple Sub-enclosures,\00"
@.str.8 = [10 x i8] c" DCE/DRM,\00"
@.str.9 = [6 x i8] c" AVT,\00"
@.str.11 = [21 x i8] c" Max. #of LUNS: %d\0A\00"
@.str.12 = [18 x i8] c" Partitions: %d\0A\00"
@.str.13 = [14 x i8] c" Name: %s\0A\00"
@.str.14 = [26 x i8] c" Version: %d.%d.%d.%d\0A\00"
define void @decode_rdac_vpd_c2(i8* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %1, 3
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = trunc i32 %1 to i8
%9 = tail call i32 (i32, i8*, i8, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
br label %125
10: ; preds = %2
%11 = getelementptr inbounds i8, i8* %0, i64 4
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 115
br i1 %13, label %30, label %14
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %0, i64 5
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = icmp eq i8 %16, 119
br i1 %18, label %30, label %19
19: ; preds = %14
%20 = getelementptr inbounds i8, i8* %0, i64 6
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 114
br i1 %22, label %30, label %23
23: ; preds = %19
%24 = zext i8 %21 to i32
%25 = load i32, i32* @stderr
%26 = getelementptr inbounds i8, i8* %0, i64 7
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = tail call i32 (i32, i8*, i8, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i8 zeroext %12, i32 %17, i32 %24, i32 %28)
br label %125
30: ; preds = %19, %14, %10
%31 = getelementptr inbounds i8, i8* %0, i64 8
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = getelementptr inbounds i8, i8* %0, i64 9
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = getelementptr inbounds i8, i8* %0, i64 10
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 %36, i32 %39)
%41 = getelementptr inbounds i8, i8* %0, i64 11
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = getelementptr inbounds i8, i8* %0, i64 12
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = getelementptr inbounds i8, i8* %0, i64 13
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %43, i32 %46, i32 %49)
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%52 = getelementptr inbounds i8, i8* %0, i64 14
%53 = load i8, i8* %52
%54 = and i8 %53, 1
%55 = icmp eq i8 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %30
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%58 = load i8, i8* %52
br label %59
59: ; preds = %56, %30
%60 = phi i8 [ %58, %56 ], [ %53, %30 ]
%61 = and i8 %60, 2
%62 = icmp eq i8 %61, 0
br i1 %62, label %66, label %63
63: ; preds = %59
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%65 = load i8, i8* %52
br label %66
66: ; preds = %63, %59
%67 = phi i8 [ %65, %63 ], [ %60, %59 ]
%68 = and i8 %67, 4
%69 = icmp eq i8 %68, 0
br i1 %69, label %73, label %70
70: ; preds = %66
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%72 = load i8, i8* %52
br label %73
73: ; preds = %70, %66
%74 = phi i8 [ %72, %70 ], [ %67, %66 ]
%75 = and i8 %74, 8
%76 = icmp eq i8 %75, 0
br i1 %76, label %80, label %77
77: ; preds = %73
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%79 = load i8, i8* %52
br label %80
80: ; preds = %77, %73
%81 = phi i8 [ %79, %77 ], [ %74, %73 ]
%82 = and i8 %81, 16
%83 = icmp eq i8 %82, 0
br i1 %83, label %86, label %84
84: ; preds = %80
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %86
86: ; preds = %84, %80
%87 = tail call i32 @putchar(i32 10)
%88 = getelementptr inbounds i8, i8* %0, i64 15
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %90)
%92 = add nsw i32 %1, -12
%93 = sdiv i32 %92, 16
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %93)
%95 = icmp ugt i32 %1, 27
br i1 %95, label %96, label %125
96: ; preds = %86
%97 = call i32 @llvm.smax.i32(i32 %93, i32 1)
br label %98
98: ; preds = %96, %98
%99 = phi i64 [ 16, %96 ], [ %122, %98 ]
%100 = phi i32 [ 0, %96 ], [ %123, %98 ]
%101 = call i32 @memset(i8* %4, i32 0, i32 5)
%102 = getelementptr inbounds i8, i8* %0, i64 %99
%103 = call i32 @memcpy(i8* %4, i8* %102, i32 4)
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), i8* %4)
%105 = or i64 %99, 4
%106 = or i64 %99, 5
%107 = getelementptr inbounds i8, i8* %0, i64 %105
%108 = load i8, i8* %107
%109 = zext i8 %108 to i32
%110 = or i64 %99, 6
%111 = getelementptr inbounds i8, i8* %0, i64 %106
%112 = load i8, i8* %111
%113 = zext i8 %112 to i32
%114 = or i64 %99, 7
%115 = getelementptr inbounds i8, i8* %0, i64 %110
%116 = load i8, i8* %115
%117 = zext i8 %116 to i32
%118 = getelementptr inbounds i8, i8* %0, i64 %114
%119 = load i8, i8* %118
%120 = zext i8 %119 to i32
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32 %109, i32 %113, i32 %117, i32 %120)
%122 = add nuw nsw i64 %99, 16
%123 = add nuw nsw i32 %100, 1
%124 = icmp eq i32 %123, %97
br i1 %124, label %125, label %98
125: ; preds = %98, %86, %23, %6
ret void
}