#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 gsl_sf_fermi_dirac_int(int, double);
double average_neutrino_energy(double T, double mu_nu) {
  return mu_nu > -10 * T ? T * (6 * gsl_sf_fermi_dirac_int(3, mu_nu / T)) /
                               (2 * gsl_sf_fermi_dirac_int(2, mu_nu / T))
                         : 3 * T;
}


x86 assembly (clang, -O0):
<average_neutrino_energy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jbe    119f <average_neutrino_energy+0x8f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <gsl_sf_fermi_dirac_int@plt>
movsd  -0x28(%rbp),%xmm0
imul   $0x6,%eax,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <gsl_sf_fermi_dirac_int@plt>
movsd  -0x20(%rbp),%xmm0
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    11b1 <average_neutrino_energy+0xa1>
movsd  0xe61(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<average_neutrino_energy>:
sub    $0x18,%rsp
movapd %xmm0,%xmm2
movsd  0xee0(%rip),%xmm0
mulsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
jbe    118c <average_neutrino_energy+0x7c>
divsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
mov    $0x3,%edi
movapd %xmm1,%xmm0
movsd  %xmm2,0x8(%rsp)
call   1030 <gsl_sf_fermi_dirac_int@plt>
add    %eax,%eax
lea    (%rax,%rax,2),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
movsd  0x10(%rsp),%xmm0
call   1030 <gsl_sf_fermi_dirac_int@plt>
add    %eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret
mulsd  0xe74(%rip),%xmm2
movapd %xmm2,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @average_neutrino_energy(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fmul double -1.000000e+01, %6
%8 = fcmp ogt double %5, %7
br i1 %8, label %9, label %25
9: ; preds = %2
%10 = load double, double* %3
%11 = load double, double* %4
%12 = load double, double* %3
%13 = fdiv double %11, %12
%14 = call i32 @gsl_sf_fermi_dirac_int(i32 3, double %13)
%15 = mul nsw i32 6, %14
%16 = sitofp i32 %15 to double
%17 = fmul double %10, %16
%18 = load double, double* %4
%19 = load double, double* %3
%20 = fdiv double %18, %19
%21 = call i32 @gsl_sf_fermi_dirac_int(i32 2, double %20)
%22 = mul nsw i32 2, %21
%23 = sitofp i32 %22 to double
%24 = fdiv double %17, %23
br label %28
25: ; preds = %2
%26 = load double, double* %3
%27 = fmul double 3.000000e+00, %26
br label %28
28: ; preds = %25, %9
%29 = phi double [ %24, %9 ], [ %27, %25 ]
ret double %29
}

LLVM IR (-O2):
define double @average_neutrino_energy(double %0, double %1) {
%3 = fmul double %0, -1.000000e+01
%4 = fcmp olt double %3, %1
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = fdiv double %1, %0
%7 = tail call i32 @gsl_sf_fermi_dirac_int(i32 3, double %6)
%8 = mul nsw i32 %7, 6
%9 = sitofp i32 %8 to double
%10 = fmul double %9, %0
%11 = tail call i32 @gsl_sf_fermi_dirac_int(i32 2, double %6)
%12 = shl nsw i32 %11, 1
%13 = sitofp i32 %12 to double
%14 = fdiv double %10, %13
br label %17
15: ; preds = %2
%16 = fmul double %0, 3.000000e+00
br label %17
17: ; preds = %15, %5
%18 = phi double [ %14, %5 ], [ %16, %15 ]
ret double %18
}