#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 argc) {
  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)
mov    %edi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
cmpl   $0x42,-0xc(%rbp)
jge    1206 <main+0xe6>
mov    -0xc(%rbp),%edi
call   1040 <foo@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x4,-0xc(%rbp)
jne    116e <main+0x4e>
cmpl   $0x1e,-0x10(%rbp)
je     1169 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11f3 <main+0xd3>
cmpl   $0x6,-0xc(%rbp)
jne    118e <main+0x6e>
cmpl   $0x1e,-0x10(%rbp)
je     1189 <main+0x69>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11ee <main+0xce>
cmpl   $0x9,-0xc(%rbp)
jne    11ae <main+0x8e>
cmpl   $0x1e,-0x10(%rbp)
je     11a9 <main+0x89>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11e9 <main+0xc9>
cmpl   $0xb,-0xc(%rbp)
jne    11ce <main+0xae>
cmpl   $0x1e,-0x10(%rbp)
je     11c9 <main+0xa9>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11e4 <main+0xc4>
cmpl   $0x1f,-0x10(%rbp)
je     11df <main+0xbf>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    11e4 <main+0xc4>
jmp    11e9 <main+0xc9>
jmp    11ee <main+0xce>
jmp    11f3 <main+0xd3>
jmp    11f8 <main+0xd8>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x19>
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(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
store i32 -1, i32* %4
br label %6
6: ; preds = %57, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 66
br i1 %8, label %9, label %60
9: ; preds = %6
%10 = load i32, i32* %4
%11 = call i32 @foo(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 4
br i1 %13, label %14, label %20
14: ; preds = %9
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 30
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %14
br label %56
20: ; preds = %9
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 6
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %5
%25 = icmp ne i32 %24, 30
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %23
br label %55
29: ; preds = %20
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 9
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = load i32, i32* %5
%34 = icmp ne i32 %33, 30
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (...) @abort()
unreachable
37: ; preds = %32
br label %54
38: ; preds = %29
%39 = load i32, i32* %4
%40 = icmp eq i32 %39, 11
br i1 %40, label %41, label %47
41: ; preds = %38
%42 = load i32, i32* %5
%43 = icmp ne i32 %42, 30
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 (...) @abort()
unreachable
46: ; preds = %41
br label %53
47: ; preds = %38
%48 = load i32, i32* %5
%49 = icmp ne i32 %48, 31
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 (...) @abort()
unreachable
52: ; preds = %47
br label %53
53: ; preds = %52, %46
br label %54
54: ; preds = %53, %37
br label %55
55: ; preds = %54, %28
br label %56
56: ; preds = %55, %19
br label %57
57: ; preds = %56
%58 = load i32, i32* %4
%59 = add nsw i32 %58, 1
store i32 %59, i32* %4
br label %6
60: ; preds = %6
ret i32 0
}

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