#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 algdiv(double, double);
double alnrel(double);
double exp(double);
double fabs(double);
double gam1(double);
int /*<<< orphan*/ grat1(double, double, double, double *, double *, double);
double log(double);
void bgrat(double a, double b, double x, double y, double *w, double eps,
           int *ierr) {
  int i__1;
  double r__1;
  double c__[30], d__[30];
  int i__;
  double j, l;
  int n;
  double p, q, r__, s, t, u, v, z__, n2, t2, dj, cn, nu, bm1;
  int nm1;
  double lnx, sum;
  double bp2n, coef;
  bm1 = b - 0.5 - 0.5;
  nu = a + bm1 * 0.5;
  if (y > .375f) {
    goto L10;
  }
  lnx = alnrel(-y);
  goto L11;
L10:
  lnx = log(x);
L11:
  z__ = -nu * lnx;
  if (b * z__ == 0.0) {
    goto L100;
  }
  r__ = b * (gam1(b) + 1.0) * exp(b * log(z__));
  r__ = r__ * exp(a * lnx) * exp(bm1 * 0.5 * lnx);
  u = algdiv(b, a) + b * log(nu);
  u = r__ * exp(-u);
  if (u == 0.0) {
    goto L100;
  }
  grat1(b, z__, r__, &p, &q, eps);
  r__1 = 1.0 / nu;
  v = r__1 * r__1 * .25;
  t2 = lnx * .25f * lnx;
  l = *w / u;
  j = q / r__;
  sum = j;
  t = 1.0;
  cn = 1.0;
  n2 = 0.0;
  for (n = 1; n <= 30; ++n) {
    bp2n = b + n2;
    j = (bp2n * (bp2n + 1.0) * j + (z__ + bp2n + 1.0) * t) * v;
    n2 += 2.0;
    t *= t2;
    cn /= n2 * (n2 + 1.0);
    c__[n - 1] = cn;
    s = 0.0;
    if (n == 1) {
      goto L21;
    }
    nm1 = n - 1;
    coef = b - n;
    i__1 = nm1;
    for (i__ = 1; i__ <= i__1; ++i__) {
      s += coef * c__[i__ - 1] * d__[n - i__ - 1];
      coef += b;
    }
  L21:
    d__[n - 1] = bm1 * cn + s / n;
    dj = d__[n - 1] * j;
    sum += dj;
    if (sum <= 0.0) {
      goto L100;
    }
    if (fabs(dj) <= eps * (sum + l)) {
      goto L30;
    }
  }
L30:
  *ierr = 0;
  *w += u * sum;
  return;
L100:
  *ierr = 1;
  return;
}


