#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 choleskytile(double *A, int n, int bs, int *info) {
  int i, j, k, nb = n / bs, lda = bs, bs2 = bs * bs;
  const double done = 1.0, dmone = -1.0, dzero = 0.0;
  for (k = 0; k < nb; k++) {
    dpotrf_("L", &bs, A + (k + k * nb) * bs2, &lda, info, 1);
    if (*info != 0)
      return;
    for (j = k + 1; j < nb; j++)
      dtrsm_("R", "L", "T", "N", &bs, &bs, &done, A + (k + k * nb) * bs2, &lda,
             A + (j + k * nb) * bs2, &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 + k * nb) * bs2, &lda,
               A + (j + k * nb) * bs2, &lda, &done, A + (i + j * nb) * bs2,
               &lda, 1, 1);
      dsyrk_("L", "N", &bs, &bs, &dmone, A + (j + k * nb) * bs2, &lda, &done,
             A + (j + j * nb) * bs2, &lda);
    }
  }
}


x86 assembly (clang, -O0):
<choleskytile>:
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    -0x20(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%eax
imul   -0x20(%rbp),%eax
mov    %eax,-0x40(%rbp)
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xe75(%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    143b <choleskytile+0x2fb>
mov    -0x18(%rbp),%rdx
mov    -0x34(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x28(%rbp),%r8
lea    0xe3d(%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     11f8 <choleskytile+0xb8>
jmp    143b <choleskytile+0x2fb>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    12bd <choleskytile+0x17d>
mov    -0x18(%rbp),%r11
mov    -0x34(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r11
mov    -0x18(%rbp),%r10
mov    -0x30(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
lea    0xdc4(%rip),%rdi
lea    0xdbb(%rip),%rsi
lea    0xdb8(%rip),%rdx
lea    0xdb3(%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    1201 <choleskytile+0xc1>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1428 <choleskytile+0x2e8>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    13a7 <choleskytile+0x267>
mov    -0x18(%rbp),%r14
mov    -0x2c(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r14
mov    -0x18(%rbp),%rbx
mov    -0x30(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rbx
mov    -0x18(%rbp),%r10
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
lea    0xcd1(%rip),%rdi
lea    0xcc8(%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    12db <choleskytile+0x19b>
mov    -0x18(%rbp),%r9
mov    -0x30(%rbp),%eax
mov    -0x34(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r9
mov    -0x18(%rbp),%r10
mov    -0x30(%rbp),%eax
mov    -0x30(%rbp),%ecx
imul   -0x38(%rbp),%ecx
add    %ecx,%eax
imul   -0x40(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r10
lea    0xc28(%rip),%rdi
lea    0xc27(%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    12c6 <choleskytile+0x186>
jmp    142d <choleskytile+0x2ed>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    119f <choleskytile+0x5f>
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<choleskytile>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rcx,0xa0(%rsp)
mov    %edx,%ecx
mov    %esi,%eax
mov    %rdi,0x10(%rsp)
mov    %edx,0x4(%rsp)
cltd
idiv   %ecx
mov    %ecx,%edx
mov    %ecx,0x8(%rsp)
movabs $0x3ff0000000000000,%rcx
mov    %rcx,0x98(%rsp)
movabs $0xbff0000000000000,%rcx
mov    %rcx,0xc0(%rsp)
mov    %eax,0xc(%rsp)
test   %eax,%eax
jle    151d <choleskytile+0x3dd>
imul   %edx,%edx
mov    %edx,0x4c(%rsp)
mov    %edx,%ecx
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%rax
lea    (%rax,%rcx,8),%rax
mov    %rax,0x60(%rsp)
lea    0x1(%rdx),%rax
imul   %rcx,%rax
shl    $0x3,%rax
mov    %rax,0x78(%rsp)
mov    %rcx,0x28(%rsp)
lea    0x0(,%rcx,8),%r13
mov    $0x1,%ebp
movl   $0x2,0x1c(%rsp)
xor    %eax,%eax
mov    %rax,0x58(%rsp)
lea    0xe0d(%rip),%r12
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%r8
mov    %rdx,0x20(%rsp)
mov    %rdx,0x50(%rsp)
xor    %eax,%eax
mov    %r13,0x40(%rsp)
jmp    124a <choleskytile+0x10a>
mov    0x30(%rsp),%rbp
add    $0x1,%rbp
addl   $0x1,0x1c(%rsp)
mov    0x78(%rsp),%rax
add    %rax,0x60(%rsp)
add    %rdi,0x50(%rsp)
add    %rdi,0x58(%rsp)
mov    0x68(%rsp),%rax
cmp    %rdi,%rax
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%r8
je     151d <choleskytile+0x3dd>
mov    %rax,%rbx
mov    0xc(%rsp),%eax
imul   %ebx,%eax
cltq
add    %rbx,%rax
imul   0x28(%rsp),%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%rdx
mov    %r12,%rdi
mov    %rdx,%r15
mov    %r8,%rcx
mov    0xa0(%rsp),%r14
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <dpotrf_@plt>
cmpl   $0x0,(%r14)
jne    151d <choleskytile+0x3dd>
mov    %rbp,0x30(%rsp)
lea    0x1(%rbx),%rax
mov    %rax,0x68(%rsp)
mov    0x20(%rsp),%rdi
cmp    %rdi,%rax
jae    1210 <choleskytile+0xd0>
movslq 0x1c(%rsp),%rsi
mov    0x50(%rsp),%rax
add    %rsi,%rax
mov    0x28(%rsp),%rdx
imul   %rdx,%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,0x38(%rsp)
mov    0x58(%rsp),%rax
mov    %rsi,0x88(%rsp)
add    %rsi,%rax
imul   %rdx,%rax
lea    (%rcx,%rax,8),%rax
mov    %rax,0x80(%rsp)
imul   %rdi,%rbx
mov    %rbx,0x70(%rsp)
mov    %rdi,%rbx
mov    0x60(%rsp),%rbp
lea    0x4(%rsp),%r13
lea    0x8(%rsp),%r14
nopl   0x0(%rax)
sub    $0x8,%rsp
lea    0xce7(%rip),%rdi
mov    %r12,%rsi
lea    0xcdf(%rip),%rdx
lea    0xcda(%rip),%rcx
mov    %r13,%r8
mov    %r13,%r9
push   $0x1
push   $0x1
push   $0x1
push   $0x1
push   %r14
push   %rbp
push   %r14
push   %r15
lea    0xe0(%rsp),%rax
push   %rax
call   1030 <dtrsm_@plt>
add    $0x50,%rsp
add    0x40(%rsp),%rbp
add    $0xffffffffffffffff,%rbx
cmp    %rbx,0x30(%rsp)
jne    1310 <choleskytile+0x1d0>
mov    0x30(%rsp),%rdx
mov    0x20(%rsp),%rdi
cmp    %rdi,0x68(%rsp)
mov    0x70(%rsp),%rax
jb     1426 <choleskytile+0x2e6>
jmp    1210 <choleskytile+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x10(%rsp),%rdi
mov    0x90(%rsp),%rax
lea    (%rdi,%rax,8),%r9
mov    0xc(%rsp),%eax
mov    0xa8(%rsp),%rsi
imul   %esi,%eax
add    %esi,%eax
imul   0x4c(%rsp),%eax
cltq
lea    (%rdi,%rax,8),%rax
lea    0xc3c(%rip),%r12
mov    %r12,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r11,%r8
push   %r14
push   %rax
push   %r10
push   %r14
call   1060 <dsyrk_@plt>
add    $0x20,%rsp
addq   $0x1,0x88(%rsp)
mov    0x38(%rsp),%rax
add    0x78(%rsp),%rax
mov    %rax,0x38(%rsp)
mov    0x40(%rsp),%r13
add    %r13,0x80(%rsp)
mov    0xb0(%rsp),%rax
mov    %rax,%rdx
mov    0x20(%rsp),%rcx
cmp    %rcx,%rax
mov    %rcx,%rdi
mov    0x70(%rsp),%rax
je     1210 <choleskytile+0xd0>
lea    0x1(%rdx),%rcx
mov    %rdx,0xa8(%rsp)
add    %rdx,%rax
imul   0x28(%rsp),%rax
mov    %rax,0x90(%rsp)
mov    %rcx,0xb0(%rsp)
cmp    %rdi,%rcx
lea    0x4(%rsp),%rcx
lea    0x8(%rsp),%r14
lea    0x98(%rsp),%r10
lea    0xb9d(%rip),%rbx
lea    0xb98(%rip),%rdx
lea    0xc0(%rsp),%r11
jae    1390 <choleskytile+0x250>
mov    0x10(%rsp),%rax
mov    0x90(%rsp),%rsi
lea    (%rax,%rsi,8),%rax
mov    %rax,0xb8(%rsp)
mov    0x80(%rsp),%r13
mov    0x38(%rsp),%r15
mov    0x88(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
sub    $0x8,%rsp
mov    %rdx,%rdi
mov    %rbx,%rsi
mov    %rcx,%rdx
lea    0xc(%rsp),%r8
mov    %r11,%r9
push   $0x1
push   $0x1
push   %r14
push   %r15
push   %r10
push   %r14
push   0xf0(%rsp)
push   %r14
push   %r13
mov    %r10,%r12
mov    %r11,%r14
call   1050 <dgemm_@plt>
lea    0x54(%rsp),%rcx
mov    %r14,%r11
lea    0x58(%rsp),%r14
mov    %r12,%r10
lea    0xb08(%rip),%rdx
add    $0x50,%rsp
add    $0x1,%rbp
mov    0x40(%rsp),%rax
add    %rax,%r15
add    %rax,%r13
cmp    0x20(%rsp),%rbp
jl     14b0 <choleskytile+0x370>
jmp    1390 <choleskytile+0x250>
add    $0xc8,%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 @choleskytile(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 i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = sdiv i32 %18, %19
store i32 %20, i32* %12
%21 = load i32, i32* %7
store i32 %21, i32* %13
%22 = load i32, i32* %7
%23 = load i32, i32* %7
%24 = mul nsw i32 %22, %23
store i32 %24, i32* %14
store double 1.000000e+00, double* %15
store double -1.000000e+00, double* %16
store double 0.000000e+00, double* %17
store i32 0, i32* %11
br label %25
25: ; preds = %153, %4
%26 = load i32, i32* %11
%27 = load i32, i32* %12
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %156
29: ; preds = %25
%30 = load double*, double** %5
%31 = load i32, i32* %11
%32 = load i32, i32* %11
%33 = load i32, i32* %12
%34 = mul nsw i32 %32, %33
%35 = add nsw i32 %31, %34
%36 = load i32, i32* %14
%37 = mul nsw i32 %35, %36
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %30, i64 %38
%40 = load i32*, i32** %8
%41 = call i32 @dpotrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %7, double* %39, i32* %13, i32* %40, i32 1)
%42 = load i32*, i32** %8
%43 = load i32, i32* %42
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %46
45: ; preds = %29
br label %156
46: ; preds = %29
%47 = load i32, i32* %11
%48 = add nsw i32 %47, 1
store i32 %48, i32* %10
br label %49
49: ; preds = %75, %46
%50 = load i32, i32* %10
%51 = load i32, i32* %12
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %78
53: ; preds = %49
%54 = load double*, double** %5
%55 = load i32, i32* %11
%56 = load i32, i32* %11
%57 = load i32, i32* %12
%58 = mul nsw i32 %56, %57
%59 = add nsw i32 %55, %58
%60 = load i32, i32* %14
%61 = mul nsw i32 %59, %60
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %54, i64 %62
%64 = load double*, double** %5
%65 = load i32, i32* %10
%66 = load i32, i32* %11
%67 = load i32, i32* %12
%68 = mul nsw i32 %66, %67
%69 = add nsw i32 %65, %68
%70 = load i32, i32* %14
%71 = mul nsw i32 %69, %70
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %64, i64 %72
%74 = 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* %15, double* %63, i32* %13, double* %73, i32* %13, i32 1, i32 1, i32 1, i32 1)
br label %75
75: ; preds = %53
%76 = load i32, i32* %10
%77 = add nsw i32 %76, 1
store i32 %77, i32* %10
br label %49
78: ; preds = %49
%79 = load i32, i32* %11
%80 = add nsw i32 %79, 1
store i32 %80, i32* %10
br label %81
81: ; preds = %149, %78
%82 = load i32, i32* %10
%83 = load i32, i32* %12
%84 = icmp slt i32 %82, %83
br i1 %84, label %85, label %152
85: ; preds = %81
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %9
br label %88
88: ; preds = %124, %85
%89 = load i32, i32* %9
%90 = load i32, i32* %12
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %127
92: ; preds = %88
%93 = load double*, double** %5
%94 = load i32, i32* %9
%95 = load i32, i32* %11
%96 = load i32, i32* %12
%97 = mul nsw i32 %95, %96
%98 = add nsw i32 %94, %97
%99 = load i32, i32* %14
%100 = mul nsw i32 %98, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds double, double* %93, i64 %101
%103 = load double*, double** %5
%104 = load i32, i32* %10
%105 = load i32, i32* %11
%106 = load i32, i32* %12
%107 = mul nsw i32 %105, %106
%108 = add nsw i32 %104, %107
%109 = load i32, i32* %14
%110 = mul nsw i32 %108, %109
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %103, i64 %111
%113 = load double*, double** %5
%114 = load i32, i32* %9
%115 = load i32, i32* %10
%116 = load i32, i32* %12
%117 = mul nsw i32 %115, %116
%118 = add nsw i32 %114, %117
%119 = load i32, i32* %14
%120 = mul nsw i32 %118, %119
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds double, double* %113, i64 %121
%123 = 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* %16, double* %102, i32* %13, double* %112, i32* %13, double* %15, double* %122, i32* %13, i32 1, i32 1)
br label %124
124: ; preds = %92
%125 = load i32, i32* %9
%126 = add nsw i32 %125, 1
store i32 %126, i32* %9
br label %88
127: ; preds = %88
%128 = load double*, double** %5
%129 = load i32, i32* %10
%130 = load i32, i32* %11
%131 = load i32, i32* %12
%132 = mul nsw i32 %130, %131
%133 = add nsw i32 %129, %132
%134 = load i32, i32* %14
%135 = mul nsw i32 %133, %134
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds double, double* %128, i64 %136
%138 = load double*, double** %5
%139 = load i32, i32* %10
%140 = load i32, i32* %10
%141 = load i32, i32* %12
%142 = mul nsw i32 %140, %141
%143 = add nsw i32 %139, %142
%144 = load i32, i32* %14
%145 = mul nsw i32 %143, %144
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %138, i64 %146
%148 = 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* %16, double* %137, i32* %13, double* %15, double* %147, i32* %13)
br label %149
149: ; preds = %127
%150 = load i32, i32* %10
%151 = add nsw i32 %150, 1
store i32 %151, i32* %10
br label %81
152: ; preds = %81
br label %153
153: ; preds = %152
%154 = load i32, i32* %11
%155 = add nsw i32 %154, 1
store i32 %155, i32* %11
br label %25
156: ; preds = %45, %25
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 @choleskytile(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 %2, i32* %6
%11 = mul nsw i32 %2, %2
%12 = bitcast double* %7 to i8*
store double 1.000000e+00, double* %7
%13 = bitcast double* %8 to i8*
store double -1.000000e+00, double* %8
%14 = icmp sgt i32 %9, 0
br i1 %14, label %15, label %82
15: ; preds = %4
%16 = zext i32 %11 to i64
%17 = zext i32 %9 to i64
%18 = zext i32 %9 to i64
br label %23
19: ; preds = %72, %38, %41
%20 = add nuw nsw i64 %26, 1
%21 = add nuw i32 %25, 1
%22 = icmp eq i64 %39, %18
br i1 %22, label %82, label %23
23: ; preds = %15, %19
%24 = phi i64 [ 0, %15 ], [ %39, %19 ]
%25 = phi i32 [ 2, %15 ], [ %21, %19 ]
%26 = phi i64 [ 1, %15 ], [ %20, %19 ]
%27 = trunc i64 %24 to i32
%28 = sext i32 %25 to i64
%29 = mul nsw i64 %24, %17
%30 = mul nsw i32 %9, %27
%31 = sext i32 %30 to i64
%32 = add nsw i64 %24, %31
%33 = mul nsw i64 %32, %16
%34 = getelementptr inbounds double, double* %0, i64 %33
%35 = call i32 @dpotrf_(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32* %5, double* %34, i32* %6, i32* %3, i32 1)
%36 = load i32, i32* %3
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %82
38: ; preds = %23
%39 = add nuw nsw i64 %24, 1
%40 = icmp ult i64 %39, %17
br i1 %40, label %42, label %19
41: ; preds = %42
br i1 %40, label %50, label %19
42: ; preds = %38, %42
%43 = phi i64 [ %48, %42 ], [ %26, %38 ]
%44 = add nuw nsw i64 %43, %29
%45 = mul nsw i64 %44, %16
%46 = getelementptr inbounds double, double* %0, i64 %45
%47 = 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* %34, i32* %6, double* %46, i32* %6, i32 1, i32 1, i32 1, i32 1)
%48 = add nuw nsw i64 %43, 1
%49 = icmp eq i64 %48, %18
br i1 %49, label %41, label %42
50: ; preds = %41, %72
%51 = phi i64 [ %54, %72 ], [ %26, %41 ]
%52 = phi i64 [ %80, %72 ], [ %28, %41 ]
%53 = trunc i64 %51 to i32
%54 = add nuw nsw i64 %51, 1
%55 = icmp ult i64 %54, %17
%56 = add nuw nsw i64 %51, %29
%57 = mul nsw i64 %56, %16
br i1 %55, label %58, label %72
58: ; preds = %50
%59 = getelementptr inbounds double, double* %0, i64 %57
%60 = mul nsw i64 %51, %17
br label %61
61: ; preds = %58, %61
%62 = phi i64 [ %52, %58 ], [ %70, %61 ]
%63 = add nsw i64 %62, %29
%64 = mul nsw i64 %63, %16
%65 = getelementptr inbounds double, double* %0, i64 %64
%66 = add nsw i64 %62, %60
%67 = mul nsw i64 %66, %16
%68 = getelementptr inbounds double, double* %0, i64 %67
%69 = 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* %65, i32* %6, double* %59, i32* %6, double* %7, double* %68, i32* %6, i32 1, i32 1)
%70 = add nsw i64 %62, 1
%71 = icmp slt i64 %70, %17
br i1 %71, label %61, label %72
72: ; preds = %61, %50
%73 = getelementptr inbounds double, double* %0, i64 %57
%74 = mul nsw i32 %9, %53
%75 = add nsw i32 %74, %53
%76 = mul nsw i32 %75, %11
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %0, i64 %77
%79 = 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* %73, i32* %6, double* %7, double* %78, i32* %6)
%80 = add nsw i64 %52, 1
%81 = icmp eq i64 %54, %18
br i1 %81, label %19, label %50
82: ; preds = %23, %19, %4
ret void
}