#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 */
double *alloca(int);
int /*<<< orphan*/ assert(int);
double exp(double);
scalar_t__ log(double);
double dirichlet_moment_match(int num_dims, int num_bags, double *counts,
                              double *alphas) {
  double *sample_mean = alloca(num_dims * sizeof(double));
  double *sample_variance = alloca(num_dims * sizeof(double));
  double *bag_total = alloca(num_bags * sizeof(double));
  double x, y, alphas_sum;
  int i, j;
  for (i = 0; i < num_bags; i++) {
    bag_total[i] = 0;
    for (j = 0; j < num_dims; j++)
      bag_total[i] += (counts[(i * num_dims) + j]);
    assert(bag_total[i]);
  }
  for (j = 0; j < num_dims; j++) {
    sample_mean[j] = 0;
    for (i = 0; i < num_bags; i++)
      sample_mean[j] +=
          (counts[(i * num_dims) + j]) / (bag_total[i] * num_bags);
    assert(sample_mean[j] == sample_mean[j]);
  }
  for (j = 0; j < num_dims; j++) {
    sample_variance[j] = 0;
    for (i = 0; i < num_bags; i++) {
      x = (counts[(i * num_dims) + j]) / bag_total[i];
      sample_variance[j] += x * x;
    }
    sample_variance[j] /= num_bags;
    sample_variance[j] -= (sample_mean[j] * sample_mean[j]);
    assert(sample_variance[j] == sample_variance[j]);
  }
  x = 0;
  for (j = 0; j < num_dims - 1; j++) {
    assert(sample_variance[j] > 0);
    y = ((sample_mean[j] * (1 - sample_mean[j])) / sample_variance[j]) - 1;
    assert(y > 0);
    x += log(y);
    assert(x == x);
  }
  x *= 1.0 / (num_dims - 1.0);
  alphas_sum = exp(x);
  assert(alphas_sum == alphas_sum);
  for (j = 0; j < num_dims; j++)
    alphas[j] = sample_mean[j] * alphas_sum;
  return alphas_sum;
}


