void _eppMatrix(double *X, double *V, int k, int n, double rho, double p) {
  int i, j, *iter_step;
  double *v, *x;
  double c0, c;
  v = (double *)malloc(sizeof(double) * n);
  x = (double *)malloc(sizeof(double) * n);
  iter_step = (int *)malloc(sizeof(int) * 2);
  c0 = 0;
  for (i = 0; i < k; i++) {
    for (j = 0; j < n; j++)
      v[j] = V[i + j * k];
    epp(x, &c, iter_step, v, n, rho, p, c0);
    c0 = c;
    for (j = 0; j < n; j++)
      X[i + j * k] = x[j];
  }
  free(v);
  free(x);
  free(iter_step);
}


x86 assembly (clang, -O0):
<_eppMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movslq -0x18(%rbp),%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x18(%rbp),%rdi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    126e <_eppMatrix+0x13e>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11e1 <_eppMatrix+0xb1>
mov    -0x10(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11a2 <_eppMatrix+0x72>
mov    -0x48(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%rcx
mov    -0x18(%rbp),%r8d
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm2
lea    -0x58(%rbp),%rsi
mov    $0x3,%al
call   1050 <epp@plt>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    125b <_eppMatrix+0x12b>
mov    -0x48(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    121c <_eppMatrix+0xec>
jmp    1260 <_eppMatrix+0x130>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    118f <_eppMatrix+0x5f>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eppMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movsd  %xmm1,0x68(%rsp)
movsd  %xmm0,0x60(%rsp)
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,0x50(%rsp)
mov    %rdi,0x48(%rsp)
movslq %ecx,%rbp
shl    $0x3,%rbp
mov    %rbp,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,0x38(%rsp)
test   %r15d,%r15d
jle    144a <_eppMatrix+0x31a>
mov    %r14d,%r8d
mov    %r15d,%r9d
mov    %r14d,%eax
lea    -0x1(%rax),%rcx
mov    %rcx,0x58(%rsp)
mov    %eax,%r13d
and    $0x3,%r13d
mov    %rax,0x70(%rsp)
mov    %eax,%esi
and    $0xfffffffc,%esi
mov    %r9,%rdi
shl    $0x4,%rdi
mov    %r9,%r12
shl    $0x5,%r12
lea    0x0(,%r9,8),%r15
lea    (%r15,%r15,2),%r14
xorps  %xmm2,%xmm2
xor    %r10d,%r10d
mov    0x48(%rsp),%r11
mov    0x50(%rsp),%rcx
mov    %r8d,0x4(%rsp)
mov    %r9,0x8(%rsp)
mov    %rsi,0x30(%rsp)
mov    %rdi,0x28(%rsp)
jmp    1233 <_eppMatrix+0x103>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x8(%rsp),%r9
mov    0x30(%rsp),%rsi
mov    0x28(%rsp),%rdi
mov    0x18(%rsp),%r10
mov    0x10(%rsp),%r11
mov    0x20(%rsp),%rcx
add    $0x1,%r10
add    $0x8,%rcx
add    $0x8,%r11
cmp    %r9,%r10
je     144a <_eppMatrix+0x31a>
test   %r8d,%r8d
mov    %r10,0x18(%rsp)
mov    %r11,0x10(%rsp)
mov    %rcx,0x20(%rsp)
jle    1260 <_eppMatrix+0x130>
cmpq   $0x3,0x58(%rsp)
jae    12c0 <_eppMatrix+0x190>
xor    %eax,%eax
jmp    1308 <_eppMatrix+0x1d8>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
lea    0x40(%rsp),%rsi
mov    0x38(%rsp),%rdx
mov    %rbx,%rcx
mov    0x4(%rsp),%r8d
movsd  0x60(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
mov    $0x3,%al
call   1050 <epp@plt>
mov    0x20(%rsp),%rcx
mov    0x10(%rsp),%r11
mov    0x18(%rsp),%r10
mov    0x28(%rsp),%rdi
mov    0x30(%rsp),%rsi
mov    0x8(%rsp),%r9
mov    0x4(%rsp),%r8d
movsd  0x40(%rsp),%xmm2
jmp    121e <_eppMatrix+0xee>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rcx),%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  (%rcx,%r9,8),%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
movsd  (%rcx,%rdi,1),%xmm0
movsd  %xmm0,0x10(%rbx,%rax,8)
movsd  (%rcx,%r14,1),%xmm0
movsd  %xmm0,0x18(%rbx,%rax,8)
add    $0x4,%rax
add    %r12,%rcx
cmp    %rax,%rsi
jne    12d0 <_eppMatrix+0x1a0>
test   %r13,%r13
je     1345 <_eppMatrix+0x215>
lea    (%rbx,%rax,8),%rcx
imul   %r9,%rax
add    %r10,%rax
mov    0x50(%rsp),%rdx
lea    (%rdx,%rax,8),%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%rax),%xmm0
movsd  %xmm0,(%rcx,%rdx,8)
add    $0x1,%rdx
add    %r15,%rax
cmp    %rdx,%r13
jne    1330 <_eppMatrix+0x200>
mov    %rbp,%rdi
lea    0x40(%rsp),%rsi
mov    0x38(%rsp),%rdx
mov    %rbx,%rcx
mov    0x4(%rsp),%r8d
movsd  0x60(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
mov    $0x3,%al
call   1050 <epp@plt>
mov    0x4(%rsp),%r8d
movsd  0x40(%rsp),%xmm2
test   %r8d,%r8d
jle    1200 <_eppMatrix+0xd0>
cmpq   $0x3,0x58(%rsp)
mov    0x30(%rsp),%rsi
mov    0x28(%rsp),%rdi
jae    13a6 <_eppMatrix+0x276>
xor    %eax,%eax
mov    0x8(%rsp),%r9
mov    0x18(%rsp),%r10
mov    0x10(%rsp),%r11
jmp    13f9 <_eppMatrix+0x2c9>
mov    0x10(%rsp),%r11
mov    %r11,%rcx
xor    %eax,%eax
mov    0x8(%rsp),%r9
mov    0x18(%rsp),%r10
nopw   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rcx)
movsd  0x8(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%r15,1)
movsd  0x10(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rdi,1)
movsd  0x18(%rbp,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%r14,1)
add    $0x4,%rax
add    %r12,%rcx
cmp    %rax,%rsi
jne    13c0 <_eppMatrix+0x290>
testb  $0x3,0x70(%rsp)
je     1219 <_eppMatrix+0xe9>
mov    %r9,%rcx
imul   %rax,%rcx
add    %r10,%rcx
mov    0x48(%rsp),%rdx
lea    (%rdx,%rcx,8),%rcx
lea    0x0(,%rax,8),%rax
add    %rbp,%rax
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rax,%rdx,8),%xmm0
movsd  %xmm0,(%rcx)
add    $0x1,%rdx
add    %r15,%rcx
cmp    %rdx,%r13
jne    1430 <_eppMatrix+0x300>
jmp    1219 <_eppMatrix+0xe9>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_eppMatrix(double* %0, double* %1, i32 %2, i32 %3, double %4, double %5) {
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca double
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double
%19 = alloca double
store double* %0, double** %7
store double* %1, double** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store double %4, double* %11
store double %5, double* %12
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = mul i64 8, %21
%23 = call i8* @malloc(i64 %22)
%24 = bitcast i8* %23 to double*
store double* %24, double** %16
%25 = load i32, i32* %10
%26 = sext i32 %25 to i64
%27 = mul i64 8, %26
%28 = call i8* @malloc(i64 %27)
%29 = bitcast i8* %28 to double*
store double* %29, double** %17
%30 = call i8* @malloc(i64 8)
%31 = bitcast i8* %30 to i32*
store i32* %31, i32** %15
store double 0.000000e+00, double* %18
store i32 0, i32* %13
br label %32
32: ; preds = %90, %6
%33 = load i32, i32* %13
%34 = load i32, i32* %9
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %93
36: ; preds = %32
store i32 0, i32* %14
br label %37
37: ; preds = %55, %36
%38 = load i32, i32* %14
%39 = load i32, i32* %10
%40 = icmp slt i32 %38, %39
br i1 %40, label %41, label %58
41: ; preds = %37
%42 = load double*, double** %8
%43 = load i32, i32* %13
%44 = load i32, i32* %14
%45 = load i32, i32* %9
%46 = mul nsw i32 %44, %45
%47 = add nsw i32 %43, %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %42, i64 %48
%50 = load double, double* %49
%51 = load double*, double** %16
%52 = load i32, i32* %14
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
store double %50, double* %54
br label %55
55: ; preds = %41
%56 = load i32, i32* %14
%57 = add nsw i32 %56, 1
store i32 %57, i32* %14
br label %37
58: ; preds = %37
%59 = load double*, double** %17
%60 = load i32*, i32** %15
%61 = load double*, double** %16
%62 = load i32, i32* %10
%63 = load double, double* %11
%64 = load double, double* %12
%65 = load double, double* %18
%66 = call i32 (double*, double*, i32*, double*, i32, double, double, double, ...) bitcast (i32 (...)* @epp to i32 (double*, double*, i32*, double*, i32, double, double, double, ...)*)(double* %59, double* %19, i32* %60, double* %61, i32 %62, double %63, double %64, double %65)
%67 = load double, double* %19
store double %67, double* %18
store i32 0, i32* %14
br label %68
68: ; preds = %86, %58
%69 = load i32, i32* %14
%70 = load i32, i32* %10
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %89
72: ; preds = %68
%73 = load double*, double** %17
%74 = load i32, i32* %14
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
%77 = load double, double* %76
%78 = load double*, double** %7
%79 = load i32, i32* %13
%80 = load i32, i32* %14
%81 = load i32, i32* %9
%82 = mul nsw i32 %80, %81
%83 = add nsw i32 %79, %82
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds double, double* %78, i64 %84
store double %77, double* %85
br label %86
86: ; preds = %72
%87 = load i32, i32* %14
%88 = add nsw i32 %87, 1
store i32 %88, i32* %14
br label %68
89: ; preds = %68
br label %90
90: ; preds = %89
%91 = load i32, i32* %13
%92 = add nsw i32 %91, 1
store i32 %92, i32* %13
br label %32
93: ; preds = %32
%94 = load double*, double** %16
%95 = bitcast double* %94 to i8*
%96 = load double*, double** %17
%97 = bitcast double* %96 to i8*
%98 = load i32*, i32** %15
%99 = bitcast i32* %98 to i8*
ret void
}

LLVM IR (-O2):
define void @_eppMatrix(double* nocapture writeonly %0, double* nocapture %1, i32 %2, i32 %3, double %4, double %5) {
%7 = alloca double
%8 = bitcast double* %7 to i8*
%9 = sext i32 %3 to i64
%10 = shl nsw i64 %9, 3
%11 = tail call i8* @malloc(i64 %10)
%12 = bitcast i8* %11 to double*
%13 = tail call i8* @malloc(i64 %10)
%14 = bitcast i8* %13 to double*
%15 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%16 = bitcast i8* %15 to i32*
%17 = icmp sgt i32 %2, 0
br i1 %17, label %18, label %131
18: ; preds = %6
%19 = icmp sgt i32 %3, 0
%20 = zext i32 %2 to i64
%21 = zext i32 %2 to i64
%22 = zext i32 %3 to i64
%23 = add nsw i64 %22, -1
%24 = and i64 %22, 3
%25 = icmp ult i64 %23, 3
%26 = and i64 %22, 4294967292
%27 = icmp eq i64 %24, 0
%28 = and i64 %22, 3
%29 = icmp ult i64 %23, 3
%30 = and i64 %22, 4294967292
%31 = icmp eq i64 %28, 0
br label %32
32: ; preds = %18, %127
%33 = phi i64 [ 0, %18 ], [ %129, %127 ]
%34 = phi double [ 0.000000e+00, %18 ], [ %128, %127 ]
br i1 %19, label %35, label %36
35: ; preds = %32
br i1 %25, label %68, label %39
36: ; preds = %32
%37 = call i32 (double*, double*, i32*, double*, i32, double, double, double, ...) bitcast (i32 (...)* @epp to i32 (double*, double*, i32*, double*, i32, double, double, double, ...)*)(double* %14, double* %7, i32* %16, double* %12, i32 %3, double %4, double %5, double %34)
%38 = load double, double* %7
br label %127
39: ; preds = %35, %39
%40 = phi i64 [ %65, %39 ], [ 0, %35 ]
%41 = phi i64 [ %66, %39 ], [ 0, %35 ]
%42 = mul nsw i64 %40, %20
%43 = add nuw nsw i64 %42, %33
%44 = getelementptr inbounds double, double* %1, i64 %43
%45 = load double, double* %44
%46 = getelementptr inbounds double, double* %12, i64 %40
store double %45, double* %46
%47 = or i64 %40, 1
%48 = mul nsw i64 %47, %20
%49 = add nuw nsw i64 %48, %33
%50 = getelementptr inbounds double, double* %1, i64 %49
%51 = load double, double* %50
%52 = getelementptr inbounds double, double* %12, i64 %47
store double %51, double* %52
%53 = or i64 %40, 2
%54 = mul nsw i64 %53, %20
%55 = add nuw nsw i64 %54, %33
%56 = getelementptr inbounds double, double* %1, i64 %55
%57 = load double, double* %56
%58 = getelementptr inbounds double, double* %12, i64 %53
store double %57, double* %58
%59 = or i64 %40, 3
%60 = mul nsw i64 %59, %20
%61 = add nuw nsw i64 %60, %33
%62 = getelementptr inbounds double, double* %1, i64 %61
%63 = load double, double* %62
%64 = getelementptr inbounds double, double* %12, i64 %59
store double %63, double* %64
%65 = add nuw nsw i64 %40, 4
%66 = add i64 %41, 4
%67 = icmp eq i64 %66, %26
br i1 %67, label %68, label %39
68: ; preds = %39, %35
%69 = phi i64 [ 0, %35 ], [ %65, %39 ]
br i1 %27, label %81, label %70
70: ; preds = %68, %70
%71 = phi i64 [ %78, %70 ], [ %69, %68 ]
%72 = phi i64 [ %79, %70 ], [ 0, %68 ]
%73 = mul nsw i64 %71, %20
%74 = add nuw nsw i64 %73, %33
%75 = getelementptr inbounds double, double* %1, i64 %74
%76 = load double, double* %75
%77 = getelementptr inbounds double, double* %12, i64 %71
store double %76, double* %77
%78 = add nuw nsw i64 %71, 1
%79 = add i64 %72, 1
%80 = icmp eq i64 %79, %24
br i1 %80, label %81, label %70
81: ; preds = %70, %68
%82 = call i32 (double*, double*, i32*, double*, i32, double, double, double, ...) bitcast (i32 (...)* @epp to i32 (double*, double*, i32*, double*, i32, double, double, double, ...)*)(double* %14, double* %7, i32* %16, double* %12, i32 %3, double %4, double %5, double %34)
%83 = load double, double* %7
br i1 %19, label %84, label %127
84: ; preds = %81
br i1 %29, label %114, label %85
85: ; preds = %84, %85
%86 = phi i64 [ %111, %85 ], [ 0, %84 ]
%87 = phi i64 [ %112, %85 ], [ 0, %84 ]
%88 = getelementptr inbounds double, double* %14, i64 %86
%89 = load double, double* %88
%90 = mul nsw i64 %86, %20
%91 = add nuw nsw i64 %90, %33
%92 = getelementptr inbounds double, double* %0, i64 %91
store double %89, double* %92
%93 = or i64 %86, 1
%94 = getelementptr inbounds double, double* %14, i64 %93
%95 = load double, double* %94
%96 = mul nsw i64 %93, %20
%97 = add nuw nsw i64 %96, %33
%98 = getelementptr inbounds double, double* %0, i64 %97
store double %95, double* %98
%99 = or i64 %86, 2
%100 = getelementptr inbounds double, double* %14, i64 %99
%101 = load double, double* %100
%102 = mul nsw i64 %99, %20
%103 = add nuw nsw i64 %102, %33
%104 = getelementptr inbounds double, double* %0, i64 %103
store double %101, double* %104
%105 = or i64 %86, 3
%106 = getelementptr inbounds double, double* %14, i64 %105
%107 = load double, double* %106
%108 = mul nsw i64 %105, %20
%109 = add nuw nsw i64 %108, %33
%110 = getelementptr inbounds double, double* %0, i64 %109
store double %107, double* %110
%111 = add nuw nsw i64 %86, 4
%112 = add i64 %87, 4
%113 = icmp eq i64 %112, %30
br i1 %113, label %114, label %85
114: ; preds = %85, %84
%115 = phi i64 [ 0, %84 ], [ %111, %85 ]
br i1 %31, label %127, label %116
116: ; preds = %114, %116
%117 = phi i64 [ %124, %116 ], [ %115, %114 ]
%118 = phi i64 [ %125, %116 ], [ 0, %114 ]
%119 = getelementptr inbounds double, double* %14, i64 %117
%120 = load double, double* %119
%121 = mul nsw i64 %117, %20
%122 = add nuw nsw i64 %121, %33
%123 = getelementptr inbounds double, double* %0, i64 %122
store double %120, double* %123
%124 = add nuw nsw i64 %117, 1
%125 = add i64 %118, 1
%126 = icmp eq i64 %125, %28
br i1 %126, label %127, label %116
127: ; preds = %114, %116, %36, %81
%128 = phi double [ %38, %36 ], [ %83, %81 ], [ %83, %116 ], [ %83, %114 ]
%129 = add nuw nsw i64 %33, 1
%130 = icmp eq i64 %129, %21
br i1 %130, label %131, label %32
131: ; preds = %127, %6
ret void
}