#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 F2(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));
  return (1.0 / 8.0) *
             (-3.0 * pow(mass, 2.0) * momentum + 2.0 * pow(momentum, 3.0)) * E +
         (3.0 / 8.0) * pow(mass, 4.0) * log((momentum + E) / mass);
}


x86 assembly (clang, -O0):
<F2>:
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 <F2+0x4d>
movsd  -0x18(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
call   1040 <pow@plt>
movsd  0xea1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1297 <F2+0x167>
movsd  -0x10(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe7f(%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  -0x10(%rbp),%xmm0
movsd  0xe57(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe57(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe2f(%rip),%xmm1
call   1040 <pow@plt>
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
movaps %xmm0,%xmm3
movsd  0xe0d(%rip),%xmm0
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xdf1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xdc9(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
divsd  -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
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F2>:
sub    $0x28,%rsp
movapd %xmm1,%xmm2
movsd  0xec0(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1164 <F2+0x34>
movsd  0xed2(%rip),%xmm1
movapd %xmm2,%xmm0
call   1040 <pow@plt>
mulsd  0xed1(%rip),%xmm0
add    $0x28,%rsp
ret
movsd  %xmm0,0x18(%rsp)
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  %xmm1,(%rsp)
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
movsd  %xmm2,0x10(%rsp)
jb     1199 <F2+0x69>
sqrtsd %xmm0,%xmm0
jmp    11a4 <F2+0x74>
call   1050 <sqrt@plt>
movsd  0x10(%rsp),%xmm2
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xe51(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe4c(%rip),%xmm1
movapd %xmm2,%xmm0
call   1040 <pow@plt>
addsd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
mulsd  0x10(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  0xe30(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe2b(%rip),%xmm1
movsd  0x18(%rsp),%xmm0
call   1040 <pow@plt>
mulsd  0xe20(%rip),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
divsd  0x18(%rsp),%xmm0
call   1030 <log@plt>
mulsd  0x20(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

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

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