#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 IncompleteGamma(double, double, double);
double LnGamma(double);
double PointChi2(int, double);
int DiscreteGamma(double freqK[], double rK[], double alpha, double beta, int K,
                  int median) {
  int i;
  double t, factor = alpha / beta * K, lnga1;
  if (median) {
    for (i = 0; i < K; i++)
      rK[i] =
          PointChi2((i * 2. + 1) / (2. * K), 2.0 * (alpha)) / (2.0 * (beta));
    for (i = 0, t = 0; i < K; i++)
      t += rK[i];
    for (i = 0; i < K; i++)
      rK[i] *= factor / t;
  } else {
    lnga1 = LnGamma(alpha + 1);
    for (i = 0; i < K - 1; i++)
      freqK[i] = PointChi2((i + 1.0) / K, 2.0 * (alpha)) / (2.0 * (beta));
    for (i = 0; i < K - 1; i++)
      freqK[i] = IncompleteGamma(freqK[i] * beta, alpha + 1, lnga1);
    rK[0] = freqK[0] * factor;
    rK[K - 1] = (1 - freqK[K - 2]) * factor;
    for (i = 1; i < K - 1; i++)
      rK[i] = (freqK[i] - freqK[i - 1]) * factor;
  }
  for (i = 0; i < K; i++)
    freqK[i] = 1.0 / K;
  return (0);
}


