#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*/ dgemm_(char *, char *, int *, int *, int *, double const *,
                          double *, int *, double *, int *, double const *,
                          double *, int *, int, int);
int /*<<< orphan*/ dpotrf_(char *, int *, double *, int *, int *, int);
int /*<<< orphan*/ dsyrk_(char *, char *, int *, int *, double const *,
                          double *, int *, double const *, double *, int *);
int /*<<< orphan*/ dtrsm_(char *, char *, char *, char *, int *, int *,
                          double const *, double *, int *, double *, int *, int,
                          int, int, 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++) {
    dpotrf_("L", &bs, A + k * bs + k * bs * n, &lda, info, 1);
    if (*info != 0)
      return;
    for (j = k + 1; j < nb; j++)
      dtrsm_("R", "L", "T", "N", &bs, &bs, &done, A + k * bs + k * bs * n, &lda,
             A + j * bs + k * bs * n, &lda, 1, 1, 1, 1);
    for (j = k + 1; j < nb; j++) {
      for (i = j + 1; i < nb; i++)
        dgemm_("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, 1, 1);
      dsyrk_("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    $0x90,%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    1489 <choleskyblk+0x349>
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
mov    $0x1,%r9d
call   1040 <dpotrf_@plt>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
je     11f9 <choleskyblk+0xb9>
jmp    1489 <choleskyblk+0x349>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12d4 <choleskyblk+0x194>
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    0xdad(%rip),%rdi
lea    0xda4(%rip),%rsi
lea    0xda1(%rip),%rdx
lea    0xd9c(%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)
movl   $0x1,0x28(%rsp)
movl   $0x1,0x30(%rsp)
movl   $0x1,0x38(%rsp)
movl   $0x1,0x40(%rsp)
call   1030 <dtrsm_@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1202 <choleskyblk+0xc2>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1476 <choleskyblk+0x336>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    13df <choleskyblk+0x29f>
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    0xc99(%rip),%rdi
lea    0xc90(%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)
movl   $0x1,0x38(%rsp)
movl   $0x1,0x40(%rsp)
call   1050 <dgemm_@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12f2 <choleskyblk+0x1b2>
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    0xbda(%rip),%rdi
lea    0xbd9(%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   1060 <dsyrk_@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12dd <choleskyblk+0x19d>
jmp    147b <choleskyblk+0x33b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1195 <choleskyblk+0x55>
add    $0x90,%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    $0x58,%rsp
mov    %rcx,0x30(%rsp)
mov    %edx,%ecx
mov    %edx,0xc(%rsp)
mov    %esi,%eax
cltd
idiv   %ecx
mov    %eax,%r13d
mov    %esi,0x18(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x28(%rsp)
movabs $0xbff0000000000000,%rax
mov    %rax,0x50(%rsp)
test   %r13d,%r13d
jle    1464 <choleskyblk+0x324>
mov    %esi,%ebp
mov    %rdi,%r12
lea    0xe68(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x18(%rsp),%rbx
mov    %r12,%rdx
mov    %rbx,%rcx
mov    %ebp,0x14(%rsp)
mov    0x30(%rsp),%rbp
mov    %rbp,%r8
mov    $0x1,%r9d
call   1040 <dpotrf_@plt>
cmpl   $0x0,0x0(%rbp)
mov    0x14(%rsp),%r14d
jne    1464 <choleskyblk+0x324>
xor    %eax,%eax
mov    %r12,0x38(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    %eax,0x10(%rsp)
cltq
add    $0x1,%rax
mov    %eax,%ebp
mov    %rax,0x20(%rsp)
cmp    %r13d,%eax
lea    0xe05(%rip),%r15
jge    1410 <choleskyblk+0x2d0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
mov    %eax,%ecx
imul   0x10(%rsp),%ecx
movslq %ecx,%rcx
lea    (%r12,%rcx,8),%rdx
imul   %r14d,%ecx
movslq %ecx,%rcx
lea    (%rdx,%rcx,8),%r10
imul   %ebp,%eax
cltq
lea    (%r12,%rax,8),%rax
lea    (%rax,%rcx,8),%rax
sub    $0x8,%rsp
lea    0xdbd(%rip),%rdi
mov    %r15,%rsi
lea    0xdb5(%rip),%rdx
lea    0xdb0(%rip),%rcx
lea    0x14(%rsp),%r8
mov    %r8,%r9
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   %rbx
push   %rax
push   %rbx
push   %r10
lea    0x70(%rsp),%rax
push   %rax
call   1030 <dtrsm_@plt>
add    $0x50,%rsp
add    $0x1,%ebp
cmp    %ebp,%r13d
jne    1210 <choleskyblk+0xd0>
cmp    %r13d,0x20(%rsp)
jge    1410 <choleskyblk+0x2d0>
mov    0x10(%rsp),%eax
imul   %r14d,%eax
mov    %eax,0x10(%rsp)
mov    0x20(%rsp),%r15
mov    %r15d,%edi
jmp    131f <choleskyblk+0x1df>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc(%rsp),%eax
imul   %eax,%edi
movslq %edi,%rcx
lea    (%r15,%rcx,8),%rdx
imul   0x10(%rsp),%eax
cltq
lea    (%rdx,%rax,8),%r9
imul   %r13d,%ecx
movslq %ecx,%rax
lea    (%rdx,%rax,8),%rax
lea    0xd25(%rip),%rdi
lea    0xd24(%rip),%rsi
lea    0xc(%rsp),%rcx
mov    %rcx,%rdx
mov    %r15,%r12
mov    %rbp,%r8
lea    0x18(%rsp),%rbx
push   %rbx
push   %rax
lea    0x38(%rsp),%rax
push   %rax
push   %rbx
call   1060 <dsyrk_@plt>
add    $0x20,%rsp
mov    0x1c(%rsp),%eax
mov    %eax,%edi
cmp    %r14d,%eax
mov    %r14d,%eax
mov    %r13d,%r14d
mov    %eax,%r13d
je     1410 <choleskyblk+0x2d0>
lea    0x1(%rdi),%eax
mov    %eax,0x1c(%rsp)
cmp    %r13d,%eax
mov    %r12,%r15
mov    %r13d,%eax
mov    %r14d,%r13d
mov    %eax,%r14d
lea    0xcc8(%rip),%rsi
lea    0x50(%rsp),%rbp
jge    12b0 <choleskyblk+0x170>
mov    0x1c(%rsp),%r12d
mov    %rdi,0x40(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%ecx
mov    %ecx,%eax
imul   %r12d,%eax
cltq
lea    (%r15,%rax,8),%rdx
mov    0x10(%rsp),%eax
imul   %ecx,%eax
cltq
lea    (%rdx,%rax,8),%rbx
mov    %rbx,0x48(%rsp)
imul   %edi,%ecx
movslq %ecx,%rcx
lea    (%r15,%rcx,8),%rdi
lea    (%rdi,%rax,8),%r11
imul   %r13d,%ecx
movslq %ecx,%rcx
lea    (%rdx,%rcx,8),%rax
sub    $0x8,%rsp
lea    0xc60(%rip),%rdi
lea    0x14(%rsp),%rcx
mov    %rcx,%rdx
mov    %rsi,%r15
mov    %rcx,%r8
mov    %rbp,%r9
push   $0x1
push   $0x1
lea    0x30(%rsp),%r10
push   %r10
push   %rax
mov    0x3c(%rsp),%r13d
lea    0x50(%rsp),%rbx
push   %rbx
push   %r10
push   %r11
push   %r10
push   0x90(%rsp)
call   1050 <dgemm_@plt>
mov    %r15,%rsi
mov    0x88(%rsp),%r15
mov    0x90(%rsp),%rdi
add    $0x50,%rsp
add    $0x1,%r12d
cmp    %r14d,%r12d
jl     1360 <choleskyblk+0x220>
jmp    12b0 <choleskyblk+0x170>
nopl   0x0(%rax)
mov    0x20(%rsp),%rbp
cmp    %r13d,%ebp
je     1464 <choleskyblk+0x324>
movslq 0xc(%rsp),%rax
imul   %rbp,%rax
lea    (%r12,%rax,8),%rcx
imul   %r14d,%eax
cltq
lea    (%rcx,%rax,8),%rdx
lea    0xbc8(%rip),%rdi
lea    0xc(%rsp),%rsi
mov    %rbx,%rcx
mov    0x30(%rsp),%r14
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <dpotrf_@plt>
cmpl   $0x0,(%r14)
mov    0x14(%rsp),%r14d
mov    %ebp,%eax
je     11e0 <choleskyblk+0xa0>
add    $0x58,%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 @dpotrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %7, double* %38, i32* %13, i32* %39, i32 1)
%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 @dtrsm_(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, i32 1, i32 1, i32 1, i32 1)
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 @dgemm_(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, i32 1, i32 1)
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 @dsyrk_(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 @dpotrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, double* %0, i32* %6, i32* %3, i32 1)
%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 @dpotrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, double* %27, i32* %6, i32* %3, i32 1)
%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 @dtrsm_(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, i32 1, i32 1, i32 1, i32 1)
%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 @dgemm_(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, i32 1, i32 1)
%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 @dsyrk_(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
}