#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*/ add_gem_options();
int /*<<< orphan*/ print_header(char *);
int /*<<< orphan*/ set_callback(char *);
int /*<<< orphan*/ set_input_type(char *);
void obanksub3(int ans) {
  switch (ans) {
  case 'd':
    print_header("How much? ");
    set_input_type("number");
    set_callback("deposit_money");
    break;
  case 'w':
    print_header("How much? ");
    set_input_type("number");
    set_callback("withdraw_money");
    break;
  case 's':
    set_callback("sell_gem");
    add_gem_options();
    break;
  }
}


x86 assembly (clang, -O0):
<obanksub3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x64,%eax
je     1181 <obanksub3+0x41>
jmp    115f <obanksub3+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x73,%eax
je     11d3 <obanksub3+0x93>
jmp    1170 <obanksub3+0x30>
mov    -0x8(%rbp),%eax
sub    $0x77,%eax
je     11aa <obanksub3+0x6a>
jmp    11e6 <obanksub3+0xa6>
lea    0xe78(%rip),%rdi
call   1060 <print_header@plt>
lea    0xe77(%rip),%rdi
call   1030 <set_input_type@plt>
lea    0xe72(%rip),%rdi
call   1040 <set_callback@plt>
jmp    11e6 <obanksub3+0xa6>
lea    0xe4f(%rip),%rdi
call   1060 <print_header@plt>
lea    0xe4e(%rip),%rdi
call   1030 <set_input_type@plt>
lea    0xe57(%rip),%rdi
call   1040 <set_callback@plt>
jmp    11e6 <obanksub3+0xa6>
lea    0xe55(%rip),%rdi
call   1040 <set_callback@plt>
mov    $0x0,%al
call   1050 <add_gem_options@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<obanksub3>:
push   %rax
cmp    $0x77,%edi
je     1175 <obanksub3+0x35>
cmp    $0x73,%edi
je     119a <obanksub3+0x5a>
cmp    $0x64,%edi
jne    11ae <obanksub3+0x6e>
lea    0xea9(%rip),%rdi
call   1060 <print_header@plt>
lea    0xea8(%rip),%rdi
call   1030 <set_input_type@plt>
lea    0xea3(%rip),%rdi
pop    %rax
jmp    1040 <set_callback@plt>
lea    0xe84(%rip),%rdi
call   1060 <print_header@plt>
lea    0xe83(%rip),%rdi
call   1030 <set_input_type@plt>
lea    0xe8c(%rip),%rdi
pop    %rax
jmp    1040 <set_callback@plt>
lea    0xe8e(%rip),%rdi
call   1040 <set_callback@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <add_gem_options@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"How much? \00"
@.str.1 = [7 x i8] c"number\00"
@.str.2 = [14 x i8] c"deposit_money\00"
@.str.3 = [15 x i8] c"withdraw_money\00"
@.str.4 = [9 x i8] c"sell_gem\00"
define void @obanksub3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %15 [
i32 100, label %4
i32 119, label %8
i32 115, label %12
]
4: ; preds = %1
%5 = call i32 @print_header(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @set_input_type(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @set_callback(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %15
8: ; preds = %1
%9 = call i32 @print_header(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @set_input_type(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @set_callback(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %15
12: ; preds = %1
%13 = call i32 @set_callback(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (...) @add_gem_options()
br label %15
15: ; preds = %1, %12, %8, %4
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"How much? \00"
@.str.1 = [7 x i8] c"number\00"
@.str.2 = [14 x i8] c"deposit_money\00"
@.str.3 = [15 x i8] c"withdraw_money\00"
@.str.4 = [9 x i8] c"sell_gem\00"
define void @obanksub3(i32 %0) {
switch i32 %0, label %13 [
i32 100, label %2
i32 119, label %6
i32 115, label %10
]
2: ; preds = %1
%3 = tail call i32 @print_header(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @set_input_type(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @set_callback(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %13
6: ; preds = %1
%7 = tail call i32 @print_header(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @set_input_type(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @set_callback(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %13
10: ; preds = %1
%11 = tail call i32 @set_callback(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 (...) @add_gem_options()
br label %13
13: ; preds = %1, %10, %6, %2
ret void
}