#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*/ axpy(double *, double, double *, double *, int);
double ddot(double *, double *, int);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int const);
int /*<<< orphan*/ memcpy(double *, double *, int const);
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int const);
int /*<<< orphan*/ printf(char *, int, ...);
int precond_cg(void (*matvec)(double *Ax, double **Adata, double *x, int n),
               void (*psolve)(double *Minvx, double *Mdata, double *x, int n),
               double **Adata, double *Mdata, double *b, double *x, double rtol,
               int n, int maxiter) {
  const int nbytes = n * sizeof(double);
  double bnorm2 = 0.0;
  double rnorm2 = 0.0;
  double rz = 0.0;
  double rzold = 0.0;
  double alpha = 0.0;
  double beta = 0.0;
  double *s = 0;
  double *r = 0;
  double *z = 0;
  int i = 0;
  s = (double *)malloc(nbytes);
  r = (double *)malloc(nbytes);
  z = (double *)malloc(nbytes);
  bnorm2 = ddot(b, b, n);
  memset(x, 0, nbytes);
  memcpy(r, b, nbytes);
  psolve(z, Mdata, r, n);
  memcpy(s, z, nbytes);
  rz = ddot(r, z, n);
  rnorm2 = ddot(r, r, n);
  printf("rz=%2.15f, aplha=%2.15f, rnorm=%2.15f, bnorm:%f\n", rz, alpha, rnorm2,
         bnorm2);
  for (i = 0; i < maxiter; i++) {
    printf("Repeat# %d \n", i);
    matvec(z, Adata, s, n);
    alpha = rz / ddot(s, z, n);
    axpy(x, alpha, s, x, n);
    axpy(r, -alpha, z, r, n);
    psolve(z, Mdata, r, n);
    rzold = rz;
    rz = ddot(r, z, n);
    beta = -rz / rzold;
    axpy(s, -beta, s, z, n);
    printf("(%d)rz=%2.15f, alpha=%2.15f, rnorm=%2.15f\n", i, rz, alpha, rnorm2);
    rnorm2 = ddot(r, r, n);
    if (rnorm2 <= bnorm2 * rtol * rtol) {
      break;
    } else {
    }
  }
  free(z);
  free(r);
  free(s);
  if (i >= maxiter) {
    return -1;
  } else {
    return i;
  }
}