x86 assembly (clang, -O0):
<bgrat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x330,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %rdi,-0x28(%rbp)
movsd  %xmm4,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe6f(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe63(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x2c0(%rbp)
ff
movsd  -0x8(%rbp),%xmm1
movsd  -0x2c0(%rbp),%xmm0
ff
movsd  0xe42(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x2b8(%rbp)
ff
movsd  -0x20(%rbp),%xmm0
movsd  0xe1d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11f2 <bgrat+0x92>
jmp    1220 <bgrat+0xc0>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <alnrel@plt>
movsd  %xmm0,-0x2d0(%rbp)
ff
jmp    1232 <bgrat+0xd2>
movsd  -0x18(%rbp),%xmm0
call   1080 <log@plt>
movsd  %xmm0,-0x2d0(%rbp)
ff
movsd  -0x2b8(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x2d0(%rbp),%xmm0
ff
movsd  %xmm0,-0x290(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
mulsd  -0x290(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1286 <bgrat+0x126>
jp     1286 <bgrat+0x126>
jmp    1825 <bgrat+0x6c5>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x328(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1030 <gam1@plt>
movaps %xmm0,%xmm1
movsd  -0x328(%rbp),%xmm0
ff
movsd  0xd60(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x318(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x320(%rbp)
ff
movsd  -0x290(%rbp),%xmm0
ff
call   1080 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x320(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x318(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x268(%rbp)
ff
movsd  -0x268(%rbp),%xmm0
ff
movsd  %xmm0,-0x310(%rbp)
ff
movsd  -0x8(%rbp),%xmm0
mulsd  -0x2d0(%rbp),%xmm0
ff
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x310(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x308(%rbp)
ff
movsd  0xcc2(%rip),%xmm0
mulsd  -0x2c0(%rbp),%xmm0
ff
mulsd  -0x2d0(%rbp),%xmm0
ff
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x308(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x268(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1060 <algdiv@plt>
movsd  %xmm0,-0x300(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x2f8(%rbp)
ff
movsd  -0x2b8(%rbp),%xmm0
ff
call   1080 <log@plt>
movsd  -0x300(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movsd  -0x2f8(%rbp),%xmm0
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x280(%rbp)
ff
movsd  -0x268(%rbp),%xmm0
ff
movsd  %xmm0,-0x2f0(%rbp)
ff
movsd  -0x280(%rbp),%xmm0
ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x2f0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x280(%rbp)
ff
movsd  -0x280(%rbp),%xmm0
ff
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1431 <bgrat+0x2d1>
jp     1431 <bgrat+0x2d1>
jmp    1825 <bgrat+0x6c5>
movsd  -0x10(%rbp),%xmm0
movsd  -0x290(%rbp),%xmm1
ff
movsd  -0x268(%rbp),%xmm2
ff
movsd  -0x30(%rbp),%xmm3
lea    -0x258(%rbp),%rdi
lea    -0x260(%rbp),%rsi
call   1050 <grat1@plt>
movsd  0xbaa(%rip),%xmm0
divsd  -0x2b8(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  0xb93(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x288(%rbp)
ff
movsd  0xb7f(%rip),%xmm0
mulsd  -0x2d0(%rbp),%xmm0
ff
mulsd  -0x2d0(%rbp),%xmm0
ff
movsd  %xmm0,-0x2a0(%rbp)
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
divsd  -0x280(%rbp),%xmm0
ff
movsd  %xmm0,-0x248(%rbp)
ff
movsd  -0x260(%rbp),%xmm0
ff
divsd  -0x268(%rbp),%xmm0
ff
movsd  %xmm0,-0x240(%rbp)
ff
movsd  -0x240(%rbp),%xmm0
ff
movsd  %xmm0,-0x2d8(%rbp)
ff
movsd  0xb17(%rip),%xmm0
movsd  %xmm0,-0x278(%rbp)
movsd  0xb07(%rip),%xmm0
movsd  %xmm0,-0x2b0(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x298(%rbp)
ff
movl   $0x1,-0x24c(%rbp)
cmpl   $0x1e,-0x24c(%rbp)
jg     17ed <bgrat+0x68d>
movsd  -0x10(%rbp),%xmm0
addsd  -0x298(%rbp),%xmm0
ff
movsd  %xmm0,-0x2e0(%rbp)
ff
movsd  -0x2e0(%rbp),%xmm0
ff
movsd  0xab8(%rip),%xmm1
addsd  -0x2e0(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  -0x240(%rbp),%xmm2
ff
movsd  -0x290(%rbp),%xmm1
ff
addsd  -0x2e0(%rbp),%xmm1
ff
movsd  0xa8c(%rip),%xmm3
addsd  %xmm3,%xmm1
mulsd  -0x278(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mulsd  -0x288(%rbp),%xmm0
ff
movsd  %xmm0,-0x240(%rbp)
ff
movsd  0xa70(%rip),%xmm0
addsd  -0x298(%rbp),%xmm0
ff
movsd  %xmm0,-0x298(%rbp)
ff
movsd  -0x2a0(%rbp),%xmm0
ff
mulsd  -0x278(%rbp),%xmm0
ff
movsd  %xmm0,-0x278(%rbp)
ff
movsd  -0x298(%rbp),%xmm1
ff
movsd  0xa28(%rip),%xmm0
addsd  -0x298(%rbp),%xmm0
ff
mulsd  %xmm0,%xmm1
movsd  -0x2b0(%rbp),%xmm0
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x2b0(%rbp)
ff
movsd  -0x2b0(%rbp),%xmm0
ff
mov    -0x24c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x140(%rbp,%rax,8)
ff ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x270(%rbp)
ff
cmpl   $0x1,-0x24c(%rbp)
jne    1641 <bgrat+0x4e1>
jmp    1707 <bgrat+0x5a7>
mov    -0x24c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2c4(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x24c(%rbp),%xmm1
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x2e8(%rbp)
ff
mov    -0x2c4(%rbp),%eax
mov    %eax,-0x3c(%rbp)
movl   $0x1,-0x234(%rbp)
mov    -0x234(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jg     1702 <bgrat+0x5a2>
movsd  -0x2e8(%rbp),%xmm0
ff
mov    -0x234(%rbp),%eax
sub    $0x1,%eax
cltq
mulsd  -0x140(%rbp,%rax,8),%xmm0
ff ff
mov    -0x24c(%rbp),%eax
sub    -0x234(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x230(%rbp,%rax,8),%xmm2
ff ff
movsd  -0x270(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x270(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
addsd  -0x2e8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2e8(%rbp)
ff
mov    -0x234(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x234(%rbp)
jmp    167c <bgrat+0x51c>
jmp    1707 <bgrat+0x5a7>
movsd  -0x2c0(%rbp),%xmm0
ff
movsd  -0x2b0(%rbp),%xmm2
ff
movsd  -0x270(%rbp),%xmm1
ff
cvtsi2sdl -0x24c(%rbp),%xmm3
ff
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x24c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  %xmm0,-0x230(%rbp,%rax,8)
ff ff
mov    -0x24c(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x230(%rbp,%rax,8),%xmm0
ff ff
mulsd  -0x240(%rbp),%xmm0
ff
movsd  %xmm0,-0x2a8(%rbp)
ff
movsd  -0x2a8(%rbp),%xmm0
ff
addsd  -0x2d8(%rbp),%xmm0
ff
movsd  %xmm0,-0x2d8(%rbp)
ff
xorps  %xmm0,%xmm0
ucomisd -0x2d8(%rbp),%xmm0
ff
jb     1799 <bgrat+0x639>
jmp    1825 <bgrat+0x6c5>
movsd  -0x2a8(%rbp),%xmm1
ff
movaps 0x888(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  -0x2d8(%rbp),%xmm2
ff
addsd  -0x248(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jb     17d4 <bgrat+0x674>
jmp    17f2 <bgrat+0x692>
jmp    17d9 <bgrat+0x679>
mov    -0x24c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24c(%rbp)
jmp    1526 <bgrat+0x3c6>
jmp    17f2 <bgrat+0x692>
mov    -0x38(%rbp),%rax
movl   $0x0,(%rax)
movsd  -0x280(%rbp),%xmm0
ff
movsd  -0x2d8(%rbp),%xmm2
ff
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
jmp    182f <bgrat+0x6cf>
mov    -0x38(%rbp),%rax
movl   $0x1,(%rax)
add    $0x330,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bgrat>:
push   %r15
push   %r14
push   %rbx
sub    $0x260,%rsp
mov    %rsi,%r15
movsd  %xmm4,0x48(%rsp)
mov    %rdi,%r14
movsd  %xmm1,0x8(%rsp)
movsd  0xe7a(%rip),%xmm4
addsd  %xmm4,%xmm1
addsd  %xmm4,%xmm1
movsd  0xe72(%rip),%xmm4
movsd  %xmm1,0x68(%rsp)
mulsd  %xmm1,%xmm4
movapd %xmm4,%xmm1
addsd  %xmm0,%xmm1
ucomisd 0xe60(%rip),%xmm3
movapd %xmm1,0x30(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  %xmm4,0x20(%rsp)
jbe    11cf <bgrat+0x6f>
movapd %xmm2,%xmm0
call   1080 <log@plt>
jmp    11e0 <bgrat+0x80>
xorpd  0xe69(%rip),%xmm3
movapd %xmm3,%xmm0
call   1040 <alnrel@plt>
movapd 0x30(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm3
movapd 0xe48(%rip),%xmm0
xorpd  %xmm2,%xmm0
mulsd  %xmm3,%xmm0
movapd %xmm0,0x50(%rsp)
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    121a <bgrat+0xba>
jnp    12f2 <bgrat+0x192>
movsd  0x8(%rsp),%xmm0
movsd  %xmm3,0x28(%rsp)
call   1030 <gam1@plt>
addsd  0xde5(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movapd 0x50(%rsp),%xmm0
call   1080 <log@plt>
mulsd  0x8(%rsp),%xmm0
call   1070 <exp@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x28(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1070 <exp@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x20(%rsp),%xmm0
mulsd  0x28(%rsp),%xmm0
call   1070 <exp@plt>
mulsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1060 <algdiv@plt>
movsd  %xmm0,0x10(%rsp)
movapd 0x30(%rsp),%xmm0
call   1080 <log@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
xorpd  0xd6f(%rip),%xmm0
call   1070 <exp@plt>
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
ucomisd 0xd42(%rip),%xmm0
jne    1306 <bgrat+0x1a6>
jp     1306 <bgrat+0x1a6>
movl   $0x1,(%r15)
add    $0x260,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
movapd %xmm1,%xmm2
lea    0x78(%rsp),%rdi
lea    0x70(%rsp),%rsi
movsd  0x8(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
movsd  0x48(%rsp),%xmm3
call   1050 <grat1@plt>
movsd  0xce5(%rip),%xmm15
movapd %xmm15,%xmm14
divsd  0x30(%rsp),%xmm14
mulsd  %xmm14,%xmm14
movsd  0xcd3(%rip),%xmm13
mulsd  %xmm13,%xmm14
movsd  0x28(%rsp),%xmm0
mulsd  %xmm0,%xmm13
mulsd  %xmm0,%xmm13
movsd  (%r14),%xmm12
movsd  %xmm12,0x30(%rsp)
divsd  0x10(%rsp),%xmm12
movsd  0x70(%rsp),%xmm3
divsd  0x20(%rsp),%xmm3
lea    0x168(%rsp),%r8
xorpd  %xmm9,%xmm9
mov    $0x1,%ecx
xor    %edx,%edx
movsd  0xc8a(%rip),%xmm11
movapd %xmm3,%xmm4
movapd %xmm15,%xmm0
movapd %xmm15,%xmm1
xorpd  %xmm2,%xmm2
xorpd  %xmm10,%xmm10
cs nopw 0x0(%rax,%rax,1)
nop
addsd  %xmm11,%xmm10
movapd %xmm10,%xmm6
addsd  %xmm15,%xmm6
mulsd  %xmm10,%xmm6
divsd  %xmm6,%xmm0
movsd  %xmm0,0x78(%rsp,%rcx,8)
xorps  %xmm7,%xmm7
cvtsi2sd %ecx,%xmm7
xorpd  %xmm6,%xmm6
cmp    $0x1,%rcx
movsd  0x8(%rsp),%xmm5
je     14b4 <bgrat+0x354>
movapd %xmm5,%xmm8
subsd  %xmm7,%xmm8
cmp    $0x1,%rdx
jne    1420 <bgrat+0x2c0>
xorpd  %xmm6,%xmm6
mov    $0x1,%esi
jmp    148e <bgrat+0x32e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
neg    %rdi
xorpd  %xmm6,%xmm6
mov    $0x1,%esi
mov    %r8,%rax
cs nopw 0x0(%rax,%rax,1)
movsd  0x78(%rsp,%rsi,8),%xmm9
mulsd  %xmm8,%xmm9
mulsd  (%rax),%xmm9
addsd  %xmm6,%xmm9
addsd  %xmm5,%xmm8
movsd  0x80(%rsp,%rsi,8),%xmm6
mulsd  %xmm8,%xmm6
mulsd  -0x8(%rax),%xmm6
addsd  %xmm9,%xmm6
addsd  %xmm5,%xmm8
add    $0xfffffffffffffff0,%rax
lea    (%rdi,%rsi,1),%rbx
add    $0x2,%rbx
add    $0x2,%rsi
cmp    $0x1,%rbx
jne    1440 <bgrat+0x2e0>
test   $0x1,%dl
xorpd  %xmm9,%xmm9
je     14b4 <bgrat+0x354>
mulsd  0x78(%rsp,%rsi,8),%xmm8
not    %rsi
add    %rcx,%rsi
mulsd  0x170(%rsp,%rsi,8),%xmm8
addsd  %xmm8,%xmm6
addsd  %xmm5,%xmm2
movapd %xmm2,%xmm5
addsd  %xmm15,%xmm5
mulsd  %xmm2,%xmm5
mulsd  %xmm5,%xmm4
addsd  0x50(%rsp),%xmm2
addsd  %xmm15,%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm2,%xmm4
mulsd  %xmm14,%xmm4
divsd  %xmm7,%xmm6
movsd  0x68(%rsp),%xmm5
mulsd  %xmm0,%xmm5
addsd  %xmm6,%xmm5
movsd  %xmm5,0x168(%rsp,%rcx,8)
mulsd  %xmm4,%xmm5
addsd  %xmm5,%xmm3
ucomisd %xmm3,%xmm9
jae    12f2 <bgrat+0x192>
andpd  0xb39(%rip),%xmm5
movapd %xmm12,%xmm2
addsd  %xmm3,%xmm2
mulsd  0x48(%rsp),%xmm2
ucomisd %xmm5,%xmm2
jae    154c <bgrat+0x3ec>
mulsd  %xmm13,%xmm1
add    $0x1,%rcx
add    $0x1,%rdx
add    $0x8,%r8
movapd %xmm10,%xmm2
cmp    $0x1f,%rcx
jne    13c0 <bgrat+0x260>
movl   $0x0,(%r15)
movsd  0x10(%rsp),%xmm0
mulsd  %xmm3,%xmm0
addsd  0x30(%rsp),%xmm0
movsd  %xmm0,(%r14)
jmp    12f9 <bgrat+0x199>

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

LLVM IR (-O2):
define void @bgrat(double %0, double %1, double %2, double %3, double* nocapture %4, double %5, i32* nocapture writeonly %6) {
%8 = alloca [30 x double]
%9 = alloca [30 x double]
%10 = alloca double
%11 = alloca double
%12 = bitcast [30 x double]* %8 to i8*
%13 = bitcast [30 x double]* %9 to i8*
%14 = bitcast double* %10 to i8*
%15 = bitcast double* %11 to i8*
%16 = fadd double %1, -5.000000e-01
%17 = fadd double %16, -5.000000e-01
%18 = tail call double @llvm.fmuladd.f64(double %17, double 5.000000e-01, double %0)
%19 = fcmp ogt double %3, 3.750000e-01
br i1 %19, label %23, label %20
20: ; preds = %7
%21 = fneg double %3
%22 = tail call double @alnrel(double %21)
br label %25
23: ; preds = %7
%24 = tail call double @log(double %2)
br label %25
25: ; preds = %23, %20
%26 = phi double [ %24, %23 ], [ %22, %20 ]
%27 = fneg double %18
%28 = fmul double %26, %27
%29 = fmul double %28, %1
%30 = fcmp oeq double %29, 0.000000e+00
br i1 %30, label %158, label %31
31: ; preds = %25
%32 = tail call double @gam1(double %1)
%33 = fadd double %32, 1.000000e+00
%34 = fmul double %33, %1
%35 = tail call double @log(double %28)
%36 = fmul double %35, %1
%37 = tail call double @exp(double %36)
%38 = fmul double %34, %37
%39 = fmul double %26, %0
%40 = tail call double @exp(double %39)
%41 = fmul double %38, %40
%42 = fmul double %17, 5.000000e-01
%43 = fmul double %42, %26
%44 = tail call double @exp(double %43)
%45 = fmul double %41, %44
%46 = tail call double @algdiv(double %1, double %0)
%47 = tail call double @log(double %18)
%48 = tail call double @llvm.fmuladd.f64(double %1, double %47, double %46)
%49 = fneg double %48
%50 = tail call double @exp(double %49)
%51 = fmul double %45, %50
%52 = fcmp oeq double %51, 0.000000e+00
br i1 %52, label %158, label %53
53: ; preds = %31
%54 = call i32 @grat1(double %1, double %28, double %45, double* %10, double* %11, double %5)
%55 = fdiv double 1.000000e+00, %18
%56 = fmul double %55, %55
%57 = fmul double %56, 2.500000e-01
%58 = fmul double %26, 2.500000e-01
%59 = fmul double %26, %58
%60 = load double, double* %4
%61 = fdiv double %60, %51
%62 = load double, double* %11
%63 = fdiv double %62, %45
br label %64
64: ; preds = %147, %53
%65 = phi i64 [ %155, %147 ], [ 0, %53 ]
%66 = phi i64 [ %152, %147 ], [ 1, %53 ]
%67 = phi double [ %145, %147 ], [ %63, %53 ]
%68 = phi double [ %79, %147 ], [ %63, %53 ]
%69 = phi double [ %84, %147 ], [ 1.000000e+00, %53 ]
%70 = phi double [ %81, %147 ], [ 1.000000e+00, %53 ]
%71 = phi double [ %80, %147 ], [ 0.000000e+00, %53 ]
%72 = fadd double %71, %1
%73 = fadd double %72, 1.000000e+00
%74 = fmul double %72, %73
%75 = fadd double %28, %72
%76 = fadd double %75, 1.000000e+00
%77 = fmul double %70, %76
%78 = call double @llvm.fmuladd.f64(double %74, double %68, double %77)
%79 = fmul double %57, %78
%80 = fadd double %71, 2.000000e+00
%81 = fmul double %59, %70
%82 = fadd double %80, 1.000000e+00
%83 = fmul double %80, %82
%84 = fdiv double %69, %83
%85 = add nsw i64 %66, -1
%86 = getelementptr inbounds [30 x double], [30 x double]* %8, i64 0, i64 %85
store double %84, double* %86
%87 = icmp eq i64 %66, 1
%88 = trunc i64 %66 to i32
%89 = sitofp i32 %88 to double
br i1 %87, label %139, label %90
90: ; preds = %64
%91 = fsub double %1, %89
%92 = and i64 %65, 1
%93 = icmp eq i64 %65, 1
br i1 %93, label %123, label %94
94: ; preds = %90
%95 = and i64 %65, -2
br label %96
96: ; preds = %96, %94
%97 = phi i64 [ 1, %94 ], [ %120, %96 ]
%98 = phi double [ %91, %94 ], [ %119, %96 ]
%99 = phi double [ 0.000000e+00, %94 ], [ %118, %96 ]
%100 = phi i64 [ 0, %94 ], [ %121, %96 ]
%101 = add nsw i64 %97, -1
%102 = getelementptr inbounds [30 x double], [30 x double]* %8, i64 0, i64 %101
%103 = load double, double* %102
%104 = fmul double %98, %103
%105 = xor i64 %97, -1
%106 = add nsw i64 %66, %105
%107 = getelementptr inbounds [30 x double], [30 x double]* %9, i64 0, i64 %106
%108 = load double, double* %107
%109 = call double @llvm.fmuladd.f64(double %104, double %108, double %99)
%110 = fadd double %98, %1
%111 = getelementptr inbounds [30 x double], [30 x double]* %8, i64 0, i64 %97
%112 = load double, double* %111
%113 = fmul double %110, %112
%114 = sub nuw i64 -2, %97
%115 = add nsw i64 %66, %114
%116 = getelementptr inbounds [30 x double], [30 x double]* %9, i64 0, i64 %115
%117 = load double, double* %116
%118 = call double @llvm.fmuladd.f64(double %113, double %117, double %109)
%119 = fadd double %110, %1
%120 = add nuw nsw i64 %97, 2
%121 = add i64 %100, 2
%122 = icmp eq i64 %121, %95
br i1 %122, label %123, label %96
123: ; preds = %96, %90
%124 = phi double [ undef, %90 ], [ %118, %96 ]
%125 = phi i64 [ 1, %90 ], [ %120, %96 ]
%126 = phi double [ %91, %90 ], [ %119, %96 ]
%127 = phi double [ 0.000000e+00, %90 ], [ %118, %96 ]
%128 = icmp eq i64 %92, 0
br i1 %128, label %139, label %129
129: ; preds = %123
%130 = add nsw i64 %125, -1
%131 = getelementptr inbounds [30 x double], [30 x double]* %8, i64 0, i64 %130
%132 = load double, double* %131
%133 = fmul double %126, %132
%134 = xor i64 %125, -1
%135 = add nsw i64 %66, %134
%136 = getelementptr inbounds [30 x double], [30 x double]* %9, i64 0, i64 %135
%137 = load double, double* %136
%138 = call double @llvm.fmuladd.f64(double %133, double %137, double %127)
br label %139
139: ; preds = %129, %123, %64
%140 = phi double [ 0.000000e+00, %64 ], [ %124, %123 ], [ %138, %129 ]
%141 = fdiv double %140, %89
%142 = call double @llvm.fmuladd.f64(double %17, double %84, double %141)
%143 = getelementptr inbounds [30 x double], [30 x double]* %9, i64 0, i64 %85
store double %142, double* %143
%144 = fmul double %79, %142
%145 = fadd double %67, %144
%146 = fcmp ugt double %145, 0.000000e+00
br i1 %146, label %147, label %158
147: ; preds = %139
%148 = call double @llvm.fabs.f64(double %144)
%149 = fadd double %61, %145
%150 = fmul double %149, %5
%151 = fcmp ole double %148, %150
%152 = add nuw nsw i64 %66, 1
%153 = icmp eq i64 %152, 31
%154 = select i1 %151, i1 true, i1 %153
%155 = add i64 %65, 1
br i1 %154, label %156, label %64
156: ; preds = %147
store i32 0, i32* %6
%157 = call double @llvm.fmuladd.f64(double %51, double %145, double %60)
store double %157, double* %4
br label %159
158: ; preds = %139, %31, %25
store i32 1, i32* %6
br label %159
159: ; preds = %158, %156
ret void
}