#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*/ abort();
int foo(int);
int main() {
  int i, r;
  for (i = -1; i < 66; i++) {
    r = foo(i);
    if (i == 4) {
      if (r != 30)
        abort();
    } else if (i == 6) {
      if (r != 30)
        abort();
    } else if (i == 9) {
      if (r != 30)
        abort();
    } else if (i == 11) {
      if (r != 30)
        abort();
    } else if (r != 31)
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x42,-0x8(%rbp)
jge    1203 <main+0xe3>
mov    -0x8(%rbp),%edi
call   1040 <foo@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    116b <main+0x4b>
cmpl   $0x1e,-0xc(%rbp)
je     1166 <main+0x46>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11f0 <main+0xd0>
cmpl   $0x6,-0x8(%rbp)
jne    118b <main+0x6b>
cmpl   $0x1e,-0xc(%rbp)
je     1186 <main+0x66>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11eb <main+0xcb>
cmpl   $0x9,-0x8(%rbp)
jne    11ab <main+0x8b>
cmpl   $0x1e,-0xc(%rbp)
je     11a6 <main+0x86>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11e6 <main+0xc6>
cmpl   $0xb,-0x8(%rbp)
jne    11cb <main+0xab>
cmpl   $0x1e,-0xc(%rbp)
je     11c6 <main+0xa6>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11e1 <main+0xc1>
cmpl   $0x1f,-0xc(%rbp)
je     11dc <main+0xbc>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11e1 <main+0xc1>
jmp    11e6 <main+0xc6>
jmp    11eb <main+0xcb>
jmp    11f0 <main+0xd0>
jmp    11f5 <main+0xd5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
lea    0xed0(%rip),%r14
jmp    1158 <main+0x38>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    $0x1f,%eax
jne    1175 <main+0x55>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebx
cmp    $0x42,%ebx
je     117c <main+0x5c>
mov    %ebx,%edi
call   1040 <foo@plt>
lea    -0x4(%rbx),%ecx
cmp    $0x7,%ecx
ja     1140 <main+0x20>
movslq (%r14,%rcx,4),%rcx
add    %r14,%rcx
jmp    *%rcx
cmp    $0x1e,%eax
je     1150 <main+0x30>
xor    %eax,%eax
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
br label %4
4: ; preds = %55, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 66
br i1 %6, label %7, label %58
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @foo(i32 %8)
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 4
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 30
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %12
br label %54
18: ; preds = %7
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 6
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 30
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (...) @abort()
unreachable
26: ; preds = %21
br label %53
27: ; preds = %18
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 9
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load i32, i32* %3
%32 = icmp ne i32 %31, 30
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (...) @abort()
unreachable
35: ; preds = %30
br label %52
36: ; preds = %27
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 11
br i1 %38, label %39, label %45
39: ; preds = %36
%40 = load i32, i32* %3
%41 = icmp ne i32 %40, 30
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = call i32 (...) @abort()
unreachable
44: ; preds = %39
br label %51
45: ; preds = %36
%46 = load i32, i32* %3
%47 = icmp ne i32 %46, 31
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (...) @abort()
unreachable
50: ; preds = %45
br label %51
51: ; preds = %50, %44
br label %52
52: ; preds = %51, %35
br label %53
53: ; preds = %52, %26
br label %54
54: ; preds = %53, %17
br label %55
55: ; preds = %54
%56 = load i32, i32* %2
%57 = add nsw i32 %56, 1
store i32 %57, i32* %2
br label %4
58: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %24
%2 = phi i32 [ -1, %0 ], [ %25, %24 ]
%3 = tail call i32 @foo(i32 %2)
switch i32 %2, label %20 [
i32 4, label %4
i32 6, label %8
i32 9, label %12
i32 11, label %16
]
4: ; preds = %1
%5 = icmp eq i32 %3, 30
br i1 %5, label %24, label %6
6: ; preds = %4
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = icmp eq i32 %3, 30
br i1 %9, label %24, label %10
10: ; preds = %8
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %1
%13 = icmp eq i32 %3, 30
br i1 %13, label %24, label %14
14: ; preds = %12
%15 = tail call i32 (...) @abort()
unreachable
16: ; preds = %1
%17 = icmp eq i32 %3, 30
br i1 %17, label %24, label %18
18: ; preds = %16
%19 = tail call i32 (...) @abort()
unreachable
20: ; preds = %1
%21 = icmp eq i32 %3, 31
br i1 %21, label %24, label %22
22: ; preds = %20
%23 = tail call i32 (...) @abort()
unreachable
24: ; preds = %4, %12, %20, %16, %8
%25 = add nsw i32 %2, 1
%26 = icmp eq i32 %25, 66
br i1 %26, label %27, label %1
27: ; preds = %24
ret i32 0
}