#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 */
typedef int /*<<< orphan*/ pcb_str;

/* Variables and functions */
int /*<<< orphan*/ dStrHex(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ get_pcb_str(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
void show_non_volatile_cache_page(unsigned char *resp, int len, int show_pcb) {
  int j, num, pl, pc, pcb;
  unsigned char *ucp;
  char pcb_str[128];
  printf("Non-volatile cache page (sbc-2) [0x17]\n");
  num = len - 4;
  ucp = &resp[0] + 4;
  while (num > 3) {
    pc = (ucp[0] << 8) | ucp[1];
    pcb = ucp[2];
    pl = ucp[3] + 4;
    switch (pc) {
    case 0:
      printf("  Remaining non-volatile time: ");
      if (3 == ucp[4]) {
        j = (ucp[5] << 16) + (ucp[6] << 8) + ucp[7];
        switch (j) {
        case 0:
          printf("0 (i.e. it is now volatile)\n");
          break;
        case 1:
          printf("<unknown>\n");
          break;
        case 0xffffff:
          printf("<indefinite>\n");
          break;
        default:
          printf("%d minutes [%d:%d]\n", j, (j / 60), (j % 60));
          break;
        }
      } else
        printf("<unexpected parameter length=%d>\n", ucp[4]);
      break;
    case 1:
      printf("  Maximum non-volatile time: ");
      if (3 == ucp[4]) {
        j = (ucp[5] << 16) + (ucp[6] << 8) + ucp[7];
        switch (j) {
        case 0:
          printf("0 (i.e. it is now volatile)\n");
          break;
        case 1:
          printf("<reserved>\n");
          break;
        case 0xffffff:
          printf("<indefinite>\n");
          break;
        default:
          printf("%d minutes [%d:%d]\n", j, (j / 60), (j % 60));
          break;
        }
      } else
        printf("<unexpected parameter length=%d>\n", ucp[4]);
      break;
    default:
      printf("  Unknown Format status code = 0x%x\n", pc);
      dStrHex((const char *)ucp, pl, 0);
      break;
    }
    if (show_pcb) {
      get_pcb_str(pcb, pcb_str, sizeof(pcb_str));
      printf("\n        <%s>\n", pcb_str);
    }
    num -= pl;
    ucp += pl;
  }
}


x86 assembly (clang, -O0):
<show_non_volatile_cache_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x30(%rbp)
cmpl   $0x3,-0x18(%rbp)
jle    1453 <show_non_volatile_cache_page+0x323>
mov    -0x30(%rbp),%rax
movzwl (%rax),%eax
shl    $0x10,%eax
bswap  %eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x30(%rbp),%rax
movzbl 0x3(%rax),%eax
add    $0x4,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0xb4(%rbp)
test   %eax,%eax
je     11c4 <show_non_volatile_cache_page+0x94>
jmp    11b0 <show_non_volatile_cache_page+0x80>
mov    -0xb4(%rbp),%eax
sub    $0x1,%eax
je     12d2 <show_non_volatile_cache_page+0x1a2>
jmp    13e0 <show_non_volatile_cache_page+0x2b0>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
jne    12b7 <show_non_volatile_cache_page+0x187>
mov    -0x30(%rbp),%rcx
movzbl 0x5(%rcx),%eax
shl    $0x10,%eax
movzbl 0x6(%rcx),%edx
shl    $0x8,%edx
or     %edx,%eax
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xb8(%rbp)
test   %eax,%eax
je     1244 <show_non_volatile_cache_page+0x114>
jmp    121a <show_non_volatile_cache_page+0xea>
mov    -0xb8(%rbp),%eax
sub    $0x1,%eax
je     1257 <show_non_volatile_cache_page+0x127>
jmp    122e <show_non_volatile_cache_page+0xfe>
mov    -0xb8(%rbp),%eax
sub    $0xffffff,%eax
je     126a <show_non_volatile_cache_page+0x13a>
jmp    127d <show_non_volatile_cache_page+0x14d>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12b2 <show_non_volatile_cache_page+0x182>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12b2 <show_non_volatile_cache_page+0x182>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12b2 <show_non_volatile_cache_page+0x182>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xbc(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0xbc(%rbp),%edx
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12cd <show_non_volatile_cache_page+0x19d>
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%esi
lea    0xdcc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ff <show_non_volatile_cache_page+0x2cf>
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
jne    13c5 <show_non_volatile_cache_page+0x295>
mov    -0x30(%rbp),%rcx
movzbl 0x5(%rcx),%eax
shl    $0x10,%eax
movzbl 0x6(%rcx),%edx
shl    $0x8,%edx
or     %edx,%eax
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc0(%rbp)
test   %eax,%eax
je     1352 <show_non_volatile_cache_page+0x222>
jmp    1328 <show_non_volatile_cache_page+0x1f8>
mov    -0xc0(%rbp),%eax
sub    $0x1,%eax
je     1365 <show_non_volatile_cache_page+0x235>
jmp    133c <show_non_volatile_cache_page+0x20c>
mov    -0xc0(%rbp),%eax
sub    $0xffffff,%eax
je     1378 <show_non_volatile_cache_page+0x248>
jmp    138b <show_non_volatile_cache_page+0x25b>
lea    0xcef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13c0 <show_non_volatile_cache_page+0x290>
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13c0 <show_non_volatile_cache_page+0x290>
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13c0 <show_non_volatile_cache_page+0x290>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc4(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0xc4(%rbp),%edx
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13db <show_non_volatile_cache_page+0x2ab>
mov    -0x30(%rbp),%rax
movzbl 0x4(%rax),%esi
lea    0xcbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13ff <show_non_volatile_cache_page+0x2cf>
mov    -0x20(%rbp),%esi
lea    0xcf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
mov    -0x1c(%rbp),%esi
xor    %edx,%edx
call   1030 <dStrHex@plt>
cmpl   $0x0,-0x10(%rbp)
je     1432 <show_non_volatile_cache_page+0x302>
mov    -0x24(%rbp),%edi
lea    -0xb0(%rbp),%rsi
mov    $0x80,%edx
call   1050 <get_pcb_str@plt>
lea    -0xb0(%rbp),%rsi
lea    0xcd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
jmp    1168 <show_non_volatile_cache_page+0x38>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_non_volatile_cache_page>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xf48(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x8,%ebp
jl     12ff <show_non_volatile_cache_page+0x1bf>
add    $0xfffffffc,%ebp
add    $0x4,%rbx
mov    %rsp,%r12
jmp    118f <show_non_volatile_cache_page+0x4f>
nopw   0x0(%rax,%rax,1)
sub    %r13d,%ebp
add    %r13,%rbx
cmp    $0x3,%ebp
jle    12ff <show_non_volatile_cache_page+0x1bf>
movzwl (%rbx),%esi
shl    $0x10,%esi
bswap  %esi
movzbl 0x2(%rbx),%r15d
movzbl 0x3(%rbx),%r13d
add    $0x4,%r13
cmp    $0x1,%si
je     1210 <show_non_volatile_cache_page+0xd0>
test   %si,%si
jne    1260 <show_non_volatile_cache_page+0x120>
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x4(%rbx),%esi
cmp    $0x3,%esi
jne    1280 <show_non_volatile_cache_page+0x140>
movzbl 0x5(%rbx),%eax
shl    $0x10,%eax
movzbl 0x6(%rbx),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x7(%rbx),%esi
or     %ecx,%esi
cmp    $0xffffff,%esi
je     12bd <show_non_volatile_cache_page+0x17d>
cmp    $0x1,%esi
jne    124e <show_non_volatile_cache_page+0x10e>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
jmp    128e <show_non_volatile_cache_page+0x14e>
nopw   0x0(%rax,%rax,1)
lea    0xe3f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movzbl 0x4(%rbx),%esi
cmp    $0x3,%esi
jne    1280 <show_non_volatile_cache_page+0x140>
movzbl 0x5(%rbx),%eax
shl    $0x10,%eax
movzbl 0x6(%rbx),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
movzbl 0x7(%rbx),%esi
or     %ecx,%esi
cmp    $0xffffff,%esi
je     12bd <show_non_volatile_cache_page+0x17d>
cmp    $0x1,%esi
je     12f1 <show_non_volatile_cache_page+0x1b1>
test   %esi,%esi
jne    12cb <show_non_volatile_cache_page+0x18b>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
jmp    128e <show_non_volatile_cache_page+0x14e>
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %edx,%edx
call   1040 <dStrHex@plt>
jmp    128e <show_non_volatile_cache_page+0x14e>
nopl   (%rax)
lea    0xdad(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
je     1180 <show_non_volatile_cache_page+0x40>
mov    %r15d,%edi
mov    %r12,%rsi
mov    $0x80,%edx
call   1060 <get_pcb_str@plt>
lea    0xdeb(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1180 <show_non_volatile_cache_page+0x40>
lea    0xe16(%rip),%rdi
call   1030 <puts@plt>
jmp    128e <show_non_volatile_cache_page+0x14e>
mov    %esi,%edx
mov    $0x88888889,%eax
imul   %rax,%rdx
shr    $0x25,%rdx
imul   $0x3c,%edx,%eax
mov    %esi,%ecx
sub    %eax,%ecx
lea    0xd38(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    128e <show_non_volatile_cache_page+0x14e>
lea    0xdd7(%rip),%rdi
call   1030 <puts@plt>
jmp    128e <show_non_volatile_cache_page+0x14e>
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Non-volatile cache page (sbc-2) [0x17]\0A\00"
@.str.1 = [32 x i8] c" Remaining non-volatile time: \00"
@.str.2 = [29 x i8] c"0 (i.e. it is now volatile)\0A\00"
@.str.3 = [11 x i8] c"<unknown>\0A\00"
@.str.4 = [14 x i8] c"<indefinite>\0A\00"
@.str.5 = [20 x i8] c"%d minutes [%d:%d]\0A\00"
@.str.6 = [34 x i8] c"<unexpected parameter length=%d>\0A\00"
@.str.7 = [30 x i8] c" Maximum non-volatile time: \00"
@.str.8 = [12 x i8] c"<reserved>\0A\00"
@.str.9 = [37 x i8] c" Unknown Format status code = 0x%x\0A\00"
@.str.10 = [15 x i8] c"\0A <%s>\0A\00"
define void @show_non_volatile_cache_page(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca [128 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 4
store i32 %16, i32* %8
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = getelementptr inbounds i8, i8* %18, i64 4
store i8* %19, i8** %12
br label %20
20: ; preds = %151, %3
%21 = load i32, i32* %8
%22 = icmp sgt i32 %21, 3
br i1 %22, label %23, label %159
23: ; preds = %20
%24 = load i8*, i8** %12
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 8
%29 = load i8*, i8** %12
%30 = getelementptr inbounds i8, i8* %29, i64 1
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = or i32 %28, %32
store i32 %33, i32* %10
%34 = load i8*, i8** %12
%35 = getelementptr inbounds i8, i8* %34, i64 2
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
store i32 %37, i32* %11
%38 = load i8*, i8** %12
%39 = getelementptr inbounds i8, i8* %38, i64 3
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = add nsw i32 %41, 4
store i32 %42, i32* %9
%43 = load i32, i32* %10
switch i32 %43, label %136 [
i32 0, label %44
i32 1, label %90
]
44: ; preds = %23
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%46 = load i8*, i8** %12
%47 = getelementptr inbounds i8, i8* %46, i64 4
%48 = load i8, i8* %47
%49 = zext i8 %48 to i32
%50 = icmp eq i32 3, %49
br i1 %50, label %51, label %83
51: ; preds = %44
%52 = load i8*, i8** %12
%53 = getelementptr inbounds i8, i8* %52, i64 5
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = shl i32 %55, 16
%57 = load i8*, i8** %12
%58 = getelementptr inbounds i8, i8* %57, i64 6
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = shl i32 %60, 8
%62 = add nsw i32 %56, %61
%63 = load i8*, i8** %12
%64 = getelementptr inbounds i8, i8* %63, i64 7
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = add nsw i32 %62, %66
store i32 %67, i32* %7
%68 = load i32, i32* %7
switch i32 %68, label %75 [
i32 0, label %69
i32 1, label %71
i32 16777215, label %73
]
69: ; preds = %51
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %82
71: ; preds = %51
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %82
73: ; preds = %51
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %82
75: ; preds = %51
%76 = load i32, i32* %7
%77 = load i32, i32* %7
%78 = sdiv i32 %77, 60
%79 = load i32, i32* %7
%80 = srem i32 %79, 60
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %76, i32 %78, i32 %80)
br label %82
82: ; preds = %75, %73, %71, %69
br label %89
83: ; preds = %44
%84 = load i8*, i8** %12
%85 = getelementptr inbounds i8, i8* %84, i64 4
%86 = load i8, i8* %85
%87 = zext i8 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %87)
br label %89
89: ; preds = %83, %82
br label %142
90: ; preds = %23
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%92 = load i8*, i8** %12
%93 = getelementptr inbounds i8, i8* %92, i64 4
%94 = load i8, i8* %93
%95 = zext i8 %94 to i32
%96 = icmp eq i32 3, %95
br i1 %96, label %97, label %129
97: ; preds = %90
%98 = load i8*, i8** %12
%99 = getelementptr inbounds i8, i8* %98, i64 5
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = shl i32 %101, 16
%103 = load i8*, i8** %12
%104 = getelementptr inbounds i8, i8* %103, i64 6
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = shl i32 %106, 8
%108 = add nsw i32 %102, %107
%109 = load i8*, i8** %12
%110 = getelementptr inbounds i8, i8* %109, i64 7
%111 = load i8, i8* %110
%112 = zext i8 %111 to i32
%113 = add nsw i32 %108, %112
store i32 %113, i32* %7
%114 = load i32, i32* %7
switch i32 %114, label %121 [
i32 0, label %115
i32 1, label %117
i32 16777215, label %119
]
115: ; preds = %97
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %128
117: ; preds = %97
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %128
119: ; preds = %97
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
br label %128
121: ; preds = %97
%122 = load i32, i32* %7
%123 = load i32, i32* %7
%124 = sdiv i32 %123, 60
%125 = load i32, i32* %7
%126 = srem i32 %125, 60
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %122, i32 %124, i32 %126)
br label %128
128: ; preds = %121, %119, %117, %115
br label %135
129: ; preds = %90
%130 = load i8*, i8** %12
%131 = getelementptr inbounds i8, i8* %130, i64 4
%132 = load i8, i8* %131
%133 = zext i8 %132 to i32
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %133)
br label %135
135: ; preds = %129, %128
br label %142
136: ; preds = %23
%137 = load i32, i32* %10
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i32 %137)
%139 = load i8*, i8** %12
%140 = load i32, i32* %9
%141 = call i32 @dStrHex(i8* %139, i32 %140, i32 0)
br label %142
142: ; preds = %136, %135, %89
%143 = load i32, i32* %6
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %151
145: ; preds = %142
%146 = load i32, i32* %11
%147 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%148 = call i32 @get_pcb_str(i32 %146, i8* %147, i32 128)
%149 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* %149)
br label %151
151: ; preds = %145, %142
%152 = load i32, i32* %9
%153 = load i32, i32* %8
%154 = sub nsw i32 %153, %152
store i32 %154, i32* %8
%155 = load i32, i32* %9
%156 = load i8*, i8** %12
%157 = sext i32 %155 to i64
%158 = getelementptr inbounds i8, i8* %156, i64 %157
store i8* %158, i8** %12
br label %20
159: ; preds = %20
ret void
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c" Remaining non-volatile time: \00"
@.str.5 = [20 x i8] c"%d minutes [%d:%d]\0A\00"
@.str.6 = [34 x i8] c"<unexpected parameter length=%d>\0A\00"
@.str.7 = [30 x i8] c" Maximum non-volatile time: \00"
@.str.9 = [37 x i8] c" Unknown Format status code = 0x%x\0A\00"
@.str.10 = [15 x i8] c"\0A <%s>\0A\00"
@str = [39 x i8] c"Non-volatile cache page (sbc-2) [0x17]\00"
@str.12 = [11 x i8] c"<reserved>\00"
@str.14 = [13 x i8] c"<indefinite>\00"
@str.15 = [10 x i8] c"<unknown>\00"
@str.16 = [28 x i8] c"0 (i.e. it is now volatile)\00"
define void @show_non_volatile_cache_page(i8* %0, i32 %1, i32 %2) {
%4 = alloca [128 x i8]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%7 = icmp sgt i32 %1, 7
br i1 %7, label %8, label %106
8: ; preds = %3
%9 = add nsw i32 %1, -4
%10 = getelementptr inbounds i8, i8* %0, i64 4
%11 = icmp eq i32 %2, 0
br label %12
12: ; preds = %8, %101
%13 = phi i8* [ %10, %8 ], [ %104, %101 ]
%14 = phi i32 [ %9, %8 ], [ %102, %101 ]
%15 = load i8, i8* %13
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = getelementptr inbounds i8, i8* %13, i64 1
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
%22 = getelementptr inbounds i8, i8* %13, i64 2
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = getelementptr inbounds i8, i8* %13, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = add nuw nsw i32 %27, 4
%29 = trunc i32 %21 to i16
switch i16 %29, label %94 [
i16 0, label %30
i16 1, label %62
]
30: ; preds = %12
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%32 = getelementptr inbounds i8, i8* %13, i64 4
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 3
br i1 %34, label %35, label %59
35: ; preds = %30
%36 = getelementptr inbounds i8, i8* %13, i64 5
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = shl nuw nsw i32 %38, 16
%40 = getelementptr inbounds i8, i8* %13, i64 6
%41 = load i8, i8* %40
%42 = zext i8 %41 to i32
%43 = shl nuw nsw i32 %42, 8
%44 = or i32 %43, %39
%45 = getelementptr inbounds i8, i8* %13, i64 7
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = or i32 %44, %47
switch i32 %48, label %55 [
i32 0, label %49
i32 1, label %51
i32 16777215, label %53
]
49: ; preds = %35
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.16, i64 0, i64 0))
br label %97
51: ; preds = %35
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.15, i64 0, i64 0))
br label %97
53: ; preds = %35
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.14, i64 0, i64 0))
br label %97
55: ; preds = %35
%56 = udiv i32 %48, 60
%57 = urem i32 %48, 60
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %48, i32 %56, i32 %57)
br label %97
59: ; preds = %30
%60 = zext i8 %33 to i32
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %60)
br label %97
62: ; preds = %12
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0))
%64 = getelementptr inbounds i8, i8* %13, i64 4
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, 3
br i1 %66, label %67, label %91
67: ; preds = %62
%68 = getelementptr inbounds i8, i8* %13, i64 5
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
%71 = shl nuw nsw i32 %70, 16
%72 = getelementptr inbounds i8, i8* %13, i64 6
%73 = load i8, i8* %72
%74 = zext i8 %73 to i32
%75 = shl nuw nsw i32 %74, 8
%76 = or i32 %75, %71
%77 = getelementptr inbounds i8, i8* %13, i64 7
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = or i32 %76, %79
switch i32 %80, label %87 [
i32 0, label %81
i32 1, label %83
i32 16777215, label %85
]
81: ; preds = %67
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.16, i64 0, i64 0))
br label %97
83: ; preds = %67
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.12, i64 0, i64 0))
br label %97
85: ; preds = %67
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.14, i64 0, i64 0))
br label %97
87: ; preds = %67
%88 = udiv i32 %80, 60
%89 = urem i32 %80, 60
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %80, i32 %88, i32 %89)
br label %97
91: ; preds = %62
%92 = zext i8 %65 to i32
%93 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %92)
br label %97
94: ; preds = %12
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0), i32 %21)
%96 = call i32 @dStrHex(i8* %13, i32 %28, i32 0)
br label %97
97: ; preds = %91, %87, %85, %83, %81, %59, %55, %53, %51, %49, %94
br i1 %11, label %101, label %98
98: ; preds = %97
%99 = call i32 @get_pcb_str(i32 %24, i8* %5, i32 128)
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i8* %5)
br label %101
101: ; preds = %98, %97
%102 = sub nsw i32 %14, %28
%103 = zext i32 %28 to i64
%104 = getelementptr inbounds i8, i8* %13, i64 %103
%105 = icmp sgt i32 %102, 3
br i1 %105, label %12, label %106
106: ; preds = %101, %3
ret void
}