#define TTR_HI 157807.0
#define TTR_HeI 285335.0
#define TTR_HeII 631515.0
#define ERG_TO_EV 6.242e11

__device__ float rec_HII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HI/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = 1.269e-13*powf(lam, 1.503)/powf(1.0 + powf(lam/0.522, 0.470), 1.923);
	}
	else
	{
		_a = 2.753e-14*powf(lam, 1.500)/powf(1.0 + powf(lam/2.740, 0.407), 2.242);
	}
	
	return _a;
}

__device__ float rec_cool_HII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HI/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = _t*1.778e-29*powf(lam, 1.965)/powf(1.0 + powf(lam/0.541, 0.502), 2.697);
	}
	else
	{
		_a = _t*3.435e-30*powf(lam, 1.970)/powf(1.0 + powf(lam/2.250, 0.376), 3.720);
	}
	
	return _a*ERG_TO_EV;
}

__device__ float rec_HeII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HeI/_t;
	
	if(_t <= 5.e3 || _t >= 5.e5)
		return 0.0;
	
	// Case A
	if(_case == 0)
	{
		_a = 3.0e-14*powf(lam, 0.654);
	}
	else
	{
		_a = 1.26e-14*powf(lam, 0.750);
	}
	
	return _a;
}

__device__ float rec_cool_HeII(float _t, int _case)
{
	float kb = 8.617e-5;
	
	float _a = (kb*_t)*rec_HeII(_t, _case);
	
	return _a;
}

__device__ float rec_HeIII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HeII/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = 2.0*1.269e-13*powf(lam, 1.503)/powf(1.0 + powf(lam/0.522, 0.470), 1.923);
	}
	else
	{
		_a = 2.0*2.753e-14*powf(lam, 1.500)/powf(1.0 + powf(lam/2.740, 0.407), 2.242);
	}
	
	return _a;
}

__device__ float rec_cool_HeIII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HeII/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = _t*8.0*1.778e-29*powf(lam, 1.965)/powf(1.0 + powf(lam/0.541, 0.502), 2.697);
	}
	else
	{
		_a = _t*8.0*3.435e-30*powf(lam, 1.970)/powf(1.0 + powf(lam/2.250, 0.376), 3.720);
	}
	
	return _a*ERG_TO_EV;
}

__device__ float col_HI(float _t)
{
	float lam = 2.0*TTR_HI/_t;
	
	if(_t < 1.e4 || _t > 1.e9)
		return 0.0;
	
	float _a = 21.11*powf(_t, -1.5)*expf(-lam/2.0);
	_a *= powf(lam, -1.089)/powf(1.0 + powf(lam/0.354, 0.874), 1.101);
	return _a;
}

__device__ float col_cool_HI(float _t)
{
	float kb = 8.617e-5;
	
	float _a = (kb*TTR_HI)*col_HI(_t);
	
	return _a;
}

__device__ float col_HeI(float _t)
{
	float lam = 2.0*TTR_HeI/_t;
	
	if(_t < 1.e4 || _t > 1.e9)
		return 0.0;
	
	float _a = 32.38*powf(_t, -1.5)*expf(-lam/2.0);
	_a *= powf(lam, -1.146)/powf(1.0 + powf(lam/0.416, 0.987), 1.056);
	return _a;
}

__device__ float col_cool_HeI(float _t)
{
	float kb = 8.617e-5;
	
	float _a = (kb*TTR_HeI)*col_HeI(_t);
	
	return _a;
}

__device__ float col_HeII(float _t)
{
	float lam = 2.0*TTR_HeII/_t;
	
	if(_t < 1.e4 || _t > 1.e9)
		return 0.0;
	
	float _a = 19.95*powf(_t, -1.5)*expf(-lam/2.0);
	_a *= powf(lam, -1.089)/powf(1.0 + powf(lam/0.553, 0.735), 1.275);
	return _a;
}

__device__ float col_cool_HeII(float _t)
{
	float kb = 8.617e-5;
	//float lam = 2.0*TTR_HeII/_t;
	
	float _a = (kb*TTR_HeII)*col_HeII(_t);
	
	return _a;
}

