#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 get_menu_choice();
int /*<<< orphan*/ printf(char *, int, float, unsigned int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, char *argv[]) {
  int choice = 0;
  int int_var = 0;
  float float_var = 0.0;
  unsigned unsigned_var = 0;
  while (choice != 4) {
    choice = get_menu_choice();
    if (choice == 1) {
      puts("\nEnter a signed decimal integer (i.e. -123)");
      scanf("%d", &int_var);
    }
    if (choice == 2) {
      puts("\nEnter a decimal floating-point number                  (e.g. "
           "1.23)");
      scanf("%f", &float_var);
    }
    if (choice == 3) {
      puts("\nEnter an unsigned decimal integer                  (e.g. 123)");
      scanf("%u", &unsigned_var);
    }
  }
  printf("\nYour values are: int: %d  float: %f  unsigned: %u \n", int_var,
         float_var, unsigned_var);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x4,-0x14(%rbp)
je     1204 <main+0xc4>
mov    $0x0,%al
call   1040 <get_menu_choice@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    11af <main+0x6f>
lea    0xe68(%rip),%rdi
call   1030 <puts@plt>
lea    0xe88(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x2,-0x14(%rbp)
jne    11d7 <main+0x97>
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
lea    0xea7(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x3,-0x14(%rbp)
jne    11ff <main+0xbf>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
jmp    1173 <main+0x33>
mov    -0x18(%rbp),%esi
movss  -0x1c(%rbp),%xmm0
mov    -0x20(%rbp),%edx
lea    0xea2(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xe93(%rip),%r13
lea    0xf0f(%rip),%rbx
lea    0x10(%rsp),%rbp
lea    0xf06(%rip),%r14
lea    0xf3e(%rip),%r15
lea    0xc(%rsp),%r12
jmp    11af <main+0x6f>
xchg   %ax,%ax
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
xor    %eax,%eax
call   1040 <get_menu_choice@plt>
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     11af <main+0x6f>
movslq 0x0(%r13,%rax,4),%rax
add    %r13,%rax
jmp    *%rax
lea    0xe70(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
jmp    11a8 <main+0x68>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r12,%rsi
jmp    11a8 <main+0x68>
mov    0x14(%rsp),%esi
movss  0x10(%rsp),%xmm0
mov    0xc(%rsp),%edx
lea    0xec3(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0AEnter a signed decimal integer (i.e. -123)\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [68 x i8] c"\0AEnter a decimal floating-point number (e.g. 1.23)\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [63 x i8] c"\0AEnter an unsigned decimal integer (e.g. 123)\00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [53 x i8] c"\0AYour values are: int: %d float: %f unsigned: %u \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 0, i32* %7
store float 0.000000e+00, float* %8
store i32 0, i32* %9
br label %10
10: ; preds = %32, %2
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 4
br i1 %12, label %13, label %33
13: ; preds = %10
%14 = call i32 (...) @get_menu_choice()
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = call i32 @puts(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %8)
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %6
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %9)
br label %32
32: ; preds = %29, %26
br label %10
33: ; preds = %10
%34 = load i32, i32* %7
%35 = load float, float* %8
%36 = load i32, i32* %9
%37 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 %34, float %35, i32 %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"\0AEnter a signed decimal integer (i.e. -123)\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [68 x i8] c"\0AEnter a decimal floating-point number (e.g. 1.23)\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [63 x i8] c"\0AEnter an unsigned decimal integer (e.g. 123)\00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [53 x i8] c"\0AYour values are: int: %d float: %f unsigned: %u \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = bitcast float* %4 to i8*
store float 0.000000e+00, float* %4
%8 = bitcast i32* %5 to i8*
store i32 0, i32* %5
br label %9
9: ; preds = %20, %2
%10 = call i32 (...) @get_menu_choice()
switch i32 %10, label %20 [
i32 1, label %11
i32 2, label %14
i32 3, label %17
i32 4, label %21
]
11: ; preds = %9
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %20
14: ; preds = %9
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
br label %20
17: ; preds = %9
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
br label %20
20: ; preds = %17, %11, %14, %9
br label %9
21: ; preds = %9
%22 = load i32, i32* %3
%23 = load float, float* %4
%24 = load i32, i32* %5
%25 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0), i32 %22, float %23, i32 %24)
ret i32 0
}