#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, int);
double ath(double f) {
  double ath;
  f /= 1000.;
  if (f > 0.0)
    ath = 3.64 * pow(f, -0.8) - 6.5 * exp(-0.6 * pow(f - 3.3, 2)) +
          0.001 * pow(f, 4);
  else {
    f = 0.01;
    ath = 3.64 * pow(f, -0.8) - 6.5 * exp(-0.6 * pow(f - 3.3, 2)) +
          0.001 * pow(f, 4);
  }
  return ath;
}


x86 assembly (clang, -O0):
<ath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1203 <ath+0xe3>
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb5(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe94(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
movsd  0xe73(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe48(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe17(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    12b9 <ath+0x199>
movsd  0xe25(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xdfa(%rip),%xmm1
subsd  %xmm1,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdd9(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x30(%rbp),%xmm0
movsd  0xdb8(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xd8d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  -0x28(%rbp),%xmm1
movsd  0xd5c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ath>:
sub    $0x18,%rsp
divsd  0xed4(%rip),%xmm0
xorpd  %xmm1,%xmm1
movsd  %xmm0,0x10(%rsp)
ucomisd %xmm1,%xmm0
jbe    115f <ath+0x3f>
movsd  0x10(%rsp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xec1(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
jmp    1182 <ath+0x62>
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe8e(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0xe8c(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xe87(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xe81(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
mulsd  0xe67(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ath(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* %2
%6 = load double, double* %2
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %22
8: ; preds = %1
%9 = load double, double* %2
%10 = call double @pow(double %9, i32 0)
%11 = load double, double* %2
%12 = fsub double %11, 3.300000e+00
%13 = call double @pow(double %12, i32 2)
%14 = fmul double -6.000000e-01, %13
%15 = call double @exp(double %14)
%16 = fmul double 6.500000e+00, %15
%17 = fneg double %16
%18 = call double @llvm.fmuladd.f64(double 3.640000e+00, double %10, double %17)
%19 = load double, double* %2
%20 = call double @pow(double %19, i32 4)
%21 = call double @llvm.fmuladd.f64(double 1.000000e-03, double %20, double %18)
store double %21, double* %3
br label %36
22: ; preds = %1
store double 1.000000e-02, double* %2
%23 = load double, double* %2
%24 = call double @pow(double %23, i32 0)
%25 = load double, double* %2
%26 = fsub double %25, 3.300000e+00
%27 = call double @pow(double %26, i32 2)
%28 = fmul double -6.000000e-01, %27
%29 = call double @exp(double %28)
%30 = fmul double 6.500000e+00, %29
%31 = fneg double %30
%32 = call double @llvm.fmuladd.f64(double 3.640000e+00, double %24, double %31)
%33 = load double, double* %2
%34 = call double @pow(double %33, i32 4)
%35 = call double @llvm.fmuladd.f64(double 1.000000e-03, double %34, double %32)
store double %35, double* %3
br label %36
36: ; preds = %22, %8
%37 = load double, double* %3
ret double %37
}

LLVM IR (-O2):
define double @ath(double %0) {
%2 = fdiv double %0, 1.000000e+03
%3 = fcmp ogt double %2, 0.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call double @pow(double %2, i32 0)
%6 = fadd double %2, -3.300000e+00
br label %9
7: ; preds = %1
%8 = tail call double @pow(double 1.000000e-02, i32 0)
br label %9
9: ; preds = %7, %4
%10 = phi double [ -3.290000e+00, %7 ], [ %6, %4 ]
%11 = phi double [ %8, %7 ], [ %5, %4 ]
%12 = phi double [ 1.000000e-02, %7 ], [ %2, %4 ]
%13 = tail call double @pow(double %10, i32 2)
%14 = fmul double %13, -6.000000e-01
%15 = tail call double @exp(double %14)
%16 = fmul double %15, -6.500000e+00
%17 = tail call double @llvm.fmuladd.f64(double %11, double 3.640000e+00, double %16)
%18 = tail call double @pow(double %12, i32 4)
%19 = tail call double @llvm.fmuladd.f64(double %18, double 1.000000e-03, double %17)
ret double %19
}