#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_laursys_solver();
int dobldobl_polysys_solver();
int /*<<< orphan*/ printf(char *);
int quaddobl_laursys_solver();
int quaddobl_polysys_solver();
int /*<<< orphan*/ scanf(char *, int *);
int standard_laursys_solver();
int standard_polysys_solver();
int main(int argc, char *argv[]) {
  int fail, choice;
  adainit();
  printf("\nMENU for the precision and type of system :\n");
  printf("  0. standard double precision on a polynomial system\n");
  printf("  1. standard double precision on a Laurent polynomial system\n");
  printf("  2. double double precision on a polynomial system\n");
  printf("  3. double double precision on a Laurent polynomial system\n");
  printf("  4. quad double precision on a polynomial system\n");
  printf("  5. quad double precision on a Laurent polynomial system\n");
  printf("Type 0, 1, 2, 3, 4, or 5 : ");
  scanf("%d", &choice);
  if (choice == 0)
    fail = standard_polysys_solver();
  else if (choice == 1)
    fail = standard_laursys_solver();
  else if (choice == 2)
    fail = dobldobl_polysys_solver();
  else if (choice == 3)
    fail = dobldobl_laursys_solver();
  else if (choice == 4)
    fail = quaddobl_polysys_solver();
  else if (choice == 5)
    fail = quaddobl_laursys_solver();
  else
    printf("invalid choice\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   10a0 <adainit@plt>
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf6c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf7c(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1246 <main+0xa6>
mov    $0x0,%al
call   1040 <standard_polysys_solver@plt>
mov    %eax,-0x14(%rbp)
jmp    12e8 <main+0x148>
cmpl   $0x1,-0x18(%rbp)
jne    125f <main+0xbf>
mov    $0x0,%al
call   10b0 <standard_laursys_solver@plt>
mov    %eax,-0x14(%rbp)
jmp    12e3 <main+0x143>
cmpl   $0x2,-0x18(%rbp)
jne    1278 <main+0xd8>
mov    $0x0,%al
call   10c0 <dobldobl_polysys_solver@plt>
mov    %eax,-0x14(%rbp)
jmp    12de <main+0x13e>
cmpl   $0x3,-0x18(%rbp)
jne    1291 <main+0xf1>
mov    $0x0,%al
call   1050 <dobldobl_laursys_solver@plt>
mov    %eax,-0x14(%rbp)
jmp    12d9 <main+0x139>
cmpl   $0x4,-0x18(%rbp)
jne    12aa <main+0x10a>
mov    $0x0,%al
call   1080 <quaddobl_polysys_solver@plt>
mov    %eax,-0x14(%rbp)
jmp    12d4 <main+0x134>
cmpl   $0x5,-0x18(%rbp)
jne    12c3 <main+0x123>
mov    $0x0,%al
call   1070 <quaddobl_laursys_solver@plt>
mov    %eax,-0x14(%rbp)
jmp    12cf <main+0x12f>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    12d4 <main+0x134>
jmp    12d9 <main+0x139>
jmp    12de <main+0x13e>
jmp    12e3 <main+0x143>
jmp    12e8 <main+0x148>
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   10b0 <adainit@plt>
lea    0xe78(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf4d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf73(%rip),%rdi
call   1030 <puts@plt>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
lea    0xe15(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10a0 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x5,%rax
ja     124c <main+0x9c>
lea    0xdc6(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1050 <standard_polysys_solver@plt>
jmp    1285 <main+0xd5>
lea    0xf61(%rip),%rdi
call   1030 <puts@plt>
jmp    1285 <main+0xd5>
xor    %eax,%eax
call   10c0 <standard_laursys_solver@plt>
jmp    1285 <main+0xd5>
xor    %eax,%eax
call   10d0 <dobldobl_polysys_solver@plt>
jmp    1285 <main+0xd5>
xor    %eax,%eax
call   1060 <dobldobl_laursys_solver@plt>
jmp    1285 <main+0xd5>
xor    %eax,%eax
call   1090 <quaddobl_polysys_solver@plt>
jmp    1285 <main+0xd5>
xor    %eax,%eax
call   1080 <quaddobl_laursys_solver@plt>
xor    %eax,%eax
call   1070 <adafinal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"\0AMENU for the precision and type of system :\0A\00"
@.str.1 = [55 x i8] c" 0. standard double precision on a polynomial system\0A\00"
@.str.2 = [63 x i8] c" 1. standard double precision on a Laurent polynomial system\0A\00"
@.str.3 = [53 x i8] c" 2. double double precision on a polynomial system\0A\00"
@.str.4 = [61 x i8] c" 3. double double precision on a Laurent polynomial system\0A\00"
@.str.5 = [51 x i8] c" 4. quad double precision on a polynomial system\0A\00"
@.str.6 = [59 x i8] c" 5. quad double precision on a Laurent polynomial system\0A\00"
@.str.7 = [28 x i8] c"Type 0, 1, 2, 3, 4, or 5 : \00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [16 x i8] c"invalid choice\0A\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 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 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 ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %7)
%18 = load i32, i32* %7
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (...) @standard_polysys_solver()
store i32 %21, i32* %6
br label %54
22: ; preds = %2
%23 = load i32, i32* %7
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (...) @standard_laursys_solver()
store i32 %26, i32* %6
br label %53
27: ; preds = %22
%28 = load i32, i32* %7
%29 = icmp eq i32 %28, 2
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (...) @dobldobl_polysys_solver()
store i32 %31, i32* %6
br label %52
32: ; preds = %27
%33 = load i32, i32* %7
%34 = icmp eq i32 %33, 3
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 (...) @dobldobl_laursys_solver()
store i32 %36, i32* %6
br label %51
37: ; preds = %32
%38 = load i32, i32* %7
%39 = icmp eq i32 %38, 4
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 (...) @quaddobl_polysys_solver()
store i32 %41, i32* %6
br label %50
42: ; preds = %37
%43 = load i32, i32* %7
%44 = icmp eq i32 %43, 5
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (...) @quaddobl_laursys_solver()
store i32 %46, i32* %6
br label %49
47: ; preds = %42
%48 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
br label %50
50: ; preds = %49, %40
br label %51
51: ; preds = %50, %35
br label %52
52: ; preds = %51, %30
br label %53
53: ; preds = %52, %25
br label %54
54: ; preds = %53, %20
%55 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.7 = [28 x i8] c"Type 0, 1, 2, 3, 4, or 5 : \00"
@.str.8 = [3 x i8] c"%d\00"
@str = [45 x i8] c"\0AMENU for the precision and type of system :\00"
@str.10 = [54 x i8] c" 0. standard double precision on a polynomial system\00"
@str.11 = [62 x i8] c" 1. standard double precision on a Laurent polynomial system\00"
@str.12 = [52 x i8] c" 2. double double precision on a polynomial system\00"
@str.13 = [60 x i8] c" 3. double double precision on a Laurent polynomial system\00"
@str.14 = [50 x i8] c" 4. quad double precision on a polynomial system\00"
@str.15 = [58 x i8] c" 5. quad double precision on a Laurent polynomial system\00"
@str.16 = [15 x i8] c"invalid choice\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.10, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.11, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.12, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.13, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.14, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.15, i64 0, i64 0))
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
switch i32 %15, label %28 [
i32 0, label %16
i32 1, label %18
i32 2, label %20
i32 3, label %22
i32 4, label %24
i32 5, label %26
]
16: ; preds = %2
%17 = call i32 (...) @standard_polysys_solver()
br label %30
18: ; preds = %2
%19 = call i32 (...) @standard_laursys_solver()
br label %30
20: ; preds = %2
%21 = call i32 (...) @dobldobl_polysys_solver()
br label %30
22: ; preds = %2
%23 = call i32 (...) @dobldobl_laursys_solver()
br label %30
24: ; preds = %2
%25 = call i32 (...) @quaddobl_polysys_solver()
br label %30
26: ; preds = %2
%27 = call i32 (...) @quaddobl_laursys_solver()
br label %30
28: ; preds = %2
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.16, i64 0, i64 0))
br label %30
30: ; preds = %18, %22, %26, %28, %24, %20, %16
%31 = call i32 (...) @adafinal()
ret i32 0
}