#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 erf1(double *);
double erfc1(int *, double *);
double exp(double);
double fabs(double);
double gam1(double *);
double log(double);
double rexp(double *);
double sqrt(double);
void grat1(double *a, double *x, double *r, double *p, double *q, double *eps) {
  static int K2 = 0;
  static double a2n, a2nm1, am0, an, an0, b2n, b2nm1, c, cma, g, h, j, l, sum,
      t, tol, w, z, T1, T3;
  if (*a * *x == 0.0e0)
    goto S120;
  if (*a == 0.5e0)
    goto S100;
  if (*x < 1.1e0)
    goto S10;
  goto S60;
S10:
  an = 3.0e0;
  c = *x;
  sum = *x / (*a + 3.0e0);
  tol = 0.1e0 * *eps / (*a + 1.0e0);
S20:
  an += 1.0e0;
  c = -(c * (*x / an));
  t = c / (*a + an);
  sum += t;
  if (fabs(t) > tol)
    goto S20;
  j = *a * *x *
      ((sum / 6.0e0 - 0.5e0 / (*a + 2.0e0)) * *x + 1.0e0 / (*a + 1.0e0));
  z = *a * log(*x);
  h = gam1(a);
  g = 1.0e0 + h;
  if (*x < 0.25e0)
    goto S30;
  if (*a < *x / 2.59e0)
    goto S50;
  goto S40;
S30:
  if (z > -.13394e0)
    goto S50;
S40:
  w = exp(z);
  *p = w * g * (0.5e0 + (0.5e0 - j));
  *q = 0.5e0 + (0.5e0 - *p);
  return;
S50:
  l = rexp(&z);
  w = 0.5e0 + (0.5e0 + l);
  *q = (w * j - l) * g - h;
  if (*q < 0.0e0)
    goto S90;
  *p = 0.5e0 + (0.5e0 - *q);
  return;
S60:
  a2nm1 = a2n = 1.0e0;
  b2nm1 = *x;
  b2n = *x + (1.0e0 - *a);
  c = 1.0e0;
S70:
  a2nm1 = *x * a2n + c * a2nm1;
  b2nm1 = *x * b2n + c * b2nm1;
  am0 = a2nm1 / b2nm1;
  c += 1.0e0;
  cma = c - *a;
  a2n = a2nm1 + cma * a2n;
  b2n = b2nm1 + cma * b2n;
  an0 = a2n / b2n;
  if (fabs(an0 - am0) >= *eps * an0)
    goto S70;
  *q = *r * an0;
  *p = 0.5e0 + (0.5e0 - *q);
  return;
S80:
  *p = 0.0e0;
  *q = 1.0e0;
  return;
S90:
  *p = 1.0e0;
  *q = 0.0e0;
  return;
S100:
  if (*x >= 0.25e0)
    goto S110;
  T1 = sqrt(*x);
  *p = erf1(&T1);
  *q = 0.5e0 + (0.5e0 - *p);
  return;
S110:
  T3 = sqrt(*x);
  *q = erfc1(&K2, &T3);
  *p = 0.5e0 + (0.5e0 - *q);
  return;
S120:
  if (*x <= *a)
    goto S80;
  goto S90;
}


