#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*/ free(double *);
double *malloc(int);
int /*<<< orphan*/ tridiag_free();
int /*<<< orphan*/ tridiag_malloc(int);
int /*<<< orphan*/ tridiag_premalloc(double *, double *, double *, double *,
                                     double *, int);
void implicit_precalc_3Dy(double *phi, double *ay, double *by, double *cy,
                          double dt, int L, int M, int N, int Lstart,
                          int Lend) {
  int ii, jj, kk;
  int index;
  double *a = malloc(M * sizeof(*a));
  double *b = malloc(M * sizeof(*b));
  double *c = malloc(M * sizeof(*c));
  double *r = malloc(M * sizeof(*r));
  double *new_row = malloc(M * sizeof(*new_row));
  tridiag_malloc(M);
  for (ii = Lstart; ii < Lend; ii++) {
    for (kk = 0; kk < N; kk++) {
      for (jj = 0; jj < M; jj++) {
        index = ii * M * N + jj * N + kk;
        a[jj] = ay[index];
        b[jj] = by[index] + 1 / dt;
        c[jj] = cy[index];
        r[jj] = 1 / dt * phi[index];
      }
      tridiag_premalloc(a, b, c, r, new_row, M);
      for (jj = 0; jj < M; jj++)
        phi[ii * M * N + jj * N + kk] = new_row[jj];
    }
  }
  tridiag_free();
  free(a);
  free(b);
  free(c);
  free(r);
  free(new_row);
}


