#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 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("Type 1, 2, 3, or 4 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
    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    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   10b0 <adainit@plt>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jne    1249 <main+0xa9>
mov    $0x0,%al
call   1080 <compute_mixed_volume@plt>
jmp    1303 <main+0x163>
movsbl -0x5(%rbp),%eax
cmp    $0x31,%eax
jne    1272 <main+0xd2>
lea    0xf5a(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   10a0 <scanf@plt>
mov    $0x0,%al
call   1060 <read_and_retrieve@plt>
jmp    12fe <main+0x15e>
movsbl -0x5(%rbp),%eax
cmp    $0x32,%eax
jne    128b <main+0xeb>
mov    $0x0,%al
call   1040 <read_and_construct@plt>
jmp    12f9 <main+0x159>
movsbl -0x5(%rbp),%eax
cmp    $0x33,%eax
jne    12b4 <main+0x114>
lea    0xf18(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   10a0 <scanf@plt>
mov    $0x0,%al
call   10c0 <read_cells_and_create_start_system@plt>
jmp    12f4 <main+0x154>
movsbl -0x5(%rbp),%eax
cmp    $0x34,%eax
jne    12dd <main+0x13d>
lea    0xeef(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   10a0 <scanf@plt>
mov    $0x0,%al
call   1090 <read_cells_and_solve_start_system@plt>
jmp    12ef <main+0x14f>
movsbl -0x5(%rbp),%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12f4 <main+0x154>
jmp    12f9 <main+0x159>
jmp    12fe <main+0x15e>
jmp    1303 <main+0x163>
mov    $0x0,%al
call   1070 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   10c0 <adainit@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf25(%rip),%rdi
call   1030 <puts@plt>
lea    0xf50(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfac(%rip),%rdi
call   1030 <puts@plt>
lea    0xe01(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %al,0x7(%rsp)
lea    -0x30(%rax),%ecx
cmp    $0x4,%cl
ja     1249 <main+0x99>
movzbl %cl,%eax
lea    0xdc9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1090 <compute_mixed_volume@plt>
jmp    12b1 <main+0x101>
movsbl %al,%esi
lea    0xdee(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12b1 <main+0x101>
lea    0xddb(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10b0 <scanf@plt>
xor    %eax,%eax
call   1070 <read_and_retrieve@plt>
jmp    12b1 <main+0x101>
xor    %eax,%eax
call   1050 <read_and_construct@plt>
jmp    12b1 <main+0x101>
lea    0xdb8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10b0 <scanf@plt>
xor    %eax,%eax
call   10d0 <read_cells_and_create_start_system@plt>
jmp    12b1 <main+0x101>
lea    0xd9e(%rip),%rdi
lea    0x7(%rsp),%rsi
call   10b0 <scanf@plt>
xor    %eax,%eax
call   10a0 <read_cells_and_solve_start_system@plt>
xor    %eax,%eax
call   1080 <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 = [42 x i8] c"Type 1, 2, 3, or 4 to make your choice : \00"
@.str.8 = [3 x i8] c"%c\00"
@.str.9 = [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 ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%12 = call signext i8 (...) @getchar()
store i8 %12, i8* %2
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 48
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 (...) @compute_mixed_volume()
br label %53
18: ; preds = %0
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 49
br i1 %21, label %22, label %25
22: ; preds = %18
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %2)
%24 = call i32 (...) @read_and_retrieve()
br label %52
25: ; preds = %18
%26 = load i8, i8* %2
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 50
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 (...) @read_and_construct()
br label %51
31: ; preds = %25
%32 = load i8, i8* %2
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %33, 51
br i1 %34, label %35, label %38
35: ; preds = %31
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %2)
%37 = call i32 (...) @read_cells_and_create_start_system()
br label %50
38: ; preds = %31
%39 = load i8, i8* %2
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 52
br i1 %41, label %42, label %45
42: ; preds = %38
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %2)
%44 = call i32 (...) @read_cells_and_solve_start_system()
br label %49
45: ; preds = %38
%46 = load i8, i8* %2
%47 = sext i8 %46 to i32
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %45, %42
br label %50
50: ; preds = %49, %35
br label %51
51: ; preds = %50, %29
br label %52
52: ; preds = %51, %22
br label %53
53: ; preds = %52, %16
%54 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.7 = [42 x i8] c"Type 1, 2, 3, or 4 to make your choice : \00"
@.str.8 = [3 x i8] c"%c\00"
@.str.9 = [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.10 = [46 x i8] c"Choose one of the following testing options :\00"
@str.11 = [60 x i8] c" 0. read a polynomial system and compute its mixed volume;\00"
@str.12 = [55 x i8] c" 1. read a mixed-cell configuration, test retrievals;\00"
@str.13 = [54 x i8] c" 2. create a mixed-cell configuration interactively;\00"
@str.14 = [62 x i8] c" 3. read a mixed-cell configuration and create start system;\00"
@str.15 = [62 x i8] c" 4. polyhedral homotopies solve a random coefficient system.\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.10, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.11, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.12, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.13, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.14, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.15, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.7, i64 0, i64 0))
%11 = tail call signext i8 (...) @getchar()
store i8 %11, i8* %1
switch i8 %11, label %25 [
i8 48, label %12
i8 49, label %14
i8 50, label %17
i8 51, label %19
i8 52, label %22
]
12: ; preds = %0
%13 = tail call i32 (...) @compute_mixed_volume()
br label %28
14: ; preds = %0
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %1)
%16 = call i32 (...) @read_and_retrieve()
br label %28
17: ; preds = %0
%18 = tail call i32 (...) @read_and_construct()
br label %28
19: ; preds = %0
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %1)
%21 = call i32 (...) @read_cells_and_create_start_system()
br label %28
22: ; preds = %0
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i8* %1)
%24 = call i32 (...) @read_cells_and_solve_start_system()
br label %28
25: ; preds = %0
%26 = sext i8 %11 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.9, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %14, %19, %25, %22, %17, %12
%29 = call i32 (...) @adafinal()
ret i32 0
}