// File: /workspace/github_cpp_makefile_star2_O2/TBody[P]atomicpp/atomicpp/ImpuritySpecies.cpp
// Function: atomicpp::ImpuritySpecies::addJSONFiles(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int)
void ImpuritySpecies::addJSONFiles(const std::string& physics_process, const std::string& filetype_code, const std::string& json_database_path, const int year_fallback /* = 1996*/){
	// # 1. Make the filename std::string expected for the json adas file
	// # 2. Check that this file exists in the JSON_database_path/json_data directory
	// # 3. Add this file to the atomic data .adas_files_dict attribute
	std::string filename;
	std::string year_to_string = std::to_string(year);

	filename = json_database_path + "/" + filetype_code + year_to_string.substr(2,4) + "_" + symbol + ".json";

	if (test_file_exists(filename)) {
		adas_files_dict[physics_process] = filename;
	} else {
		std::printf("%s not found in the specified JSON database\n", filename.c_str());

		std::string filename_fallback;
		std::string year_to_string_fallback = std::to_string(year_fallback);
		filename_fallback = json_database_path + "/" + filetype_code + year_to_string_fallback.substr(2,4) + "_" + symbol + ".json";
		if (test_file_exists(filename_fallback)) {
			std::printf("Warning: Fallback (%s) will be used\n", filename_fallback.c_str());
			adas_files_dict[physics_process] = filename_fallback;
		} else {
			std::printf("Error: Fallback to %s failed\n", year_to_string_fallback.c_str());
			throw std::runtime_error("File not found error (in ImpuritySpecies::addJSONFiles)");
		}
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movl %r8d, %r13d
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x138(%rbp), %rdi
callq 0x4300
movl 0x40(%r14), %esi
leaq -0x198(%rbp), %rdi
callq 0xcc1c
leaq 0x166c2(%rip), %rdx     # 0x21fae
leaq -0x98(%rbp), %rdi
movq %r12, -0x58(%rbp)
movq %r12, %rsi
callq 0xcd5d
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movq %r15, %rdx
callq 0xccb3
leaq -0x78(%rbp), %rdi
leaq -0x198(%rbp), %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %rcx
callq 0x43a0
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0xccdc
leaq 0x16f1d(%rip), %rdx     # 0x22866
leaq -0x118(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x8f95
leaq -0x48(%rbp), %rdi
leaq -0x118(%rbp), %rsi
movq %r14, %rdx
callq 0xccb3
movl %r13d, %r12d
movq %r15, -0x50(%rbp)
leaq 0x156e8(%rip), %rdx     # 0x21065
leaq -0xf8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x8f95
leaq -0x138(%rbp), %r15
leaq -0xf8(%rbp), %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x4420
movq %r13, %rdi
callq 0x41a0
leaq -0x48(%rbp), %rdi
callq 0x41a0
leaq -0x118(%rbp), %rdi
callq 0x41a0
leaq -0xd8(%rbp), %rdi
callq 0x41a0
leaq -0x78(%rbp), %rdi
callq 0x41a0
leaq -0xb8(%rbp), %rdi
callq 0x41a0
leaq -0x98(%rbp), %rdi
callq 0x41a0
movq %r15, %rdi
callq 0x5d61
testb %al, %al
movq %rbx, %r13
movq -0x58(%rbp), %rbx
je 0xba26
addq $0x58, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xcd96
leaq -0x138(%rbp), %rsi
movq %rax, %rdi
callq 0x4060
jmp 0xbbbe
leaq -0x138(%rbp), %rdi
callq 0x4180
leaq 0x16e2f(%rip), %rdi     # 0x22868
movq %rax, %rsi
xorl %eax, %eax
callq 0x4080
leaq -0xf8(%rbp), %rdi
callq 0x4300
leaq -0x48(%rbp), %rdi
movl %r12d, %esi
callq 0xcc1c
leaq 0x1654c(%rip), %rdx     # 0x21fae
leaq -0x178(%rbp), %rdi
movq %rbx, %rsi
callq 0xcd5d
leaq -0x78(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0xccb3
leaq -0x158(%rbp), %rdi
leaq -0x48(%rbp), %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %rcx
callq 0x43a0
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x158(%rbp), %rdx
callq 0xccdc
leaq 0x16dad(%rip), %rdx     # 0x22866
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x8f95
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movq %r14, %rdx
callq 0xccb3
leaq 0x1557c(%rip), %rdx     # 0x21065
leaq -0x118(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x8f95
leaq -0xf8(%rbp), %rbx
leaq -0x118(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4420
movq %r15, %rdi
callq 0x41a0
leaq -0xd8(%rbp), %rdi
callq 0x41a0
leaq -0xb8(%rbp), %rdi
callq 0x41a0
leaq -0x98(%rbp), %rdi
callq 0x41a0
leaq -0x158(%rbp), %rdi
callq 0x41a0
leaq -0x78(%rbp), %rdi
callq 0x41a0
leaq -0x178(%rbp), %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0x5d61
testb %al, %al
je 0xbbe8
leaq -0xf8(%rbp), %rdi
callq 0x4180
leaq 0x16d14(%rip), %rdi     # 0x22895
movq %rax, %rsi
xorl %eax, %eax
callq 0x4080
addq $0x58, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xcd96
leaq -0xf8(%rbp), %rsi
movq %rax, %rdi
callq 0x4060
leaq -0x48(%rbp), %rdi
callq 0x41a0
leaq -0xf8(%rbp), %rdi
callq 0x41a0
leaq -0x198(%rbp), %rdi
callq 0x41a0
leaq -0x138(%rbp), %rdi
callq 0x41a0
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x48(%rbp), %rdi
callq 0x4180
leaq 0x16cc2(%rip), %rdi     # 0x228ba
movq %rax, %rsi
xorl %eax, %eax
callq 0x4080
pushq $0x10
popq %rdi
callq 0x41b0
movq %rax, %r14
leaq 0x16cc4(%rip), %rsi     # 0x228d8
movq %rax, %rdi
callq 0x4150
movq 0x2e3cd(%rip), %rsi     # 0x39ff0
movq 0x2e376(%rip), %rdx     # 0x39fa0
movq %r14, %rdi
callq 0x4560
movq %rax, %rbx
movq %r14, %rdi
callq 0x4270
jmp 0xbd11
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x41a0
jmp 0xbc56
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x41a0
jmp 0xbc67
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x41a0
jmp 0xbc78
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x41a0
jmp 0xbc89
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x41a0
leaq -0x178(%rbp), %rdi
callq 0x41a0
jmp 0xbd11
movq %rax, %rbx
jmp 0xbc92
jmp 0xbd0e
movq %rax, %rbx
jmp 0xbd1a
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x41a0
jmp 0xbcbd
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x41a0
jmp 0xbcce
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x41a0
jmp 0xbcdf
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x41a0
jmp 0xbced
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x41a0
leaq -0x98(%rbp), %rdi
jmp 0xbd21
movq %rax, %rbx
jmp 0xbcf9
jmp 0xbd28
movq %rax, %rbx
jmp 0xbd37
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x41a0
leaq -0xf8(%rbp), %rdi
callq 0x41a0
jmp 0xbd2b
movq %rax, %rbx
leaq -0x198(%rbp), %rdi
callq 0x41a0
leaq -0x138(%rbp), %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0x45a0
nop