#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 pow(double, double);
double eval_zinb_dfdp(double a, double p, unsigned int nz, double m) {
  const double ppa = pow(p, a);
  return -(nz * a * (1 - (a + 1) * ppa) / ((p * (1 - ppa)) * (p * (1 - ppa))) +
           m / ((1 - p) * (1 - p)));
}


x86 assembly (clang, -O0):
<eval_zinb_dfdp>:
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  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe80(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe6b(%rip),%xmm2
subsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  0xe55(%rip),%xmm3
subsd  -0x28(%rbp),%xmm3
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe37(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  0xe2a(%rip),%xmm3
subsd  -0x10(%rbp),%xmm3
mulsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_zinb_dfdp>:
push   %rbx
sub    $0x30,%rsp
movaps %xmm2,0x20(%rsp)
mov    %edi,%ebx
movapd %xmm1,0x10(%rsp)
movaps %xmm0,%xmm2
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <pow@plt>
mov    %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  0x8(%rsp),%xmm3
mulsd  %xmm3,%xmm1
movsd  0xead(%rip),%xmm2
addsd  %xmm2,%xmm3
mulsd  %xmm0,%xmm3
movapd %xmm3,%xmm4
movapd %xmm2,%xmm3
subsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm3
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm0
movapd 0x10(%rsp),%xmm4
unpcklpd %xmm4,%xmm1
mulpd  %xmm0,%xmm1
subsd  %xmm4,%xmm2
shufpd $0x2,%xmm1,%xmm2
mulpd  %xmm2,%xmm2
movapd 0x20(%rsp),%xmm1
unpcklpd %xmm3,%xmm1
divpd  %xmm2,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
xorpd  0xe5c(%rip),%xmm0
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @eval_zinb_dfdp(double %0, double %1, i32 %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store i32 %2, i32* %7
store double %3, double* %8
%10 = load double, double* %6
%11 = load double, double* %5
%12 = call double @pow(double %10, double %11)
store double %12, double* %9
%13 = load i32, i32* %7
%14 = uitofp i32 %13 to double
%15 = load double, double* %5
%16 = fmul double %14, %15
%17 = load double, double* %5
%18 = fadd double %17, 1.000000e+00
%19 = load double, double* %9
%20 = fneg double %18
%21 = call double @llvm.fmuladd.f64(double %20, double %19, double 1.000000e+00)
%22 = fmul double %16, %21
%23 = load double, double* %6
%24 = load double, double* %9
%25 = fsub double 1.000000e+00, %24
%26 = fmul double %23, %25
%27 = load double, double* %6
%28 = load double, double* %9
%29 = fsub double 1.000000e+00, %28
%30 = fmul double %27, %29
%31 = fmul double %26, %30
%32 = fdiv double %22, %31
%33 = load double, double* %8
%34 = load double, double* %6
%35 = fsub double 1.000000e+00, %34
%36 = load double, double* %6
%37 = fsub double 1.000000e+00, %36
%38 = fmul double %35, %37
%39 = fdiv double %33, %38
%40 = fadd double %32, %39
%41 = fneg double %40
ret double %41
}

LLVM IR (-O2):
define double @eval_zinb_dfdp(double %0, double %1, i32 %2, double %3) {
%5 = tail call double @pow(double %1, double %0)
%6 = uitofp i32 %2 to double
%7 = fmul double %6, %0
%8 = fadd double %0, 1.000000e+00
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %9, double %5, double 1.000000e+00)
%11 = fmul double %7, %10
%12 = fsub double 1.000000e+00, %5
%13 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %12, i64 1
%14 = insertelement <2 x double> poison, double %1, i64 0
%15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer
%16 = fsub <2 x double> %13, %15
%17 = fmul <2 x double> %13, %15
%18 = shufflevector <2 x double> %16, <2 x double> %17, <2 x i32> <i32 0, i32 3>
%19 = fmul <2 x double> %18, %18
%20 = insertelement <2 x double> poison, double %3, i64 0
%21 = insertelement <2 x double> %20, double %11, i64 1
%22 = fdiv <2 x double> %21, %19
%23 = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%24 = fadd <2 x double> %22, %23
%25 = extractelement <2 x double> %24, i64 0
%26 = fneg double %25
ret double %26
}