#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 alfa, double beta, int K,
                  int median) {
  int i;
  double gap05 = 1.0 / (2.0 * K), t, factor = alfa / beta * K, lnga1;
  if (median) {
    for (i = 0; i < K; i++)
      rK[i] = PointChi2((i * 2.0 + 1) * gap05, 2.0 * (alfa)) / (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(alfa + 1);
    for (i = 0; i < K - 1; i++)
      freqK[i] = PointChi2((i + 1.0) / K, 2.0 * (alfa)) / (2.0 * (beta));
    for (i = 0; i < K - 1; i++)
      freqK[i] = IncompleteGamma(freqK[i] * beta, alfa + 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)
cvtsi2sdl -0x24(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe97(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1285 <DiscreteGamma+0x155>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1203 <DiscreteGamma+0xd3>
cvtsi2sdl -0x2c(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xe48(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  -0x38(%rbp),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xe3b(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <PointChi2@plt>
movsd  0xe29(%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    119b <DiscreteGamma+0x6b>
movl   $0x0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1243 <DiscreteGamma+0x113>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1212 <DiscreteGamma+0xe2>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1280 <DiscreteGamma+0x150>
movsd  -0x48(%rbp),%xmm0
divsd  -0x40(%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    124a <DiscreteGamma+0x11a>
jmp    140e <DiscreteGamma+0x2de>
movsd  0xd73(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
call   1050 <LnGamma@plt>
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1310 <DiscreteGamma+0x1e0>
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  0xd3f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xd2e(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
call   1040 <PointChi2@plt>
movsd  0xd1c(%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    12a3 <DiscreteGamma+0x173>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    136c <DiscreteGamma+0x23c>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xcbe(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x50(%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    1317 <DiscreteGamma+0x1e7>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x48(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xc6a(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mulsd  -0x48(%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    1409 <DiscreteGamma+0x2d9>
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  -0x48(%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    13b9 <DiscreteGamma+0x289>
jmp    140e <DiscreteGamma+0x2de>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    144d <DiscreteGamma+0x31d>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xbd2(%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    1415 <DiscreteGamma+0x2e5>
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
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
movsd  0xea6(%rip),%xmm5
movapd %xmm3,%xmm2
divsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
mov    %edx,%r12d
test   %ecx,%ecx
je     122d <DiscreteGamma+0xfd>
test   %r13d,%r13d
jle    17bf <DiscreteGamma+0x68f>
movapd %xmm2,0x40(%rsp)
movsd  %xmm0,0x20(%rsp)
addsd  %xmm0,%xmm0
movapd %xmm5,%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,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  %xmm5,%xmm0
mulsd  0x28(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm3,%xmm0
call   1040 <PointChi2@plt>
movsd  0x10(%rsp),%xmm3
movsd  0x8(%rsp),%xmm1
movsd  0xe1a(%rip),%xmm5
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    11b0 <DiscreteGamma+0x80>
test   %r13d,%r13d
movsd  0x20(%rsp),%xmm6
movapd 0x40(%rsp),%xmm7
jle    17bf <DiscreteGamma+0x68f>
lea    -0x1(%r12),%rcx
mov    %r12d,%eax
and    $0x7,%eax
cmp    $0x7,%rcx
jae    145e <DiscreteGamma+0x32e>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
jmp    14a8 <DiscreteGamma+0x378>
movapd %xmm2,0x40(%rsp)
movsd  %xmm0,0x20(%rsp)
movsd  0xdbf(%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     1330 <DiscreteGamma+0x200>
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)
nop
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
movsd  0xd50(%rip),%xmm2
addsd  %xmm2,%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    12a0 <DiscreteGamma+0x170>
mov    %rbp,%r13
cmp    $0x2,%r13d
movsd  0x8(%rsp),%xmm3
movsd  0x38(%rsp),%xmm1
movsd  0x30(%rsp),%xmm2
jl     1330 <DiscreteGamma+0x200>
xor    %ebp,%ebp
nop
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    1300 <DiscreteGamma+0x1d0>
movsd  (%r15),%xmm0
movapd 0x40(%rsp),%xmm4
mulsd  %xmm4,%xmm0
movsd  %xmm0,(%rbx)
movslq %r13d,%rax
movsd  0xcb2(%rip),%xmm5
movapd %xmm5,%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),%xmm6
jl     1676 <DiscreteGamma+0x546>
mov    %ecx,%eax
lea    -0x1(%rax),%rdx
mov    $0x1,%ecx
cmp    $0x4,%rdx
jb     1617 <DiscreteGamma+0x4e7>
lea    0x8(%rbx),%rsi
lea    (%r15,%rax,8),%rdi
cmp    %rdi,%rsi
jae    13a8 <DiscreteGamma+0x278>
lea    (%rbx,%rax,8),%rsi
cmp    %r15,%rsi
ja     1617 <DiscreteGamma+0x4e7>
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     15c5 <DiscreteGamma+0x495>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
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    13e0 <DiscreteGamma+0x2b0>
jmp    15c7 <DiscreteGamma+0x497>
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    1470 <DiscreteGamma+0x340>
test   %rax,%rax
je     14ce <DiscreteGamma+0x39e>
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    14c0 <DiscreteGamma+0x390>
test   %r13d,%r13d
jle    17bf <DiscreteGamma+0x68f>
divsd  %xmm0,%xmm7
cmp    $0x4,%r12d
jae    14e8 <DiscreteGamma+0x3b8>
xor    %eax,%eax
jmp    15a0 <DiscreteGamma+0x470>
mov    %r12d,%eax
and    $0xfffffffc,%eax
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
lea    -0x4(%rax),%rcx
mov    %rcx,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rcx,%rcx
je     15bc <DiscreteGamma+0x48c>
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    1520 <DiscreteGamma+0x3f0>
test   $0x1,%dl
je     158b <DiscreteGamma+0x45b>
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     1676 <DiscreteGamma+0x546>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  (%rbx,%rax,8),%xmm0
mulsd  %xmm7,%xmm0
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    15a0 <DiscreteGamma+0x470>
jmp    1676 <DiscreteGamma+0x546>
xor    %ecx,%ecx
test   $0x1,%dl
jne    156d <DiscreteGamma+0x43d>
jmp    158b <DiscreteGamma+0x45b>
xor    %esi,%esi
test   $0x1,%bpl
je     160e <DiscreteGamma+0x4de>
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     1676 <DiscreteGamma+0x546>
or     $0x1,%rcx
mov    %rcx,%rdx
not    %rdx
test   $0x1,%al
jne    163b <DiscreteGamma+0x50b>
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     1676 <DiscreteGamma+0x546>
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    1640 <DiscreteGamma+0x510>
test   %r13d,%r13d
jle    17bf <DiscreteGamma+0x68f>
divsd  %xmm6,%xmm5
cmp    $0x4,%r13d
jae    1690 <DiscreteGamma+0x560>
xor    %eax,%eax
jmp    17b0 <DiscreteGamma+0x680>
mov    %r12d,%eax
and    $0xfffffffc,%eax
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x1c,%rsi
jae    16bf <DiscreteGamma+0x58f>
xor    %esi,%esi
jmp    1775 <DiscreteGamma+0x645>
movabs $0x7ffffffffffffffe,%rsi
ff ff 7f
add    $0xfffffffffffffffa,%rsi
and    %rsi,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd %xmm0,(%r15,%rsi,8)
movupd %xmm0,0x10(%r15,%rsi,8)
movupd %xmm0,0x20(%r15,%rsi,8)
movupd %xmm0,0x30(%r15,%rsi,8)
movupd %xmm0,0x40(%r15,%rsi,8)
movupd %xmm0,0x50(%r15,%rsi,8)
movupd %xmm0,0x60(%r15,%rsi,8)
movupd %xmm0,0x70(%r15,%rsi,8)
movupd %xmm0,0x80(%r15,%rsi,8)
movupd %xmm0,0x90(%r15,%rsi,8)
movupd %xmm0,0xa0(%r15,%rsi,8)
movupd %xmm0,0xb0(%r15,%rsi,8)
movupd %xmm0,0xc0(%r15,%rsi,8)
movupd %xmm0,0xd0(%r15,%rsi,8)
movupd %xmm0,0xe0(%r15,%rsi,8)
movupd %xmm0,0xf0(%r15,%rsi,8)
add    $0x20,%rsi
add    $0xfffffffffffffff8,%rdx
jne    16e0 <DiscreteGamma+0x5b0>
test   %rcx,%rcx
je     17a4 <DiscreteGamma+0x674>
lea    (%r15,%rsi,8),%rdx
add    $0x10,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
nopl   0x0(%rax,%rax,1)
movupd %xmm0,-0x10(%rdx,%rsi,1)
movupd %xmm0,(%rdx,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    1790 <DiscreteGamma+0x660>
cmp    %r12,%rax
je     17bf <DiscreteGamma+0x68f>
nopl   0x0(%rax)
movsd  %xmm5,(%r15,%rax,8)
add    $0x1,%rax
cmp    %rax,%r12
jne    17b0 <DiscreteGamma+0x680>
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
%17 = 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
%18 = load i32, i32* %11
%19 = sitofp i32 %18 to double
%20 = fmul double 2.000000e+00, %19
%21 = fdiv double 1.000000e+00, %20
store double %21, double* %14
%22 = load double, double* %9
%23 = load double, double* %10
%24 = fdiv double %22, %23
%25 = load i32, i32* %11
%26 = sitofp i32 %25 to double
%27 = fmul double %24, %26
store double %27, double* %16
%28 = load i32, i32* %12
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %90
30: ; preds = %6
store i32 0, i32* %13
br label %31
31: ; preds = %52, %30
%32 = load i32, i32* %13
%33 = load i32, i32* %11
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %55
35: ; preds = %31
%36 = load i32, i32* %13
%37 = sitofp i32 %36 to double
%38 = call double @llvm.fmuladd.f64(double %37, double 2.000000e+00, double 1.000000e+00)
%39 = load double, double* %14
%40 = fmul double %38, %39
%41 = fptosi double %40 to i32
%42 = load double, double* %9
%43 = fmul double 2.000000e+00, %42
%44 = call double @PointChi2(i32 %41, double %43)
%45 = load double, double* %10
%46 = fmul double 2.000000e+00, %45
%47 = fdiv double %44, %46
%48 = load double*, double** %8
%49 = load i32, i32* %13
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
store double %47, double* %51
br label %52
52: ; preds = %35
%53 = load i32, i32* %13
%54 = add nsw i32 %53, 1
store i32 %54, i32* %13
br label %31
55: ; preds = %31
store i32 0, i32* %13
store double 0.000000e+00, double* %15
br label %56
56: ; preds = %68, %55
%57 = load i32, i32* %13
%58 = load i32, i32* %11
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %71
60: ; preds = %56
%61 = load double*, double** %8
%62 = load i32, i32* %13
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = load double, double* %15
%67 = fadd double %66, %65
store double %67, double* %15
br label %68
68: ; preds = %60
%69 = load i32, i32* %13
%70 = add nsw i32 %69, 1
store i32 %70, i32* %13
br label %56
71: ; preds = %56
store i32 0, i32* %13
br label %72
72: ; preds = %86, %71
%73 = load i32, i32* %13
%74 = load i32, i32* %11
%75 = icmp slt i32 %73, %74
br i1 %75, label %76, label %89
76: ; preds = %72
%77 = load double, double* %16
%78 = load double, double* %15
%79 = fdiv double %77, %78
%80 = load double*, double** %8
%81 = load i32, i32* %13
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds double, double* %80, i64 %82
%84 = load double, double* %83
%85 = fmul double %84, %79
store double %85, double* %83
br label %86
86: ; preds = %76
%87 = load i32, i32* %13
%88 = add nsw i32 %87, 1
store i32 %88, i32* %13
br label %72
89: ; preds = %72
br label %195
90: ; preds = %6
%91 = load double, double* %9
%92 = fadd double %91, 1.000000e+00
%93 = call double @LnGamma(double %92)
store double %93, double* %17
store i32 0, i32* %13
br label %94
94: ; preds = %117, %90
%95 = load i32, i32* %13
%96 = load i32, i32* %11
%97 = sub nsw i32 %96, 1
%98 = icmp slt i32 %95, %97
br i1 %98, label %99, label %120
99: ; preds = %94
%100 = load i32, i32* %13
%101 = sitofp i32 %100 to double
%102 = fadd double %101, 1.000000e+00
%103 = load i32, i32* %11
%104 = sitofp i32 %103 to double
%105 = fdiv double %102, %104
%106 = fptosi double %105 to i32
%107 = load double, double* %9
%108 = fmul double 2.000000e+00, %107
%109 = call double @PointChi2(i32 %106, double %108)
%110 = load double, double* %10
%111 = fmul double 2.000000e+00, %110
%112 = fdiv double %109, %111
%113 = load double*, double** %7
%114 = load i32, i32* %13
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds double, double* %113, i64 %115
store double %112, double* %116
br label %117
117: ; preds = %99
%118 = load i32, i32* %13
%119 = add nsw i32 %118, 1
store i32 %119, i32* %13
br label %94
120: ; preds = %94
store i32 0, i32* %13
br label %121
121: ; preds = %142, %120
%122 = load i32, i32* %13
%123 = load i32, i32* %11
%124 = sub nsw i32 %123, 1
%125 = icmp slt i32 %122, %124
br i1 %125, label %126, label %145
126: ; preds = %121
%127 = load double*, double** %7
%128 = load i32, i32* %13
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
%131 = load double, double* %130
%132 = load double, double* %10
%133 = fmul double %131, %132
%134 = load double, double* %9
%135 = fadd double %134, 1.000000e+00
%136 = load double, double* %17
%137 = call double @IncompleteGamma(double %133, double %135, double %136)
%138 = load double*, double** %7
%139 = load i32, i32* %13
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %138, i64 %140
store double %137, double* %141
br label %142
142: ; preds = %126
%143 = load i32, i32* %13
%144 = add nsw i32 %143, 1
store i32 %144, i32* %13
br label %121
145: ; preds = %121
%146 = load double*, double** %7
%147 = getelementptr inbounds double, double* %146, i64 0
%148 = load double, double* %147
%149 = load double, double* %16
%150 = fmul double %148, %149
%151 = load double*, double** %8
%152 = getelementptr inbounds double, double* %151, i64 0
store double %150, double* %152
%153 = load double*, double** %7
%154 = load i32, i32* %11
%155 = sub nsw i32 %154, 2
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %153, i64 %156
%158 = load double, double* %157
%159 = fsub double 1.000000e+00, %158
%160 = load double, double* %16
%161 = fmul double %159, %160
%162 = load double*, double** %8
%163 = load i32, i32* %11
%164 = sub nsw i32 %163, 1
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds double, double* %162, i64 %165
store double %161, double* %166
store i32 1, i32* %13
br label %167
167: ; preds = %191, %145
%168 = load i32, i32* %13
%169 = load i32, i32* %11
%170 = sub nsw i32 %169, 1
%171 = icmp slt i32 %168, %170
br i1 %171, label %172, label %194
172: ; preds = %167
%173 = load double*, double** %7
%174 = load i32, i32* %13
%175 = sext i32 %174 to i64
%176 = getelementptr inbounds double, double* %173, i64 %175
%177 = load double, double* %176
%178 = load double*, double** %7
%179 = load i32, i32* %13
%180 = sub nsw i32 %179, 1
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds double, double* %178, i64 %181
%183 = load double, double* %182
%184 = fsub double %177, %183
%185 = load double, double* %16
%186 = fmul double %184, %185
%187 = load double*, double** %8
%188 = load i32, i32* %13
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds double, double* %187, i64 %189
store double %186, double* %190
br label %191
191: ; preds = %172
%192 = load i32, i32* %13
%193 = add nsw i32 %192, 1
store i32 %193, i32* %13
br label %167
194: ; preds = %167
br label %195
195: ; preds = %194, %89
store i32 0, i32* %13
br label %196
196: ; preds = %208, %195
%197 = load i32, i32* %13
%198 = load i32, i32* %11
%199 = icmp slt i32 %197, %198
br i1 %199, label %200, label %211
200: ; preds = %196
%201 = load i32, i32* %11
%202 = sitofp i32 %201 to double
%203 = fdiv double 1.000000e+00, %202
%204 = load double*, double** %7
%205 = load i32, i32* %13
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds double, double* %204, i64 %206
store double %203, double* %207
br label %208
208: ; preds = %200
%209 = load i32, i32* %13
%210 = add nsw i32 %209, 1
store i32 %210, i32* %13
br label %196
211: ; preds = %196
ret i32 0
}

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