#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);
int /*<<< orphan*/ get_pcb_str(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
void show_start_stop_page(unsigned char *resp, int len, int show_pcb,
                          int verbose) {
  int k, num, extra, pc, pcb;
  unsigned int n;
  unsigned char *ucp;
  char pcb_str[128];
  num = len - 4;
  ucp = &resp[0] + 4;
  if (num < 4) {
    printf("badly formed Start-stop cycle counter log page\n");
    return;
  }
  printf("Start-stop cycle counter log page\n");
  for (k = num; k > 0; k -= extra, ucp += extra) {
    if (k < 3) {
      printf("short Start-stop cycle counter log page\n");
      return;
    }
    extra = ucp[3] + 4;
    pc = (ucp[0] << 8) + ucp[1];
    pcb = ucp[2];
    switch (pc) {
    case 1:
      if (10 == extra)
        printf("  Date of manufacture, year: %.4s, week: %.2s", &ucp[4],
               &ucp[8]);
      else if (verbose) {
        printf("  Date of manufacture parameter length "
               "strange: %d\n",
               extra - 4);
        dStrHex((const char *)ucp, extra, 1);
      }
      break;
    case 2:
      if (10 == extra)
        printf("  Accounting date, year: %.4s, week: %.2s", &ucp[4], &ucp[8]);
      else if (verbose) {
        printf("  Accounting date parameter length strange: %d\n", extra - 4);
        dStrHex((const char *)ucp, extra, 1);
      }
      break;
    case 3:
      if (extra > 7) {
        n = (ucp[4] << 24) | (ucp[5] << 16) | (ucp[6] << 8) | ucp[7];
        if (0xffffffff == n)
          printf("  Specified cycle count over device lifetime "
                 "= -1");
        else
          printf("  Specified cycle count over device lifetime "
                 "= %u",
                 n);
      }
      break;
    case 4:
      if (extra > 7) {
        n = (ucp[4] << 24) | (ucp[5] << 16) | (ucp[6] << 8) | ucp[7];
        if (0xffffffff == n)
          printf("  Accumulated start-stop cycles = -1");
        else
          printf("  Accumulated start-stop cycles = %u", n);
      }
      break;
    case 5:
      if (extra > 7) {
        n = (ucp[4] << 24) | (ucp[5] << 16) | (ucp[6] << 8) | ucp[7];
        if (0xffffffff == n)
          printf("  Specified load-unload count over device lifetime "
                 "= -1");
        else
          printf("  Specified load-unload count over device lifetime "
                 "= %u",
                 n);
      }
      break;
    case 6:
      if (extra > 7) {
        n = (ucp[4] << 24) | (ucp[5] << 16) | (ucp[6] << 8) | ucp[7];
        if (0xffffffff == n)
          printf("  Accumulated load-unload cycles = -1");
        else
          printf("  Accumulated load-unload cycles = %u", n);
      }
      break;
    default:
      printf("  unknown parameter code = 0x%x, contents in hex:\n", pc);
      dStrHex((const char *)ucp, extra, 1);
      break;
    }
    if (show_pcb) {
      get_pcb_str(pcb, pcb_str, sizeof(pcb_str));
      printf("\n        <%s>\n", pcb_str);
    } else
      printf("\n");
  }
}


x86 assembly (clang, -O0):
<show_start_stop_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    117a <show_start_stop_page+0x4a>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    154e <show_start_stop_page+0x41e>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    154e <show_start_stop_page+0x41e>
cmpl   $0x3,-0x18(%rbp)
jge    11b5 <show_start_stop_page+0x85>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    154e <show_start_stop_page+0x41e>
mov    -0x38(%rbp),%rax
movzbl 0x3(%rax),%eax
add    $0x4,%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rax
movzwl (%rax),%eax
shl    $0x10,%eax
bswap  %eax
mov    %eax,-0x24(%rbp)
mov    -0x38(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xc8(%rbp)
sub    $0x5,%eax
ja     14c0 <show_start_stop_page+0x390>
mov    -0xc8(%rbp),%rax
lea    0xdfd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0xa,%eax
cmp    -0x20(%rbp),%eax
jne    123d <show_start_stop_page+0x10d>
mov    -0x38(%rbp),%rsi
add    $0x4,%rsi
mov    -0x38(%rbp),%rdx
add    $0x8,%rdx
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1271 <show_start_stop_page+0x141>
cmpl   $0x0,-0x14(%rbp)
je     126c <show_start_stop_page+0x13c>
mov    -0x20(%rbp),%esi
sub    $0x4,%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    $0x1,%edx
call   1030 <dStrHex@plt>
jmp    1271 <show_start_stop_page+0x141>
jmp    14e2 <show_start_stop_page+0x3b2>
mov    $0xa,%eax
cmp    -0x20(%rbp),%eax
jne    12a7 <show_start_stop_page+0x177>
mov    -0x38(%rbp),%rsi
add    $0x4,%rsi
mov    -0x38(%rbp),%rdx
add    $0x8,%rdx
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12db <show_start_stop_page+0x1ab>
cmpl   $0x0,-0x14(%rbp)
je     12d6 <show_start_stop_page+0x1a6>
mov    -0x20(%rbp),%esi
sub    $0x4,%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    $0x1,%edx
call   1030 <dStrHex@plt>
jmp    12db <show_start_stop_page+0x1ab>
jmp    14e2 <show_start_stop_page+0x3b2>
cmpl   $0x7,-0x20(%rbp)
jle    1353 <show_start_stop_page+0x223>
mov    -0x38(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x18,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    $0xffffffff,%eax
cmp    -0x2c(%rbp),%eax
jne    133d <show_start_stop_page+0x20d>
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    134e <show_start_stop_page+0x21e>
mov    -0x2c(%rbp),%esi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1353 <show_start_stop_page+0x223>
jmp    14e2 <show_start_stop_page+0x3b2>
cmpl   $0x7,-0x20(%rbp)
jle    13cb <show_start_stop_page+0x29b>
mov    -0x38(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x18,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    $0xffffffff,%eax
cmp    -0x2c(%rbp),%eax
jne    13b5 <show_start_stop_page+0x285>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13c6 <show_start_stop_page+0x296>
mov    -0x2c(%rbp),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <show_start_stop_page+0x29b>
jmp    14e2 <show_start_stop_page+0x3b2>
cmpl   $0x7,-0x20(%rbp)
jle    1443 <show_start_stop_page+0x313>
mov    -0x38(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x18,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    $0xffffffff,%eax
cmp    -0x2c(%rbp),%eax
jne    142d <show_start_stop_page+0x2fd>
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    143e <show_start_stop_page+0x30e>
mov    -0x2c(%rbp),%esi
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1443 <show_start_stop_page+0x313>
jmp    14e2 <show_start_stop_page+0x3b2>
cmpl   $0x7,-0x20(%rbp)
jle    14bb <show_start_stop_page+0x38b>
mov    -0x38(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x18,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x6(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x38(%rbp),%rcx
movzbl 0x7(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    $0xffffffff,%eax
cmp    -0x2c(%rbp),%eax
jne    14a5 <show_start_stop_page+0x375>
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14b6 <show_start_stop_page+0x386>
mov    -0x2c(%rbp),%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14bb <show_start_stop_page+0x38b>
jmp    14e2 <show_start_stop_page+0x3b2>
mov    -0x24(%rbp),%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    $0x1,%edx
call   1030 <dStrHex@plt>
cmpl   $0x0,-0x10(%rbp)
je     151a <show_start_stop_page+0x3ea>
mov    -0x28(%rbp),%edi
lea    -0xc0(%rbp),%rsi
mov    $0x80,%edx
call   1050 <get_pcb_str@plt>
lea    -0xc0(%rbp),%rsi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1528 <show_start_stop_page+0x3f8>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    152d <show_start_stop_page+0x3fd>
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x38(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
jmp    118e <show_start_stop_page+0x5e>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_start_stop_page>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
cmp    $0x7,%esi
jg     1183 <show_start_stop_page+0x33>
lea    0x113b(%rip),%rdi
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>
mov    %edx,%r15d
mov    %esi,%r13d
mov    %rdi,%rbp
mov    %ecx,0xc(%rsp)
lea    0x111e(%rip),%rdi
call   1040 <puts@plt>
add    $0xfffffffc,%r13d
add    $0x4,%rbp
jmp    11c6 <show_start_stop_page+0x76>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    %r14,%rbp
sub    %r14d,%r13d
jle    138c <show_start_stop_page+0x23c>
cmp    $0x2,%r13d
jbe    1380 <show_start_stop_page+0x230>
movzbl 0x3(%rbp),%esi
lea    0x4(%rsi),%r14
movzwl 0x0(%rbp),%eax
shl    $0x10,%eax
bswap  %eax
movzbl 0x2(%rbp),%r12d
lea    -0x1(%rax),%ecx
cmp    $0x5,%cx
ja     121d <show_start_stop_page+0xcd>
movzwl %cx,%eax
lea    0xe07(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmp    $0xa,%r14d
jne    12e4 <show_start_stop_page+0x194>
lea    0x4(%rbp),%rsi
lea    0x8(%rbp),%rdx
lea    0xdfd(%rip),%rdi
jmp    1244 <show_start_stop_page+0xf4>
lea    0x101a(%rip),%rdi
mov    %eax,%esi
jmp    1302 <show_start_stop_page+0x1b2>
cmp    $0xa,%r14d
jne    12f4 <show_start_stop_page+0x1a4>
lea    0x4(%rbp),%rsi
lea    0x8(%rbp),%rdx
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r15d,%r15d
jne    1322 <show_start_stop_page+0x1d2>
jmp    11b0 <show_start_stop_page+0x60>
cmp    $0x4,%sil
jb     1319 <show_start_stop_page+0x1c9>
mov    0x4(%rbp),%esi
bswap  %esi
cmp    $0xffffffff,%esi
je     134d <show_start_stop_page+0x1fd>
lea    0xe8e(%rip),%rdi
jmp    12d3 <show_start_stop_page+0x183>
cmp    $0x4,%sil
jb     1319 <show_start_stop_page+0x1c9>
mov    0x4(%rbp),%esi
bswap  %esi
cmp    $0xffffffff,%esi
je     1356 <show_start_stop_page+0x206>
lea    0xec4(%rip),%rdi
jmp    12d3 <show_start_stop_page+0x183>
cmp    $0x4,%sil
jb     1319 <show_start_stop_page+0x1c9>
mov    0x4(%rbp),%esi
bswap  %esi
cmp    $0xffffffff,%esi
je     135f <show_start_stop_page+0x20f>
lea    0xf04(%rip),%rdi
jmp    12d3 <show_start_stop_page+0x183>
cmp    $0x4,%sil
jb     1319 <show_start_stop_page+0x1c9>
mov    0x4(%rbp),%esi
bswap  %esi
cmp    $0xffffffff,%esi
je     1368 <show_start_stop_page+0x218>
lea    0xf45(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r15d,%r15d
jne    1322 <show_start_stop_page+0x1d2>
jmp    11b0 <show_start_stop_page+0x60>
cmpl   $0x0,0xc(%rsp)
je     1319 <show_start_stop_page+0x1c9>
lea    0xd54(%rip),%rdi
jmp    1302 <show_start_stop_page+0x1b2>
cmpl   $0x0,0xc(%rsp)
je     1319 <show_start_stop_page+0x1c9>
lea    0xda2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %r14d,%esi
mov    $0x1,%edx
call   1050 <dStrHex@plt>
test   %r15d,%r15d
je     11b0 <show_start_stop_page+0x60>
mov    %r12d,%edi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x80,%edx
call   1070 <get_pcb_str@plt>
lea    0xf33(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11ba <show_start_stop_page+0x6a>
lea    0xd80(%rip),%rdi
jmp    136f <show_start_stop_page+0x21f>
lea    0xddb(%rip),%rdi
jmp    136f <show_start_stop_page+0x21f>
lea    0xe1c(%rip),%rdi
jmp    136f <show_start_stop_page+0x21f>
lea    0xe83(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
test   %r15d,%r15d
jne    1322 <show_start_stop_page+0x1d2>
jmp    11b0 <show_start_stop_page+0x60>
lea    0xef9(%rip),%rdi
call   1040 <puts@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [48 x i8] c"badly formed Start-stop cycle counter log page\0A\00"
@.str.1 = [35 x i8] c"Start-stop cycle counter log page\0A\00"
@.str.2 = [41 x i8] c"short Start-stop cycle counter log page\0A\00"
@.str.3 = [46 x i8] c" Date of manufacture, year: %.4s, week: %.2s\00"
@.str.4 = [52 x i8] c" Date of manufacture parameter length strange: %d\0A\00"
@.str.5 = [42 x i8] c" Accounting date, year: %.4s, week: %.2s\00"
@.str.6 = [48 x i8] c" Accounting date parameter length strange: %d\0A\00"
@.str.7 = [50 x i8] c" Specified cycle count over device lifetime = -1\00"
@.str.8 = [50 x i8] c" Specified cycle count over device lifetime = %u\00"
@.str.9 = [37 x i8] c" Accumulated start-stop cycles = -1\00"
@.str.10 = [37 x i8] c" Accumulated start-stop cycles = %u\00"
@.str.11 = [56 x i8] c" Specified load-unload count over device lifetime = -1\00"
@.str.12 = [56 x i8] c" Specified load-unload count over device lifetime = %u\00"
@.str.13 = [38 x i8] c" Accumulated load-unload cycles = -1\00"
@.str.14 = [38 x i8] c" Accumulated load-unload cycles = %u\00"
@.str.15 = [51 x i8] c" unknown parameter code = 0x%x, contents in hex:\0A\00"
@.str.16 = [15 x i8] c"\0A <%s>\0A\00"
@.str.17 = [2 x i8] c"\0A\00"
define void @show_start_stop_page(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca [128 x i8]
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%17 = load i32, i32* %6
%18 = sub nsw i32 %17, 4
store i32 %18, i32* %10
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = getelementptr inbounds i8, i8* %20, i64 4
store i8* %21, i8** %15
%22 = load i32, i32* %10
%23 = icmp slt i32 %22, 4
br i1 %23, label %24, label %26
24: ; preds = %4
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
br label %266
26: ; preds = %4
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* %10
store i32 %28, i32* %9
br label %29
29: ; preds = %258, %26
%30 = load i32, i32* %9
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %266
32: ; preds = %29
%33 = load i32, i32* %9
%34 = icmp slt i32 %33, 3
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.2, i64 0, i64 0))
br label %266
37: ; preds = %32
%38 = load i8*, i8** %15
%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* %11
%43 = load i8*, i8** %15
%44 = getelementptr inbounds i8, i8* %43, i64 0
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = shl i32 %46, 8
%48 = load i8*, i8** %15
%49 = getelementptr inbounds i8, i8* %48, i64 1
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = add nsw i32 %47, %51
store i32 %52, i32* %12
%53 = load i8*, i8** %15
%54 = getelementptr inbounds i8, i8* %53, i64 2
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
store i32 %56, i32* %13
%57 = load i32, i32* %12
switch i32 %57, label %240 [
i32 1, label %58
i32 2, label %79
i32 3, label %100
i32 4, label %135
i32 5, label %170
i32 6, label %205
]
58: ; preds = %37
%59 = load i32, i32* %11
%60 = icmp eq i32 10, %59
br i1 %60, label %61, label %67
61: ; preds = %58
%62 = load i8*, i8** %15
%63 = getelementptr inbounds i8, i8* %62, i64 4
%64 = load i8*, i8** %15
%65 = getelementptr inbounds i8, i8* %64, i64 8
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* %63, i8* %65)
br label %78
67: ; preds = %58
%68 = load i32, i32* %8
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %77
70: ; preds = %67
%71 = load i32, i32* %11
%72 = sub nsw i32 %71, 4
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i32 %72)
%74 = load i8*, i8** %15
%75 = load i32, i32* %11
%76 = call i32 @dStrHex(i8* %74, i32 %75, i32 1)
br label %77
77: ; preds = %70, %67
br label %78
78: ; preds = %77, %61
br label %246
79: ; preds = %37
%80 = load i32, i32* %11
%81 = icmp eq i32 10, %80
br i1 %81, label %82, label %88
82: ; preds = %79
%83 = load i8*, i8** %15
%84 = getelementptr inbounds i8, i8* %83, i64 4
%85 = load i8*, i8** %15
%86 = getelementptr inbounds i8, i8* %85, i64 8
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %84, i8* %86)
br label %99
88: ; preds = %79
%89 = load i32, i32* %8
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %98
91: ; preds = %88
%92 = load i32, i32* %11
%93 = sub nsw i32 %92, 4
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %93)
%95 = load i8*, i8** %15
%96 = load i32, i32* %11
%97 = call i32 @dStrHex(i8* %95, i32 %96, i32 1)
br label %98
98: ; preds = %91, %88
br label %99
99: ; preds = %98, %82
br label %246
100: ; preds = %37
%101 = load i32, i32* %11
%102 = icmp sgt i32 %101, 7
br i1 %102, label %103, label %134
103: ; preds = %100
%104 = load i8*, i8** %15
%105 = getelementptr inbounds i8, i8* %104, i64 4
%106 = load i8, i8* %105
%107 = zext i8 %106 to i32
%108 = shl i32 %107, 24
%109 = load i8*, i8** %15
%110 = getelementptr inbounds i8, i8* %109, i64 5
%111 = load i8, i8* %110
%112 = zext i8 %111 to i32
%113 = shl i32 %112, 16
%114 = or i32 %108, %113
%115 = load i8*, i8** %15
%116 = getelementptr inbounds i8, i8* %115, i64 6
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = shl i32 %118, 8
%120 = or i32 %114, %119
%121 = load i8*, i8** %15
%122 = getelementptr inbounds i8, i8* %121, i64 7
%123 = load i8, i8* %122
%124 = zext i8 %123 to i32
%125 = or i32 %120, %124
store i32 %125, i32* %14
%126 = load i32, i32* %14
%127 = icmp eq i32 -1, %126
br i1 %127, label %128, label %130
128: ; preds = %103
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
br label %133
130: ; preds = %103
%131 = load i32, i32* %14
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), i32 %131)
br label %133
133: ; preds = %130, %128
br label %134
134: ; preds = %133, %100
br label %246
135: ; preds = %37
%136 = load i32, i32* %11
%137 = icmp sgt i32 %136, 7
br i1 %137, label %138, label %169
138: ; preds = %135
%139 = load i8*, i8** %15
%140 = getelementptr inbounds i8, i8* %139, i64 4
%141 = load i8, i8* %140
%142 = zext i8 %141 to i32
%143 = shl i32 %142, 24
%144 = load i8*, i8** %15
%145 = getelementptr inbounds i8, i8* %144, i64 5
%146 = load i8, i8* %145
%147 = zext i8 %146 to i32
%148 = shl i32 %147, 16
%149 = or i32 %143, %148
%150 = load i8*, i8** %15
%151 = getelementptr inbounds i8, i8* %150, i64 6
%152 = load i8, i8* %151
%153 = zext i8 %152 to i32
%154 = shl i32 %153, 8
%155 = or i32 %149, %154
%156 = load i8*, i8** %15
%157 = getelementptr inbounds i8, i8* %156, i64 7
%158 = load i8, i8* %157
%159 = zext i8 %158 to i32
%160 = or i32 %155, %159
store i32 %160, i32* %14
%161 = load i32, i32* %14
%162 = icmp eq i32 -1, %161
br i1 %162, label %163, label %165
163: ; preds = %138
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
br label %168
165: ; preds = %138
%166 = load i32, i32* %14
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i32 %166)
br label %168
168: ; preds = %165, %163
br label %169
169: ; preds = %168, %135
br label %246
170: ; preds = %37
%171 = load i32, i32* %11
%172 = icmp sgt i32 %171, 7
br i1 %172, label %173, label %204
173: ; preds = %170
%174 = load i8*, i8** %15
%175 = getelementptr inbounds i8, i8* %174, i64 4
%176 = load i8, i8* %175
%177 = zext i8 %176 to i32
%178 = shl i32 %177, 24
%179 = load i8*, i8** %15
%180 = getelementptr inbounds i8, i8* %179, i64 5
%181 = load i8, i8* %180
%182 = zext i8 %181 to i32
%183 = shl i32 %182, 16
%184 = or i32 %178, %183
%185 = load i8*, i8** %15
%186 = getelementptr inbounds i8, i8* %185, i64 6
%187 = load i8, i8* %186
%188 = zext i8 %187 to i32
%189 = shl i32 %188, 8
%190 = or i32 %184, %189
%191 = load i8*, i8** %15
%192 = getelementptr inbounds i8, i8* %191, i64 7
%193 = load i8, i8* %192
%194 = zext i8 %193 to i32
%195 = or i32 %190, %194
store i32 %195, i32* %14
%196 = load i32, i32* %14
%197 = icmp eq i32 -1, %196
br i1 %197, label %198, label %200
198: ; preds = %173
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0))
br label %203
200: ; preds = %173
%201 = load i32, i32* %14
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.12, i64 0, i64 0), i32 %201)
br label %203
203: ; preds = %200, %198
br label %204
204: ; preds = %203, %170
br label %246
205: ; preds = %37
%206 = load i32, i32* %11
%207 = icmp sgt i32 %206, 7
br i1 %207, label %208, label %239
208: ; preds = %205
%209 = load i8*, i8** %15
%210 = getelementptr inbounds i8, i8* %209, i64 4
%211 = load i8, i8* %210
%212 = zext i8 %211 to i32
%213 = shl i32 %212, 24
%214 = load i8*, i8** %15
%215 = getelementptr inbounds i8, i8* %214, i64 5
%216 = load i8, i8* %215
%217 = zext i8 %216 to i32
%218 = shl i32 %217, 16
%219 = or i32 %213, %218
%220 = load i8*, i8** %15
%221 = getelementptr inbounds i8, i8* %220, i64 6
%222 = load i8, i8* %221
%223 = zext i8 %222 to i32
%224 = shl i32 %223, 8
%225 = or i32 %219, %224
%226 = load i8*, i8** %15
%227 = getelementptr inbounds i8, i8* %226, i64 7
%228 = load i8, i8* %227
%229 = zext i8 %228 to i32
%230 = or i32 %225, %229
store i32 %230, i32* %14
%231 = load i32, i32* %14
%232 = icmp eq i32 -1, %231
br i1 %232, label %233, label %235
233: ; preds = %208
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
br label %238
235: ; preds = %208
%236 = load i32, i32* %14
%237 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0), i32 %236)
br label %238
238: ; preds = %235, %233
br label %239
239: ; preds = %238, %205
br label %246
240: ; preds = %37
%241 = load i32, i32* %12
%242 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0), i32 %241)
%243 = load i8*, i8** %15
%244 = load i32, i32* %11
%245 = call i32 @dStrHex(i8* %243, i32 %244, i32 1)
br label %246
246: ; preds = %240, %239, %204, %169, %134, %99, %78
%247 = load i32, i32* %7
%248 = icmp ne i32 %247, 0
br i1 %248, label %249, label %255
249: ; preds = %246
%250 = load i32, i32* %13
%251 = getelementptr inbounds [128 x i8], [128 x i8]* %16, i64 0, i64 0
%252 = call i32 @get_pcb_str(i32 %250, i8* %251, i32 128)
%253 = getelementptr inbounds [128 x i8], [128 x i8]* %16, i64 0, i64 0
%254 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i8* %253)
br label %257
255: ; preds = %246
%256 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.17, i64 0, i64 0))
br label %257
257: ; preds = %255, %249
br label %258
258: ; preds = %257
%259 = load i32, i32* %11
%260 = load i32, i32* %9
%261 = sub nsw i32 %260, %259
store i32 %261, i32* %9
%262 = load i32, i32* %11
%263 = load i8*, i8** %15
%264 = sext i32 %262 to i64
%265 = getelementptr inbounds i8, i8* %263, i64 %264
store i8* %265, i8** %15
br label %29
266: ; preds = %24, %35, %29
ret void
}

