#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 DBL_EPSILON;
double exp(double const);
double Phys_PlanckFunc(double nu, double T_k) {
  static const double h = 6.626068760000000e-34, c = 2.997924580000000e+08,
                      k = 1.380650300000000e-23;
  if (T_k <= DBL_EPSILON) {
    return 0.0;
  } else if (h * nu >= 100.0 * k * T_k) {
    return 2.0 * h * (nu * nu * nu / (c * c)) * exp(-h * nu / (k * T_k));
  } else {
    return (2.0 * h * nu * nu * nu / (c * c)) / (exp(h * nu / k / T_k) - 1.0);
  }
}


x86 assembly (clang, -O0):
<Phys_PlanckFunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm1
mov    0x2eba(%rip),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     1149 <Phys_PlanckFunc+0x39>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    123a <Phys_PlanckFunc+0x12a>
movsd  0xeb7(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xea2(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     11d2 <Phys_PlanckFunc+0xc2>
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe9c(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe98(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    123a <Phys_PlanckFunc+0x12a>
movsd  0xe4e(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe2f(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe06(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe09(%rip),%xmm1
divsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xde3(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Phys_PlanckFunc>:
push   %rax
mov    0x2ed0(%rip),%rax
movsd  (%rax),%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm1,%xmm2
jae    11d4 <Phys_PlanckFunc+0xc4>
movsd  0xece(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeca(%rip),%xmm3
mulsd  %xmm1,%xmm3
ucomisd %xmm3,%xmm2
jae    1191 <Phys_PlanckFunc+0x81>
movsd  0xec8(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
divsd  0xeac(%rip),%xmm3
movsd  %xmm3,(%rsp)
divsd  0xeb7(%rip),%xmm2
divsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm3
addsd  0xea5(%rip),%xmm0
divsd  %xmm0,%xmm3
jmp    11d4 <Phys_PlanckFunc+0xc4>
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
divsd  0xe6b(%rip),%xmm2
mulsd  0xe6b(%rip),%xmm2
movsd  %xmm2,(%rsp)
mulsd  0xe66(%rip),%xmm0
mulsd  0xe66(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm3
mulsd  (%rsp),%xmm3
movapd %xmm3,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@Phys_PlanckFunc.h = internal constant double 0x390B860B7D23C354
@Phys_PlanckFunc.c = internal constant double 0x41B1DE784A000000
@Phys_PlanckFunc.k = internal constant double 0x3B30B0E7DD0A406E
@DBL_EPSILON = global double 0.000000e+00
define double @Phys_PlanckFunc(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %5
%7 = load double, double* @DBL_EPSILON
%8 = fcmp ole double %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store double 0.000000e+00, double* %3
br label %47
10: ; preds = %2
%11 = load double, double* %4
%12 = fmul double 0x390B860B7D23C354, %11
%13 = load double, double* %5
%14 = fmul double 0x3B9A146A496004AC, %13
%15 = fcmp oge double %12, %14
br i1 %15, label %16, label %31
16: ; preds = %10
%17 = load double, double* %4
%18 = load double, double* %4
%19 = fmul double %17, %18
%20 = load double, double* %4
%21 = fmul double %19, %20
%22 = fdiv double %21, 0x4373F4D4EACDD756
%23 = fmul double 0x391B860B7D23C354, %22
%24 = load double, double* %4
%25 = fmul double 0xB90B860B7D23C354, %24
%26 = load double, double* %5
%27 = fmul double 0x3B30B0E7DD0A406E, %26
%28 = fdiv double %25, %27
%29 = call double @exp(double %28)
%30 = fmul double %23, %29
store double %30, double* %3
br label %47
31: ; preds = %10
%32 = load double, double* %4
%33 = fmul double 0x391B860B7D23C354, %32
%34 = load double, double* %4
%35 = fmul double %33, %34
%36 = load double, double* %4
%37 = fmul double %35, %36
%38 = fdiv double %37, 0x4373F4D4EACDD756
%39 = load double, double* %4
%40 = fmul double 0x390B860B7D23C354, %39
%41 = fdiv double %40, 0x3B30B0E7DD0A406E
%42 = load double, double* %5
%43 = fdiv double %41, %42
%44 = call double @exp(double %43)
%45 = fsub double %44, 1.000000e+00
%46 = fdiv double %38, %45
store double %46, double* %3
br label %47
47: ; preds = %31, %16, %9
%48 = load double, double* %3
ret double %48
}

LLVM IR (-O2):
@DBL_EPSILON = global double 0.000000e+00
define double @Phys_PlanckFunc(double %0, double %1) {
%3 = load double, double* @DBL_EPSILON
%4 = fcmp ult double %3, %1
br i1 %4, label %5, label %29
5: ; preds = %2
%6 = fmul double %0, 0x390B860B7D23C354
%7 = fmul double %1, 0x3B9A146A496004AC
%8 = fcmp ult double %6, %7
br i1 %8, label %19, label %9
9: ; preds = %5
%10 = fmul double %0, %0
%11 = fmul double %10, %0
%12 = fdiv double %11, 0x4373F4D4EACDD756
%13 = fmul double %12, 0x391B860B7D23C354
%14 = fmul double %0, 0xB90B860B7D23C354
%15 = fmul double %1, 0x3B30B0E7DD0A406E
%16 = fdiv double %14, %15
%17 = tail call double @exp(double %16)
%18 = fmul double %13, %17
br label %29
19: ; preds = %5
%20 = fmul double %0, 0x391B860B7D23C354
%21 = fmul double %20, %0
%22 = fmul double %21, %0
%23 = fdiv double %22, 0x4373F4D4EACDD756
%24 = fdiv double %6, 0x3B30B0E7DD0A406E
%25 = fdiv double %24, %1
%26 = tail call double @exp(double %25)
%27 = fadd double %26, -1.000000e+00
%28 = fdiv double %23, %27
br label %29
29: ; preds = %2, %19, %9
%30 = phi double [ %18, %9 ], [ %28, %19 ], [ 0.000000e+00, %2 ]
ret double %30
}