#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 erf__(int /*<<< orphan*/);
double erfc1(int /*<<< orphan*/, int /*<<< orphan*/);
double exp(double);
double fabs(double);
double gam1(double);
double log(double);
double rexp(double);
int /*<<< orphan*/ sqrt(double);
void grat1(double a, double x, double r, double *p, double *q, double eps) {
  double c__, g, h__, j, l, t, w, z__, an, am0, an0, a2n, b2n, cma;
  double tol, sum;
  double a2nm1, b2nm1;
  if (a * x == 0.0) {
    goto L130;
  }
  if (a == 0.5) {
    goto L120;
  }
  if (x < 1.1f) {
    goto L10;
  }
  goto L50;
L10:
  an = 3.0;
  c__ = x;
  sum = x / (a + 3.0);
  tol = eps * .1f / (a + 1.0);
L11:
  an += 1.0;
  c__ = -c__ * (x / an);
  t = c__ / (a + an);
  sum += t;
  if (fabs(t) > tol) {
    goto L11;
  }
  j = a * x * ((sum / 6.0 - 0.5 / (a + 2.0)) * x + 1.0 / (a + 1.0));
  z__ = a * log(x);
  h__ = gam1(a);
  g = h__ + 1.0;
  if (x < .25f) {
    goto L20;
  }
  if (a < x / 2.59f) {
    goto L40;
  }
  goto L30;
L20:
  if (z__ > -.13394f) {
    goto L40;
  }
L30:
  w = exp(z__);
  *p = w * g * (0.5 - j + 0.5);
  *q = 0.5 - *p + 0.5;
  return;
L40:
  l = rexp(z__);
  w = l + 0.5 + 0.5;
  *q = (w * j - l) * g - h__;
  if (*q < 0.0) {
    goto L110;
  }
  *p = 0.5 - *q + 0.5;
  return;
L50:
  a2nm1 = 1.0;
  a2n = 1.0;
  b2nm1 = x;
  b2n = x + (1.0 - a);
  c__ = 1.0;
L51:
  a2nm1 = x * a2n + c__ * a2nm1;
  b2nm1 = x * b2n + c__ * b2nm1;
  am0 = a2nm1 / b2nm1;
  c__ += 1.0;
  cma = c__ - a;
  a2n = a2nm1 + cma * a2n;
  b2n = b2nm1 + cma * b2n;
  an0 = a2n / b2n;
  if (fabs(an0 - am0) >= eps * an0) {
    goto L51;
  }
  *q = r * an0;
  *p = 0.5 - *q + 0.5;
  return;
L100:
  *p = 0.0;
  *q = 1.0;
  return;
L110:
  *p = 1.0;
  *q = 0.0;
  return;
L120:
  if (x >= .25f) {
    goto L121;
  }
  *p = erf__(sqrt(x));
  *q = 0.5 - *p + 0.5;
  return;
L121:
  *q = erfc1(0, sqrt(x));
  *p = 0.5 - *q + 0.5;
  return;
L130:
  if (x <= a) {
    goto L100;
  }
  goto L110;
}


