#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 copy_start_solutions_to_container();
int copy_start_system_to_container();
int /*<<< orphan*/ printf(char *, ...);
int read_standard_start_system();
int solcon_number_of_standard_solutions(int *);
int solcon_write_standard_solutions();
int standard_deflate(int const, int const, double const, double const,
                     double const);
int syscon_number_of_standard_polynomials(int *);
void test_deflate(void) {
  int fail, dim, len;
  const int maxitr = 3;
  const int maxdef = 3;
  const double tolerr = 1.0e-8;
  const double tolres = 1.0e-8;
  const double tolrnk = 1.0e-6;
  printf("\nRunning deflation ...\n");
  fail = read_standard_start_system();
  fail = copy_start_system_to_container();
  fail = copy_start_solutions_to_container();
  fail = syscon_number_of_standard_polynomials(&dim);
  printf("The system container has %d polynomials.\n", dim);
  fail = solcon_number_of_standard_solutions(&len);
  printf("The solution container has size %d.\n", len);
  fail = standard_deflate(maxitr, maxdef, tolerr, tolres, tolrnk);
  printf("The solutions after deflation :\n");
  fail = solcon_write_standard_solutions();
}


x86 assembly (clang, -O0):
<test_deflate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x3,-0x10(%rbp)
movl   $0x3,-0x14(%rbp)
movsd  0xe62(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe55(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe50(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1070 <read_standard_start_system@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1080 <copy_start_system_to_container@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1060 <copy_start_solutions_to_container@plt>
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1090 <syscon_number_of_standard_polynomials@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
call   1040 <solcon_number_of_standard_solutions@plt>
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%esi
movsd  0xdd0(%rip),%xmm1
movsd  0xdd0(%rip),%xmm2
mov    %esi,%edi
movaps %xmm1,%xmm0
call   10a0 <standard_deflate@plt>
mov    %eax,-0x4(%rbp)
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <solcon_write_standard_solutions@plt>
mov    %eax,-0x4(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_deflate>:
push   %rax
lea    0xec7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1080 <read_standard_start_system@plt>
xor    %eax,%eax
call   1090 <copy_start_system_to_container@plt>
xor    %eax,%eax
call   1070 <copy_start_solutions_to_container@plt>
lea    0x4(%rsp),%rdi
call   10a0 <syscon_number_of_standard_polynomials@plt>
mov    0x4(%rsp),%esi
lea    0xe49(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1050 <solcon_number_of_standard_solutions@plt>
mov    (%rsp),%esi
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsd  0xe11(%rip),%xmm0
movsd  0xe11(%rip),%xmm2
mov    $0x3,%edi
mov    $0x3,%esi
movaps %xmm0,%xmm1
call   10b0 <standard_deflate@plt>
lea    0xe66(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <solcon_write_standard_solutions@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\0ARunning deflation ...\0A\00"
@.str.1 = [42 x i8] c"The system container has %d polynomials.\0A\00"
@.str.2 = [37 x i8] c"The solution container has size %d.\0A\00"
@.str.3 = [33 x i8] c"The solutions after deflation :\0A\00"
define void @test_deflate() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 3, i32* %4
store i32 3, i32* %5
store double 1.000000e-08, double* %6
store double 1.000000e-08, double* %7
store double 0x3EB0C6F7A0B5ED8D, double* %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @read_standard_start_system()
store i32 %10, i32* %1
%11 = call i32 (...) @copy_start_system_to_container()
store i32 %11, i32* %1
%12 = call i32 (...) @copy_start_solutions_to_container()
store i32 %12, i32* %1
%13 = call i32 @syscon_number_of_standard_polynomials(i32* %2)
store i32 %13, i32* %1
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 @solcon_number_of_standard_solutions(i32* %3)
store i32 %16, i32* %1
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = call i32 @standard_deflate(i32 3, i32 3, double 1.000000e-08, double 1.000000e-08, double 0x3EB0C6F7A0B5ED8D)
store i32 %19, i32* %1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 (...) @solcon_write_standard_solutions()
store i32 %21, i32* %1
ret void
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"The system container has %d polynomials.\0A\00"
@.str.2 = [37 x i8] c"The solution container has size %d.\0A\00"
@str = [23 x i8] c"\0ARunning deflation ...\00"
@str.4 = [32 x i8] c"The solutions after deflation :\00"
define void @test_deflate() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (...) @read_standard_start_system()
%7 = tail call i32 (...) @copy_start_system_to_container()
%8 = tail call i32 (...) @copy_start_solutions_to_container()
%9 = call i32 @syscon_number_of_standard_polynomials(i32* %1)
%10 = load i32, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 @solcon_number_of_standard_solutions(i32* %2)
%13 = load i32, i32* %2
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = call i32 @standard_deflate(i32 3, i32 3, double 1.000000e-08, double 1.000000e-08, double 0x3EB0C6F7A0B5ED8D)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.4, i64 0, i64 0))
%17 = call i32 (...) @solcon_write_standard_solutions()
ret void
}