// File: TBody[P]atomicpp/atomicpp/ImpuritySpecies.cpp
// Function: atomicpp::ImpuritySpecies::ImpuritySpecies(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
ImpuritySpecies::ImpuritySpecies(std::string& impurity_symbol_supplied){
	// Constructor for the ImpuritySpecies class
	// Input is a std::string, which typically should be of length 1 (i.e. "c" for carbon, "n" for nitrogen)
	// Will return an ImpuritySpecies object
	
	// Convert impurity_symbol_supplied to lowercase (this is what impurity_user_input uses as a key)
	impurity_symbol_supplied[0] = tolower(impurity_symbol_supplied[0]);

	// Declare the path to the JSON file which contains hard-coded parameters for the ADAS data corresponding to the impurities
	// std::string user_file = get_impurity_user_input();
	std::string user_file = "impurity_user_input.json";

	// Declare the path the directory which contains the JSON files created from OpenADAS .dat files
	// To convert .dat to .json, see https://github.com/TBody/OpenADAS_to_JSON (should be included as a subdirectory of SD1D)
	// std::string json_database_path = get_json_database_path();
	std::string json_database_path = "json_database/json_data";

	// Define a std::map between a recognisable key for various physics process, and the 3-letter code used by OpenADAS to represent this data
	std::map<std::string,std::string>datatype_abbrevs={
		{"ionisation",           "scd"},
		{"recombination",        "acd"},
		{"cx_rec",              "ccd"},
		{"continuum_power",      "prb"},
		{"line_power",           "plt"},
		{"cx_power",             "prc"},
		{"ionisation_potential", "ecd"} //N.b. ionisation_potential is not a rate-coefficient, but most of the methods are transferable
	};

	// Save from impurity_symbol_supplied and the hard-coded data within user_file
	symbol              = impurity_symbol_supplied;
	// retrieve from JSON and std::set attributes
	
	json j_object = retrieveFromJSON(user_file);
	auto check_symbol_in_file = j_object.find(impurity_symbol_supplied);
	if ((check_symbol_in_file != j_object.end())){
		name                = j_object[impurity_symbol_supplied]["name"];
		year                = j_object[impurity_symbol_supplied]["year"];
		has_charge_exchange = j_object[impurity_symbol_supplied]["has_charge_exchange"];
		atomic_number       = j_object[impurity_symbol_supplied]["atomic_number"];
		double mass_in_amu  = j_object[impurity_symbol_supplied]["mass"]; //in amu
		mass                = mass_in_amu;
	} else {
		std::cout << "Error: "<< impurity_symbol_supplied << " not found in " << user_file << "\n";
		throw std::invalid_argument( "Key not found in user input file" );
	};

	// Add the JSON files associated with this impurity to its .adas_files_dict attribute where the key is the (extended) process name, which std::maps to a filename (std::string)
	// Mark the physics processes which rely on charge exchange
	std::set<std::string> cx_processes{datatype_abbrevs["cx_rec"],datatype_abbrevs["cx_power"]};
	// Iterate over the key -> value pairs in datatype_abbrevs
	for (auto& kv : datatype_abbrevs) {
		std::string physics_process = kv.first;
		std::string filetype_code = kv.second;
		// Check to see if physics_process is a charge exchange process
		bool code_is_cx = find(begin(cx_processes), end(cx_processes), filetype_code) != end(cx_processes);
		// If it is, and the element doesn't have charge exchange data, then skip this process
		if (get_has_charge_exchange() or not(code_is_cx)){
			// Otherwise, add the filenames of the json files corresponding to the rate-coefficients for the physics process to .adas_files_dict
		    addJSONFiles(physics_process, filetype_code, json_database_path);
		};
	}

	// Use the .adas_file_dict files to generate RateCoefficient objects for each process
	// Uses the same keys as .adas_file_dict
	makeRateCoefficients();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x680, %rsp            # imm = 0x680
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x4b0(%rbp)
movq %rdi, %rax
movq %rax, -0x4c8(%rbp)
callq 0x44e0
movq -0x4b0(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x4c0(%rbp)
callq 0x44e0
movq -0x4b0(%rbp), %rdi
addq $0x58, %rdi
movq %rdi, -0x4b8(%rbp)
callq 0x12690
movq -0x4b0(%rbp), %rdi
addq $0x88, %rdi
movq %rdi, -0x4a8(%rbp)
callq 0x126b0
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4690
movq %rax, -0x4a0(%rbp)
jmp 0x1092b
movq -0x4a0(%rbp), %rax
movsbl (%rax), %edi
callq 0x44f0
movb %al, -0x4d1(%rbp)
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x4690
movq %rax, -0x4d0(%rbp)
jmp 0x10956
movq -0x4d0(%rbp), %rax
movb -0x4d1(%rbp), %cl
movb %cl, (%rax)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x4e0(%rbp)
callq 0x45f0
movq -0x4e0(%rbp), %rdx
leaq 0x26f6d(%rip), %rsi     # 0x378f0
leaq -0x40(%rbp), %rdi
callq 0x44d0
jmp 0x1098e
leaq -0x41(%rbp), %rdi
callq 0x4410
leaq -0x69(%rbp), %rdi
movq %rdi, -0x4e8(%rbp)
callq 0x45f0
movq -0x4e8(%rbp), %rdx
leaq 0x26f54(%rip), %rsi     # 0x37909
leaq -0x68(%rbp), %rdi
callq 0x44d0
jmp 0x109c0
leaq -0x69(%rbp), %rdi
callq 0x4410
leaq -0x270(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq 0x25652(%rip), %rsi     # 0x36030
leaq 0x26f3c(%rip), %rdx     # 0x37921
callq 0x126d0
jmp 0x109ec
leaq -0x230(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq 0x2563a(%rip), %rsi     # 0x3603b
leaq 0x26f1d(%rip), %rdx     # 0x37925
callq 0x127b0
jmp 0x10a0f
leaq -0x1f0(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq 0x26f05(%rip), %rsi     # 0x37929
leaq 0x26f05(%rip), %rdx     # 0x37930
callq 0x12890
jmp 0x10a32
leaq -0x1b0(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq 0x26eed(%rip), %rsi     # 0x37934
leaq 0x26ef6(%rip), %rdx     # 0x37944
callq 0x12970
jmp 0x10a55
leaq -0x170(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq 0x26ede(%rip), %rsi     # 0x37948
leaq 0x26ee2(%rip), %rdx     # 0x37953
callq 0x126d0
jmp 0x10a78
leaq -0x130(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq 0x26eca(%rip), %rsi     # 0x37957
leaq 0x26ecc(%rip), %rdx     # 0x37960
callq 0x12a50
jmp 0x10a9b
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x278(%rbp)
leaq 0x26eb4(%rip), %rsi     # 0x37964
leaq 0x26ec2(%rip), %rdx     # 0x37979
callq 0x12b30
jmp 0x10abe
leaq -0x270(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq $0x7, -0xa8(%rbp)
leaq -0x27a(%rbp), %rdi
movq %rdi, -0x4f0(%rbp)
callq 0x12c10
movq -0x4f0(%rbp), %r8
movq -0xb0(%rbp), %rsi
movq -0xa8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
leaq -0x279(%rbp), %rcx
callq 0x12c30
jmp 0x10b14
leaq -0x27a(%rbp), %rdi
callq 0x12d00
leaq -0x270(%rbp), %rax
movq %rax, -0x500(%rbp)
addq $0x1c0, %rax            # imm = 0x1C0
movq %rax, -0x4f8(%rbp)
movq -0x4f8(%rbp), %rdi
addq $-0x40, %rdi
movq %rdi, -0x508(%rbp)
callq 0x6320
movq -0x500(%rbp), %rcx
movq -0x508(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x4f8(%rbp)
jne 0x10b3b
movq -0x4c8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4060
jmp 0x10b7e
leaq -0x2b0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4190
jmp 0x10b90
leaq -0x290(%rbp), %rdi
leaq -0x2b0(%rbp), %rsi
callq 0x6c20
jmp 0x10ba5
leaq -0x2b0(%rbp), %rdi
callq 0x4220
movq -0x10(%rbp), %rsi
leaq -0x2f0(%rbp), %rdi
callq 0x4190
jmp 0x10bc3
leaq -0x2d0(%rbp), %rdi
leaq -0x290(%rbp), %rsi
leaq -0x2f0(%rbp), %rdx
callq 0x12d20
jmp 0x10bdf
leaq -0x2f0(%rbp), %rdi
callq 0x4220
leaq -0x310(%rbp), %rdi
movq %rdi, -0x518(%rbp)
leaq -0x290(%rbp), %rsi
callq 0x12dc0
movq -0x518(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x12d90
movb %al, -0x509(%rbp)
jmp 0x10c20
movb -0x509(%rbp), %al
testb $0x1, %al
jne 0x10c2f
jmp 0x10f8b
movq -0x10(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0xc890
movq %rax, -0x520(%rbp)
jmp 0x10c48
movq -0x520(%rbp), %rdi
leaq 0x26d27(%rip), %rsi     # 0x3797d
callq 0x12e00
movq %rax, -0x528(%rbp)
jmp 0x10c64
movq -0x528(%rbp), %rsi
leaq -0x330(%rbp), %rdi
callq 0x13000
jmp 0x10c79
movq -0x4c8(%rbp), %rdi
addq $0x20, %rdi
leaq -0x330(%rbp), %rsi
movq %rsi, -0x538(%rbp)
callq 0x4470
movq -0x538(%rbp), %rdi
callq 0x4220
movq -0x10(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0xc890
movq %rax, -0x530(%rbp)
jmp 0x10cbc
movq -0x530(%rbp), %rdi
leaq 0x26cb8(%rip), %rsi     # 0x37982
callq 0x12e00
movq %rax, -0x540(%rbp)
jmp 0x10cd8
movq -0x540(%rbp), %rdi
callq 0x13030
movl %eax, -0x544(%rbp)
jmp 0x10cec
movq -0x4c8(%rbp), %rax
movl -0x544(%rbp), %ecx
movl %ecx, 0x40(%rax)
movq -0x10(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0xc890
movq %rax, -0x550(%rbp)
jmp 0x10d15
movq -0x550(%rbp), %rdi
leaq 0x26c64(%rip), %rsi     # 0x37987
callq 0x12e00
movq %rax, -0x558(%rbp)
jmp 0x10d31
movq -0x558(%rbp), %rdi
callq 0x13050
movb %al, -0x559(%rbp)
jmp 0x10d45
movq -0x4c8(%rbp), %rax
movb -0x559(%rbp), %cl
andb $0x1, %cl
movb %cl, 0x44(%rax)
movq -0x10(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0xc890
movq %rax, -0x568(%rbp)
jmp 0x10d71
movq -0x568(%rbp), %rdi
leaq 0x26c1c(%rip), %rsi     # 0x3799b
callq 0x12e00
movq %rax, -0x570(%rbp)
jmp 0x10d8d
movq -0x570(%rbp), %rdi
callq 0x13030
movl %eax, -0x574(%rbp)
jmp 0x10da1
movq -0x4c8(%rbp), %rax
movl -0x574(%rbp), %ecx
movl %ecx, 0x48(%rax)
movq -0x10(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0xc890
movq %rax, -0x580(%rbp)
jmp 0x10dca
movq -0x580(%rbp), %rdi
leaq 0x26bd1(%rip), %rsi     # 0x379a9
callq 0x12e00
movq %rax, -0x588(%rbp)
jmp 0x10de6
movq -0x588(%rbp), %rdi
callq 0x13070
movsd %xmm0, -0x590(%rbp)
jmp 0x10dfc
movq -0x4c8(%rbp), %rax
movsd -0x590(%rbp), %xmm0
movsd %xmm0, -0x338(%rbp)
movsd -0x338(%rbp), %xmm0
movsd %xmm0, 0x50(%rax)
jmp 0x1106b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x115f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x4410
jmp 0x115f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x4410
jmp 0x115ed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x598(%rbp)
je 0x10ec1
movq -0x598(%rbp), %rdi
addq $-0x40, %rdi
movq %rdi, -0x5a0(%rbp)
callq 0x6320
movq -0x5a0(%rbp), %rax
leaq -0x270(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x598(%rbp)
jne 0x10e90
jmp 0x115e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x27a(%rbp), %rdi
callq 0x12d00
leaq -0x270(%rbp), %rax
movq %rax, -0x5b0(%rbp)
addq $0x1c0, %rax            # imm = 0x1C0
movq %rax, -0x5a8(%rbp)
movq -0x5a8(%rbp), %rdi
addq $-0x40, %rdi
movq %rdi, -0x5b8(%rbp)
callq 0x6320
movq -0x5b0(%rbp), %rcx
movq -0x5b8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x5a8(%rbp)
jne 0x10ef9
jmp 0x115e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x115d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x2b0(%rbp), %rdi
callq 0x4220
jmp 0x115d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x115cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x2f0(%rbp), %rdi
callq 0x4220
jmp 0x115cc
movq 0x3e01e(%rip), %rdi     # 0x4efb0
leaq 0x26a15(%rip), %rsi     # 0x379ae
callq 0x43a0
movq %rax, -0x5c0(%rbp)
jmp 0x10fa7
movq -0x5c0(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x4360
movq %rax, -0x5c8(%rbp)
jmp 0x10fc0
movq -0x5c8(%rbp), %rdi
leaq 0x269e8(%rip), %rsi     # 0x379b6
callq 0x43a0
movq %rax, -0x5d0(%rbp)
jmp 0x10fdc
movq -0x5d0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4360
movq %rax, -0x5d8(%rbp)
jmp 0x10ff5
movq -0x5d8(%rbp), %rdi
leaq 0x28359(%rip), %rsi     # 0x3935c
callq 0x43a0
jmp 0x1100a
movl $0x10, %edi
callq 0x41b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x5e0(%rbp)
leaq 0x2699d(%rip), %rsi     # 0x379c5
callq 0x4630
jmp 0x1102f
movq -0x5e0(%rbp), %rdi
movq 0x3df9b(%rip), %rsi     # 0x4efd8
movq 0x3df7c(%rip), %rdx     # 0x4efc0
callq 0x45b0
jmp 0x1162f
movq -0x5e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x42b0
jmp 0x115cc
movb $0x1, -0x40a(%rbp)
leaq -0x3b8(%rbp), %rax
movq %rax, -0x3c0(%rbp)
leaq -0x3e1(%rbp), %rdi
movq %rdi, -0x5e8(%rbp)
callq 0x45f0
movq -0x5e8(%rbp), %rdx
leaq 0x26888(%rip), %rsi     # 0x37929
leaq -0x3e0(%rbp), %rdi
callq 0x44d0
jmp 0x110af
leaq -0xa0(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x13090
movq %rax, -0x5f0(%rbp)
jmp 0x110cb
movq -0x5f0(%rbp), %rsi
leaq -0x3b8(%rbp), %rdi
callq 0x4190
jmp 0x110e0
leaq -0x398(%rbp), %rax
movq %rax, -0x600(%rbp)
movq %rax, -0x3c0(%rbp)
leaq -0x409(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0x45f0
movq -0x5f8(%rbp), %rdx
leaq 0x26841(%rip), %rsi     # 0x37957
leaq -0x408(%rbp), %rdi
callq 0x44d0
jmp 0x11124
leaq -0xa0(%rbp), %rdi
leaq -0x408(%rbp), %rsi
callq 0x13090
movq %rax, -0x608(%rbp)
jmp 0x11140
movq -0x608(%rbp), %rsi
movq -0x600(%rbp), %rdi
callq 0x4190
jmp 0x11155
movb $0x0, -0x40a(%rbp)
leaq -0x3b8(%rbp), %rax
movq %rax, -0x378(%rbp)
movq $0x2, -0x370(%rbp)
leaq -0x40c(%rbp), %rdi
movq %rdi, -0x610(%rbp)
callq 0x7300
movq -0x610(%rbp), %r8
movq -0x378(%rbp), %rsi
movq -0x370(%rbp), %rdx
leaq -0x368(%rbp), %rdi
leaq -0x40b(%rbp), %rcx
callq 0x13170
jmp 0x111b2
leaq -0x40c(%rbp), %rdi
callq 0x7370
leaq -0x3b8(%rbp), %rax
movq %rax, -0x620(%rbp)
addq $0x40, %rax
movq %rax, -0x618(%rbp)
movq -0x618(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x628(%rbp)
callq 0x4220
movq -0x620(%rbp), %rcx
movq -0x628(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x618(%rbp)
jne 0x111d7
leaq -0x408(%rbp), %rdi
callq 0x4220
leaq -0x409(%rbp), %rdi
callq 0x4410
leaq -0x3e0(%rbp), %rdi
callq 0x4220
leaq -0x3e1(%rbp), %rdi
callq 0x4410
leaq -0xa0(%rbp), %rax
movq %rax, -0x418(%rbp)
movq -0x418(%rbp), %rdi
callq 0x13240
movq %rax, -0x420(%rbp)
movq -0x418(%rbp), %rdi
callq 0x13270
movq %rax, -0x428(%rbp)
leaq -0x420(%rbp), %rdi
leaq -0x428(%rbp), %rsi
callq 0x132a0
testb $0x1, %al
jne 0x11288
jmp 0x11573
leaq -0x420(%rbp), %rdi
callq 0x132d0
movq %rax, -0x430(%rbp)
movq -0x430(%rbp), %rsi
leaq -0x450(%rbp), %rdi
callq 0x4190
jmp 0x112b0
movq -0x430(%rbp), %rsi
addq $0x20, %rsi
leaq -0x470(%rbp), %rdi
callq 0x4190
jmp 0x112c9
leaq -0x368(%rbp), %rdi
callq 0x13370
movq %rax, -0x630(%rbp)
jmp 0x112de
movq -0x630(%rbp), %rax
movq %rax, -0x488(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x133a0
movq %rax, -0x638(%rbp)
jmp 0x11301
movq -0x638(%rbp), %rax
movq %rax, -0x490(%rbp)
movq -0x488(%rbp), %rdi
movq -0x490(%rbp), %rsi
leaq -0x470(%rbp), %rdx
callq 0x13320
movq %rax, -0x640(%rbp)
jmp 0x11332
movq -0x640(%rbp), %rax
movq %rax, -0x480(%rbp)
leaq -0x368(%rbp), %rdi
callq 0x133a0
movq %rax, -0x648(%rbp)
jmp 0x11355
movq -0x648(%rbp), %rax
movq %rax, -0x498(%rbp)
leaq -0x480(%rbp), %rdi
leaq -0x498(%rbp), %rsi
callq 0x132f0
movq -0x4c8(%rbp), %rdi
movb %al, -0x471(%rbp)
callq 0x11630
movb %al, -0x649(%rbp)
jmp 0x11390
movb -0x649(%rbp), %al
testb $0x1, %al
jne 0x113a9
jmp 0x1139c
testb $0x1, -0x471(%rbp)
jne 0x1153c
movq -0x4c8(%rbp), %rdi
leaq -0x450(%rbp), %rsi
leaq -0x470(%rbp), %rdx
leaq -0x68(%rbp), %rcx
movl $0x7cc, %r8d            # imm = 0x7CC
callq 0x11650
jmp 0x113cf
jmp 0x1153c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x1149a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x1148e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x11482
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x11476
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x40c(%rbp), %rdi
callq 0x7370
leaq -0x3b8(%rbp), %rax
movq %rax, -0x660(%rbp)
addq $0x40, %rax
movq %rax, -0x658(%rbp)
movq -0x658(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x668(%rbp)
callq 0x4220
movq -0x660(%rbp), %rcx
movq -0x668(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x658(%rbp)
jne 0x11443
jmp 0x11476
leaq -0x408(%rbp), %rdi
callq 0x4220
leaq -0x409(%rbp), %rdi
callq 0x4410
leaq -0x3e0(%rbp), %rdi
callq 0x4220
leaq -0x3e1(%rbp), %rdi
callq 0x4410
testb $0x1, -0x40a(%rbp)
jne 0x114b1
jmp 0x114fe
movq -0x3c0(%rbp), %rax
leaq -0x3b8(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x670(%rbp)
je 0x114fc
movq -0x670(%rbp), %rdi
addq $-0x20, %rdi
movq %rdi, -0x678(%rbp)
callq 0x4220
movq -0x678(%rbp), %rax
leaq -0x3b8(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x670(%rbp)
jne 0x114cb
jmp 0x114fe
jmp 0x115cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x115c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x11565
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x4220
jmp 0x11565
leaq -0x470(%rbp), %rdi
callq 0x4220
leaq -0x450(%rbp), %rdi
callq 0x4220
leaq -0x420(%rbp), %rdi
callq 0x133d0
jmp 0x1126c
leaq -0x450(%rbp), %rdi
callq 0x4220
jmp 0x115c0
movq -0x4c8(%rbp), %rdi
callq 0x11c80
jmp 0x11581
leaq -0x368(%rbp), %rdi
callq 0x13400
leaq -0x290(%rbp), %rdi
callq 0x6fd0
leaq -0xa0(%rbp), %rdi
callq 0x6090
leaq -0x68(%rbp), %rdi
callq 0x4220
leaq -0x40(%rbp), %rdi
callq 0x4220
addq $0x680, %rsp            # imm = 0x680
popq %rbp
retq
leaq -0x368(%rbp), %rdi
callq 0x13400
leaq -0x290(%rbp), %rdi
callq 0x6fd0
leaq -0xa0(%rbp), %rdi
callq 0x6090
leaq -0x68(%rbp), %rdi
callq 0x4220
leaq -0x40(%rbp), %rdi
callq 0x4220
movq -0x4a8(%rbp), %rdi
callq 0x5cf0
movq -0x4b8(%rbp), %rdi
callq 0x6090
movq -0x4c0(%rbp), %rdi
callq 0x4220
movq -0x4b0(%rbp), %rdi
callq 0x4220
movq -0x18(%rbp), %rdi
callq 0x45e0
nop