#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 menu();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ wuerf();
int /*<<< orphan*/ zahlenraten();
int main(void) {
LOOP:
  do {
    int z;
    z = menu();
    switch (z) {
    case 1:
      wuerf();
      goto LOOP;
    case 2:
      zahlenraten();
      goto LOOP;
    case 3:
      goto END;
    default:
      printf("WHAT\n");
    }
  } while (1);
END:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
jmp    1154 <main+0x14>
xor    %eax,%eax
call   1030 <menu@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1194 <main+0x54>
jmp    1172 <main+0x32>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     11a0 <main+0x60>
jmp    1183 <main+0x43>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     11ac <main+0x6c>
jmp    11b1 <main+0x71>
mov    $0x0,%al
call   1060 <wuerf@plt>
jmp    114f <main+0xf>
mov    $0x0,%al
call   1050 <zahlenraten@plt>
jmp    114f <main+0xf>
jmp    11d6 <main+0x96>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
jmp    11c2 <main+0x82>
mov    $0x1,%al
test   $0x1,%al
jne    1154 <main+0x14>
jmp    11d1 <main+0x91>
jmp    11d6 <main+0x96>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rbx
jmp    1157 <main+0x17>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <zahlenraten@plt>
xor    %eax,%eax
call   1040 <menu@plt>
cmp    $0x1,%eax
je     1180 <main+0x40>
cmp    $0x2,%eax
je     1150 <main+0x10>
cmp    $0x3,%eax
je     1189 <main+0x49>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1157 <main+0x17>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <wuerf@plt>
jmp    1157 <main+0x17>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"WHAT\00"
define i32 @main() {
br label %1
1: ; preds = %9, %0
%2 = tail call i32 (...) @menu()
switch i32 %2, label %7 [
i32 1, label %3
i32 2, label %5
i32 3, label %10
]
3: ; preds = %1
%4 = tail call i32 (...) @wuerf()
br label %9
5: ; preds = %1
%6 = tail call i32 (...) @zahlenraten()
br label %9
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5, %3
br label %1
10: ; preds = %1
ret i32 0
}