float atten_coeff(energy, pars)
float energy, pars[];
{
  float temp;
  temp = pars[0] * pow(energy, pars[1]) * (1. + pars[2] * pow(energy, pars[3]));
  return (1. / temp);
}


x86 assembly (clang, -O0):
<atten_coeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm1
cvtss2sd %xmm1,%xmm1
call   1030 <pow@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm2,%xmm1
movsd  0xe58(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe36(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atten_coeff>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rbx
cvtsd2ss %xmm0,%xmm0
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
cvtss2sd %xmm1,%xmm1
movsd  %xmm1,0x8(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x18(%rsp)
xorps  %xmm1,%xmm1
cvtss2sd %xmm2,%xmm1
call   1030 <pow@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movss  0x8(%rbx),%xmm0
movss  0xc(%rbx),%xmm1
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x10(%rsp)
cvtss2sd %xmm1,%xmm1
movsd  0x18(%rsp),%xmm0
call   1030 <pow@plt>
mulsd  0x10(%rsp),%xmm0
addsd  0xe7e(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
movss  0xe71(%rip),%xmm0
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @atten_coeff(double %0, float* %1) {
%3 = alloca float
%4 = alloca float*
%5 = alloca float
%6 = fptrunc double %0 to float
store float %6, float* %3
store float* %1, float** %4
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = load float*, float** %4
%14 = getelementptr inbounds float, float* %13, i64 1
%15 = load float, float* %14
%16 = fpext float %15 to double
%17 = call double @pow(double %12, double %16)
%18 = fmul double %10, %17
%19 = load float*, float** %4
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = fpext float %21 to double
%23 = load float, float* %3
%24 = fpext float %23 to double
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 3
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = call double @pow(double %24, double %28)
%30 = call double @llvm.fmuladd.f64(double %22, double %29, double 1.000000e+00)
%31 = fmul double %18, %30
%32 = fptrunc double %31 to float
store float %32, float* %5
%33 = load float, float* %5
%34 = fpext float %33 to double
%35 = fdiv double 1.000000e+00, %34
%36 = fptrunc double %35 to float
ret float %36
}

LLVM IR (-O2):
define float @atten_coeff(double %0, float* nocapture %1) {
%3 = fptrunc double %0 to float
%4 = load float, float* %1
%5 = fpext float %4 to double
%6 = fpext float %3 to double
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = tail call double @pow(double %6, double %9)
%11 = fmul double %10, %5
%12 = getelementptr inbounds float, float* %1, i64 2
%13 = load float, float* %12
%14 = fpext float %13 to double
%15 = getelementptr inbounds float, float* %1, i64 3
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = tail call double @pow(double %6, double %17)
%19 = tail call double @llvm.fmuladd.f64(double %14, double %18, double 1.000000e+00)
%20 = fmul double %11, %19
%21 = fptrunc double %20 to float
%22 = fdiv float 1.000000e+00, %21
ret float %22
}