x86 assembly (clang, -O0):
<precond_cg>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movsd  %xmm0,-0x40(%rbp)
movslq 0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,-0x44(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x70(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x78(%rbp)
movq   $0x0,-0x80(%rbp)
movq   $0x0,-0x88(%rbp)
movq   $0x0,-0x90(%rbp)
movl   $0x0,-0x94(%rbp)
mov    -0x44(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x80(%rbp)
mov    -0x44(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x44(%rbp),%edi
call   1080 <malloc@plt>
mov    %rax,-0x90(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <ddot@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x44(%rbp),%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x88(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x90(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   *%rax
mov    -0x80(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    -0x44(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x88(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <ddot@plt>
movsd  %xmm0,-0x60(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <ddot@plt>
movsd  %xmm0,-0x58(%rbp)
cvttsd2si -0x60(%rbp),%esi
movsd  -0x70(%rbp),%xmm0
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
lea    0xd20(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
movl   $0x0,-0x94(%rbp)
mov    -0x94(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    14ca <precond_cg+0x35a>
mov    -0x94(%rbp),%esi
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    -0x90(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   *%rax
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x80(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <ddot@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x38(%rbp),%rdi
movsd  -0x70(%rbp),%xmm0
mov    -0x80(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   1090 <axpy@plt>
mov    -0x88(%rbp),%rdi
movsd  -0x70(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x90(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   1090 <axpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x90(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x88(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   *%rax
movsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x88(%rbp),%rdi
mov    -0x90(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <ddot@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
divsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x80(%rbp),%rdi
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x80(%rbp),%rsi
mov    -0x90(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   1090 <axpy@plt>
mov    -0x94(%rbp),%esi
movsd  -0x60(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
lea    0xbd7(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
mov    -0x88(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    0x10(%rbp),%edx
call   1040 <ddot@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     14ac <precond_cg+0x33c>
jmp    14ca <precond_cg+0x35a>
jmp    14b1 <precond_cg+0x341>
jmp    14b6 <precond_cg+0x346>
mov    -0x94(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x94(%rbp)
jmp    12f1 <precond_cg+0x181>
mov    -0x90(%rbp),%rdi
call   1030 <free@plt>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x94(%rbp),%eax
cmp    0x18(%rbp),%eax
jl     1506 <precond_cg+0x396>
movl   $0xffffffff,-0x4(%rbp)
jmp    150f <precond_cg+0x39f>
mov    -0x94(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<precond_cg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
movsd  %xmm0,0x30(%rsp)
mov    %r9,%r14
mov    %r8,(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rdx,0x50(%rsp)
mov    %rsi,0x10(%rsp)
mov    %rdi,0x48(%rsp)
mov    0x90(%rsp),%r12d
lea    0x0(,%r12,8),%r13d
mov    %r13d,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    %r13d,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %r13d,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    (%rsp),%rdi
mov    %rdi,%rsi
mov    %r12d,%edx
call   1040 <ddot@plt>
movsd  %xmm0,0x8(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
mov    %r13d,%edx
call   1060 <memset@plt>
mov    %rbp,%rdi
mov    (%rsp),%rsi
mov    %r13d,%edx
call   1070 <memcpy@plt>
mov    %r15,%rdi
mov    0x18(%rsp),%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
call   *0x10(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r13d,%edx
call   1070 <memcpy@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1040 <ddot@plt>
movsd  %xmm0,(%rsp)
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
call   1040 <ddot@plt>
movapd %xmm0,%xmm1
cvttsd2si (%rsp),%esi
lea    0xdbe(%rip),%rdi
xorpd  %xmm0,%xmm0
movsd  %xmm1,0x20(%rsp)
movsd  0x8(%rsp),%xmm2
mov    $0x3,%al
call   1050 <printf@plt>
mov    $0xffffffff,%r13d
cmpl   $0x0,0x98(%rsp)
jle    13b5 <precond_cg+0x245>
movsd  0x30(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xor    %r13d,%r13d
movsd  (%rsp),%xmm0
movsd  %xmm1,0x8(%rsp)
nop
movsd  %xmm0,(%rsp)
lea    0xd95(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    0x50(%rsp),%rsi
mov    %rbx,%rdx
mov    %r12d,%ecx
call   *0x48(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1040 <ddot@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,0x30(%rsp)
mov    %r14,%rdi
movapd %xmm1,%xmm0
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r12d,%ecx
call   1090 <axpy@plt>
movapd 0x30(%rsp),%xmm0
xorpd  0xcf8(%rip),%xmm0
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
call   1090 <axpy@plt>
mov    %r15,%rdi
mov    0x18(%rsp),%rsi
mov    %rbp,%rdx
mov    %r12d,%ecx
call   *0x10(%rsp)
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1040 <ddot@plt>
movsd  %xmm0,0x28(%rsp)
divsd  (%rsp),%xmm0
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r12d,%ecx
call   1090 <axpy@plt>
lea    0xcf2(%rip),%rdi
mov    %r13d,%esi
movsd  0x28(%rsp),%xmm0
movaps 0x30(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
mov    $0x3,%al
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
call   1040 <ddot@plt>
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    13b5 <precond_cg+0x245>
movsd  %xmm0,0x20(%rsp)
add    $0x1,%r13d
movsd  0x28(%rsp),%xmm0
cmp    %r13d,0x98(%rsp)
jne    12a0 <precond_cg+0x130>
mov    $0xffffffff,%r13d
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r13d,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"rz=%2.15f, aplha=%2.15f, rnorm=%2.15f, bnorm:%f\0A\00"
@.str.1 = [13 x i8] c"Repeat# %d \0A\00"
@.str.2 = [43 x i8] c"(%d)rz=%2.15f, alpha=%2.15f, rnorm=%2.15f\0A\00"
define i32 @precond_cg(void (double*, double**, double*, i32)* %0, void (double*, double*, double*, i32)* %1, double** %2, double* %3, double* %4, double* %5, double %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca void (double*, double**, double*, i32)*
%12 = alloca void (double*, double*, double*, i32)*
%13 = alloca double**
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca i32
store void (double*, double**, double*, i32)* %0, void (double*, double**, double*, i32)** %11
store void (double*, double*, double*, i32)* %1, void (double*, double*, double*, i32)** %12
store double** %2, double*** %13
store double* %3, double** %14
store double* %4, double** %15
store double* %5, double** %16
store double %6, double* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
%31 = load i32, i32* %18
%32 = sext i32 %31 to i64
%33 = mul i64 %32, 8
%34 = trunc i64 %33 to i32
store i32 %34, i32* %20
store double 0.000000e+00, double* %21
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
store double 0.000000e+00, double* %25
store double 0.000000e+00, double* %26
store double* null, double** %27
store double* null, double** %28
store double* null, double** %29
store i32 0, i32* %30
%35 = load i32, i32* %20
%36 = call i64 @malloc(i32 %35)
%37 = inttoptr i64 %36 to double*
store double* %37, double** %27
%38 = load i32, i32* %20
%39 = call i64 @malloc(i32 %38)
%40 = inttoptr i64 %39 to double*
store double* %40, double** %28
%41 = load i32, i32* %20
%42 = call i64 @malloc(i32 %41)
%43 = inttoptr i64 %42 to double*
store double* %43, double** %29
%44 = load double*, double** %15
%45 = load double*, double** %15
%46 = load i32, i32* %18
%47 = call double @ddot(double* %44, double* %45, i32 %46)
store double %47, double* %21
%48 = load double*, double** %16
%49 = load i32, i32* %20
%50 = call i32 @memset(double* %48, i32 0, i32 %49)
%51 = load double*, double** %28
%52 = load double*, double** %15
%53 = load i32, i32* %20
%54 = call i32 @memcpy(double* %51, double* %52, i32 %53)
%55 = load void (double*, double*, double*, i32)*, void (double*, double*, double*, i32)** %12
%56 = load double*, double** %29
%57 = load double*, double** %14
%58 = load double*, double** %28
%59 = load i32, i32* %18
%60 = load double*, double** %27
%61 = load double*, double** %29
%62 = load i32, i32* %20
%63 = call i32 @memcpy(double* %60, double* %61, i32 %62)
%64 = load double*, double** %28
%65 = load double*, double** %29
%66 = load i32, i32* %18
%67 = call double @ddot(double* %64, double* %65, i32 %66)
store double %67, double* %23
%68 = load double*, double** %28
%69 = load double*, double** %28
%70 = load i32, i32* %18
%71 = call double @ddot(double* %68, double* %69, i32 %70)
store double %71, double* %22
%72 = load double, double* %23
%73 = fptosi double %72 to i32
%74 = load double, double* %25
%75 = load double, double* %22
%76 = load double, double* %21
%77 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %73, double %74, double %75, double %76)
store i32 0, i32* %30
br label %78
78: ; preds = %149, %9
%79 = load i32, i32* %30
%80 = load i32, i32* %19
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %152
82: ; preds = %78
%83 = load i32, i32* %30
%84 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %83)
%85 = load void (double*, double**, double*, i32)*, void (double*, double**, double*, i32)** %11
%86 = load double*, double** %29
%87 = load double**, double*** %13
%88 = load double*, double** %27
%89 = load i32, i32* %18
%90 = load double, double* %23
%91 = load double*, double** %27
%92 = load double*, double** %29
%93 = load i32, i32* %18
%94 = call double @ddot(double* %91, double* %92, i32 %93)
%95 = fdiv double %90, %94
store double %95, double* %25
%96 = load double*, double** %16
%97 = load double, double* %25
%98 = load double*, double** %27
%99 = load double*, double** %16
%100 = load i32, i32* %18
%101 = call i32 @axpy(double* %96, double %97, double* %98, double* %99, i32 %100)
%102 = load double*, double** %28
%103 = load double, double* %25
%104 = fneg double %103
%105 = load double*, double** %29
%106 = load double*, double** %28
%107 = load i32, i32* %18
%108 = call i32 @axpy(double* %102, double %104, double* %105, double* %106, i32 %107)
%109 = load void (double*, double*, double*, i32)*, void (double*, double*, double*, i32)** %12
%110 = load double*, double** %29
%111 = load double*, double** %14
%112 = load double*, double** %28
%113 = load i32, i32* %18
%114 = load double, double* %23
store double %114, double* %24
%115 = load double*, double** %28
%116 = load double*, double** %29
%117 = load i32, i32* %18
%118 = call double @ddot(double* %115, double* %116, i32 %117)
store double %118, double* %23
%119 = load double, double* %23
%120 = fneg double %119
%121 = load double, double* %24
%122 = fdiv double %120, %121
store double %122, double* %26
%123 = load double*, double** %27
%124 = load double, double* %26
%125 = fneg double %124
%126 = load double*, double** %27
%127 = load double*, double** %29
%128 = load i32, i32* %18
%129 = call i32 @axpy(double* %123, double %125, double* %126, double* %127, i32 %128)
%130 = load i32, i32* %30
%131 = load double, double* %23
%132 = load double, double* %25
%133 = load double, double* %22
%134 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %130, double %131, double %132, double %133)
%135 = load double*, double** %28
%136 = load double*, double** %28
%137 = load i32, i32* %18
%138 = call double @ddot(double* %135, double* %136, i32 %137)
store double %138, double* %22
%139 = load double, double* %22
%140 = load double, double* %21
%141 = load double, double* %17
%142 = fmul double %140, %141
%143 = load double, double* %17
%144 = fmul double %142, %143
%145 = fcmp ole double %139, %144
br i1 %145, label %146, label %147
146: ; preds = %82
br label %152
147: ; preds = %82
br label %148
148: ; preds = %147
br label %149
149: ; preds = %148
%150 = load i32, i32* %30
%151 = add nsw i32 %150, 1
store i32 %151, i32* %30
br label %78
152: ; preds = %146, %78
%153 = load double*, double** %29
%154 = call i32 @free(double* %153)
%155 = load double*, double** %28
%156 = call i32 @free(double* %155)
%157 = load double*, double** %27
%158 = call i32 @free(double* %157)
%159 = load i32, i32* %30
%160 = load i32, i32* %19
%161 = icmp sge i32 %159, %160
br i1 %161, label %162, label %163
162: ; preds = %152
store i32 -1, i32* %10
br label %165
163: ; preds = %152
%164 = load i32, i32* %30
store i32 %164, i32* %10
br label %165
165: ; preds = %163, %162
%166 = load i32, i32* %10
ret i32 %166
}

LLVM IR (-O2):
@.str = [49 x i8] c"rz=%2.15f, aplha=%2.15f, rnorm=%2.15f, bnorm:%f\0A\00"
@.str.1 = [13 x i8] c"Repeat# %d \0A\00"
@.str.2 = [43 x i8] c"(%d)rz=%2.15f, alpha=%2.15f, rnorm=%2.15f\0A\00"
define i32 @precond_cg(void (double*, double**, double*, i32)* nocapture %0, void (double*, double*, double*, i32)* nocapture %1, double** %2, double* %3, double* %4, double* %5, double %6, i32 %7, i32 %8) {
%10 = shl i32 %7, 3
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to double*
%13 = tail call i64 @malloc(i32 %10)
%14 = inttoptr i64 %13 to double*
%15 = tail call i64 @malloc(i32 %10)
%16 = inttoptr i64 %15 to double*
%17 = tail call double @ddot(double* %4, double* %4, i32 %7)
%18 = tail call i32 @memset(double* %5, i32 0, i32 %10)
%19 = tail call i32 @memcpy(double* %14, double* %4, i32 %10)
tail call void %1(double* %16, double* %3, double* %14, i32 %7)
%20 = tail call i32 @memcpy(double* %12, double* %16, i32 %10)
%21 = tail call double @ddot(double* %14, double* %16, i32 %7)
%22 = tail call double @ddot(double* %14, double* %14, i32 %7)
%23 = fptosi double %21 to i32
%24 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i32 %23, double 0.000000e+00, double %22, double %17)
%25 = icmp sgt i32 %8, 0
br i1 %25, label %26, label %48
26: ; preds = %9
%27 = fmul double %17, %6
%28 = fmul double %27, %6
br label %29
29: ; preds = %26, %45
%30 = phi i32 [ 0, %26 ], [ %46, %45 ]
%31 = phi double [ %21, %26 ], [ %39, %45 ]
%32 = phi double [ %22, %26 ], [ %43, %45 ]
%33 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %30)
tail call void %0(double* %16, double** %2, double* %12, i32 %7)
%34 = tail call double @ddot(double* %12, double* %16, i32 %7)
%35 = fdiv double %31, %34
%36 = tail call i32 @axpy(double* %5, double %35, double* %12, double* %5, i32 %7)
%37 = fneg double %35
%38 = tail call i32 @axpy(double* %14, double %37, double* %16, double* %14, i32 %7)
tail call void %1(double* %16, double* %3, double* %14, i32 %7)
%39 = tail call double @ddot(double* %14, double* %16, i32 %7)
%40 = fdiv double %39, %31
%41 = tail call i32 @axpy(double* %12, double %40, double* %12, double* %16, i32 %7)
%42 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %30, double %39, double %35, double %32)
%43 = tail call double @ddot(double* %14, double* %14, i32 %7)
%44 = fcmp ugt double %43, %28
br i1 %44, label %45, label %48
45: ; preds = %29
%46 = add nuw nsw i32 %30, 1
%47 = icmp eq i32 %46, %8
br i1 %47, label %48, label %29
48: ; preds = %45, %29, %9
%49 = phi i32 [ -1, %9 ], [ %30, %29 ], [ -1, %45 ]
%50 = tail call i32 @free(double* %16)
%51 = tail call i32 @free(double* %14)
%52 = tail call i32 @free(double* %12)
ret i32 %49
}