x86 assembly (clang, -O0):
<grat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b9 <grat1+0x49>
jp     11b9 <grat1+0x49>
jmp    17d0 <grat1+0x660>
movsd  -0x8(%rbp),%xmm0
movsd  0xe3a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11db <grat1+0x6b>
jp     11db <grat1+0x6b>
jmp    172e <grat1+0x5be>
movsd  0xe25(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11f3 <grat1+0x83>
jmp    11f8 <grat1+0x88>
jmp    152f <grat1+0x3bf>
movsd  0xe20(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe04(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  0xde3(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xdce(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  0xdb5(%rip),%xmm0
addsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x78(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  -0x78(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x60(%rbp),%xmm0
movaps 0xd83(%rip),%xmm1
pand   %xmm1,%xmm0
ucomisd -0xa8(%rbp),%xmm0
ff
jbe    12e4 <grat1+0x174>
jmp    1253 <grat1+0xe3>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0xb0(%rbp),%xmm1
ff
movsd  0xd3a(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xd26(%rip),%xmm3
addsd  -0x8(%rbp),%xmm3
movsd  0xce9(%rip),%xmm2
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm3
movsd  0xce4(%rip),%xmm4
addsd  -0x8(%rbp),%xmm4
movsd  0xcd7(%rip),%xmm2
divsd  %xmm4,%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
call   1080 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xc8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <gam1@plt>
movsd  %xmm0,-0x48(%rbp)
movsd  0xc80(%rip),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xc86(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    13b2 <grat1+0x242>
jmp    13dc <grat1+0x26c>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movsd  0xc7c(%rip),%xmm2
divsd  %xmm2,%xmm0
ucomisd %xmm1,%xmm0
jbe    13d7 <grat1+0x267>
jmp    1464 <grat1+0x2f4>
jmp    13fd <grat1+0x28d>
movsd  -0x70(%rbp),%xmm0
movsd  0xc5f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13f8 <grat1+0x288>
jmp    1464 <grat1+0x2f4>
jmp    13fd <grat1+0x28d>
movsd  -0x70(%rbp),%xmm0
call   1060 <exp@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x40(%rbp),%xmm0
movsd  0xbe2(%rip),%xmm1
subsd  -0x50(%rbp),%xmm1
movsd  0xbd5(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0xbb9(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  0xbad(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17ee <grat1+0x67e>
movsd  -0x70(%rbp),%xmm0
call   1040 <rexp@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  0xb85(%rip),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  0xb78(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm2
movsd  -0x48(%rbp),%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    1506 <grat1+0x396>
jmp    170e <grat1+0x59e>
mov    -0x28(%rbp),%rax
movsd  0xaee(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  0xae2(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17ee <grat1+0x67e>
movsd  0xad9(%rip),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  0xac9(%rip),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  0xaa7(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xa8e(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm1
mulsd  -0xb8(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x10(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x38(%rbp),%xmm1
mulsd  -0xc0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm0
ff
divsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0x80(%rbp)
movsd  0xa18(%rip),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xb8(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0xc0(%rbp),%xmm1
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x98(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
divsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
subsd  -0x80(%rbp),%xmm0
movaps 0x9c0(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
ucomisd %xmm1,%xmm0
jb     16b0 <grat1+0x540>
jmp    1587 <grat1+0x417>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x88(%rbp),%xmm0
ff
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x92f(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  0x923(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17ee <grat1+0x67e>
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x90b(%rip),%xmm0
movsd  %xmm0,(%rax)
jmp    17ee <grat1+0x67e>
mov    -0x20(%rbp),%rax
movsd  0x8f6(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    17ee <grat1+0x67e>
movsd  -0x10(%rbp),%xmm0
movsd  0x8ed(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     174a <grat1+0x5da>
jmp    178c <grat1+0x61c>
movsd  -0x10(%rbp),%xmm0
call   1090 <sqrt@plt>
mov    %eax,%edi
call   1050 <erf__@plt>
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
movsd  0x891(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  0x885(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17ee <grat1+0x67e>
movsd  -0x10(%rbp),%xmm0
call   1090 <sqrt@plt>
mov    %eax,%esi
xor    %edi,%edi
call   1070 <erfc1@plt>
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movsd  0x84d(%rip),%xmm0
subsd  (%rax),%xmm0
movsd  0x841(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    17ee <grat1+0x67e>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     17e9 <grat1+0x679>
jmp    16ee <grat1+0x57e>
jmp    170e <grat1+0x59e>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grat1>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
movapd %xmm0,%xmm13
movapd %xmm0,%xmm5
mulsd  %xmm1,%xmm5
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm5
jne    11b6 <grat1+0x46>
jp     11b6 <grat1+0x46>
ucomisd %xmm1,%xmm13
jae    120d <grat1+0x9d>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%r14)
movq   $0x0,(%rbx)
jmp    1532 <grat1+0x3c2>
ucomisd 0xe41(%rip),%xmm13
jne    1226 <grat1+0xb6>
jp     1226 <grat1+0xb6>
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1090 <sqrt@plt>
movsd  (%rsp),%xmm0
ucomisd 0xe62(%rip),%xmm0
jae    13b9 <grat1+0x249>
mov    %eax,%edi
call   1050 <erf__@plt>
movsd  %xmm0,(%r14)
movsd  0xe08(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rbx)
jmp    1532 <grat1+0x3c2>
movq   $0x0,(%r14)
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rbx)
jmp    1532 <grat1+0x3c2>
movsd  0xdda(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    13e4 <grat1+0x274>
movsd  0xdd8(%rip),%xmm2
movapd %xmm13,%xmm4
addsd  %xmm2,%xmm4
movapd %xmm1,%xmm0
divsd  %xmm4,%xmm0
mulsd  0xdc7(%rip),%xmm3
movsd  0xdae(%rip),%xmm8
addsd  %xmm13,%xmm8
divsd  %xmm8,%xmm3
movsd  0xd9b(%rip),%xmm11
movapd 0xdf2(%rip),%xmm9
movapd 0xdd9(%rip),%xmm10
movapd %xmm1,%xmm6
nopl   0x0(%rax,%rax,1)
xorpd  %xmm9,%xmm6
addsd  %xmm11,%xmm2
movapd %xmm1,%xmm7
divsd  %xmm2,%xmm7
mulsd  %xmm7,%xmm6
movapd %xmm2,%xmm7
addsd  %xmm13,%xmm7
movapd %xmm6,%xmm4
divsd  %xmm7,%xmm4
addsd  %xmm4,%xmm0
andpd  %xmm10,%xmm4
ucomisd %xmm3,%xmm4
ja     1290 <grat1+0x120>
divsd  0xd5a(%rip),%xmm0
movsd  0xd5a(%rip),%xmm3
addsd  %xmm13,%xmm3
movsd  0xd55(%rip),%xmm2
divsd  %xmm3,%xmm2
addsd  %xmm0,%xmm2
movapd %xmm11,%xmm0
divsd  %xmm8,%xmm0
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm2,%xmm5
movsd  %xmm5,0x18(%rsp)
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
movsd  %xmm13,0x20(%rsp)
call   1080 <log@plt>
movsd  0x20(%rsp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <gam1@plt>
movsd  0xcd3(%rip),%xmm2
movsd  (%rsp),%xmm1
movapd %xmm0,%xmm3
addsd  %xmm0,%xmm2
movsd  0xcee(%rip),%xmm0
ucomisd %xmm1,%xmm0
movsd  %xmm2,0x10(%rsp)
jbe    14c2 <grat1+0x352>
movsd  0x8(%rsp),%xmm0
ucomisd 0xce0(%rip),%xmm0
ja     14dc <grat1+0x36c>
call   1060 <exp@plt>
movsd  0x10(%rsp),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xc73(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  0x18(%rsp),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,(%r14)
movapd %xmm0,%xmm2
subsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,(%rbx)
jmp    1532 <grat1+0x3c2>
xor    %edi,%edi
mov    %eax,%esi
call   1070 <erfc1@plt>
movsd  %xmm0,(%rbx)
movsd  0xc32(%rip),%xmm1
movapd %xmm1,%xmm2
subsd  %xmm0,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%r14)
jmp    1532 <grat1+0x3c2>
movsd  0xc23(%rip),%xmm9
movapd %xmm9,%xmm10
subsd  %xmm13,%xmm10
addsd  %xmm1,%xmm10
movapd 0xc5b(%rip),%xmm8
movapd %xmm9,%xmm12
movapd %xmm9,%xmm11
movapd %xmm9,%xmm6
movapd %xmm1,%xmm7
nopl   0x0(%rax,%rax,1)
mulsd  %xmm11,%xmm6
movapd %xmm1,%xmm4
mulsd  %xmm12,%xmm4
addsd  %xmm4,%xmm6
mulsd  %xmm11,%xmm7
movapd %xmm1,%xmm4
mulsd  %xmm10,%xmm4
addsd  %xmm4,%xmm7
addsd  %xmm9,%xmm11
movapd %xmm11,%xmm0
subsd  %xmm13,%xmm0
mulsd  %xmm0,%xmm12
addsd  %xmm6,%xmm12
mulsd  %xmm10,%xmm0
addsd  %xmm7,%xmm0
movapd %xmm12,%xmm4
unpcklpd %xmm6,%xmm4
movapd %xmm0,%xmm10
unpcklpd %xmm7,%xmm0
divpd  %xmm0,%xmm4
movapd %xmm4,%xmm0
unpckhpd %xmm4,%xmm0
movapd %xmm4,%xmm5
subsd  %xmm0,%xmm5
andpd  %xmm8,%xmm5
movapd %xmm4,%xmm0
mulsd  %xmm3,%xmm0
ucomisd %xmm0,%xmm5
jae    1420 <grat1+0x2b0>
mulsd  %xmm2,%xmm4
movsd  %xmm4,(%rbx)
movsd  0xb51(%rip),%xmm0
movapd %xmm0,%xmm1
subsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14)
jmp    1532 <grat1+0x3c2>
divsd  0xb7e(%rip),%xmm1
ucomisd 0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
jbe    1376 <grat1+0x206>
movsd  %xmm3,(%rsp)
call   1040 <rexp@plt>
movsd  0xb12(%rip),%xmm1
movapd %xmm0,%xmm2
addsd  %xmm1,%xmm2
addsd  %xmm1,%xmm2
mulsd  0x18(%rsp),%xmm2
subsd  %xmm0,%xmm2
mulsd  0x10(%rsp),%xmm2
subsd  (%rsp),%xmm2
movsd  %xmm2,(%rbx)
xorpd  %xmm0,%xmm0
ucomisd %xmm2,%xmm0
ja     119d <grat1+0x2d>
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

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