#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*/ adafinal();
int /*<<< orphan*/ adainit();
int dobldobl_membership_test();
int /*<<< orphan*/ printf(char *);
int quaddobl_membership_test();
int /*<<< orphan*/ scanf(char *, ...);
int standard_membership_test();
int main(int argc, char *argv[]) {
  char ans;
  int precision, fail;
  adainit();
  printf("\nMENU for the working precision :\n");
  printf("  0. standard double precision;\n");
  printf("  1. double double precision;\n");
  printf("  2. quad double precision.\n");
  printf("Type 0, 1, or 2 to make a choice : ");
  scanf("%d", &precision);
  scanf("%c", &ans);
  if (precision == 0)
    fail = standard_membership_test();
  else if (precision == 1)
    fail = dobldobl_membership_test();
  else if (precision == 2)
    fail = quaddobl_membership_test();
  else
    printf("Selected precision level is not supported.\n");
  adafinal();
  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)
mov    $0x0,%al
call   1090 <adainit@plt>
lea    0xe6c(%rip),%rdi
call   1050 <printf@plt>
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
lea    0xe98(%rip),%rdi
call   1050 <printf@plt>
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
lea    0xebc(%rip),%rdi
call   1050 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xec5(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1206 <main+0x96>
mov    $0x0,%al
call   1030 <standard_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    124e <main+0xde>
cmpl   $0x1,-0x18(%rbp)
jne    121f <main+0xaf>
mov    $0x0,%al
call   1070 <dobldobl_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    1249 <main+0xd9>
cmpl   $0x2,-0x18(%rbp)
jne    1238 <main+0xc8>
mov    $0x0,%al
call   1040 <quaddobl_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    1244 <main+0xd4>
lea    0xe6b(%rip),%rdi
call   1050 <printf@plt>
jmp    1249 <main+0xd9>
jmp    124e <main+0xde>
mov    $0x0,%al
call   1060 <adafinal@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   10a0 <adainit@plt>
lea    0xe9b(%rip),%rdi
call   1050 <puts@plt>
lea    0xeb1(%rip),%rdi
call   1050 <puts@plt>
lea    0xec5(%rip),%rdi
call   1050 <puts@plt>
lea    0xed7(%rip),%rdi
call   1050 <puts@plt>
lea    0xe41(%rip),%rdi
call   1060 <printf@plt>
lea    0xe59(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xe49(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x2,%eax
je     1205 <main+0x85>
cmp    $0x1,%eax
je     120e <main+0x8e>
test   %eax,%eax
jne    1217 <main+0x97>
xor    %eax,%eax
call   1030 <standard_membership_test@plt>
jmp    1223 <main+0xa3>
xor    %eax,%eax
call   1040 <quaddobl_membership_test@plt>
jmp    1223 <main+0xa3>
xor    %eax,%eax
call   1080 <dobldobl_membership_test@plt>
jmp    1223 <main+0xa3>
lea    0xe88(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1070 <adafinal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0AMENU for the working precision :\0A\00"
@.str.1 = [33 x i8] c" 0. standard double precision;\0A\00"
@.str.2 = [31 x i8] c" 1. double double precision;\0A\00"
@.str.3 = [29 x i8] c" 2. quad double precision.\0A\00"
@.str.4 = [36 x i8] c"Type 0, 1, or 2 to make a choice : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [44 x i8] c"Selected precision level is not supported.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @adainit()
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%17 = load i32, i32* %7
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = call i32 (...) @standard_membership_test()
store i32 %20, i32* %8
br label %35
21: ; preds = %2
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (...) @dobldobl_membership_test()
store i32 %25, i32* %8
br label %34
26: ; preds = %21
%27 = load i32, i32* %7
%28 = icmp eq i32 %27, 2
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @quaddobl_membership_test()
store i32 %30, i32* %8
br label %33
31: ; preds = %26
%32 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
br label %34
34: ; preds = %33, %24
br label %35
35: ; preds = %34, %19
%36 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [36 x i8] c"Type 0, 1, or 2 to make a choice : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [3 x i8] c"%c\00"
@str = [34 x i8] c"\0AMENU for the working precision :\00"
@str.8 = [32 x i8] c" 0. standard double precision;\00"
@str.9 = [30 x i8] c" 1. double double precision;\00"
@str.10 = [28 x i8] c" 2. quad double precision.\00"
@str.11 = [43 x i8] c"Selected precision level is not supported.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 (...) @adainit()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.8, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.9, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.10, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%14 = load i32, i32* %4
switch i32 %14, label %21 [
i32 0, label %15
i32 1, label %17
i32 2, label %19
]
15: ; preds = %2
%16 = call i32 (...) @standard_membership_test()
br label %23
17: ; preds = %2
%18 = call i32 (...) @dobldobl_membership_test()
br label %23
19: ; preds = %2
%20 = call i32 (...) @quaddobl_membership_test()
br label %23
21: ; preds = %2
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.11, i64 0, i64 0))
br label %23
23: ; preds = %17, %21, %19, %15
%24 = call i32 (...) @adafinal()
ret i32 0
}