#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ test_dobldobl_container();
int /*<<< orphan*/ test_multprec_container();
int /*<<< orphan*/ test_quaddobl_container();
int /*<<< orphan*/ test_read_solutions_from_file();
int /*<<< orphan*/ test_retrieve_all_standard_solution_strings();
int /*<<< orphan*/ test_standard_container();
int /*<<< orphan*/ test_standard_next_retrievals();
int main(void) {
  int choice;
  char ch;
  printf("\nMENU to test solution containers :\n");
  printf("  1. test with standard doubles;\n");
  printf("  2. test with double doubles;\n");
  printf("  3. test with quad doubles;\n");
  printf("  4. test with multiprecision numbers;\n");
  printf("  5. test retrieval of standard solutions with next.\n");
  printf("  6. test retrieval of all standard solution strings.\n");
  printf("  7. test reading solutions from a file with given name.\n");
  printf("Type 1, 2, 3, 4, 5, 6, or 7 to choose a test : ");
  scanf("%d", &choice);
  scanf("%c", &ch);
  printf("\n");
  adainit();
  if (choice == 1)
    test_standard_container();
  else if (choice == 2)
    test_dobldobl_container();
  else if (choice == 3)
    test_quaddobl_container();
  else if (choice == 4)
    test_multprec_container();
  else if (choice == 5)
    test_standard_next_retrievals();
  else if (choice == 6)
    test_retrieve_all_standard_solution_strings();
  else if (choice == 7)
    test_read_solutions_from_file();
  else
    printf("invalid choice, please try again\n");
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe3a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe53(%rip),%rdi
call   1050 <printf@plt>
lea    0xe69(%rip),%rdi
call   1050 <printf@plt>
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
lea    0xeab(%rip),%rdi
call   1050 <printf@plt>
lea    0xed5(%rip),%rdi
call   1050 <printf@plt>
lea    0xf00(%rip),%rdi
call   1050 <printf@plt>
lea    0xf2e(%rip),%rdi
call   1050 <printf@plt>
lea    0xf52(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xf43(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xefc(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <adainit@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1278 <main+0xc8>
mov    $0x0,%al
call   10d0 <test_standard_container@plt>
jmp    1326 <main+0x176>
cmpl   $0x2,-0x8(%rbp)
jne    128e <main+0xde>
mov    $0x0,%al
call   10c0 <test_dobldobl_container@plt>
jmp    1321 <main+0x171>
cmpl   $0x3,-0x8(%rbp)
jne    12a4 <main+0xf4>
mov    $0x0,%al
call   1030 <test_quaddobl_container@plt>
jmp    131c <main+0x16c>
cmpl   $0x4,-0x8(%rbp)
jne    12ba <main+0x10a>
mov    $0x0,%al
call   1080 <test_multprec_container@plt>
jmp    1317 <main+0x167>
cmpl   $0x5,-0x8(%rbp)
jne    12d0 <main+0x120>
mov    $0x0,%al
call   1070 <test_standard_next_retrievals@plt>
jmp    1312 <main+0x162>
cmpl   $0x6,-0x8(%rbp)
jne    12e6 <main+0x136>
mov    $0x0,%al
call   1040 <test_retrieve_all_standard_solution_strings@plt>
jmp    130d <main+0x15d>
cmpl   $0x7,-0x8(%rbp)
jne    12fc <main+0x14c>
mov    $0x0,%al
call   10b0 <test_read_solutions_from_file@plt>
jmp    1308 <main+0x158>
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
jmp    130d <main+0x15d>
jmp    1312 <main+0x162>
jmp    1317 <main+0x167>
jmp    131c <main+0x16c>
jmp    1321 <main+0x171>
jmp    1326 <main+0x176>
mov    $0x0,%al
call   1060 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe7a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe92(%rip),%rdi
call   1040 <puts@plt>
lea    0xea7(%rip),%rdi
call   1040 <puts@plt>
lea    0xeba(%rip),%rdi
call   1040 <puts@plt>
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0xee6(%rip),%rdi
call   1040 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1040 <puts@plt>
lea    0xf39(%rip),%rdi
call   1040 <puts@plt>
lea    0xde4(%rip),%rdi
call   1070 <printf@plt>
lea    0xe08(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xdf8(%rip),%rdi
lea    0x3(%rsp),%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   10c0 <adainit@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x6,%eax
ja     1299 <main+0xc9>
lea    0xd79(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   10f0 <test_standard_container@plt>
jmp    12db <main+0x10b>
lea    0xefe(%rip),%rdi
call   1040 <puts@plt>
jmp    12db <main+0x10b>
xor    %eax,%eax
call   10e0 <test_dobldobl_container@plt>
jmp    12db <main+0x10b>
xor    %eax,%eax
call   1050 <test_quaddobl_container@plt>
jmp    12db <main+0x10b>
xor    %eax,%eax
call   10a0 <test_multprec_container@plt>
jmp    12db <main+0x10b>
xor    %eax,%eax
call   1090 <test_standard_next_retrievals@plt>
jmp    12db <main+0x10b>
xor    %eax,%eax
call   1060 <test_retrieve_all_standard_solution_strings@plt>
jmp    12db <main+0x10b>
xor    %eax,%eax
call   10d0 <test_read_solutions_from_file@plt>
xor    %eax,%eax
call   1080 <adafinal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0AMENU to test solution containers :\0A\00"
@.str.1 = [34 x i8] c" 1. test with standard doubles;\0A\00"
@.str.2 = [32 x i8] c" 2. test with double doubles;\0A\00"
@.str.3 = [30 x i8] c" 3. test with quad doubles;\0A\00"
@.str.4 = [40 x i8] c" 4. test with multiprecision numbers;\0A\00"
@.str.5 = [54 x i8] c" 5. test retrieval of standard solutions with next.\0A\00"
@.str.6 = [55 x i8] c" 6. test retrieval of all standard solution strings.\0A\00"
@.str.7 = [58 x i8] c" 7. test reading solutions from a file with given name.\0A\00"
@.str.8 = [48 x i8] c"Type 1, 2, 3, 4, 5, 6, or 7 to choose a test : \00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [3 x i8] c"%c\00"
@.str.11 = [2 x i8] c"\0A\00"
@.str.12 = [34 x i8] c"invalid choice, please try again\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %2)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %3)
%15 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%16 = call i32 (...) @adainit()
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %0
%20 = call i32 (...) @test_standard_container()
br label %59
21: ; preds = %0
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 2
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 (...) @test_dobldobl_container()
br label %58
26: ; preds = %21
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 3
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 (...) @test_quaddobl_container()
br label %57
31: ; preds = %26
%32 = load i32, i32* %2
%33 = icmp eq i32 %32, 4
br i1 %33, label %34, label %36
34: ; preds = %31
%35 = call i32 (...) @test_multprec_container()
br label %56
36: ; preds = %31
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 5
br i1 %38, label %39, label %41
39: ; preds = %36
%40 = call i32 (...) @test_standard_next_retrievals()
br label %55
41: ; preds = %36
%42 = load i32, i32* %2
%43 = icmp eq i32 %42, 6
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = call i32 (...) @test_retrieve_all_standard_solution_strings()
br label %54
46: ; preds = %41
%47 = load i32, i32* %2
%48 = icmp eq i32 %47, 7
br i1 %48, label %49, label %51
49: ; preds = %46
%50 = call i32 (...) @test_read_solutions_from_file()
br label %53
51: ; preds = %46
%52 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
br label %54
54: ; preds = %53, %44
br label %55
55: ; preds = %54, %39
br label %56
56: ; preds = %55, %34
br label %57
57: ; preds = %56, %29
br label %58
58: ; preds = %57, %24
br label %59
59: ; preds = %58, %19
%60 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.8 = [48 x i8] c"Type 1, 2, 3, 4, 5, 6, or 7 to choose a test : \00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [3 x i8] c"%c\00"
@str = [36 x i8] c"\0AMENU to test solution containers :\00"
@str.13 = [33 x i8] c" 1. test with standard doubles;\00"
@str.14 = [31 x i8] c" 2. test with double doubles;\00"
@str.15 = [29 x i8] c" 3. test with quad doubles;\00"
@str.16 = [39 x i8] c" 4. test with multiprecision numbers;\00"
@str.17 = [53 x i8] c" 5. test retrieval of standard solutions with next.\00"
@str.18 = [54 x i8] c" 6. test retrieval of all standard solution strings.\00"
@str.19 = [57 x i8] c" 7. test reading solutions from a file with given name.\00"
@str.20 = [33 x i8] c"invalid choice, please try again\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.13, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.14, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.15, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.16, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str.17, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.18, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.19, i64 0, i64 0))
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %1)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %2)
%15 = call i32 @putchar(i32 10)
%16 = call i32 (...) @adainit()
%17 = load i32, i32* %1
switch i32 %17, label %32 [
i32 1, label %18
i32 2, label %20
i32 3, label %22
i32 4, label %24
i32 5, label %26
i32 6, label %28
i32 7, label %30
]
18: ; preds = %0
%19 = call i32 (...) @test_standard_container()
br label %34
20: ; preds = %0
%21 = call i32 (...) @test_dobldobl_container()
br label %34
22: ; preds = %0
%23 = call i32 (...) @test_quaddobl_container()
br label %34
24: ; preds = %0
%25 = call i32 (...) @test_multprec_container()
br label %34
26: ; preds = %0
%27 = call i32 (...) @test_standard_next_retrievals()
br label %34
28: ; preds = %0
%29 = call i32 (...) @test_retrieve_all_standard_solution_strings()
br label %34
30: ; preds = %0
%31 = call i32 (...) @test_read_solutions_from_file()
br label %34
32: ; preds = %0
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.20, i64 0, i64 0))
br label %34
34: ; preds = %20, %24, %28, %32, %30, %26, %22, %18
%35 = call i32 (...) @adafinal()
ret i32 0
}