// File: /workspace/github_cpp_makefile_star2_O2/TBody[P]atomicpp/atomicpp/RateCoefficient.cpp
// Function: atomicpp::RateCoefficient::RateCoefficient(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
RateCoefficient::RateCoefficient(const std::string& filename){
	// # Create an instance of RateCoefficient by reading an OpenADAS JSON file

	json data_dict = retrieveFromJSON(filename);

	atomic_number   = data_dict["charge"];
	element         = data_dict["element"];
	adf11_file      = filename;

	std::vector<std::vector< std::vector<double> > > log_rate = data_dict["log_coeff"];
	std::vector<double> log_temp = data_dict["log_temperature"];
	std::vector<double> log_dens = data_dict["log_density"];
	// Doing this as a two-step process - since the first is casting JSON data into the stated type.
	// The second copies the value to the corresponding RateCoefficient attribute

	for(int k=0; k<atomic_number; ++k){
		interpolator.push_back(BivariateBSpline(log_temp, log_dens, log_rate[k]));
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rsi, %r13
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
movq %r14, %rdi
callq 0x4300
leaq 0x28(%rbx), %r15
movq %r15, %rdi
callq 0x4300
movq %rbx, -0x48(%rbp)
leaq 0x48(%rbx), %rdi
movq %rdi, -0x40(%rbp)
callq 0x11090
leaq -0xc0(%rbp), %rdi
movq %r13, %rsi
movq %r14, -0x58(%rbp)
movq %r15, -0x50(%rbp)
callq 0x4480
leaq -0x38(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5c2c
leaq -0xc0(%rbp), %rdi
callq 0x41a0
leaq 0x1235f(%rip), %rsi     # 0x22fb8
leaq -0x38(%rbp), %rdi
callq 0xc8b4
movq %rax, %rdi
callq 0xca0a
movq -0x48(%rbp), %rcx
movl %eax, (%rcx)
leaq 0x12348(%rip), %rsi     # 0x22fbf
leaq -0x38(%rbp), %rdi
callq 0xc8b4
leaq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0xc9f2
leaq -0x150(%rbp), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4420
movq %rbx, %rdi
callq 0x41a0
movq %r15, %rdi
movq %r13, %rsi
callq 0x4060
leaq 0x1230c(%rip), %rsi     # 0x22fc7
leaq -0x38(%rbp), %rdi
callq 0xc8b4
leaq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x1109a
leaq 0x122f7(%rip), %rsi     # 0x22fd1
leaq -0x38(%rbp), %rdi
callq 0xc8b4
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x110b2
leaq 0x122e8(%rip), %rsi     # 0x22fe1
leaq -0x38(%rbp), %rdi
callq 0xc8b4
leaq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x110b2
xorl %r13d, %r13d
leaq -0x150(%rbp), %r14
leaq -0x88(%rbp), %r15
leaq -0x70(%rbp), %r12
pushq $0x1
popq %rbx
movq -0x48(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r13
jge 0x10d71
leaq -0xa0(%rbp), %rdi
movq %r13, %rsi
callq 0x110d4
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rax, %rcx
movl %ebx, %r8d
movl %ebx, %r9d
callq 0x1981c
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x110ca
movq %r14, %rdi
callq 0x100ae
incq %r13
jmp 0x10d26
leaq -0x70(%rbp), %rdi
callq 0x53a6
leaq -0x88(%rbp), %rdi
callq 0x53a6
leaq -0xa0(%rbp), %rdi
callq 0x110e2
leaq -0x38(%rbp), %rdi
callq 0x5e66
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r12
leaq -0xc0(%rbp), %rdi
callq 0x41a0
jmp 0x10e14
movq %rax, %r12
jmp 0x10e14
movq %rax, %r12
jmp 0x10df3
movq %rax, %r12
jmp 0x10dff
jmp 0x10dd1
jmp 0x10dd1
movq %rax, %r12
jmp 0x10e0b
movq %rax, %r12
leaq -0x150(%rbp), %rdi
callq 0x100ae
jmp 0x10dea
movq %rax, %r12
leaq -0x70(%rbp), %rdi
callq 0x53a6
leaq -0x88(%rbp), %rdi
callq 0x53a6
leaq -0xa0(%rbp), %rdi
callq 0x110e2
leaq -0x38(%rbp), %rdi
callq 0x5e66
movq -0x40(%rbp), %rdi
callq 0xffe0
movq -0x50(%rbp), %rdi
callq 0x41a0
movq -0x58(%rbp), %rdi
callq 0x41a0
movq %r12, %rdi
callq 0x45a0
nop