#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(float, int);
float ath(float f) {
  float 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
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    121b <ath+0xfb>
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe80(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movsd  0xe5f(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xe34(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe03(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    12dd <ath+0x1bd>
movss  0xe0d(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdde(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xdb9(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  0xd98(%rip),%xmm1
mulsd  %xmm2,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
movsd  0xd6d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x4(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xd3c(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ath>:
sub    $0x18,%rsp
divss  0xed4(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1168 <ath+0x48>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
movss  %xmm0,0x4(%rsp)
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
addsd  0xeae(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    118b <ath+0x6b>
movss  0xe94(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
xor    %edi,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movss  0xe7d(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0xe7b(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xe76(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  0xe70(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movss  0x4(%rsp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
mulsd  0xe56(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @ath(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fdiv double %5, 1.000000e+03
%7 = fptrunc double %6 to float
store float %7, float* %2
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fcmp ogt double %9, 0.000000e+00
br i1 %10, label %11, label %28
11: ; preds = %1
%12 = load float, float* %2
%13 = call double @pow(float %12, i32 0)
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fsub double %15, 3.300000e+00
%17 = fptrunc double %16 to float
%18 = call double @pow(float %17, i32 2)
%19 = fmul double -6.000000e-01, %18
%20 = call double @exp(double %19)
%21 = fmul double 6.500000e+00, %20
%22 = fneg double %21
%23 = call double @llvm.fmuladd.f64(double 3.640000e+00, double %13, double %22)
%24 = load float, float* %2
%25 = call double @pow(float %24, i32 4)
%26 = call double @llvm.fmuladd.f64(double 1.000000e-03, double %25, double %23)
%27 = fptrunc double %26 to float
store float %27, float* %3
br label %45
28: ; preds = %1
store float 0x3F847AE140000000, float* %2
%29 = load float, float* %2
%30 = call double @pow(float %29, i32 0)
%31 = load float, float* %2
%32 = fpext float %31 to double
%33 = fsub double %32, 3.300000e+00
%34 = fptrunc double %33 to float
%35 = call double @pow(float %34, i32 2)
%36 = fmul double -6.000000e-01, %35
%37 = call double @exp(double %36)
%38 = fmul double 6.500000e+00, %37
%39 = fneg double %38
%40 = call double @llvm.fmuladd.f64(double 3.640000e+00, double %30, double %39)
%41 = load float, float* %2
%42 = call double @pow(float %41, i32 4)
%43 = call double @llvm.fmuladd.f64(double 1.000000e-03, double %42, double %40)
%44 = fptrunc double %43 to float
store float %44, float* %3
br label %45
45: ; preds = %28, %11
%46 = load float, float* %3
ret float %46
}

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