#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 *, ...);
int solcon_extrinsic_product(int, int, int, int, double *, double *, int,
                             double *);
int solcon_read_next_witness_point(int, int, int *, double *);
int solcon_reset_input_file(int, int *, int *);
void check_on_two_witness_sets(int n1, int n2, int dim1, int dim2, int deg1,
                               int deg2, int cd) {
  double sol1[2 * n1 + 5];
  double sol2[2 * n2 + 5];
  double ps[2 * cd + 5];
  int fail, m, deg, dim, i, j;
  printf("\nDoing a sanity check on the solutions on file...\n");
  fail = solcon_read_next_witness_point(1, n1, &m, sol1);
  fail = solcon_read_next_witness_point(2, n2, &m, sol2);
  fail = solcon_extrinsic_product(dim1, dim2, n1, n2, sol1, sol2, cd, ps);
  printf("\nThe product of the first two solutions :");
  for (i = 0; i < 2 * cd + 2; i++) {
    if (i % 2 == 0)
      printf("\n");
    printf("  %.14lf", ps[i]);
  }
  printf("\n");
  fail = solcon_reset_input_file(1, &deg, &dim);
  printf("after resetting 1 : n = %d  degree = %d\n", dim, deg);
  fail = solcon_reset_input_file(2, &deg, &dim);
  printf("after resetting 2 : n = %d  degree = %d\n", dim, deg);
  for (i = 0; i < deg1; i++) {
    fail = solcon_read_next_witness_point(1, n1, &m, sol1);
    for (j = 0; j < deg2; j++) {
      fail = solcon_read_next_witness_point(2, n2, &m, sol2);
      printf("%d x %d starts with (%.3lf , %.3lf) \n", i, j, sol1[2], sol2[2]);
    }
    if (i < deg1 - 1) {
      fail = solcon_reset_input_file(2, &deg, &dim);
      printf("after resetting 2 : n = %d  degree = %d\n", dim, deg);
    }
  }
  printf("\n");
  fail = solcon_reset_input_file(1, &deg, &dim);
  printf("after resetting 1 : n = %d  degree = %d\n", dim, deg);
  fail = solcon_reset_input_file(2, &deg, &dim);
  printf("after resetting 2 : n = %d  degree = %d\n", dim, deg);
}


