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


x86 assembly (clang, -O0):
<eval_zinb_dfda>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xea2(%rip),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x38(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe54(%rip),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  0xe47(%rip),%xmm3
subsd  -0x20(%rbp),%xmm3
mulsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_zinb_dfda>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movsd  %xmm1,0x8(%rsp)
movaps %xmm0,%xmm2
movsd  %xmm0,(%rsp)
movapd %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1040 <pow@plt>
mov    %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
movsd  %xmm1,0x18(%rsp)
movsd  0xea7(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
mulsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  0x18(%rsp),%xmm0
mulsd  %xmm1,%xmm1
mulsd  0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @eval_zinb_dfda(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%8 = load double, double* %5
%9 = load double, double* %4
%10 = call double @pow(double %8, double %9)
store double %10, double* %7
%11 = load i32, i32* %6
%12 = uitofp i32 %11 to double
%13 = load double, double* %7
%14 = fsub double 1.000000e+00, %13
%15 = load double, double* %4
%16 = load double, double* %7
%17 = fmul double %15, %16
%18 = load double, double* %5
%19 = call double @log(double %18)
%20 = call double @llvm.fmuladd.f64(double %17, double %19, double %14)
%21 = fmul double %12, %20
%22 = load double, double* %5
%23 = load double, double* %7
%24 = fsub double 1.000000e+00, %23
%25 = load double, double* %7
%26 = fsub double 1.000000e+00, %25
%27 = fmul double %24, %26
%28 = fmul double %22, %27
%29 = fdiv double %21, %28
ret double %29
}

LLVM IR (-O2):
define double @eval_zinb_dfda(double %0, double %1, i32 %2) {
%4 = tail call double @pow(double %1, double %0)
%5 = uitofp i32 %2 to double
%6 = fsub double 1.000000e+00, %4
%7 = fmul double %4, %0
%8 = tail call double @log(double %1)
%9 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %6)
%10 = fmul double %9, %5
%11 = fmul double %6, %6
%12 = fmul double %11, %1
%13 = fdiv double %10, %12
ret double %13
}