#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 CDFBeta(double, double, double, double);
double LnGamma(double);
double QuantileBeta(int, double, double, double);
double log(int);
int DiscreteBeta(double freq[], double x[], double p, double q, int K,
                 int UseMedian) {
  int i;
  double mean = p / (p + q), lnbeta, lnbeta1, t;
  lnbeta = (LnGamma(p) + LnGamma(q) - LnGamma(p + q));
  if (UseMedian) {
    for (i = 0, t = 0; i < K; i++)
      t += x[i] = QuantileBeta((i + 0.5) / K, p, q, lnbeta);
    for (i = 0; i < K; i++)
      x[i] *= mean * K / t;
  } else {
    for (i = 0; i < K - 1; i++)
      freq[i] = QuantileBeta((i + 1.0) / K, p, q, lnbeta);
    freq[K - 1] = 1;
    lnbeta1 = lnbeta - log(1 + q / p);
    for (i = 0; i < K - 1; i++)
      freq[i] = CDFBeta(freq[i], p + 1, q, lnbeta1);
    x[0] = freq[0] * mean * K;
    for (i = 1; i < K - 1; i++)
      x[i] = (freq[i] - freq[i - 1]) * mean * K;
    x[K - 1] = (1 - freq[K - 2]) * mean * K;
    for (i = 0, t = 0; i < K; i++)
      t += x[i] / K;
  }
  for (i = 0; i < K; i++)
    freq[i] = 1.0 / K;
  return (0);
}


