#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*/ addv(double, double *, double, double *, int, double *);
double atof(char *);
int atoi(char *);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ cgm(double *, double *, int, int *, double *, double *);
int /*<<< orphan*/ dot(double *, double *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ matvec(double *, double *, int, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_matrix(char *, double **, int *, int *);
double sqrt(int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc < 3) {
    printf("Usage: %s A b tolerance(default 1e-8) max_iter(default is b "
           "dimension)\n",
           argv[0]);
    exit(1);
  }
  int N, M;
  double *A;
  double *b;
  double *x;
  read_matrix(argv[1], &A, &M, &N);
  if (M != N) {
    printf("Only square matrix are supported. Current matrix %dx%d.\n", M, N);
    exit(1);
  }
  int N1, M1;
  read_matrix(argv[2], &b, &M1, &N1);
  if (M1 * N1 != N) {
    printf("Invalid b size %d.\n", M1 * N1);
    exit(1);
  }
  x = (double *)calloc(N, sizeof(double));
  int max_iter = N;
  double tol = 1e-8;
  if (argc > 4) {
    max_iter = atoi(argv[4]);
  }
  if (argc > 3) {
    tol = atof(argv[3]);
  }
  cgm(A, b, N, &max_iter, &tol, x);
  int i;
  for (i = 0; i < N; i++) {
    printf("%f ", x[i]);
  }
  printf("\n");
  printf("tol %e\n", tol);
  printf("max_iter %d\n", max_iter);
  double *t = (double *)calloc(N, sizeof(double));
  matvec(A, x, N, t);
  addv(1.0, t, -1.0, b, N, t);
  printf("||A*x-b|| %e\n", sqrt(dot(t, t, N)));
  free(t);
  free(A);
  free(b);
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    11ff <main+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1080 <read_matrix@plt>
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1242 <main+0x82>
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   1080 <read_matrix@plt>
mov    -0x38(%rbp),%eax
imul   -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     128a <main+0xca>
mov    -0x38(%rbp),%esi
imul   -0x34(%rbp),%esi
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x14(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movsd  0xd57(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    12c8 <main+0x108>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    12e4 <main+0x124>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1050 <atof@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x30(%rbp),%r9
lea    -0x3c(%rbp),%rcx
lea    -0x48(%rbp),%r8
call   1090 <cgm@plt>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    133c <main+0x17c>
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xd86(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1307 <main+0x147>
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xd5b(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x3c(%rbp),%esi
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%edi
mov    $0x8,%esi
call   1070 <calloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x58(%rbp),%rcx
call   10d0 <matvec@plt>
mov    -0x58(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x58(%rbp),%rcx
movsd  0xc5e(%rip),%xmm0
movsd  0xc5e(%rip),%xmm1
call   10e0 <addv@plt>
mov    -0x58(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <dot@plt>
mov    %eax,%edi
call   10b0 <sqrt@plt>
lea    0xcf1(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x58(%rbp),%rdi
call   1040 <free@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r14
cmp    $0x2,%edi
jle    13a9 <main+0x1d9>
mov    %edi,%r15d
mov    0x8(%r14),%rdi
lea    0x18(%rsp),%rsi
lea    0x2c(%rsp),%rdx
mov    %rsp,%rcx
call   1090 <read_matrix@plt>
mov    0x2c(%rsp),%esi
mov    (%rsp),%edx
cmp    %edx,%esi
jne    13c4 <main+0x1f4>
mov    0x10(%r14),%rdi
lea    0x10(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0x28(%rsp),%rcx
call   1090 <read_matrix@plt>
mov    0x28(%rsp),%esi
imul   0x24(%rsp),%esi
cmp    (%rsp),%esi
jne    13dc <main+0x20c>
mov    %esi,%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,%r12
mov    (%rsp),%ebp
mov    %ebp,0x4(%rsp)
movabs $0x3e45798ee2308c3a,%rax
79 45 3e
mov    %rax,0x8(%rsp)
cmp    $0x5,%r15d
jb     1274 <main+0xa4>
mov    0x20(%r14),%rdi
call   10b0 <atoi@plt>
mov    %eax,0x4(%rsp)
jmp    127a <main+0xaa>
cmp    $0x4,%r15d
jne    1289 <main+0xb9>
mov    0x18(%r14),%rdi
call   1060 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    0x18(%rsp),%rdi
mov    0x10(%rsp),%rsi
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %ebp,%edx
mov    %r12,%r9
call   10a0 <cgm@plt>
cmpl   $0x0,(%rsp)
jle    12dd <main+0x10d>
xor    %ebx,%ebx
lea    0xdef(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
movsd  (%r12,%rbx,8),%xmm0
mov    %rbp,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1,%rbx
movslq (%rsp),%rax
cmp    %rax,%rbx
jl     12c0 <main+0xf0>
mov    $0xa,%edi
call   1050 <putchar@plt>
movsd  0x8(%rsp),%xmm0
lea    0xdb5(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xdab(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%rsp),%edi
mov    $0x8,%esi
call   1080 <calloc@plt>
mov    %rax,%rbp
mov    0x18(%rsp),%rdi
mov    (%rsp),%edx
mov    %r12,%rsi
mov    %rax,%rcx
call   10e0 <matvec@plt>
mov    0x10(%rsp),%rsi
mov    (%rsp),%edx
movsd  0xcc0(%rip),%xmm0
movsd  0xcc0(%rip),%xmm1
mov    %rbp,%rdi
mov    %rbp,%rcx
call   10f0 <addv@plt>
mov    (%rsp),%edx
mov    %rbp,%rdi
mov    %rbp,%rsi
call   1030 <dot@plt>
mov    %eax,%edi
call   10c0 <sqrt@plt>
lea    0xd4f(%rip),%rdi
mov    $0x1,%al
call   1070 <printf@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
mov    0x18(%rsp),%rdi
call   1040 <free@plt>
mov    0x10(%rsp),%rdi
call   1040 <free@plt>
mov    %r12,%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r14),%rsi
lea    0xc5d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xc8d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xcae(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [72 x i8] c"Usage: %s A b tolerance(default 1e-8) max_iter(default is b dimension)\0A\00"
@.str.1 = [57 x i8] c"Only square matrix are supported. Current matrix %dx%d.\0A\00"
@.str.2 = [20 x i8] c"Invalid b size %d.\0A\00"
@.str.3 = [4 x i8] c"%f \00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [8 x i8] c"tol %e\0A\00"
@.str.6 = [13 x i8] c"max_iter %d\0A\00"
@.str.7 = [14 x i8] c"||A*x-b|| %e\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca i32
%16 = alloca double*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %25
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = call i32 @exit(i32 1)
unreachable
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 1
%28 = load i8*, i8** %27
%29 = call i32 @read_matrix(i8* %28, double** %8, i32* %7, i32* %6)
%30 = load i32, i32* %7
%31 = load i32, i32* %6
%32 = icmp ne i32 %30, %31
br i1 %32, label %33, label %38
33: ; preds = %25
%34 = load i32, i32* %7
%35 = load i32, i32* %6
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %34, i32 %35)
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %25
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
%42 = call i32 @read_matrix(i8* %41, double** %9, i32* %12, i32* %11)
%43 = load i32, i32* %12
%44 = load i32, i32* %11
%45 = mul nsw i32 %43, %44
%46 = load i32, i32* %6
%47 = icmp ne i32 %45, %46
br i1 %47, label %48, label %54
48: ; preds = %38
%49 = load i32, i32* %12
%50 = load i32, i32* %11
%51 = mul nsw i32 %49, %50
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%53 = call i32 @exit(i32 1)
unreachable
54: ; preds = %38
%55 = load i32, i32* %6
%56 = call i64 @calloc(i32 %55, i32 8)
%57 = inttoptr i64 %56 to double*
store double* %57, double** %10
%58 = load i32, i32* %6
store i32 %58, i32* %13
store double 1.000000e-08, double* %14
%59 = load i32, i32* %4
%60 = icmp sgt i32 %59, 4
br i1 %60, label %61, label %66
61: ; preds = %54
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 4
%64 = load i8*, i8** %63
%65 = call i32 @atoi(i8* %64)
store i32 %65, i32* %13
br label %66
66: ; preds = %61, %54
%67 = load i32, i32* %4
%68 = icmp sgt i32 %67, 3
br i1 %68, label %69, label %74
69: ; preds = %66
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 3
%72 = load i8*, i8** %71
%73 = call double @atof(i8* %72)
store double %73, double* %14
br label %74
74: ; preds = %69, %66
%75 = load double*, double** %8
%76 = load double*, double** %9
%77 = load i32, i32* %6
%78 = load double*, double** %10
%79 = call i32 @cgm(double* %75, double* %76, i32 %77, i32* %13, double* %14, double* %78)
store i32 0, i32* %15
br label %80
80: ; preds = %91, %74
%81 = load i32, i32* %15
%82 = load i32, i32* %6
%83 = icmp slt i32 %81, %82
br i1 %83, label %84, label %94
84: ; preds = %80
%85 = load double*, double** %10
%86 = load i32, i32* %15
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %85, i64 %87
%89 = load double, double* %88
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %89)
br label %91
91: ; preds = %84
%92 = load i32, i32* %15
%93 = add nsw i32 %92, 1
store i32 %93, i32* %15
br label %80
94: ; preds = %80
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%96 = load double, double* %14
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), double %96)
%98 = load i32, i32* %13
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %98)
%100 = load i32, i32* %6
%101 = call i64 @calloc(i32 %100, i32 8)
%102 = inttoptr i64 %101 to double*
store double* %102, double** %16
%103 = load double*, double** %8
%104 = load double*, double** %10
%105 = load i32, i32* %6
%106 = load double*, double** %16
%107 = call i32 @matvec(double* %103, double* %104, i32 %105, double* %106)
%108 = load double*, double** %16
%109 = load double*, double** %9
%110 = load i32, i32* %6
%111 = load double*, double** %16
%112 = call i32 @addv(double 1.000000e+00, double* %108, double -1.000000e+00, double* %109, i32 %110, double* %111)
%113 = load double*, double** %16
%114 = load double*, double** %16
%115 = load i32, i32* %6
%116 = call i32 @dot(double* %113, double* %114, i32 %115)
%117 = call double @sqrt(i32 %116)
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %117)
%119 = load double*, double** %16
%120 = call i32 @free(double* %119)
%121 = load double*, double** %8
%122 = call i32 @free(double* %121)
%123 = load double*, double** %9
%124 = call i32 @free(double* %123)
%125 = load double*, double** %10
%126 = call i32 @free(double* %125)
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"Usage: %s A b tolerance(default 1e-8) max_iter(default is b dimension)\0A\00"
@.str.1 = [57 x i8] c"Only square matrix are supported. Current matrix %dx%d.\0A\00"
@.str.2 = [20 x i8] c"Invalid b size %d.\0A\00"
@.str.3 = [4 x i8] c"%f \00"
@.str.5 = [8 x i8] c"tol %e\0A\00"
@.str.6 = [13 x i8] c"max_iter %d\0A\00"
@.str.7 = [14 x i8] c"||A*x-b|| %e\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = icmp slt i32 %0, 3
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = bitcast i32* %3 to i8*
%18 = bitcast i32* %4 to i8*
%19 = bitcast double** %5 to i8*
%20 = bitcast double** %6 to i8*
%21 = getelementptr inbounds i8*, i8** %1, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @read_matrix(i8* %22, double** %5, i32* %4, i32* %3)
%24 = load i32, i32* %4
%25 = load i32, i32* %3
%26 = icmp eq i32 %24, %25
br i1 %26, label %30, label %27
27: ; preds = %16
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i32 %24, i32 %25)
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %16
%31 = bitcast i32* %7 to i8*
%32 = bitcast i32* %8 to i8*
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @read_matrix(i8* %34, double** %6, i32* %8, i32* %7)
%36 = load i32, i32* %8
%37 = load i32, i32* %7
%38 = mul nsw i32 %37, %36
%39 = load i32, i32* %3
%40 = icmp eq i32 %38, %39
br i1 %40, label %44, label %41
41: ; preds = %30
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%43 = call i32 @exit(i32 1)
unreachable
44: ; preds = %30
%45 = call i64 @calloc(i32 %38, i32 8)
%46 = inttoptr i64 %45 to double*
%47 = bitcast i32* %9 to i8*
%48 = load i32, i32* %3
store i32 %48, i32* %9
%49 = bitcast double* %10 to i8*
store double 1.000000e-08, double* %10
%50 = icmp ugt i32 %0, 4
br i1 %50, label %51, label %55
51: ; preds = %44
%52 = getelementptr inbounds i8*, i8** %1, i64 4
%53 = load i8*, i8** %52
%54 = call i32 @atoi(i8* %53)
store i32 %54, i32* %9
br label %57
55: ; preds = %44
%56 = icmp eq i32 %0, 4
br i1 %56, label %57, label %61
57: ; preds = %51, %55
%58 = getelementptr inbounds i8*, i8** %1, i64 3
%59 = load i8*, i8** %58
%60 = call double @atof(i8* %59)
store double %60, double* %10
br label %61
61: ; preds = %57, %55
%62 = load double*, double** %5
%63 = load double*, double** %6
%64 = call i32 @cgm(double* %62, double* %63, i32 %48, i32* %9, double* %10, double* %46)
%65 = load i32, i32* %3
%66 = icmp sgt i32 %65, 0
br i1 %66, label %67, label %76
67: ; preds = %61, %67
%68 = phi i64 [ %72, %67 ], [ 0, %61 ]
%69 = getelementptr inbounds double, double* %46, i64 %68
%70 = load double, double* %69
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double %70)
%72 = add nuw nsw i64 %68, 1
%73 = load i32, i32* %3
%74 = sext i32 %73 to i64
%75 = icmp slt i64 %72, %74
br i1 %75, label %67, label %76
76: ; preds = %67, %61
%77 = call i32 @putchar(i32 10)
%78 = load double, double* %10
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), double %78)
%80 = load i32, i32* %9
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %80)
%82 = load i32, i32* %3
%83 = call i64 @calloc(i32 %82, i32 8)
%84 = inttoptr i64 %83 to double*
%85 = load double*, double** %5
%86 = load i32, i32* %3
%87 = call i32 @matvec(double* %85, double* %46, i32 %86, double* %84)
%88 = load double*, double** %6
%89 = load i32, i32* %3
%90 = call i32 @addv(double 1.000000e+00, double* %84, double -1.000000e+00, double* %88, i32 %89, double* %84)
%91 = load i32, i32* %3
%92 = call i32 @dot(double* %84, double* %84, i32 %91)
%93 = call double @sqrt(i32 %92)
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %93)
%95 = call i32 @free(double* %84)
%96 = load double*, double** %5
%97 = call i32 @free(double* %96)
%98 = load double*, double** %6
%99 = call i32 @free(double* %98)
%100 = call i32 @free(double* %46)
ret i32 0
}