#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 QuantileChi2(int, double);
int DiscreteGamma(double freqK[], double rK[], double alpha, double beta, int K,
                  int UseMedian) {
  int i;
  double t, mean = alpha / beta, lnga1;
  if (UseMedian) {
    for (i = 0; i < K; i++)
      rK[i] =
          QuantileChi2((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] *= mean * K / t;
  } else {
    lnga1 = LnGamma(alpha + 1);
    for (i = 0; i < K - 1; i++)
      freqK[i] = QuantileChi2((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] * mean * K;
    for (i = 1; i < K - 1; i++)
      rK[i] = (freqK[i] - freqK[i - 1]) * mean * K;
    rK[K - 1] = (1 - freqK[K - 2]) * mean * K;
  }
  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
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    11e8 <DiscreteGamma+0xb8>
cvtsi2sdl -0x2c(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe73(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm2
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xe56(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1050 <QuantileChi2@plt>
movsd  0xe44(%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    1170 <DiscreteGamma+0x40>
movl   $0x0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1228 <DiscreteGamma+0xf8>
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    11f7 <DiscreteGamma+0xc7>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    126e <DiscreteGamma+0x13e>
movsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
mulsd  %xmm1,%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    122f <DiscreteGamma+0xff>
jmp    1412 <DiscreteGamma+0x2e2>
movsd  0xd85(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1040 <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   1050 <QuantileChi2@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
cvtsi2sdl -0x24(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    13d8 <DiscreteGamma+0x2a8>
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
cvtsi2sdl -0x24(%rbp),%xmm1
mulsd  %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    137f <DiscreteGamma+0x24f>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xc13(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mulsd  -0x40(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1451 <DiscreteGamma+0x321>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xbce(%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    1419 <DiscreteGamma+0x2e9>
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,%xmm2
mov    %rsi,%rbx
mov    %rdi,%r15
divsd  %xmm1,%xmm0
mov    %edx,%r12d
test   %ecx,%ecx
je     1213 <DiscreteGamma+0xe3>
test   %r13d,%r13d
jle    173f <DiscreteGamma+0x60f>
movapd %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  %xmm0,0x18(%rsp)
addsd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
addsd  %xmm2,%xmm2
addsd  %xmm1,%xmm1
xor    %ebp,%ebp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  %xmm0,%xmm0
addsd  0xe4d(%rip),%xmm0
divsd  0x30(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm2,%xmm0
call   1050 <QuantileChi2@plt>
movsd  0x8(%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11a0 <DiscreteGamma+0x70>
test   %r13d,%r13d
movapd 0x20(%rsp),%xmm5
jle    173f <DiscreteGamma+0x60f>
lea    -0x1(%r12),%rcx
mov    %r12d,%eax
and    $0x7,%eax
cmp    $0x7,%rcx
jae    1497 <DiscreteGamma+0x367>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
jmp    14e8 <DiscreteGamma+0x3b8>
movsd  %xmm1,0x10(%rsp)
movapd %xmm0,0x20(%rsp)
movsd  0xdd9(%rip),%xmm0
addsd  %xmm2,%xmm0
movsd  %xmm0,0x50(%rsp)
movsd  %xmm2,0x8(%rsp)
call   1040 <LnGamma@plt>
lea    -0x1(%r13),%ecx
cmp    $0x2,%r13d
jl     1454 <DiscreteGamma+0x324>
movsd  %xmm0,0x48(%rsp)
mov    %r13,%rbp
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
movsd  0x8(%rsp),%xmm2
addsd  %xmm2,%xmm2
movsd  0x10(%rsp),%xmm0
addsd  %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %ecx,0x4(%rsp)
mov    %ecx,%r14d
xor    %r13d,%r13d
movapd %xmm1,0x30(%rsp)
movsd  %xmm2,0x8(%rsp)
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
addsd  0xd60(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm2,%xmm0
call   1050 <QuantileChi2@plt>
movsd  0x8(%rsp),%xmm2
movapd 0x30(%rsp),%xmm1
divsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r15,%r13,8)
add    $0x1,%r13
cmp    %r13,%r14
jne    1290 <DiscreteGamma+0x160>
mov    %rbp,%r13
cmp    $0x2,%r13d
mov    0x4(%rsp),%ecx
jl     1454 <DiscreteGamma+0x324>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%r15,%rbp,8),%xmm0
mulsd  0x10(%rsp),%xmm0
movsd  0x50(%rsp),%xmm1
movsd  0x48(%rsp),%xmm2
call   1030 <IncompleteGamma@plt>
movsd  %xmm0,(%r15,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
jne    12f0 <DiscreteGamma+0x1c0>
movsd  (%r15),%xmm0
movapd 0x20(%rsp),%xmm5
mulsd  %xmm5,%xmm0
movapd 0x30(%rsp),%xmm6
mulsd  %xmm6,%xmm0
movsd  %xmm0,(%rbx)
cmp    $0x3,%r13d
jl     144e <DiscreteGamma+0x31e>
lea    -0x1(%r14),%rcx
mov    $0x1,%eax
cmp    $0x4,%rcx
jb     13dd <DiscreteGamma+0x2ad>
lea    0x8(%rbx),%rdx
lea    (%r15,%r14,8),%rsi
cmp    %rsi,%rdx
jae    136c <DiscreteGamma+0x23c>
lea    (%rbx,%r14,8),%rdx
cmp    %r15,%rdx
ja     13dd <DiscreteGamma+0x2ad>
mov    %rcx,%rdx
and    $0xfffffffffffffffc,%rdx
lea    0x1(%rdx),%rax
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
movapd %xmm6,%xmm1
unpcklpd %xmm6,%xmm1
xor    %esi,%esi
nopl   0x0(%rax)
movupd (%r15,%rsi,8),%xmm2
movupd 0x8(%r15,%rsi,8),%xmm3
subpd  %xmm2,%xmm3
movupd 0x10(%r15,%rsi,8),%xmm2
movupd 0x18(%r15,%rsi,8),%xmm4
subpd  %xmm2,%xmm4
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm4
mulpd  %xmm1,%xmm3
mulpd  %xmm1,%xmm4
movupd %xmm3,0x8(%rbx,%rsi,8)
movupd %xmm4,0x18(%rbx,%rsi,8)
add    $0x4,%rsi
cmp    %rsi,%rdx
jne    1390 <DiscreteGamma+0x260>
cmp    %rdx,%rcx
je     144e <DiscreteGamma+0x31e>
mov    %rax,%rcx
not    %rcx
test   $0x1,%r14b
jne    1407 <DiscreteGamma+0x2d7>
movsd  (%r15,%rax,8),%xmm0
subsd  -0x8(%r15,%rax,8),%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm6,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
add    %r14,%rcx
je     144e <DiscreteGamma+0x31e>
nopl   0x0(%rax)
movsd  (%r15,%rax,8),%xmm0
subsd  -0x8(%r15,%rax,8),%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm6,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
movsd  0x8(%r15,%rax,8),%xmm0
subsd  (%r15,%rax,8),%xmm0
mulsd  %xmm5,%xmm0
mulsd  %xmm6,%xmm0
movsd  %xmm0,0x8(%rbx,%rax,8)
add    $0x2,%rax
cmp    %rax,%r14
jne    1410 <DiscreteGamma+0x2e0>
mov    0x4(%rsp),%ecx
jmp    1470 <DiscreteGamma+0x340>
movsd  (%r15),%xmm0
movapd 0x20(%rsp),%xmm5
mulsd  %xmm5,%xmm0
cvtsi2sd %r13d,%xmm6
mulsd  %xmm6,%xmm0
movsd  %xmm0,(%rbx)
movslq %r13d,%rax
movsd  0xb85(%rip),%xmm0
subsd  -0x10(%r15,%rax,8),%xmm0
mulsd  %xmm0,%xmm5
mulsd  %xmm6,%xmm5
movslq %ecx,%rax
movsd  %xmm5,(%rbx,%rax,8)
jmp    15f7 <DiscreteGamma+0x4c7>
mov    %r12d,%edx
and    $0xfffffff8,%edx
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
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    14b0 <DiscreteGamma+0x380>
test   %rax,%rax
je     150e <DiscreteGamma+0x3de>
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    1500 <DiscreteGamma+0x3d0>
test   %r13d,%r13d
jle    173f <DiscreteGamma+0x60f>
mulsd  0x18(%rsp),%xmm5
divsd  %xmm0,%xmm5
cmp    $0x4,%r12d
jae    152e <DiscreteGamma+0x3fe>
xor    %eax,%eax
jmp    15e0 <DiscreteGamma+0x4b0>
mov    %r12d,%eax
and    $0xfffffffc,%eax
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
lea    -0x4(%rax),%rdx
mov    %rdx,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
test   %rdx,%rdx
je     1750 <DiscreteGamma+0x620>
movabs $0x7ffffffffffffff8,%rsi
ff ff 7f
or     $0x6,%rsi
and    %rcx,%rsi
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
movupd (%rbx,%rdx,8),%xmm1
movupd 0x10(%rbx,%rdx,8),%xmm2
movupd 0x20(%rbx,%rdx,8),%xmm3
movupd 0x30(%rbx,%rdx,8),%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rbx,%rdx,8)
movupd %xmm2,0x10(%rbx,%rdx,8)
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm4
movupd %xmm3,0x20(%rbx,%rdx,8)
movupd %xmm4,0x30(%rbx,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rsi
jne    1570 <DiscreteGamma+0x440>
test   $0x1,%cl
je     15db <DiscreteGamma+0x4ab>
movupd (%rbx,%rdx,8),%xmm1
movupd 0x10(%rbx,%rdx,8),%xmm2
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rbx,%rdx,8)
movupd %xmm2,0x10(%rbx,%rdx,8)
cmp    %r12,%rax
je     15f7 <DiscreteGamma+0x4c7>
movsd  (%rbx,%rax,8),%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    15e0 <DiscreteGamma+0x4b0>
test   %r13d,%r13d
jle    173f <DiscreteGamma+0x60f>
xorps  %xmm1,%xmm1
cvtsi2sd %r13d,%xmm1
movsd  0x9f0(%rip),%xmm0
divsd  %xmm1,%xmm0
cmp    $0x4,%r13d
jae    1621 <DiscreteGamma+0x4f1>
xor    %eax,%eax
jmp    1730 <DiscreteGamma+0x600>
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    1650 <DiscreteGamma+0x520>
xor    %esi,%esi
jmp    16f5 <DiscreteGamma+0x5c5>
and    $0xfffffffffffffff8,%rdx
xor    %esi,%esi
cs 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    1660 <DiscreteGamma+0x530>
test   %rcx,%rcx
je     1724 <DiscreteGamma+0x5f4>
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    1710 <DiscreteGamma+0x5e0>
cmp    %r12,%rax
je     173f <DiscreteGamma+0x60f>
nopl   0x0(%rax)
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    1730 <DiscreteGamma+0x600>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%cl
jne    15bd <DiscreteGamma+0x48d>
jmp    15db <DiscreteGamma+0x4ab>

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