#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 */
scalar_t__ check_amount(float);
scalar_t__ check_option(int);
scalar_t__ check_year(int);
int /*<<< orphan*/ display_option();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int option, year;
  float amount;
  char *op_name[3];
  op_name[0] = "Checking";
  op_name[1] = "Saving";
  op_name[2] = "Fix Deposit";
  while (1) {
    display_option();
    scanf("%d", &option);
    if (check_option(option))
      break;
    printf("incorrect option\n");
  }
  while (1) {
    printf("select year:\n");
    scanf("%d", &year);
    if (check_year(year))
      break;
    printf("incorrect year\n");
  }
  while (1) {
    printf("input amount\n");
    scanf("%f", &amount);
    if (check_amount(amount))
      break;
    printf("incorrect amount\n");
  }
  printf("%s\n", op_name[option - 1]);
  printf("Year: %d\n", year);
  printf("amount: %.2f\n", amount);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe88(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe84(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1070 <display_option@plt>
lea    0xe7e(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <check_option@plt>
cmp    $0x0,%rax
je     11c0 <main+0x60>
jmp    11d3 <main+0x73>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1190 <main+0x30>
jmp    11d8 <main+0x78>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe2f(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1060 <check_year@plt>
cmp    $0x0,%rax
je     120f <main+0xaf>
jmp    1222 <main+0xc2>
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11d8 <main+0x78>
jmp    1227 <main+0xc7>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe21(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
movss  -0x10(%rbp),%xmm0
call   1040 <check_amount@plt>
cmp    $0x0,%rax
je     1260 <main+0x100>
jmp    1273 <main+0x113>
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1227 <main+0xc7>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x30(%rbp,%rax,8),%rsi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd1(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xe7e(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe7b(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe76(%rip),%rax
mov    %rax,0x20(%rsp)
xor    %eax,%eax
call   1080 <display_option@plt>
lea    0xe6f(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <check_option@plt>
test   %rax,%rax
jne    120a <main+0x9a>
lea    0xe6c(%rip),%r14
lea    0xe47(%rip),%r15
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <display_option@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <check_option@plt>
test   %rax,%rax
je     11e0 <main+0x70>
lea    0xe3a(%rip),%rdi
call   1040 <puts@plt>
lea    0xdff(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x8(%rsp),%edi
call   1070 <check_year@plt>
test   %rax,%rax
jne    128b <main+0x11b>
lea    0xe1a(%rip),%r14
lea    0xe06(%rip),%r15
lea    0xdd0(%rip),%r12
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x8(%rsp),%edi
call   1070 <check_year@plt>
test   %rax,%rax
je     1260 <main+0xf0>
lea    0xdd5(%rip),%rdi
call   1040 <puts@plt>
lea    0xd81(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <check_amount@plt>
test   %rax,%rax
jne    130d <main+0x19d>
lea    0xdb3(%rip),%r14
lea    0xd9f(%rip),%r15
lea    0xd50(%rip),%r12
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movss  0x4(%rsp),%xmm0
call   1050 <check_amount@plt>
test   %rax,%rax
je     12e0 <main+0x170>
movslq 0xc(%rsp),%rax
mov    0x8(%rsp,%rax,8),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%esi
lea    0xcfb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xced(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    $0x1,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Checking\00"
@.str.1 = [7 x i8] c"Saving\00"
@.str.2 = [12 x i8] c"Fix Deposit\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [18 x i8] c"incorrect option\0A\00"
@.str.5 = [14 x i8] c"select year:\0A\00"
@.str.6 = [16 x i8] c"incorrect year\0A\00"
@.str.7 = [14 x i8] c"input amount\0A\00"
@.str.8 = [3 x i8] c"%f\00"
@.str.9 = [18 x i8] c"incorrect amount\0A\00"
@.str.10 = [4 x i8] c"%s\0A\00"
@.str.11 = [10 x i8] c"Year: %d\0A\00"
@.str.12 = [14 x i8] c"amount: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca [3 x i8*]
store i32 0, i32* %1
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %8
br label %9
9: ; preds = %0, %16
%10 = call i32 (...) @display_option()
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = call i64 @check_option(i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %9
br label %18
16: ; preds = %9
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %9
18: ; preds = %15
br label %19
19: ; preds = %18, %26
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%22 = load i32, i32* %3
%23 = call i64 @check_year(i32 %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %19
br label %28
26: ; preds = %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
br label %19
28: ; preds = %25
br label %29
29: ; preds = %28, %36
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %4)
%32 = load float, float* %4
%33 = call i64 @check_amount(float %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %29
br label %38
36: ; preds = %29
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %29
38: ; preds = %35
%39 = load i32, i32* %2
%40 = sub nsw i32 %39, 1
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3 x i8*], [3 x i8*]* %5, i64 0, i64 %41
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i8* %43)
%45 = load i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %45)
%47 = load float, float* %4
%48 = fpext float %47 to double
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), double %48)
ret i32 1
}

LLVM IR (-O2):
@.str = [9 x i8] c"Checking\00"
@.str.1 = [7 x i8] c"Saving\00"
@.str.2 = [12 x i8] c"Fix Deposit\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.8 = [3 x i8] c"%f\00"
@.str.11 = [10 x i8] c"Year: %d\0A\00"
@.str.12 = [14 x i8] c"amount: %.2f\0A\00"
@str = [17 x i8] c"incorrect option\00"
@str.13 = [13 x i8] c"select year:\00"
@str.14 = [15 x i8] c"incorrect year\00"
@str.15 = [13 x i8] c"input amount\00"
@str.16 = [17 x i8] c"incorrect amount\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca [3 x i8*]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast [3 x i8*]* %4 to i8*
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8** %11
%12 = call i32 (...) @display_option()
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = call i64 @check_option(i32 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %23, label %17
17: ; preds = %23, %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.13, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%20 = load i32, i32* %2
%21 = call i64 @check_year(i32 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %36, label %30
23: ; preds = %0, %23
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%25 = call i32 (...) @display_option()
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%27 = load i32, i32* %1
%28 = call i64 @check_option(i32 %27)
%29 = icmp eq i64 %28, 0
br i1 %29, label %23, label %17
30: ; preds = %36, %17
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.15, i64 0, i64 0))
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %3)
%33 = load float, float* %3
%34 = call i64 @check_amount(float %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %43, label %50
36: ; preds = %17, %36
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.14, i64 0, i64 0))
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.13, i64 0, i64 0))
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%40 = load i32, i32* %2
%41 = call i64 @check_year(i32 %40)
%42 = icmp eq i64 %41, 0
br i1 %42, label %36, label %30
43: ; preds = %30, %43
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.16, i64 0, i64 0))
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.15, i64 0, i64 0))
%46 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %3)
%47 = load float, float* %3
%48 = call i64 @check_amount(float %47)
%49 = icmp eq i64 %48, 0
br i1 %49, label %43, label %50
50: ; preds = %43, %30
%51 = load i32, i32* %1
%52 = add nsw i32 %51, -1
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 %53
%55 = load i8*, i8** %54
%56 = call i32 @puts(i8* dereferenceable(1) %55)
%57 = load i32, i32* %2
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %57)
%59 = load float, float* %3
%60 = fpext float %59 to double
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0), double %60)
ret i32 1
}