x86 assembly (clang, -O0):
<check_on_two_witness_sets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    %ecx,%eax
lea    0x5(%rax,%rax,1),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x68(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%eax
lea    0x5(%rax,%rax,1),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
mov    0x10(%rbp),%ecx
mov    %ecx,%eax
lea    0x5(%rax,%rax,1),%eax
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%rcx
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
lea    -0x40(%rbp),%rdx
call   1060 <solcon_read_next_witness_point@plt>
mov    -0x60(%rbp),%rcx
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
lea    -0x40(%rbp),%rdx
call   1060 <solcon_read_next_witness_point@plt>
mov    -0x68(%rbp),%r8
mov    -0x60(%rbp),%r9
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
mov    %ecx,-0x3c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    0x10(%rbp),%r10d
sub    $0x10,%rsp
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <solcon_extrinsic_product@plt>
add    $0x10,%rsp
mov    %eax,-0x3c(%rbp)
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    0x10(%rbp),%ecx
shl    $0x1,%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    12c1 <check_on_two_witness_sets+0x181>
mov    -0x4c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1298 <check_on_two_witness_sets+0x158>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x58(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xdb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1262 <check_on_two_witness_sets+0x122>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1050 <solcon_reset_input_file@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%esi
mov    -0x44(%rbp),%edx
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1050 <solcon_reset_input_file@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%esi
mov    -0x44(%rbp),%edx
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13fa <check_on_two_witness_sets+0x2ba>
mov    -0x68(%rbp),%rcx
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
lea    -0x40(%rbp),%rdx
call   1060 <solcon_read_next_witness_point@plt>
mov    %eax,-0x3c(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13ad <check_on_two_witness_sets+0x26d>
mov    -0x60(%rbp),%rcx
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
lea    -0x40(%rbp),%rdx
call   1060 <solcon_read_next_witness_point@plt>
mov    -0x68(%rbp),%rcx
mov    %eax,%edx
mov    -0x60(%rbp),%rax
mov    %edx,-0x3c(%rbp)
mov    -0x4c(%rbp),%esi
mov    -0x50(%rbp),%edx
movsd  0x10(%rcx),%xmm0
movsd  0x10(%rax),%xmm1
lea    0xd20(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1353 <check_on_two_witness_sets+0x213>
mov    -0x4c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13e7 <check_on_two_witness_sets+0x2a7>
mov    $0x2,%edi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1050 <solcon_reset_input_file@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%esi
mov    -0x44(%rbp),%edx
lea    0xcaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13ec <check_on_two_witness_sets+0x2ac>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1328 <check_on_two_witness_sets+0x1e8>
lea    0xcdb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1050 <solcon_reset_input_file@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%esi
mov    -0x44(%rbp),%edx
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
lea    -0x44(%rbp),%rsi
lea    -0x48(%rbp),%rdx
call   1050 <solcon_reset_input_file@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%esi
mov    -0x44(%rbp),%edx
lea    0xc3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_on_two_witness_sets>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r9d,-0x38(%rbp)
mov    %r8,-0x50(%rbp)
mov    %ecx,-0x34(%rbp)
mov    %edx,-0x48(%rbp)
mov    %rsi,-0x70(%rbp)
mov    %edi,%ebx
mov    0x10(%rbp),%r13d
lea    (%rbx,%rbx,1),%eax
add    $0x5,%eax
mov    %rbx,-0x68(%rbp)
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r15
sub    %rax,%r15
mov    %r15,%rsp
lea    (%rsi,%rsi,1),%eax
add    $0x5,%eax
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r14
sub    %rax,%r14
mov    %r14,%rsp
lea    0x5(%r13,%r13,1),%eax
lea    0xf(,%rax,8),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
lea    -0x3c(%rbp),%rdx
mov    $0x1,%edi
mov    %ebx,%esi
mov    %r15,%rcx
call   1080 <solcon_read_next_witness_point@plt>
mov    $0x2,%edi
mov    -0x70(%rbp),%rbx
mov    %ebx,%esi
lea    -0x3c(%rbp),%rdx
mov    %r14,%rcx
call   1080 <solcon_read_next_witness_point@plt>
mov    -0x48(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x68(%rbp),%rdx
mov    %ebx,%ecx
mov    %r15,-0x58(%rbp)
mov    %r15,%r8
mov    %r14,%r9
push   %r12
push   %r13
call   1060 <solcon_extrinsic_product@plt>
add    $0x10,%rsp
lea    0xdc3(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
test   %r13d,%r13d
js     129a <check_on_two_witness_sets+0x13a>
add    %r13d,%r13d
or     $0x1,%r13d
cmovle %ebx,%r13d
add    $0x1,%r13d
lea    0xdc9(%rip),%r15
jmp    1289 <check_on_two_witness_sets+0x129>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%r12,%rbx,8),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
je     129a <check_on_two_witness_sets+0x13a>
test   $0x1,%bl
jne    1270 <check_on_two_witness_sets+0x110>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1270 <check_on_two_witness_sets+0x110>
mov    %r14,-0x48(%rbp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x30(%rbp),%rbx
lea    -0x2c(%rbp),%r15
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1070 <solcon_reset_input_file@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xd66(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1070 <solcon_reset_input_file@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xd6b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,-0x50(%rbp)
mov    -0x38(%rbp),%r15d
mov    -0x58(%rbp),%rcx
jle    13ef <check_on_two_witness_sets+0x28f>
mov    -0x50(%rbp),%rax
add    $0xffffffff,%eax
mov    %eax,-0x5c(%rbp)
lea    -0x3c(%rbp),%r12
xor    %ebx,%ebx
mov    -0x70(%rbp),%r14
mov    -0x48(%rbp),%r13
jmp    1344 <check_on_two_witness_sets+0x1e4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
cmp    -0x50(%rbp),%ebx
mov    -0x38(%rbp),%r15d
mov    -0x58(%rbp),%rcx
je     13ef <check_on_two_witness_sets+0x28f>
mov    %ebx,-0x34(%rbp)
mov    $0x1,%edi
mov    -0x68(%rbp),%rsi
mov    %r12,%rdx
call   1080 <solcon_read_next_witness_point@plt>
test   %r15d,%r15d
mov    %r15d,%ecx
mov    %r12,%r15
jle    13b3 <check_on_two_witness_sets+0x253>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2,%edi
mov    %r14d,%esi
mov    %r15,%rdx
mov    %ecx,%r12d
mov    %r13,%rcx
call   1080 <solcon_read_next_witness_point@plt>
mov    -0x58(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  0x10(%r13),%xmm1
lea    0xce9(%rip),%rdi
mov    -0x34(%rbp),%esi
mov    %ebx,%edx
mov    $0x2,%al
call   1050 <printf@plt>
mov    %r12d,%ecx
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    1370 <check_on_two_witness_sets+0x210>
mov    %r15,%r12
mov    -0x34(%rbp),%eax
cmp    -0x5c(%rbp),%eax
mov    %eax,%ebx
jge    1330 <check_on_two_witness_sets+0x1d0>
mov    $0x2,%edi
lea    -0x30(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1070 <solcon_reset_input_file@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xc79(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1330 <check_on_two_witness_sets+0x1d0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x30(%rbp),%rbx
lea    -0x2c(%rbp),%r14
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1070 <solcon_reset_input_file@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xc15(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1070 <solcon_reset_input_file@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xc1a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [51 x i8] c"\0ADoing a sanity check on the solutions on file...\0A\00"
@.str.1 = [42 x i8] c"\0AThe product of the first two solutions :\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [9 x i8] c" %.14lf\00"
@.str.4 = [41 x i8] c"after resetting 1 : n = %d degree = %d\0A\00"
@.str.5 = [41 x i8] c"after resetting 2 : n = %d degree = %d\0A\00"
@.str.6 = [38 x i8] c"%d x %d starts with (%.3lf , %.3lf) \0A\00"
define void @check_on_two_witness_sets(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%25 = load i32, i32* %8
%26 = mul nsw i32 2, %25
%27 = add nsw i32 %26, 5
%28 = zext i32 %27 to i64
%29 = call i8* @llvm.stacksave()
store i8* %29, i8** %15
%30 = alloca double, i64 %28
store i64 %28, i64* %16
%31 = load i32, i32* %9
%32 = mul nsw i32 2, %31
%33 = add nsw i32 %32, 5
%34 = zext i32 %33 to i64
%35 = alloca double, i64 %34
store i64 %34, i64* %17
%36 = load i32, i32* %14
%37 = mul nsw i32 2, %36
%38 = add nsw i32 %37, 5
%39 = zext i32 %38 to i64
%40 = alloca double, i64 %39
store i64 %39, i64* %18
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%42 = load i32, i32* %8
%43 = call i32 @solcon_read_next_witness_point(i32 1, i32 %42, i32* %20, double* %30)
store i32 %43, i32* %19
%44 = load i32, i32* %9
%45 = call i32 @solcon_read_next_witness_point(i32 2, i32 %44, i32* %20, double* %35)
store i32 %45, i32* %19
%46 = load i32, i32* %10
%47 = load i32, i32* %11
%48 = load i32, i32* %8
%49 = load i32, i32* %9
%50 = load i32, i32* %14
%51 = call i32 @solcon_extrinsic_product(i32 %46, i32 %47, i32 %48, i32 %49, double* %30, double* %35, i32 %50, double* %40)
store i32 %51, i32* %19
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %23
br label %53
53: ; preds = %71, %7
%54 = load i32, i32* %23
%55 = load i32, i32* %14
%56 = mul nsw i32 2, %55
%57 = add nsw i32 %56, 2
%58 = icmp slt i32 %54, %57
br i1 %58, label %59, label %74
59: ; preds = %53
%60 = load i32, i32* %23
%61 = srem i32 %60, 2
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %65
65: ; preds = %63, %59
%66 = load i32, i32* %23
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds double, double* %40, i64 %67
%69 = load double, double* %68
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %69)
br label %71
71: ; preds = %65
%72 = load i32, i32* %23
%73 = add nsw i32 %72, 1
store i32 %73, i32* %23
br label %53
74: ; preds = %53
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%76 = call i32 @solcon_reset_input_file(i32 1, i32* %21, i32* %22)
store i32 %76, i32* %19
%77 = load i32, i32* %22
%78 = load i32, i32* %21
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %77, i32 %78)
%80 = call i32 @solcon_reset_input_file(i32 2, i32* %21, i32* %22)
store i32 %80, i32* %19
%81 = load i32, i32* %22
%82 = load i32, i32* %21
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %81, i32 %82)
store i32 0, i32* %23
br label %84
84: ; preds = %119, %74
%85 = load i32, i32* %23
%86 = load i32, i32* %12
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %122
88: ; preds = %84
%89 = load i32, i32* %8
%90 = call i32 @solcon_read_next_witness_point(i32 1, i32 %89, i32* %20, double* %30)
store i32 %90, i32* %19
store i32 0, i32* %24
br label %91
91: ; preds = %105, %88
%92 = load i32, i32* %24
%93 = load i32, i32* %13
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %108
95: ; preds = %91
%96 = load i32, i32* %9
%97 = call i32 @solcon_read_next_witness_point(i32 2, i32 %96, i32* %20, double* %35)
store i32 %97, i32* %19
%98 = load i32, i32* %23
%99 = load i32, i32* %24
%100 = getelementptr inbounds double, double* %30, i64 2
%101 = load double, double* %100
%102 = getelementptr inbounds double, double* %35, i64 2
%103 = load double, double* %102
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i32 %98, i32 %99, double %101, double %103)
br label %105
105: ; preds = %95
%106 = load i32, i32* %24
%107 = add nsw i32 %106, 1
store i32 %107, i32* %24
br label %91
108: ; preds = %91
%109 = load i32, i32* %23
%110 = load i32, i32* %12
%111 = sub nsw i32 %110, 1
%112 = icmp slt i32 %109, %111
br i1 %112, label %113, label %118
113: ; preds = %108
%114 = call i32 @solcon_reset_input_file(i32 2, i32* %21, i32* %22)
store i32 %114, i32* %19
%115 = load i32, i32* %22
%116 = load i32, i32* %21
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %115, i32 %116)
br label %118
118: ; preds = %113, %108
br label %119
119: ; preds = %118
%120 = load i32, i32* %23
%121 = add nsw i32 %120, 1
store i32 %121, i32* %23
br label %84
122: ; preds = %84
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%124 = call i32 @solcon_reset_input_file(i32 1, i32* %21, i32* %22)
store i32 %124, i32* %19
%125 = load i32, i32* %22
%126 = load i32, i32* %21
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %125, i32 %126)
%128 = call i32 @solcon_reset_input_file(i32 2, i32* %21, i32* %22)
store i32 %128, i32* %19
%129 = load i32, i32* %22
%130 = load i32, i32* %21
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %129, i32 %130)
%132 = load i8*, i8** %15
ret void
}

LLVM IR (-O2):
@.str.1 = [42 x i8] c"\0AThe product of the first two solutions :\00"
@.str.3 = [9 x i8] c" %.14lf\00"
@.str.4 = [41 x i8] c"after resetting 1 : n = %d degree = %d\0A\00"
@.str.5 = [41 x i8] c"after resetting 2 : n = %d degree = %d\0A\00"
@.str.6 = [38 x i8] c"%d x %d starts with (%.3lf , %.3lf) \0A\00"
@str = [50 x i8] c"\0ADoing a sanity check on the solutions on file...\00"
define void @check_on_two_witness_sets(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = shl nsw i32 %0, 1
%12 = add nsw i32 %11, 5
%13 = zext i32 %12 to i64
%14 = alloca double, i64 %13
%15 = shl nsw i32 %1, 1
%16 = add nsw i32 %15, 5
%17 = zext i32 %16 to i64
%18 = alloca double, i64 %17
%19 = shl i32 %6, 1
%20 = add nsw i32 %19, 5
%21 = zext i32 %20 to i64
%22 = alloca double, i64 %21
%23 = bitcast i32* %8 to i8*
%24 = bitcast i32* %9 to i8*
%25 = bitcast i32* %10 to i8*
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%27 = call i32 @solcon_read_next_witness_point(i32 1, i32 %0, i32* %8, double* %14)
%28 = call i32 @solcon_read_next_witness_point(i32 2, i32 %1, i32* %8, double* %18)
%29 = call i32 @solcon_extrinsic_product(i32 %2, i32 %3, i32 %0, i32 %1, double* %14, double* %18, i32 %6, double* %22)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp sgt i32 %6, -1
br i1 %31, label %32, label %49
32: ; preds = %7
%33 = or i32 %19, 1
%34 = call i32 @llvm.smax.i32(i32 %33, i32 0)
%35 = add nuw i32 %34, 1
%36 = zext i32 %35 to i64
br label %37
37: ; preds = %32, %43
%38 = phi i64 [ 0, %32 ], [ %47, %43 ]
%39 = and i64 %38, 1
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = call i32 @putchar(i32 10)
br label %43
43: ; preds = %41, %37
%44 = getelementptr inbounds double, double* %22, i64 %38
%45 = load double, double* %44
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), double %45)
%47 = add nuw nsw i64 %38, 1
%48 = icmp eq i64 %47, %36
br i1 %48, label %49, label %37
49: ; preds = %43, %7
%50 = call i32 @putchar(i32 10)
%51 = call i32 @solcon_reset_input_file(i32 1, i32* %9, i32* %10)
%52 = load i32, i32* %10
%53 = load i32, i32* %9
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %52, i32 %53)
%55 = call i32 @solcon_reset_input_file(i32 2, i32* %9, i32* %10)
%56 = load i32, i32* %10
%57 = load i32, i32* %9
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %56, i32 %57)
%59 = icmp sgt i32 %4, 0
br i1 %59, label %60, label %86
60: ; preds = %49
%61 = icmp sgt i32 %5, 0
%62 = getelementptr inbounds double, double* %14, i64 2
%63 = getelementptr inbounds double, double* %18, i64 2
%64 = add nsw i32 %4, -1
br label %65
65: ; preds = %60, %83
%66 = phi i32 [ 0, %60 ], [ %84, %83 ]
%67 = call i32 @solcon_read_next_witness_point(i32 1, i32 %0, i32* %8, double* %14)
br i1 %61, label %68, label %76
68: ; preds = %65, %68
%69 = phi i32 [ %74, %68 ], [ 0, %65 ]
%70 = call i32 @solcon_read_next_witness_point(i32 2, i32 %1, i32* %8, double* %18)
%71 = load double, double* %62
%72 = load double, double* %63
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0), i32 %66, i32 %69, double %71, double %72)
%74 = add nuw nsw i32 %69, 1
%75 = icmp eq i32 %74, %5
br i1 %75, label %76, label %68
76: ; preds = %68, %65
%77 = icmp slt i32 %66, %64
br i1 %77, label %78, label %83
78: ; preds = %76
%79 = call i32 @solcon_reset_input_file(i32 2, i32* %9, i32* %10)
%80 = load i32, i32* %10
%81 = load i32, i32* %9
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %80, i32 %81)
br label %83
83: ; preds = %76, %78
%84 = add nuw nsw i32 %66, 1
%85 = icmp eq i32 %84, %4
br i1 %85, label %86, label %65
86: ; preds = %83, %49
%87 = call i32 @putchar(i32 10)
%88 = call i32 @solcon_reset_input_file(i32 1, i32* %9, i32* %10)
%89 = load i32, i32* %10
%90 = load i32, i32* %9
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0), i32 %89, i32 %90)
%92 = call i32 @solcon_reset_input_file(i32 2, i32* %9, i32* %10)
%93 = load i32, i32* %10
%94 = load i32, i32* %9
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %93, i32 %94)
ret void
}