#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 exp(double);
double pow(double, double);
double hom(double f) {
  double f1 = f / 1000;
  return -3.64 * pow(f1, -0.8) + 6.8 * exp(-0.6 * (f1 - 3.4) * (f1 - 3.4)) -
         6.0 * exp(-0.15 * (f1 - 8.7) * (f1 - 8.7)) -
         0.0006 * (f1 * f1) * (f1 * f1);
}


x86 assembly (clang, -O0):
<hom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf0e(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xef0(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xec9(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xec5(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeac(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xe73(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xe49(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe45(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xe2c(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  0xe07(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
movsd  0xde5(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  -0x10(%rbp),%xmm2
mulsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hom>:
sub    $0x18,%rsp
divsd  0xed4(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xece(%rip),%xmm1
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xec3(%rip),%xmm1
addsd  0x10(%rsp),%xmm1
movsd  0xebd(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xeb0(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xeaa(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xea0(%rip),%xmm1
addsd  0x10(%rsp),%xmm1
movsd  0xe9a(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0xe8d(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm2
movsd  0xe7d(%rip),%xmm1
mulsd  %xmm2,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @hom(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 1.000000e+03
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @pow(double %6, double -8.000000e-01)
%8 = load double, double* %3
%9 = fsub double %8, 3.400000e+00
%10 = fmul double -6.000000e-01, %9
%11 = load double, double* %3
%12 = fsub double %11, 3.400000e+00
%13 = fmul double %10, %12
%14 = call double @exp(double %13)
%15 = fmul double 6.800000e+00, %14
%16 = call double @llvm.fmuladd.f64(double -3.640000e+00, double %7, double %15)
%17 = load double, double* %3
%18 = fsub double %17, 0x4021666666666666
%19 = fmul double -1.500000e-01, %18
%20 = load double, double* %3
%21 = fsub double %20, 0x4021666666666666
%22 = fmul double %19, %21
%23 = call double @exp(double %22)
%24 = call double @llvm.fmuladd.f64(double -6.000000e+00, double %23, double %16)
%25 = load double, double* %3
%26 = load double, double* %3
%27 = fmul double %25, %26
%28 = fmul double 6.000000e-04, %27
%29 = load double, double* %3
%30 = load double, double* %3
%31 = fmul double %29, %30
%32 = fneg double %28
%33 = call double @llvm.fmuladd.f64(double %32, double %31, double %24)
ret double %33
}

LLVM IR (-O2):
define double @hom(double %0) {
%2 = fdiv double %0, 1.000000e+03
%3 = tail call double @pow(double %2, double -8.000000e-01)
%4 = fadd double %2, -3.400000e+00
%5 = fmul double %4, -6.000000e-01
%6 = fmul double %4, %5
%7 = tail call double @exp(double %6)
%8 = fmul double %7, 6.800000e+00
%9 = tail call double @llvm.fmuladd.f64(double %3, double -3.640000e+00, double %8)
%10 = fadd double %2, 0xC021666666666666
%11 = fmul double %10, -1.500000e-01
%12 = fmul double %10, %11
%13 = tail call double @exp(double %12)
%14 = tail call double @llvm.fmuladd.f64(double %13, double -6.000000e+00, double %9)
%15 = fmul double %2, %2
%16 = fmul double %15, -6.000000e-04
%17 = tail call double @llvm.fmuladd.f64(double %16, double %15, double %14)
ret double %17
}