// File: /workspace/github_cpp_makefile_star2_O1/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, -0x30(%rbp)
leaq 0x48(%rbx), %rdi
movq %rdi, -0x48(%rbp)
callq 0x11472
leaq -0xc0(%rbp), %rdi
movq %r13, %rsi
movq %r14, -0x58(%rbp)
movq %r15, -0x50(%rbp)
callq 0x4480
leaq -0x40(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x5c50
leaq -0xc0(%rbp), %rdi
callq 0x41a0
leaq 0x12f93(%rip), %rsi     # 0x23fb8
leaq -0x40(%rbp), %rdi
callq 0xcb52
movq %rax, %rdi
callq 0xccb0
movq -0x30(%rbp), %rcx
movl %eax, (%rcx)
leaq 0x12f7c(%rip), %rsi     # 0x23fbf
leaq -0x40(%rbp), %rdi
callq 0xcb52
leaq -0x150(%rbp), %rdi
movq %rax, %rsi
callq 0xcc98
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 0x12f40(%rip), %rsi     # 0x23fc7
leaq -0x40(%rbp), %rdi
callq 0xcb52
leaq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0x1147c
leaq 0x12f2b(%rip), %rsi     # 0x23fd1
leaq -0x40(%rbp), %rdi
callq 0xcb52
leaq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x11494
leaq 0x12f1c(%rip), %rsi     # 0x23fe1
leaq -0x40(%rbp), %rdi
callq 0xcb52
leaq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x11494
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x1114a
xorl %r13d, %r13d
leaq -0xa0(%rbp), %rbx
leaq -0x150(%rbp), %r14
leaq -0x88(%rbp), %r15
leaq -0x70(%rbp), %r12
movq %rbx, %rdi
movq %r13, %rsi
callq 0x114b6
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rax, %rcx
movl $0x1, %r8d
movl $0x1, %r9d
callq 0x19ec8
movq -0x48(%rbp), %rdi
movq %r14, %rsi
callq 0x114ac
movq %r14, %rdi
callq 0x10446
incq %r13
movq -0x30(%rbp), %rax
movslq (%rax), %rax
cmpq %rax, %r13
jl 0x110ff
leaq -0x70(%rbp), %rdi
callq 0x53c6
leaq -0x88(%rbp), %rdi
callq 0x53c6
leaq -0xa0(%rbp), %rdi
callq 0x114c8
leaq -0x40(%rbp), %rdi
callq 0x5e92
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 0x111ed
movq %rax, %r12
jmp 0x111ed
movq %rax, %r12
jmp 0x111cc
movq %rax, %r12
jmp 0x111d8
jmp 0x111aa
jmp 0x111aa
movq %rax, %r12
jmp 0x111e4
movq %rax, %r12
jmp 0x111c3
movq %rax, %r12
leaq -0x150(%rbp), %rdi
callq 0x10446
leaq -0x70(%rbp), %rdi
callq 0x53c6
leaq -0x88(%rbp), %rdi
callq 0x53c6
leaq -0xa0(%rbp), %rdi
callq 0x114c8
leaq -0x40(%rbp), %rdi
callq 0x5e92
movq -0x48(%rbp), %rdi
callq 0x10370
movq -0x50(%rbp), %rdi
callq 0x41a0
movq -0x58(%rbp), %rdi
callq 0x41a0
movq %r12, %rdi
callq 0x45a0