#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*/ printf(char *, ...);
char *read_polynomials_from_file(int, char *, int *, int *, int *, int *);
int /*<<< orphan*/ scanf(char *, ...);
int solcon_dimension_of_multprec_solutions(int *);
int solcon_number_of_multprec_solutions(int *);
int solcon_read_multprec_solutions();
int solcon_write_multprec_solutions();
scalar_t__ strlen(char *);
int varbprec_Newton_Laurent_step(int, int, int, int, int, char *);
void test_varbprec_Newton_Laurent_step(void) {
  int fail, dim, lenpols, nf, nq, nv, ns, lensols;
  int wanted, maxitr, maxprc;
  char infile[80], c;
  char *system;
  printf("\nRunning variable precision Newton step ...\n");
  printf("\nGive name of the input file : ");
  scanf("%s", infile);
  nf = (int)strlen(infile);
  system = read_polynomials_from_file(nf, infile, &lenpols, &nq, &nv, &fail);
  printf("The system has %d characters :\n%s\n", lenpols, system);
  scanf("%c", &c);
  printf("\n");
  fail = solcon_read_multprec_solutions();
  fail = solcon_number_of_multprec_solutions(&lensols);
  printf("The solution container has size %d.\n", lensols);
  fail = solcon_dimension_of_multprec_solutions(&dim);
  printf("The solutions in the container have dimension %d.\n", dim);
  if (dim != nv)
    printf("Dimension of solutions does not match number of variables!\n");
  else {
    printf("Calling the variable precision Newton steps method ...\n");
    printf("-> give the wanted number of decimal places : ");
    scanf("%d", &wanted);
    printf("-> give the maximum number of Newton steps : ");
    scanf("%d", &maxitr);
    printf("-> give the maximum number of places in the precision : ");
    scanf("%d", &maxprc);
    fail = varbprec_Newton_Laurent_step(dim, wanted, maxitr, maxprc, lenpols,
                                        system);
    printf("The solutions after the variable precision Newton steps :\n");
    fail = solcon_write_multprec_solutions();
  }
}


