#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_2Dx(double *phi, double *ax, double *bx, double *cx,
                          double dt, int L, int M, int Mstart, int Mend) {
  int ii, jj;
  double *a = malloc(L * sizeof(*a));
  double *b = malloc(L * sizeof(*b));
  double *c = malloc(L * sizeof(*c));
  double *r = malloc(L * sizeof(*r));
  double *temp = malloc(L * sizeof(*temp));
  tridiag_malloc(L);
  for (jj = Mstart; jj < Mend; jj++) {
    for (ii = 0; ii < L; ii++) {
      a[ii] = ax[ii * M + jj];
      b[ii] = bx[ii * M + jj] + 1 / dt;
      c[ii] = cx[ii * M + jj];
      r[ii] = 1 / dt * phi[ii * M + jj];
    }
    tridiag_premalloc(a, b, c, r, temp, L);
    for (ii = 0; ii < L; ii++)
      phi[ii * M + jj] = temp[ii];
  }
  tridiag_free();
  free(a);
  free(b);
  free(c);
  free(r);
  free(temp);
}


x86 assembly (clang, -O0):
<implicit_precalc_2Dx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
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 -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x58(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x60(%rbp)
mov    -0x2c(%rbp),%edi
call   1070 <tridiag_malloc@plt>
mov    0x10(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    0x18(%rbp),%eax
jge    1333 <implicit_precalc_2Dx+0x1e3>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12bf <implicit_precalc_2Dx+0x16f>
mov    -0x10(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xdb8(%rip),%xmm1
divsd  -0x28(%rbp),%xmm1
addsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x50(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movsd  0xd77(%rip),%xmm0
divsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11fb <implicit_precalc_2Dx+0xab>
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    -0x60(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1040 <tridiag_premalloc@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1320 <implicit_precalc_2Dx+0x1d0>
mov    -0x60(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x30(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    12e3 <implicit_precalc_2Dx+0x193>
jmp    1325 <implicit_precalc_2Dx+0x1d5>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11e8 <implicit_precalc_2Dx+0x98>
mov    $0x0,%al
call   1050 <tridiag_free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <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>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<implicit_precalc_2Dx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
mov    %r9d,%r13d
mov    %r8d,%ebp
movsd  %xmm0,0x88(%rsp)
mov    %rcx,0xa8(%rsp)
mov    %rdx,0xa0(%rsp)
mov    %rsi,0x98(%rsp)
mov    %rdi,0x40(%rsp)
mov    0x1c8(%rsp),%r15d
mov    0x1c0(%rsp),%r14d
lea    0x0(,%rbp,8),%ebx
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,0x38(%rsp)
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %ebx,%edi
call   1060 <malloc@plt>
mov    %rax,0x30(%rsp)
mov    %ebx,%edi
mov    %rbp,%rbx
call   1060 <malloc@plt>
mov    %rax,%r12
mov    %rbp,0x50(%rsp)
mov    %ebx,%edi
call   1070 <tridiag_malloc@plt>
mov    %r15d,0x94(%rsp)
cmp    %r15d,%r14d
jge    1985 <implicit_precalc_2Dx+0x835>
movsd  0xdfa(%rip),%xmm2
divsd  0x88(%rsp),%xmm2
movslq %r13d,%rbx
movslq %r14d,%r8
mov    0x50(%rsp),%rdi
mov    %edi,%ebp
mov    %ebp,%eax
and    $0xfffffffe,%eax
mov    %rax,0x130(%rsp)
add    $0xfffffffffffffffe,%rax
mov    %rax,0x128(%rsp)
mov    %rax,%rdx
shr    %rdx
add    $0x1,%rdx
mov    %ebp,%eax
and    $0xfffffffc,%eax
mov    %rax,0x110(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0x108(%rsp)
mov    %rax,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
cmp    $0x1,%edi
setne  %cl
cmp    $0x1,%ebx
sete   %al
and    %al,%cl
mov    %cl,0xf(%rsp)
movapd %xmm2,%xmm3
unpcklpd %xmm2,%xmm3
mov    %rdx,%rcx
mov    %rdx,0x120(%rsp)
and    $0xfffffffffffffffe,%rdx
mov    %rdx,0xf8(%rsp)
cmp    $0x4,%edi
setae  %cl
and    %al,%cl
mov    %cl,0xe(%rsp)
mov    %rsi,%rax
mov    %rsi,0x100(%rsp)
and    $0xfffffffffffffffe,%rsi
mov    %rsi,0xe0(%rsp)
mov    %ebp,%eax
and    $0x3,%eax
mov    %rax,0x138(%rsp)
mov    %rbx,%rax
shl    $0x4,%rbx
mov    %rax,%r14
mov    %rax,%rdx
mov    %rax,0x20(%rsp)
shl    $0x5,%r14
mov    0x40(%rsp),%rsi
lea    (%rsi,%rbx,1),%rax
mov    %rax,0x80(%rsp)
mov    0xa8(%rsp),%rax
lea    (%rax,%rbx,1),%rcx
mov    %rcx,0x78(%rsp)
mov    0xa0(%rsp),%rcx
lea    (%rcx,%rbx,1),%rdi
mov    %rdi,0x70(%rsp)
mov    0x98(%rsp),%r11
add    %r11,%rbx
mov    %rdx,%r10
shl    $0x6,%r10
mov    %r10,0xd8(%rsp)
mov    %rbp,%r10
lea    (%r11,%r8,8),%rbp
mov    %rbp,0x58(%rsp)
lea    (%rcx,%r8,8),%r9
lea    (%rax,%r8,8),%rdi
lea    (%rsi,%r8,8),%rbp
lea    (%rsi,%r8,8),%r15
add    $0x10,%r15
lea    0x0(,%rdx,8),%r13
mov    %r13,0xf0(%rsp)
xor    %r13d,%r13d
mov    %rbp,0xe8(%rsp)
mov    0x78(%rsp),%rdx
mov    %rcx,0x68(%rsp)
mov    0x70(%rsp),%rcx
mov    %rax,0xb8(%rsp)
mov    0x68(%rsp),%rax
mov    %rsi,0xb0(%rsp)
mov    0x80(%rsp),%rsi
mov    %r8,0x28(%rsp)
mov    %r12,0x140(%rsp)
movapd %xmm2,0x170(%rsp)
mov    %r8,0x118(%rsp)
mov    %r10,0x48(%rsp)
movapd %xmm3,0x160(%rsp)
mov    %r14,0x88(%rsp)
jmp    14af <implicit_precalc_2Dx+0x35f>
nopw   0x0(%rax,%rax,1)
mov    0x38(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x30(%rsp),%rcx
mov    %r12,%r8
mov    %r9,0x60(%rsp)
mov    0x50(%rsp),%r9
mov    %r11,%r13
call   1040 <tridiag_premalloc@plt>
mov    %r13,%r11
mov    0x60(%rsp),%r9
mov    0xc0(%rsp),%r13
movapd 0x160(%rsp),%xmm3
mov    0x48(%rsp),%r10
movapd 0x170(%rsp),%xmm2
mov    0x28(%rsp),%r8
add    $0x1,%r8
mov    0x80(%rsp),%rsi
add    $0x8,%rsi
mov    0x78(%rsp),%rdx
add    $0x8,%rdx
mov    0x70(%rsp),%rcx
add    $0x8,%rcx
mov    0x158(%rsp),%rbx
add    $0x8,%rbx
addq   $0x8,0xb0(%rsp)
addq   $0x8,0xb8(%rsp)
mov    0x68(%rsp),%rax
add    $0x8,%rax
add    $0x8,%r11
addq   $0x8,0x58(%rsp)
add    $0x8,%r9
mov    0xd0(%rsp),%rdi
add    $0x8,%rdi
mov    0xc8(%rsp),%rbp
add    $0x8,%rbp
add    $0x8,%r15
add    $0x8,%r13
mov    %r8,0x28(%rsp)
cmp    0x94(%rsp),%r8d
je     1985 <implicit_precalc_2Dx+0x835>
cmpl   $0x0,0x50(%rsp)
mov    %rbx,0x158(%rsp)
mov    %rsi,0x80(%rsp)
mov    %rdx,0x78(%rsp)
mov    %rcx,0x70(%rsp)
mov    %rdi,0xd0(%rsp)
mov    %r13,0xc0(%rsp)
mov    %rbp,0xc8(%rsp)
mov    %rax,0x68(%rsp)
jle    13d0 <implicit_precalc_2Dx+0x280>
cmpb   $0x0,0xf(%rsp)
mov    %r15,0x150(%rsp)
mov    %r11,0x148(%rsp)
je     1610 <implicit_precalc_2Dx+0x4c0>
cmpq   $0x0,0x128(%rsp)
mov    %r9,0x60(%rsp)
je     1637 <implicit_precalc_2Dx+0x4e7>
mov    0x118(%rsp),%r8
mov    0xf8(%rsp),%rdi
mov    %r11,%r9
mov    %rax,%r10
mov    0xb8(%rsp),%r11
mov    0xb0(%rsp),%rbp
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movups (%r9,%r8,8),%xmm0
mov    0x38(%rsp),%r12
movups %xmm0,(%r12,%rax,8)
movupd (%r10,%r8,8),%xmm0
addpd  %xmm3,%xmm0
mov    0x18(%rsp),%r14
movupd %xmm0,(%r14,%rax,8)
movups (%r11,%r8,8),%xmm0
mov    0x10(%rsp),%r15
movups %xmm0,(%r15,%rax,8)
movupd 0x0(%rbp,%r8,8),%xmm0
mulpd  %xmm3,%xmm0
mov    0x30(%rsp),%r13
movupd %xmm0,0x0(%r13,%rax,8)
movups (%rbx,%r8,8),%xmm0
movups %xmm0,0x10(%r12,%rax,8)
movupd (%rcx,%r8,8),%xmm0
addpd  %xmm3,%xmm0
movupd %xmm0,0x10(%r14,%rax,8)
mov    0x88(%rsp),%r14
movups (%rdx,%r8,8),%xmm0
movups %xmm0,0x10(%r15,%rax,8)
movupd (%rsi,%r8,8),%xmm0
mulpd  %xmm3,%xmm0
movupd %xmm0,0x10(%r13,%rax,8)
add    $0x4,%rax
add    %r14,%rsi
add    %r14,%rdx
add    %r14,%rcx
add    %r14,%rbx
add    %r14,%rbp
add    %r14,%r11
add    %r14,%r10
add    %r14,%r9
add    $0xfffffffffffffffe,%rdi
jne    1550 <implicit_precalc_2Dx+0x400>
jmp    1639 <implicit_precalc_2Dx+0x4e9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ebx,%ebx
mov    0x38(%rsp),%rsi
mov    0x30(%rsp),%rcx
mov    %rdi,%r13
mov    %r9,%r15
mov    %rbp,%r11
mov    %r10,%rbp
mov    0x20(%rsp),%r10
mov    0x58(%rsp),%r12
jmp    16e0 <implicit_precalc_2Dx+0x590>
xor    %eax,%eax
mov    0x38(%rsp),%rsi
testb  $0x1,0x120(%rsp)
01
mov    0x30(%rsp),%rcx
mov    0x20(%rsp),%r10
je     16b1 <implicit_precalc_2Dx+0x561>
mov    %rax,%rdi
imul   %r10,%rdi
add    0x28(%rsp),%rdi
mov    0x98(%rsp),%rdx
movups (%rdx,%rdi,8),%xmm0
movups %xmm0,(%rsi,%rax,8)
mov    0xa0(%rsp),%rdx
movupd (%rdx,%rdi,8),%xmm0
addpd  %xmm3,%xmm0
mov    0x18(%rsp),%rdx
movupd %xmm0,(%rdx,%rax,8)
mov    0xa8(%rsp),%rdx
movups (%rdx,%rdi,8),%xmm0
mov    0x10(%rsp),%rdx
movups %xmm0,(%rdx,%rax,8)
mov    0x40(%rsp),%rdx
movupd (%rdx,%rdi,8),%xmm0
mulpd  %xmm3,%xmm0
movupd %xmm0,(%rcx,%rax,8)
mov    0x130(%rsp),%rax
mov    %rax,%rbx
mov    0x48(%rsp),%rbp
cmp    %rbp,%rax
mov    0x58(%rsp),%r12
mov    0x60(%rsp),%r15
mov    0xd0(%rsp),%r13
mov    0xc8(%rsp),%r11
je     1753 <implicit_precalc_2Dx+0x603>
mov    %r10,%rax
imul   %rbx,%rax
lea    (%rcx,%rbx,8),%r8
mov    0x10(%rsp),%rdx
lea    (%rdx,%rbx,8),%r9
mov    0x18(%rsp),%rdx
lea    (%rdx,%rbx,8),%rdx
lea    (%rsi,%rbx,8),%rdi
sub    %rbx,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsd  (%r12,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rbx,8)
movsd  (%r15,%rax,8),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,(%rdx,%rbx,8)
movsd  0x0(%r13,%rax,8),%xmm0
movsd  %xmm0,(%r9,%rbx,8)
movsd  (%r11,%rax,8),%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm0,(%r8,%rbx,8)
add    %r10,%rax
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1710 <implicit_precalc_2Dx+0x5c0>
mov    %r12,0x58(%rsp)
mov    %rsi,%rdi
mov    0x18(%rsp),%rsi
mov    0x10(%rsp),%rdx
mov    0x140(%rsp),%r12
mov    %r12,%r8
mov    0x50(%rsp),%rbx
mov    %ebx,%r9d
call   1040 <tridiag_premalloc@plt>
mov    0x48(%rsp),%r10
movapd 0x170(%rsp),%xmm2
test   %ebx,%ebx
movapd 0x160(%rsp),%xmm3
mov    0x138(%rsp),%rdi
mov    %r15,%r9
mov    0x150(%rsp),%r15
mov    0xc0(%rsp),%r13
mov    0x148(%rsp),%r11
jle    1420 <implicit_precalc_2Dx+0x2d0>
cmpb   $0x0,0xe(%rsp)
je     186e <implicit_precalc_2Dx+0x71e>
cmpq   $0x0,0x108(%rsp)
je     1970 <implicit_precalc_2Dx+0x820>
mov    0xe0(%rsp),%rcx
mov    %r15,%rdx
xor    %eax,%eax
mov    0xd8(%rsp),%rsi
xchg   %ax,%ax
movups (%r12,%rax,8),%xmm0
movups 0x10(%r12,%rax,8),%xmm1
movups %xmm0,-0x10(%rdx)
movups %xmm1,(%rdx)
movupd 0x20(%r12,%rax,8),%xmm0
movups 0x30(%r12,%rax,8),%xmm1
movupd %xmm0,-0x10(%rdx,%r14,1)
movups %xmm1,(%rdx,%r14,1)
add    $0x8,%rax
add    %rsi,%rdx
add    $0xfffffffffffffffe,%rcx
jne    17f0 <implicit_precalc_2Dx+0x6a0>
testb  $0x1,0x100(%rsp)
01
je     1858 <implicit_precalc_2Dx+0x708>
movupd (%r12,%rax,8),%xmm0
movups 0x10(%r12,%rax,8),%xmm1
imul   0x20(%rsp),%rax
add    0x28(%rsp),%rax
mov    0x40(%rsp),%rcx
movupd %xmm0,(%rcx,%rax,8)
movups %xmm1,0x10(%rcx,%rax,8)
mov    0x110(%rsp),%rcx
mov    %rcx,%rax
cmp    %r10,%rcx
je     1420 <implicit_precalc_2Dx+0x2d0>
jmp    1870 <implicit_precalc_2Dx+0x720>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %r10,%rcx
test   %rdi,%rdi
je     18b7 <implicit_precalc_2Dx+0x767>
mov    0x20(%rsp),%rdx
imul   %rax,%rdx
add    0x28(%rsp),%rdx
mov    0x40(%rsp),%rsi
lea    (%rsi,%rdx,8),%rdx
mov    %rdi,%rsi
mov    0xf0(%rsp),%rdi
movsd  (%r12,%rax,8),%xmm0
movsd  %xmm0,(%rdx)
add    $0x1,%rax
add    %rdi,%rdx
add    $0xffffffffffffffff,%rsi
jne    18a0 <implicit_precalc_2Dx+0x750>
cmp    $0x3,%rcx
jb     1420 <implicit_precalc_2Dx+0x2d0>
lea    0x3(%rax),%rcx
mov    0x20(%rsp),%r8
imul   %r8,%rcx
mov    0xe8(%rsp),%rbp
lea    0x0(,%rcx,8),%rcx
add    %rbp,%rcx
lea    0x2(%rax),%rdx
imul   %r8,%rdx
lea    0x0(,%rdx,8),%rdx
add    %rbp,%rdx
mov    %r8,%rsi
imul   %rax,%rsi
lea    0x0(,%rsi,8),%rsi
add    %rbp,%rsi
lea    0x1(%rax),%rdi
imul   %r8,%rdi
mov    0x48(%rsp),%r10
lea    0x0(,%rdi,8),%rdi
add    %rbp,%rdi
mov    %r13,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rax,8),%xmm0
movsd  %xmm0,(%rsi,%rbp,1)
movsd  0x8(%r12,%rax,8),%xmm0
movsd  %xmm0,(%rdi,%rbp,1)
movsd  0x10(%r12,%rax,8),%xmm0
movsd  %xmm0,(%rdx,%rbp,1)
movsd  0x18(%r12,%rax,8),%xmm0
movsd  %xmm0,(%rcx,%rbp,1)
add    $0x4,%rax
add    %r14,%rbp
cmp    %rax,%r10
jne    1930 <implicit_precalc_2Dx+0x7e0>
jmp    1420 <implicit_precalc_2Dx+0x2d0>
xor    %eax,%eax
testb  $0x1,0x100(%rsp)
01
jne    1832 <implicit_precalc_2Dx+0x6e2>
jmp    1858 <implicit_precalc_2Dx+0x708>
xor    %eax,%eax
call   1050 <tridiag_free@plt>
mov    0x38(%rsp),%rdi
call   1030 <free@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x30(%rsp),%rdi
call   1030 <free@plt>
mov    %r12,%rdi
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

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

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