#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 Laurent_input_output_on_files(int);
int /*<<< orphan*/ adafinal();
int /*<<< orphan*/ adainit();
int /*<<< orphan*/ greetings();
int input_output_on_files(int);
int interactive_Laurent_input_output(int);
int interactive_input_output(int);
int /*<<< orphan*/ printf(char *);
int prompt_for_precision();
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int choice, fail, prec;
  adainit();
  greetings();
  prec = prompt_for_precision();
  printf("\nWelcome to the blackbox solver in PHCpack :\n");
  printf("  1. the input polynomial system will be typed in; or\n");
  printf("  2. the system typed in is a Laurent polynomial system; or\n");
  printf("  3. an input file contains the input polynomial system; or\n");
  printf("  4. the input Laurent system is on an input file.\n");
  printf("Type 1, 2, 3, or 4 to make your choice : ");
  scanf("%d", &choice);
  if (choice == 1)
    fail = interactive_input_output(prec);
  else if (choice == 2)
    fail = interactive_Laurent_input_output(prec);
  else if (choice == 3)
    fail = input_output_on_files(prec);
  else
    fail = Laurent_input_output_on_files(prec);
  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   10b0 <adainit@plt>
mov    $0x0,%al
call   10c0 <greetings@plt>
mov    $0x0,%al
call   1060 <prompt_for_precision@plt>
mov    %eax,-0x1c(%rbp)
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1090 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1240 <main+0xa0>
mov    -0x1c(%rbp),%edi
call   1050 <interactive_input_output@plt>
mov    %eax,-0x18(%rbp)
jmp    1289 <main+0xe9>
cmpl   $0x2,-0x14(%rbp)
jne    125a <main+0xba>
mov    -0x1c(%rbp),%edi
call   1040 <interactive_Laurent_input_output@plt>
mov    %eax,-0x18(%rbp)
jmp    1284 <main+0xe4>
cmpl   $0x3,-0x14(%rbp)
jne    1274 <main+0xd4>
mov    -0x1c(%rbp),%edi
call   1080 <input_output_on_files@plt>
mov    %eax,-0x18(%rbp)
jmp    127f <main+0xdf>
mov    -0x1c(%rbp),%edi
call   10a0 <Laurent_input_output_on_files@plt>
mov    %eax,-0x18(%rbp)
jmp    1284 <main+0xe4>
jmp    1289 <main+0xe9>
mov    $0x0,%al
call   1070 <adafinal@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   10c0 <adainit@plt>
xor    %eax,%eax
call   10d0 <greetings@plt>
xor    %eax,%eax
call   1070 <prompt_for_precision@plt>
mov    %eax,%ebx
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xdf1(%rip),%rdi
call   1040 <printf@plt>
lea    0xe0f(%rip),%rdi
lea    0xc(%rsp),%rsi
call   10a0 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %ebx,%edi
cmp    $0x3,%eax
je     1241 <main+0x91>
cmp    $0x2,%eax
je     1248 <main+0x98>
cmp    $0x1,%eax
jne    124f <main+0x9f>
call   1060 <interactive_input_output@plt>
jmp    1254 <main+0xa4>
call   1090 <input_output_on_files@plt>
jmp    1254 <main+0xa4>
call   1050 <interactive_Laurent_input_output@plt>
jmp    1254 <main+0xa4>
call   10b0 <Laurent_input_output_on_files@plt>
xor    %eax,%eax
call   1080 <adafinal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"\0AWelcome to the blackbox solver in PHCpack :\0A\00"
@.str.1 = [55 x i8] c" 1. the input polynomial system will be typed in; or\0A\00"
@.str.2 = [61 x i8] c" 2. the system typed in is a Laurent polynomial system; or\0A\00"
@.str.3 = [61 x i8] c" 3. an input file contains the input polynomial system; or\0A\00"
@.str.4 = [52 x i8] c" 4. the input Laurent system is on an input file.\0A\00"
@.str.5 = [42 x i8] c"Type 1, 2, 3, or 4 to make your choice : \00"
@.str.6 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%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 (...) @greetings()
%11 = call i32 (...) @prompt_for_precision()
store i32 %11, i32* %8
%12 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %6)
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %24
21: ; preds = %2
%22 = load i32, i32* %8
%23 = call i32 @interactive_input_output(i32 %22)
store i32 %23, i32* %7
br label %41
24: ; preds = %2
%25 = load i32, i32* %6
%26 = icmp eq i32 %25, 2
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %8
%29 = call i32 @interactive_Laurent_input_output(i32 %28)
store i32 %29, i32* %7
br label %40
30: ; preds = %24
%31 = load i32, i32* %6
%32 = icmp eq i32 %31, 3
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i32, i32* %8
%35 = call i32 @input_output_on_files(i32 %34)
store i32 %35, i32* %7
br label %39
36: ; preds = %30
%37 = load i32, i32* %8
%38 = call i32 @Laurent_input_output_on_files(i32 %37)
store i32 %38, i32* %7
br label %39
39: ; preds = %36, %33
br label %40
40: ; preds = %39, %27
br label %41
41: ; preds = %40, %21
%42 = call i32 (...) @adafinal()
ret i32 0
}

LLVM IR (-O2):
@.str.5 = [42 x i8] c"Type 1, 2, 3, or 4 to make your choice : \00"
@.str.6 = [3 x i8] c"%d\00"
@str = [45 x i8] c"\0AWelcome to the blackbox solver in PHCpack :\00"
@str.7 = [54 x i8] c" 1. the input polynomial system will be typed in; or\00"
@str.8 = [60 x i8] c" 2. the system typed in is a Laurent polynomial system; or\00"
@str.9 = [60 x i8] c" 3. an input file contains the input polynomial system; or\00"
@str.10 = [51 x i8] c" 4. the input Laurent system is on an input file.\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 (...) @greetings()
%7 = tail call i32 (...) @prompt_for_precision()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.7, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.8, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.9, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.10, i64 0, i64 0))
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
switch i32 %15, label %22 [
i32 1, label %16
i32 2, label %18
i32 3, label %20
]
16: ; preds = %2
%17 = call i32 @interactive_input_output(i32 %7)
br label %24
18: ; preds = %2
%19 = call i32 @interactive_Laurent_input_output(i32 %7)
br label %24
20: ; preds = %2
%21 = call i32 @input_output_on_files(i32 %7)
br label %24
22: ; preds = %2
%23 = call i32 @Laurent_input_output_on_files(i32 %7)
br label %24
24: ; preds = %18, %22, %20, %16
%25 = call i32 (...) @adafinal()
ret i32 0
}