#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*/ compute_mixed_volume();
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_and_construct();
int /*<<< orphan*/ read_and_retrieve();
int /*<<< orphan*/ read_cells_and_create_start_system();
int /*<<< orphan*/ read_cells_and_solve_start_system();
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ test_intcelcon();
int main(void) {
  char ans;
  printf("\nTesting the Operations in the Cells Container...\n\n");
  adainit();
  printf("Choose one of the following testing options :\n");
  printf("  0. read a polynomial system and compute its mixed volume;\n");
  printf("  1. read a mixed-cell configuration, test retrievals;\n");
  printf("  2. create a mixed-cell configuration interactively;\n");
  printf("  3. read a mixed-cell configuration and create start system;\n");
  printf("  4. polyhedral homotopies solve a random coefficient system;\n");
  printf("  5. test operations on integer cells container.\n");
  printf("Type 1, 2, 3, 4, or 5 to make your choice : ");
  ans = getchar();
  if (ans == '0')
    compute_mixed_volume();
  else if (ans == '1') {
    scanf("%c", &ans);
    read_and_retrieve();
  } else if (ans == '2')
    read_and_construct();
  else if (ans == '3') {
    scanf("%c", &ans);
    read_cells_and_create_start_system();
  } else if (ans == '4') {
    scanf("%c", &ans);
    read_cells_and_solve_start_system();
  } else if (ans == '5') {
    scanf("%c", &ans);
    test_intcelcon();
  } else
    printf("\nOption %c unknown.  Please come again.\n\n", ans);
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10c0 <adainit@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xefc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf2d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    1267 <main+0xb7>
mov    $0x0,%al
call   1090 <compute_mixed_volume@plt>
jmp    134f <main+0x19f>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    1290 <main+0xe0>
lea    0xf71(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   10b0 <scanf@plt>
mov    $0x0,%al
call   1070 <read_and_retrieve@plt>
jmp    134a <main+0x19a>
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jne    12a9 <main+0xf9>
mov    $0x0,%al
call   1050 <read_and_construct@plt>
jmp    1345 <main+0x195>
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
jne    12d2 <main+0x122>
lea    0xf2f(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   10b0 <scanf@plt>
mov    $0x0,%al
call   10d0 <read_cells_and_create_start_system@plt>
jmp    1340 <main+0x190>
movsbl -0x5(%rbp),%eax
cmp    $0x34,%eax
jne    12fb <main+0x14b>
lea    0xf06(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   10b0 <scanf@plt>
mov    $0x0,%al
call   10a0 <read_cells_and_solve_start_system@plt>
jmp    133b <main+0x18b>
movsbl -0x5(%rbp),%eax
cmp    $0x35,%eax
jne    1324 <main+0x174>
lea    0xedd(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   10b0 <scanf@plt>
mov    $0x0,%al
call   1030 <test_intcelcon@plt>
jmp    1336 <main+0x186>
movsbl -0x5(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    133b <main+0x18b>
jmp    1340 <main+0x190>
jmp    1345 <main+0x195>
jmp    134a <main+0x19a>
jmp    134f <main+0x19f>
mov    $0x0,%al
call   1080 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10d0 <adainit@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
lea    0xf1c(%rip),%rdi
call   1040 <puts@plt>
lea    0xf47(%rip),%rdi
call   1040 <puts@plt>
lea    0xf71(%rip),%rdi
call   1040 <puts@plt>
lea    0xfa3(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd5(%rip),%rdi
call   1040 <puts@plt>
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1070 <getchar@plt>
mov    %al,0x7(%rsp)
lea    -0x30(%rax),%ecx
cmp    $0x5,%cl
ja     1268 <main+0xa8>
movzbl %cl,%eax
lea    0xdad(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   10a0 <compute_mixed_volume@plt>
jmp    12ea <main+0x12a>
movsbl %al,%esi
lea    0xdd6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    12ea <main+0x12a>
lea    0xdc3(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10c0 <scanf@plt>
xor    %eax,%eax
call   1080 <read_and_retrieve@plt>
jmp    12ea <main+0x12a>
xor    %eax,%eax
call   1060 <read_and_construct@plt>
jmp    12ea <main+0x12a>
lea    0xda0(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10c0 <scanf@plt>
xor    %eax,%eax
call   10e0 <read_cells_and_create_start_system@plt>
jmp    12ea <main+0x12a>
lea    0xd86(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10c0 <scanf@plt>
xor    %eax,%eax
call   10b0 <read_cells_and_solve_start_system@plt>
jmp    12ea <main+0x12a>
lea    0xd6c(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10c0 <scanf@plt>
xor    %eax,%eax
call   1030 <test_intcelcon@plt>
xor    %eax,%eax
call   1090 <adafinal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\0ATesting the Operations in the Cells Container...\0A\0A\00"
@.str.1 = [47 x i8] c"Choose one of the following testing options :\0A\00"
@.str.2 = [61 x i8] c" 0. read a polynomial system and compute its mixed volume;\0A\00"
@.str.3 = [56 x i8] c" 1. read a mixed-cell configuration, test retrievals;\0A\00"
@.str.4 = [55 x i8] c" 2. create a mixed-cell configuration interactively;\0A\00"
@.str.5 = [63 x i8] c" 3. read a mixed-cell configuration and create start system;\0A\00"
@.str.6 = [63 x i8] c" 4. polyhedral homotopies solve a random coefficient system;\0A\00"
@.str.7 = [50 x i8] c" 5. test operations on integer cells container.\0A\00"
@.str.8 = [45 x i8] c"Type 1, 2, 3, 4, or 5 to make your choice : \00"
@.str.9 = [3 x i8] c"%c\00"
@.str.10 = [42 x i8] c"\0AOption %c unknown. Please come again.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @adainit()
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.5, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.6, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %2
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 48
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (...) @compute_mixed_volume()
br label %62
19: ; preds = %0
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 49
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%25 = call i32 (...) @read_and_retrieve()
br label %61
26: ; preds = %19
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp eq i32 %28, 50
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 (...) @read_and_construct()
br label %60
32: ; preds = %26
%33 = load i8, i8* %2
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 51
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%38 = call i32 (...) @read_cells_and_create_start_system()
br label %59
39: ; preds = %32
%40 = load i8, i8* %2
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %41, 52
br i1 %42, label %43, label %46
43: ; preds = %39
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%45 = call i32 (...) @read_cells_and_solve_start_system()
br label %58
46: ; preds = %39
%47 = load i8, i8* %2
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 53
br i1 %49, label %50, label %53
50: ; preds = %46
%51 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %2)
%52 = call i32 (...) @test_intcelcon()
br label %57
53: ; preds = %46
%54 = load i8, i8* %2
%55 = sext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %53, %50
br label %58
58: ; preds = %57, %43
br label %59
59: ; preds = %58, %36
br label %60
60: ; preds = %59, %30
br label %61
61: ; preds = %60, %23
br label %62
62: ; preds = %61, %17
%63 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.8 = [45 x i8] c"Type 1, 2, 3, 4, or 5 to make your choice : \00"
@.str.9 = [3 x i8] c"%c\00"
@.str.10 = [42 x i8] c"\0AOption %c unknown. Please come again.\0A\0A\00"
@str = [51 x i8] c"\0ATesting the Operations in the Cells Container...\0A\00"
@str.11 = [46 x i8] c"Choose one of the following testing options :\00"
@str.12 = [60 x i8] c" 0. read a polynomial system and compute its mixed volume;\00"
@str.13 = [55 x i8] c" 1. read a mixed-cell configuration, test retrievals;\00"
@str.14 = [54 x i8] c" 2. create a mixed-cell configuration interactively;\00"
@str.15 = [62 x i8] c" 3. read a mixed-cell configuration and create start system;\00"
@str.16 = [62 x i8] c" 4. polyhedral homotopies solve a random coefficient system;\00"
@str.17 = [49 x i8] c" 5. test operations on integer cells container.\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @adainit()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.11, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.12, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.13, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.14, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.15, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.16, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.17, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%12 = tail call signext i8 (...) @getchar()
store i8 %12, i8* %1
switch i8 %12, label %29 [
i8 48, label %13
i8 49, label %15
i8 50, label %18
i8 51, label %20
i8 52, label %23
i8 53, label %26
]
13: ; preds = %0
%14 = tail call i32 (...) @compute_mixed_volume()
br label %32
15: ; preds = %0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%17 = call i32 (...) @read_and_retrieve()
br label %32
18: ; preds = %0
%19 = tail call i32 (...) @read_and_construct()
br label %32
20: ; preds = %0
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%22 = call i32 (...) @read_cells_and_create_start_system()
br label %32
23: ; preds = %0
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%25 = call i32 (...) @read_cells_and_solve_start_system()
br label %32
26: ; preds = %0
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %1)
%28 = call i32 (...) @test_intcelcon()
br label %32
29: ; preds = %0
%30 = sext i8 %12 to i32
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %15, %20, %26, %29, %23, %18, %13
%33 = call i32 (...) @adafinal()
ret i32 0
}