#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ setbuf(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ stdout;
int main(void) {
  setbuf(stdout, NULL);
  int etage;
  printf("Drücken Sie die Taste für Ihre Etage:");
  scanf("%d", &etage);
  switch (etage) {
  case 0:
    printf("Etage 0\n");
  case 1:
    printf("Etage 1\n");
  case 2:
    printf("Etage 2\n");
    break;
  case 3:
    printf("Etage 3\n");
    break;
  case 4:
    printf("Etage 4\n");
    break;
  case 5:
    printf("Etage 5\n");
    break;
  default:
    printf("keine gültige Etage\n");
    break;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <setbuf@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     11ee <main+0xbe>
mov    -0x10(%rbp),%rax
lea    0xe77(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
jmp    11fa <main+0xca>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
jmp    11fa <main+0xca>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    11fa <main+0xca>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
jmp    11fa <main+0xca>
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1040 <setbuf@plt>
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x5,%rax
ja     11ad <main+0x6d>
lea    0xed8(%rip),%rbx
lea    0xe76(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
jmp    11cf <main+0x8f>
lea    0xebf(%rip),%rbx
jmp    11cf <main+0x8f>
lea    0xe96(%rip),%rbx
jmp    11cf <main+0x8f>
lea    0xe85(%rip),%rbx
jmp    11cf <main+0x8f>
lea    0xe74(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [40 x i8] c"Dr\C3\BCcken Sie die Taste f\C3\BCr Ihre Etage:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"Etage 0\0A\00"
@.str.3 = [9 x i8] c"Etage 1\0A\00"
@.str.4 = [9 x i8] c"Etage 2\0A\00"
@.str.5 = [9 x i8] c"Etage 3\0A\00"
@.str.6 = [9 x i8] c"Etage 4\0A\00"
@.str.7 = [9 x i8] c"Etage 5\0A\00"
@.str.8 = [22 x i8] c"keine g\C3\BCltige Etage\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stdout
%4 = call i32 @setbuf(i32 %3, i32* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %20 [
i32 0, label %8
i32 1, label %10
i32 2, label %12
i32 3, label %14
i32 4, label %16
i32 5, label %18
]
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %0, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %0, %10
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %22
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %22
16: ; preds = %0
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %22
18: ; preds = %0
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %22
20: ; preds = %0
%21 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
br label %22
22: ; preds = %20, %18, %16, %14, %12
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [40 x i8] c"Dr\C3\BCcken Sie die Taste f\C3\BCr Ihre Etage:\00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"Etage 5\00"
@str.9 = [8 x i8] c"Etage 4\00"
@str.10 = [8 x i8] c"Etage 3\00"
@str.11 = [8 x i8] c"Etage 2\00"
@str.12 = [8 x i8] c"Etage 1\00"
@str.13 = [8 x i8] c"Etage 0\00"
@str.14 = [21 x i8] c"keine g\C3\BCltige Etage\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = tail call i32 @setbuf(i32 %2, i32* null)
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %15 [
i32 0, label %8
i32 1, label %10
i32 2, label %16
i32 3, label %12
i32 4, label %13
i32 5, label %14
]
8: ; preds = %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.13, i64 0, i64 0))
br label %10
10: ; preds = %0, %8
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.12, i64 0, i64 0))
br label %16
12: ; preds = %0
br label %16
13: ; preds = %0
br label %16
14: ; preds = %0
br label %16
15: ; preds = %0
br label %16
16: ; preds = %10, %0, %15, %14, %13, %12
%17 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.14, i64 0, i64 0), %15 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %14 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.9, i64 0, i64 0), %13 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0), %12 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.11, i64 0, i64 0), %0 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.11, i64 0, i64 0), %10 ]
%18 = call i32 @puts(i8* dereferenceable(1) %17)
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}