#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 foo();
int /*<<< orphan*/ printf(char *);
int main() {
  while (foo()) {
    switch (foo()) {
    case 0:
    case 1:
    case 2:
    case 3:
      printf("3");
    case 4:
      printf("4");
    case 5:
    case 6:
    default:
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo@plt>
cmp    $0x0,%eax
je     11a5 <main+0x85>
xor    %eax,%eax
call   1040 <foo@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x4,%eax
jb     117e <main+0x5e>
jmp    1159 <main+0x39>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
je     118a <main+0x6a>
jmp    116a <main+0x4a>
mov    -0x8(%rbp),%eax
add    $0xfffffffb,%eax
sub    $0x2,%eax
jb     1196 <main+0x76>
jmp    119b <main+0x7b>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <main+0x7b>
jmp    11a0 <main+0x80>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    1144 <main+0x24>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x33,%edi
call   1030 <putchar@plt>
mov    $0x34,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <foo@plt>
test   %eax,%eax
je     115f <main+0x3f>
xor    %eax,%eax
call   1040 <foo@plt>
cmp    $0x4,%eax
jb     1130 <main+0x10>
jne    1144 <main+0x24>
jmp    113a <main+0x1a>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"3\00"
@.str.1 = [2 x i8] c"4\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %13, %0
%3 = call i32 (...) @foo()
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = call i32 (...) @foo()
switch i32 %6, label %12 [
i32 0, label %7
i32 1, label %7
i32 2, label %7
i32 3, label %7
i32 4, label %9
i32 5, label %11
i32 6, label %11
]
7: ; preds = %5, %5, %5, %5
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %5, %5, %9
br label %12
12: ; preds = %5, %11
br label %13
13: ; preds = %12
br label %2
14: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = icmp eq i32 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0, %9
%4 = tail call i32 (...) @foo()
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %7
]
5: ; preds = %3, %3, %3, %3
%6 = tail call i32 @putchar(i32 51)
br label %7
7: ; preds = %3, %5
%8 = tail call i32 @putchar(i32 52)
br label %9
9: ; preds = %3, %7
%10 = tail call i32 (...) @foo()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %9, %0
ret i32 0
}