x86 assembly (clang, -O0):
<test_varbprec_Newton_Laurent_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0x80(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x14(%rbp),%rcx
lea    -0x18(%rbp),%r8
lea    -0x4(%rbp),%r9
call   1080 <read_polynomials_from_file@plt>
mov    %rax,-0x90(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x90(%rbp),%rdx
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe5c(%rip),%rdi
lea    -0x81(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <solcon_read_multprec_solutions@plt>
mov    %eax,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   10b0 <solcon_number_of_multprec_solutions@plt>
mov    %eax,-0x4(%rbp)
mov    -0x20(%rbp),%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   10a0 <solcon_dimension_of_multprec_solutions@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     1296 <test_varbprec_Newton_Laurent_step+0x106>
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    133b <test_varbprec_Newton_Laurent_step+0x1ab>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb8(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe78(%rip),%rdi
lea    -0x2c(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0xc(%rbp),%r8d
mov    -0x90(%rbp),%r9
call   1050 <varbprec_Newton_Laurent_step@plt>
mov    %eax,-0x4(%rbp)
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <solcon_write_multprec_solutions@plt>
mov    %eax,-0x4(%rbp)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_varbprec_Newton_Laurent_step>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0xf79(%rip),%rdi
call   1040 <puts@plt>
lea    0xe33(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe45(%rip),%rdi
lea    0x30(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    0x14(%rsp),%rdx
lea    0x2c(%rsp),%rcx
lea    0x28(%rsp),%r8
lea    0x8(%rsp),%r9
mov    %eax,%edi
mov    %rbx,%rsi
call   10a0 <read_polynomials_from_file@plt>
mov    %rax,%r14
mov    0x14(%rsp),%esi
lea    0xe05(%rip),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe17(%rip),%rdi
lea    0x13(%rsp),%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1090 <solcon_read_multprec_solutions@plt>
mov    %eax,0x8(%rsp)
lea    0x24(%rsp),%rdi
call   10d0 <solcon_number_of_multprec_solutions@plt>
mov    %eax,0x8(%rsp)
mov    0x24(%rsp),%esi
lea    0xde0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xc(%rsp),%rdi
call   10c0 <solcon_dimension_of_multprec_solutions@plt>
mov    %eax,0x8(%rsp)
mov    0xc(%rsp),%esi
lea    0xde5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%eax
cmp    0x28(%rsp),%eax
jne    133e <test_varbprec_Newton_Laurent_step+0x18e>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf0(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe11(%rip),%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xdfe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xe0f(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x20(%rsp),%esi
mov    0x1c(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    %r14,%r9
call   1070 <varbprec_Newton_Laurent_step@plt>
mov    %eax,0x8(%rsp)
lea    0xe6d(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <solcon_write_multprec_solutions@plt>
jmp    134a <test_varbprec_Newton_Laurent_step+0x19a>
lea    0xe92(%rip),%rdi
call   1040 <puts@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [45 x i8] c"\0ARunning variable precision Newton step ...\0A\00"
@.str.1 = [32 x i8] c"\0AGive name of the input file : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [35 x i8] c"The system has %d characters :\0A%s\0A\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [37 x i8] c"The solution container has size %d.\0A\00"
@.str.7 = [51 x i8] c"The solutions in the container have dimension %d.\0A\00"
@.str.8 = [60 x i8] c"Dimension of solutions does not match number of variables!\0A\00"
@.str.9 = [56 x i8] c"Calling the variable precision Newton steps method ...\0A\00"
@.str.10 = [47 x i8] c"-> give the wanted number of decimal places : \00"
@.str.11 = [3 x i8] c"%d\00"
@.str.12 = [46 x i8] c"-> give the maximum number of Newton steps : \00"
@.str.13 = [57 x i8] c"-> give the maximum number of places in the precision : \00"
@.str.14 = [59 x i8] c"The solutions after the variable precision Newton steps :\0A\00"
define void @test_varbprec_Newton_Laurent_step() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [80 x i8]
%13 = alloca i8
%14 = alloca i8*
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%20 = call i64 @strlen(i8* %19)
%21 = trunc i64 %20 to i32
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%24 = call i8* @read_polynomials_from_file(i32 %22, i8* %23, i32* %3, i32* %5, i32* %6, i32* %1)
store i8* %24, i8** %14
%25 = load i32, i32* %3
%26 = load i8*, i8** %14
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %25, i8* %26)
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%30 = call i32 (...) @solcon_read_multprec_solutions()
store i32 %30, i32* %1
%31 = call i32 @solcon_number_of_multprec_solutions(i32* %8)
store i32 %31, i32* %1
%32 = load i32, i32* %8
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %32)
%34 = call i32 @solcon_dimension_of_multprec_solutions(i32* %2)
store i32 %34, i32* %1
%35 = load i32, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %2
%38 = load i32, i32* %6
%39 = icmp ne i32 %37, %38
br i1 %39, label %40, label %42
40: ; preds = %0
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.8, i64 0, i64 0))
br label %59
42: ; preds = %0
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.9, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %9)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %10)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %11)
%50 = load i32, i32* %2
%51 = load i32, i32* %9
%52 = load i32, i32* %10
%53 = load i32, i32* %11
%54 = load i32, i32* %3
%55 = load i8*, i8** %14
%56 = call i32 @varbprec_Newton_Laurent_step(i32 %50, i32 %51, i32 %52, i32 %53, i32 %54, i8* %55)
store i32 %56, i32* %1
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.14, i64 0, i64 0))
%58 = call i32 (...) @solcon_write_multprec_solutions()
store i32 %58, i32* %1
br label %59
59: ; preds = %42, %40
ret void
}

LLVM IR (-O2):
@.str.1 = [32 x i8] c"\0AGive name of the input file : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [35 x i8] c"The system has %d characters :\0A%s\0A\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.6 = [37 x i8] c"The solution container has size %d.\0A\00"
@.str.7 = [51 x i8] c"The solutions in the container have dimension %d.\0A\00"
@.str.10 = [47 x i8] c"-> give the wanted number of decimal places : \00"
@.str.11 = [3 x i8] c"%d\00"
@.str.12 = [46 x i8] c"-> give the maximum number of Newton steps : \00"
@.str.13 = [57 x i8] c"-> give the maximum number of places in the precision : \00"
@str = [44 x i8] c"\0ARunning variable precision Newton step ...\00"
@str.15 = [55 x i8] c"Calling the variable precision Newton steps method ...\00"
@str.16 = [58 x i8] c"The solutions after the variable precision Newton steps :\00"
@str.17 = [59 x i8] c"Dimension of solutions does not match number of variables!\00"
define void @test_varbprec_Newton_Laurent_step() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [80 x i8]
%11 = alloca i8
%12 = bitcast i32* %1 to i8*
%13 = bitcast i32* %2 to i8*
%14 = bitcast i32* %3 to i8*
%15 = bitcast i32* %4 to i8*
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
%18 = bitcast i32* %7 to i8*
%19 = bitcast i32* %8 to i8*
%20 = bitcast i32* %9 to i8*
%21 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %21)
%25 = call i64 @strlen(i8* %21)
%26 = trunc i64 %25 to i32
%27 = call i8* @read_polynomials_from_file(i32 %26, i8* %21, i32* %3, i32* %4, i32* %5, i32* %1)
%28 = load i32, i32* %3
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %28, i8* %27)
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %11)
%31 = call i32 @putchar(i32 10)
%32 = call i32 (...) @solcon_read_multprec_solutions()
store i32 %32, i32* %1
%33 = call i32 @solcon_number_of_multprec_solutions(i32* %6)
store i32 %33, i32* %1
%34 = load i32, i32* %6
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %34)
%36 = call i32 @solcon_dimension_of_multprec_solutions(i32* %2)
store i32 %36, i32* %1
%37 = load i32, i32* %2
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %2
%40 = load i32, i32* %5
%41 = icmp eq i32 %39, %40
br i1 %41, label %44, label %42
42: ; preds = %0
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.17, i64 0, i64 0))
br label %60
44: ; preds = %0
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.15, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.10, i64 0, i64 0))
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %7)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.12, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %8)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.13, i64 0, i64 0))
%51 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32* %9)
%52 = load i32, i32* %2
%53 = load i32, i32* %7
%54 = load i32, i32* %8
%55 = load i32, i32* %9
%56 = load i32, i32* %3
%57 = call i32 @varbprec_Newton_Laurent_step(i32 %52, i32 %53, i32 %54, i32 %55, i32 %56, i8* %27)
store i32 %57, i32* %1
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.16, i64 0, i64 0))
%59 = call i32 (...) @solcon_write_multprec_solutions()
br label %60
60: ; preds = %44, %42
ret void
}