#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 M_PI;
double exp(double);
double pow(double, int);
double tk2rad(double tk, double lambda, double emiss) {
  double term, lam, rad;
  lam = lambda * 1e-6;
  term = exp(0.0143876912 / (lam * tk)) - 1.0;
  rad = (emiss * 3.741774922e-22 / ((pow(lam, 5)) * M_PI * term)) * 1000.0;
  return (rad);
}


x86 assembly (clang, -O0):
<tk2rad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xebd(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  0xea4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8b(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
mov    0x2e43(%rip),%rax
mulsd  (%rax),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe46(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tk2rad>:
sub    $0x18,%rsp
mulsd  0xed4(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  %xmm2,(%rsp)
mulsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
mov    0x2e61(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0xe7e(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @tk2rad(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%10 = load double, double* %5
%11 = fmul double %10, 0x3EB0C6F7A0B5ED8D
store double %11, double* %8
%12 = load double, double* %8
%13 = load double, double* %4
%14 = fmul double %12, %13
%15 = fdiv double 0x3F8D774B395A00E2, %14
%16 = call double @exp(double %15)
%17 = fsub double %16, 1.000000e+00
store double %17, double* %7
%18 = load double, double* %6
%19 = fmul double %18, 0x3B7C45A532944800
%20 = load double, double* %8
%21 = call double @pow(double %20, i32 5)
%22 = load double, double* @M_PI
%23 = fmul double %21, %22
%24 = load double, double* %7
%25 = fmul double %23, %24
%26 = fdiv double %19, %25
%27 = fmul double %26, 1.000000e+03
store double %27, double* %9
%28 = load double, double* %9
ret double %28
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @tk2rad(double %0, double %1, double %2) {
%4 = fmul double %1, 0x3EB0C6F7A0B5ED8D
%5 = fmul double %4, %0
%6 = fdiv double 0x3F8D774B395A00E2, %5
%7 = tail call double @exp(double %6)
%8 = fadd double %7, -1.000000e+00
%9 = fmul double %2, 0x3B7C45A532944800
%10 = tail call double @pow(double %4, i32 5)
%11 = load double, double* @M_PI
%12 = fmul double %10, %11
%13 = fmul double %8, %12
%14 = fdiv double %9, %13
%15 = fmul double %14, 1.000000e+03
ret double %15
}