#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*/ mydgemm(char *, char *, int *, int *, int *, double const *,
                           double *, int *, double *, int *, double const *,
                           double *, int *);
int /*<<< orphan*/ mydpotrf(char *, int *, double *, int *, int *);
int /*<<< orphan*/ mydsyrk(char *, char *, int *, int *, double const *,
                           double *, int *, double const *, double *, int *);
int /*<<< orphan*/ mydtrsm(char *, char *, char *, char *, int *, int *,
                           double const *, double *, int *, double *, int *);
void choleskyblk(double *A, int n, int bs, int *info) {
  int i, j, k, nb = n / bs, lda = n;
  const double done = 1.0, dmone = -1.0, dzero = 0.0;
  for (k = 0; k < nb; k++) {
    mydpotrf("L", &bs, A + k * bs + k * bs * n, &lda, info);
    if (*info != 0)
      return;
    for (j = k + 1; j < nb; j++)
      mydtrsm("R", "L", "T", "N", &bs, &bs, &done, A + k * bs + k * bs * n,
              &lda, A + j * bs + k * bs * n, &lda);
    for (j = k + 1; j < nb; j++) {
      for (i = j + 1; i < nb; i++)
        mydgemm("N", "T", &bs, &bs, &bs, &dmone, A + i * bs + k * bs * n, &lda,
                A + j * bs + k * bs * n, &lda, &done, A + i * bs + j * bs * n,
                &lda);
      mydsyrk("L", "N", &bs, &bs, &dmone, A + j * bs + k * bs * n, &lda, &done,
              A + j * bs + j * bs * n, &lda);
    }
  }
}


