#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 dnbinom_precalc(unsigned int, double, double, double);
double dnbinom_mu_precalc(unsigned int x, double size, double mu,
                          double log_n_combinations) {
  double p;
  if (size <= 0)
    return 0;
  if (mu <= 0)
    return 0;
  p = mu / (size + mu);
  return dnbinom_precalc(x, size, p, log_n_combinations);
}


x86 assembly (clang, -O0):
<dnbinom_mu_precalc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1145 <dnbinom_mu_precalc+0x35>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1194 <dnbinom_mu_precalc+0x84>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1160 <dnbinom_mu_precalc+0x50>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1194 <dnbinom_mu_precalc+0x84>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0xc(%rbp),%edi
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
call   1030 <dnbinom_precalc@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dnbinom_mu_precalc>:
xorpd  %xmm3,%xmm3
ucomisd %xmm0,%xmm3
jae    1131 <dnbinom_mu_precalc+0x21>
ucomisd %xmm1,%xmm3
jae    1131 <dnbinom_mu_precalc+0x21>
movapd %xmm0,%xmm3
addsd  %xmm1,%xmm3
divsd  %xmm3,%xmm1
jmp    1030 <dnbinom_precalc@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dnbinom_mu_precalc(i32 %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store i32 %0, i32* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%11 = load double, double* %7
%12 = fcmp ole double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %4
store double 0.000000e+00, double* %5
br label %29
14: ; preds = %4
%15 = load double, double* %8
%16 = fcmp ole double %15, 0.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %14
store double 0.000000e+00, double* %5
br label %29
18: ; preds = %14
%19 = load double, double* %8
%20 = load double, double* %7
%21 = load double, double* %8
%22 = fadd double %20, %21
%23 = fdiv double %19, %22
store double %23, double* %10
%24 = load i32, i32* %6
%25 = load double, double* %7
%26 = load double, double* %10
%27 = load double, double* %9
%28 = call double @dnbinom_precalc(i32 %24, double %25, double %26, double %27)
store double %28, double* %5
br label %29
29: ; preds = %18, %17, %13
%30 = load double, double* %5
ret double %30
}

LLVM IR (-O2):
define double @dnbinom_mu_precalc(i32 %0, double %1, double %2, double %3) {
%5 = fcmp ugt double %1, 0.000000e+00
%6 = fcmp ugt double %2, 0.000000e+00
%7 = and i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = fadd double %1, %2
%10 = fdiv double %2, %9
%11 = tail call double @dnbinom_precalc(i32 %0, double %1, double %10, double %3)
br label %12
12: ; preds = %4, %8
%13 = phi double [ %11, %8 ], [ 0.000000e+00, %4 ]
ret double %13
}