#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*/ chol_backward(double *, int, double *, double *, double *);
int /*<<< orphan*/ chol_forward(double *, int, double *, double *, double *);
int /*<<< orphan*/ choldc(double *, int, double *);
int /*<<< orphan*/ cholsb(double *, int, double *, double *, double *);
void solve_reduced(int n, int m, double h_x[], double h_y[], double a[],
                   double x_x[], double x_y[], double c_x[], double c_y[],
                   double workspace[], int step) {
  int i, j, k;
  double *p_x;
  double *p_y;
  double *t_a;
  double *t_c;
  double *t_y;
  p_x = workspace;
  p_y = p_x + n;
  t_a = p_y + m;
  t_c = t_a + n * m;
  t_y = t_c + n;
  if (step == 1) {
    choldc(h_x, n, p_x);
    for (i = 0; i < m; i++)
      chol_forward(h_x, n, p_x, a + i * n, t_a + i * n);
    for (i = 0; i < m; i++)
      for (j = i; j < m; j++)
        for (k = 0; k < n; k++)
          h_y[m * i + j] += t_a[n * j + k] * t_a[n * i + k];
    choldc(h_y, m, p_y);
  }
  chol_forward(h_x, n, p_x, c_x, t_c);
  for (i = 0; i < m; i++) {
    t_y[i] = c_y[i];
    for (j = 0; j < n; j++)
      t_y[i] += t_a[i * n + j] * t_c[j];
  }
  cholsb(h_y, m, p_y, t_y, x_y);
  for (i = 0; i < n; i++) {
    t_c[i] = -t_c[i];
    for (j = 0; j < m; j++)
      t_c[i] += t_a[j * n + i] * x_y[j];
  }
  chol_backward(h_x, n, p_x, t_c, x_x);
}


