#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 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) * 3.1415927 * 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  0xee9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xecf(%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
movsd  0xe9e(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe85(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  0xe6d(%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  0xe37(%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>
mulsd  0xeb5(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
mulsd  0xeaf(%rip),%xmm0
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
addsd  0xea6(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <log@plt>
mulsd  0x10(%rsp),%xmm0
movsd  0xe97(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
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 = fmul double %15, 0x400921FB5A7ED197
%17 = load double, double* %4
%18 = fmul double %16, %17
%19 = fmul double %18, 1.000000e-03
%20 = fdiv double %13, %19
%21 = fadd double %20, 1.000000e+00
store double %21, double* %7
%22 = load double, double* %8
%23 = load double, double* %7
%24 = call double @log(double %23)
%25 = fmul double %22, %24
%26 = fdiv double 0x3F8D774B395A00E2, %25
store double %26, double* %9
%27 = load double, double* %9
ret double %27
}

LLVM IR (-O2):
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 = fmul double %6, 0x400921FB5A7ED197
%8 = fmul double %7, %0
%9 = fmul double %8, 1.000000e-03
%10 = fdiv double %5, %9
%11 = fadd double %10, 1.000000e+00
%12 = tail call double @log(double %11)
%13 = fmul double %4, %12
%14 = fdiv double 0x3F8D774B395A00E2, %13
ret double %14
}