LLVM IR (-O2):
@.str.3 = [46 x i8] c" Date of manufacture, year: %.4s, week: %.2s\00"
@.str.4 = [52 x i8] c" Date of manufacture parameter length strange: %d\0A\00"
@.str.5 = [42 x i8] c" Accounting date, year: %.4s, week: %.2s\00"
@.str.6 = [48 x i8] c" Accounting date parameter length strange: %d\0A\00"
@.str.7 = [50 x i8] c" Specified cycle count over device lifetime = -1\00"
@.str.8 = [50 x i8] c" Specified cycle count over device lifetime = %u\00"
@.str.9 = [37 x i8] c" Accumulated start-stop cycles = -1\00"
@.str.10 = [37 x i8] c" Accumulated start-stop cycles = %u\00"
@.str.11 = [56 x i8] c" Specified load-unload count over device lifetime = -1\00"
@.str.12 = [56 x i8] c" Specified load-unload count over device lifetime = %u\00"
@.str.13 = [38 x i8] c" Accumulated load-unload cycles = -1\00"
@.str.14 = [38 x i8] c" Accumulated load-unload cycles = %u\00"
@.str.15 = [51 x i8] c" unknown parameter code = 0x%x, contents in hex:\0A\00"
@.str.16 = [15 x i8] c"\0A <%s>\0A\00"
@str = [34 x i8] c"Start-stop cycle counter log page\00"
@str.18 = [40 x i8] c"short Start-stop cycle counter log page\00"
@str.19 = [47 x i8] c"badly formed Start-stop cycle counter log page\00"
define void @show_start_stop_page(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = icmp slt i32 %1, 8
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.19, i64 0, i64 0))
br label %176
10: ; preds = %4
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%12 = add nsw i32 %1, -4
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = icmp eq i32 %3, 0
%15 = icmp eq i32 %2, 0
br label %16
16: ; preds = %10, %171
%17 = phi i8* [ %13, %10 ], [ %174, %171 ]
%18 = phi i32 [ %12, %10 ], [ %172, %171 ]
%19 = icmp ult i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.18, i64 0, i64 0))
br label %176
22: ; preds = %16
%23 = getelementptr inbounds i8, i8* %17, i64 3
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = add nuw nsw i32 %25, 4
%27 = load i8, i8* %17
%28 = zext i8 %27 to i32
%29 = shl nuw nsw i32 %28, 8
%30 = getelementptr inbounds i8, i8* %17, i64 1
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = or i32 %29, %32
%34 = getelementptr inbounds i8, i8* %17, i64 2
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = trunc i32 %33 to i16
switch i16 %37, label %162 [
i16 1, label %38
i16 2, label %48
i16 3, label %58
i16 4, label %84
i16 5, label %110
i16 6, label %136
]
38: ; preds = %22
%39 = icmp eq i32 %26, 10
br i1 %39, label %40, label %44
40: ; preds = %38
%41 = getelementptr inbounds i8, i8* %17, i64 4
%42 = getelementptr inbounds i8, i8* %17, i64 8
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), i8* %41, i8* %42)
br label %165
44: ; preds = %38
br i1 %14, label %165, label %45
45: ; preds = %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%47 = call i32 @dStrHex(i8* %17, i32 %26, i32 1)
br label %165
48: ; preds = %22
%49 = icmp eq i32 %26, 10
br i1 %49, label %50, label %54
50: ; preds = %48
%51 = getelementptr inbounds i8, i8* %17, i64 4
%52 = getelementptr inbounds i8, i8* %17, i64 8
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i8* %51, i8* %52)
br label %165
54: ; preds = %48
br i1 %14, label %165, label %55
55: ; preds = %54
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%57 = call i32 @dStrHex(i8* %17, i32 %26, i32 1)
br label %165
58: ; preds = %22
%59 = icmp ugt i8 %24, 3
br i1 %59, label %60, label %165
60: ; preds = %58
%61 = getelementptr inbounds i8, i8* %17, i64 4
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = shl nuw i32 %63, 24
%65 = getelementptr inbounds i8, i8* %17, i64 5
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = shl nuw nsw i32 %67, 16
%69 = or i32 %68, %64
%70 = getelementptr inbounds i8, i8* %17, i64 6
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = shl nuw nsw i32 %72, 8
%74 = or i32 %69, %73
%75 = getelementptr inbounds i8, i8* %17, i64 7
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = or i32 %74, %77
%79 = icmp eq i32 %78, -1
br i1 %79, label %80, label %82
80: ; preds = %60
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
br label %165
82: ; preds = %60
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0), i32 %78)
br label %165
84: ; preds = %22
%85 = icmp ugt i8 %24, 3
br i1 %85, label %86, label %165
86: ; preds = %84
%87 = getelementptr inbounds i8, i8* %17, i64 4
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = shl nuw i32 %89, 24
%91 = getelementptr inbounds i8, i8* %17, i64 5
%92 = load i8, i8* %91
%93 = zext i8 %92 to i32
%94 = shl nuw nsw i32 %93, 16
%95 = or i32 %94, %90
%96 = getelementptr inbounds i8, i8* %17, i64 6
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = shl nuw nsw i32 %98, 8
%100 = or i32 %95, %99
%101 = getelementptr inbounds i8, i8* %17, i64 7
%102 = load i8, i8* %101
%103 = zext i8 %102 to i32
%104 = or i32 %100, %103
%105 = icmp eq i32 %104, -1
br i1 %105, label %106, label %108
106: ; preds = %86
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.9, i64 0, i64 0))
br label %165
108: ; preds = %86
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0), i32 %104)
br label %165
110: ; preds = %22
%111 = icmp ugt i8 %24, 3
br i1 %111, label %112, label %165
112: ; preds = %110
%113 = getelementptr inbounds i8, i8* %17, i64 4
%114 = load i8, i8* %113
%115 = zext i8 %114 to i32
%116 = shl nuw i32 %115, 24
%117 = getelementptr inbounds i8, i8* %17, i64 5
%118 = load i8, i8* %117
%119 = zext i8 %118 to i32
%120 = shl nuw nsw i32 %119, 16
%121 = or i32 %120, %116
%122 = getelementptr inbounds i8, i8* %17, i64 6
%123 = load i8, i8* %122
%124 = zext i8 %123 to i32
%125 = shl nuw nsw i32 %124, 8
%126 = or i32 %121, %125
%127 = getelementptr inbounds i8, i8* %17, i64 7
%128 = load i8, i8* %127
%129 = zext i8 %128 to i32
%130 = or i32 %126, %129
%131 = icmp eq i32 %130, -1
br i1 %131, label %132, label %134
132: ; preds = %112
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0))
br label %165
134: ; preds = %112
%135 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.12, i64 0, i64 0), i32 %130)
br label %165
136: ; preds = %22
%137 = icmp ugt i8 %24, 3
br i1 %137, label %138, label %165
138: ; preds = %136
%139 = getelementptr inbounds i8, i8* %17, i64 4
%140 = load i8, i8* %139
%141 = zext i8 %140 to i32
%142 = shl nuw i32 %141, 24
%143 = getelementptr inbounds i8, i8* %17, i64 5
%144 = load i8, i8* %143
%145 = zext i8 %144 to i32
%146 = shl nuw nsw i32 %145, 16
%147 = or i32 %146, %142
%148 = getelementptr inbounds i8, i8* %17, i64 6
%149 = load i8, i8* %148
%150 = zext i8 %149 to i32
%151 = shl nuw nsw i32 %150, 8
%152 = or i32 %147, %151
%153 = getelementptr inbounds i8, i8* %17, i64 7
%154 = load i8, i8* %153
%155 = zext i8 %154 to i32
%156 = or i32 %152, %155
%157 = icmp eq i32 %156, -1
br i1 %157, label %158, label %160
158: ; preds = %138
%159 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0))
br label %165
160: ; preds = %138
%161 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.14, i64 0, i64 0), i32 %156)
br label %165
162: ; preds = %22
%163 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.15, i64 0, i64 0), i32 %33)
%164 = call i32 @dStrHex(i8* %17, i32 %26, i32 1)
br label %165
165: ; preds = %136, %160, %158, %110, %134, %132, %84, %108, %106, %58, %82, %80, %50, %55, %54, %40, %45, %44, %162
br i1 %15, label %169, label %166
166: ; preds = %165
%167 = call i32 @get_pcb_str(i32 %36, i8* %6, i32 128)
%168 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i8* %6)
br label %171
169: ; preds = %165
%170 = call i32 @putchar(i32 10)
br label %171
171: ; preds = %166, %169
%172 = sub nsw i32 %18, %26
%173 = zext i32 %26 to i64
%174 = getelementptr inbounds i8, i8* %17, i64 %173
%175 = icmp sgt i32 %172, 0
br i1 %175, label %16, label %176
176: ; preds = %171, %20, %8
ret void
}