x86 assembly (clang, -O0):
<dirichlet_moment_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x20(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x28(%rbp)
movslq -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <alloca@plt>
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121b <dirichlet_moment_match+0xdb>
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11fb <dirichlet_moment_match+0xbb>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    11b9 <dirichlet_moment_match+0x79>
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
cvttsd2si (%rax,%rcx,8),%edi
call   1030 <assert@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1196 <dirichlet_moment_match+0x56>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    12db <dirichlet_moment_match+0x19b>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12a1 <dirichlet_moment_match+0x161>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1245 <dirichlet_moment_match+0x105>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1222 <dirichlet_moment_match+0xe2>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    140b <dirichlet_moment_match+0x2cb>
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    136b <dirichlet_moment_match+0x22b>
mov    -0x10(%rbp),%rax
mov    -0x4c(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x50(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1305 <dirichlet_moment_match+0x1c5>
cvtsi2sdl -0x8(%rbp),%xmm1
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rdx
movabs $0x8000000000000000,%rsi
xor    %rsi,%rdx
movq   %rdx,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12e2 <dirichlet_moment_match+0x1a2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    14ec <dirichlet_moment_match+0x3ac>
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  0xb97(%rip),%xmm1
subsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
movsd  0xb79(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsd  -0x40(%rbp),%xmm0
call   1060 <log@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
ucomisd -0x38(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    141a <dirichlet_moment_match+0x2da>
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xb07(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xafb(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
ucomisd -0x48(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    157e <dirichlet_moment_match+0x43e>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1545 <dirichlet_moment_match+0x405>
movsd  -0x48(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirichlet_moment_match>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rcx,0x48(%rsp)
mov    %rdx,0x20(%rsp)
mov    %esi,%ebx
mov    %edi,%r14d
lea    0x0(,%r14,8),%ebp
mov    %ebp,%edi
call   1040 <alloca@plt>
mov    %rax,0x30(%rsp)
mov    %ebp,%edi
call   1040 <alloca@plt>
mov    %rax,0x50(%rsp)
lea    0x0(,%rbx,8),%edi
call   1040 <alloca@plt>
mov    %rax,%r13
mov    %ebx,%eax
mov    %rax,(%rsp)
mov    %r14,0x10(%rsp)
mov    %r14d,%edx
mov    %rbx,0x28(%rsp)
test   %ebx,%ebx
mov    %rdx,0x40(%rsp)
jle    12aa <dirichlet_moment_match+0x16a>
movslq 0x10(%rsp),%rax
lea    -0x1(%rdx),%rcx
mov    %rcx,0x38(%rsp)
mov    %edx,%ebx
and    $0x3,%ebx
mov    %edx,%r12d
and    $0xfffffffc,%r12d
mov    0x20(%rsp),%r15
lea    0x18(%r15),%rbp
shl    $0x3,%rax
mov    %rax,0x18(%rsp)
xor    %r14d,%r14d
jmp    120b <dirichlet_moment_match+0xcb>
nopl   (%rax)
xorpd  %xmm0,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <assert@plt>
add    $0x1,%r14
mov    0x18(%rsp),%rax
add    %rax,%rbp
add    %rax,%r15
cmp    (%rsp),%r14
mov    0x40(%rsp),%rdx
je     12aa <dirichlet_moment_match+0x16a>
movq   $0x0,0x0(%r13,%r14,8)
cmpl   $0x0,0x10(%rsp)
jle    11e0 <dirichlet_moment_match+0xa0>
cmpq   $0x3,0x38(%rsp)
jae    1230 <dirichlet_moment_match+0xf0>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
jmp    127d <dirichlet_moment_match+0x13d>
nopl   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
addsd  -0x18(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x0(%r13,%r14,8)
addsd  -0x10(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x0(%r13,%r14,8)
addsd  -0x8(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x0(%r13,%r14,8)
addsd  0x0(%rbp,%rax,8),%xmm0
movsd  %xmm0,0x0(%r13,%r14,8)
add    $0x4,%rax
cmp    %rax,%r12
jne    1240 <dirichlet_moment_match+0x100>
test   %rbx,%rbx
je     11e4 <dirichlet_moment_match+0xa4>
lea    (%r15,%rax,8),%rax
xor    %ecx,%ecx
nopl   0x0(%rax)
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,0x0(%r13,%r14,8)
add    $0x1,%rcx
cmp    %rcx,%rbx
jne    1290 <dirichlet_moment_match+0x150>
jmp    11e4 <dirichlet_moment_match+0xa4>
mov    0x10(%rsp),%r12
test   %r12d,%r12d
jle    15f7 <dirichlet_moment_match+0x4b7>
cvtsi2sdl 0x28(%rsp),%xmm3
mov    (%rsp),%rbx
lea    -0x1(%rbx),%rax
mov    %rax,0x38(%rsp)
and    $0xfffffffe,%ebx
mov    %rdx,%r12
shl    $0x4,%r12
xor    %ebp,%ebp
mov    0x20(%rsp),%r14
mov    0x30(%rsp),%r15
movsd  %xmm3,0x18(%rsp)
jmp    131f <dirichlet_moment_match+0x1df>
nopl   0x0(%rax)
xorpd  %xmm0,%xmm0
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
call   1030 <assert@plt>
movsd  0x18(%rsp),%xmm3
mov    0x40(%rsp),%rdx
add    $0x1,%rbp
add    $0x8,%r14
cmp    %rdx,%rbp
je     13e2 <dirichlet_moment_match+0x2a2>
movq   $0x0,(%r15,%rbp,8)
cmpl   $0x0,0x28(%rsp)
jle    12f0 <dirichlet_moment_match+0x1b0>
cmpq   $0x0,0x38(%rsp)
je     13a0 <dirichlet_moment_match+0x260>
xorpd  %xmm0,%xmm0
mov    %r14,%rcx
xor    %eax,%eax
nop
movsd  (%rcx),%xmm1
movsd  0x0(%r13,%rax,8),%xmm2
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rbp,8)
movsd  (%rcx,%rdx,8),%xmm0
movsd  0x8(%r13,%rax,8),%xmm2
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15,%rbp,8)
add    $0x2,%rax
add    %r12,%rcx
cmp    %rax,%rbx
jne    1340 <dirichlet_moment_match+0x200>
testb  $0x1,(%rsp)
je     12f4 <dirichlet_moment_match+0x1b4>
jmp    13b0 <dirichlet_moment_match+0x270>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
testb  $0x1,(%rsp)
je     12f4 <dirichlet_moment_match+0x1b4>
mov    %rax,%rcx
imul   %rdx,%rcx
add    %rbp,%rcx
mov    0x20(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
movsd  0x0(%r13,%rax,8),%xmm2
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15,%rbp,8)
jmp    12f4 <dirichlet_moment_match+0x1b4>
cmpl   $0x0,0x10(%rsp)
mov    0x50(%rsp),%rbp
jle    160c <dirichlet_moment_match+0x4cc>
mov    (%rsp),%r14
and    $0xfffffffe,%r14d
xor    %r15d,%r15d
mov    0x20(%rsp),%rbx
jmp    1464 <dirichlet_moment_match+0x324>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorpd  %xmm0,%xmm0
movsd  0x18(%rsp),%xmm2
divsd  %xmm2,%xmm0
movsd  %xmm0,0x0(%rbp,%r15,8)
mov    0x30(%rsp),%rax
movsd  (%rax,%r15,8),%xmm1
mulsd  %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%r15,8)
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
call   1030 <assert@plt>
mov    0x40(%rsp),%rdx
add    $0x1,%r15
add    $0x8,%rbx
cmp    %rdx,%r15
je     1525 <dirichlet_moment_match+0x3e5>
movq   $0x0,0x0(%rbp,%r15,8)
cmpl   $0x0,0x28(%rsp)
jle    1410 <dirichlet_moment_match+0x2d0>
cmpq   $0x0,0x38(%rsp)
je     14e0 <dirichlet_moment_match+0x3a0>
xorpd  %xmm0,%xmm0
mov    %rbx,%rcx
xor    %eax,%eax
movsd  0x18(%rsp),%xmm2
nopl   0x0(%rax,%rax,1)
movsd  (%rcx),%xmm1
divsd  0x0(%r13,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%rbp,%r15,8)
movsd  (%rcx,%rdx,8),%xmm0
divsd  0x8(%r13,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%r15,8)
add    $0x2,%rax
add    %r12,%rcx
cmp    %rax,%r14
jne    1490 <dirichlet_moment_match+0x350>
testb  $0x1,(%rsp)
je     141a <dirichlet_moment_match+0x2da>
jmp    14f6 <dirichlet_moment_match+0x3b6>
nopl   (%rax)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
movsd  0x18(%rsp),%xmm2
testb  $0x1,(%rsp)
je     141a <dirichlet_moment_match+0x2da>
mov    %rax,%rcx
imul   %rdx,%rcx
add    %r15,%rcx
mov    0x20(%rsp),%rdx
movsd  (%rdx,%rcx,8),%xmm1
divsd  0x0(%r13,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp,%r15,8)
jmp    141a <dirichlet_moment_match+0x2da>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    0x10(%rsp),%r12
cmp    $0x2,%r12d
mov    0x48(%rsp),%rbx
mov    0x30(%rsp),%r15
jl     161f <dirichlet_moment_match+0x4df>
mov    %rbp,%r13
lea    -0x1(%r12),%r14d
xor    %ebp,%ebp
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
nopw   0x0(%rax,%rax,1)
movsd  0x0(%r13,%rbp,8),%xmm0
xor    %edi,%edi
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
seta   %dil
call   1030 <assert@plt>
movsd  (%r15,%rbp,8),%xmm0
movsd  0xa78(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
divsd  0x0(%r13,%rbp,8),%xmm1
addsd  0xa69(%rip),%xmm1
movsd  %xmm1,0x28(%rsp)
xor    %edi,%edi
ucomisd 0xa61(%rip),%xmm1
seta   %dil
call   1030 <assert@plt>
movsd  0x28(%rsp),%xmm0
call   1060 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  (%rsp),%xmm1
addsd  %xmm0,%xmm1
xor    %edi,%edi
movsd  %xmm1,(%rsp)
ucomisd %xmm1,%xmm1
setnp  %dil
call   1030 <assert@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1560 <dirichlet_moment_match+0x420>
jmp    161f <dirichlet_moment_match+0x4df>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    0x48(%rsp),%rbx
mov    0x30(%rsp),%r15
jmp    161f <dirichlet_moment_match+0x4df>
xorpd  %xmm0,%xmm0
movsd  %xmm0,(%rsp)
mov    0x48(%rsp),%rbx
mov    0x10(%rsp),%r12
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
addsd  0x9d9(%rip),%xmm1
movsd  0x9c9(%rip),%xmm0
divsd  %xmm1,%xmm0
mulsd  (%rsp),%xmm0
call   1050 <exp@plt>
movapd %xmm0,(%rsp)
xor    %edi,%edi
ucomisd %xmm0,%xmm0
setnp  %dil
call   1030 <assert@plt>
movapd (%rsp),%xmm0
test   %r12d,%r12d
mov    0x40(%rsp),%rdi
jle    17ca <dirichlet_moment_match+0x68a>
cmp    $0x4,%r12d
jb     168c <dirichlet_moment_match+0x54c>
lea    (%r15,%rdi,8),%rax
cmp    %rbx,%rax
jbe    1720 <dirichlet_moment_match+0x5e0>
lea    (%rbx,%rdi,8),%rax
cmp    %rax,%r15
jae    1720 <dirichlet_moment_match+0x5e0>
xor    %eax,%eax
mov    %rax,%rcx
not    %rcx
add    %rdi,%rcx
mov    %rdi,%rdx
and    $0x3,%rdx
je     16b9 <dirichlet_moment_match+0x579>
movsd  (%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
add    $0x1,%rax
add    $0xffffffffffffffff,%rdx
jne    16a0 <dirichlet_moment_match+0x560>
cmp    $0x3,%rcx
jb     17ca <dirichlet_moment_match+0x68a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
movsd  0x8(%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rbx,%rax,8)
movsd  0x10(%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rbx,%rax,8)
movsd  0x18(%r15,%rax,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rbx,%rax,8)
add    $0x4,%rax
cmp    %rax,%rdi
jne    16d0 <dirichlet_moment_match+0x590>
jmp    17ca <dirichlet_moment_match+0x68a>
mov    %edi,%eax
and    $0xfffffffc,%eax
movapd %xmm0,%xmm3
unpcklpd %xmm0,%xmm3
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     17d9 <dirichlet_moment_match+0x699>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
xchg   %ax,%ax
movupd (%r15,%rcx,8),%xmm1
movupd 0x10(%r15,%rcx,8),%xmm2
mulpd  %xmm3,%xmm1
mulpd  %xmm3,%xmm2
movupd %xmm1,(%rbx,%rcx,8)
movupd %xmm2,0x10(%rbx,%rcx,8)
movupd 0x20(%r15,%rcx,8),%xmm1
movupd 0x30(%r15,%rcx,8),%xmm2
mulpd  %xmm3,%xmm1
mulpd  %xmm3,%xmm2
movupd %xmm1,0x20(%rbx,%rcx,8)
movupd %xmm2,0x30(%rbx,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1750 <dirichlet_moment_match+0x610>
test   $0x1,%dl
je     17c1 <dirichlet_moment_match+0x681>
movupd (%r15,%rcx,8),%xmm1
movupd 0x10(%r15,%rcx,8),%xmm2
mulpd  %xmm3,%xmm1
mulpd  %xmm3,%xmm2
movupd %xmm1,(%rbx,%rcx,8)
movupd %xmm2,0x10(%rbx,%rcx,8)
cmp    %rdi,%rax
jne    168e <dirichlet_moment_match+0x54e>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
test   $0x1,%dl
jne    17a1 <dirichlet_moment_match+0x661>
jmp    17c1 <dirichlet_moment_match+0x681>

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

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