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


x86 assembly (clang, -O0):
<implicit_precalc_3Dz>:
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 0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x48(%rbp)
movslq 0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x50(%rbp)
movslq 0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x58(%rbp)
movslq 0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x60(%rbp)
movslq 0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x68(%rbp)
mov    0x10(%rbp),%edi
call   1070 <tridiag_malloc@plt>
mov    0x18(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    0x20(%rbp),%eax
jge    1329 <implicit_precalc_3Dz+0x1d9>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    1316 <implicit_precalc_3Dz+0x1c6>
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    12cb <implicit_precalc_3Dz+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 -0x3c(%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 -0x3c(%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 -0x3c(%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 -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1211 <implicit_precalc_3Dz+0xc1>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x60(%rbp),%rcx
mov    -0x8(%rbp),%r8
mov    -0x34(%rbp),%eax
imul   -0x30(%rbp),%eax
imul   0x10(%rbp),%eax
mov    -0x38(%rbp),%r9d
imul   0x10(%rbp),%r9d
add    %r9d,%eax
cltq
shl    $0x3,%rax
add    %rax,%r8
mov    0x10(%rbp),%r9d
call   1040 <tridiag_premalloc@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11fe <implicit_precalc_3Dz+0xae>
jmp    131b <implicit_precalc_3Dz+0x1cb>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11eb <implicit_precalc_3Dz+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_3Dz>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    %r9d,0xc(%rsp)
movsd  %xmm0,0x18(%rsp)
mov    %rcx,0xc8(%rsp)
mov    %rdx,0x38(%rsp)
mov    %rsi,0xc0(%rsp)
mov    %rdi,%r14
mov    0x140(%rsp),%r12d
mov    0x138(%rsp),%eax
mov    %eax,0x8(%rsp)
mov    0x130(%rsp),%ebx
lea    0x0(,%rbx,8),%ebp
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,0x50(%rsp)
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,0x48(%rsp)
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,%r13
mov    %ebp,%edi
call   1070 <malloc@plt>
mov    %rax,0x80(%rsp)
mov    %ebx,%edi
call   1080 <tridiag_malloc@plt>
sub    0x8(%rsp),%r12d
mov    %r12d,0x60(%rsp)
jle    156d <implicit_precalc_3Dz+0x40d>
mov    %rbx,%rdx
movsd  0xdee(%rip),%xmm0
divsd  0x18(%rsp),%xmm0
movapd %xmm0,0x70(%rsp)
mov    0x8(%rsp),%ecx
imul   %edx,%ecx
mov    0xc(%rsp),%eax
imul   %eax,%ecx
mov    %edx,%esi
imul   %eax,%esi
mov    %esi,0x24(%rsp)
mov    %edx,%ebx
lea    0x0(,%rbx,8),%rsi
mov    %rsi,0xb8(%rsp)
mov    %eax,%eax
mov    %rax,0xd0(%rsp)
mov    %ebx,%eax
and    $0xfffffffe,%eax
mov    %rax,0xb0(%rsp)
add    $0xfffffffffffffffe,%rax
mov    %rax,0xa8(%rsp)
mov    %rax,%rsi
shr    %rsi
add    $0x1,%rsi
unpcklpd %xmm0,%xmm0
movapd %xmm0,0xe0(%rsp)
mov    %rsi,%rax
mov    %rsi,0xa0(%rsp)
and    $0xfffffffffffffffe,%rsi
mov    %rsi,0x98(%rsp)
lea    0x10(%r14),%rax
mov    %rax,0x90(%rsp)
mov    0x38(%rsp),%rax
add    $0x10,%rax
mov    %rax,0x88(%rsp)
xor    %eax,%eax
mov    %rax,0x28(%rsp)
mov    %ecx,0x5c(%rsp)
mov    %ecx,0x10(%rsp)
mov    %rdx,0x18(%rsp)
mov    %r14,0x30(%rsp)
jmp    12f8 <implicit_precalc_3Dz+0x198>
addl   $0x1,0x8(%rsp)
mov    0x28(%rsp),%rax
add    $0x1,%eax
mov    0x10(%rsp),%ecx
add    0x24(%rsp),%ecx
mov    %ecx,0x10(%rsp)
mov    %rax,0x28(%rsp)
cmp    0x60(%rsp),%eax
je     156d <implicit_precalc_3Dz+0x40d>
cmpl   $0x0,0xc(%rsp)
jle    12d0 <implicit_precalc_3Dz+0x170>
mov    0x24(%rsp),%eax
imul   0x28(%rsp),%eax
add    0x5c(%rsp),%eax
mov    %eax,0x64(%rsp)
mov    0x8(%rsp),%eax
imul   0xc(%rsp),%eax
mov    %rax,0x68(%rsp)
mov    0x10(%rsp),%r12d
xor    %ebp,%ebp
jmp    1375 <implicit_precalc_3Dz+0x215>
nopw   0x0(%rax,%rax,1)
mov    0x68(%rsp),%rax
add    %ebp,%eax
imul   %edx,%eax
movslq %eax,%r8
lea    (%r14,%r8,8),%r8
mov    0x50(%rsp),%rdi
mov    %r15,%rsi
mov    0x48(%rsp),%rdx
mov    %r13,%rcx
mov    0x18(%rsp),%r9
call   1040 <tridiag_premalloc@plt>
mov    0x18(%rsp),%rdx
add    $0x1,%rbp
add    %edx,%r12d
cmp    0xd0(%rsp),%rbp
je     12d0 <implicit_precalc_3Dz+0x170>
test   %edx,%edx
jle    1330 <implicit_precalc_3Dz+0x1d0>
mov    0x68(%rsp),%rax
mov    %rbp,%rcx
lea    (%rax,%rbp,1),%r14d
mov    %ecx,%eax
imul   %edx,%eax
add    0x64(%rsp),%eax
mov    %r12d,0x14(%rsp)
movslq %r12d,%rcx
mov    %rcx,0x40(%rsp)
cltq
mov    0xc0(%rsp),%rcx
lea    (%rcx,%rax,8),%rsi
mov    0xc8(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,0xd8(%rsp)
imul   %edx,%r14d
mov    0x50(%rsp),%rdi
mov    0xb8(%rsp),%r12
mov    %r12,%rdx
call   1060 <memcpy@plt>
mov    0x48(%rsp),%rdi
mov    0xd8(%rsp),%rsi
mov    %r12,%rdx
call   1060 <memcpy@plt>
movslq %r14d,%r8
cmpl   $0x1,0x18(%rsp)
jne    1420 <implicit_precalc_3Dz+0x2c0>
xor    %ecx,%ecx
mov    0x30(%rsp),%r14
movapd 0x70(%rsp),%xmm1
mov    0x14(%rsp),%r12d
mov    0x40(%rsp),%rax
jmp    1502 <implicit_precalc_3Dz+0x3a2>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpq   $0x0,0xa8(%rsp)
je     153d <implicit_precalc_3Dz+0x3dd>
mov    0x90(%rsp),%rcx
mov    0x40(%rsp),%rax
lea    (%rcx,%rax,8),%rdx
mov    0x88(%rsp),%rcx
lea    (%rcx,%rax,8),%rsi
mov    0x98(%rsp),%rdi
xor    %ecx,%ecx
mov    0x30(%rsp),%r14
movapd 0x70(%rsp),%xmm1
movapd 0xe0(%rsp),%xmm2
mov    0x14(%rsp),%r12d
nop
movupd -0x10(%rsi,%rcx,8),%xmm0
addpd  %xmm2,%xmm0
movupd %xmm0,(%r15,%rcx,8)
movupd -0x10(%rdx,%rcx,8),%xmm0
mulpd  %xmm2,%xmm0
movupd %xmm0,0x0(%r13,%rcx,8)
movupd (%rsi,%rcx,8),%xmm0
addpd  %xmm2,%xmm0
movupd %xmm0,0x10(%r15,%rcx,8)
movupd (%rdx,%rcx,8),%xmm0
mulpd  %xmm2,%xmm0
movupd %xmm0,0x10(%r13,%rcx,8)
add    $0x4,%rcx
add    $0xfffffffffffffffe,%rdi
jne    1470 <implicit_precalc_3Dz+0x310>
testb  $0x1,0xa0(%rsp)
01
je     14ee <implicit_precalc_3Dz+0x38e>
lea    (%rcx,%r8,1),%rdx
mov    0x38(%rsp),%rsi
movupd (%rsi,%rdx,8),%xmm0
addpd  %xmm2,%xmm0
movupd %xmm0,(%r15,%rcx,8)
movupd (%r14,%rdx,8),%xmm0
mulpd  %xmm2,%xmm0
movupd %xmm0,0x0(%r13,%rcx,8)
mov    0xb0(%rsp),%rdx
mov    %rdx,%rcx
cmp    %rbx,%rdx
je     133d <implicit_precalc_3Dz+0x1dd>
mov    0x38(%rsp),%rdx
lea    (%rdx,%rax,8),%rdx
lea    (%r14,%rax,8),%rsi
nop
movsd  (%rdx,%rcx,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15,%rcx,8)
movsd  (%rsi,%rcx,8),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%r13,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rbx
jne    1510 <implicit_precalc_3Dz+0x3b0>
jmp    133d <implicit_precalc_3Dz+0x1dd>
xor    %ecx,%ecx
mov    0x30(%rsp),%r14
movapd 0x70(%rsp),%xmm1
movapd 0xe0(%rsp),%xmm2
mov    0x14(%rsp),%r12d
mov    0x40(%rsp),%rax
testb  $0x1,0xa0(%rsp)
01
jne    14c5 <implicit_precalc_3Dz+0x365>
jmp    14ee <implicit_precalc_3Dz+0x38e>
xor    %eax,%eax
call   1050 <tridiag_free@plt>
mov    0x50(%rsp),%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    0x48(%rsp),%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1030 <free@plt>
mov    0x80(%rsp),%rdi
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @implicit_precalc_3Dz(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* %18
%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* %18
%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* %18
%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* %18
%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* %18
%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* %18
%56 = call i32 @tridiag_malloc(i32 %55)
%57 = load i32, i32* %19
store i32 %57, i32* %21
br label %58
58: ; preds = %152, %10
%59 = load i32, i32* %21
%60 = load i32, i32* %20
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %155
62: ; preds = %58
store i32 0, i32* %22
br label %63
63: ; preds = %148, %62
%64 = load i32, i32* %22
%65 = load i32, i32* %17
%66 = icmp slt i32 %64, %65
br i1 %66, label %67, label %151
67: ; preds = %63
store i32 0, i32* %23
br label %68
68: ; preds = %126, %67
%69 = load i32, i32* %23
%70 = load i32, i32* %18
%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* %23
%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* %23
%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* %23
%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* %23
%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* %23
%128 = add nsw i32 %127, 1
store i32 %128, i32* %23
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** %11
%135 = load i32, i32* %21
%136 = load i32, i32* %17
%137 = mul nsw i32 %135, %136
%138 = load i32, i32* %18
%139 = mul nsw i32 %137, %138
%140 = load i32, i32* %22
%141 = load i32, i32* %18
%142 = mul nsw i32 %140, %141
%143 = add nsw i32 %139, %142
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %134, i64 %144
%146 = load i32, i32* %18
%147 = call i32 @tridiag_premalloc(double* %130, double* %131, double* %132, double* %133, double* %145, i32 %146)
br label %148
148: ; preds = %129
%149 = load i32, i32* %22
%150 = add nsw i32 %149, 1
store i32 %150, i32* %22
br label %63
151: ; preds = %63
br label %152
152: ; preds = %151
%153 = load i32, i32* %21
%154 = add nsw i32 %153, 1
store i32 %154, i32* %21
br label %58
155: ; preds = %58
%156 = call i32 (...) @tridiag_free()
%157 = load double*, double** %25
%158 = call i32 @free(double* %157)
%159 = load double*, double** %26
%160 = call i32 @free(double* %159)
%161 = load double*, double** %27
%162 = call i32 @free(double* %161)
%163 = load double*, double** %28
%164 = call i32 @free(double* %163)
%165 = load double*, double** %29
%166 = call i32 @free(double* %165)
ret void
}

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