x86 assembly (clang, -O0):
<DiscreteGamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    %edx,-0x24(%rbp)
mov    %ecx,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1273 <DiscreteGamma+0x143>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11f1 <DiscreteGamma+0xc1>
cvtsi2sdl -0x2c(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe6a(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xe61(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xe4d(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <PointChi2@plt>
movsd  0xe3b(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1179 <DiscreteGamma+0x49>
movl   $0x0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1231 <DiscreteGamma+0x101>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1200 <DiscreteGamma+0xd0>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    126e <DiscreteGamma+0x13e>
movsd  -0x40(%rbp),%xmm0
divsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1238 <DiscreteGamma+0x108>
jmp    13fc <DiscreteGamma+0x2cc>
movsd  0xd85(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <LnGamma@plt>
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12fe <DiscreteGamma+0x1ce>
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  0xd51(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xd40(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <PointChi2@plt>
movsd  0xd2e(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1291 <DiscreteGamma+0x161>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    135a <DiscreteGamma+0x22a>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xcd0(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm2
call   1030 <IncompleteGamma@plt>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1305 <DiscreteGamma+0x1d5>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xc7c(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13f7 <DiscreteGamma+0x2c7>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
subsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13a7 <DiscreteGamma+0x277>
jmp    13fc <DiscreteGamma+0x2cc>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    143b <DiscreteGamma+0x30b>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xbe4(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1403 <DiscreteGamma+0x2d3>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DiscreteGamma>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %edx,%r13d
movapd %xmm0,%xmm3
mov    %rsi,%rbx
mov    %rdi,%r15
movapd %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
divsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mov    %edx,%r12d
test   %ecx,%ecx
je     1219 <DiscreteGamma+0xe9>
test   %r13d,%r13d
jle    17af <DiscreteGamma+0x67f>
movapd %xmm2,0x40(%rsp)
movsd  %xmm0,0x20(%rsp)
addsd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
addsd  %xmm3,%xmm3
addsd  %xmm1,%xmm1
xor    %ebp,%ebp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm3,0x10(%rsp)
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  %xmm0,%xmm0
addsd  0xe4d(%rip),%xmm0
divsd  0x28(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm3,%xmm0
call   1040 <PointChi2@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11a0 <DiscreteGamma+0x70>
test   %r13d,%r13d
movsd  0x20(%rsp),%xmm5
movapd 0x40(%rsp),%xmm6
jle    17af <DiscreteGamma+0x67f>
lea    -0x1(%r12),%rcx
mov    %r12d,%eax
and    $0x7,%eax
cmp    $0x7,%rcx
jae    144e <DiscreteGamma+0x31e>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
jmp    1498 <DiscreteGamma+0x368>
movapd %xmm2,0x40(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  0xdd3(%rip),%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm3,0x10(%rsp)
call   1050 <LnGamma@plt>
lea    -0x1(%r13),%eax
mov    %eax,0x1c(%rsp)
cmp    $0x2,%r13d
jl     1320 <DiscreteGamma+0x1f0>
movsd  %xmm0,0x30(%rsp)
mov    %r13,%rbp
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
mov    0x1c(%rsp),%r14d
xor    %r13d,%r13d
movsd  %xmm1,0x10(%rsp)
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
addsd  0xd60(%rip),%xmm0
divsd  0x20(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm1,%xmm0
call   1040 <PointChi2@plt>
movsd  0x10(%rsp),%xmm1
divsd  0x28(%rsp),%xmm0
movsd  %xmm0,(%r15,%r13,8)
add    $0x1,%r13
cmp    %r13,%r14
jne    1290 <DiscreteGamma+0x160>
mov    %rbp,%r13
cmp    $0x2,%r13d
movsd  0x8(%rsp),%xmm3
movsd  0x38(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
jl     1320 <DiscreteGamma+0x1f0>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbp,8),%xmm0
mulsd  %xmm3,%xmm0
call   1030 <IncompleteGamma@plt>
movsd  0x30(%rsp),%xmm2
movsd  0x38(%rsp),%xmm1
movsd  0x8(%rsp),%xmm3
movsd  %xmm0,(%r15,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    12f0 <DiscreteGamma+0x1c0>
movsd  (%r15),%xmm0
movapd 0x40(%rsp),%xmm4
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rbx)
movslq %r13d,%rax
movsd  0xcc2(%rip),%xmm0
subsd  -0x10(%r15,%rax,8),%xmm0
mulsd  %xmm4,%xmm0
mov    0x1c(%rsp),%ecx
movslq %ecx,%rax
movsd  %xmm0,(%rbx,%rax,8)
cmp    $0x3,%r13d
movsd  0x20(%rsp),%xmm5
jl     1666 <DiscreteGamma+0x536>
mov    %ecx,%eax
lea    -0x1(%rax),%rdx
mov    $0x1,%ecx
cmp    $0x4,%rdx
jb     1607 <DiscreteGamma+0x4d7>
lea    0x8(%rbx),%rsi
lea    (%r15,%rax,8),%rdi
cmp    %rdi,%rsi
jae    1394 <DiscreteGamma+0x264>
lea    (%rbx,%rax,8),%rsi
cmp    %r15,%rsi
ja     1607 <DiscreteGamma+0x4d7>
mov    %rdx,%rcx
and    $0xfffffffffffffffc,%rcx
movapd %xmm4,%xmm0
unpcklpd %xmm4,%xmm0
lea    -0x4(%rcx),%rsi
mov    %rsi,%rbp
shr    $0x2,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     15b5 <DiscreteGamma+0x485>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movupd (%r15,%rsi,8),%xmm1
movupd 0x8(%r15,%rsi,8),%xmm2
subpd  %xmm1,%xmm2
movupd 0x10(%r15,%rsi,8),%xmm1
movupd 0x18(%r15,%rsi,8),%xmm3
subpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm3
movupd %xmm2,0x8(%rbx,%rsi,8)
movupd %xmm3,0x18(%rbx,%rsi,8)
movupd 0x20(%r15,%rsi,8),%xmm1
movupd 0x28(%r15,%rsi,8),%xmm2
subpd  %xmm1,%xmm2
movupd 0x30(%r15,%rsi,8),%xmm1
movupd 0x38(%r15,%rsi,8),%xmm3
subpd  %xmm1,%xmm3
mulpd  %xmm0,%xmm2
mulpd  %xmm0,%xmm3
movupd %xmm2,0x28(%rbx,%rsi,8)
movupd %xmm3,0x38(%rbx,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    13d0 <DiscreteGamma+0x2a0>
jmp    15b7 <DiscreteGamma+0x487>
mov    %r12d,%edx
and    $0xfffffff8,%edx
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
addsd  (%rbx,%rcx,8),%xmm0
addsd  0x8(%rbx,%rcx,8),%xmm0
addsd  0x10(%rbx,%rcx,8),%xmm0
addsd  0x18(%rbx,%rcx,8),%xmm0
addsd  0x20(%rbx,%rcx,8),%xmm0
addsd  0x28(%rbx,%rcx,8),%xmm0
addsd  0x30(%rbx,%rcx,8),%xmm0
addsd  0x38(%rbx,%rcx,8),%xmm0
add    $0x8,%rcx
cmp    %rcx,%rdx
jne    1460 <DiscreteGamma+0x330>
test   %rax,%rax
je     14be <DiscreteGamma+0x38e>
lea    (%rbx,%rcx,8),%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addsd  (%rcx,%rdx,8),%xmm0
add    $0x1,%rdx
cmp    %rdx,%rax
jne    14b0 <DiscreteGamma+0x380>
test   %r13d,%r13d
jle    17af <DiscreteGamma+0x67f>
divsd  %xmm0,%xmm6
cmp    $0x4,%r12d
jae    14d8 <DiscreteGamma+0x3a8>
xor    %eax,%eax
jmp    1590 <DiscreteGamma+0x460>
mov    %r12d,%eax
and    $0xfffffffc,%eax
movapd %xmm6,%xmm0
unpcklpd %xmm6,%xmm0
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     15ac <DiscreteGamma+0x47c>
mov    %rdx,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
movupd (%rbx,%rcx,8),%xmm1
movupd 0x10(%rbx,%rcx,8),%xmm2
movupd 0x20(%rbx,%rcx,8),%xmm3
movupd 0x30(%rbx,%rcx,8),%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rbx,%rcx,8)
movupd %xmm2,0x10(%rbx,%rcx,8)
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm4
movupd %xmm3,0x20(%rbx,%rcx,8)
movupd %xmm4,0x30(%rbx,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%rsi
jne    1510 <DiscreteGamma+0x3e0>
test   $0x1,%dl
je     157b <DiscreteGamma+0x44b>
movupd (%rbx,%rcx,8),%xmm1
movupd 0x10(%rbx,%rcx,8),%xmm2
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rbx,%rcx,8)
movupd %xmm2,0x10(%rbx,%rcx,8)
cmp    %r12,%rax
je     1666 <DiscreteGamma+0x536>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx,%rax,8),%xmm0
mulsd  %xmm6,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    1590 <DiscreteGamma+0x460>
jmp    1666 <DiscreteGamma+0x536>
xor    %ecx,%ecx
test   $0x1,%dl
jne    155d <DiscreteGamma+0x42d>
jmp    157b <DiscreteGamma+0x44b>
xor    %esi,%esi
test   $0x1,%bpl
je     15fe <DiscreteGamma+0x4ce>
lea    0x0(,%rsi,8),%rdi
or     $0x8,%rdi
movupd (%r15,%rdi,1),%xmm1
movupd 0x10(%r15,%rdi,1),%xmm2
movupd (%r15,%rsi,8),%xmm3
subpd  %xmm3,%xmm1
movupd 0x10(%r15,%rsi,8),%xmm3
subpd  %xmm3,%xmm2
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rbx,%rdi,1)
movupd %xmm2,0x10(%rbx,%rdi,1)
cmp    %rcx,%rdx
je     1666 <DiscreteGamma+0x536>
or     $0x1,%rcx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
jne    162b <DiscreteGamma+0x4fb>
movsd  (%r15,%rcx,8),%xmm0
subsd  -0x8(%r15,%rcx,8),%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
add    $0x1,%rcx
add    %rax,%rdx
je     1666 <DiscreteGamma+0x536>
movsd  (%r15,%rcx,8),%xmm0
subsd  -0x8(%r15,%rcx,8),%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rbx,%rcx,8)
movsd  0x8(%r15,%rcx,8),%xmm0
subsd  (%r15,%rcx,8),%xmm0
mulsd  %xmm4,%xmm0
movsd  %xmm0,0x8(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    1630 <DiscreteGamma+0x500>
test   %r13d,%r13d
jle    17af <DiscreteGamma+0x67f>
movsd  0x989(%rip),%xmm0
divsd  %xmm5,%xmm0
cmp    $0x4,%r13d
jae    1688 <DiscreteGamma+0x558>
xor    %eax,%eax
jmp    17a0 <DiscreteGamma+0x670>
mov    %r12d,%eax
and    $0xfffffffc,%eax
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x1c,%rsi
jae    16b7 <DiscreteGamma+0x587>
xor    %esi,%esi
jmp    1765 <DiscreteGamma+0x635>
movabs $0x7ffffffffffffffe,%rsi
ff ff 7f
add    $0xfffffffffffffffa,%rsi
and    %rsi,%rdx
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movupd %xmm1,(%r15,%rsi,8)
movupd %xmm1,0x10(%r15,%rsi,8)
movupd %xmm1,0x20(%r15,%rsi,8)
movupd %xmm1,0x30(%r15,%rsi,8)
movupd %xmm1,0x40(%r15,%rsi,8)
movupd %xmm1,0x50(%r15,%rsi,8)
movupd %xmm1,0x60(%r15,%rsi,8)
movupd %xmm1,0x70(%r15,%rsi,8)
movupd %xmm1,0x80(%r15,%rsi,8)
movupd %xmm1,0x90(%r15,%rsi,8)
movupd %xmm1,0xa0(%r15,%rsi,8)
movupd %xmm1,0xb0(%r15,%rsi,8)
movupd %xmm1,0xc0(%r15,%rsi,8)
movupd %xmm1,0xd0(%r15,%rsi,8)
movupd %xmm1,0xe0(%r15,%rsi,8)
movupd %xmm1,0xf0(%r15,%rsi,8)
add    $0x20,%rsi
add    $0xfffffffffffffff8,%rdx
jne    16d0 <DiscreteGamma+0x5a0>
test   %rcx,%rcx
je     1794 <DiscreteGamma+0x664>
lea    (%r15,%rsi,8),%rdx
add    $0x10,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movupd %xmm1,-0x10(%rdx,%rsi,1)
movupd %xmm1,(%rdx,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    1780 <DiscreteGamma+0x650>
cmp    %r12,%rax
je     17af <DiscreteGamma+0x67f>
nopl   0x0(%rax)
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    17a0 <DiscreteGamma+0x670>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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