#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 dobldobl_polysys_solve(int, int, int, int, int);
int dobldobl_polysys_write(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_solver_options(int *, int *, int *, int *, int *);
int syscon_number_of_dobldobl_polynomials(int *);
int syscon_read_dobldobl_system();
int dobldobl_polysys_solver(void) {
  int fail, nbq, nbtasks, topdim, filter, factor, verbose;
  fail = syscon_read_dobldobl_system();
  fail = syscon_number_of_dobldobl_polynomials(&nbq);
  printf("-> read %d polynomials\n", nbq);
  printf("\n");
  read_solver_options(&nbtasks, &topdim, &filter, &factor, &verbose);
  printf("\nCalling the solver ...\n\n");
  fail = dobldobl_polysys_solve(nbtasks, topdim, filter, factor, verbose);
  fail = dobldobl_polysys_write(topdim);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_polysys_solver>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1080 <syscon_read_dobldobl_system@plt>
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <syscon_number_of_dobldobl_polynomials@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1040 <read_solver_options@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1070 <dobldobl_polysys_solve@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%edi
call   1060 <dobldobl_polysys_write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_polysys_solver>:
sub    $0x18,%rsp
xor    %eax,%eax
call   10a0 <syscon_read_dobldobl_system@plt>
lea    0x14(%rsp),%rdi
call   1050 <syscon_number_of_dobldobl_polynomials@plt>
mov    0x14(%rsp),%esi
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
call   1060 <read_solver_options@plt>
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%edi
mov    (%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x4(%rsp),%r8d
call   1090 <dobldobl_polysys_solve@plt>
mov    (%rsp),%edi
call   1080 <dobldobl_polysys_write@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"-> read %d polynomials\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [26 x i8] c"\0ACalling the solver ...\0A\0A\00"
define i32 @dobldobl_polysys_solver() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = call i32 (...) @syscon_read_dobldobl_system()
store i32 %8, i32* %1
%9 = call i32 @syscon_number_of_dobldobl_polynomials(i32* %2)
store i32 %9, i32* %1
%10 = load i32, i32* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @read_solver_options(i32* %3, i32* %4, i32* %5, i32* %6, i32* %7)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call i32 @dobldobl_polysys_solve(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
store i32 %20, i32* %1
%21 = load i32, i32* %4
%22 = call i32 @dobldobl_polysys_write(i32 %21)
store i32 %22, i32* %1
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [24 x i8] c"-> read %d polynomials\0A\00"
@str = [25 x i8] c"\0ACalling the solver ...\0A\00"
define i32 @dobldobl_polysys_solver() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = tail call i32 (...) @syscon_read_dobldobl_system()
%14 = call i32 @syscon_number_of_dobldobl_polynomials(i32* %1)
%15 = load i32, i32* %1
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @putchar(i32 10)
%18 = call i32 @read_solver_options(i32* %2, i32* %3, i32* %4, i32* %5, i32* %6)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%20 = load i32, i32* %2
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = call i32 @dobldobl_polysys_solve(i32 %20, i32 %21, i32 %22, i32 %23, i32 %24)
%26 = load i32, i32* %3
%27 = call i32 @dobldobl_polysys_write(i32 %26)
ret i32 %27
}