#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_test(int);
int /*<<< orphan*/ printf(char *, ...);
int quaddobl_test(int);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ srand(int);
int standard_test(int);
int time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  char ans;
  int precision, fail, laurent;
  int seed = time(NULL);
  adainit();
  srand(seed);
  printf("Seed for the random number generators : %d.\n", seed);
  printf("\nMENU for the working precision :\n");
  printf("  0. standard double precision;\n");
  printf("  1. double double precision;\n");
  printf("  2. quad double precision.\n");
  printf("Type 0, 1, or 2 to make a choice : ");
  scanf("%d", &precision);
  scanf("%c", &ans);
  printf("\nLaurent polynomial system ? (y/n) ");
  scanf("%c", &ans);
  laurent = (ans == 'y');
  scanf("%c", &ans);
  if (precision == 0)
    fail = standard_test(laurent);
  else if (precision == 1)
    fail = dobldobl_test(laurent);
  else if (precision == 2)
    fail = quaddobl_test(laurent);
  else
    printf("Selected precision level is not supported.\n");
  adafinal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1080 <time@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   10b0 <adainit@plt>
mov    -0x24(%rbp),%edi
call   1060 <srand@plt>
mov    -0x24(%rbp),%esi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xea3(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe83(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x79,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
lea    0xe5f(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    129a <main+0x10a>
mov    -0x20(%rbp),%edi
call   1050 <standard_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    12e6 <main+0x156>
cmpl   $0x1,-0x18(%rbp)
jne    12b4 <main+0x124>
mov    -0x20(%rbp),%edi
call   1090 <dobldobl_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    12e1 <main+0x151>
cmpl   $0x2,-0x18(%rbp)
jne    12ce <main+0x13e>
mov    -0x20(%rbp),%edi
call   1030 <quaddobl_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    12dc <main+0x14c>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    12e1 <main+0x151>
jmp    12e6 <main+0x156>
mov    $0x0,%al
call   1070 <adafinal@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1090 <time@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   10c0 <adainit@plt>
mov    %ebx,%edi
call   1070 <srand@plt>
lea    0xe39(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xee0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe26(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe3c(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xe2c(%rip),%r14
lea    0xb(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
xor    %ebx,%ebx
cmpb   $0x79,0xb(%rsp)
sete   %bl
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
je     1287 <main+0xe7>
cmp    $0x1,%eax
je     1290 <main+0xf0>
test   %eax,%eax
jne    1299 <main+0xf9>
mov    %ebx,%edi
call   1060 <standard_test@plt>
jmp    12a5 <main+0x105>
mov    %ebx,%edi
call   1040 <quaddobl_test@plt>
jmp    12a5 <main+0x105>
mov    %ebx,%edi
call   10a0 <dobldobl_test@plt>
jmp    12a5 <main+0x105>
lea    0xe57(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Seed for the random number generators : %d.\0A\00"
@.str.1 = [35 x i8] c"\0AMENU for the working precision :\0A\00"
@.str.2 = [33 x i8] c" 0. standard double precision;\0A\00"
@.str.3 = [31 x i8] c" 1. double double precision;\0A\00"
@.str.4 = [29 x i8] c" 2. quad double precision.\0A\00"
@.str.5 = [36 x i8] c"Type 0, 1, or 2 to make a choice : \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [36 x i8] c"\0ALaurent polynomial system ? (y/n) \00"
@.str.9 = [44 x i8] c"Selected precision level is not supported.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @time(i32* null)
store i32 %11, i32* %10
%12 = call i32 (...) @adainit()
%13 = load i32, i32* %10
%14 = call i32 @srand(i32 %13)
%15 = load i32, i32* %10
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %7)
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%26 = load i8, i8* %6
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 121
%29 = zext i1 %28 to i32
store i32 %29, i32* %9
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%31 = load i32, i32* %7
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %2
%34 = load i32, i32* %9
%35 = call i32 @standard_test(i32 %34)
store i32 %35, i32* %8
br label %52
36: ; preds = %2
%37 = load i32, i32* %7
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %42
39: ; preds = %36
%40 = load i32, i32* %9
%41 = call i32 @dobldobl_test(i32 %40)
store i32 %41, i32* %8
br label %51
42: ; preds = %36
%43 = load i32, i32* %7
%44 = icmp eq i32 %43, 2
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* %9
%47 = call i32 @quaddobl_test(i32 %46)
store i32 %47, i32* %8
br label %50
48: ; preds = %42
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.9, i64 0, i64 0))
br label %50
50: ; preds = %48, %45
br label %51
51: ; preds = %50, %39
br label %52
52: ; preds = %51, %33
%53 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"Seed for the random number generators : %d.\0A\00"
@.str.5 = [36 x i8] c"Type 0, 1, or 2 to make a choice : \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [36 x i8] c"\0ALaurent polynomial system ? (y/n) \00"
@str = [34 x i8] c"\0AMENU for the working precision :\00"
@str.10 = [32 x i8] c" 0. standard double precision;\00"
@str.11 = [30 x i8] c" 1. double double precision;\00"
@str.12 = [28 x i8] c" 2. quad double precision.\00"
@str.13 = [43 x i8] c"Selected precision level is not supported.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 (...) @adainit()
%8 = tail call i32 @srand(i32 %6)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %6)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.10, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.12, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %4)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.8, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%19 = load i8, i8* %3
%20 = icmp eq i8 %19, 121
%21 = zext i1 %20 to i32
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%23 = load i32, i32* %4
switch i32 %23, label %30 [
i32 0, label %24
i32 1, label %26
i32 2, label %28
]
24: ; preds = %2
%25 = call i32 @standard_test(i32 %21)
br label %32
26: ; preds = %2
%27 = call i32 @dobldobl_test(i32 %21)
br label %32
28: ; preds = %2
%29 = call i32 @quaddobl_test(i32 %21)
br label %32
30: ; preds = %2
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.13, i64 0, i64 0))
br label %32
32: ; preds = %26, %30, %28, %24
%33 = call i32 (...) @adafinal()
ret i32 0
}