#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 exp(double const);
double log10(double);
double const pow(double, double const);
double behroozi_fx(const double x, const double alpha, const double delta,
                   const double gamma) {
  if (x == 0.0) {
    return -log10(2.0) + delta * pow(log10(2.0), gamma) / (1.0 + exp(1.0));
  } else {
    double first_term = -log10(pow(10.0, alpha * x) + 1.0);
    double second_term_numerator = pow(log10(1.0 + exp(x)), gamma);
    double second_term_denom = 1.0 + exp(pow(10.0, -x));
    double second_term = delta * second_term_numerator / second_term_denom;
    return first_term + second_term;
  }
}


x86 assembly (clang, -O0):
<behroozi_fx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f7 <behroozi_fx+0xc7>
jp     11f7 <behroozi_fx+0xc7>
movsd  0xea4(%rip),%xmm0
call   1050 <log10@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xe71(%rip),%xmm0
call   1050 <log10@plt>
movsd  -0x28(%rbp),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  0xe39(%rip),%xmm0
call   1030 <exp@plt>
movsd  -0x58(%rbp),%xmm1
movaps %xmm0,%xmm3
movsd  -0x50(%rbp),%xmm0
movsd  0xe1f(%rip),%xmm2
addsd  %xmm3,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    12cd <behroozi_fx+0x19d>
movsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xdff(%rip),%xmm0
call   1040 <pow@plt>
movsd  0xdea(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1050 <log10@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xdb0(%rip),%xmm0
addsd  %xmm1,%xmm0
call   1050 <log10@plt>
movsd  -0x28(%rbp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xd7c(%rip),%xmm0
call   1040 <pow@plt>
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xd5f(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x30(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<behroozi_fx>:
sub    $0x38,%rsp
movsd  %xmm2,0x10(%rsp)
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jne    1175 <behroozi_fx+0x45>
jp     1175 <behroozi_fx+0x45>
movsd  0xebe(%rip),%xmm0
movaps %xmm3,%xmm1
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
divsd  0xeb0(%rip),%xmm0
addsd  0xeb0(%rip),%xmm0
add    $0x38,%rsp
ret
mulsd  %xmm2,%xmm1
movsd  0xe7f(%rip),%xmm0
movapd %xmm2,0x20(%rsp)
movsd  %xmm3,0x8(%rsp)
call   1040 <pow@plt>
addsd  0xe6e(%rip),%xmm0
call   1050 <log10@plt>
movsd  %xmm0,0x18(%rsp)
movapd 0x20(%rsp),%xmm0
call   1030 <exp@plt>
addsd  0xe50(%rip),%xmm0
call   1050 <log10@plt>
movsd  0x8(%rsp),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movaps 0x20(%rsp),%xmm1
xorps  0xe56(%rip),%xmm1
movsd  0xe1e(%rip),%xmm0
call   1040 <pow@plt>
call   1030 <exp@plt>
addsd  0xe14(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
subsd  0x18(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @behroozi_fx(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
%14 = load double, double* %6
%15 = fcmp oeq double %14, 0.000000e+00
br i1 %15, label %16, label %28
16: ; preds = %4
%17 = call double @log10(double 2.000000e+00)
%18 = fneg double %17
%19 = load double, double* %8
%20 = call double @log10(double 2.000000e+00)
%21 = load double, double* %9
%22 = call double @pow(double %20, double %21)
%23 = fmul double %19, %22
%24 = call double @exp(double 1.000000e+00)
%25 = fadd double 1.000000e+00, %24
%26 = fdiv double %23, %25
%27 = fadd double %18, %26
store double %27, double* %5
br label %55
28: ; preds = %4
%29 = load double, double* %7
%30 = load double, double* %6
%31 = fmul double %29, %30
%32 = call double @pow(double 1.000000e+01, double %31)
%33 = fadd double %32, 1.000000e+00
%34 = call double @log10(double %33)
%35 = fneg double %34
store double %35, double* %10
%36 = load double, double* %6
%37 = call double @exp(double %36)
%38 = fadd double 1.000000e+00, %37
%39 = call double @log10(double %38)
%40 = load double, double* %9
%41 = call double @pow(double %39, double %40)
store double %41, double* %11
%42 = load double, double* %6
%43 = fneg double %42
%44 = call double @pow(double 1.000000e+01, double %43)
%45 = call double @exp(double %44)
%46 = fadd double 1.000000e+00, %45
store double %46, double* %12
%47 = load double, double* %8
%48 = load double, double* %11
%49 = fmul double %47, %48
%50 = load double, double* %12
%51 = fdiv double %49, %50
store double %51, double* %13
%52 = load double, double* %10
%53 = load double, double* %13
%54 = fadd double %52, %53
store double %54, double* %5
br label %55
55: ; preds = %28, %16
%56 = load double, double* %5
ret double %56
}

LLVM IR (-O2):
define double @behroozi_fx(double %0, double %1, double %2, double %3) {
%5 = fcmp oeq double %0, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = tail call double @pow(double 0x3FD34413509F79FF, double %3)
%8 = fmul double %7, %2
%9 = fdiv double %8, 0x400DBF0A8B145769
%10 = fadd double %9, 0xBFD34413509F79FF
br label %27
11: ; preds = %4
%12 = fmul double %0, %1
%13 = tail call double @pow(double 1.000000e+01, double %12)
%14 = fadd double %13, 1.000000e+00
%15 = tail call double @log10(double %14)
%16 = tail call double @exp(double %0)
%17 = fadd double %16, 1.000000e+00
%18 = tail call double @log10(double %17)
%19 = tail call double @pow(double %18, double %3)
%20 = fneg double %0
%21 = tail call double @pow(double 1.000000e+01, double %20)
%22 = tail call double @exp(double %21)
%23 = fadd double %22, 1.000000e+00
%24 = fmul double %19, %2
%25 = fdiv double %24, %23
%26 = fsub double %25, %15
br label %27
27: ; preds = %11, %6
%28 = phi double [ %10, %6 ], [ %26, %11 ]
ret double %28
}