#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_2d(int, double, double, int);
double compute_d1F1_dz2_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_dz3_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)
    return .5 * sqrt(M_PI) * compute_1F1_2d(dim + 2, z1, z2, iter);
  if (z1 < 0)
    return exp(z1) * compute_d1F1_dz2_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 = 0; i < iter; i++) {
    for (j = 0; j < iter; j++) {
      for (k = 1; k < iter; k++) {
        g = lgamma(i + a) + lgamma(j + a) + lgamma(k + a) -
            lgamma(i + j + k + b) + i * logz1 + j * logz2 + (k - 1) * logz3 -
            lfact(i) - lfact(j) - lfact(k - 1);
        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_dz3_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%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   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xe3a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11f0 <compute_d1F1_dz3_3d+0x60>
mov    -0xc(%rbp),%edi
call   1080 <surface_area_sphere@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    155b <compute_d1F1_dz3_3d+0x3cb>
movsd  -0x28(%rbp),%xmm0
call   1040 <fabs@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdfa(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1261 <compute_d1F1_dz3_3d+0xd1>
mov    0x2dd1(%rip),%rax
mov    (%rax),%edi
call   10b0 <sqrt@plt>
cvtsi2sd %eax,%xmm1
movsd  0xdde(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0xc(%rbp),%edi
add    $0x2,%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
mov    -0x2c(%rbp),%esi
call   1060 <compute_1F1_2d@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    155b <compute_d1F1_dz3_3d+0x3cb>
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    12cf <compute_d1F1_dz3_3d+0x13f>
movsd  -0x18(%rbp),%xmm0
call   1070 <exp@plt>
movsd  %xmm0,-0x80(%rbp)
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   1050 <compute_d1F1_dz2_3d@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    155b <compute_d1F1_dz3_3d+0x3cb>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
call   10a0 <log@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
call   10a0 <log@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x28(%rbp),%xmm0
call   10a0 <log@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  0xcfc(%rip),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xce5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    153c <compute_d1F1_dz3_3d+0x3ac>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1529 <compute_d1F1_dz3_3d+0x399>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1516 <compute_d1F1_dz3_3d+0x386>
cvtsi2sdl -0x30(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <lgamma@plt>
movsd  %xmm0,-0xb0(%rbp)
ff
cvtsi2sdl -0x34(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
cvtsi2sdl -0x38(%rbp),%xmm0
addsd  -0x68(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <lgamma@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
mov    -0x30(%rbp),%eax
add    -0x34(%rbp),%eax
add    -0x38(%rbp),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x70(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <lgamma@plt>
movsd  -0xa0(%rbp),%xmm1
ff
subsd  %xmm0,%xmm1
cvtsi2sdl -0x30(%rbp),%xmm0
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  -0x60(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x30(%rbp),%edi
call   1030 <lfact@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x34(%rbp),%edi
call   1030 <lfact@plt>
movaps %xmm0,%xmm1
movsd  -0x90(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x38(%rbp),%edi
sub    $0x1,%edi
call   1030 <lfact@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
cvtsi2sdl -0x30(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     14cb <compute_d1F1_dz3_3d+0x33b>
cvtsi2sdl -0x34(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
ja     14cb <compute_d1F1_dz3_3d+0x33b>
cvtsi2sdl -0x38(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    14f4 <compute_d1F1_dz3_3d+0x364>
movsd  -0x40(%rbp),%xmm0
call   1070 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xb20(%rip),%xmm0
mulsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14f4 <compute_d1F1_dz3_3d+0x364>
jmp    1516 <compute_d1F1_dz3_3d+0x386>
movsd  -0x40(%rbp),%xmm0
call   1070 <exp@plt>
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1359 <compute_d1F1_dz3_3d+0x1c9>
jmp    151b <compute_d1F1_dz3_3d+0x38b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1346 <compute_d1F1_dz3_3d+0x1b6>
jmp    152e <compute_d1F1_dz3_3d+0x39e>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1333 <compute_d1F1_dz3_3d+0x1a3>
mov    0x2aa5(%rip),%rax
mov    (%rax),%edi
call   10b0 <sqrt@plt>
shl    $0x1,%eax
cvtsi2sd %eax,%xmm0
mulsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_d1F1_dz3_3d>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %esi,0xc(%rsp)
movsd  %xmm2,0x28(%rsp)
movsd  %xmm1,0x20(%rsp)
mov    %edi,%ebx
movapd %xmm0,0x40(%rsp)
call   1040 <fabs@plt>
test   %eax,%eax
jle    122b <compute_d1F1_dz3_3d+0x9b>
movsd  0x28(%rsp),%xmm0
call   1040 <fabs@plt>
test   %eax,%eax
jle    1245 <compute_d1F1_dz3_3d+0xb5>
xorpd  %xmm1,%xmm1
movapd 0x40(%rsp),%xmm0
ucomisd %xmm0,%xmm1
jbe    128b <compute_d1F1_dz3_3d+0xfb>
call   1070 <exp@plt>
movsd  %xmm0,(%rsp)
movapd 0xe2c(%rip),%xmm0
movapd 0x40(%rsp),%xmm2
xorpd  %xmm2,%xmm0
movsd  0x28(%rsp),%xmm1
subsd  %xmm2,%xmm1
movapd %xmm2,%xmm3
movsd  0x20(%rsp),%xmm2
subsd  %xmm3,%xmm2
mov    %ebx,%edi
mov    0xc(%rsp),%esi
call   1050 <compute_d1F1_dz2_3d@plt>
mulsd  (%rsp),%xmm0
jmp    151e <compute_d1F1_dz3_3d+0x38e>
mov    %ebx,%edi
call   1080 <surface_area_sphere@plt>
add    $0x1,%ebx
xorps  %xmm1,%xmm1
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
jmp    151e <compute_d1F1_dz3_3d+0x38e>
mov    0x2d9c(%rip),%rax
mov    (%rax),%edi
call   10b0 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xd9e(%rip),%xmm0
movsd  %xmm0,(%rsp)
add    $0x2,%ebx
mov    %ebx,%edi
movapd 0x40(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    0xc(%rsp),%esi
call   1060 <compute_1F1_2d@plt>
mulsd  (%rsp),%xmm0
jmp    151e <compute_d1F1_dz3_3d+0x38e>
call   10a0 <log@plt>
movsd  %xmm0,0x68(%rsp)
movsd  0x20(%rsp),%xmm0
call   10a0 <log@plt>
movsd  %xmm0,0x60(%rsp)
movsd  0x28(%rsp),%xmm0
call   10a0 <log@plt>
xorpd  %xmm1,%xmm1
movsd  %xmm0,0x58(%rsp)
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    14fb <compute_d1F1_dz3_3d+0x36b>
add    $0x1,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xd26(%rip),%xmm0
movsd  %xmm0,0x50(%rsp)
xor    %ecx,%ecx
xorpd  %xmm0,%xmm0
xorpd  %xmm1,%xmm1
jmp    130d <compute_d1F1_dz3_3d+0x17d>
nopl   0x0(%rax)
movsd  0x38(%rsp),%xmm0
addsd  0xd12(%rip),%xmm0
mov    0x1c(%rsp),%ecx
add    $0x1,%ecx
cmp    %eax,%ecx
je     14fb <compute_d1F1_dz3_3d+0x36b>
movsd  %xmm0,0x38(%rsp)
addsd  0xce5(%rip),%xmm0
cvttsd2si %xmm0,%r12d
mov    %ecx,0x1c(%rsp)
mov    %ecx,%r14d
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x30(%rsp)
xor    %ebp,%ebp
jmp    135f <compute_d1F1_dz3_3d+0x1cf>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x30(%rsp),%xmm0
addsd  0xcc2(%rip),%xmm0
movsd  %xmm0,0x30(%rsp)
add    $0x1,%ebp
add    $0x1,%r14d
cmp    %eax,%ebp
je     12f0 <compute_d1F1_dz3_3d+0x160>
cmp    $0x1,%eax
je     1340 <compute_d1F1_dz3_3d+0x1b0>
movsd  0x38(%rsp),%xmm0
ucomisd 0x40(%rsp),%xmm0
seta   %al
movsd  0x30(%rsp),%xmm2
movapd %xmm2,%xmm0
addsd  0xc7b(%rip),%xmm0
cvttsd2si %xmm0,%r13d
ucomisd 0x20(%rsp),%xmm2
seta   %r15b
or     %al,%r15b
mov    $0x1,%ebx
jmp    13be <compute_d1F1_dz3_3d+0x22e>
xchg   %ax,%ax
movapd %xmm1,%xmm0
call   1070 <exp@plt>
movsd  0x10(%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0x2,%ebx
mov    0xc(%rsp),%eax
cmp    %eax,%ebx
je     1340 <compute_d1F1_dz3_3d+0x1b0>
movsd  %xmm1,0x10(%rsp)
mov    %r12d,%edi
call   1090 <lgamma@plt>
movsd  %xmm0,(%rsp)
mov    %r13d,%edi
call   1090 <lgamma@plt>
movapd %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
movsd  %xmm0,0x70(%rsp)
addsd  (%rsp),%xmm1
movsd  %xmm1,(%rsp)
addsd  0xc04(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1090 <lgamma@plt>
lea    (%r14,%rbx,1),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
addsd  0x50(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   1090 <lgamma@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x38(%rsp),%xmm0
mulsd  0x68(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  0x30(%rsp),%xmm1
mulsd  0x60(%rsp),%xmm1
addsd  %xmm0,%xmm1
add    $0xffffffff,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0x58(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
mov    0x1c(%rsp),%edi
call   1030 <lfact@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %ebp,%edi
call   1030 <lfact@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %ebx,%edi
call   1030 <lfact@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movsd  0x70(%rsp),%xmm0
ucomisd 0x28(%rsp),%xmm0
seta   %al
or     %r15b,%al
cmp    $0x1,%al
jne    13a0 <compute_d1F1_dz3_3d+0x210>
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
call   1070 <exp@plt>
movsd  0x10(%rsp),%xmm1
mulsd  0xb2b(%rip),%xmm1
ucomisd %xmm0,%xmm1
movsd  (%rsp),%xmm1
jbe    13a0 <compute_d1F1_dz3_3d+0x210>
mov    0xc(%rsp),%eax
movsd  0x10(%rsp),%xmm1
jmp    1340 <compute_d1F1_dz3_3d+0x1b0>
movsd  %xmm1,0x10(%rsp)
mov    0x2ae0(%rip),%rax
mov    (%rax),%edi
call   10b0 <sqrt@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x78,%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_dz3_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 i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = 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
%22 = load double, double* %8
%23 = call i32 @fabs(double %22)
%24 = sitofp i32 %23 to double
%25 = fcmp olt double %24, 1.000000e-08
br i1 %25, label %26, label %33
26: ; preds = %5
%27 = load i32, i32* %7
%28 = call double @surface_area_sphere(i32 %27)
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
%31 = sitofp i32 %30 to double
%32 = fdiv double %28, %31
store double %32, double* %6
br label %192
33: ; preds = %5
%34 = load double, double* %10
%35 = call i32 @fabs(double %34)
%36 = sitofp i32 %35 to double
%37 = fcmp olt double %36, 1.000000e-08
br i1 %37, label %38, label %50
38: ; preds = %33
%39 = load i32, i32* @M_PI
%40 = call i32 @sqrt(i32 %39)
%41 = sitofp i32 %40 to double
%42 = fmul double 5.000000e-01, %41
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 2
%45 = load double, double* %8
%46 = load double, double* %9
%47 = load i32, i32* %11
%48 = call double @compute_1F1_2d(i32 %44, double %45, double %46, i32 %47)
%49 = fmul double %42, %48
store double %49, double* %6
br label %192
50: ; preds = %33
%51 = load double, double* %8
%52 = fcmp olt double %51, 0.000000e+00
br i1 %52, label %53, label %68
53: ; preds = %50
%54 = load double, double* %8
%55 = call double @exp(double %54)
%56 = load i32, i32* %7
%57 = load double, double* %8
%58 = fneg double %57
%59 = load double, double* %10
%60 = load double, double* %8
%61 = fsub double %59, %60
%62 = load double, double* %9
%63 = load double, double* %8
%64 = fsub double %62, %63
%65 = load i32, i32* %11
%66 = call double @compute_d1F1_dz2_3d(i32 %56, double %58, double %61, double %64, i32 %65)
%67 = fmul double %55, %66
store double %67, double* %6
br label %192
68: ; preds = %50
store double 0.000000e+00, double* %16
%69 = load double, double* %8
%70 = call double @log(double %69)
store double %70, double* %17
%71 = load double, double* %9
%72 = call double @log(double %71)
store double %72, double* %18
%73 = load double, double* %10
%74 = call double @log(double %73)
store double %74, double* %19
store double 5.000000e-01, double* %20
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
%77 = sitofp i32 %76 to double
%78 = fmul double 5.000000e-01, %77
store double %78, double* %21
store i32 0, i32* %12
br label %79
79: ; preds = %182, %68
%80 = load i32, i32* %12
%81 = load i32, i32* %11
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %185
83: ; preds = %79
store i32 0, i32* %13
br label %84
84: ; preds = %178, %83
%85 = load i32, i32* %13
%86 = load i32, i32* %11
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %181
88: ; preds = %84
store i32 1, i32* %14
br label %89
89: ; preds = %174, %88
%90 = load i32, i32* %14
%91 = load i32, i32* %11
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %177
93: ; preds = %89
%94 = load i32, i32* %12
%95 = sitofp i32 %94 to double
%96 = load double, double* %20
%97 = fadd double %95, %96
%98 = fptosi double %97 to i32
%99 = call double @lgamma(i32 %98)
%100 = load i32, i32* %13
%101 = sitofp i32 %100 to double
%102 = load double, double* %20
%103 = fadd double %101, %102
%104 = fptosi double %103 to i32
%105 = call double @lgamma(i32 %104)
%106 = fadd double %99, %105
%107 = load i32, i32* %14
%108 = sitofp i32 %107 to double
%109 = load double, double* %20
%110 = fadd double %108, %109
%111 = fptosi double %110 to i32
%112 = call double @lgamma(i32 %111)
%113 = fadd double %106, %112
%114 = load i32, i32* %12
%115 = load i32, i32* %13
%116 = add nsw i32 %114, %115
%117 = load i32, i32* %14
%118 = add nsw i32 %116, %117
%119 = sitofp i32 %118 to double
%120 = load double, double* %21
%121 = fadd double %119, %120
%122 = fptosi double %121 to i32
%123 = call double @lgamma(i32 %122)
%124 = fsub double %113, %123
%125 = load i32, i32* %12
%126 = sitofp i32 %125 to double
%127 = load double, double* %17
%128 = call double @llvm.fmuladd.f64(double %126, double %127, double %124)
%129 = load i32, i32* %13
%130 = sitofp i32 %129 to double
%131 = load double, double* %18
%132 = call double @llvm.fmuladd.f64(double %130, double %131, double %128)
%133 = load i32, i32* %14
%134 = sub nsw i32 %133, 1
%135 = sitofp i32 %134 to double
%136 = load double, double* %19
%137 = call double @llvm.fmuladd.f64(double %135, double %136, double %132)
%138 = load i32, i32* %12
%139 = call double @lfact(i32 %138)
%140 = fsub double %137, %139
%141 = load i32, i32* %13
%142 = call double @lfact(i32 %141)
%143 = fsub double %140, %142
%144 = load i32, i32* %14
%145 = sub nsw i32 %144, 1
%146 = call double @lfact(i32 %145)
%147 = fsub double %143, %146
store double %147, double* %15
%148 = load i32, i32* %12
%149 = sitofp i32 %148 to double
%150 = load double, double* %8
%151 = fcmp ogt double %149, %150
br i1 %151, label %162, label %152
152: ; preds = %93
%153 = load i32, i32* %13
%154 = sitofp i32 %153 to double
%155 = load double, double* %9
%156 = fcmp ogt double %154, %155
br i1 %156, label %162, label %157
157: ; preds = %152
%158 = load i32, i32* %14
%159 = sitofp i32 %158 to double
%160 = load double, double* %10
%161 = fcmp ogt double %159, %160
br i1 %161, label %162, label %169
162: ; preds = %157, %152, %93
%163 = load double, double* %15
%164 = call double @exp(double %163)
%165 = load double, double* %16
%166 = fmul double 1.000000e-08, %165
%167 = fcmp olt double %164, %166
br i1 %167, label %168, label %169
168: ; preds = %162
br label %177
169: ; preds = %162, %157
%170 = load double, double* %15
%171 = call double @exp(double %170)
%172 = load double, double* %16
%173 = fadd double %172, %171
store double %173, double* %16
br label %174
174: ; preds = %169
%175 = load i32, i32* %14
%176 = add nsw i32 %175, 1
store i32 %176, i32* %14
br label %89
177: ; preds = %168, %89
br label %178
178: ; preds = %177
%179 = load i32, i32* %13
%180 = add nsw i32 %179, 1
store i32 %180, i32* %13
br label %84
181: ; preds = %84
br label %182
182: ; preds = %181
%183 = load i32, i32* %12
%184 = add nsw i32 %183, 1
store i32 %184, i32* %12
br label %79
185: ; preds = %79
%186 = load i32, i32* @M_PI
%187 = call i32 @sqrt(i32 %186)
%188 = mul nsw i32 2, %187
%189 = sitofp i32 %188 to double
%190 = load double, double* %16
%191 = fmul double %189, %190
store double %191, double* %6
br label %192
192: ; preds = %185, %53, %38, %26
%193 = load double, double* %6
ret double %193
}

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