#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 /*<<< orphan*/ dobldobl_Pade_test();
int /*<<< orphan*/ dobldobl_series_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quaddobl_Pade_test();
int /*<<< orphan*/ quaddobl_series_test();
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ standard_Pade_test();
int /*<<< orphan*/ standard_series_test();
int main(int argc, char *argv[]) {
  int choice;
  char ch;
  adainit();
  printf("\nMENU to select the test and the working precision : \n");
  printf("  0. power series in standard double precision;\n");
  printf("  1. power series in double double precision;\n");
  printf("  2. power series in quad double precision.\n");
  printf("  3. Pade approximant in standard double precision;\n");
  printf("  4. Pade approximant in double double precision;\n");
  printf("  5. Pade approximant in quad double precision.\n");
  printf("Type 0, 1, 2, 3, 4, or 5 to select the precision : ");
  scanf("%d", &choice);
  scanf("%c", &ch);
  if (choice == 0)
    standard_series_test();
  else if (choice == 1)
    dobldobl_series_test();
  else if (choice == 2)
    quaddobl_series_test();
  else if (choice == 3)
    standard_Pade_test();
  else if (choice == 4)
    dobldobl_Pade_test();
  else if (choice == 5)
    quaddobl_Pade_test();
  else
    printf("invalid selection, please try again\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   1070 <adainit@plt>
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
call   1030 <printf@plt>
lea    0xf45(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6d(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xf5e(%rip),%rdi
lea    -0x15(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1257 <main+0xb7>
mov    $0x0,%al
call   10c0 <standard_series_test@plt>
jmp    12ea <main+0x14a>
cmpl   $0x1,-0x14(%rbp)
jne    126d <main+0xcd>
mov    $0x0,%al
call   10a0 <dobldobl_series_test@plt>
jmp    12e5 <main+0x145>
cmpl   $0x2,-0x14(%rbp)
jne    1283 <main+0xe3>
mov    $0x0,%al
call   1050 <quaddobl_series_test@plt>
jmp    12e0 <main+0x140>
cmpl   $0x3,-0x14(%rbp)
jne    1299 <main+0xf9>
mov    $0x0,%al
call   10b0 <standard_Pade_test@plt>
jmp    12db <main+0x13b>
cmpl   $0x4,-0x14(%rbp)
jne    12af <main+0x10f>
mov    $0x0,%al
call   1080 <dobldobl_Pade_test@plt>
jmp    12d6 <main+0x136>
cmpl   $0x5,-0x14(%rbp)
jne    12c5 <main+0x125>
mov    $0x0,%al
call   1090 <quaddobl_Pade_test@plt>
jmp    12d1 <main+0x131>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
jmp    12d6 <main+0x136>
jmp    12db <main+0x13b>
jmp    12e0 <main+0x140>
jmp    12e5 <main+0x145>
jmp    12ea <main+0x14a>
mov    $0x0,%al
call   1040 <adafinal@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <adainit@plt>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xf23(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4b(%rip),%rdi
call   1030 <puts@plt>
lea    0xf71(%rip),%rdi
call   1030 <puts@plt>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
lea    0xe2d(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe1d(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%rax
ja     1261 <main+0xb1>
lea    0xdb1(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   10d0 <standard_series_test@plt>
jmp    129a <main+0xea>
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
jmp    129a <main+0xea>
xor    %eax,%eax
call   10b0 <dobldobl_series_test@plt>
jmp    129a <main+0xea>
xor    %eax,%eax
call   1060 <quaddobl_series_test@plt>
jmp    129a <main+0xea>
xor    %eax,%eax
call   10c0 <standard_Pade_test@plt>
jmp    129a <main+0xea>
xor    %eax,%eax
call   1090 <dobldobl_Pade_test@plt>
jmp    129a <main+0xea>
xor    %eax,%eax
call   10a0 <quaddobl_Pade_test@plt>
xor    %eax,%eax
call   1050 <adafinal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"\0AMENU to select the test and the working precision : \0A\00"
@.str.1 = [49 x i8] c" 0. power series in standard double precision;\0A\00"
@.str.2 = [47 x i8] c" 1. power series in double double precision;\0A\00"
@.str.3 = [45 x i8] c" 2. power series in quad double precision.\0A\00"
@.str.4 = [53 x i8] c" 3. Pade approximant in standard double precision;\0A\00"
@.str.5 = [51 x i8] c" 4. Pade approximant in double double precision;\0A\00"
@.str.6 = [49 x i8] c" 5. Pade approximant in quad double precision.\0A\00"
@.str.7 = [52 x i8] c"Type 0, 1, 2, 3, 4, or 5 to select the precision : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [3 x i8] c"%c\00"
@.str.10 = [37 x i8] c"invalid selection, please try again\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (...) @adainit()
%9 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %6)
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %7)
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 (...) @standard_series_test()
br label %55
23: ; preds = %2
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (...) @dobldobl_series_test()
br label %54
28: ; preds = %23
%29 = load i32, i32* %6
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (...) @quaddobl_series_test()
br label %53
33: ; preds = %28
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 3
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 (...) @standard_Pade_test()
br label %52
38: ; preds = %33
%39 = load i32, i32* %6
%40 = icmp eq i32 %39, 4
br i1 %40, label %41, label %43
41: ; preds = %38
%42 = call i32 (...) @dobldobl_Pade_test()
br label %51
43: ; preds = %38
%44 = load i32, i32* %6
%45 = icmp eq i32 %44, 5
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 (...) @quaddobl_Pade_test()
br label %50
48: ; preds = %43
%49 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.10, i64 0, i64 0))
br label %50
50: ; preds = %48, %46
br label %51
51: ; preds = %50, %41
br label %52
52: ; preds = %51, %36
br label %53
53: ; preds = %52, %31
br label %54
54: ; preds = %53, %26
br label %55
55: ; preds = %54, %21
%56 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.7 = [52 x i8] c"Type 0, 1, 2, 3, 4, or 5 to select the precision : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [3 x i8] c"%c\00"
@str = [54 x i8] c"\0AMENU to select the test and the working precision : \00"
@str.11 = [48 x i8] c" 0. power series in standard double precision;\00"
@str.12 = [46 x i8] c" 1. power series in double double precision;\00"
@str.13 = [44 x i8] c" 2. power series in quad double precision.\00"
@str.14 = [52 x i8] c" 3. Pade approximant in standard double precision;\00"
@str.15 = [50 x i8] c" 4. Pade approximant in double double precision;\00"
@str.16 = [48 x i8] c" 5. Pade approximant in quad double precision.\00"
@str.17 = [36 x i8] c"invalid selection, please try again\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %3 to i8*
%6 = tail call i32 (...) @adainit()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.11, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.12, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.13, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.14, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.15, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.16, i64 0, i64 0))
%14 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %3)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%17 = load i32, i32* %3
switch i32 %17, label %30 [
i32 0, label %18
i32 1, label %20
i32 2, label %22
i32 3, label %24
i32 4, label %26
i32 5, label %28
]
18: ; preds = %2
%19 = call i32 (...) @standard_series_test()
br label %32
20: ; preds = %2
%21 = call i32 (...) @dobldobl_series_test()
br label %32
22: ; preds = %2
%23 = call i32 (...) @quaddobl_series_test()
br label %32
24: ; preds = %2
%25 = call i32 (...) @standard_Pade_test()
br label %32
26: ; preds = %2
%27 = call i32 (...) @dobldobl_Pade_test()
br label %32
28: ; preds = %2
%29 = call i32 (...) @quaddobl_Pade_test()
br label %32
30: ; preds = %2
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.17, i64 0, i64 0))
br label %32
32: ; preds = %20, %24, %28, %30, %26, %22, %18
%33 = call i32 (...) @adafinal()
ret i32 0
}