#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 expm1(double);
double log(double);
double f_eval_large(double x, double v, double A, double B) {
  double L = log(v), C = expm1((1 / x - 1) * L), D = expm1((x - 1) * L);
  return v * ((1 + A) * C + x * (1 + B) * D);
}


x86 assembly (clang, -O0):
<f_eval_large>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  0xead(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <expm1@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x28(%rbp),%xmm0
call   1040 <expm1@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xe60(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm2
movsd  0xe49(%rip),%xmm4
addsd  -0x20(%rbp),%xmm4
mulsd  %xmm4,%xmm2
mulsd  -0x38(%rbp),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_eval_large>:
sub    $0x38,%rsp
movsd  %xmm3,0x28(%rsp)
movsd  %xmm2,0x20(%rsp)
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <log@plt>
movapd %xmm0,%xmm1
movsd  %xmm0,0x10(%rsp)
movsd  0xea9(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
addsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <expm1@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0xe8c(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
call   1040 <expm1@plt>
movsd  0x20(%rsp),%xmm1
movsd  0xe65(%rip),%xmm3
addsd  %xmm3,%xmm1
movsd  0x28(%rsp),%xmm2
addsd  %xmm3,%xmm2
mulsd  0x8(%rsp),%xmm2
mulsd  %xmm2,%xmm0
mulsd  0x18(%rsp),%xmm1
addsd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @f_eval_large(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
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%12 = load double, double* %6
%13 = call double @log(double %12)
store double %13, double* %9
%14 = load double, double* %5
%15 = fdiv double 1.000000e+00, %14
%16 = fsub double %15, 1.000000e+00
%17 = load double, double* %9
%18 = fmul double %16, %17
%19 = call double @expm1(double %18)
store double %19, double* %10
%20 = load double, double* %5
%21 = fsub double %20, 1.000000e+00
%22 = load double, double* %9
%23 = fmul double %21, %22
%24 = call double @expm1(double %23)
store double %24, double* %11
%25 = load double, double* %6
%26 = load double, double* %7
%27 = fadd double 1.000000e+00, %26
%28 = load double, double* %10
%29 = load double, double* %5
%30 = load double, double* %8
%31 = fadd double 1.000000e+00, %30
%32 = fmul double %29, %31
%33 = load double, double* %11
%34 = fmul double %32, %33
%35 = call double @llvm.fmuladd.f64(double %27, double %28, double %34)
%36 = fmul double %25, %35
ret double %36
}

LLVM IR (-O2):
define double @f_eval_large(double %0, double %1, double %2, double %3) {
%5 = tail call double @log(double %1)
%6 = fdiv double 1.000000e+00, %0
%7 = fadd double %6, -1.000000e+00
%8 = fmul double %7, %5
%9 = tail call double @expm1(double %8)
%10 = fadd double %0, -1.000000e+00
%11 = fmul double %10, %5
%12 = tail call double @expm1(double %11)
%13 = fadd double %2, 1.000000e+00
%14 = fadd double %3, 1.000000e+00
%15 = fmul double %14, %0
%16 = fmul double %15, %12
%17 = tail call double @llvm.fmuladd.f64(double %13, double %9, double %16)
%18 = fmul double %17, %1
ret double %18
}