#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 *);
int int_min(int, int);
double kernel_value_by_name(double *, double *, int, void *);
scalar_t__ malloc(int);
void ekcpd_compute(double *signal, int n_samples, int n_dims, int n_bkps,
                   int min_size, void *kernelDescObj, int *M_path) {
  int t, s, k;
  int n_bkps_max;
  double *D, *S, *M_V;
  double c_cost, c_cost_sum, c_r, diag_element;
  D = (double *)malloc((n_samples + 1) * sizeof(double));
  S = (double *)malloc((n_samples + 1) * sizeof(double));
  M_V = (double *)malloc((n_samples + 1) * (n_bkps + 1) * sizeof(double));
  for (t = 0; t < (n_samples + 1); t++) {
    D[t] = 0.0;
    S[t] = 0.0;
    for (k = 0; k < (n_bkps + 1); k++) {
      M_V[t * (n_bkps + 1) + k] = 0.0;
      M_path[t * (n_bkps + 1) + k] = 0;
    }
  }
  for (t = 1; t < (n_samples + 1); t++) {
    diag_element = kernel_value_by_name(&(signal[(t - 1) * n_dims]),
                                        &(signal[(t - 1) * n_dims]), n_dims,
                                        kernelDescObj);
    D[t] = D[t - 1] + diag_element;
    c_r = 0.0;
    for (s = t - 1; s >= 0; s--) {
      c_r += kernel_value_by_name(&(signal[s * n_dims]),
                                  &(signal[(t - 1) * n_dims]), n_dims,
                                  kernelDescObj);
      S[s] += 2 * c_r - diag_element;
    }
    M_V[t * (n_bkps + 1)] = D[t] - S[0] / t;
    for (s = min_size; s < t - min_size + 1; s++) {
      c_cost = D[t] - D[s] - S[s] / (t - s);
      n_bkps_max = int_min(n_bkps, s / min_size);
      for (k = 1; k <= n_bkps_max; k++) {
        c_cost_sum = M_V[s * (n_bkps + 1) + (k - 1)] + c_cost;
        if (s == k * min_size) {
          M_V[t * (n_bkps + 1) + k] = c_cost_sum;
          M_path[t * (n_bkps + 1) + k] = s;
          continue;
        }
        if (M_V[t * (n_bkps + 1) + k] > c_cost_sum) {
          M_V[t * (n_bkps + 1) + k] = c_cost_sum;
          M_path[t * (n_bkps + 1) + k] = s;
        }
      }
    }
  }
  free(D);
  free(S);
  free(M_V);
  return;
}


