#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_scaler();
int greetings();
int /*<<< orphan*/ printf(char *);
int quaddobl_scaler();
int /*<<< orphan*/ scanf(char *, int *);
int standard_scaler();
int main(int argc, char *argv[]) {
  int fail, choice;
  adainit();
  fail = greetings();
  printf("\nMENU for the precision of the scalers :\n");
  printf("  0. use standard double precision arithmetic; or\n");
  printf("  1. use double double precision arithmetic; or\n");
  printf("  2. use quad double precision arithmetic.\n");
  printf("Type 0, 1, or 2 to make your choice : ");
  scanf("%d", &choice);
  if (choice == 0)
    fail = standard_scaler();
  else if (choice == 1)
    fail = dobldobl_scaler();
  else if (choice == 2)
    fail = quaddobl_scaler();
  adafinal();
  return fail;
}


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   1080 <adainit@plt>
mov    $0x0,%al
call   1090 <greetings@plt>
mov    %eax,-0x14(%rbp)
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1070 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    120c <main+0x8c>
mov    $0x0,%al
call   1040 <standard_scaler@plt>
mov    %eax,-0x14(%rbp)
jmp    1243 <main+0xc3>
cmpl   $0x1,-0x18(%rbp)
jne    1225 <main+0xa5>
mov    $0x0,%al
call   1050 <dobldobl_scaler@plt>
mov    %eax,-0x14(%rbp)
jmp    123e <main+0xbe>
cmpl   $0x2,-0x18(%rbp)
jne    1239 <main+0xb9>
mov    $0x0,%al
call   10a0 <quaddobl_scaler@plt>
mov    %eax,-0x14(%rbp)
jmp    123e <main+0xbe>
jmp    1243 <main+0xc3>
mov    $0x0,%al
call   1060 <adafinal@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1090 <adainit@plt>
xor    %eax,%eax
call   10a0 <greetings@plt>
mov    %eax,%ebx
lea    0xe7e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1030 <puts@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe24(%rip),%rdi
call   1040 <printf@plt>
lea    0xe3f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     120d <main+0x7d>
cmp    $0x1,%eax
je     1216 <main+0x86>
test   %eax,%eax
jne    121f <main+0x8f>
xor    %eax,%eax
call   1050 <standard_scaler@plt>
jmp    121d <main+0x8d>
xor    %eax,%eax
call   10b0 <quaddobl_scaler@plt>
jmp    121d <main+0x8d>
xor    %eax,%eax
call   1060 <dobldobl_scaler@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <adafinal@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0AMENU for the precision of the scalers :\0A\00"
@.str.1 = [51 x i8] c" 0. use standard double precision arithmetic; or\0A\00"
@.str.2 = [49 x i8] c" 1. use double double precision arithmetic; or\0A\00"
@.str.3 = [44 x i8] c" 2. use quad double precision arithmetic.\0A\00"
@.str.4 = [39 x i8] c"Type 0, 1, or 2 to make your choice : \00"
@.str.5 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @adainit()
%9 = call i32 (...) @greetings()
store i32 %9, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @standard_scaler()
store i32 %19, i32* %6
br label %32
20: ; preds = %2
%21 = load i32, i32* %7
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @dobldobl_scaler()
store i32 %24, i32* %6
br label %31
25: ; preds = %20
%26 = load i32, i32* %7
%27 = icmp eq i32 %26, 2
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @quaddobl_scaler()
store i32 %29, i32* %6
br label %30
30: ; preds = %28, %25
br label %31
31: ; preds = %30, %23
br label %32
32: ; preds = %31, %18
%33 = call i32 (...) @adafinal()
%34 = load i32, i32* %6
ret i32 %34
}

LLVM IR (-O2):
@.str.4 = [39 x i8] c"Type 0, 1, or 2 to make your choice : \00"
@.str.5 = [3 x i8] c"%d\00"
@str = [41 x i8] c"\0AMENU for the precision of the scalers :\00"
@str.6 = [50 x i8] c" 0. use standard double precision arithmetic; or\00"
@str.7 = [48 x i8] c" 1. use double double precision arithmetic; or\00"
@str.8 = [43 x i8] c" 2. use quad double precision arithmetic.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (...) @adainit()
%6 = tail call i32 (...) @greetings()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.6, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.7, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.8, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%13 = load i32, i32* %3
switch i32 %13, label %20 [
i32 0, label %14
i32 1, label %16
i32 2, label %18
]
14: ; preds = %2
%15 = call i32 (...) @standard_scaler()
br label %20
16: ; preds = %2
%17 = call i32 (...) @dobldobl_scaler()
br label %20
18: ; preds = %2
%19 = call i32 (...) @quaddobl_scaler()
br label %20
20: ; preds = %2, %16, %18, %14
%21 = phi i32 [ %15, %14 ], [ %17, %16 ], [ %19, %18 ], [ %6, %2 ]
%22 = call i32 (...) @adafinal()
ret i32 %21
}