// File: 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
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x160(%rbp)
addq $0x8, %rdi
movq %rdi, -0x170(%rbp)
callq 0x44e0
movq -0x160(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0x168(%rbp)
callq 0x44e0
movq -0x160(%rbp), %rdi
addq $0x48, %rdi
movq %rdi, -0x158(%rbp)
callq 0x1abd0
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x4190
jmp 0x1a50b
leaq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x6c20
jmp 0x1a51a
leaq -0x40(%rbp), %rdi
callq 0x4220
leaq 0x1dc0e(%rip), %rsi     # 0x38138
leaq -0x20(%rbp), %rdi
callq 0x12e00
movq %rax, -0x178(%rbp)
jmp 0x1a53c
movq -0x178(%rbp), %rdi
callq 0x13030
movl %eax, -0x17c(%rbp)
jmp 0x1a550
movq -0x160(%rbp), %rax
movl -0x17c(%rbp), %ecx
movl %ecx, (%rax)
leaq 0x1dbd9(%rip), %rsi     # 0x3813f
leaq -0x20(%rbp), %rdi
callq 0x12e00
movq %rax, -0x188(%rbp)
jmp 0x1a578
movq -0x188(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x13000
jmp 0x1a58a
movq -0x160(%rbp), %rdi
addq $0x8, %rdi
leaq -0x70(%rbp), %rsi
movq %rsi, -0x190(%rbp)
callq 0x4470
movq -0x190(%rbp), %rdi
callq 0x4220
movq -0x160(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x28, %rdi
callq 0x4060
jmp 0x1a5c7
leaq 0x1db79(%rip), %rsi     # 0x38147
leaq -0x20(%rbp), %rdi
callq 0x12e00
movq %rax, -0x198(%rbp)
jmp 0x1a5e0
movq -0x198(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x1abf0
jmp 0x1a5f5
leaq 0x1db55(%rip), %rsi     # 0x38151
leaq -0x20(%rbp), %rdi
callq 0x12e00
movq %rax, -0x1a0(%rbp)
jmp 0x1a60e
movq -0x1a0(%rbp), %rsi
leaq -0xa0(%rbp), %rdi
callq 0x1ac20
jmp 0x1a623
leaq 0x1db37(%rip), %rsi     # 0x38161
leaq -0x20(%rbp), %rdi
callq 0x12e00
movq %rax, -0x1a8(%rbp)
jmp 0x1a63c
movq -0x1a8(%rbp), %rsi
leaq -0xb8(%rbp), %rdi
callq 0x1ac20
jmp 0x1a651
movl $0x0, -0xbc(%rbp)
movq -0x160(%rbp), %rcx
movl -0xbc(%rbp), %eax
cmpl (%rcx), %eax
jge 0x1a775
movq -0x160(%rbp), %rax
addq $0x48, %rax
movq %rax, -0x1b0(%rbp)
movslq -0xbc(%rbp), %rsi
leaq -0x88(%rbp), %rdi
callq 0x1ac80
movq %rax, %rcx
leaq -0x150(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
movl $0x1, %r9d
movl %r9d, %r8d
callq 0x29bc0
jmp 0x1a6bd
movq -0x1b0(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x1ac50
jmp 0x1a6d2
leaq -0x150(%rbp), %rdi
callq 0x190f0
movl -0xbc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xbc(%rbp)
jmp 0x1a65b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1a7d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x4220
jmp 0x1a7d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1a7cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1a7c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1a7b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x1a7ab
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x190f0
jmp 0x1a7ab
leaq -0xb8(%rbp), %rdi
callq 0x59b0
leaq -0xa0(%rbp), %rdi
callq 0x59b0
leaq -0x88(%rbp), %rdi
callq 0x1aca0
leaq -0x20(%rbp), %rdi
callq 0x6fd0
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
leaq -0xb8(%rbp), %rdi
callq 0x59b0
leaq -0xa0(%rbp), %rdi
callq 0x59b0
leaq -0x88(%rbp), %rdi
callq 0x1aca0
leaq -0x20(%rbp), %rdi
callq 0x6fd0
movq -0x158(%rbp), %rdi
callq 0x18f70
movq -0x168(%rbp), %rdi
callq 0x4220
movq -0x170(%rbp), %rdi
callq 0x4220
movq -0x48(%rbp), %rdi
callq 0x45e0
nopw %cs:(%rax,%rax)