x86 assembly (clang, -O0):
<ekcpd_compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    125b <ekcpd_compute+0x11b>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1248 <ekcpd_compute+0x108>
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11ee <ekcpd_compute+0xae>
jmp    124d <ekcpd_compute+0x10d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b6 <ekcpd_compute+0x76>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    154c <ekcpd_compute+0x40c>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1050 <kernel_value_by_name@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x68(%rbp),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jl     137b <ekcpd_compute+0x23b>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x24(%rbp),%eax
sub    $0x1,%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x10(%rbp),%edx
mov    -0x20(%rbp),%rcx
call   1050 <kernel_value_by_name@plt>
addsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
movsd  -0x68(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x28(%rbp)
jmp    12e7 <ekcpd_compute+0x1a7>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movsd  (%rax),%xmm1
cvtsi2sdl -0x24(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    -0x18(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    1539 <ekcpd_compute+0x3f9>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x28(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x24(%rbp),%eax
sub    -0x28(%rbp),%eax
cvtsi2sd %eax,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%eax
cltd
idivl  -0x18(%rbp)
mov    %eax,%esi
call   1060 <int_min@plt>
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jg     1526 <ekcpd_compute+0x3e6>
mov    -0x48(%rbp),%rax
mov    -0x28(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
mov    -0x2c(%rbp),%edx
sub    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x2c(%rbp),%ecx
imul   -0x18(%rbp),%ecx
cmp    %ecx,%eax
jne    14b1 <ekcpd_compute+0x371>
movsd  -0x58(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%edx
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%esi
add    $0x1,%esi
imul   %esi,%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1518 <ekcpd_compute+0x3d8>
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x58(%rbp),%xmm0
jbe    1513 <ekcpd_compute+0x3d3>
movsd  -0x58(%rbp),%xmm0
mov    -0x48(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%edx
add    $0x1,%edx
imul   %edx,%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%edx
mov    0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x14(%rbp),%esi
add    $0x1,%esi
imul   %esi,%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1518 <ekcpd_compute+0x3d8>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1428 <ekcpd_compute+0x2e8>
jmp    152b <ekcpd_compute+0x3eb>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13bb <ekcpd_compute+0x27b>
jmp    153e <ekcpd_compute+0x3fe>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1262 <ekcpd_compute+0x122>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ekcpd_compute>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %r9,0x88(%rsp)
mov    %r8d,%r12d
mov    %ecx,%r14d
mov    %edx,0x34(%rsp)
mov    %esi,%ebp
mov    %rdi,0x58(%rsp)
mov    0x100(%rsp),%r15
lea    0x8(,%rbp,8),%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,0x10(%rsp)
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,0x8(%rsp)
mov    %r14,0x80(%rsp)
lea    0x1(%r14),%eax
mov    %rax,(%rsp)
imul   %eax,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
test   %ebp,%ebp
js     167c <ekcpd_compute+0x53c>
mov    %rbp,0x40(%rsp)
lea    0x1(%rbp),%eax
movslq (%rsp),%rcx
mov    %r12d,%r8d
mov    %eax,%r12d
mov    %ecx,%ebp
mov    %ebp,%r11d
and    $0xfffffffc,%r11d
lea    -0x4(%r11),%rax
mov    %rax,0x20(%rsp)
shr    $0x2,%rax
add    $0x1,%rax
mov    %eax,%esi
and    $0x3,%esi
and    $0xfffffffffffffffc,%rax
mov    %rax,0x90(%rsp)
lea    0x38(%r15),%rbx
lea    0x0(,%rcx,4),%rax
mov    %rax,0x70(%rsp)
lea    0x70(%rdi),%rdx
mov    %rcx,0x50(%rsp)
lea    0x0(,%rcx,8),%rax
mov    %rax,0x68(%rsp)
lea    0x8(%r15),%r13
lea    0x10(%rdi),%r14
mov    %rsi,0x18(%rsp)
mov    %rsi,%rcx
shl    $0x4,%rcx
xor    %eax,%eax
xorpd  %xmm0,%xmm0
mov    %r15,0x38(%rsp)
mov    %r15,%rsi
mov    %rdi,0x48(%rsp)
mov    %rdi,%r15
mov    %r8d,%r10d
mov    %r8d,0x2c(%rsp)
mov    0x8(%rsp),%r8
mov    %rbp,0x78(%rsp)
mov    0x68(%rsp),%r9
jmp    1284 <ekcpd_compute+0x144>
nopl   (%rax)
add    $0x1,%rax
mov    0x70(%rsp),%rdi
add    %rdi,%rbx
add    %r9,%rdx
add    %rdi,%r13
add    %r9,%r14
add    %r9,%r15
add    %rdi,%rsi
cmp    %r12,%rax
je     139d <ekcpd_compute+0x25d>
mov    0x10(%rsp),%rdi
movq   $0x0,(%rdi,%rax,8)
movq   $0x0,(%r8,%rax,8)
cmpl   $0x0,0x80(%rsp)
js     1260 <ekcpd_compute+0x120>
cmpl   $0x4,(%rsp)
jae    12b0 <ekcpd_compute+0x170>
xor    %edi,%edi
jmp    1380 <ekcpd_compute+0x240>
cmpq   $0xc,0x20(%rsp)
jae    12bc <ekcpd_compute+0x17c>
xor    %edi,%edi
jmp    1321 <ekcpd_compute+0x1e1>
mov    0x90(%rsp),%rbp
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
movupd %xmm0,-0x70(%rdx,%rdi,8)
movupd %xmm0,-0x60(%rdx,%rdi,8)
movupd %xmm0,-0x38(%rbx,%rdi,4)
movupd %xmm0,-0x50(%rdx,%rdi,8)
movupd %xmm0,-0x40(%rdx,%rdi,8)
movupd %xmm0,-0x28(%rbx,%rdi,4)
movupd %xmm0,-0x30(%rdx,%rdi,8)
movupd %xmm0,-0x20(%rdx,%rdi,8)
movupd %xmm0,-0x18(%rbx,%rdi,4)
movupd %xmm0,-0x10(%rdx,%rdi,8)
movupd %xmm0,(%rdx,%rdi,8)
movupd %xmm0,-0x8(%rbx,%rdi,4)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rbp
jne    12d0 <ekcpd_compute+0x190>
cmpq   $0x0,0x18(%rsp)
je     135d <ekcpd_compute+0x21d>
lea    0x0(,%rdi,4),%rbp
add    %r13,%rbp
lea    (%r14,%rdi,8),%rdi
xor    %r8d,%r8d
nopl   0x0(%rax,%rax,1)
movupd %xmm0,-0x10(%rdi,%r8,2)
movupd %xmm0,(%rdi,%r8,2)
movupd %xmm0,-0x8(%rbp,%r8,1)
add    $0x10,%r8
cmp    %r8,%rcx
jne    1340 <ekcpd_compute+0x200>
mov    %r11,%rdi
mov    0x78(%rsp),%rbp
cmp    %rbp,%r11
mov    0x2c(%rsp),%r10d
mov    0x8(%rsp),%r8
je     1260 <ekcpd_compute+0x120>
nopl   0x0(%rax,%rax,1)
movq   $0x0,(%r15,%rdi,8)
movl   $0x0,(%rsi,%rdi,4)
add    $0x1,%rdi
cmp    %rdi,%rbp
jne    1380 <ekcpd_compute+0x240>
jmp    1260 <ekcpd_compute+0x120>
mov    0x40(%rsp),%rbp
test   %ebp,%ebp
mov    0x48(%rsp),%rdi
mov    0x38(%rsp),%rsi
jle    167c <ekcpd_compute+0x53c>
movslq 0x34(%rsp),%rax
movslq %r10d,%rcx
mov    $0x2,%edx
sub    %ecx,%edx
mov    %edx,0x30(%rsp)
mov    %ebp,%edx
mov    %rdx,0xb0(%rsp)
mov    %rax,0xb8(%rsp)
lea    0x0(,%rax,8),%rax
mov    %rax,0xa8(%rsp)
neg    %rax
mov    %rax,0xa0(%rsp)
mov    0x50(%rsp),%rax
lea    (%rsi,%rax,4),%r13
add    $0x4,%r13
lea    (%rdi,%rax,8),%r12
add    $0x8,%r12
mov    (%rsp),%rax
mov    %rcx,0x60(%rsp)
imul   %ecx,%eax
mov    %rax,(%rsp)
mov    $0x1,%r9d
xor    %ebp,%ebp
mov    0x58(%rsp),%rbx
jmp    146a <ekcpd_compute+0x32a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r9
mov    0x40(%rsp),%rbp
add    $0x1,%rbp
addl   $0x1,0x30(%rsp)
mov    0xc0(%rsp),%rbx
add    0xa8(%rsp),%rbx
add    0x70(%rsp),%r13
add    0x68(%rsp),%r12
cmp    0xb0(%rsp),%rbp
je     167c <ekcpd_compute+0x53c>
lea    -0x1(%r9),%rax
mov    0xb8(%rsp),%rdx
imul   %rdx,%rax
mov    0x58(%rsp),%rcx
lea    (%rcx,%rax,8),%rdi
mov    %rdi,0x18(%rsp)
mov    %rdi,%rsi
mov    0x88(%rsp),%rcx
mov    %r9,%r14
call   1050 <kernel_value_by_name@plt>
mov    0x10(%rsp),%rax
movsd  -0x8(%rax,%r14,8),%xmm1
addsd  %xmm0,%xmm1
mov    %r14,0x38(%rsp)
movsd  %xmm1,(%rax,%r14,8)
xorpd  0xb42(%rip),%xmm0
movapd %xmm0,0x90(%rsp)
xorpd  %xmm1,%xmm1
mov    %rbx,0xc0(%rsp)
mov    %rbp,0x40(%rsp)
mov    0x8(%rsp),%r14
mov    0xa0(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm1,0x20(%rsp)
mov    %rbx,%rdi
mov    0x18(%rsp),%rsi
mov    0x34(%rsp),%edx
mov    0x88(%rsp),%rcx
call   1050 <kernel_value_by_name@plt>
movsd  0x20(%rsp),%xmm1
addsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
addsd  0x90(%rsp),%xmm0
mov    %ebp,%eax
addsd  (%r14,%rax,8),%xmm0
movsd  %xmm0,(%r14,%rax,8)
lea    -0x1(%rbp),%rax
add    %r15,%rbx
test   %rbp,%rbp
mov    %rax,%rbp
jg     14f0 <ekcpd_compute+0x3b0>
mov    0x10(%rsp),%rax
mov    0x38(%rsp),%r9
movsd  (%rax,%r9,8),%xmm0
movsd  (%r14),%xmm1
cvtsi2sd %r9d,%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
mov    %r9,%rax
imul   0x50(%rsp),%rax
mov    0x48(%rsp),%rdi
movsd  %xmm0,(%rdi,%rax,8)
mov    %r9,%rax
mov    0x60(%rsp),%rcx
sub    %rcx,%rax
cmp    %rcx,%rax
mov    0x2c(%rsp),%ebp
jl     1430 <ekcpd_compute+0x2f0>
mov    %r14,%rcx
xor    %ebx,%ebx
mov    (%rsp),%r14
mov    0x60(%rsp),%r15
jmp    15ca <ekcpd_compute+0x48a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r15
add    $0xffffffff,%ebx
add    %r8,%r14
cmp    %r15d,0x30(%rsp)
mov    0x8(%rsp),%rcx
je     1430 <ekcpd_compute+0x2f0>
mov    0x10(%rsp),%rax
movsd  (%rax,%r9,8),%xmm0
subsd  (%rax,%r15,8),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  (%rcx,%r15,8),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %r15d,%eax
cltd
idiv   %ebp
mov    0x80(%rsp),%rdi
mov    %eax,%esi
call   1060 <int_min@plt>
movsd  0x20(%rsp),%xmm2
mov    0x38(%rsp),%r9
mov    0x48(%rsp),%rdi
test   %eax,%eax
mov    0x78(%rsp),%r8
jle    15b0 <ekcpd_compute+0x470>
mov    %r9d,%ecx
sub    %r15d,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
movsd  0x18(%rsp),%xmm1
divsd  %xmm0,%xmm1
subsd  %xmm1,%xmm2
mov    %eax,%eax
xor    %ecx,%ecx
mov    %ebx,%edx
jmp    165a <ekcpd_compute+0x51a>
xchg   %ax,%ax
movsd  %xmm0,(%r12,%rcx,8)
mov    %r15d,0x0(%r13,%rcx,4)
add    %ebp,%edx
add    $0x1,%rcx
cmp    %rcx,%rax
je     15b0 <ekcpd_compute+0x470>
lea    (%r14,%rcx,1),%esi
movslq %esi,%rsi
movsd  (%rdi,%rsi,8),%xmm0
addsd  %xmm2,%xmm0
test   %edx,%edx
je     1640 <ekcpd_compute+0x500>
movsd  (%r12,%rcx,8),%xmm1
ucomisd %xmm0,%xmm1
ja     1640 <ekcpd_compute+0x500>
jmp    164b <ekcpd_compute+0x50b>
mov    %rdi,%rbx
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ekcpd_compute(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5, i32* %6) {
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
store double* %0, double** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store i32* %6, i32** %14
%26 = load i32, i32* %9
%27 = add nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 8
%30 = trunc i64 %29 to i32
%31 = call i64 @malloc(i32 %30)
%32 = inttoptr i64 %31 to double*
store double* %32, double** %19
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = mul i64 %35, 8
%37 = trunc i64 %36 to i32
%38 = call i64 @malloc(i32 %37)
%39 = inttoptr i64 %38 to double*
store double* %39, double** %20
%40 = load i32, i32* %9
%41 = add nsw i32 %40, 1
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
%44 = mul nsw i32 %41, %43
%45 = sext i32 %44 to i64
%46 = mul i64 %45, 8
%47 = trunc i64 %46 to i32
%48 = call i64 @malloc(i32 %47)
%49 = inttoptr i64 %48 to double*
store double* %49, double** %21
store i32 0, i32* %15
br label %50
50: ; preds = %92, %7
%51 = load i32, i32* %15
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
%54 = icmp slt i32 %51, %53
br i1 %54, label %55, label %95
55: ; preds = %50
%56 = load double*, double** %19
%57 = load i32, i32* %15
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
store double 0.000000e+00, double* %59
%60 = load double*, double** %20
%61 = load i32, i32* %15
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
store double 0.000000e+00, double* %63
store i32 0, i32* %17
br label %64
64: ; preds = %88, %55
%65 = load i32, i32* %17
%66 = load i32, i32* %11
%67 = add nsw i32 %66, 1
%68 = icmp slt i32 %65, %67
br i1 %68, label %69, label %91
69: ; preds = %64
%70 = load double*, double** %21
%71 = load i32, i32* %15
%72 = load i32, i32* %11
%73 = add nsw i32 %72, 1
%74 = mul nsw i32 %71, %73
%75 = load i32, i32* %17
%76 = add nsw i32 %74, %75
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %70, i64 %77
store double 0.000000e+00, double* %78
%79 = load i32*, i32** %14
%80 = load i32, i32* %15
%81 = load i32, i32* %11
%82 = add nsw i32 %81, 1
%83 = mul nsw i32 %80, %82
%84 = load i32, i32* %17
%85 = add nsw i32 %83, %84
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i32, i32* %79, i64 %86
store i32 0, i32* %87
br label %88
88: ; preds = %69
%89 = load i32, i32* %17
%90 = add nsw i32 %89, 1
store i32 %90, i32* %17
br label %64
91: ; preds = %64
br label %92
92: ; preds = %91
%93 = load i32, i32* %15
%94 = add nsw i32 %93, 1
store i32 %94, i32* %15
br label %50
95: ; preds = %50
store i32 1, i32* %15
br label %96
96: ; preds = %311, %95
%97 = load i32, i32* %15
%98 = load i32, i32* %9
%99 = add nsw i32 %98, 1
%100 = icmp slt i32 %97, %99
br i1 %100, label %101, label %314
101: ; preds = %96
%102 = load double*, double** %8
%103 = load i32, i32* %15
%104 = sub nsw i32 %103, 1
%105 = load i32, i32* %10
%106 = mul nsw i32 %104, %105
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds double, double* %102, i64 %107
%109 = load double*, double** %8
%110 = load i32, i32* %15
%111 = sub nsw i32 %110, 1
%112 = load i32, i32* %10
%113 = mul nsw i32 %111, %112
%114 = sext i32 %113 to i64
%115 = getelementptr inbounds double, double* %109, i64 %114
%116 = load i32, i32* %10
%117 = load i8*, i8** %13
%118 = call double @kernel_value_by_name(double* %108, double* %115, i32 %116, i8* %117)
store double %118, double* %25
%119 = load double*, double** %19
%120 = load i32, i32* %15
%121 = sub nsw i32 %120, 1
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds double, double* %119, i64 %122
%124 = load double, double* %123
%125 = load double, double* %25
%126 = fadd double %124, %125
%127 = load double*, double** %19
%128 = load i32, i32* %15
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
store double %126, double* %130
store double 0.000000e+00, double* %24
%131 = load i32, i32* %15
%132 = sub nsw i32 %131, 1
store i32 %132, i32* %16
br label %133
133: ; preds = %165, %101
%134 = load i32, i32* %16
%135 = icmp sge i32 %134, 0
br i1 %135, label %136, label %168
136: ; preds = %133
%137 = load double*, double** %8
%138 = load i32, i32* %16
%139 = load i32, i32* %10
%140 = mul nsw i32 %138, %139
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %137, i64 %141
%143 = load double*, double** %8
%144 = load i32, i32* %15
%145 = sub nsw i32 %144, 1
%146 = load i32, i32* %10
%147 = mul nsw i32 %145, %146
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds double, double* %143, i64 %148
%150 = load i32, i32* %10
%151 = load i8*, i8** %13
%152 = call double @kernel_value_by_name(double* %142, double* %149, i32 %150, i8* %151)
%153 = load double, double* %24
%154 = fadd double %153, %152
store double %154, double* %24
%155 = load double, double* %24
%156 = load double, double* %25
%157 = fneg double %156
%158 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %155, double %157)
%159 = load double*, double** %20
%160 = load i32, i32* %16
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds double, double* %159, i64 %161
%163 = load double, double* %162
%164 = fadd double %163, %158
store double %164, double* %162
br label %165
165: ; preds = %136
%166 = load i32, i32* %16
%167 = add nsw i32 %166, -1
store i32 %167, i32* %16
br label %133
168: ; preds = %133
%169 = load double*, double** %19
%170 = load i32, i32* %15
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds double, double* %169, i64 %171
%173 = load double, double* %172
%174 = load double*, double** %20
%175 = getelementptr inbounds double, double* %174, i64 0
%176 = load double, double* %175
%177 = load i32, i32* %15
%178 = sitofp i32 %177 to double
%179 = fdiv double %176, %178
%180 = fsub double %173, %179
%181 = load double*, double** %21
%182 = load i32, i32* %15
%183 = load i32, i32* %11
%184 = add nsw i32 %183, 1
%185 = mul nsw i32 %182, %184
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds double, double* %181, i64 %186
store double %180, double* %187
%188 = load i32, i32* %12
store i32 %188, i32* %16
br label %189
189: ; preds = %307, %168
%190 = load i32, i32* %16
%191 = load i32, i32* %15
%192 = load i32, i32* %12
%193 = sub nsw i32 %191, %192
%194 = add nsw i32 %193, 1
%195 = icmp slt i32 %190, %194
br i1 %195, label %196, label %310
196: ; preds = %189
%197 = load double*, double** %19
%198 = load i32, i32* %15
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds double, double* %197, i64 %199
%201 = load double, double* %200
%202 = load double*, double** %19
%203 = load i32, i32* %16
%204 = sext i32 %203 to i64
%205 = getelementptr inbounds double, double* %202, i64 %204
%206 = load double, double* %205
%207 = fsub double %201, %206
%208 = load double*, double** %20
%209 = load i32, i32* %16
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds double, double* %208, i64 %210
%212 = load double, double* %211
%213 = load i32, i32* %15
%214 = load i32, i32* %16
%215 = sub nsw i32 %213, %214
%216 = sitofp i32 %215 to double
%217 = fdiv double %212, %216
%218 = fsub double %207, %217
store double %218, double* %22
%219 = load i32, i32* %11
%220 = load i32, i32* %16
%221 = load i32, i32* %12
%222 = sdiv i32 %220, %221
%223 = call i32 @int_min(i32 %219, i32 %222)
store i32 %223, i32* %18
store i32 1, i32* %17
br label %224
224: ; preds = %303, %196
%225 = load i32, i32* %17
%226 = load i32, i32* %18
%227 = icmp sle i32 %225, %226
br i1 %227, label %228, label %306
228: ; preds = %224
%229 = load double*, double** %21
%230 = load i32, i32* %16
%231 = load i32, i32* %11
%232 = add nsw i32 %231, 1
%233 = mul nsw i32 %230, %232
%234 = load i32, i32* %17
%235 = sub nsw i32 %234, 1
%236 = add nsw i32 %233, %235
%237 = sext i32 %236 to i64
%238 = getelementptr inbounds double, double* %229, i64 %237
%239 = load double, double* %238
%240 = load double, double* %22
%241 = fadd double %239, %240
store double %241, double* %23
%242 = load i32, i32* %16
%243 = load i32, i32* %17
%244 = load i32, i32* %12
%245 = mul nsw i32 %243, %244
%246 = icmp eq i32 %242, %245
br i1 %246, label %247, label %268
247: ; preds = %228
%248 = load double, double* %23
%249 = load double*, double** %21
%250 = load i32, i32* %15
%251 = load i32, i32* %11
%252 = add nsw i32 %251, 1
%253 = mul nsw i32 %250, %252
%254 = load i32, i32* %17
%255 = add nsw i32 %253, %254
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds double, double* %249, i64 %256
store double %248, double* %257
%258 = load i32, i32* %16
%259 = load i32*, i32** %14
%260 = load i32, i32* %15
%261 = load i32, i32* %11
%262 = add nsw i32 %261, 1
%263 = mul nsw i32 %260, %262
%264 = load i32, i32* %17
%265 = add nsw i32 %263, %264
%266 = sext i32 %265 to i64
%267 = getelementptr inbounds i32, i32* %259, i64 %266
store i32 %258, i32* %267
br label %303
268: ; preds = %228
%269 = load double*, double** %21
%270 = load i32, i32* %15
%271 = load i32, i32* %11
%272 = add nsw i32 %271, 1
%273 = mul nsw i32 %270, %272
%274 = load i32, i32* %17
%275 = add nsw i32 %273, %274
%276 = sext i32 %275 to i64
%277 = getelementptr inbounds double, double* %269, i64 %276
%278 = load double, double* %277
%279 = load double, double* %23
%280 = fcmp ogt double %278, %279
br i1 %280, label %281, label %302
281: ; preds = %268
%282 = load double, double* %23
%283 = load double*, double** %21
%284 = load i32, i32* %15
%285 = load i32, i32* %11
%286 = add nsw i32 %285, 1
%287 = mul nsw i32 %284, %286
%288 = load i32, i32* %17
%289 = add nsw i32 %287, %288
%290 = sext i32 %289 to i64
%291 = getelementptr inbounds double, double* %283, i64 %290
store double %282, double* %291
%292 = load i32, i32* %16
%293 = load i32*, i32** %14
%294 = load i32, i32* %15
%295 = load i32, i32* %11
%296 = add nsw i32 %295, 1
%297 = mul nsw i32 %294, %296
%298 = load i32, i32* %17
%299 = add nsw i32 %297, %298
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds i32, i32* %293, i64 %300
store i32 %292, i32* %301
br label %302
302: ; preds = %281, %268
br label %303
303: ; preds = %302, %247
%304 = load i32, i32* %17
%305 = add nsw i32 %304, 1
store i32 %305, i32* %17
br label %224
306: ; preds = %224
br label %307
307: ; preds = %306
%308 = load i32, i32* %16
%309 = add nsw i32 %308, 1
store i32 %309, i32* %16
br label %189
310: ; preds = %189
br label %311
311: ; preds = %310
%312 = load i32, i32* %15
%313 = add nsw i32 %312, 1
store i32 %313, i32* %15
br label %96
314: ; preds = %96
%315 = load double*, double** %19
%316 = call i32 @free(double* %315)
%317 = load double*, double** %20
%318 = call i32 @free(double* %317)
%319 = load double*, double** %21
%320 = call i32 @free(double* %319)
ret void
}

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