#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_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("Type 1, 2, 3, 4, 5, or 6 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
    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    0xe4a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe63(%rip),%rdi
call   1050 <printf@plt>
lea    0xe79(%rip),%rdi
call   1050 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
lea    0xe9f(%rip),%rdi
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
call   1050 <printf@plt>
lea    0xee5(%rip),%rdi
call   1050 <printf@plt>
lea    0xf10(%rip),%rdi
call   1050 <printf@plt>
lea    0xf31(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xf22(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xede(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   10a0 <adainit@plt>
cmpl   $0x1,-0x8(%rbp)
jne    125c <main+0xbc>
mov    $0x0,%al
call   10c0 <test_standard_container@plt>
jmp    12ef <main+0x14f>
cmpl   $0x2,-0x8(%rbp)
jne    1272 <main+0xd2>
mov    $0x0,%al
call   10b0 <test_dobldobl_container@plt>
jmp    12ea <main+0x14a>
cmpl   $0x3,-0x8(%rbp)
jne    1288 <main+0xe8>
mov    $0x0,%al
call   1030 <test_quaddobl_container@plt>
jmp    12e5 <main+0x145>
cmpl   $0x4,-0x8(%rbp)
jne    129e <main+0xfe>
mov    $0x0,%al
call   1080 <test_multprec_container@plt>
jmp    12e0 <main+0x140>
cmpl   $0x5,-0x8(%rbp)
jne    12b4 <main+0x114>
mov    $0x0,%al
call   1070 <test_standard_next_retrievals@plt>
jmp    12db <main+0x13b>
cmpl   $0x6,-0x8(%rbp)
jne    12ca <main+0x12a>
mov    $0x0,%al
call   1040 <test_retrieve_all_standard_solution_strings@plt>
jmp    12d6 <main+0x136>
lea    0xe7c(%rip),%rdi
call   1050 <printf@plt>
jmp    12db <main+0x13b>
jmp    12e0 <main+0x140>
jmp    12e5 <main+0x145>
jmp    12ea <main+0x14a>
jmp    12ef <main+0x14f>
mov    $0x0,%al
call   1060 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1040 <puts@plt>
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
lea    0xeef(%rip),%rdi
call   1040 <puts@plt>
lea    0xf18(%rip),%rdi
call   1040 <puts@plt>
lea    0xdfc(%rip),%rdi
call   1070 <printf@plt>
lea    0xe1d(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xe0d(%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    $0x5,%eax
ja     127d <main+0xbd>
lea    0xd95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   10e0 <test_standard_container@plt>
jmp    12b6 <main+0xf6>
lea    0xeda(%rip),%rdi
call   1040 <puts@plt>
jmp    12b6 <main+0xf6>
xor    %eax,%eax
call   10d0 <test_dobldobl_container@plt>
jmp    12b6 <main+0xf6>
xor    %eax,%eax
call   1050 <test_quaddobl_container@plt>
jmp    12b6 <main+0xf6>
xor    %eax,%eax
call   10a0 <test_multprec_container@plt>
jmp    12b6 <main+0xf6>
xor    %eax,%eax
call   1090 <test_standard_next_retrievals@plt>
jmp    12b6 <main+0xf6>
xor    %eax,%eax
call   1060 <test_retrieve_all_standard_solution_strings@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 = [45 x i8] c"Type 1, 2, 3, 4, 5, or 6 to choose a test : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [3 x i8] c"%c\00"
@.str.10 = [2 x i8] c"\0A\00"
@.str.11 = [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 ([45 x i8], [45 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %3)
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%15 = call i32 (...) @adainit()
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = call i32 (...) @test_standard_container()
br label %52
20: ; preds = %0
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 2
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @test_dobldobl_container()
br label %51
25: ; preds = %20
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 3
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @test_quaddobl_container()
br label %50
30: ; preds = %25
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 4
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (...) @test_multprec_container()
br label %49
35: ; preds = %30
%36 = load i32, i32* %2
%37 = icmp eq i32 %36, 5
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 (...) @test_standard_next_retrievals()
br label %48
40: ; preds = %35
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 6
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (...) @test_retrieve_all_standard_solution_strings()
br label %47
45: ; preds = %40
%46 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.11, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
br label %48
48: ; preds = %47, %38
br label %49
49: ; preds = %48, %33
br label %50
50: ; preds = %49, %28
br label %51
51: ; preds = %50, %23
br label %52
52: ; preds = %51, %18
%53 = call i32 (...) @adafinal()
ret i32 0
}

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