#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_Laurent_membership_test();
int dobldobl_membership_test();
int /*<<< orphan*/ printf(char *);
int quaddobl_Laurent_membership_test();
int quaddobl_membership_test();
int /*<<< orphan*/ scanf(char *, ...);
int standard_Laurent_membership_test();
int standard_membership_test();
int main(int argc, char *argv[]) {
  char ans;
  int precision, fail;
  adainit();
  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("Laurent polynomial system ? (y/n) ");
  scanf("%c", &ans);
  if (ans == 'y') {
    scanf("%c", &ans);
    if (precision == 0)
      fail = standard_Laurent_membership_test();
    else if (precision == 1)
      fail = dobldobl_Laurent_membership_test();
    else if (precision == 2)
      fail = quaddobl_Laurent_membership_test();
    else
      printf("Selected precision level is not supported.\n");
  } else {
    scanf("%c", &ans);
    if (precision == 0)
      fail = standard_membership_test();
    else if (precision == 1)
      fail = dobldobl_membership_test();
    else if (precision == 2)
      fail = quaddobl_membership_test();
    else
      printf("Selected precision level is not supported.\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   10c0 <adainit@plt>
lea    0xe3c(%rip),%rdi
call   1060 <printf@plt>
lea    0xe53(%rip),%rdi
call   1060 <printf@plt>
lea    0xe68(%rip),%rdi
call   1060 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1060 <printf@plt>
lea    0xe8c(%rip),%rdi
call   1060 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   10b0 <scanf@plt>
lea    0xe95(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   10b0 <scanf@plt>
lea    0xe86(%rip),%rdi
call   1060 <printf@plt>
lea    0xe77(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   10b0 <scanf@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x79,%eax
jne    12c0 <main+0x120>
lea    0xe58(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   10b0 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    1273 <main+0xd3>
mov    $0x0,%al
call   1040 <standard_Laurent_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    12bb <main+0x11b>
cmpl   $0x1,-0x18(%rbp)
jne    128c <main+0xec>
mov    $0x0,%al
call   1070 <dobldobl_Laurent_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    12b6 <main+0x116>
cmpl   $0x2,-0x18(%rbp)
jne    12a5 <main+0x105>
mov    $0x0,%al
call   1090 <quaddobl_Laurent_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    12b1 <main+0x111>
lea    0xe21(%rip),%rdi
call   1060 <printf@plt>
jmp    12b6 <main+0x116>
jmp    12bb <main+0x11b>
jmp    1338 <main+0x198>
lea    0xde0(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   10b0 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
jne    12eb <main+0x14b>
mov    $0x0,%al
call   1030 <standard_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    1333 <main+0x193>
cmpl   $0x1,-0x18(%rbp)
jne    1304 <main+0x164>
mov    $0x0,%al
call   10a0 <dobldobl_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    132e <main+0x18e>
cmpl   $0x2,-0x18(%rbp)
jne    131d <main+0x17d>
mov    $0x0,%al
call   1050 <quaddobl_membership_test@plt>
mov    %eax,-0x1c(%rbp)
jmp    1329 <main+0x189>
lea    0xda9(%rip),%rdi
call   1060 <printf@plt>
jmp    132e <main+0x18e>
jmp    1333 <main+0x193>
jmp    1338 <main+0x198>
mov    $0x0,%al
call   1080 <adafinal@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   10d0 <adainit@plt>
lea    0xe86(%rip),%rdi
call   1060 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1060 <puts@plt>
lea    0xeb0(%rip),%rdi
call   1060 <puts@plt>
lea    0xec2(%rip),%rdi
call   1060 <puts@plt>
lea    0xe09(%rip),%rdi
call   1070 <printf@plt>
lea    0xe21(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   10c0 <scanf@plt>
lea    0xe11(%rip),%r15
lea    0xb(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10c0 <scanf@plt>
lea    0xdfb(%rip),%rdi
call   1070 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10c0 <scanf@plt>
mov    0xb(%rsp),%bl
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10c0 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x79,%bl
jne    1272 <main+0xc2>
cmp    $0x2,%eax
je     1297 <main+0xe7>
cmp    $0x1,%eax
je     12a0 <main+0xf0>
test   %eax,%eax
jne    1289 <main+0xd9>
xor    %eax,%eax
call   1040 <standard_Laurent_membership_test@plt>
jmp    12b9 <main+0x109>
cmp    $0x2,%eax
je     12a9 <main+0xf9>
cmp    $0x1,%eax
je     12b2 <main+0x102>
test   %eax,%eax
jne    1289 <main+0xd9>
xor    %eax,%eax
call   1030 <standard_membership_test@plt>
jmp    12b9 <main+0x109>
lea    0xe39(%rip),%rdi
call   1060 <puts@plt>
jmp    12b9 <main+0x109>
xor    %eax,%eax
call   10a0 <quaddobl_Laurent_membership_test@plt>
jmp    12b9 <main+0x109>
xor    %eax,%eax
call   1080 <dobldobl_Laurent_membership_test@plt>
jmp    12b9 <main+0x109>
xor    %eax,%eax
call   1050 <quaddobl_membership_test@plt>
jmp    12b9 <main+0x109>
xor    %eax,%eax
call   10b0 <dobldobl_membership_test@plt>
xor    %eax,%eax
call   1090 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0AMENU for the working precision :\0A\00"
@.str.1 = [33 x i8] c" 0. standard double precision;\0A\00"
@.str.2 = [31 x i8] c" 1. double double precision;\0A\00"
@.str.3 = [29 x i8] c" 2. quad double precision.\0A\00"
@.str.4 = [36 x i8] c"Type 0, 1, or 2 to make a choice : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [35 x i8] c"Laurent polynomial system ? (y/n) \00"
@.str.8 = [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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @adainit()
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %7)
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%17 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%19 = load i8, i8* %6
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 121
br i1 %21, label %22, label %43
22: ; preds = %2
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%24 = load i32, i32* %7
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (...) @standard_Laurent_membership_test()
store i32 %27, i32* %8
br label %42
28: ; preds = %22
%29 = load i32, i32* %7
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 (...) @dobldobl_Laurent_membership_test()
store i32 %32, i32* %8
br label %41
33: ; preds = %28
%34 = load i32, i32* %7
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = call i32 (...) @quaddobl_Laurent_membership_test()
store i32 %37, i32* %8
br label %40
38: ; preds = %33
%39 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %41
41: ; preds = %40, %31
br label %42
42: ; preds = %41, %26
br label %64
43: ; preds = %2
%44 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %6)
%45 = load i32, i32* %7
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %43
%48 = call i32 (...) @standard_membership_test()
store i32 %48, i32* %8
br label %63
49: ; preds = %43
%50 = load i32, i32* %7
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %54
52: ; preds = %49
%53 = call i32 (...) @dobldobl_membership_test()
store i32 %53, i32* %8
br label %62
54: ; preds = %49
%55 = load i32, i32* %7
%56 = icmp eq i32 %55, 2
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 (...) @quaddobl_membership_test()
store i32 %58, i32* %8
br label %61
59: ; preds = %54
%60 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.8, i64 0, i64 0))
br label %61
61: ; preds = %59, %57
br label %62
62: ; preds = %61, %52
br label %63
63: ; preds = %62, %47
br label %64
64: ; preds = %63, %42
%65 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [36 x i8] c"Type 0, 1, or 2 to make a choice : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [3 x i8] c"%c\00"
@.str.7 = [35 x i8] c"Laurent polynomial system ? (y/n) \00"
@str = [34 x i8] c"\0AMENU for the working precision :\00"
@str.9 = [32 x i8] c" 0. standard double precision;\00"
@str.10 = [30 x i8] c" 1. double double precision;\00"
@str.11 = [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 (...) @adainit()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.9, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.10, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%14 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%16 = load i8, i8* %3
%17 = icmp eq i8 %16, 121
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %3)
%19 = load i32, i32* %4
br i1 %17, label %20, label %29
20: ; preds = %2
switch i32 %19, label %27 [
i32 0, label %21
i32 1, label %23
i32 2, label %25
]
21: ; preds = %20
%22 = call i32 (...) @standard_Laurent_membership_test()
br label %38
23: ; preds = %20
%24 = call i32 (...) @dobldobl_Laurent_membership_test()
br label %38
25: ; preds = %20
%26 = call i32 (...) @quaddobl_Laurent_membership_test()
br label %38
27: ; preds = %20
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.13, i64 0, i64 0))
br label %38
29: ; preds = %2
switch i32 %19, label %36 [
i32 0, label %30
i32 1, label %32
i32 2, label %34
]
30: ; preds = %29
%31 = call i32 (...) @standard_membership_test()
br label %38
32: ; preds = %29
%33 = call i32 (...) @dobldobl_membership_test()
br label %38
34: ; preds = %29
%35 = call i32 (...) @quaddobl_membership_test()
br label %38
36: ; preds = %29
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.13, i64 0, i64 0))
br label %38
38: ; preds = %30, %34, %36, %32, %21, %25, %27, %23
%39 = call i32 (...) @adafinal()
ret i32 0
}