__device__ float colex_HI(float _t)
{
	float lam = 2.0*TTR_HI/_t;
	
	if(_t < 5.e3 || _t > 5.e5)
		return 0.0;
	
	float _a = 7.5e-19*expf(-0.375*lam)/(1.0+powf(_t/1.e5, 0.5));
	
	return _a*ERG_TO_EV;
}

	.file	"tmpxft_00340012_00000000-6_rates.cudafe1.cpp"
	.text
#APP

#NO_APP
	.type	_ZL26__cudaUnregisterBinaryUtilv, @function
_ZL26__cudaUnregisterBinaryUtilv:
.LFB2023:
	.cfi_startproc
	endbr64
	movq	_ZL20__cudaFatCubinHandle(%rip), %rdi
	jmp	__cudaUnregisterFatBinary@PLT
	.cfi_endproc
.LFE2023:
	.size	_ZL26__cudaUnregisterBinaryUtilv, .-_ZL26__cudaUnregisterBinaryUtilv
	.type	_Z6col_HIf.constprop.0.isra.0, @function
_Z6col_HIf.constprop.0.isra.0:
.LFB2184:
	.cfi_startproc
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2184:
	.size	_Z6col_HIf.constprop.0.isra.0, .-_Z6col_HIf.constprop.0.isra.0
	.globl	_Z7rec_HIIfi
	.type	_Z7rec_HIIfi, @function
_Z7rec_HIIfi:
.LFB2008:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2008:
	.size	_Z7rec_HIIfi, .-_Z7rec_HIIfi
	.globl	_Z12rec_cool_HIIfi
	.type	_Z12rec_cool_HIIfi, @function
_Z12rec_cool_HIIfi:
.LFB2162:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2162:
	.size	_Z12rec_cool_HIIfi, .-_Z12rec_cool_HIIfi
	.globl	_Z8rec_HeIIfi
	.type	_Z8rec_HeIIfi, @function
_Z8rec_HeIIfi:
.LFB2164:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2164:
	.size	_Z8rec_HeIIfi, .-_Z8rec_HeIIfi
	.globl	_Z13rec_cool_HeIIfi
	.type	_Z13rec_cool_HeIIfi, @function
_Z13rec_cool_HeIIfi:
.LFB2166:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2166:
	.size	_Z13rec_cool_HeIIfi, .-_Z13rec_cool_HeIIfi
	.globl	_Z9rec_HeIIIfi
	.type	_Z9rec_HeIIIfi, @function
_Z9rec_HeIIIfi:
.LFB2168:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2168:
	.size	_Z9rec_HeIIIfi, .-_Z9rec_HeIIIfi
	.globl	_Z14rec_cool_HeIIIfi
	.type	_Z14rec_cool_HeIIIfi, @function
_Z14rec_cool_HeIIIfi:
.LFB2170:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2170:
	.size	_Z14rec_cool_HeIIIfi, .-_Z14rec_cool_HeIIIfi
	.globl	_Z6col_HIf
	.type	_Z6col_HIf, @function
_Z6col_HIf:
.LFB2014:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	movl	$1, 12(%rsp)
	movl	12(%rsp), %edi
	call	exit@PLT
	.cfi_endproc
.LFE2014:
	.size	_Z6col_HIf, .-_Z6col_HIf
	.globl	_Z11col_cool_HIf
	.type	_Z11col_cool_HIf, @function
_Z11col_cool_HIf:
.LFB2172:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z6col_HIf.constprop.0.isra.0
	.cfi_endproc
.LFE2172:
	.size	_Z11col_cool_HIf, .-_Z11col_cool_HIf
	.globl	_Z7col_HeIf
	.type	_Z7col_HeIf, @function
_Z7col_HeIf:
.LFB2174:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z6col_HIf.constprop.0.isra.0
	.cfi_endproc
.LFE2174:
	.size	_Z7col_HeIf, .-_Z7col_HeIf
	.globl	_Z12col_cool_HeIf
	.type	_Z12col_cool_HeIf, @function
_Z12col_cool_HeIf:
.LFB2176:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z6col_HIf.constprop.0.isra.0
	.cfi_endproc
.LFE2176:
	.size	_Z12col_cool_HeIf, .-_Z12col_cool_HeIf
	.globl	_Z8col_HeIIf
	.type	_Z8col_HeIIf, @function
