#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 pow(double, double);
double eval_zinb_f(double a, double p, unsigned int nz, double sum) {
  return a * nz / (p * (1 - pow(p, a))) - sum / (1 - p);
}


x86 assembly (clang, -O0):
<eval_zinb_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1030 <pow@plt>
movsd  -0x30(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe7b(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_zinb_f>:
sub    $0x38,%rsp
movaps %xmm2,0x20(%rsp)
movapd %xmm1,%xmm2
movapd %xmm1,(%rsp)
movapd %xmm0,%xmm1
mov    %edi,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <pow@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
cvtsi2sd %ecx,%xmm3
movapd 0xeaa(%rip),%xmm1
movapd (%rsp),%xmm0
unpcklpd %xmm0,%xmm2
subpd  %xmm2,%xmm1
mulpd  %xmm0,%xmm3
shufpd $0x2,%xmm1,%xmm3
movapd 0x10(%rsp),%xmm0
unpcklpd 0x20(%rsp),%xmm0
divpd  %xmm3,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
subsd  %xmm1,%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @eval_zinb_f(double %0, double %1, i32 %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load i32, i32* %7
%11 = uitofp i32 %10 to double
%12 = fmul double %9, %11
%13 = load double, double* %6
%14 = load double, double* %6
%15 = load double, double* %5
%16 = call i32 @pow(double %14, double %15)
%17 = sub nsw i32 1, %16
%18 = sitofp i32 %17 to double
%19 = fmul double %13, %18
%20 = fdiv double %12, %19
%21 = load double, double* %8
%22 = load double, double* %6
%23 = fsub double 1.000000e+00, %22
%24 = fdiv double %21, %23
%25 = fsub double %20, %24
ret double %25
}

LLVM IR (-O2):
define double @eval_zinb_f(double %0, double %1, i32 %2, double %3) {
%5 = uitofp i32 %2 to double
%6 = fmul double %5, %0
%7 = tail call i32 @pow(double %1, double %0)
%8 = sub nsw i32 1, %7
%9 = sitofp i32 %8 to double
%10 = insertelement <2 x double> <double poison, double 1.000000e+00>, double %9, i64 0
%11 = insertelement <2 x double> poison, double %1, i64 0
%12 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> zeroinitializer
%13 = fmul <2 x double> %10, %12
%14 = fsub <2 x double> %10, %12
%15 = shufflevector <2 x double> %13, <2 x double> %14, <2 x i32> <i32 0, i32 3>
%16 = insertelement <2 x double> poison, double %3, i64 1
%17 = insertelement <2 x double> %16, double %6, i64 0
%18 = fdiv <2 x double> %17, %15
%19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%20 = fsub <2 x double> %18, %19
%21 = extractelement <2 x double> %20, i64 0
ret double %21
}