#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*/ printf(char *);
int /*<<< orphan*/ printt(int, char *);
main() {
  int t;
  t = 0;
  if (t)
    printt(t, "failure");
  else
    printt(t, "success");
  t = 1;
  if (t)
    printt(t, "success");
  else
    printt(t, "failure");
  t = 8;
  if (t)
    printt(t, "success");
  else
    printt(t, "failure");
  t = -2;
  if (t)
    printt(t, "success");
  else
    printt(t, "failure");
  printf("\n");
  t = 4;
  printf("switch test: ");
  switch (t) {
  case 3:
    printf("failure");
    break;
  case 4:
    printf("success");
    break;
  case 5:
    printf("failure");
    break;
  }
  printf("\n");
  printf("switch fallthrough test: ");
  switch (t) {
  case 3:
    printf("failure");
    break;
  case 4:
    printf("OKSOFAR: ");
  case 5:
    printf("success if oksofar printed before this in caps");
    break;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1154 <main+0x34>
mov    -0x8(%rbp),%edi
lea    0xeb6(%rip),%rsi
call   1030 <printt@plt>
jmp    1163 <main+0x43>
mov    -0x8(%rbp),%edi
lea    0xeaa(%rip),%rsi
call   1030 <printt@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1188 <main+0x68>
mov    -0x8(%rbp),%edi
lea    0xe8a(%rip),%rsi
call   1030 <printt@plt>
jmp    1197 <main+0x77>
mov    -0x8(%rbp),%edi
lea    0xe6e(%rip),%rsi
call   1030 <printt@plt>
movl   $0x8,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11bc <main+0x9c>
mov    -0x8(%rbp),%edi
lea    0xe56(%rip),%rsi
call   1030 <printt@plt>
jmp    11cb <main+0xab>
mov    -0x8(%rbp),%edi
lea    0xe3a(%rip),%rsi
call   1030 <printt@plt>
movl   $0xfffffffe,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11f0 <main+0xd0>
mov    -0x8(%rbp),%edi
lea    0xe22(%rip),%rsi
call   1030 <printt@plt>
jmp    11ff <main+0xdf>
mov    -0x8(%rbp),%edi
lea    0xe06(%rip),%rsi
call   1030 <printt@plt>
lea    0xe0a(%rip),%rdi
call   1040 <printf@plt>
movl   $0x4,-0x8(%rbp)
lea    0xdf9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3,%eax
je     1254 <main+0x134>
jmp    1232 <main+0x112>
mov    -0xc(%rbp),%eax
sub    $0x4,%eax
je     1265 <main+0x145>
jmp    1243 <main+0x123>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     1276 <main+0x156>
jmp    1282 <main+0x162>
lea    0xda5(%rip),%rdi
call   1040 <printf@plt>
jmp    1282 <main+0x162>
lea    0xd9c(%rip),%rdi
call   1040 <printf@plt>
jmp    1282 <main+0x162>
lea    0xd83(%rip),%rdi
call   1040 <printf@plt>
lea    0xd87(%rip),%rdi
call   1040 <printf@plt>
lea    0xd8b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x3,%eax
je     12d0 <main+0x1b0>
jmp    12ae <main+0x18e>
mov    -0x10(%rbp),%eax
sub    $0x4,%eax
je     12e1 <main+0x1c1>
jmp    12bf <main+0x19f>
mov    -0x10(%rbp),%eax
sub    $0x5,%eax
je     12ed <main+0x1cd>
jmp    12f9 <main+0x1d9>
lea    0xd29(%rip),%rdi
call   1040 <printf@plt>
jmp    12f9 <main+0x1d9>
lea    0xd52(%rip),%rdi
call   1040 <printf@plt>
lea    0xd50(%rip),%rdi
call   1040 <printf@plt>
lea    0xd10(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <printt@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <printt@plt>
mov    $0x8,%edi
mov    %rbx,%rsi
call   1030 <printt@plt>
mov    $0xfffffffe,%edi
mov    %rbx,%rsi
call   1030 <printt@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xe8e(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0xe7e(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8a(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"failure\00"
@.str.1 = [8 x i8] c"success\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [14 x i8] c"switch test: \00"
@.str.4 = [26 x i8] c"switch fallthrough test: \00"
@.str.5 = [10 x i8] c"OKSOFAR: \00"
@.str.6 = [47 x i8] c"success if oksofar printed before this in caps\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* %2
%7 = call i32 @printt(i32 %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @printt(i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
store i32 1, i32* %2
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %2
%16 = call i32 @printt(i32 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %20
17: ; preds = %11
%18 = load i32, i32* %2
%19 = call i32 @printt(i32 %18, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %17, %14
store i32 8, i32* %2
%21 = load i32, i32* %2
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %2
%25 = call i32 @printt(i32 %24, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %29
26: ; preds = %20
%27 = load i32, i32* %2
%28 = call i32 @printt(i32 %27, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %29
29: ; preds = %26, %23
store i32 -2, i32* %2
%30 = load i32, i32* %2
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %29
%33 = load i32, i32* %2
%34 = call i32 @printt(i32 %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %38
35: ; preds = %29
%36 = load i32, i32* %2
%37 = call i32 @printt(i32 %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %38
38: ; preds = %35, %32
%39 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32 4, i32* %2
%40 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%41 = load i32, i32* %2
switch i32 %41, label %48 [
i32 3, label %42
i32 4, label %44
i32 5, label %46
]
42: ; preds = %38
%43 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %48
44: ; preds = %38
%45 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %48
46: ; preds = %38
%47 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %48
48: ; preds = %38, %46, %44, %42
%49 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%50 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%51 = load i32, i32* %2
switch i32 %51, label %58 [
i32 3, label %52
i32 4, label %54
i32 5, label %56
]
52: ; preds = %48
%53 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %58
54: ; preds = %48
%55 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %56
56: ; preds = %48, %54
%57 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
br label %58
58: ; preds = %48, %56, %52
%59 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"success\00"
@.str.3 = [14 x i8] c"switch test: \00"
@.str.4 = [26 x i8] c"switch fallthrough test: \00"
@.str.5 = [10 x i8] c"OKSOFAR: \00"
@.str.6 = [47 x i8] c"success if oksofar printed before this in caps\00"
define i32 @main() {
%1 = tail call i32 @printt(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printt(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printt(i32 8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printt(i32 -2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%12 = tail call i32 @putchar(i32 10)
ret i32 0
}