#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*/ loop();
int /*<<< orphan*/ printGetGeld();
int /*<<< orphan*/ printKontostand();
int /*<<< orphan*/ printSetGeld();
int /*<<< orphan*/ printUeberweisung();
int /*<<< orphan*/ printVorrat();
int /*<<< orphan*/ printf(char *);
void menu(char inp) {
  switch (inp) {
  case '1':
    printGetGeld();
    break;
  case '2':
    printSetGeld();
    break;
  case '3':
    printKontostand();
    break;
  case '4':
    printUeberweisung();
    break;
  case '5':
    loop();
    break;
  case '7':
    printVorrat();
    break;
  default:
    printf("Input Missmatch Error\n");
    break;
  }
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffcf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     11f0 <menu+0x80>
mov    -0x10(%rbp),%rax
lea    0xe61(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1060 <printGetGeld@plt>
jmp    11fc <menu+0x8c>
mov    $0x0,%al
call   1080 <printSetGeld@plt>
jmp    11fc <menu+0x8c>
mov    $0x0,%al
call   1070 <printKontostand@plt>
jmp    11fc <menu+0x8c>
mov    $0x0,%al
call   1050 <printUeberweisung@plt>
jmp    11fc <menu+0x8c>
mov    $0x0,%al
call   1030 <loop@plt>
jmp    11fc <menu+0x8c>
mov    $0x0,%al
call   1090 <printVorrat@plt>
jmp    11fc <menu+0x8c>
lea    0xe25(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
add    $0xffffffcf,%edi
cmp    $0x6,%edi
ja     11ab <menu+0x3b>
lea    0xe81(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
xor    %eax,%eax
jmp    1060 <printGetGeld@plt>
xor    %eax,%eax
jmp    1080 <printSetGeld@plt>
xor    %eax,%eax
jmp    1070 <printKontostand@plt>
xor    %eax,%eax
jmp    1050 <printUeberweisung@plt>
xor    %eax,%eax
jmp    1040 <loop@plt>
lea    0xe6a(%rip),%rdi
jmp    1030 <puts@plt>
xor    %eax,%eax
jmp    1090 <printVorrat@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Input Missmatch Error\0A\00"
define void @menu(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %17 [
i32 49, label %5
i32 50, label %7
i32 51, label %9
i32 52, label %11
i32 53, label %13
i32 55, label %15
]
5: ; preds = %1
%6 = call i32 (...) @printGetGeld()
br label %19
7: ; preds = %1
%8 = call i32 (...) @printSetGeld()
br label %19
9: ; preds = %1
%10 = call i32 (...) @printKontostand()
br label %19
11: ; preds = %1
%12 = call i32 (...) @printUeberweisung()
br label %19
13: ; preds = %1
%14 = call i32 (...) @loop()
br label %19
15: ; preds = %1
%16 = call i32 (...) @printVorrat()
br label %19
17: ; preds = %1
%18 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13, %11, %9, %7, %5
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"Input Missmatch Error\00"
define void @menu(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %15 [
i32 49, label %3
i32 50, label %5
i32 51, label %7
i32 52, label %9
i32 53, label %11
i32 55, label %13
]
3: ; preds = %1
%4 = tail call i32 (...) @printGetGeld()
br label %17
5: ; preds = %1
%6 = tail call i32 (...) @printSetGeld()
br label %17
7: ; preds = %1
%8 = tail call i32 (...) @printKontostand()
br label %17
9: ; preds = %1
%10 = tail call i32 (...) @printUeberweisung()
br label %17
11: ; preds = %1
%12 = tail call i32 (...) @loop()
br label %17
13: ; preds = %1
%14 = tail call i32 (...) @printVorrat()
br label %17
15: ; preds = %1
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %17
17: ; preds = %15, %13, %11, %9, %7, %5, %3
ret void
}