// File: /workspace/github_cpp_makefile_star2_O3/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 0xce44
leaq 0x174d6(%rip), %rdx     # 0x22fae
leaq -0x98(%rbp), %rdi
movq %r12, -0x58(%rbp)
movq %r12, %rsi
callq 0xcf89
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
movq %r15, %rdx
callq 0xcedf
leaq -0x78(%rbp), %rdi
leaq -0x198(%rbp), %rsi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x43a0
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0xcf08
leaq 0x17d2d(%rip), %rdx     # 0x23866
leaq -0x118(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x90d4
leaq -0x48(%rbp), %rdi
leaq -0x118(%rbp), %rsi
movq %r14, %rdx
callq 0xcedf
movl %r13d, %r12d
movq %r15, -0x50(%rbp)
leaq 0x164f8(%rip), %rdx     # 0x22065
leaq -0xf8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x90d4
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 0x5d8c
testb %al, %al
movq %rbx, %r13
movq -0x58(%rbp), %rbx
je 0xbc16
addq $0x58, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xcfc2
leaq -0x138(%rbp), %rsi
movq %rax, %rdi
callq 0x4060
jmp 0xbdb2
leaq -0x138(%rbp), %rdi
callq 0x4180
leaq 0x17c3f(%rip), %rdi     # 0x23868
movq %rax, %rsi
xorl %eax, %eax
callq 0x4080
leaq -0xf8(%rbp), %rdi
callq 0x4300
leaq -0x48(%rbp), %rdi
movl %r12d, %esi
callq 0xce44
leaq 0x1735c(%rip), %rdx     # 0x22fae
leaq -0x178(%rbp), %rdi
movq %rbx, %rsi
callq 0xcf89
leaq -0x78(%rbp), %rdi
leaq -0x178(%rbp), %rsi
movq -0x50(%rbp), %rdx
callq 0xcedf
leaq -0x158(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x2, %edx
movl $0x4, %ecx
callq 0x43a0
leaq -0x98(%rbp), %rdi
leaq -0x78(%rbp), %rsi
leaq -0x158(%rbp), %rdx
callq 0xcf08
leaq 0x17bb9(%rip), %rdx     # 0x23866
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x90d4
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movq %r14, %rdx
callq 0xcedf
leaq 0x16388(%rip), %rdx     # 0x22065
leaq -0x118(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x90d4
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 0x5d8c
testb %al, %al
je 0xbddc
leaq -0xf8(%rbp), %rdi
callq 0x4180
leaq 0x17b20(%rip), %rdi     # 0x23895
movq %rax, %rsi
xorl %eax, %eax
callq 0x4080
addq $0x58, %r14
movq %r14, %rdi
movq %r13, %rsi
callq 0xcfc2
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 0x17ace(%rip), %rdi     # 0x238ba
movq %rax, %rsi
xorl %eax, %eax
callq 0x4080
movl $0x10, %edi
callq 0x41b0
movq %rax, %r14
leaq 0x17ace(%rip), %rsi     # 0x238d8
movq %rax, %rdi
callq 0x4150
movq 0x2f1d7(%rip), %rsi     # 0x3aff0
movq 0x2f180(%rip), %rdx     # 0x3afa0
movq %r14, %rdi
callq 0x4560
movq %rax, %rbx
movq %r14, %rdi
callq 0x4270
jmp 0xbf07
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x41a0
jmp 0xbe4c
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x41a0
jmp 0xbe5d
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x41a0
jmp 0xbe6e
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x41a0
jmp 0xbe7f
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x41a0
leaq -0x178(%rbp), %rdi
callq 0x41a0
jmp 0xbf07
movq %rax, %rbx
jmp 0xbe88
jmp 0xbf04
movq %rax, %rbx
jmp 0xbf10
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x41a0
jmp 0xbeb3
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x41a0
jmp 0xbec4
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x41a0
jmp 0xbed5
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x41a0
jmp 0xbee3
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
callq 0x41a0
leaq -0x98(%rbp), %rdi
jmp 0xbf17
movq %rax, %rbx
jmp 0xbeef
jmp 0xbf1e
movq %rax, %rbx
jmp 0xbf2d
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x41a0
leaq -0xf8(%rbp), %rdi
callq 0x41a0
jmp 0xbf21
movq %rax, %rbx
leaq -0x198(%rbp), %rdi
callq 0x41a0
leaq -0x138(%rbp), %rdi
callq 0x41a0
movq %rbx, %rdi
callq 0x45a0
nop