x86 assembly (clang, -O0):
<solve_reduced>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x4(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x60(%rbp)
cmpl   $0x1,0x30(%rbp)
jne    1309 <solve_reduced+0x1c9>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x40(%rbp),%rdx
call   1030 <choldc@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    123e <solve_reduced+0xfe>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x2c(%rbp),%eax
imul   -0x4(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x50(%rbp),%r8
mov    -0x2c(%rbp),%eax
imul   -0x4(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
call   1050 <chol_forward@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ec <solve_reduced+0xac>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12f9 <solve_reduced+0x1b9>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e6 <solve_reduced+0x1a6>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12d3 <solve_reduced+0x193>
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
mov    -0x4(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x34(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   -0x2c(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    126a <solve_reduced+0x12a>
jmp    12d8 <solve_reduced+0x198>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1257 <solve_reduced+0x117>
jmp    12eb <solve_reduced+0x1ab>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1245 <solve_reduced+0x105>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x48(%rbp),%rdx
call   1030 <choldc@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    0x18(%rbp),%rcx
mov    -0x58(%rbp),%r8
call   1050 <chol_forward@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    13bf <solve_reduced+0x27f>
mov    0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13ac <solve_reduced+0x26c>
mov    -0x50(%rbp),%rax
mov    -0x2c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x30(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x60(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1355 <solve_reduced+0x215>
jmp    13b1 <solve_reduced+0x271>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1328 <solve_reduced+0x1e8>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x48(%rbp),%rdx
mov    -0x60(%rbp),%rcx
mov    0x10(%rbp),%r8
call   1060 <cholsb@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    148c <solve_reduced+0x34c>
mov    -0x58(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1479 <solve_reduced+0x339>
mov    -0x50(%rbp),%rax
mov    -0x30(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x58(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1422 <solve_reduced+0x2e2>
jmp    147e <solve_reduced+0x33e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13de <solve_reduced+0x29e>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1040 <chol_backward@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_reduced>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9,0x70(%rsp)
mov    %rcx,%r15
mov    %rdx,%rbp
mov    %esi,%ebx
mov    %edi,%esi
mov    0xc8(%rsp),%rdx
mov    0xc0(%rsp),%rax
mov    %rax,0x60(%rsp)
mov    0xb8(%rsp),%rcx
mov    0xb0(%rsp),%rax
mov    %rax,0x68(%rsp)
movslq %edi,%rax
mov    %rax,0x8(%rsp)
lea    (%rdx,%rax,8),%rdi
movslq %ebx,%rax
mov    %rax,0x28(%rsp)
mov    %rdi,0x40(%rsp)
lea    (%rdi,%rax,8),%rdi
mov    %ebx,%eax
imul   %esi,%eax
cmpl   $0x1,0xd0(%rsp)
01
cltq
mov    %rdi,0x30(%rsp)
mov    %rax,0x58(%rsp)
lea    (%rdi,%rax,8),%r14
mov    %ebx,%r13d
mov    %esi,%eax
mov    %rax,0x20(%rsp)
mov    %rbp,0x38(%rsp)
mov    %esi,0x4(%rsp)
mov    %rdx,0x18(%rsp)
mov    %ebx,0x14(%rsp)
jne    1376 <solve_reduced+0x236>
mov    %r8,%r12
mov    %rcx,0x50(%rsp)
mov    %rbp,%rdi
call   1030 <choldc@plt>
mov    0x4(%rsp),%esi
test   %ebx,%ebx
jle    1350 <solve_reduced+0x210>
mov    0x8(%rsp),%rax
mov    %r12,%rbp
lea    0x0(,%rax,8),%r12
mov    %r13,0x48(%rsp)
mov    %r13,%rbx
mov    0x30(%rsp),%r13
nopl   0x0(%rax)
mov    0x38(%rsp),%rdi
mov    0x18(%rsp),%rdx
mov    %rbp,%rcx
mov    %r13,%r8
call   1050 <chol_forward@plt>
mov    0x4(%rsp),%esi
add    %r12,%rbp
add    %r12,%r13
add    $0xffffffffffffffff,%rbx
jne    1220 <solve_reduced+0xe0>
cmpl   $0x0,0x14(%rsp)
mov    0x48(%rsp),%r13
jle    1350 <solve_reduced+0x210>
mov    0x20(%rsp),%r11
and    $0xfffffffe,%r11d
mov    0x8(%rsp),%rax
mov    0x28(%rsp),%rcx
add    %rax,%rcx
mov    0x18(%rsp),%rax
lea    (%rax,%rcx,8),%rdx
add    $0x8,%rdx
xor    %r8d,%r8d
jmp    1290 <solve_reduced+0x150>
nopl   (%rax)
add    $0x1,%r8
add    %r12,%rdx
cmp    %r13,%r8
je     1350 <solve_reduced+0x210>
mov    %r8,%r9
imul   0x8(%rsp),%r9
mov    %r8,%r10
imul   0x28(%rsp),%r10
mov    %rdx,%rcx
mov    %r8,%rax
jmp    12bc <solve_reduced+0x17c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
add    %r12,%rcx
cmp    %r13,%rax
je     1280 <solve_reduced+0x140>
test   %esi,%esi
jle    12b0 <solve_reduced+0x170>
lea    (%rax,%r10,1),%rbp
movsd  (%r15,%rbp,8),%xmm0
xor    %ebx,%ebx
cmp    $0x1,%esi
je     1313 <solve_reduced+0x1d3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  -0x8(%rcx,%rbx,8),%xmm1
mulsd  -0x8(%rdx,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rbp,8)
movsd  (%rcx,%rbx,8),%xmm0
mulsd  (%rdx,%rbx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15,%rbp,8)
add    $0x2,%rbx
cmp    %rbx,%r11
jne    12e0 <solve_reduced+0x1a0>
testb  $0x1,0x20(%rsp)
je     12b0 <solve_reduced+0x170>
mov    %rax,%rdi
imul   0x8(%rsp),%rdi
add    %rbx,%rdi
mov    0x30(%rsp),%r13
movsd  0x0(%r13,%rdi,8),%xmm1
add    %r9,%rbx
mulsd  0x0(%r13,%rbx,8),%xmm1
mov    0x48(%rsp),%r13
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rbp,8)
jmp    12b0 <solve_reduced+0x170>
mov    %r15,%rdi
mov    0x14(%rsp),%ebx
mov    %ebx,%esi
mov    0x40(%rsp),%rdx
call   1030 <choldc@plt>
mov    0x4(%rsp),%esi
mov    0x38(%rsp),%rbp
mov    0x18(%rsp),%rdx
mov    0x50(%rsp),%rcx
mov    0x8(%rsp),%rax
lea    (%r14,%rax,8),%r12
mov    %rbp,%rdi
mov    %r14,%r8
call   1050 <chol_forward@plt>
mov    0x18(%rsp),%rdi
mov    0x4(%rsp),%r9d
test   %ebx,%ebx
mov    %ebx,%esi
mov    0x60(%rsp),%r11
jle    1480 <solve_reduced+0x340>
mov    0x20(%rsp),%r10
and    $0xfffffffe,%r10d
mov    0x8(%rsp),%rbp
mov    0x28(%rsp),%rax
lea    (%rax,%rbp,1),%rdx
lea    (%rdi,%rdx,8),%rcx
add    $0x8,%rcx
lea    0x0(,%rbp,8),%r8
mov    0x58(%rsp),%rax
add    %rdx,%rax
lea    (%rdi,%rax,8),%rdx
add    $0x8,%rdx
xor    %ebx,%ebx
mov    0x30(%rsp),%rax
jmp    1400 <solve_reduced+0x2c0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
add    %r8,%rcx
cmp    %r13,%rbx
je     1480 <solve_reduced+0x340>
movsd  (%r11,%rbx,8),%xmm0
movsd  %xmm0,(%r12,%rbx,8)
test   %r9d,%r9d
jle    13f0 <solve_reduced+0x2b0>
xor    %ebp,%ebp
cmp    $0x1,%r9d
je     1453 <solve_reduced+0x313>
nopl   0x0(%rax)
movsd  -0x8(%rcx,%rbp,8),%xmm1
mulsd  -0x8(%rdx,%rbp,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r12,%rbx,8)
movsd  (%rcx,%rbp,8),%xmm0
mulsd  (%rdx,%rbp,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r12,%rbx,8)
add    $0x2,%rbp
cmp    %rbp,%r10
jne    1420 <solve_reduced+0x2e0>
testb  $0x1,0x20(%rsp)
je     13f0 <solve_reduced+0x2b0>
mov    %rbx,%rdi
imul   0x8(%rsp),%rdi
add    %rbp,%rdi
movsd  (%rax,%rdi,8),%xmm1
mulsd  (%r14,%rbp,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r12,%rbx,8)
jmp    13f0 <solve_reduced+0x2b0>
mov    %r15,%rdi
mov    0x40(%rsp),%rdx
mov    %r12,%rcx
mov    0x68(%rsp),%r15
mov    %r15,%r8
call   1060 <cholsb@plt>
mov    0x14(%rsp),%r11d
mov    0x18(%rsp),%rdx
mov    0x4(%rsp),%esi
test   %esi,%esi
jle    159d <solve_reduced+0x45d>
mov    %r13d,%r8d
and    $0xfffffffe,%r8d
mov    0x8(%rsp),%rax
mov    %rax,%r9
shl    $0x4,%r9
mov    0x28(%rsp),%rcx
lea    (%r9,%rcx,8),%r10
shl    $0x3,%rcx
lea    (%rcx,%rax,8),%rcx
xor    %edi,%edi
movapd 0xb24(%rip),%xmm0
jmp    14f7 <solve_reduced+0x3b7>
xchg   %ax,%ax
add    $0x1,%rdi
add    $0x8,%r10
add    $0x8,%rcx
cmp    0x20(%rsp),%rdi
je     159d <solve_reduced+0x45d>
movsd  (%r14,%rdi,8),%xmm1
xorpd  %xmm0,%xmm1
movlpd %xmm1,(%r14,%rdi,8)
test   %r11d,%r11d
jle    14e0 <solve_reduced+0x3a0>
cmp    $0x1,%r11d
jne    1520 <solve_reduced+0x3e0>
xor    %eax,%eax
jmp    1568 <solve_reduced+0x428>
cs nopw 0x0(%rax,%rax,1)
mov    %rdx,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rbx,%rcx,1),%xmm2
mulsd  (%r15,%rax,8),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r14,%rdi,8)
movsd  (%rbx,%r10,1),%xmm1
mulsd  0x8(%r15,%rax,8),%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,(%r14,%rdi,8)
add    $0x2,%rax
add    %r9,%rbx
cmp    %rax,%r8
jne    1530 <solve_reduced+0x3f0>
test   $0x1,%r13b
je     14e0 <solve_reduced+0x3a0>
mov    %rax,%rbp
imul   0x8(%rsp),%rbp
add    %rdi,%rbp
mov    0x30(%rsp),%rbx
movsd  (%rbx,%rbp,8),%xmm2
mulsd  (%r15,%rax,8),%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r14,%rdi,8)
jmp    14e0 <solve_reduced+0x3a0>
mov    0x38(%rsp),%rdi
mov    %r14,%rcx
mov    0x70(%rsp),%r8
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <chol_backward@plt>

LLVM IR (-O0):
define void @solve_reduced(i32 %0, i32 %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, i32 %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca double*
%27 = alloca double*
%28 = alloca double*
%29 = alloca double*
%30 = alloca double*
store i32 %0, i32* %12
store i32 %1, i32* %13
store double* %2, double** %14
store double* %3, double** %15
store double* %4, double** %16
store double* %5, double** %17
store double* %6, double** %18
store double* %7, double** %19
store double* %8, double** %20
store double* %9, double** %21
store i32 %10, i32* %22
%31 = load double*, double** %21
store double* %31, double** %26
%32 = load double*, double** %26
%33 = load i32, i32* %12
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
store double* %35, double** %27
%36 = load double*, double** %27
%37 = load i32, i32* %13
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
store double* %39, double** %28
%40 = load double*, double** %28
%41 = load i32, i32* %12
%42 = load i32, i32* %13
%43 = mul nsw i32 %41, %42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %40, i64 %44
store double* %45, double** %29
%46 = load double*, double** %29
%47 = load i32, i32* %12
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds double, double* %46, i64 %48
store double* %49, double** %30
%50 = load i32, i32* %22
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %142
52: ; preds = %11
%53 = load double*, double** %14
%54 = load i32, i32* %12
%55 = load double*, double** %26
%56 = call i32 @choldc(double* %53, i32 %54, double* %55)
store i32 0, i32* %23
br label %57
57: ; preds = %78, %52
%58 = load i32, i32* %23
%59 = load i32, i32* %13
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %81
61: ; preds = %57
%62 = load double*, double** %14
%63 = load i32, i32* %12
%64 = load double*, double** %26
%65 = load double*, double** %16
%66 = load i32, i32* %23
%67 = load i32, i32* %12
%68 = mul nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %65, i64 %69
%71 = load double*, double** %28
%72 = load i32, i32* %23
%73 = load i32, i32* %12
%74 = mul nsw i32 %72, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %71, i64 %75
%77 = call i32 @chol_forward(double* %62, i32 %63, double* %64, double* %70, double* %76)
br label %78
78: ; preds = %61
%79 = load i32, i32* %23
%80 = add nsw i32 %79, 1
store i32 %80, i32* %23
br label %57
81: ; preds = %57
store i32 0, i32* %23
br label %82
82: ; preds = %134, %81
%83 = load i32, i32* %23
%84 = load i32, i32* %13
%85 = icmp slt i32 %83, %84
br i1 %85, label %86, label %137
86: ; preds = %82
%87 = load i32, i32* %23
store i32 %87, i32* %24
br label %88
88: ; preds = %130, %86
%89 = load i32, i32* %24
%90 = load i32, i32* %13
%91 = icmp slt i32 %89, %90
br i1 %91, label %92, label %133
92: ; preds = %88
store i32 0, i32* %25
br label %93
93: ; preds = %126, %92
%94 = load i32, i32* %25
%95 = load i32, i32* %12
%96 = icmp slt i32 %94, %95
br i1 %96, label %97, label %129
97: ; preds = %93
%98 = load double*, double** %28
%99 = load i32, i32* %12
%100 = load i32, i32* %24
%101 = mul nsw i32 %99, %100
%102 = load i32, i32* %25
%103 = add nsw i32 %101, %102
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds double, double* %98, i64 %104
%106 = load double, double* %105
%107 = load double*, double** %28
%108 = load i32, i32* %12
%109 = load i32, i32* %23
%110 = mul nsw i32 %108, %109
%111 = load i32, i32* %25
%112 = add nsw i32 %110, %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds double, double* %107, i64 %113
%115 = load double, double* %114
%116 = load double*, double** %15
%117 = load i32, i32* %13
%118 = load i32, i32* %23
%119 = mul nsw i32 %117, %118
%120 = load i32, i32* %24
%121 = add nsw i32 %119, %120
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %116, i64 %122
%124 = load double, double* %123
%125 = call double @llvm.fmuladd.f64(double %106, double %115, double %124)
store double %125, double* %123
br label %126
126: ; preds = %97
%127 = load i32, i32* %25
%128 = add nsw i32 %127, 1
store i32 %128, i32* %25
br label %93
129: ; preds = %93
br label %130
130: ; preds = %129
%131 = load i32, i32* %24
%132 = add nsw i32 %131, 1
store i32 %132, i32* %24
br label %88
133: ; preds = %88
br label %134
134: ; preds = %133
%135 = load i32, i32* %23
%136 = add nsw i32 %135, 1
store i32 %136, i32* %23
br label %82
137: ; preds = %82
%138 = load double*, double** %15
%139 = load i32, i32* %13
%140 = load double*, double** %27
%141 = call i32 @choldc(double* %138, i32 %139, double* %140)
br label %142
142: ; preds = %137, %11
%143 = load double*, double** %14
%144 = load i32, i32* %12
%145 = load double*, double** %26
%146 = load double*, double** %19
%147 = load double*, double** %29
%148 = call i32 @chol_forward(double* %143, i32 %144, double* %145, double* %146, double* %147)
store i32 0, i32* %23
br label %149
149: ; preds = %192, %142
%150 = load i32, i32* %23
%151 = load i32, i32* %13
%152 = icmp slt i32 %150, %151
br i1 %152, label %153, label %195
153: ; preds = %149
%154 = load double*, double** %20
%155 = load i32, i32* %23
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %154, i64 %156
%158 = load double, double* %157
%159 = load double*, double** %30
%160 = load i32, i32* %23
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %159, i64 %161
store double %158, double* %162
store i32 0, i32* %24
br label %163
163: ; preds = %188, %153
%164 = load i32, i32* %24
%165 = load i32, i32* %12
%166 = icmp slt i32 %164, %165
br i1 %166, label %167, label %191
167: ; preds = %163
%168 = load double*, double** %28
%169 = load i32, i32* %23
%170 = load i32, i32* %12
%171 = mul nsw i32 %169, %170
%172 = load i32, i32* %24
%173 = add nsw i32 %171, %172
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds double, double* %168, i64 %174
%176 = load double, double* %175
%177 = load double*, double** %29
%178 = load i32, i32* %24
%179 = sext i32 %178 to i64
%180 = getelementptr inbounds double, double* %177, i64 %179
%181 = load double, double* %180
%182 = load double*, double** %30
%183 = load i32, i32* %23
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds double, double* %182, i64 %184
%186 = load double, double* %185
%187 = call double @llvm.fmuladd.f64(double %176, double %181, double %186)
store double %187, double* %185
br label %188
188: ; preds = %167
%189 = load i32, i32* %24
%190 = add nsw i32 %189, 1
store i32 %190, i32* %24
br label %163
191: ; preds = %163
br label %192
192: ; preds = %191
%193 = load i32, i32* %23
%194 = add nsw i32 %193, 1
store i32 %194, i32* %23
br label %149
195: ; preds = %149
%196 = load double*, double** %15
%197 = load i32, i32* %13
%198 = load double*, double** %27
%199 = load double*, double** %30
%200 = load double*, double** %18
%201 = call i32 @cholsb(double* %196, i32 %197, double* %198, double* %199, double* %200)
store i32 0, i32* %23
br label %202
202: ; preds = %246, %195
%203 = load i32, i32* %23
%204 = load i32, i32* %12
%205 = icmp slt i32 %203, %204
br i1 %205, label %206, label %249
206: ; preds = %202
%207 = load double*, double** %29
%208 = load i32, i32* %23
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds double, double* %207, i64 %209
%211 = load double, double* %210
%212 = fneg double %211
%213 = load double*, double** %29
%214 = load i32, i32* %23
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds double, double* %213, i64 %215
store double %212, double* %216
store i32 0, i32* %24
br label %217
217: ; preds = %242, %206
%218 = load i32, i32* %24
%219 = load i32, i32* %13
%220 = icmp slt i32 %218, %219
br i1 %220, label %221, label %245
221: ; preds = %217
%222 = load double*, double** %28
%223 = load i32, i32* %24
%224 = load i32, i32* %12
%225 = mul nsw i32 %223, %224
%226 = load i32, i32* %23
%227 = add nsw i32 %225, %226
%228 = sext i32 %227 to i64
%229 = getelementptr inbounds double, double* %222, i64 %228
%230 = load double, double* %229
%231 = load double*, double** %18
%232 = load i32, i32* %24
%233 = sext i32 %232 to i64
%234 = getelementptr inbounds double, double* %231, i64 %233
%235 = load double, double* %234
%236 = load double*, double** %29
%237 = load i32, i32* %23
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds double, double* %236, i64 %238
%240 = load double, double* %239
%241 = call double @llvm.fmuladd.f64(double %230, double %235, double %240)
store double %241, double* %239
br label %242
242: ; preds = %221
%243 = load i32, i32* %24
%244 = add nsw i32 %243, 1
store i32 %244, i32* %24
br label %217
245: ; preds = %217
br label %246
246: ; preds = %245
%247 = load i32, i32* %23
%248 = add nsw i32 %247, 1
store i32 %248, i32* %23
br label %202
249: ; preds = %202
%250 = load double*, double** %14
%251 = load i32, i32* %12
%252 = load double*, double** %26
%253 = load double*, double** %29
%254 = load double*, double** %17
%255 = call i32 @chol_backward(double* %250, i32 %251, double* %252, double* %253, double* %254)
ret void
}

LLVM IR (-O2):
define void @solve_reduced(i32 %0, i32 %1, double* %2, double* %3, double* %4, double* %5, double* %6, double* %7, double* nocapture %8, double* %9, i32 %10) {
%12 = sext i32 %0 to i64
%13 = getelementptr inbounds double, double* %9, i64 %12
%14 = sext i32 %1 to i64
%15 = getelementptr inbounds double, double* %13, i64 %14
%16 = mul nsw i32 %1, %0
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %15, i64 %17
%19 = getelementptr double, double* %18, i64 %12
%20 = icmp eq i32 %10, 1
br i1 %20, label %21, label %95
21: ; preds = %11
%22 = tail call i32 @choldc(double* %2, i32 %0, double* %9)
%23 = icmp sgt i32 %1, 0
br i1 %23, label %24, label %93
24: ; preds = %21
%25 = zext i32 %1 to i64
br label %35
26: ; preds = %35
br i1 %23, label %27, label %93
27: ; preds = %26
%28 = icmp sgt i32 %0, 0
%29 = zext i32 %1 to i64
%30 = zext i32 %0 to i64
%31 = and i64 %30, 1
%32 = icmp eq i32 %0, 1
%33 = and i64 %30, 4294967294
%34 = icmp eq i64 %31, 0
br label %43
35: ; preds = %24, %35
%36 = phi i64 [ 0, %24 ], [ %41, %35 ]
%37 = mul nsw i64 %36, %12
%38 = getelementptr inbounds double, double* %4, i64 %37
%39 = getelementptr inbounds double, double* %15, i64 %37
%40 = tail call i32 @chol_forward(double* %2, i32 %0, double* %9, double* %38, double* %39)
%41 = add nuw nsw i64 %36, 1
%42 = icmp eq i64 %41, %25
br i1 %42, label %26, label %35
43: ; preds = %90, %27
%44 = phi i64 [ 0, %27 ], [ %91, %90 ]
%45 = mul nsw i64 %44, %12
%46 = mul nsw i64 %44, %14
br label %47
47: ; preds = %43, %87
%48 = phi i64 [ %44, %43 ], [ %88, %87 ]
br i1 %28, label %49, label %87
49: ; preds = %47
%50 = mul nsw i64 %48, %12
%51 = add nsw i64 %48, %46
%52 = getelementptr inbounds double, double* %3, i64 %51
%53 = load double, double* %52
br i1 %32, label %76, label %54
54: ; preds = %49, %54
%55 = phi double [ %72, %54 ], [ %53, %49 ]
%56 = phi i64 [ %73, %54 ], [ 0, %49 ]
%57 = phi i64 [ %74, %54 ], [ 0, %49 ]
%58 = add nsw i64 %56, %50
%59 = getelementptr inbounds double, double* %15, i64 %58
%60 = load double, double* %59
%61 = add nsw i64 %56, %45
%62 = getelementptr inbounds double, double* %15, i64 %61
%63 = load double, double* %62
%64 = tail call double @llvm.fmuladd.f64(double %60, double %63, double %55)
store double %64, double* %52
%65 = or i64 %56, 1
%66 = add nsw i64 %65, %50
%67 = getelementptr inbounds double, double* %15, i64 %66
%68 = load double, double* %67
%69 = add nsw i64 %65, %45
%70 = getelementptr inbounds double, double* %15, i64 %69
%71 = load double, double* %70
%72 = tail call double @llvm.fmuladd.f64(double %68, double %71, double %64)
store double %72, double* %52
%73 = add nuw nsw i64 %56, 2
%74 = add i64 %57, 2
%75 = icmp eq i64 %74, %33
br i1 %75, label %76, label %54
76: ; preds = %54, %49
%77 = phi double [ %53, %49 ], [ %72, %54 ]
%78 = phi i64 [ 0, %49 ], [ %73, %54 ]
br i1 %34, label %87, label %79
79: ; preds = %76
%80 = add nsw i64 %78, %50
%81 = getelementptr inbounds double, double* %15, i64 %80
%82 = load double, double* %81
%83 = add nsw i64 %78, %45
%84 = getelementptr inbounds double, double* %15, i64 %83
%85 = load double, double* %84
%86 = tail call double @llvm.fmuladd.f64(double %82, double %85, double %77)
store double %86, double* %52
br label %87
87: ; preds = %79, %76, %47
%88 = add nuw nsw i64 %48, 1
%89 = icmp eq i64 %88, %29
br i1 %89, label %90, label %47
90: ; preds = %87
%91 = add nuw nsw i64 %44, 1
%92 = icmp eq i64 %91, %29
br i1 %92, label %93, label %43
93: ; preds = %90, %21, %26
%94 = tail call i32 @choldc(double* %3, i32 %1, double* %13)
br label %95
95: ; preds = %93, %11
%96 = tail call i32 @chol_forward(double* %2, i32 %0, double* %9, double* %7, double* %18)
%97 = icmp sgt i32 %1, 0
br i1 %97, label %98, label %146
98: ; preds = %95
%99 = icmp sgt i32 %0, 0
%100 = zext i32 %1 to i64
%101 = zext i32 %0 to i64
%102 = and i64 %101, 1
%103 = icmp eq i32 %0, 1
%104 = and i64 %101, 4294967294
%105 = icmp eq i64 %102, 0
br label %106
106: ; preds = %98, %143
%107 = phi i64 [ 0, %98 ], [ %144, %143 ]
%108 = getelementptr inbounds double, double* %8, i64 %107
%109 = load double, double* %108
%110 = getelementptr inbounds double, double* %19, i64 %107
store double %109, double* %110
br i1 %99, label %111, label %143
111: ; preds = %106
%112 = mul nsw i64 %107, %12
br i1 %103, label %133, label %113
113: ; preds = %111, %113
%114 = phi double [ %129, %113 ], [ %109, %111 ]
%115 = phi i64 [ %130, %113 ], [ 0, %111 ]
%116 = phi i64 [ %131, %113 ], [ 0, %111 ]
%117 = add nsw i64 %115, %112
%118 = getelementptr inbounds double, double* %15, i64 %117
%119 = load double, double* %118
%120 = getelementptr inbounds double, double* %18, i64 %115
%121 = load double, double* %120
%122 = tail call double @llvm.fmuladd.f64(double %119, double %121, double %114)
store double %122, double* %110
%123 = or i64 %115, 1
%124 = add nsw i64 %123, %112
%125 = getelementptr inbounds double, double* %15, i64 %124
%126 = load double, double* %125
%127 = getelementptr inbounds double, double* %18, i64 %123
%128 = load double, double* %127
%129 = tail call double @llvm.fmuladd.f64(double %126, double %128, double %122)
store double %129, double* %110
%130 = add nuw nsw i64 %115, 2
%131 = add i64 %116, 2
%132 = icmp eq i64 %131, %104
br i1 %132, label %133, label %113
133: ; preds = %113, %111
%134 = phi double [ %109, %111 ], [ %129, %113 ]
%135 = phi i64 [ 0, %111 ], [ %130, %113 ]
br i1 %105, label %143, label %136
136: ; preds = %133
%137 = add nsw i64 %135, %112
%138 = getelementptr inbounds double, double* %15, i64 %137
%139 = load double, double* %138
%140 = getelementptr inbounds double, double* %18, i64 %135
%141 = load double, double* %140
%142 = tail call double @llvm.fmuladd.f64(double %139, double %141, double %134)
store double %142, double* %110
br label %143
143: ; preds = %136, %133, %106
%144 = add nuw nsw i64 %107, 1
%145 = icmp eq i64 %144, %100
br i1 %145, label %146, label %106
146: ; preds = %143, %95
%147 = tail call i32 @cholsb(double* %3, i32 %1, double* %13, double* %19, double* %6)
%148 = icmp sgt i32 %0, 0
br i1 %148, label %149, label %198
149: ; preds = %146
%150 = zext i32 %0 to i64
%151 = zext i32 %1 to i64
%152 = and i64 %151, 1
%153 = icmp eq i32 %1, 1
%154 = and i64 %151, 4294967294
%155 = icmp eq i64 %152, 0
br label %156
156: ; preds = %149, %195
%157 = phi i64 [ 0, %149 ], [ %196, %195 ]
%158 = getelementptr inbounds double, double* %18, i64 %157
%159 = load double, double* %158
%160 = fneg double %159
store double %160, double* %158
br i1 %97, label %161, label %195
161: ; preds = %156
br i1 %153, label %184, label %162
162: ; preds = %161, %162
%163 = phi double [ %180, %162 ], [ %160, %161 ]
%164 = phi i64 [ %181, %162 ], [ 0, %161 ]
%165 = phi i64 [ %182, %162 ], [ 0, %161 ]
%166 = mul nsw i64 %164, %12
%167 = add nsw i64 %166, %157
%168 = getelementptr inbounds double, double* %15, i64 %167
%169 = load double, double* %168
%170 = getelementptr inbounds double, double* %6, i64 %164
%171 = load double, double* %170
%172 = tail call double @llvm.fmuladd.f64(double %169, double %171, double %163)
store double %172, double* %158
%173 = or i64 %164, 1
%174 = mul nsw i64 %173, %12
%175 = add nsw i64 %174, %157
%176 = getelementptr inbounds double, double* %15, i64 %175
%177 = load double, double* %176
%178 = getelementptr inbounds double, double* %6, i64 %173
%179 = load double, double* %178
%180 = tail call double @llvm.fmuladd.f64(double %177, double %179, double %172)
store double %180, double* %158
%181 = add nuw nsw i64 %164, 2
%182 = add i64 %165, 2
%183 = icmp eq i64 %182, %154
br i1 %183, label %184, label %162
184: ; preds = %162, %161
%185 = phi double [ %160, %161 ], [ %180, %162 ]
%186 = phi i64 [ 0, %161 ], [ %181, %162 ]
br i1 %155, label %195, label %187
187: ; preds = %184
%188 = mul nsw i64 %186, %12
%189 = add nsw i64 %188, %157
%190 = getelementptr inbounds double, double* %15, i64 %189
%191 = load double, double* %190
%192 = getelementptr inbounds double, double* %6, i64 %186
%193 = load double, double* %192
%194 = tail call double @llvm.fmuladd.f64(double %191, double %193, double %185)
store double %194, double* %158
br label %195
195: ; preds = %187, %184, %156
%196 = add nuw nsw i64 %157, 1
%197 = icmp eq i64 %196, %150
br i1 %197, label %198, label %156
198: ; preds = %195, %146
%199 = tail call i32 @chol_backward(double* %2, i32 %0, double* %9, double* %18, double* %5)
ret void
}