x86 assembly (clang, -O0):
<implicit_precalc_3Dy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    %r9d,-0x30(%rbp)
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x58(%rbp)
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x60(%rbp)
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    -0x30(%rbp),%edi
call   1070 <tridiag_malloc@plt>
mov    0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    135f <implicit_precalc_3Dy+0x20f>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    134c <implicit_precalc_3Dy+0x1fc>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    12cb <implicit_precalc_3Dy+0x17b>
mov    -0x34(%rbp),%eax
imul   -0x30(%rbp),%eax
imul   0x10(%rbp),%eax
mov    -0x38(%rbp),%ecx
imul   0x10(%rbp),%ecx
add    %ecx,%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x48(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd9a(%rip),%xmm1
divsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x50(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x40(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd62(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x40(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x60(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1211 <implicit_precalc_3Dy+0xc1>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x60(%rbp),%rcx
mov    -0x68(%rbp),%r8
mov    -0x30(%rbp),%r9d
call   1040 <tridiag_premalloc@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1339 <implicit_precalc_3Dy+0x1e9>
mov    -0x68(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x30(%rbp),%ecx
imul   0x10(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   0x10(%rbp),%edx
add    %edx,%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12ef <implicit_precalc_3Dy+0x19f>
jmp    133e <implicit_precalc_3Dy+0x1ee>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11fe <implicit_precalc_3Dy+0xae>
jmp    1351 <implicit_precalc_3Dy+0x201>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11eb <implicit_precalc_3Dy+0x9b>
mov    $0x0,%al
call   1050 <tridiag_free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<implicit_precalc_3Dy>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %r9d,%r13d
movsd  %xmm0,0x10(%rsp)
mov    %rcx,0x38(%rsp)
mov    %rdx,0x30(%rsp)
mov    %rsi,0x28(%rsp)
mov    %rdi,%r14
mov    0x150(%rsp),%ebx
mov    0x148(%rsp),%eax
mov    %eax,(%rsp)
mov    0x140(%rsp),%eax
mov    %rax,0x60(%rsp)
lea    0x0(,%r13,8),%ebp
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x58(%rsp)
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%r12
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,%rbp
mov    %r13d,%edi
call   1070 <tridiag_malloc@plt>
mov    0x58(%rsp),%rdi
mov    0x60(%rsp),%r9
mov    %ebx,0x70(%rsp)
cmp    %ebx,(%rsp)
jge    1727 <implicit_precalc_3Dy+0x5d7>
mov    %r13,%r8
movsd  0xdff(%rip),%xmm2
divsd  0x10(%rsp),%xmm2
mov    %r8d,%r13d
lea    -0x1(%r13),%r10
mov    (%rsp),%eax
mov    %eax,%edx
imul   %r8d,%edx
mov    %r13d,%esi
and    $0xfffffffc,%esi
mov    %rsi,0xb0(%rsp)
add    $0xfffffffffffffffc,%rsi
mov    %rsi,0xa8(%rsp)
mov    %rsi,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %r13d,%esi
and    $0xfffffffe,%esi
mov    %rsi,0xb8(%rsp)
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
mov    %rcx,%rsi
mov    %rcx,0xa0(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x98(%rsp)
mov    %r13,%rcx
neg    %rcx
mov    %rcx,0xc0(%rsp)
imul   %r9d,%eax
imul   %r8d,%eax
mov    %eax,0x1c(%rsp)
mov    %r9d,%eax
imul   %r8d,%eax
mov    %eax,0x6c(%rsp)
lea    (%r9,%r9,1),%r11d
lea    0x4(%rdx),%eax
imul   %r9d,%eax
mov    %eax,0x18(%rsp)
lea    0x0(,%r9,8),%eax
mov    %eax,0x74(%rsp)
mov    %r10,%rax
mov    %r10,0x88(%rsp)
shr    $0x20,%r10
mov    %r10,0x80(%rsp)
lea    0x1(%rdx),%eax
mov    %rax,0x50(%rsp)
xor    %eax,%eax
mov    %rax,0x48(%rsp)
mov    %rdx,0x90(%rsp)
mov    %rdx,0x40(%rsp)
mov    %r8,0x10(%rsp)
mov    %rbp,0xc8(%rsp)
movapd %xmm2,0xf0(%rsp)
movapd %xmm3,0xe0(%rsp)
mov    %r11d,0x20(%rsp)
jmp    1356 <implicit_precalc_3Dy+0x206>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsp),%eax
add    $0x1,%eax
mov    0x48(%rsp),%rcx
add    $0x1,%ecx
mov    %rcx,0x48(%rsp)
mov    0x6c(%rsp),%ecx
add    %ecx,0x1c(%rsp)
mov    0x40(%rsp),%rdx
add    %r8d,%edx
mov    %rdx,0x40(%rsp)
add    %ecx,0x18(%rsp)
mov    0x50(%rsp),%rcx
add    %r8d,%ecx
mov    %rcx,0x50(%rsp)
mov    %eax,(%rsp)
cmp    0x70(%rsp),%eax
je     1727 <implicit_precalc_3Dy+0x5d7>
test   %r9d,%r9d
jle    1310 <implicit_precalc_3Dy+0x1c0>
mov    0x48(%rsp),%rax
imul   %r8d,%eax
add    0x90(%rsp),%eax
mov    %rax,0xd0(%rsp)
mov    (%rsp),%eax
imul   %r8d,%eax
mov    %rax,0x78(%rsp)
xor    %r10d,%r10d
mov    0x18(%rsp),%eax
mov    %eax,0x24(%rsp)
mov    0x1c(%rsp),%eax
mov    %eax,0x4(%rsp)
jmp    13fb <implicit_precalc_3Dy+0x2ab>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rsp),%rsi
mov    %r15,%rdx
mov    %r12,%rcx
mov    %rbp,%r8
mov    0x10(%rsp),%r9
mov    %r10,%rbx
call   1040 <tridiag_premalloc@plt>
mov    %rbx,%r10
mov    0x20(%rsp),%r11d
movapd 0xe0(%rsp),%xmm3
movapd 0xf0(%rsp),%xmm2
mov    0x58(%rsp),%rdi
mov    0x60(%rsp),%r9
mov    0x10(%rsp),%r8
add    $0x1,%r10d
addl   $0x1,0x4(%rsp)
addl   $0x1,0x24(%rsp)
cmp    %r9d,%r10d
je     1310 <implicit_precalc_3Dy+0x1c0>
test   %r8d,%r8d
jle    13a0 <implicit_precalc_3Dy+0x250>
mov    0xd0(%rsp),%rax
lea    (%rax,%r10,1),%ecx
cmp    $0x1,%r8d
mov    %rcx,0xd8(%rsp)
je     14c0 <implicit_precalc_3Dy+0x370>
cmp    $0x1,%r9d
jne    14c0 <implicit_precalc_3Dy+0x370>
mov    0x88(%rsp),%rax
add    %ecx,%eax
cmp    %ecx,%eax
jl     14c0 <implicit_precalc_3Dy+0x370>
mov    $0x0,%eax
cmpq   $0x0,0x80(%rsp)
mov    0x38(%rsp),%rdx
mov    0x30(%rsp),%rbx
mov    0x28(%rsp),%rbp
mov    0x8(%rsp),%rsi
jne    14d6 <implicit_precalc_3Dy+0x386>
mov    0x4(%rsp),%eax
xor    %ecx,%ecx
mov    0xb8(%rsp),%r8
nopl   0x0(%rax)
cltq
movups 0x0(%rbp,%rax,8),%xmm0
movups %xmm0,(%rdi,%rcx,8)
movupd (%rbx,%rax,8),%xmm0
addpd  %xmm3,%xmm0
movupd %xmm0,(%rsi,%rcx,8)
movups (%rdx,%rax,8),%xmm0
movups %xmm0,(%r15,%rcx,8)
movupd (%r14,%rax,8),%xmm0
mulpd  %xmm3,%xmm0
movupd %xmm0,(%r12,%rcx,8)
add    $0x2,%rcx
add    %r11d,%eax
cmp    %rcx,%r8
jne    1470 <implicit_precalc_3Dy+0x320>
mov    %r8,%rax
cmp    %r13,%r8
jne    14d6 <implicit_precalc_3Dy+0x386>
jmp    1533 <implicit_precalc_3Dy+0x3e3>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
mov    0x38(%rsp),%rdx
mov    0x30(%rsp),%rbx
mov    0x28(%rsp),%rbp
mov    0x8(%rsp),%rsi
mov    0x40(%rsp),%rcx
add    %eax,%ecx
imul   %r9d,%ecx
add    %r10d,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %ecx,%rcx
movsd  0x0(%rbp,%rcx,8),%xmm0
movsd  %xmm0,(%rdi,%rax,8)
movsd  (%rbx,%rcx,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rsi,%rax,8)
movsd  (%rdx,%rcx,8),%xmm0
movsd  %xmm0,(%r15,%rax,8)
movsd  (%r14,%rcx,8),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%r12,%rax,8)
add    $0x1,%rax
add    %r9d,%ecx
cmp    %rax,%r13
jne    14f0 <implicit_precalc_3Dy+0x3a0>
mov    %r15,%rdx
mov    %r12,%rcx
mov    0xc8(%rsp),%rbp
mov    %rbp,%r8
mov    0x10(%rsp),%r9
mov    %r10,%rbx
call   1040 <tridiag_premalloc@plt>
mov    %rbx,%r10
mov    0x20(%rsp),%r11d
movapd 0xe0(%rsp),%xmm3
movapd 0xf0(%rsp),%xmm2
mov    0x58(%rsp),%rdi
mov    0x60(%rsp),%r9
mov    0x10(%rsp),%r8
test   %r8d,%r8d
mov    0x74(%rsp),%ebx
jle    13e4 <implicit_precalc_3Dy+0x294>
cmp    $0x4,%r8d
jb     1680 <implicit_precalc_3Dy+0x530>
cmp    $0x1,%r9d
jne    1680 <implicit_precalc_3Dy+0x530>
mov    0x88(%rsp),%rax
mov    0xd8(%rsp),%rcx
add    %ecx,%eax
cmp    %ecx,%eax
jl     1680 <implicit_precalc_3Dy+0x530>
mov    $0x0,%ecx
cmpq   $0x0,0x80(%rsp)
jne    1682 <implicit_precalc_3Dy+0x532>
cmpq   $0x0,0xa8(%rsp)
je     1712 <implicit_precalc_3Dy+0x5c2>
mov    0x98(%rsp),%rcx
mov    0x4(%rsp),%eax
mov    %eax,%edx
mov    0x24(%rsp),%eax
mov    %eax,%esi
xor    %eax,%eax
xchg   %ax,%ax
movups 0x0(%rbp,%rax,8),%xmm0
movups 0x10(%rbp,%rax,8),%xmm1
movslq %edx,%rdx
movups %xmm0,(%r14,%rdx,8)
movups %xmm1,0x10(%r14,%rdx,8)
movupd 0x20(%rbp,%rax,8),%xmm0
movups 0x30(%rbp,%rax,8),%xmm1
movslq %esi,%rsi
movupd %xmm0,(%r14,%rsi,8)
movups %xmm1,0x10(%r14,%rsi,8)
add    $0x8,%rax
add    %ebx,%esi
add    %ebx,%edx
add    $0xfffffffffffffffe,%rcx
jne    15f0 <implicit_precalc_3Dy+0x4a0>
testb  $0x1,0xa0(%rsp)
01
je     1661 <implicit_precalc_3Dy+0x511>
movupd 0x0(%rbp,%rax,8),%xmm0
movups 0x10(%rbp,%rax,8),%xmm1
mov    0x78(%rsp),%rcx
add    %ecx,%eax
imul   %r9d,%eax
add    %r10d,%eax
cltq
movupd %xmm0,(%r14,%rax,8)
movups %xmm1,0x10(%r14,%rax,8)
mov    0xb0(%rsp),%rax
mov    %rax,%rcx
cmp    %r13,%rax
je     13e4 <implicit_precalc_3Dy+0x294>
jmp    1682 <implicit_precalc_3Dy+0x532>
nopw   0x0(%rax,%rax,1)
xor    %ecx,%ecx
mov    %rcx,%rax
test   $0x1,%r13b
je     16ae <implicit_precalc_3Dy+0x55e>
movsd  0x0(%rbp,%rcx,8),%xmm0
mov    0x78(%rsp),%rax
add    %ecx,%eax
imul   %r9d,%eax
add    %r10d,%eax
cltq
movsd  %xmm0,(%r14,%rax,8)
mov    %rcx,%rax
or     $0x1,%rax
not    %rcx
cmp    0xc0(%rsp),%rcx
je     13e4 <implicit_precalc_3Dy+0x294>
mov    0x40(%rsp),%rcx
add    %eax,%ecx
imul   %r9d,%ecx
add    %r10d,%ecx
mov    0x50(%rsp),%rdx
add    %eax,%edx
imul   %r9d,%edx
add    %r10d,%edx
nopl   0x0(%rax,%rax,1)
movsd  0x0(%rbp,%rax,8),%xmm0
movslq %ecx,%rcx
movsd  %xmm0,(%r14,%rcx,8)
movsd  0x8(%rbp,%rax,8),%xmm0
movslq %edx,%rdx
movsd  %xmm0,(%r14,%rdx,8)
add    $0x2,%rax
add    %r11d,%ecx
add    %r11d,%edx
cmp    %rax,%r13
jne    16e0 <implicit_precalc_3Dy+0x590>
jmp    13e4 <implicit_precalc_3Dy+0x294>
xor    %eax,%eax
testb  $0x1,0xa0(%rsp)
01
jne    163a <implicit_precalc_3Dy+0x4ea>
jmp    1661 <implicit_precalc_3Dy+0x511>
xor    %eax,%eax
mov    %rdi,%rbx
call   1050 <tridiag_free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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