_Z8col_HeIIf:
.LFB2178:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z6col_HIf.constprop.0.isra.0
	.cfi_endproc
.LFE2178:
	.size	_Z8col_HeIIf, .-_Z8col_HeIIf
	.globl	_Z13col_cool_HeIIf
	.type	_Z13col_cool_HeIIf, @function
_Z13col_cool_HeIIf:
.LFB2180:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z6col_HIf.constprop.0.isra.0
	.cfi_endproc
.LFE2180:
	.size	_Z13col_cool_HeIIf, .-_Z13col_cool_HeIIf
	.globl	_Z8colex_HIf
	.type	_Z8colex_HIf, @function
_Z8colex_HIf:
.LFB2182:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	popq	%rax
	.cfi_def_cfa_offset 8
	pushq	%rax
	.cfi_def_cfa_offset 16
	call	_Z6col_HIf.constprop.0.isra.0
	.cfi_endproc
.LFE2182:
	.size	_Z8colex_HIf, .-_Z8colex_HIf
	.section	.text.startup,"ax",@progbits
	.type	_ZL24__sti____cudaRegisterAllv, @function
_ZL24__sti____cudaRegisterAllv:
.LFB2046:
	.cfi_startproc
	endbr64
	pushq	%rax
	.cfi_def_cfa_offset 16
	leaq	_ZL15__fatDeviceText(%rip), %rdi
	call	__cudaRegisterFatBinary@PLT
	movq	%rax, %rdi
	movq	%rax, _ZL20__cudaFatCubinHandle(%rip)
	call	__cudaRegisterFatBinaryEnd@PLT
	leaq	_ZL26__cudaUnregisterBinaryUtilv(%rip), %rdi
	popq	%rdx
	.cfi_def_cfa_offset 8
	jmp	atexit@PLT
	.cfi_endproc
.LFE2046:
	.size	_ZL24__sti____cudaRegisterAllv, .-_ZL24__sti____cudaRegisterAllv
	.section	.init_array,"aw"
	.align 8
	.quad	_ZL24__sti____cudaRegisterAllv
	.section	.nvFatBinSegment,"aw"
	.align 8
	.type	_ZL15__fatDeviceText, @object
	.size	_ZL15__fatDeviceText, 24
_ZL15__fatDeviceText:
	.long	1180844977
	.long	1
	.quad	fatbinData
	.quad	0
	.local	_ZL20__cudaFatCubinHandle
	.comm	_ZL20__cudaFatCubinHandle,8,8
	.ident	"GCC: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:


#include <hip/hip_runtime.h>
#define TTR_HI 157807.0
#define TTR_HeI 285335.0
#define TTR_HeII 631515.0
#define ERG_TO_EV 6.242e11

__device__ float rec_HII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HI/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = 1.269e-13*powf(lam, 1.503)/powf(1.0 + powf(lam/0.522, 0.470), 1.923);
	}
	else
	{
		_a = 2.753e-14*powf(lam, 1.500)/powf(1.0 + powf(lam/2.740, 0.407), 2.242);
	}
	
	return _a;
}

__device__ float rec_cool_HII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HI/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = _t*1.778e-29*powf(lam, 1.965)/powf(1.0 + powf(lam/0.541, 0.502), 2.697);
	}
	else
	{
		_a = _t*3.435e-30*powf(lam, 1.970)/powf(1.0 + powf(lam/2.250, 0.376), 3.720);
	}
	
	return _a*ERG_TO_EV;
}

__device__ float rec_HeII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HeI/_t;
	
	if(_t <= 5.e3 || _t >= 5.e5)
		return 0.0;
	
	// Case A
	if(_case == 0)
	{
		_a = 3.0e-14*powf(lam, 0.654);
	}
	else
	{
		_a = 1.26e-14*powf(lam, 0.750);
	}
	
	return _a;
}

__device__ float rec_cool_HeII(float _t, int _case)
{
	float kb = 8.617e-5;
	
	float _a = (kb*_t)*rec_HeII(_t, _case);
	
	return _a;
}