x86 assembly (clang, -O0):
<choleskyblk>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %edx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movsd  0xe94(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe7f(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1453 <choleskyblk+0x313>
mov    -0x18(%rbp),%rdx
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x28(%rbp),%r8
lea    0xe3c(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x3c(%rbp),%rcx
call   1060 <mydpotrf@plt>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
je     11f3 <choleskyblk+0xb3>
jmp    1453 <choleskyblk+0x313>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12ae <choleskyblk+0x16e>
mov    -0x18(%rbp),%r11
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r11
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r11
mov    -0x18(%rbp),%r10
mov    -0x30(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
lea    0xdb3(%rip),%rdi
lea    0xdaa(%rip),%rsi
lea    0xda7(%rip),%rdx
lea    0xda2(%rip),%rcx
lea    -0x20(%rbp),%r9
lea    -0x48(%rbp),%rbx
lea    -0x3c(%rbp),%rax
mov    %r9,%r8
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %rax,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1040 <mydtrsm@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11fc <choleskyblk+0xbc>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1440 <choleskyblk+0x300>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    13a9 <choleskyblk+0x269>
mov    -0x18(%rbp),%r14
mov    -0x2c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r14
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r14
mov    -0x18(%rbp),%rbx
mov    -0x30(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rbx
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rbx
mov    -0x18(%rbp),%r10
mov    -0x2c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    -0x30(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
lea    0xcbf(%rip),%rdi
lea    0xcb6(%rip),%rsi
lea    -0x20(%rbp),%r8
lea    -0x50(%rbp),%r9
lea    -0x3c(%rbp),%rax
lea    -0x48(%rbp),%r11
mov    %r8,%rdx
mov    %r8,%rcx
mov    %r14,(%rsp)
mov    %rax,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %rax,0x18(%rsp)
mov    %r11,0x20(%rsp)
mov    %r10,0x28(%rsp)
mov    %rax,0x30(%rsp)
call   1030 <mydgemm@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12cc <choleskyblk+0x18c>
mov    -0x18(%rbp),%r9
mov    -0x30(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r9
mov    -0x34(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r9
mov    -0x18(%rbp),%r10
mov    -0x30(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
mov    -0x30(%rbp),%eax
imul   -0x20(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
lea    0xc10(%rip),%rdi
lea    0xc0f(%rip),%rsi
lea    -0x20(%rbp),%rcx
lea    -0x50(%rbp),%r8
lea    -0x3c(%rbp),%rax
lea    -0x48(%rbp),%r11
mov    %rcx,%rdx
mov    %rax,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1050 <mydsyrk@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12b7 <choleskyblk+0x177>
jmp    1445 <choleskyblk+0x305>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1195 <choleskyblk+0x55>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<choleskyblk>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rcx,0x28(%rsp)
mov    %edx,%ecx
mov    %edx,0x8(%rsp)
mov    %esi,%eax
cltd
idiv   %ecx
mov    %eax,%r12d
mov    %esi,0x10(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x40(%rsp)
movabs $0xbff0000000000000,%rax
mov    %rax,0x38(%rsp)
test   %r12d,%r12d
jle    141d <choleskyblk+0x2dd>
mov    %rdi,%r14
lea    0xe6a(%rip),%rdi
mov    %esi,%r15d
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rbx
mov    %r14,%rdx
mov    %rbx,%rcx
mov    0x28(%rsp),%rbp
mov    %rbp,%r8
call   1060 <mydpotrf@plt>
cmpl   $0x0,0x0(%rbp)
jne    141d <choleskyblk+0x2dd>
mov    %r15d,%esi
xor    %eax,%eax
lea    0x40(%rsp),%r15
mov    %esi,0x18(%rsp)
mov    %r12d,0x1c(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,0xc(%rsp)
cltq
add    $0x1,%rax
mov    %eax,%ebp
mov    %rax,0x20(%rsp)
cmp    %r12d,%eax
jge    13d0 <choleskyblk+0x290>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%eax
mov    %eax,%ecx
imul   0xc(%rsp),%ecx
movslq %ecx,%rcx
lea    (%r14,%rcx,8),%rdx
imul   %esi,%ecx
movslq %ecx,%rcx
lea    (%rdx,%rcx,8),%r10
imul   %ebp,%eax
cltq
lea    (%r14,%rax,8),%rax
lea    (%rax,%rcx,8),%rax
sub    $0x8,%rsp
lea    0xdce(%rip),%rdi
mov    %esi,%r13d
lea    0xdc2(%rip),%rsi
lea    0xdbf(%rip),%rdx
lea    0xdba(%rip),%rcx
lea    0x10(%rsp),%r8
mov    %r8,%r9
push   %rbx
push   %rax
push   %rbx
push   %r10
push   %r15
call   1040 <mydtrsm@plt>
mov    %r13d,%esi
add    $0x30,%rsp
add    $0x1,%ebp
cmp    %ebp,%r12d
jne    1200 <choleskyblk+0xc0>
cmp    %r12d,0x20(%rsp)
jge    13d0 <choleskyblk+0x290>
mov    0xc(%rsp),%eax
imul   %esi,%eax
mov    %eax,0xc(%rsp)
mov    0x20(%rsp),%r13
mov    %r13d,%r8d
jmp    1301 <choleskyblk+0x1c1>
nop
mov    0x8(%rsp),%eax
imul   %eax,%r8d
movslq %r8d,%rcx
lea    (%r15,%rcx,8),%rdx
imul   0xc(%rsp),%eax
cltq
lea    (%rdx,%rax,8),%rbx
imul   %r13d,%ecx
movslq %ecx,%rax
lea    (%rdx,%rax,8),%rax
lea    0xd44(%rip),%rdi
lea    0xd43(%rip),%rsi
lea    0x8(%rsp),%rcx
mov    %rcx,%rdx
mov    %r9,%r8
mov    %rbx,%r9
lea    0x10(%rsp),%rbx
push   %rbx
push   %rax
push   %rbp
push   %rbx
call   1050 <mydsyrk@plt>
add    $0x20,%rsp
mov    0x14(%rsp),%eax
mov    %eax,%r8d
mov    0x1c(%rsp),%r12d
cmp    %r12d,%eax
mov    %r13d,%esi
mov    %r15,%r14
mov    %rbp,%r15
je     13d0 <choleskyblk+0x290>
lea    0x1(%r8),%eax
mov    %eax,0x14(%rsp)
cmp    %r12d,%eax
mov    %esi,%r13d
mov    %r15,%rbp
mov    %r14,%r15
lea    0xce8(%rip),%rsi
lea    0x38(%rsp),%r9
jge    1290 <choleskyblk+0x150>
mov    0x14(%rsp),%r12d
nopl   0x0(%rax)
mov    0x8(%rsp),%eax
mov    %eax,%ecx
imul   %r12d,%ecx
movslq %ecx,%rcx
lea    (%r15,%rcx,8),%rcx
mov    0xc(%rsp),%edx
imul   %eax,%edx
movslq %edx,%rdx
lea    (%rcx,%rdx,8),%rdi
mov    %rdi,0x30(%rsp)
imul   %r8d,%eax
cltq
lea    (%r15,%rax,8),%rdi
lea    (%rdi,%rdx,8),%r11
imul   %r13d,%eax
cltq
lea    (%rcx,%rax,8),%rax
sub    $0x8,%rsp
lea    0xc8f(%rip),%rdi
lea    0x10(%rsp),%rcx
mov    %rcx,%rdx
mov    %r8,%r14
mov    %rcx,%r8
mov    %rsi,%r13
lea    0x18(%rsp),%r10
push   %r10
push   %rax
push   %rbp
push   %r10
push   %r11
push   %r10
push   0x68(%rsp)
mov    %r9,%rbx
call   1030 <mydgemm@plt>
mov    %r13,%rsi
mov    %r14,%r8
mov    %rbx,%r9
mov    0x58(%rsp),%r13d
add    $0x40,%rsp
add    $0x1,%r12d
cmp    0x1c(%rsp),%r12d
jl     1330 <choleskyblk+0x1f0>
jmp    1290 <choleskyblk+0x150>
nopl   0x0(%rax)
mov    0x20(%rsp),%rbp
cmp    %r12d,%ebp
je     141d <choleskyblk+0x2dd>
movslq 0x8(%rsp),%rax
imul   %rbp,%rax
lea    (%r14,%rax,8),%rcx
imul   %esi,%eax
cltq
lea    (%rcx,%rax,8),%rdx
lea    0xc09(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rbx,%rcx
mov    0x28(%rsp),%r13
mov    %r13,%r8
call   1060 <mydpotrf@plt>
mov    0x18(%rsp),%esi
cmpl   $0x0,0x0(%r13)
mov    %ebp,%eax
je     11e0 <choleskyblk+0xa0>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"L\00"
@.str.1 = [2 x i8] c"R\00"
@.str.2 = [2 x i8] c"T\00"
@.str.3 = [2 x i8] c"N\00"
define void @choleskyblk(double* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
store i32 %2, i32* %5
%9 = sdiv i32 %1, %2
%10 = bitcast i32* %6 to i8*
store i32 %1, i32* %6
%11 = bitcast double* %7 to i8*
store double 1.000000e+00, double* %7
%12 = bitcast double* %8 to i8*
store double -1.000000e+00, double* %8
%13 = icmp sgt i32 %9, 0
br i1 %13, label %14, label %90
14: ; preds = %4
%15 = call i32 @mydpotrf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, double* %0, i32* %6, i32* %3)
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 0
br i1 %17, label %31, label %90
18: ; preds = %77, %31, %35
%19 = icmp eq i32 %33, %9
br i1 %19, label %90, label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = mul nsw i32 %21, %33
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds double, double* %0, i64 %23
%25 = mul nsw i32 %22, %1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds double, double* %24, i64 %26
%28 = call i32 @mydpotrf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, double* %27, i32* %6, i32* %3)
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %90
31: ; preds = %14, %20
%32 = phi i32 [ %33, %20 ], [ 0, %14 ]
%33 = add nuw nsw i32 %32, 1
%34 = icmp slt i32 %33, %9
br i1 %34, label %38, label %18
35: ; preds = %38
br i1 %34, label %36, label %18
36: ; preds = %35
%37 = mul i32 %32, %1
br label %54
38: ; preds = %31, %38
%39 = phi i32 [ %52, %38 ], [ %33, %31 ]
%40 = load i32, i32* %5
%41 = mul nsw i32 %40, %32
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %0, i64 %42
%44 = mul nsw i32 %41, %1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = mul nsw i32 %40, %39
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %0, i64 %48
%50 = getelementptr inbounds double, double* %49, i64 %45
%51 = call i32 @mydtrsm(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %5, double* %7, double* %46, i32* %6, double* %50, i32* %6)
%52 = add nuw i32 %39, 1
%53 = icmp eq i32 %52, %9
br i1 %53, label %35, label %38
54: ; preds = %36, %77
%55 = phi i32 [ %33, %36 ], [ %56, %77 ]
%56 = add nuw i32 %55, 1
%57 = icmp slt i32 %56, %9
br i1 %57, label %58, label %77
58: ; preds = %54, %58
%59 = phi i32 [ %75, %58 ], [ %56, %54 ]
%60 = load i32, i32* %5
%61 = mul nsw i32 %60, %59
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %0, i64 %62
%64 = mul i32 %37, %60
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
%67 = mul nsw i32 %60, %55
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %0, i64 %68
%70 = getelementptr inbounds double, double* %69, i64 %65
%71 = mul nsw i32 %67, %1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %63, i64 %72
%74 = call i32 @mydgemm(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %5, i32* %5, i32* %5, double* %8, double* %66, i32* %6, double* %70, i32* %6, double* %7, double* %73, i32* %6)
%75 = add nuw nsw i32 %59, 1
%76 = icmp slt i32 %75, %9
br i1 %76, label %58, label %77
77: ; preds = %58, %54
%78 = load i32, i32* %5
%79 = mul nsw i32 %78, %55
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %0, i64 %80
%82 = mul i32 %37, %78
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
%85 = mul nsw i32 %79, %1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double, double* %81, i64 %86
%88 = call i32 @mydsyrk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %5, double* %8, double* %84, i32* %6, double* %7, double* %87, i32* %6)
%89 = icmp eq i32 %56, %9
br i1 %89, label %18, label %54
90: ; preds = %18, %20, %14, %4
ret void
}