x86 assembly (clang, -O0):
<grat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b8 <grat1+0x48>
jp     11b8 <grat1+0x48>
jmp    18b8 <grat1+0x748>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe38(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11dd <grat1+0x6d>
jp     11dd <grat1+0x6d>
jmp    17ee <grat1+0x67e>
mov    -0x10(%rbp),%rax
movsd  0xe1f(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    11f8 <grat1+0x88>
jmp    11fd <grat1+0x8d>
jmp    15bf <grat1+0x44f>
movsd  0xe1b(%rip),%xmm0
movsd  %xmm0,0x2e73(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x2e83(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xdef(%rip),%xmm1
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2e8f(%rip)
mov    -0x30(%rbp),%rax
movsd  0xdcb(%rip),%xmm0
mulsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xdb3(%rip),%xmm1
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2e73(%rip)
movsd  0xd9b(%rip),%xmm0
addsd  0x2e03(%rip),%xmm0
movsd  %xmm0,0x2dfb(%rip)
movsd  0x2e13(%rip),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
divsd  0x2de3(%rip),%xmm1
mulsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,0x2de0(%rip)
movsd  0x2dd8(%rip),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
addsd  0x2da8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2df4(%rip)
movsd  0x2dec(%rip),%xmm0
addsd  0x2ddc(%rip),%xmm0
movsd  %xmm0,0x2dd4(%rip)
movsd  0x2dd4(%rip),%xmm0
movaps 0xd45(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd 0x2dc9(%rip),%xmm0
jbe    1322 <grat1+0x1b2>
jmp    126d <grat1+0xfd>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  0x2d96(%rip),%xmm1
movsd  0xcf6(%rip),%xmm2
divsd  %xmm2,%xmm1
mov    -0x8(%rbp),%rax
movsd  0xcde(%rip),%xmm3
addsd  (%rax),%xmm3
movsd  0xca2(%rip),%xmm2
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm3
mov    -0x8(%rbp),%rax
movsd  0xc96(%rip),%xmm4
addsd  (%rax),%xmm4
movsd  0xc8a(%rip),%xmm2
divsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2d22(%rip)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2d24(%rip)
mov    -0x8(%rbp),%rdi
call   1030 <gam1@plt>
movsd  %xmm0,0x2cdb(%rip)
movsd  0xc2b(%rip),%xmm0
addsd  0x2ccb(%rip),%xmm0
movsd  %xmm0,0x2cbb(%rip)
mov    -0x10(%rbp),%rax
movsd  0xc27(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1410 <grat1+0x2a0>
jmp    1440 <grat1+0x2d0>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xc18(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    143b <grat1+0x2cb>
jmp    14da <grat1+0x36a>
jmp    1464 <grat1+0x2f4>
movsd  0x2ca8(%rip),%xmm0
movsd  0xbf8(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    145f <grat1+0x2ef>
jmp    14da <grat1+0x36a>
jmp    1464 <grat1+0x2f4>
movsd  0x2c84(%rip),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,0x2c6f(%rip)
movsd  0x2c67(%rip),%xmm0
mulsd  0x2c27(%rip),%xmm0
movsd  0xb6f(%rip),%xmm2
subsd  0x2c27(%rip),%xmm2
movsd  0xb5f(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xb43(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0xb37(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    18dc <grat1+0x76c>
lea    0x2c0f(%rip),%rdi
call   1040 <rexp@plt>
movsd  %xmm0,0x2bda(%rip)
movsd  0xb0a(%rip),%xmm1
addsd  0x2bca(%rip),%xmm1
movsd  0xafa(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2bd6(%rip)
movsd  0x2bce(%rip),%xmm0
movsd  0x2b9e(%rip),%xmm2
movsd  0x2b9e(%rip),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x2b5f(%rip),%xmm2
movsd  0x2b5f(%rip),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    1596 <grat1+0x426>
jmp    17ce <grat1+0x65e>
mov    -0x28(%rbp),%rax
movsd  0xa5e(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0xa52(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    18dc <grat1+0x76c>
movsd  0xa49(%rip),%xmm0
movsd  %xmm0,0x2a99(%rip)
movsd  0xa39(%rip),%xmm0
movsd  %xmm0,0x2a91(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x2aa9(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xa0d(%rip),%xmm1
subsd  (%rax),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2a7d(%rip)
movsd  0x9f5(%rip),%xmm0
movsd  %xmm0,0x2a7d(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x2a35(%rip),%xmm2
movsd  0x2a65(%rip),%xmm1
mulsd  0x2a2d(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2a1d(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x2a2d(%rip),%xmm2
movsd  0x2a35(%rip),%xmm1
mulsd  0x2a25(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2a15(%rip)
movsd  0x29e5(%rip),%xmm0
divsd  0x2a05(%rip),%xmm0
movsd  %xmm0,0x29dd(%rip)
movsd  0x96d(%rip),%xmm0
addsd  0x29f5(%rip),%xmm0
movsd  %xmm0,0x29ed(%rip)
movsd  0x29e5(%rip),%xmm0
mov    -0x8(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,0x29dd(%rip)
movsd  0x299d(%rip),%xmm1
movsd  0x29cd(%rip),%xmm0
movsd  0x2985(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2975(%rip)
movsd  0x299d(%rip),%xmm1
movsd  0x29a5(%rip),%xmm0
movsd  0x2985(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2975(%rip)
movsd  0x2945(%rip),%xmm0
divsd  0x2965(%rip),%xmm0
movsd  %xmm0,0x2955(%rip)
movsd  0x294d(%rip),%xmm0
subsd  0x2935(%rip),%xmm0
movaps 0x906(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  (%rax),%xmm1
mulsd  0x292a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     176d <grat1+0x5fd>
jmp    1623 <grat1+0x4b3>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mulsd  0x290b(%rip),%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x86f(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0x863(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    18dc <grat1+0x76c>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x84b(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    18dc <grat1+0x76c>
mov    -0x20(%rbp),%rax
movsd  0x836(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    18dc <grat1+0x76c>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0x82a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     180d <grat1+0x69d>
jmp    185f <grat1+0x6ef>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,0x28d6(%rip)
lea    0x28cf(%rip),%rdi
call   1080 <erf1@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x7be(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0x7b2(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    18dc <grat1+0x76c>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1090 <sqrt@plt>
movsd  %xmm0,0x288c(%rip)
lea    0x27e5(%rip),%rdi
lea    0x287e(%rip),%rsi
call   1060 <erfc1@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x765(%rip),%xmm1
subsd  (%rax),%xmm1
movsd  0x759(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    18dc <grat1+0x76c>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     18d7 <grat1+0x767>
jmp    17ae <grat1+0x63e>
jmp    17ce <grat1+0x65e>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grat1>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r15
mov    %rcx,%r14
movsd  (%rdi),%xmm12
movsd  (%rsi),%xmm11
movapd %xmm12,%xmm0
mulsd  %xmm11,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11c2 <grat1+0x52>
jp     11c2 <grat1+0x52>
ucomisd %xmm11,%xmm12
jae    1233 <grat1+0xc3>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r14)
movq   $0x0,(%r15)
jmp    1598 <grat1+0x428>
ucomisd 0xe35(%rip),%xmm12
jne    124c <grat1+0xdc>
jp     124c <grat1+0xdc>
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm11
jb     13a8 <grat1+0x238>
xorps  %xmm0,%xmm0
sqrtsd %xmm11,%xmm0
ucomisd 0xe51(%rip),%xmm11
jb     13cd <grat1+0x25d>
movsd  %xmm0,0x2e93(%rip)
lea    0x2e8c(%rip),%rsi
lea    0x2e55(%rip),%rdi
call   1060 <erfc1@plt>
movsd  %xmm0,(%r15)
movsd  0xde3(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r14)
jmp    1598 <grat1+0x428>
movq   $0x0,(%r14)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r15)
jmp    1598 <grat1+0x428>
movsd  0xdb4(%rip),%xmm1
ucomisd %xmm11,%xmm1
jbe    1404 <grat1+0x294>
mov    %rsi,%rbx
mov    %rdi,%r12
movsd  0xdab(%rip),%xmm3
movapd %xmm12,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm11,%xmm1
divsd  %xmm2,%xmm1
movsd  (%r9),%xmm4
mulsd  0xd94(%rip),%xmm4
movsd  0xd7b(%rip),%xmm8
addsd  %xmm12,%xmm8
divsd  %xmm8,%xmm4
movsd  0xd68(%rip),%xmm10
movapd 0xdbf(%rip),%xmm9
movapd 0xda7(%rip),%xmm6
movapd %xmm11,%xmm7
xchg   %ax,%ax
xorpd  %xmm9,%xmm7
addsd  %xmm10,%xmm3
movapd %xmm11,%xmm2
divsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm7
movapd %xmm12,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm7,%xmm5
divsd  %xmm2,%xmm5
addsd  %xmm5,%xmm1
andpd  %xmm6,%xmm5
ucomisd %xmm4,%xmm5
ja     12c0 <grat1+0x150>
divsd  0xd2a(%rip),%xmm1
movsd  0xd2a(%rip),%xmm2
addsd  %xmm12,%xmm2
movsd  0xd25(%rip),%xmm3
divsd  %xmm2,%xmm3
addsd  %xmm1,%xmm3
movapd %xmm10,%xmm1
divsd  %xmm8,%xmm1
mulsd  %xmm11,%xmm3
addsd  %xmm1,%xmm3
mulsd  %xmm3,%xmm0
movsd  %xmm0,0x2d3e(%rip)
movapd %xmm11,%xmm0
movsd  %xmm12,(%rsp)
call   1070 <log@plt>
mulsd  (%rsp),%xmm0
movsd  %xmm0,0x2d29(%rip)
mov    %r12,%rdi
call   1030 <gam1@plt>
movsd  %xmm0,0x2d09(%rip)
addsd  0xca1(%rip),%xmm0
movsd  %xmm0,0x2cf1(%rip)
movsd  (%rbx),%xmm0
movsd  0xcbd(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    14df <grat1+0x36f>
movsd  0x2ceb(%rip),%xmm0
ucomisd 0xcb3(%rip),%xmm0
ja     14ef <grat1+0x37f>
jmp    1559 <grat1+0x3e9>
movapd %xmm11,%xmm0
movsd  %xmm11,(%rsp)
call   1090 <sqrt@plt>
movsd  (%rsp),%xmm11
ucomisd 0xc79(%rip),%xmm11
jae    11f5 <grat1+0x85>
movsd  %xmm0,0x2cb3(%rip)
lea    0x2cac(%rip),%rdi
call   1080 <erf1@plt>
movsd  %xmm0,(%r14)
movsd  0xc12(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r15)
jmp    1598 <grat1+0x428>
movsd  0xc03(%rip),%xmm9
movapd %xmm9,%xmm2
subsd  %xmm12,%xmm2
addsd  %xmm11,%xmm2
movsd  (%r9),%xmm10
movapd 0xc36(%rip),%xmm8
movapd %xmm11,%xmm3
movapd %xmm9,%xmm4
movapd %xmm9,%xmm5
movapd %xmm9,%xmm0
xchg   %ax,%ax
mulsd  %xmm5,%xmm4
movapd %xmm11,%xmm6
mulsd  %xmm0,%xmm6
addsd  %xmm6,%xmm4
mulsd  %xmm5,%xmm3
movapd %xmm11,%xmm6
mulsd  %xmm2,%xmm6
addsd  %xmm6,%xmm3
addsd  %xmm9,%xmm5
movapd %xmm5,%xmm7
subsd  %xmm12,%xmm7
mulsd  %xmm7,%xmm0
addsd  %xmm4,%xmm0
mulsd  %xmm2,%xmm7
addsd  %xmm3,%xmm7
movapd %xmm0,%xmm6
unpcklpd %xmm4,%xmm6
movapd %xmm7,%xmm2
unpcklpd %xmm3,%xmm7
divpd  %xmm7,%xmm6
movapd %xmm6,%xmm7
unpckhpd %xmm6,%xmm7
movapd %xmm6,%xmm1
subsd  %xmm7,%xmm1
andpd  %xmm8,%xmm1
movapd %xmm6,%xmm7
mulsd  %xmm10,%xmm7
ucomisd %xmm7,%xmm1
jae    1440 <grat1+0x2d0>
mulsd  (%rdx),%xmm6
movsd  %xmm6,(%r15)
movsd  0xb37(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm6,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
jmp    1598 <grat1+0x428>
divsd  0xb61(%rip),%xmm0
ucomisd (%r12),%xmm0
jbe    1551 <grat1+0x3e1>
lea    0x2b8a(%rip),%rdi
call   1040 <rexp@plt>
movsd  0xafd(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  0x2b61(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  0x2b45(%rip),%xmm2
subsd  0x2b45(%rip),%xmm2
movsd  %xmm2,(%r15)
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
ja     11a9 <grat1+0x39>
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
jmp    1598 <grat1+0x428>
movsd  0x2b27(%rip),%xmm0
call   1050 <exp@plt>
mulsd  0x2b02(%rip),%xmm0
movsd  0xa92(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  0x2afe(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,(%r14)
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@grat1.K2 = internal global i32 0
@grat1.g = internal unnamed_addr global double 0.000000e+00
@grat1.h = internal unnamed_addr global double 0.000000e+00
@grat1.j = internal unnamed_addr global double 0.000000e+00
@grat1.z = internal global double 0.000000e+00
@grat1.T1 = internal global double 0.000000e+00
@grat1.T3 = internal global double 0.000000e+00
define void @grat1(double* %0, double* nocapture %1, double* nocapture %2, double* nocapture writeonly %3, double* nocapture writeonly %4, double* nocapture %5) {
%7 = load double, double* %0
%8 = load double, double* %1
%9 = fmul double %7, %8
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %132, label %11
11: ; preds = %6
%12 = fcmp oeq double %7, 5.000000e-01
br i1 %12, label %121, label %13
13: ; preds = %11
%14 = fcmp olt double %8, 1.100000e+00
br i1 %14, label %15, label %84
15: ; preds = %13
%16 = fadd double %7, 3.000000e+00
%17 = fdiv double %8, %16
%18 = load double, double* %5
%19 = fmul double %18, 1.000000e-01
%20 = fadd double %7, 1.000000e+00
%21 = fdiv double %19, %20
br label %22
22: ; preds = %22, %15
%23 = phi double [ %32, %22 ], [ %17, %15 ]
%24 = phi double [ %29, %22 ], [ %8, %15 ]
%25 = phi double [ %26, %22 ], [ 3.000000e+00, %15 ]
%26 = fadd double %25, 1.000000e+00
%27 = fdiv double %8, %26
%28 = fneg double %24
%29 = fmul double %27, %28
%30 = fadd double %7, %26
%31 = fdiv double %29, %30
%32 = fadd double %31, %23
%33 = tail call double @llvm.fabs.f64(double %31)
%34 = fcmp ogt double %33, %21
br i1 %34, label %22, label %35
35: ; preds = %22
%36 = fdiv double %32, 6.000000e+00
%37 = fadd double %7, 2.000000e+00
%38 = fdiv double 5.000000e-01, %37
%39 = fsub double %36, %38
%40 = fdiv double 1.000000e+00, %20
%41 = tail call double @llvm.fmuladd.f64(double %39, double %8, double %40)
%42 = fmul double %9, %41
store double %42, double* @grat1.j
%43 = tail call double @log(double %8)
%44 = fmul double %7, %43
store double %44, double* @grat1.z
%45 = tail call double @gam1(double* %0)
store double %45, double* @grat1.h
%46 = fadd double %45, 1.000000e+00
store double %46, double* @grat1.g
%47 = load double, double* %1
%48 = fcmp olt double %47, 2.500000e-01
br i1 %48, label %55, label %49
49: ; preds = %35
%50 = load double, double* %0
%51 = fdiv double %47, 2.590000e+00
%52 = fcmp olt double %50, %51
br i1 %52, label %69, label %53
53: ; preds = %49
%54 = load double, double* @grat1.z
br label %58
55: ; preds = %35
%56 = load double, double* @grat1.z
%57 = fcmp ogt double %56, -1.339400e-01
br i1 %57, label %69, label %58
58: ; preds = %53, %55
%59 = phi double [ %54, %53 ], [ %56, %55 ]
%60 = tail call double @exp(double %59)
%61 = load double, double* @grat1.g
%62 = fmul double %60, %61
%63 = load double, double* @grat1.j
%64 = fsub double 5.000000e-01, %63
%65 = fadd double %64, 5.000000e-01
%66 = fmul double %62, %65
store double %66, double* %3
%67 = fsub double 5.000000e-01, %66
%68 = fadd double %67, 5.000000e-01
store double %68, double* %4
br label %135
69: ; preds = %55, %49
%70 = tail call double @rexp(double* @grat1.z)
%71 = fadd double %70, 5.000000e-01
%72 = fadd double %71, 5.000000e-01
%73 = load double, double* @grat1.j
%74 = fneg double %70
%75 = tail call double @llvm.fmuladd.f64(double %72, double %73, double %74)
%76 = load double, double* @grat1.g
%77 = load double, double* @grat1.h
%78 = fneg double %77
%79 = tail call double @llvm.fmuladd.f64(double %75, double %76, double %78)
store double %79, double* %4
%80 = fcmp olt double %79, 0.000000e+00
br i1 %80, label %120, label %81
81: ; preds = %69
%82 = fsub double 5.000000e-01, %79
%83 = fadd double %82, 5.000000e-01
store double %83, double* %3
br label %135
84: ; preds = %13
%85 = fsub double 1.000000e+00, %7
%86 = fadd double %8, %85
%87 = load double, double* %5
br label %88
88: ; preds = %88, %84
%89 = phi double [ %97, %88 ], [ %8, %84 ]
%90 = phi double [ %101, %88 ], [ %86, %84 ]
%91 = phi double [ %95, %88 ], [ 1.000000e+00, %84 ]
%92 = phi double [ %98, %88 ], [ 1.000000e+00, %84 ]
%93 = phi double [ %100, %88 ], [ 1.000000e+00, %84 ]
%94 = fmul double %92, %91
%95 = tail call double @llvm.fmuladd.f64(double %8, double %93, double %94)
%96 = fmul double %92, %89
%97 = tail call double @llvm.fmuladd.f64(double %8, double %90, double %96)
%98 = fadd double %92, 1.000000e+00
%99 = fsub double %98, %7
%100 = tail call double @llvm.fmuladd.f64(double %99, double %93, double %95)
%101 = tail call double @llvm.fmuladd.f64(double %99, double %90, double %97)
%102 = insertelement <2 x double> poison, double %100, i64 0
%103 = insertelement <2 x double> %102, double %95, i64 1
%104 = insertelement <2 x double> poison, double %101, i64 0
%105 = insertelement <2 x double> %104, double %97, i64 1
%106 = fdiv <2 x double> %103, %105
%107 = extractelement <2 x double> %106, i64 0
%108 = shufflevector <2 x double> %106, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%109 = fsub <2 x double> %106, %108
%110 = extractelement <2 x double> %109, i64 0
%111 = tail call double @llvm.fabs.f64(double %110)
%112 = fmul double %107, %87
%113 = fcmp ult double %111, %112
br i1 %113, label %114, label %88
114: ; preds = %88
%115 = extractelement <2 x double> %106, i64 0
%116 = load double, double* %2
%117 = fmul double %115, %116
store double %117, double* %4
%118 = fsub double 5.000000e-01, %117
%119 = fadd double %118, 5.000000e-01
store double %119, double* %3
br label %135
120: ; preds = %132, %69
store double 1.000000e+00, double* %3
store double 0.000000e+00, double* %4
br label %135
121: ; preds = %11
%122 = fcmp ult double %8, 2.500000e-01
%123 = tail call double @sqrt(double %8)
br i1 %122, label %124, label %128
124: ; preds = %121
store double %123, double* @grat1.T1
%125 = tail call double @erf1(double* @grat1.T1)
store double %125, double* %3
%126 = fsub double 5.000000e-01, %125
%127 = fadd double %126, 5.000000e-01
store double %127, double* %4
br label %135
128: ; preds = %121
store double %123, double* @grat1.T3
%129 = tail call double @erfc1(i32* @grat1.K2, double* @grat1.T3)
store double %129, double* %4
%130 = fsub double 5.000000e-01, %129
%131 = fadd double %130, 5.000000e-01
store double %131, double* %3
br label %135
132: ; preds = %6
%133 = fcmp ugt double %8, %7
br i1 %133, label %120, label %134
134: ; preds = %132
store double 0.000000e+00, double* %3
store double 1.000000e+00, double* %4
br label %135
135: ; preds = %128, %124, %120, %134, %114, %81, %58
ret void
}