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


x86 assembly (clang, -O0):
<rad2tk>:
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  0xec7(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mov    0x2e6f(%rip),%rax
mulsd  (%rax),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe86(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xe6e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe38(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad2tk>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
mulsd  0xece(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
mulsd  0xec8(%rip),%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm1,%xmm0
mov    $0x5,%edi
call   1040 <pow@plt>
mov    0x2e8e(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xea4(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0xe9b(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0xe8c(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

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