#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 sqrt(double);
double F_E(double mass, double momentum) {
  if (mass < 1.0e-100)
    return pow(momentum, 4.0) / 4.0;
  double E = sqrt(pow(mass, 2.0) + pow(momentum, 2.0));
  double first_term = momentum * pow(E, 3.0);
  double second_term = -0.5 * pow(mass, 2.0) * momentum * E;
  double third_term = -0.5 * pow(mass, 4.0) * log((momentum + E) / mass);
  return (first_term + second_term + third_term) / 4.0;
}


x86 assembly (clang, -O0):
<F_E>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xeb6(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    117d <F_E+0x4d>
movsd  -0x18(%rbp),%xmm0
movsd  0xea6(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1284 <F_E+0x154>
movsd  -0x10(%rbp),%xmm0
movsd  0xe8e(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe4d(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe22(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe0a(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xde2(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdda(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
addsd  -0x38(%rbp),%xmm0
movsd  0xd8d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_E>:
sub    $0x28,%rsp
movapd %xmm1,%xmm2
movsd  0xec0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    115c <F_E+0x2c>
movsd  0xeca(%rip),%xmm1
movapd %xmm2,%xmm0
call   1040 <pow@plt>
jmp    1221 <F_E+0xf1>
movsd  %xmm0,0x10(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm2,0x18(%rsp)
mulsd  %xmm2,%xmm2
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm2
jb     1190 <F_E+0x60>
xorps  %xmm0,%xmm0
sqrtsd %xmm2,%xmm0
jmp    1199 <F_E+0x69>
movapd %xmm2,%xmm0
call   1050 <sqrt@plt>
movsd  0xe67(%rip),%xmm1
movsd  %xmm0,0x8(%rsp)
call   1040 <pow@plt>
movsd  0x18(%rsp),%xmm2
mulsd  %xmm2,%xmm0
movsd  (%rsp),%xmm1
mulsd  0xe4d(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe3a(%rip),%xmm1
movsd  0x10(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xe1f(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x8(%rsp),%xmm0
addsd  0x18(%rsp),%xmm0
divsd  0x10(%rsp),%xmm0
call   1030 <log@plt>
mulsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
mulsd  0xdf7(%rip),%xmm0
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define double @F_E(double %0, double %1) {
%3 = fcmp olt double %0, 1.000000e-100
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call double @pow(double %1, double 4.000000e+00)
br label %24
6: ; preds = %2
%7 = fmul double %0, %0
%8 = fmul double %1, %1
%9 = fadd double %7, %8
%10 = tail call double @sqrt(double %9)
%11 = tail call double @pow(double %10, double 3.000000e+00)
%12 = fmul double %11, %1
%13 = fmul double %7, 5.000000e-01
%14 = fmul double %13, %1
%15 = fmul double %14, %10
%16 = tail call double @pow(double %0, double 4.000000e+00)
%17 = fmul double %16, 5.000000e-01
%18 = fadd double %10, %1
%19 = fdiv double %18, %0
%20 = tail call double @log(double %19)
%21 = fmul double %17, %20
%22 = fsub double %12, %15
%23 = fsub double %22, %21
br label %24
24: ; preds = %6, %4
%25 = phi double [ %5, %4 ], [ %23, %6 ]
%26 = fmul double %25, 2.500000e-01
ret double %26
}