__device__ float rec_HeIII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HeII/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = 2.0*1.269e-13*powf(lam, 1.503)/powf(1.0 + powf(lam/0.522, 0.470), 1.923);
	}
	else
	{
		_a = 2.0*2.753e-14*powf(lam, 1.500)/powf(1.0 + powf(lam/2.740, 0.407), 2.242);
	}
	
	return _a;
}

__device__ float rec_cool_HeIII(float _t, int _case)
{
	float _a;
	float lam = 2.0*TTR_HeII/_t;
	
	// Case A
	if(_case == 0)
	{
		_a = _t*8.0*1.778e-29*powf(lam, 1.965)/powf(1.0 + powf(lam/0.541, 0.502), 2.697);
	}
	else
	{
		_a = _t*8.0*3.435e-30*powf(lam, 1.970)/powf(1.0 + powf(lam/2.250, 0.376), 3.720);
	}
	
	return _a*ERG_TO_EV;
}

__device__ float col_HI(float _t)
{
	float lam = 2.0*TTR_HI/_t;
	
	if(_t < 1.e4 || _t > 1.e9)
		return 0.0;
	
	float _a = 21.11*powf(_t, -1.5)*expf(-lam/2.0);
	_a *= powf(lam, -1.089)/powf(1.0 + powf(lam/0.354, 0.874), 1.101);
	return _a;
}

__device__ float col_cool_HI(float _t)
{
	float kb = 8.617e-5;
	
	float _a = (kb*TTR_HI)*col_HI(_t);
	
	return _a;
}

__device__ float col_HeI(float _t)
{
	float lam = 2.0*TTR_HeI/_t;
	
	if(_t < 1.e4 || _t > 1.e9)
		return 0.0;
	
	float _a = 32.38*powf(_t, -1.5)*expf(-lam/2.0);
	_a *= powf(lam, -1.146)/powf(1.0 + powf(lam/0.416, 0.987), 1.056);
	return _a;
}

__device__ float col_cool_HeI(float _t)
{
	float kb = 8.617e-5;
	
	float _a = (kb*TTR_HeI)*col_HeI(_t);
	
	return _a;
}

__device__ float col_HeII(float _t)
{
	float lam = 2.0*TTR_HeII/_t;
	
	if(_t < 1.e4 || _t > 1.e9)
		return 0.0;
	
	float _a = 19.95*powf(_t, -1.5)*expf(-lam/2.0);
	_a *= powf(lam, -1.089)/powf(1.0 + powf(lam/0.553, 0.735), 1.275);
	return _a;
}

__device__ float col_cool_HeII(float _t)
{
	float kb = 8.617e-5;
	//float lam = 2.0*TTR_HeII/_t;
	
	float _a = (kb*TTR_HeII)*col_HeII(_t);
	
	return _a;
}

__device__ float colex_HI(float _t)
{
	float lam = 2.0*TTR_HI/_t;
	
	if(_t < 5.e3 || _t > 5.e5)
		return 0.0;
	
	float _a = 7.5e-19*expf(-0.375*lam)/(1.0+powf(_t/1.e5, 0.5));
	
	return _a*ERG_TO_EV;
}

	.text
	.file	"rates.hip"
	.type	__hip_cuid_,@object             # @__hip_cuid_
	.bss
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               # 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_

	.text
	.p2alignl 7, 3214868480
	.fill 96, 4, 3214868480
	.type	__hip_cuid_,@object             ; @__hip_cuid_
	.section	.bss,"aw",@nobits
	.globl	__hip_cuid_
__hip_cuid_:
	.byte	0                               ; 0x0
	.size	__hip_cuid_, 1

	.ident	"AMD clang version 18.0.0git (https://github.com/RadeonOpenCompute/llvm-project roc-6.3.2 25012 e5bf7e55c91490b07c49d8960fa7983d864936c4)"
	.section	".note.GNU-stack","",@progbits
	.addrsig
	.addrsig_sym __hip_cuid_
	.amdgcn_target "amdgcn-amd-amdhsa--gfx1100"
	.amdgpu_metadata
---
amdhsa.kernels:  []
amdhsa.target:   amdgcn-amd-amdhsa--gfx1100
amdhsa.version:
  - 1
  - 2
...

	.end_amdgpu_metadata