x86 assembly (clang, -O0):
<DiscreteBeta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%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
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <LnGamma@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1060 <LnGamma@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
call   1060 <LnGamma@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     1289 <DiscreteBeta+0x149>
movl   $0x0,-0x2c(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    123e <DiscreteBeta+0xfe>
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  0xe14(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
call   1040 <QuantileBeta@plt>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11db <DiscreteBeta+0x9b>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1284 <DiscreteBeta+0x144>
movsd  -0x38(%rbp),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x50(%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    1245 <DiscreteBeta+0x105>
jmp    14a4 <DiscreteBeta+0x364>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12ee <DiscreteBeta+0x1ae>
cvtsi2sdl -0x2c(%rbp),%xmm0
movsd  0xd52(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
call   1040 <QuantileBeta@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    1290 <DiscreteBeta+0x150>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  0xcfd(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x20(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xcdc(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    139e <DiscreteBeta+0x25e>
mov    -0x8(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc91(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm3
call   1030 <CDFBeta@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    1349 <DiscreteBeta+0x209>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  -0x38(%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    141c <DiscreteBeta+0x2dc>
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  -0x38(%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    13c3 <DiscreteBeta+0x283>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
movsd  0xbcf(%rip),%xmm0
subsd  (%rax,%rcx,8),%xmm0
mulsd  -0x38(%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)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    149f <DiscreteBeta+0x35f>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1465 <DiscreteBeta+0x325>
jmp    14a4 <DiscreteBeta+0x364>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    14e3 <DiscreteBeta+0x3a3>
cvtsi2sdl -0x24(%rbp),%xmm1
movsd  0xb3c(%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    14ab <DiscreteBeta+0x36b>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DiscreteBeta>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %ecx,%r12d
mov    %edx,%ebp
movsd  %xmm1,0x20(%rsp)
mov    %rsi,%r15
mov    %rdi,%rbx
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%rsp)
movapd %xmm0,%xmm1
divsd  %xmm2,%xmm1
movapd %xmm1,0x30(%rsp)
movsd  %xmm0,0x18(%rsp)
call   1060 <LnGamma@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x20(%rsp),%xmm0
call   1060 <LnGamma@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1060 <LnGamma@plt>
movsd  0x8(%rsp),%xmm2
subsd  %xmm0,%xmm2
mov    %ebp,%r14d
test   %r12d,%r12d
je     1279 <DiscreteBeta+0x139>
test   %ebp,%ebp
jle    170e <DiscreteBeta+0x5ce>
mov    %rbp,%r12
xorps  %xmm1,%xmm1
cvtsi2sd %ebp,%xmm1
xorpd  %xmm0,%xmm0
xor    %ebp,%ebp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x28(%rsp)
nopl   0x0(%rax,%rax,1)
movsd  %xmm0,0x10(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  0xdfb(%rip),%xmm0
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
call   1040 <QuantileBeta@plt>
movsd  0x28(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movsd  %xmm0,(%r15,%rbp,8)
movsd  0x10(%rsp),%xmm3
addsd  %xmm0,%xmm3
movsd  %xmm3,0x10(%rsp)
movsd  0x10(%rsp),%xmm0
add    $0x1,%rbp
cmp    %rbp,%r14
jne    11f0 <DiscreteBeta+0xb0>
mov    %r12,%rdi
test   %edi,%edi
jle    170e <DiscreteBeta+0x5ce>
movapd 0x30(%rsp),%xmm5
mulsd  %xmm1,%xmm5
divsd  %xmm0,%xmm5
cmp    $0x4,%r14d
jae    1500 <DiscreteBeta+0x3c0>
xor    %eax,%eax
jmp    15c0 <DiscreteBeta+0x480>
lea    -0x1(%rbp),%r13d
mov    %rbp,0x28(%rsp)
cmp    $0x2,%ebp
movsd  0x20(%rsp),%xmm1
movsd  0x18(%rsp),%xmm3
movsd  %xmm2,0x8(%rsp)
jl     12f8 <DiscreteBeta+0x1b8>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x28(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    %r13d,%r12d
xor    %ebp,%ebp
nopl   (%rax)
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
addsd  0xd49(%rip),%xmm0
divsd  0x10(%rsp),%xmm0
cvttsd2si %xmm0,%edi
movapd %xmm3,%xmm0
movsd  0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
call   1040 <QuantileBeta@plt>
movsd  0x18(%rsp),%xmm3
movsd  0x20(%rsp),%xmm1
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r12
jne    12b0 <DiscreteBeta+0x170>
movslq %r13d,%r12
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rbx,%r12,8)
movapd %xmm1,%xmm0
divsd  %xmm3,%xmm0
addsd  0xcef(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1050 <log@plt>
mov    0x28(%rsp),%rdi
cmp    $0x1,%edi
jle    14be <DiscreteBeta+0x37e>
movsd  0x8(%rsp),%xmm2
subsd  %xmm0,%xmm2
movsd  0x18(%rsp),%xmm1
addsd  0xcc0(%rip),%xmm1
mov    %r13d,%r13d
xor    %ebp,%ebp
movsd  %xmm1,0x18(%rsp)
movsd  %xmm2,0x8(%rsp)
nopl   0x0(%rax)
movsd  (%rbx,%rbp,8),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
call   1030 <CDFBeta@plt>
movsd  %xmm0,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1360 <DiscreteBeta+0x220>
movsd  (%rbx),%xmm1
mov    0x28(%rsp),%rdi
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
movapd 0x30(%rsp),%xmm6
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
cmp    $0x3,%edi
jl     14dc <DiscreteBeta+0x39c>
lea    -0x1(%r13),%rcx
mov    $0x1,%eax
cmp    $0x4,%rcx
jb     144f <DiscreteBeta+0x30f>
lea    0x8(%r15),%rdx
lea    (%rbx,%r13,8),%rsi
cmp    %rsi,%rdx
jae    13df <DiscreteBeta+0x29f>
lea    (%r15,%r13,8),%rdx
cmp    %rbx,%rdx
ja     144f <DiscreteBeta+0x30f>
mov    %rcx,%rdx
and    $0xfffffffffffffffc,%rdx
lea    0x1(%rdx),%rax
movapd %xmm6,%xmm1
unpcklpd %xmm6,%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
xor    %esi,%esi
nopl   0x0(%rax)
movupd (%rbx,%rsi,8),%xmm3
movupd 0x8(%rbx,%rsi,8),%xmm4
subpd  %xmm3,%xmm4
movupd 0x10(%rbx,%rsi,8),%xmm3
movupd 0x18(%rbx,%rsi,8),%xmm5
subpd  %xmm3,%xmm5
mulpd  %xmm1,%xmm4
mulpd  %xmm1,%xmm5
mulpd  %xmm2,%xmm4
mulpd  %xmm2,%xmm5
movupd %xmm4,0x8(%r15,%rsi,8)
movupd %xmm5,0x18(%r15,%rsi,8)
add    $0x4,%rsi
cmp    %rsi,%rdx
jne    1400 <DiscreteBeta+0x2c0>
cmp    %rdx,%rcx
je     14dc <DiscreteBeta+0x39c>
mov    %rax,%rcx
not    %rcx
test   $0x1,%r13b
jne    1478 <DiscreteBeta+0x338>
movsd  (%rbx,%rax,8),%xmm1
subsd  -0x8(%rbx,%rax,8),%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rax,8)
add    $0x1,%rax
add    %r13,%rcx
je     14dc <DiscreteBeta+0x39c>
nopl   (%rax)
movsd  (%rbx,%rax,8),%xmm1
subsd  -0x8(%rbx,%rax,8),%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rax,8)
movsd  0x8(%rbx,%rax,8),%xmm1
subsd  (%rbx,%rax,8),%xmm1
mulsd  %xmm6,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%r15,%rax,8)
add    $0x2,%rax
cmp    %rax,%r13
jne    1480 <DiscreteBeta+0x340>
jmp    14dc <DiscreteBeta+0x39c>
movsd  (%rbx),%xmm1
movapd 0x30(%rsp),%xmm6
mulsd  %xmm6,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edi,%xmm0
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
movslq %edi,%rax
movsd  0xb21(%rip),%xmm1
subsd  -0x10(%rbx,%rax,8),%xmm1
mulsd  %xmm1,%xmm6
mulsd  %xmm0,%xmm6
movsd  %xmm6,(%r15,%r12,8)
jmp    15d9 <DiscreteBeta+0x499>
mov    %r14d,%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     171f <DiscreteBeta+0x5df>
movabs $0x7ffffffffffffff8,%rsi
ff ff 7f
or     $0x6,%rsi
and    %rcx,%rsi
xor    %edx,%edx
nopl   0x0(%rax)
movupd (%r15,%rdx,8),%xmm1
movupd 0x10(%r15,%rdx,8),%xmm2
movupd 0x20(%r15,%rdx,8),%xmm3
movupd 0x30(%r15,%rdx,8),%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%r15,%rdx,8)
movupd %xmm2,0x10(%r15,%rdx,8)
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm4
movupd %xmm3,0x20(%r15,%rdx,8)
movupd %xmm4,0x30(%r15,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rsi
jne    1540 <DiscreteBeta+0x400>
test   $0x1,%cl
je     15b7 <DiscreteBeta+0x477>
movupd (%r15,%rdx,8),%xmm1
movupd 0x10(%r15,%rdx,8),%xmm2
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%r15,%rdx,8)
movupd %xmm2,0x10(%r15,%rdx,8)
cmp    %r14,%rax
je     15d9 <DiscreteBeta+0x499>
nopl   0x0(%rax)
movsd  (%r15,%rax,8),%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,(%r15,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    15c0 <DiscreteBeta+0x480>
test   %edi,%edi
jle    170e <DiscreteBeta+0x5ce>
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
movsd  0xa18(%rip),%xmm0
divsd  %xmm1,%xmm0
cmp    $0x4,%edi
jae    1600 <DiscreteBeta+0x4c0>
xor    %eax,%eax
jmp    1700 <DiscreteBeta+0x5c0>
mov    %r14d,%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    162f <DiscreteBeta+0x4ef>
xor    %esi,%esi
jmp    16c5 <DiscreteBeta+0x585>
and    $0xfffffffffffffff8,%rdx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nop
movupd %xmm1,(%rbx,%rsi,8)
movupd %xmm1,0x10(%rbx,%rsi,8)
movupd %xmm1,0x20(%rbx,%rsi,8)
movupd %xmm1,0x30(%rbx,%rsi,8)
movupd %xmm1,0x40(%rbx,%rsi,8)
movupd %xmm1,0x50(%rbx,%rsi,8)
movupd %xmm1,0x60(%rbx,%rsi,8)
movupd %xmm1,0x70(%rbx,%rsi,8)
movupd %xmm1,0x80(%rbx,%rsi,8)
movupd %xmm1,0x90(%rbx,%rsi,8)
movupd %xmm1,0xa0(%rbx,%rsi,8)
movupd %xmm1,0xb0(%rbx,%rsi,8)
movupd %xmm1,0xc0(%rbx,%rsi,8)
movupd %xmm1,0xd0(%rbx,%rsi,8)
movupd %xmm1,0xe0(%rbx,%rsi,8)
movupd %xmm1,0xf0(%rbx,%rsi,8)
add    $0x20,%rsi
add    $0xfffffffffffffff8,%rdx
jne    1640 <DiscreteBeta+0x500>
test   %rcx,%rcx
je     16f4 <DiscreteBeta+0x5b4>
lea    (%rbx,%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    16e0 <DiscreteBeta+0x5a0>
cmp    %r14,%rax
je     170e <DiscreteBeta+0x5ce>
nopl   0x0(%rax)
movsd  %xmm0,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    1700 <DiscreteBeta+0x5c0>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %edx,%edx
test   $0x1,%cl
jne    1595 <DiscreteBeta+0x455>
jmp    15b7 <DiscreteBeta+0x477>

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

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