#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 sqrt(double);
double calculate_Fu_and_Li_D(double Eta, double Eta_E, double cn, double n,
                             double a1, double a2) {
  double ud;
  double vd;
  double numerator;
  double denominator;
  vd = 1 + (a1 * a1 / (a2 + a1 * a1)) * (cn - (n + 1) / (n - 1));
  ud = a1 - 1 - vd;
  numerator = Eta - a1 * Eta_E;
  denominator = sqrt(ud * Eta + vd * Eta * Eta);
  return (numerator / denominator);
}


x86 assembly (clang, -O0):
<calculate_Fu_and_Li_D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe98(%rip),%xmm2
addsd  -0x20(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  0xe86(%rip),%xmm4
subsd  %xmm4,%xmm3
divsd  %xmm3,%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe6e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe58(%rip),%xmm1
subsd  %xmm1,%xmm0
subsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
divsd  -0x50(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_Fu_and_Li_D>:
push   %rax
movapd %xmm3,%xmm7
movsd  0xeeb(%rip),%xmm6
addsd  %xmm6,%xmm3
addsd  %xmm4,%xmm6
mulsd  %xmm4,%xmm1
mulsd  %xmm4,%xmm4
addsd  %xmm4,%xmm5
divsd  %xmm5,%xmm4
movsd  0xec3(%rip),%xmm5
addsd  %xmm5,%xmm7
divsd  %xmm3,%xmm7
subsd  %xmm7,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm5,%xmm2
subsd  %xmm2,%xmm6
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm6
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
addsd  %xmm2,%xmm6
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm6
jb     1180 <calculate_Fu_and_Li_D+0x70>
xorps  %xmm0,%xmm0
sqrtsd %xmm6,%xmm0
jmp    1193 <calculate_Fu_and_Li_D+0x83>
movapd %xmm6,%xmm0
movsd  %xmm3,(%rsp)
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm3
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @calculate_Fu_and_Li_D(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%17 = load double, double* %11
%18 = load double, double* %11
%19 = fmul double %17, %18
%20 = load double, double* %12
%21 = load double, double* %11
%22 = load double, double* %11
%23 = call double @llvm.fmuladd.f64(double %21, double %22, double %20)
%24 = fdiv double %19, %23
%25 = load double, double* %9
%26 = load double, double* %10
%27 = fadd double %26, 1.000000e+00
%28 = load double, double* %10
%29 = fsub double %28, 1.000000e+00
%30 = fdiv double %27, %29
%31 = fsub double %25, %30
%32 = call double @llvm.fmuladd.f64(double %24, double %31, double 1.000000e+00)
store double %32, double* %14
%33 = load double, double* %11
%34 = fsub double %33, 1.000000e+00
%35 = load double, double* %14
%36 = fsub double %34, %35
store double %36, double* %13
%37 = load double, double* %7
%38 = load double, double* %11
%39 = load double, double* %8
%40 = fneg double %38
%41 = call double @llvm.fmuladd.f64(double %40, double %39, double %37)
store double %41, double* %15
%42 = load double, double* %13
%43 = load double, double* %7
%44 = load double, double* %14
%45 = load double, double* %7
%46 = fmul double %44, %45
%47 = load double, double* %7
%48 = fmul double %46, %47
%49 = call double @llvm.fmuladd.f64(double %42, double %43, double %48)
%50 = call double @sqrt(double %49)
store double %50, double* %16
%51 = load double, double* %15
%52 = load double, double* %16
%53 = fdiv double %51, %52
ret double %53
}

LLVM IR (-O2):
define double @calculate_Fu_and_Li_D(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %4, %4
%8 = tail call double @llvm.fmuladd.f64(double %4, double %4, double %5)
%9 = fdiv double %7, %8
%10 = fadd double %3, 1.000000e+00
%11 = fadd double %3, -1.000000e+00
%12 = fdiv double %10, %11
%13 = fsub double %2, %12
%14 = tail call double @llvm.fmuladd.f64(double %9, double %13, double 1.000000e+00)
%15 = fadd double %4, -1.000000e+00
%16 = fsub double %15, %14
%17 = fneg double %4
%18 = tail call double @llvm.fmuladd.f64(double %17, double %1, double %0)
%19 = fmul double %14, %0
%20 = fmul double %19, %0
%21 = tail call double @llvm.fmuladd.f64(double %16, double %0, double %20)
%22 = tail call double @sqrt(double %21)
%23 = fdiv double %18, %22
ret double %23
}