#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 _ada_pieri_solver(int, int, int, int, int, double *, double *, char *);
int /*<<< orphan*/ adafinal();
int /*<<< orphan*/ adainit();
scalar_t__ calloc(int, int);
double cos(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rand();
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int m, p, q, nb, level, n, dimpts, dimpla, i, nbsols;
  double *points, *planes;
  char filename[80];
  printf("\nTesting the call to Pieri homotopies...\n\n");
  printf("Give the name of the output file : ");
  scanf("%s", filename);
  printf("The output file name is %s.\n", filename);
  printf("Give the dimension of the input planes : ");
  scanf("%d", &m);
  printf("Give the dimension of the output planes : ");
  scanf("%d", &p);
  printf("Give the degree of the maps : ");
  scanf("%d", &q);
  printf("Give the number of maps wanted (<0 for all) : ");
  scanf("%d", &nb);
  printf("Give the amount of intermediate output : \n");
  printf("  0. no intermediate output;\n");
  printf("  1. only final determinant validation;\n");
  printf("  2. + validation of all intermediate determinants;\n");
  printf("  3. + intermediate output of all path trackers.\n");
  printf("Type 0, 1, 2, or 3 to select output level : ");
  scanf("%d", &level);
  n = m * p + q * (m + p);
  dimpts = 2 * n;
  points = (double *)calloc(dimpts, sizeof(double));
  for (i = 0; i < dimpts; i++)
    points[i] = cos(rand());
  dimpla = 2 * n * m * p;
  planes = (double *)calloc(dimpla, sizeof(double));
  for (i = 0; i < dimpla; i++)
    planes[i] = cos(rand());
  adainit();
  nbsols = _ada_pieri_solver(m, p, q, nb, level, points, planes, filename);
  adafinal();
  printf("The number of solutions : %d\n", nbsols);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xde6(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    132c <main+0x1ac>
mov    $0x0,%al
call   10a0 <rand@plt>
mov    %eax,%edi
call   1090 <cos@plt>
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12f7 <main+0x177>
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
imul   -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x8,%esi
call   1040 <calloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    138a <main+0x20a>
mov    $0x0,%al
call   10a0 <rand@plt>
mov    %eax,%edi
call   1090 <cos@plt>
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1355 <main+0x1d5>
mov    $0x0,%al
call   1080 <adainit@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%r10
lea    -0x90(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1050 <_ada_pieri_solver@plt>
mov    %eax,-0x2c(%rbp)
mov    $0x0,%al
call   1060 <adafinal@plt>
mov    -0x2c(%rbp),%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xf90(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe65(%rip),%rdi
lea    0x20(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xe52(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe5e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7a(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xe67(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf49(%rip),%rdi
call   1030 <puts@plt>
lea    0xf71(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ebx
mov    %ebx,%ecx
imul   %eax,%ecx
add    %eax,%ebx
imul   0x14(%rsp),%ebx
add    %ecx,%ebx
lea    (%rbx,%rbx,1),%r15d
mov    %r15d,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%r12
test   %ebx,%ebx
jle    130d <main+0x17d>
cmp    $0x2,%r15d
mov    $0x1,%ebp
cmovge %r15d,%ebp
xor    %ebx,%ebx
xor    %eax,%eax
call   10b0 <rand@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    12f0 <main+0x160>
imul   0x10(%rsp),%r15d
imul   0xc(%rsp),%r15d
mov    %r15d,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,%r13
test   %r15d,%r15d
jle    135e <main+0x1ce>
mov    %r15d,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   10b0 <rand@plt>
mov    %eax,%edi
call   10a0 <cos@plt>
movsd  %xmm0,0x0(%r13,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1340 <main+0x1b0>
xor    %eax,%eax
call   1090 <adainit@plt>
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x1c(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    %r12,%r9
push   %r14
push   %r13
call   1060 <_ada_pieri_solver@plt>
add    $0x10,%rsp
mov    %eax,%ebx
xor    %eax,%eax
call   1070 <adafinal@plt>
lea    0xd7d(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0ATesting the call to Pieri homotopies...\0A\0A\00"
@.str.1 = [36 x i8] c"Give the name of the output file : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [29 x i8] c"The output file name is %s.\0A\00"
@.str.4 = [42 x i8] c"Give the dimension of the input planes : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [43 x i8] c"Give the dimension of the output planes : \00"
@.str.7 = [31 x i8] c"Give the degree of the maps : \00"
@.str.8 = [47 x i8] c"Give the number of maps wanted (<0 for all) : \00"
@.str.9 = [43 x i8] c"Give the amount of intermediate output : \0A\00"
@.str.10 = [30 x i8] c" 0. no intermediate output;\0A\00"
@.str.11 = [41 x i8] c" 1. only final determinant validation;\0A\00"
@.str.12 = [53 x i8] c" 2. + validation of all intermediate determinants;\0A\00"
@.str.13 = [50 x i8] c" 3. + intermediate output of all path trackers.\0A\00"
@.str.14 = [45 x i8] c"Type 0, 1, 2, or 3 to select output level : \00"
@.str.15 = [30 x i8] c"The number of solutions : %d\0A\00"
define i32 @main() {
%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 double*
%13 = alloca double*
%14 = alloca [80 x i8]
store i32 0, i32* %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %14, 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]* %14, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.9, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.12, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.13, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %6)
%36 = load i32, i32* %2
%37 = load i32, i32* %3
%38 = mul nsw i32 %36, %37
%39 = load i32, i32* %4
%40 = load i32, i32* %2
%41 = load i32, i32* %3
%42 = add nsw i32 %40, %41
%43 = mul nsw i32 %39, %42
%44 = add nsw i32 %38, %43
store i32 %44, i32* %7
%45 = load i32, i32* %7
%46 = mul nsw i32 2, %45
store i32 %46, i32* %8
%47 = load i32, i32* %8
%48 = call i64 @calloc(i32 %47, i32 8)
%49 = inttoptr i64 %48 to double*
store double* %49, double** %12
store i32 0, i32* %10
br label %50
50: ; preds = %61, %0
%51 = load i32, i32* %10
%52 = load i32, i32* %8
%53 = icmp slt i32 %51, %52
br i1 %53, label %54, label %64
54: ; preds = %50
%55 = call i32 (...) @rand()
%56 = call double @cos(i32 %55)
%57 = load double*, double** %12
%58 = load i32, i32* %10
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds double, double* %57, i64 %59
store double %56, double* %60
br label %61
61: ; preds = %54
%62 = load i32, i32* %10
%63 = add nsw i32 %62, 1
store i32 %63, i32* %10
br label %50
64: ; preds = %50
%65 = load i32, i32* %7
%66 = mul nsw i32 2, %65
%67 = load i32, i32* %2
%68 = mul nsw i32 %66, %67
%69 = load i32, i32* %3
%70 = mul nsw i32 %68, %69
store i32 %70, i32* %9
%71 = load i32, i32* %9
%72 = call i64 @calloc(i32 %71, i32 8)
%73 = inttoptr i64 %72 to double*
store double* %73, double** %13
store i32 0, i32* %10
br label %74
74: ; preds = %85, %64
%75 = load i32, i32* %10
%76 = load i32, i32* %9
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %88
78: ; preds = %74
%79 = call i32 (...) @rand()
%80 = call double @cos(i32 %79)
%81 = load double*, double** %13
%82 = load i32, i32* %10
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
store double %80, double* %84
br label %85
85: ; preds = %78
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
br label %74
88: ; preds = %74
%89 = call i32 (...) @adainit()
%90 = load i32, i32* %2
%91 = load i32, i32* %3
%92 = load i32, i32* %4
%93 = load i32, i32* %5
%94 = load i32, i32* %6
%95 = load double*, double** %12
%96 = load double*, double** %13
%97 = getelementptr inbounds [80 x i8], [80 x i8]* %14, i64 0, i64 0
%98 = call i32 @_ada_pieri_solver(i32 %90, i32 %91, i32 %92, i32 %93, i32 %94, double* %95, double* %96, i8* %97)
store i32 %98, i32* %11
%99 = call i32 (...) @adafinal()
%100 = load i32, i32* %11
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0), i32 %100)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"Give the name of the output file : \00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [29 x i8] c"The output file name is %s.\0A\00"
@.str.4 = [42 x i8] c"Give the dimension of the input planes : \00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [43 x i8] c"Give the dimension of the output planes : \00"
@.str.7 = [31 x i8] c"Give the degree of the maps : \00"
@.str.8 = [47 x i8] c"Give the number of maps wanted (<0 for all) : \00"
@.str.14 = [45 x i8] c"Type 0, 1, 2, or 3 to select output level : \00"
@.str.15 = [30 x i8] c"The number of solutions : %d\0A\00"
@str = [42 x i8] c"\0ATesting the call to Pieri homotopies...\0A\00"
@str.16 = [42 x i8] c"Give the amount of intermediate output : \00"
@str.17 = [29 x i8] c" 0. no intermediate output;\00"
@str.18 = [40 x i8] c" 1. only final determinant validation;\00"
@str.19 = [52 x i8] c" 2. + validation of all intermediate determinants;\00"
@str.20 = [49 x i8] c" 3. + intermediate output of all path trackers.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [80 x i8]
%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 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %1)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.16, i64 0, i64 0))
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.17, i64 0, i64 0))
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.18, i64 0, i64 0))
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.19, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.20, i64 0, i64 0))
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.14, i64 0, i64 0))
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%32 = load i32, i32* %1
%33 = load i32, i32* %2
%34 = mul nsw i32 %33, %32
%35 = load i32, i32* %3
%36 = add nsw i32 %33, %32
%37 = mul nsw i32 %35, %36
%38 = add nsw i32 %37, %34
%39 = shl nsw i32 %38, 1
%40 = call i64 @calloc(i32 %39, i32 8)
%41 = inttoptr i64 %40 to double*
%42 = icmp sgt i32 %38, 0
br i1 %42, label %43, label %53
43: ; preds = %0
%44 = call i32 @llvm.smax.i32(i32 %39, i32 1)
%45 = zext i32 %44 to i64
br label %46
46: ; preds = %43, %46
%47 = phi i64 [ 0, %43 ], [ %51, %46 ]
%48 = call i32 (...) @rand()
%49 = call double @cos(i32 %48)
%50 = getelementptr inbounds double, double* %41, i64 %47
store double %49, double* %50
%51 = add nuw nsw i64 %47, 1
%52 = icmp eq i64 %51, %45
br i1 %52, label %53, label %46
53: ; preds = %46, %0
%54 = load i32, i32* %1
%55 = mul nsw i32 %54, %39
%56 = load i32, i32* %2
%57 = mul nsw i32 %55, %56
%58 = call i64 @calloc(i32 %57, i32 8)
%59 = inttoptr i64 %58 to double*
%60 = icmp sgt i32 %57, 0
br i1 %60, label %61, label %70
61: ; preds = %53
%62 = zext i32 %57 to i64
br label %63
63: ; preds = %61, %63
%64 = phi i64 [ 0, %61 ], [ %68, %63 ]
%65 = call i32 (...) @rand()
%66 = call double @cos(i32 %65)
%67 = getelementptr inbounds double, double* %59, i64 %64
store double %66, double* %67
%68 = add nuw nsw i64 %64, 1
%69 = icmp eq i64 %68, %62
br i1 %69, label %70, label %63
70: ; preds = %63, %53
%71 = call i32 (...) @adainit()
%72 = load i32, i32* %1
%73 = load i32, i32* %2
%74 = load i32, i32* %3
%75 = load i32, i32* %4
%76 = load i32, i32* %5
%77 = call i32 @_ada_pieri_solver(i32 %72, i32 %73, i32 %74, i32 %75, i32 %76, double* %41, double* %59, i8* %12)
%78 = call i32 (...) @adafinal()
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.15, i64 0, i64 0), i32 %77)
ret i32 0
}