#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 */
int /*<<< orphan*/ M_PI;
double compute_1F1_3d(int, double, double, double, int);
int compute_d1F1_dz1_2d(int, double, double, int);
double compute_d1F1_dz2_3d(int, double, double, double, int);
double compute_d1F1_dz3_3d(int, double, double, double, int);
double exp(double);
int fabs(double);
double lfact(int);
double lgamma(int);
double log(double);
int sqrt(int /*<<< orphan*/);
double surface_area_sphere(int);
double compute_d1F1_dz1_3d(int dim, double z1, double z2, double z3, int iter) {
  if (fabs(z1) < 1e-8)
    return surface_area_sphere(dim) / (double)(dim + 1);
  if (fabs(z3) < 1e-8) {
    double retval = sqrt(M_PI) * compute_d1F1_dz1_2d(dim, z1, z2, iter);
    return retval;
  }
  if (z1 < 0)
    return compute_1F1_3d(dim, z1, z2, z3, iter) -
           exp(z1) * (compute_d1F1_dz1_3d(dim, -z1, z3 - z1, z2 - z1, iter) +
                      compute_d1F1_dz2_3d(dim, -z1, z3 - z1, z2 - z1, iter) +
                      compute_d1F1_dz3_3d(dim, -z1, z3 - z1, z2 - z1, iter));
  int i, j, k;
  double g, F = 0.0, logz1 = log(z1), logz2 = log(z2), logz3 = log(z3);
  double a = .5, b = .5 * (dim + 1);
  for (i = 1; i < iter; i++) {
    for (j = 0; j < iter; j++) {
      for (k = 0; k < iter; k++) {
        g = lgamma(i + a) + lgamma(j + a) + lgamma(k + a) -
            lgamma(i + j + k + b) + (i - 1) * logz1 + j * logz2 + k * logz3 -
            lfact(i - 1) - lfact(j) - lfact(k);
        if ((i > z1 || j > z2 || k > z3) && exp(g) < 1e-8 * F)
          break;
        F += exp(g);
      }
    }
  }
  return 2 * sqrt(M_PI) * F;
}


