#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, char *);
int ipod_get_keypress();
int /*<<< orphan*/ ipod_init_input();
int /*<<< orphan*/ stderr;
int main() {
  int input;
  char *keyname;
  ipod_init_input();
  for (;;) {
    input = ipod_get_keypress();
    keyname = NULL;
    if (input != -1) {
      if ((input & 0x80)) {
        input = (input & 0x7f);
        switch (input) {
        case 17:
          keyname = "rewind";
          break;
        case 19:
          if (({
                static int scroll_count = 0;
                int use = 0;
                if (++scroll_count >= 13) {
                  scroll_count -= 13;
                  use = 1;
                }
                (use == 1);
              }))
            keyname = "scroll r";
          break;
        case 25:
          keyname = "power";
          break;
        case 28:
          keyname = "action";
          break;
        case 32:
          keyname = "play";
          break;
        case 33:
          keyname = "forward";
          break;
        case 35:
          keyname = "hold";
          break;
        case 38:
          if (({
                static int scroll_count = 0;
                int use = 0;
                if (++scroll_count >= 13) {
                  scroll_count -= 13;
                  use = 1;
                }
                (use == 1);
              }))
            keyname = "scroll l";
          break;
        case 46:
          keyname = "record";
          break;
        case 50:
          keyname = "menu";
          break;
        default:
          keyname = "UNKNOWN!";
          break;
        }
        if (keyname)
          fprintf(stderr, "Lift %i: %s\n", input, keyname);
      } else {
        input = (input & 0x7f);
        switch (input) {
        case 17:
          keyname = "rewind";
          break;
        case 19:
          if (({
                static int scroll_count = 0;
                int use = 0;
                if (++scroll_count >= 13) {
                  scroll_count -= 13;
                  use = 1;
                }
                (use == 1);
              }))
            keyname = "scroll r";
          break;
        case 25:
          keyname = "power";
          break;
        case 28:
          keyname = "action";
          break;
        case 32:
          keyname = "play";
          break;
        case 33:
          keyname = "forward";
          break;
        case 35:
          keyname = "hold";
          break;
        case 38:
          if (({
                static int scroll_count = 0;
                int use = 0;
                if (++scroll_count >= 13) {
                  scroll_count -= 13;
                  use = 1;
                }
                (use == 1);
              }))
            keyname = "scroll l";
          break;
        case 46:
          keyname = "record";
          break;
        case 50:
          keyname = "menu";
          break;
        default:
          keyname = "UNKNOWN!";
          break;
        }
        if (keyname)
          fprintf(stderr, "Press %i: %s\n", input, keyname);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ipod_init_input@plt>
mov    $0x0,%al
call   1030 <ipod_get_keypress@plt>
mov    %eax,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     14c2 <main+0x392>
mov    -0x8(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1318 <main+0x1e8>
mov    -0x8(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffef,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0x21,%eax
ja     12e1 <main+0x1b1>
mov    -0x38(%rbp),%rax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf64(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
movl   $0x0,-0x14(%rbp)
mov    0x2e7a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2e71(%rip)
cmp    $0xd,%eax
jl     11ea <main+0xba>
mov    0x2e62(%rip),%eax
sub    $0xd,%eax
mov    %eax,0x2e59(%rip)
movl   $0x1,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     120e <main+0xde>
lea    0xf0d(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xf06(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xefc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xef3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xee0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
movl   $0x0,-0x1c(%rbp)
mov    0x2dd0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2dc7(%rip)
cmp    $0xd,%eax
jl     1298 <main+0x168>
mov    0x2db8(%rip),%eax
sub    $0xd,%eax
mov    %eax,0x2daf(%rip)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12bc <main+0x18c>
lea    0xe87(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xe80(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xe77(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    12ec <main+0x1bc>
lea    0xe6c(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1313 <main+0x1e3>
mov    0x2ce2(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe4f(%rip),%rsi
call   1050 <fprintf@plt>
jmp    14bd <main+0x38d>
mov    -0x8(%rbp),%eax
and    $0x7f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffef,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0x21,%eax
ja     1486 <main+0x356>
mov    -0x40(%rbp),%rax
lea    0xcbf(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdbf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
movl   $0x0,-0x24(%rbp)
mov    0x2ce1(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2cd8(%rip)
cmp    $0xd,%eax
jl     138f <main+0x25f>
mov    0x2cc9(%rip),%eax
sub    $0xd,%eax
mov    %eax,0x2cc0(%rip)
movl   $0x1,-0x24(%rbp)
cmpl   $0x1,-0x24(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     13b3 <main+0x283>
lea    0xd68(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xd61(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xd57(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xd4e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xd43(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xd3b(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
movl   $0x0,-0x2c(%rbp)
mov    0x2c37(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2c2e(%rip)
cmp    $0xd,%eax
jl     143d <main+0x30d>
mov    0x2c1f(%rip),%eax
sub    $0xd,%eax
mov    %eax,0x2c16(%rip)
movl   $0x1,-0x2c(%rbp)
cmpl   $0x1,-0x2c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x30(%rbp)
je     1461 <main+0x331>
lea    0xce2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xcdb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xcd2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1491 <main+0x361>
lea    0xcc7(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     14b8 <main+0x388>
mov    0x2b3d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xcb7(%rip),%rsi
call   1050 <fprintf@plt>
jmp    14bd <main+0x38d>
jmp    14c2 <main+0x392>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <ipod_init_input@plt>
lea    0xfc7(%rip),%rbx
mov    0x2e90(%rip),%r13
lea    0x1013(%rip),%r14
lea    0xf2a(%rip),%rbp
lea    0xff8(%rip),%r15
lea    0xe94(%rip),%r12
jmp    118e <main+0x5e>
lea    0xfda(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%r13),%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1030 <ipod_get_keypress@plt>
cmp    $0xffffffff,%eax
je     118e <main+0x5e>
mov    %eax,%ecx
and    $0x7f,%eax
test   $0x80,%cl
jne    11e0 <main+0xb0>
lea    -0x11(%rax),%ecx
cmp    $0x21,%ecx
ja     1222 <main+0xf2>
movslq 0x0(%rbp,%rcx,4),%rdx
add    %rbp,%rdx
mov    %rbx,%rcx
jmp    *%rdx
mov    0x2e89(%rip),%edx
lea    0x1(%rdx),%esi
lea    -0xc(%rdx),%edi
lea    0xf4b(%rip),%rcx
cmp    $0xc,%edx
cmovl  %esi,%edi
mov    %edi,0x2e70(%rip)
jl     118e <main+0x5e>
jmp    1290 <main+0x160>
nop
lea    -0x11(%rax),%ecx
cmp    $0x21,%ecx
ja     129c <main+0x16c>
movslq (%r12,%rcx,4),%rdx
add    %r12,%rdx
mov    %rbx,%rcx
jmp    *%rdx
mov    0x2e3e(%rip),%edx
lea    0x1(%rdx),%esi
lea    -0xc(%rdx),%edi
lea    0xf0c(%rip),%rcx
cmp    $0xc,%edx
cmovl  %esi,%edi
mov    %edi,0x2e25(%rip)
jl     118e <main+0x5e>
jmp    1180 <main+0x50>
lea    0xf2b(%rip),%rcx
jmp    1290 <main+0x160>
lea    0xeee(%rip),%rcx
jmp    1290 <main+0x160>
lea    0xeeb(%rip),%rcx
jmp    1290 <main+0x160>
lea    0xee9(%rip),%rcx
jmp    1290 <main+0x160>
lea    0xee5(%rip),%rcx
jmp    1290 <main+0x160>
lea    0xee4(%rip),%rcx
jmp    1290 <main+0x160>
mov    0x2dee(%rip),%edx
lea    0x1(%rdx),%esi
lea    -0xc(%rdx),%edi
lea    0xed4(%rip),%rcx
cmp    $0xc,%edx
cmovl  %esi,%edi
mov    %edi,0x2dd5(%rip)
jl     118e <main+0x5e>
jmp    1290 <main+0x160>
lea    0xec2(%rip),%rcx
jmp    1290 <main+0x160>
lea    0xec0(%rip),%rcx
nop
mov    0x0(%r13),%edi
mov    %r14,%rsi
jmp    1187 <main+0x57>
lea    0xeb1(%rip),%rcx
jmp    1180 <main+0x50>
lea    0xe71(%rip),%rcx
jmp    1180 <main+0x50>
lea    0xe6b(%rip),%rcx
jmp    1180 <main+0x50>
lea    0xe66(%rip),%rcx
jmp    1180 <main+0x50>
lea    0xe5f(%rip),%rcx
jmp    1180 <main+0x50>
lea    0xe5b(%rip),%rcx
jmp    1180 <main+0x50>
mov    0x2d56(%rip),%edx
lea    0x1(%rdx),%esi
lea    -0xc(%rdx),%edi
lea    0xe48(%rip),%rcx
cmp    $0xc,%edx
cmovl  %esi,%edi
mov    %edi,0x2d3d(%rip)
jl     118e <main+0x5e>
jmp    1180 <main+0x50>
lea    0xe33(%rip),%rcx
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [7 x i8] c"rewind\00"
@main.scroll_count = internal global i32 0
@.str.1 = [9 x i8] c"scroll r\00"
@.str.2 = [6 x i8] c"power\00"
@.str.3 = [7 x i8] c"action\00"
@.str.4 = [5 x i8] c"play\00"
@.str.5 = [8 x i8] c"forward\00"
@.str.6 = [5 x i8] c"hold\00"
@main.scroll_count.7 = internal global i32 0
@.str.8 = [9 x i8] c"scroll l\00"
@.str.9 = [7 x i8] c"record\00"
@.str.10 = [5 x i8] c"menu\00"
@.str.11 = [9 x i8] c"UNKNOWN!\00"
@stderr = global i32 0
@.str.12 = [13 x i8] c"Lift %i: %s\0A\00"
@main.scroll_count.13 = internal global i32 0
@main.scroll_count.14 = internal global i32 0
@.str.15 = [14 x i8] c"Press %i: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%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
store i32 0, i32* %1
%12 = call i32 (...) @ipod_init_input()
br label %13
13: ; preds = %126, %0
%14 = call i32 (...) @ipod_get_keypress()
store i32 %14, i32* %2
store i8* null, i8** %3
%15 = load i32, i32* %2
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %126
17: ; preds = %13
%18 = load i32, i32* %2
%19 = and i32 %18, 128
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %73
21: ; preds = %17
%22 = load i32, i32* %2
%23 = and i32 %22, 127
store i32 %23, i32* %2
%24 = load i32, i32* %2
switch i32 %24, label %63 [
i32 17, label %25
i32 19, label %26
i32 25, label %41
i32 28, label %42
i32 32, label %43
i32 33, label %44
i32 35, label %45
i32 38, label %46
i32 46, label %61
i32 50, label %62
]
25: ; preds = %21
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
br label %64
26: ; preds = %21
store i32 0, i32* %4
%27 = load i32, i32* @main.scroll_count
%28 = add nsw i32 %27, 1
store i32 %28, i32* @main.scroll_count
%29 = icmp sge i32 %28, 13
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* @main.scroll_count
%32 = sub nsw i32 %31, 13
store i32 %32, i32* @main.scroll_count
store i32 1, i32* %4
br label %33
33: ; preds = %30, %26
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 1
%36 = zext i1 %35 to i32
store i32 %36, i32* %5
%37 = load i32, i32* %5
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %33
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %40
40: ; preds = %39, %33
br label %64
41: ; preds = %21
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %64
42: ; preds = %21
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %64
43: ; preds = %21
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %64
44: ; preds = %21
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %64
45: ; preds = %21
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %64
46: ; preds = %21
store i32 0, i32* %6
%47 = load i32, i32* @main.scroll_count.7
%48 = add nsw i32 %47, 1
store i32 %48, i32* @main.scroll_count.7
%49 = icmp sge i32 %48, 13
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = load i32, i32* @main.scroll_count.7
%52 = sub nsw i32 %51, 13
store i32 %52, i32* @main.scroll_count.7
store i32 1, i32* %6
br label %53
53: ; preds = %50, %46
%54 = load i32, i32* %6
%55 = icmp eq i32 %54, 1
%56 = zext i1 %55 to i32
store i32 %56, i32* %7
%57 = load i32, i32* %7
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %60
59: ; preds = %53
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %60
60: ; preds = %59, %53
br label %64
61: ; preds = %21
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %64
62: ; preds = %21
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %64
63: ; preds = %21
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %64
64: ; preds = %63, %62, %61, %60, %45, %44, %43, %42, %41, %40, %25
%65 = load i8*, i8** %3
%66 = icmp ne i8* %65, null
br i1 %66, label %67, label %72
67: ; preds = %64
%68 = load i32, i32* @stderr
%69 = load i32, i32* %2
%70 = load i8*, i8** %3
%71 = call i32 @fprintf(i32 %68, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i32 %69, i8* %70)
br label %72
72: ; preds = %67, %64
br label %125
73: ; preds = %17
%74 = load i32, i32* %2
%75 = and i32 %74, 127
store i32 %75, i32* %2
%76 = load i32, i32* %2
switch i32 %76, label %115 [
i32 17, label %77
i32 19, label %78
i32 25, label %93
i32 28, label %94
i32 32, label %95
i32 33, label %96
i32 35, label %97
i32 38, label %98
i32 46, label %113
i32 50, label %114
]
77: ; preds = %73
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
br label %116
78: ; preds = %73
store i32 0, i32* %8
%79 = load i32, i32* @main.scroll_count.13
%80 = add nsw i32 %79, 1
store i32 %80, i32* @main.scroll_count.13
%81 = icmp sge i32 %80, 13
br i1 %81, label %82, label %85
82: ; preds = %78
%83 = load i32, i32* @main.scroll_count.13
%84 = sub nsw i32 %83, 13
store i32 %84, i32* @main.scroll_count.13
store i32 1, i32* %8
br label %85
85: ; preds = %82, %78
%86 = load i32, i32* %8
%87 = icmp eq i32 %86, 1
%88 = zext i1 %87 to i32
store i32 %88, i32* %9
%89 = load i32, i32* %9
%90 = icmp ne i32 %89, 0
br i1 %90, label %91, label %92
91: ; preds = %85
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %92
92: ; preds = %91, %85
br label %116
93: ; preds = %73
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %116
94: ; preds = %73
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %116
95: ; preds = %73
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %116
96: ; preds = %73
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %116
97: ; preds = %73
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %116
98: ; preds = %73
store i32 0, i32* %10
%99 = load i32, i32* @main.scroll_count.14
%100 = add nsw i32 %99, 1
store i32 %100, i32* @main.scroll_count.14
%101 = icmp sge i32 %100, 13
br i1 %101, label %102, label %105
102: ; preds = %98
%103 = load i32, i32* @main.scroll_count.14
%104 = sub nsw i32 %103, 13
store i32 %104, i32* @main.scroll_count.14
store i32 1, i32* %10
br label %105
105: ; preds = %102, %98
%106 = load i32, i32* %10
%107 = icmp eq i32 %106, 1
%108 = zext i1 %107 to i32
store i32 %108, i32* %11
%109 = load i32, i32* %11
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %112
111: ; preds = %105
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %112
112: ; preds = %111, %105
br label %116
113: ; preds = %73
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %116
114: ; preds = %73
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %116
115: ; preds = %73
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %116
116: ; preds = %115, %114, %113, %112, %97, %96, %95, %94, %93, %92, %77
%117 = load i8*, i8** %3
%118 = icmp ne i8* %117, null
br i1 %118, label %119, label %124
119: ; preds = %116
%120 = load i32, i32* @stderr
%121 = load i32, i32* %2
%122 = load i8*, i8** %3
%123 = call i32 @fprintf(i32 %120, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %121, i8* %122)
br label %124
124: ; preds = %119, %116
br label %125
125: ; preds = %124, %72
br label %126
126: ; preds = %125, %13
br label %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"rewind\00"
@main.scroll_count = internal unnamed_addr global i32 0
@.str.1 = [9 x i8] c"scroll r\00"
@.str.2 = [6 x i8] c"power\00"
@.str.3 = [7 x i8] c"action\00"
@.str.4 = [5 x i8] c"play\00"
@.str.5 = [8 x i8] c"forward\00"
@.str.6 = [5 x i8] c"hold\00"
@main.scroll_count.7 = internal unnamed_addr global i32 0
@.str.8 = [9 x i8] c"scroll l\00"
@.str.9 = [7 x i8] c"record\00"
@.str.10 = [5 x i8] c"menu\00"
@.str.11 = [9 x i8] c"UNKNOWN!\00"
@stderr = global i32 0
@.str.12 = [13 x i8] c"Lift %i: %s\0A\00"
@main.scroll_count.13 = internal unnamed_addr global i32 0
@main.scroll_count.14 = internal unnamed_addr global i32 0
@.str.15 = [14 x i8] c"Press %i: %s\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @ipod_init_input()
br label %2
2: ; preds = %38, %0
%3 = tail call i32 (...) @ipod_get_keypress()
%4 = icmp eq i32 %3, -1
br i1 %4, label %38, label %5
5: ; preds = %2
%6 = and i32 %3, 128
%7 = icmp eq i32 %6, 0
%8 = and i32 %3, 127
br i1 %7, label %32, label %9
9: ; preds = %5
switch i32 %8, label %22 [
i32 17, label %28
i32 19, label %10
i32 25, label %15
i32 28, label %16
i32 32, label %17
i32 33, label %18
i32 35, label %19
i32 38, label %23
i32 46, label %20
i32 50, label %21
]
10: ; preds = %9
%11 = load i32, i32* @main.scroll_count
%12 = icmp sgt i32 %11, 11
%13 = select i1 %12, i32 -12, i32 1
%14 = add nsw i32 %13, %11
store i32 %14, i32* @main.scroll_count
br i1 %12, label %28, label %38
15: ; preds = %9
br label %28
16: ; preds = %9
br label %28
17: ; preds = %9
br label %28
18: ; preds = %9
br label %28
19: ; preds = %9
br label %28
20: ; preds = %9
br label %28
21: ; preds = %9
br label %28
22: ; preds = %9
br label %28
23: ; preds = %9
%24 = load i32, i32* @main.scroll_count.7
%25 = icmp sgt i32 %24, 11
%26 = select i1 %25, i32 -12, i32 1
%27 = add nsw i32 %26, %24
store i32 %27, i32* @main.scroll_count.7
br i1 %25, label %28, label %38
28: ; preds = %9, %15, %16, %17, %18, %19, %20, %21, %22, %10, %23
%29 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %23 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %10 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %15 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %16 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %17 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %18 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), %19 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), %20 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), %21 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), %22 ]
%30 = load i32, i32* @stderr
%31 = tail call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i32 %8, i8* %29)
br label %38
32: ; preds = %5
switch i32 %8, label %46 [
i32 17, label %52
i32 19, label %33
i32 25, label %39
i32 28, label %40
i32 32, label %41
i32 33, label %42
i32 35, label %43
i32 38, label %47
i32 46, label %44
i32 50, label %45
]
33: ; preds = %32
%34 = load i32, i32* @main.scroll_count.13
%35 = icmp sgt i32 %34, 11
%36 = select i1 %35, i32 -12, i32 1
%37 = add nsw i32 %36, %34
store i32 %37, i32* @main.scroll_count.13
br i1 %35, label %52, label %38
38: ; preds = %33, %10, %28, %23, %52, %47, %2
br label %2
39: ; preds = %32
br label %52
40: ; preds = %32
br label %52
41: ; preds = %32
br label %52
42: ; preds = %32
br label %52
43: ; preds = %32
br label %52
44: ; preds = %32
br label %52
45: ; preds = %32
br label %52
46: ; preds = %32
br label %52
47: ; preds = %32
%48 = load i32, i32* @main.scroll_count.14
%49 = icmp sgt i32 %48, 11
%50 = select i1 %49, i32 -12, i32 1
%51 = add nsw i32 %50, %48
store i32 %51, i32* @main.scroll_count.14
br i1 %49, label %52, label %38
52: ; preds = %32, %39, %40, %41, %42, %43, %44, %45, %46, %33, %47
%53 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %47 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %33 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %32 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), %39 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), %40 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), %41 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), %42 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), %43 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), %44 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), %45 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), %46 ]
%54 = load i32, i32* @stderr
%55 = tail call i32 @fprintf(i32 %54, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 %8, i8* %53)
br label %38
}