#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*/ createMenu();
int /*<<< orphan*/ queryMenu();
int /*<<< orphan*/ saveMenu();
int showMenu();
int /*<<< orphan*/ tipMenu(char *);
int /*<<< orphan*/ withdrawMenu();
int main(void) {
  int c;
  do {
    c = showMenu();
    switch (c) {
    case 1:
      createMenu();
      break;
    case 2:
      saveMenu();
      break;
    case 3:
      withdrawMenu();
      break;
    case 4:
      queryMenu();
      break;
    case 0:
      tipMenu("welcome come back\n");
      break;
    default:
      tipMenu("invalid input choice!\n");
      break;
    }
  } while (0 != c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <showMenu@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x4,%rax
ja     11df <main+0x7f>
mov    -0x10(%rbp),%rax
lea    0xe6b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x0,%al
call   1080 <createMenu@plt>
jmp    11eb <main+0x8b>
mov    $0x0,%al
call   1060 <saveMenu@plt>
jmp    11eb <main+0x8b>
mov    $0x0,%al
call   1070 <withdrawMenu@plt>
jmp    11eb <main+0x8b>
mov    $0x0,%al
call   1030 <queryMenu@plt>
jmp    11eb <main+0x8b>
lea    0xe3f(%rip),%rdi
call   1050 <tipMenu@plt>
jmp    11eb <main+0x8b>
lea    0xe41(%rip),%rdi
call   1050 <tipMenu@plt>
jmp    11f0 <main+0x90>
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    116f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xebc(%rip),%r14
lea    0xe8e(%rip),%rbx
jmp    1180 <main+0x20>
xor    %eax,%eax
call   1030 <queryMenu@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <showMenu@plt>
cmp    $0x4,%eax
ja     11a0 <main+0x40>
mov    %eax,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1080 <createMenu@plt>
jmp    1180 <main+0x20>
mov    %r14,%rdi
call   1050 <tipMenu@plt>
jmp    1180 <main+0x20>
xor    %eax,%eax
call   1060 <saveMenu@plt>
jmp    1180 <main+0x20>
xor    %eax,%eax
call   1070 <withdrawMenu@plt>
jmp    1180 <main+0x20>
lea    0xe51(%rip),%rdi
call   1050 <tipMenu@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"welcome come back\0A\00"
@.str.1 = [23 x i8] c"invalid input choice!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %19, %0
%4 = call i32 (...) @showMenu()
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %16 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 0, label %14
]
6: ; preds = %3
%7 = call i32 (...) @createMenu()
br label %18
8: ; preds = %3
%9 = call i32 (...) @saveMenu()
br label %18
10: ; preds = %3
%11 = call i32 (...) @withdrawMenu()
br label %18
12: ; preds = %3
%13 = call i32 (...) @queryMenu()
br label %18
14: ; preds = %3
%15 = call i32 @tipMenu(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %18
16: ; preds = %3
%17 = call i32 @tipMenu(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %14, %12, %10, %8, %6
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = icmp ne i32 0, %20
br i1 %21, label %3, label %22
22: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"welcome come back\0A\00"
@.str.1 = [23 x i8] c"invalid input choice!\0A\00"
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @showMenu()
switch i32 %2, label %12 [
i32 1, label %3
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 0, label %14
]
3: ; preds = %1
%4 = tail call i32 (...) @createMenu()
br label %5
5: ; preds = %3, %6, %8, %10, %12
br label %1
6: ; preds = %1
%7 = tail call i32 (...) @saveMenu()
br label %5
8: ; preds = %1
%9 = tail call i32 (...) @withdrawMenu()
br label %5
10: ; preds = %1
%11 = tail call i32 (...) @queryMenu()
br label %5
12: ; preds = %1
%13 = tail call i32 @tipMenu(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
br label %5
14: ; preds = %1
%15 = tail call i32 @tipMenu(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}