x86 assembly (clang, -O0):
<compute_d1F1_dz1_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe0a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1220 <compute_d1F1_dz1_3d+0x60>
mov    -0xc(%rbp),%edi
call   1090 <surface_area_sphere@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1672 <compute_d1F1_dz1_3d+0x4b2>
movsd  -0x28(%rbp),%xmm0
call   1060 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdca(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    128c <compute_d1F1_dz1_3d+0xcc>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
call   10e0 <sqrt@plt>
mov    %eax,-0x84(%rbp)
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x2c(%rbp),%esi
call   1030 <compute_d1F1_dz1_2d@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1672 <compute_d1F1_dz1_3d+0x4b2>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    13e6 <compute_d1F1_dz1_3d+0x226>
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
mov    -0x2c(%rbp),%esi
call   1050 <compute_1F1_3d@plt>
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1080 <exp@plt>
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mov    -0x2c(%rbp),%esi
call   10a0 <compute_d1F1_dz1_3d@plt>
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mov    -0x2c(%rbp),%esi
call   1070 <compute_d1F1_dz2_3d@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
subsd  -0x18(%rbp),%xmm2
mov    -0x2c(%rbp),%esi
call   10c0 <compute_d1F1_dz3_3d@plt>
movsd  -0xa0(%rbp),%xmm2
ff
movsd  -0x98(%rbp),%xmm1
ff
movaps %xmm0,%xmm3
movsd  -0x90(%rbp),%xmm0
ff
addsd  %xmm3,%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1672 <compute_d1F1_dz1_3d+0x4b2>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
call   10d0 <log@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x20(%rbp),%xmm0
call   10d0 <log@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
call   10d0 <log@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xbe5(%rip),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xbce(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x1,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1653 <compute_d1F1_dz1_3d+0x493>
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1640 <compute_d1F1_dz1_3d+0x480>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    162d <compute_d1F1_dz1_3d+0x46d>
cvtsi2sdl -0x3c(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <lgamma@plt>
movsd  %xmm0,-0xd8(%rbp)
ff
cvtsi2sdl -0x40(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0xd8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xd0(%rbp)
ff
cvtsi2sdl -0x44(%rbp),%xmm0
addsd  -0x78(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0xd0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
mov    -0x3c(%rbp),%eax
add    -0x40(%rbp),%eax
add    -0x44(%rbp),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x80(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <lgamma@plt>
movsd  -0xc8(%rbp),%xmm1
ff
subsd  %xmm0,%xmm1
mov    -0x3c(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x40(%rbp),%xmm1
movsd  -0x68(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x44(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
mov    -0x3c(%rbp),%edi
sub    $0x1,%edi
call   1040 <lfact@plt>
movaps %xmm0,%xmm1
movsd  -0xc0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
mov    -0x40(%rbp),%edi
call   1040 <lfact@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x44(%rbp),%edi
call   1040 <lfact@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     15e2 <compute_d1F1_dz1_3d+0x422>
cvtsi2sdl -0x40(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
ja     15e2 <compute_d1F1_dz1_3d+0x422>
cvtsi2sdl -0x44(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    160b <compute_d1F1_dz1_3d+0x44b>
movsd  -0x50(%rbp),%xmm0
call   1080 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xa09(%rip),%xmm0
mulsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    160b <compute_d1F1_dz1_3d+0x44b>
jmp    162d <compute_d1F1_dz1_3d+0x46d>
movsd  -0x50(%rbp),%xmm0
call   1080 <exp@plt>
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1470 <compute_d1F1_dz1_3d+0x2b0>
jmp    1632 <compute_d1F1_dz1_3d+0x472>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    145d <compute_d1F1_dz1_3d+0x29d>
jmp    1645 <compute_d1F1_dz1_3d+0x485>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    144a <compute_d1F1_dz1_3d+0x28a>
mov    0x298e(%rip),%rax
mov    (%rax),%edi
call   10e0 <sqrt@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_d1F1_dz1_3d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %esi,0xc(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x10(%rsp)
mov    %edi,%ebx
movapd %xmm0,0x50(%rsp)
call   1060 <fabs@plt>
test   %eax,%eax
jle    1302 <compute_d1F1_dz1_3d+0x142>
movsd  0x18(%rsp),%xmm0
call   1060 <fabs@plt>
test   %eax,%eax
jle    131c <compute_d1F1_dz1_3d+0x15c>
xorpd  %xmm2,%xmm2
movapd 0x50(%rsp),%xmm0
xorpd  %xmm1,%xmm1
movsd  %xmm1,0x30(%rsp)
ucomisd %xmm0,%xmm2
jbe    1351 <compute_d1F1_dz1_3d+0x191>
mov    %ebx,%edi
movsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm2
mov    0xc(%rsp),%ebp
mov    %ebp,%esi
call   1050 <compute_1F1_3d@plt>
movsd  %xmm0,0x40(%rsp)
movaps 0x50(%rsp),%xmm0
call   1080 <exp@plt>
movsd  %xmm0,0x30(%rsp)
movapd 0xdc2(%rip),%xmm0
movapd 0x50(%rsp),%xmm2
xorpd  %xmm2,%xmm0
movapd %xmm0,0x20(%rsp)
movsd  0x18(%rsp),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm2,%xmm3
movsd  %xmm1,0x18(%rsp)
movsd  0x10(%rsp),%xmm2
subsd  %xmm3,%xmm2
movsd  %xmm2,0x10(%rsp)
mov    %ebx,%edi
mov    %ebp,%esi
call   10a0 <compute_d1F1_dz1_3d@plt>
movsd  %xmm0,0x38(%rsp)
mov    %ebx,%edi
movapd 0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    %ebp,%esi
call   1070 <compute_d1F1_dz2_3d@plt>
addsd  0x38(%rsp),%xmm0
movsd  %xmm0,0x38(%rsp)
mov    %ebx,%edi
movapd 0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
mov    %ebp,%esi
call   10c0 <compute_d1F1_dz3_3d@plt>
addsd  0x38(%rsp),%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  0x40(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
jmp    1613 <compute_d1F1_dz1_3d+0x453>
mov    %ebx,%edi
call   1090 <surface_area_sphere@plt>
add    $0x1,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
jmp    1613 <compute_d1F1_dz1_3d+0x453>
mov    0x2cc5(%rip),%rax
mov    (%rax),%edi
call   10e0 <sqrt@plt>
mov    %eax,%ebp
mov    %ebx,%edi
movaps 0x50(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
mov    0xc(%rsp),%esi
call   1030 <compute_d1F1_dz1_2d@plt>
imul   %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
jmp    1613 <compute_d1F1_dz1_3d+0x453>
call   10d0 <log@plt>
movsd  %xmm0,0x88(%rsp)
movsd  0x10(%rsp),%xmm0
call   10d0 <log@plt>
movsd  %xmm0,0x80(%rsp)
movsd  0x18(%rsp),%xmm0
call   10d0 <log@plt>
movsd  %xmm0,0x78(%rsp)
cmpl   $0x2,0xc(%rsp)
jl     15f6 <compute_d1F1_dz1_3d+0x436>
add    $0x1,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xc5f(%rip),%xmm0
movsd  %xmm0,0x70(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
mov    $0x1,%r14d
movsd  0xc49(%rip),%xmm1
jmp    13ec <compute_d1F1_dz1_3d+0x22c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addsd  0xc30(%rip),%xmm1
mov    0x60(%rsp),%r14
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
je     15f6 <compute_d1F1_dz1_3d+0x436>
movapd %xmm1,%xmm0
addsd  0xc08(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,0x4c(%rsp)
lea    -0x1(%r14),%r12d
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
movsd  %xmm0,0x90(%rsp)
xor    %ebp,%ebp
mov    %r14,0x60(%rsp)
xorpd  %xmm2,%xmm2
movsd  %xmm1,0x68(%rsp)
jmp    1455 <compute_d1F1_dz1_3d+0x295>
nopl   0x0(%rax,%rax,1)
movsd  0x38(%rsp),%xmm2
addsd  0xbca(%rip),%xmm2
add    $0x1,%ebp
add    $0x1,%r14d
cmp    0xc(%rsp),%ebp
movsd  0x68(%rsp),%xmm1
je     13d0 <compute_d1F1_dz1_3d+0x210>
ucomisd 0x50(%rsp),%xmm1
seta   %al
movapd %xmm2,%xmm0
addsd  0xb96(%rip),%xmm0
cvttsd2si %xmm0,%r13d
movsd  %xmm2,0x38(%rsp)
ucomisd 0x10(%rsp),%xmm2
seta   %r15b
or     %al,%r15b
xor    %ebx,%ebx
jmp    14b6 <compute_d1F1_dz1_3d+0x2f6>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm1,%xmm0
call   1080 <exp@plt>
movsd  0x30(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
add    $0x1,%ebx
cmp    %ebx,0xc(%rsp)
je     1430 <compute_d1F1_dz1_3d+0x270>
mov    0x4c(%rsp),%edi
call   10b0 <lgamma@plt>
movsd  %xmm0,0x20(%rsp)
mov    %r13d,%edi
call   10b0 <lgamma@plt>
movapd %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x40(%rsp)
addsd  0x20(%rsp),%xmm1
movsd  %xmm1,0x20(%rsp)
addsd  0xb0e(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   10b0 <lgamma@plt>
lea    (%r14,%rbx,1),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
addsd  0x70(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   10b0 <lgamma@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x90(%rsp),%xmm0
mulsd  0x88(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  0x38(%rsp),%xmm1
mulsd  0x80(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  0x40(%rsp),%xmm0
mulsd  0x78(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
mov    %r12d,%edi
call   1040 <lfact@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %ebp,%edi
call   1040 <lfact@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x20(%rsp)
mov    %ebx,%edi
call   1040 <lfact@plt>
movsd  0x20(%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x40(%rsp),%xmm0
ucomisd 0x18(%rsp),%xmm0
seta   %al
or     %r15b,%al
cmp    $0x1,%al
jne    1490 <compute_d1F1_dz1_3d+0x2d0>
movapd %xmm1,%xmm0
movsd  %xmm1,0x20(%rsp)
call   1080 <exp@plt>
movsd  0x30(%rsp),%xmm1
mulsd  0xa2f(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  0x20(%rsp),%xmm1
jbe    1490 <compute_d1F1_dz1_3d+0x2d0>
jmp    1430 <compute_d1F1_dz1_3d+0x270>
mov    0x29eb(%rip),%rax
mov    (%rax),%edi
call   10e0 <sqrt@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x30(%rsp),%xmm0
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@M_PI = global i32 0
define double @compute_d1F1_dz1_3d(i32 %0, double %1, double %2, double %3, i32 %4) {
%6 = tail call i32 @fabs(double %1)
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = tail call double @surface_area_sphere(i32 %0)
%10 = add nsw i32 %0, 1
%11 = sitofp i32 %10 to double
%12 = fdiv double %9, %11
br label %24
13: ; preds = %5
%14 = tail call i32 @fabs(double %3)
%15 = icmp slt i32 %14, 1
br i1 %15, label %16, label %22
16: ; preds = %13
%17 = load i32, i32* @M_PI
%18 = tail call i32 @sqrt(i32 %17)
%19 = tail call i32 @compute_d1F1_dz1_2d(i32 %0, double %1, double %2, i32 %4)
%20 = mul nsw i32 %19, %18
%21 = sitofp i32 %20 to double
br label %24
22: ; preds = %13
%23 = fcmp olt double %1, 0.000000e+00
br i1 %23, label %26, label %39
24: ; preds = %8, %16, %109, %26
%25 = phi double [ %38, %26 ], [ %12, %8 ], [ %21, %16 ], [ %115, %109 ]
ret double %25
26: ; preds = %22
%27 = tail call double @compute_1F1_3d(i32 %0, double %1, double %2, double %3, i32 %4)
%28 = tail call double @exp(double %1)
%29 = fneg double %1
%30 = fsub double %3, %1
%31 = fsub double %2, %1
%32 = tail call double @compute_d1F1_dz1_3d(i32 %0, double %29, double %30, double %31, i32 %4)
%33 = tail call double @compute_d1F1_dz2_3d(i32 %0, double %29, double %30, double %31, i32 %4)
%34 = fadd double %32, %33
%35 = tail call double @compute_d1F1_dz3_3d(i32 %0, double %29, double %30, double %31, i32 %4)
%36 = fadd double %34, %35
%37 = fneg double %28
%38 = tail call double @llvm.fmuladd.f64(double %37, double %36, double %27)
br label %24
39: ; preds = %22
%40 = tail call double @log(double %1)
%41 = tail call double @log(double %2)
%42 = tail call double @log(double %3)
%43 = add nsw i32 %0, 1
%44 = sitofp i32 %43 to double
%45 = fmul double %44, 5.000000e-01
%46 = icmp sgt i32 %4, 1
br i1 %46, label %47, label %109
47: ; preds = %39, %106
%48 = phi i32 [ %107, %106 ], [ 1, %39 ]
%49 = phi double [ %103, %106 ], [ 0.000000e+00, %39 ]
%50 = sitofp i32 %48 to double
%51 = fadd double %50, 5.000000e-01
%52 = fptosi double %51 to i32
%53 = add nsw i32 %48, -1
%54 = sitofp i32 %53 to double
%55 = fcmp ogt double %50, %1
br label %56
56: ; preds = %102, %47
%57 = phi i32 [ 0, %47 ], [ %104, %102 ]
%58 = phi double [ %49, %47 ], [ %103, %102 ]
%59 = sitofp i32 %57 to double
%60 = fadd double %59, 5.000000e-01
%61 = fptosi double %60 to i32
%62 = add nuw nsw i32 %57, %48
%63 = fcmp ogt double %59, %2
%64 = select i1 %55, i1 true, i1 %63
br label %65
65: ; preds = %56, %97
%66 = phi i32 [ 0, %56 ], [ %100, %97 ]
%67 = phi double [ %58, %56 ], [ %99, %97 ]
%68 = tail call double @lgamma(i32 %52)
%69 = tail call double @lgamma(i32 %61)
%70 = fadd double %68, %69
%71 = sitofp i32 %66 to double
%72 = fadd double %71, 5.000000e-01
%73 = fptosi double %72 to i32
%74 = tail call double @lgamma(i32 %73)
%75 = fadd double %70, %74
%76 = add nuw nsw i32 %62, %66
%77 = sitofp i32 %76 to double
%78 = fadd double %45, %77
%79 = fptosi double %78 to i32
%80 = tail call double @lgamma(i32 %79)
%81 = fsub double %75, %80
%82 = tail call double @llvm.fmuladd.f64(double %54, double %40, double %81)
%83 = tail call double @llvm.fmuladd.f64(double %59, double %41, double %82)
%84 = tail call double @llvm.fmuladd.f64(double %71, double %42, double %83)
%85 = tail call double @lfact(i32 %53)
%86 = fsub double %84, %85
%87 = tail call double @lfact(i32 %57)
%88 = fsub double %86, %87
%89 = tail call double @lfact(i32 %66)
%90 = fsub double %88, %89
%91 = fcmp ogt double %71, %3
%92 = select i1 %64, i1 true, i1 %91
br i1 %92, label %93, label %97
93: ; preds = %65
%94 = tail call double @exp(double %90)
%95 = fmul double %67, 1.000000e-08
%96 = fcmp olt double %94, %95
br i1 %96, label %102, label %97
97: ; preds = %65, %93
%98 = tail call double @exp(double %90)
%99 = fadd double %67, %98
%100 = add nuw nsw i32 %66, 1
%101 = icmp eq i32 %100, %4
br i1 %101, label %102, label %65
102: ; preds = %93, %97
%103 = phi double [ %67, %93 ], [ %99, %97 ]
%104 = add nuw nsw i32 %57, 1
%105 = icmp eq i32 %104, %4
br i1 %105, label %106, label %56
106: ; preds = %102
%107 = add nuw nsw i32 %48, 1
%108 = icmp eq i32 %107, %4
br i1 %108, label %109, label %47
109: ; preds = %106, %39
%110 = phi double [ 0.000000e+00, %39 ], [ %103, %106 ]
%111 = load i32, i32* @M_PI
%112 = tail call i32 @sqrt(i32 %111)
%113 = shl nsw i32 %112, 1
%114 = sitofp i32 %113 to double
%115 = fmul double %110, %114
br label %24
}