#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*/ AddBalance();
int /*<<< orphan*/ CutBalance();
int /*<<< orphan*/ ViewBalance();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void DBBL(void) {
  int selection;
  printf("Which act you want to play?\n 1.View Balance\n 2.Add Balance\n 3.Cut "
         "Balance\n");
  scanf(" %d", &selection);
  switch (selection) {
  case 1:
    ViewBalance();
    break;
  case 2:
    AddBalance();
    break;
  case 3:
    CutBalance();
    break;
  default:
    printf("Invalid Input!");
  }
}


x86 assembly (clang, -O0):
<DBBL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1050 <printf@plt>
lea    0xee0(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x1,%eax
je     11aa <DBBL+0x5a>
jmp    1188 <DBBL+0x38>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     11b6 <DBBL+0x66>
jmp    1199 <DBBL+0x49>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     11c2 <DBBL+0x72>
jmp    11ce <DBBL+0x7e>
mov    $0x0,%al
call   1030 <ViewBalance@plt>
jmp    11da <DBBL+0x8a>
mov    $0x0,%al
call   1040 <AddBalance@plt>
jmp    11da <DBBL+0x8a>
mov    $0x0,%al
call   1060 <CutBalance@plt>
jmp    11da <DBBL+0x8a>
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DBBL>:
push   %rax
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x3,%eax
je     119a <DBBL+0x3a>
cmp    $0x2,%eax
je     11a3 <DBBL+0x43>
cmp    $0x1,%eax
jne    11ac <DBBL+0x4c>
xor    %eax,%eax
call   1040 <ViewBalance@plt>
pop    %rax
ret
xor    %eax,%eax
call   1070 <CutBalance@plt>
pop    %rax
ret
xor    %eax,%eax
call   1050 <AddBalance@plt>
pop    %rax
ret
lea    0xe51(%rip),%rdi
call   1060 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [75 x i8] c"Which act you want to play?\0A 1.View Balance\0A 2.Add Balance\0A 3.Cut Balance\0A\00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [15 x i8] c"Invalid Input!\00"
define void @DBBL() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %7
i32 3, label %9
]
5: ; preds = %0
%6 = call i32 (...) @ViewBalance()
br label %13
7: ; preds = %0
%8 = call i32 (...) @AddBalance()
br label %13
9: ; preds = %0
%10 = call i32 (...) @CutBalance()
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %7, %5
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [15 x i8] c"Invalid Input!\00"
@str = [74 x i8] c"Which act you want to play?\0A 1.View Balance\0A 2.Add Balance\0A 3.Cut Balance\00"
define void @DBBL() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
switch i32 %5, label %12 [
i32 1, label %6
i32 2, label %8
i32 3, label %10
]
6: ; preds = %0
%7 = call i32 (...) @ViewBalance()
br label %14
8: ; preds = %0
%9 = call i32 (...) @AddBalance()
br label %14
10: ; preds = %0
%11 = call i32 (...) @CutBalance()
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %14
14: ; preds = %12, %10, %8, %6
ret void
}