// File: /workspace/github_cpp_makefile_star2_O3/Windfisch[P]production-flow/read_factory.cpp
// Function: read_factory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Factory read_factory(string file)
{
	ifstream f(file);
	if (!f.good())
		throw runtime_error("could not open file '"+file+"'");
	
	Factory factory;
	string line;

	// parse facilities
	while (getline(f, line))
	{
		if (line == "#") break;

		size_t p1 = line.find(' ');
		if (p1 == string::npos)
			throw runtime_error("invalid format");
	
		if (p1 == line.length()-1)
		{
			vector<Factory::FacilityConfiguration> upgrade_plan;
			Factory::FacilityConfiguration conf;
			upgrade_plan.push_back(conf); // push an empty configuration. this is a splitter node

			factory.facilities.emplace_back(upgrade_plan);
		}
		else
		{
			size_t p2 = line.find(' ', p1+1);
			if (p2 == string::npos)
				throw runtime_error("invalid format");

			size_t p3 = line.find('/', p2+1);
			if (p3 == string::npos)
				throw runtime_error("invalid format");

			string recipe = line.substr(p1+1, p2-p1-1);
			double current = stod(line.substr(p2+1, p3-p2-1));
			double maximum = stod(line.substr(p3+1));

			cout << "recipe '" << recipe << "' with " << current << "/" << maximum << endl;

			vector<Factory::FacilityConfiguration> upgrade_plan;
			
			for (int i=0; i<5; i++)
			{
				Factory::FacilityConfiguration conf;
				
				for (auto iter : recipes.at(recipe))
					conf.production_or_consumption[iter.first] = int(SCALING_FACTOR * iter.second * (current + (maximum-current)*i/5.));
				upgrade_plan.push_back(conf);
			}

			factory.facilities.emplace_back(upgrade_plan);
		}
	}

	if (line != "#")
		throw runtime_error("invalid format: could not find edge list");

	while (getline(f, line))
	{
		size_t p1 = line.find(' ');
		if (p1 == string::npos)
			throw runtime_error("invalid format");
		size_t p2 = line.find(' ',p1+1);
		if (p2 == string::npos)
			throw runtime_error("invalid format");
		size_t p3 = line.find(' ',p2+1);
		if (p3 == string::npos)
			throw runtime_error("invalid format");

		int from = stoi(line.substr(0, p1));
		int to = stoi(line.substr(p1+1,p2-p1-1));
		string item = line.substr(p2+1,p3-p2-1);
		string dist_x = line.substr(p3+1);

		bool exists = (dist_x.substr(dist_x.length()-1) != "x");
		double dist = stod(dist_x);

		cout << "transport of " << item << " " << from << "->" << to << ", distance " << dist << " (line exists=" << exists << ")" << endl;

		vector<Factory::TransportLineConfiguration> upgrade_plan;

		upgrade_plan.emplace_back(Factory::TransportLineConfiguration{int(SCALING_FACTOR * 1*13.3), dist}); // one yellow
		upgrade_plan.emplace_back(Factory::TransportLineConfiguration{int(SCALING_FACTOR * 2*13.3), dist}); // two yellow
		upgrade_plan.emplace_back(Factory::TransportLineConfiguration{int(SCALING_FACTOR * 3*13.3), 4*dist}); // red+yellow
		upgrade_plan.emplace_back(Factory::TransportLineConfiguration{int(SCALING_FACTOR * 4*13.3), 4*dist}); // red+red
		upgrade_plan.emplace_back(Factory::TransportLineConfiguration{int(SCALING_FACTOR * 5*13.3), 15*dist}); // blue+red
		upgrade_plan.emplace_back(Factory::TransportLineConfiguration{int(SCALING_FACTOR * 6*13.3), 15*dist}); // blue+blue

		factory.transport_lines.emplace_back(item_lookup.at(item), from-1, to-1, upgrade_plan);
	}

	return factory;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rsi, %rbx
movq %rdi, %r12
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x3390
movq (%r14), %rax
movq -0x18(%rax), %r15
cmpl $0x0, 0x100(%rsp,%r15)
jne 0xbc63
movl $0x90, %edx
movq %r12, 0xa0(%rsp)
movq %r12, %rdi
xorl %esi, %esi
callq 0x3150
leaq 0xc0(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xe0(%rsp), %r13
leaq 0x80(%rsp), %rbp
leaq 0x48(%rsp), %r12
leaq 0x10(%rsp), %r14
leaq (%rsp,%r15), %rdi
addq $0xe0, %rdi
movl $0xa, %esi
callq 0x3220
leaq 0xb0(%rsp), %r15
movsbl %al, %edx
movq %r13, %rdi
movq %r15, %rsi
callq 0x3420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xb405
movq %r15, %rdi
leaq 0x49cb(%rip), %rsi      # 0xf9b0
callq 0x30a0
testl %eax, %eax
je 0xb405
movq %r15, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x32d0
cmpq $-0x1, %rax
je 0xbb8e
movq %rax, %rbx
movq 0xb8(%rsp), %rax
decq %rax
cmpq %rax, %rbx
jne 0xb086
xorpd %xmm0, %xmm0
movapd %xmm0, 0x80(%rsp)
xorl %eax, %eax
movq %rax, 0x90(%rsp)
movl $0x0, 0x50(%rsp)
movq %rax, 0x58(%rsp)
leaq 0x50(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
movq %rbp, %rdi
movq %r12, %rsi
callq 0xc578
movq 0xa0(%rsp), %rdi
movq %rbp, %rsi
callq 0xc5c2
movq %r12, %rdi
callq 0x4f46
movq %rbp, %rdi
callq 0x4eae
jmp 0xb3f4
leaq 0x1(%rbx), %rbp
movq %r15, %rdi
movl $0x20, %esi
movq %rbp, %rdx
callq 0x32d0
cmpq $-0x1, %rax
je 0xbbc5
movq %r15, %rdi
movq %rax, %r15
leaq 0x1(%rax), %r13
movl $0x2f, %esi
movq %r13, %rdx
callq 0x32d0
movq %rax, 0x8(%rsp)
cmpq $-0x1, %rax
je 0xbc14
notq %rbx
addq %r15, %rbx
leaq 0x80(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
movq %rbp, %rdx
movq %rbx, %rcx
callq 0x3260
notq %r15
addq 0x8(%rsp), %r15
movq %r12, %rdi
leaq 0xb0(%rsp), %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x3260
movq 0x48(%rsp), %r15
callq 0x3050
movq %rax, %rbx
movl (%rax), %r13d
movl $0x0, (%rax)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x31e0
movsd %xmm0, 0xa8(%rsp)
cmpq %r15, 0x20(%rsp)
leaq 0x80(%rsp), %rbp
je 0xbc08
movl (%rbx), %eax
testl %eax, %eax
leaq 0xb0(%rsp), %r15
je 0xb160
cmpl $0x22, %eax
jne 0xb163
jmp 0xbc4b
movl %r13d, (%rbx)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb17f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x8(%rsp), %rdx
incq %rdx
movq %r12, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x3260
movq 0x48(%rsp), %r15
movl (%rbx), %r13d
movl $0x0, (%rbx)
movq %r15, %rdi
leaq 0x20(%rsp), %rsi
callq 0x31e0
movsd %xmm0, 0x40(%rsp)
cmpq %r15, 0x20(%rsp)
je 0xbbfc
movl (%rbx), %eax
testl %eax, %eax
movq 0x9e00(%rip), %r15      # 0x14fd0
je 0xb1dc
cmpl $0x22, %eax
jne 0xb1df
jmp 0xbc57
movl %r13d, (%rbx)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb1fb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
movl $0x8, %edx
movq %r15, %rdi
leaq 0x47b7(%rip), %rsi      # 0xf9c1
callq 0x3290
leaq 0xe0(%rsp), %r13
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %r15, %rdi
callq 0x3290
movq %rax, %rbx
movl $0x7, %edx
movq %rax, %rdi
leaq 0x4789(%rip), %rsi      # 0xf9ca
callq 0x3290
movq %rbx, %rdi
movsd 0xa8(%rsp), %xmm0
callq 0x3380
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4176(%rip), %rsi      # 0xf3df
callq 0x3290
movq %rbx, %rdi
movsd 0x40(%rsp), %xmm0
callq 0x3380
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31a0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movsd 0x40(%rsp), %xmm0
subsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
xorl %r15d, %r15d
movl $0x0, 0x50(%rsp)
xorl %eax, %eax
movq %rax, 0x58(%rsp)
leaq 0x50(%rsp), %rcx
movq %rcx, 0x60(%rsp)
movq %rcx, 0x68(%rsp)
movq %rax, 0x70(%rsp)
leaq 0x9fb5(%rip), %rdi      # 0x152b0
movq %rbp, %rsi
callq 0xc5fc
movq %rax, %rbx
movq 0x18(%rax), %rbp
addq $0x8, %rbx
cmpq %rbx, %rbp
je 0xb388
xorps %xmm0, %xmm0
cvtsi2sd %r15d, %xmm0
mulsd 0x40(%rsp), %xmm0
divsd 0x4617(%rip), %xmm0     # 0xf940
addsd 0xa8(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
movups 0x20(%rbp), %xmm0
movaps %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %r12, %rdi
movq %r14, %rsi
callq 0xc650
movsd 0x8(%rsp), %xmm0
mulsd 0x45df(%rip), %xmm0     # 0xf948
mulsd 0xd0(%rsp), %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, (%rax)
movq %rbp, %rdi
callq 0x31b0
movq %rax, %rbp
cmpq %rbx, %rax
jne 0xb33b
leaq 0x20(%rsp), %rdi
movq %r12, %rsi
callq 0xc578
movq %r12, %rdi
callq 0x4f46
incl %r15d
cmpl $0x5, %r15d
leaq 0x80(%rsp), %rbp
jne 0xb2d1
movq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0xc5c2
movq %rbx, %rdi
callq 0x4eae
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0xb3f4
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %r15
jmp 0xaf9e
leaq 0x45a4(%rip), %rsi      # 0xf9b0
leaq 0xb0(%rsp), %rdi
callq 0x30a0
testl %eax, %eax
jne 0xbcc0
movq 0xa0(%rsp), %rax
addq $0x18, %rax
movq %rax, 0xa8(%rsp)
leaq 0xb0(%rsp), %r12
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %edx
movq %r13, %rdi
movq %r12, %rsi
callq 0x3420
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0xba55
movq %r12, %rdi
movl $0x20, %esi
xorl %edx, %edx
callq 0x32d0
cmpq $-0x1, %rax
je 0xbaa1
movq %rax, %r14
leaq 0x1(%rax), %r13
movq %r12, %rdi
movl $0x20, %esi
movq %r13, %rdx
callq 0x32d0
cmpq $-0x1, %rax
je 0xbad8
movq %rax, %rbp
leaq 0x1(%rax), %r15
movq %r12, %rdi
movl $0x20, %esi
movq %r15, %rdx
callq 0x32d0
cmpq $-0x1, %rax
je 0xbb0f
movq %rax, %rbx
movq %r13, 0x8(%rsp)
movq %r15, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r14, %rcx
callq 0x3260
movq 0x48(%rsp), %r12
callq 0x3050
movq %rax, %r13
movl (%rax), %r15d
movl $0x0, (%rax)
movq %r12, %rdi
leaq 0x80(%rsp), %rsi
movl $0xa, %edx
callq 0x3300
cmpq %r12, 0x80(%rsp)
je 0xbb46
movq %rax, 0xd0(%rsp)
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0xbb52
movl (%r13), %eax
cmpl $0x22, %eax
je 0xbb52
testl %eax, %eax
leaq 0xb0(%rsp), %r12
jne 0xb567
movl %r15d, (%r13)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb583
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
notq %r14
addq %rbp, %r14
leaq 0x48(%rsp), %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
movq %r14, %rcx
callq 0x3260
movq 0x48(%rsp), %r15
movl (%r13), %r12d
movl $0x0, (%r13)
movq %r15, %rdi
leaq 0x80(%rsp), %rsi
movl $0xa, %edx
callq 0x3300
cmpq %r15, 0x80(%rsp)
je 0xbb5e
movq %rax, %r14
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0xbb6a
movl (%r13), %eax
cmpl $0x22, %eax
je 0xbb6a
testl %eax, %eax
leaq 0x80(%rsp), %r15
jne 0xb60b
movl %r12d, (%r13)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb627
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
notq %rbp
addq %rbx, %rbp
leaq 0x48(%rsp), %rdi
leaq 0xb0(%rsp), %r12
movq %r12, %rsi
movq 0x40(%rsp), %rdx
movq %rbp, %rcx
callq 0x3260
incq %rbx
movq %r15, %rdi
movq %r12, %rsi
movq %rbx, %rdx
movq $-0x1, %rcx
callq 0x3260
movq 0x88(%rsp), %rdx
decq %rdx
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
movq $-0x1, %rcx
callq 0x3260
movq %rbx, %rdi
leaq 0x436d(%rip), %rsi      # 0xf9fb
callq 0x30a0
movl %eax, %ebp
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0xb6b1
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x80(%rsp), %rbx
movl (%r13), %r15d
movl $0x0, (%r13)
movq %rbx, %rdi
leaq 0x20(%rsp), %rsi
callq 0x31e0
movsd %xmm0, 0x8(%rsp)
cmpq %rbx, 0x20(%rsp)
je 0xbb76
movl (%r13), %eax
testl %eax, %eax
je 0xb6f5
cmpl $0x22, %eax
jne 0xb6f9
jmp 0xbb82
movl %r15d, (%r13)
movl $0xd, %edx
movq 0x98cb(%rip), %rbx      # 0x14fd0
movq %rbx, %rdi
leaq 0x42ee(%rip), %rsi      # 0xf9fd
callq 0x3290
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq %rbx, %rdi
callq 0x3290
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3ea2(%rip), %rsi      # 0xf5da
callq 0x3290
movq %rbx, %rdi
movq 0xd0(%rsp), %rsi
callq 0x33f0
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
leaq 0x3a04(%rip), %rsi      # 0xf163
callq 0x3290
movq %rbx, %rdi
movl %r14d, %esi
callq 0x33f0
movq %rax, %rbx
movl $0xb, %edx
movq %rax, %rdi
leaq 0x428a(%rip), %rsi      # 0xfa0b
callq 0x3290
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x3380
movq %rax, %rbx
movl $0xe, %edx
movq %rax, %rdi
leaq 0x4271(%rip), %rsi      # 0xfa17
callq 0x3290
xorl %esi, %esi
testl %ebp, %ebp
setne %sil
movq %rbx, %rdi
callq 0x33d0
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f47(%rip), %rsi      # 0xf714
callq 0x3290
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x31a0
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movl $0x33f4, 0x10(%rsp)     # imm = 0x33F4
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
leaq 0x10(%rsp), %r15
movq %r15, %rdx
callq 0xdc56
movq 0x28(%rsp), %rsi
movl $0x67e8, 0x10(%rsp)     # imm = 0x67E8
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
cmpq 0x30(%rsp), %rsi
leaq 0xe0(%rsp), %r13
je 0xb879
movupd 0x10(%rsp), %xmm0
movupd %xmm0, (%rsi)
movq 0x28(%rsp), %rsi
addq $0x10, %rsi
movq %rsi, 0x28(%rsp)
jmp 0xb889
movq %rbx, %rdi
movq %r15, %rdx
callq 0xdc56
movq 0x28(%rsp), %rsi
movl $0x9bdc, 0x10(%rsp)     # imm = 0x9BDC
movsd 0x8(%rsp), %xmm0
mulsd 0x40b1(%rip), %xmm0     # 0xf950
movsd %xmm0, 0x40(%rsp)
movsd %xmm0, 0x18(%rsp)
cmpq 0x30(%rsp), %rsi
je 0xb8cc
movupd 0x10(%rsp), %xmm0
movupd %xmm0, (%rsi)
movq 0x28(%rsp), %rsi
addq $0x10, %rsi
movq %rsi, 0x28(%rsp)
jmp 0xb8dc
movq %rbx, %rdi
movq %r15, %rdx
callq 0xdc56
movq 0x28(%rsp), %rsi
movl $0xcfd0, 0x10(%rsp)     # imm = 0xCFD0
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
cmpq 0x30(%rsp), %rsi
je 0xb911
movupd 0x10(%rsp), %xmm0
movupd %xmm0, (%rsi)
movq 0x28(%rsp), %rsi
addq $0x10, %rsi
movq %rsi, 0x28(%rsp)
jmp 0xb921
movq %rbx, %rdi
movq %r15, %rdx
callq 0xdc56
movq 0x28(%rsp), %rsi
movl $0x103c4, 0x10(%rsp)    # imm = 0x103C4
movsd 0x8(%rsp), %xmm0
mulsd 0x4021(%rip), %xmm0     # 0xf958
movsd %xmm0, 0x8(%rsp)
movsd %xmm0, 0x18(%rsp)
cmpq 0x30(%rsp), %rsi
je 0xb964
movupd 0x10(%rsp), %xmm0
movupd %xmm0, (%rsi)
movq 0x28(%rsp), %rsi
addq $0x10, %rsi
movq %rsi, 0x28(%rsp)
jmp 0xb974
movq %rbx, %rdi
movq %r15, %rdx
callq 0xdc56
movq 0x28(%rsp), %rsi
movl $0x137b8, 0x10(%rsp)    # imm = 0x137B8
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
cmpq 0x30(%rsp), %rsi
je 0xb9a1
movupd 0x10(%rsp), %xmm0
movupd %xmm0, (%rsi)
addq $0x10, 0x28(%rsp)
jmp 0xb9ac
movq %rbx, %rdi
movq %r15, %rdx
callq 0xdc56
leaq 0x992d(%rip), %rdi      # 0x152e0
leaq 0x48(%rsp), %rsi
callq 0xc740
movq 0xd0(%rsp), %rcx
decl %ecx
movl %ecx, 0x10(%rsp)
decl %r14d
movl %r14d, 0xdc(%rsp)
movq 0xa8(%rsp), %rdi
movq %rax, %rsi
movq %r15, %rdx
leaq 0xdc(%rsp), %rcx
movq %rbx, %r8
callq 0xc6b6
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xba0b
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0xba30
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xb43d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xb43d
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0xba7a
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0xe0(%rsp), %rdi
callq 0x3080
movq 0xa0(%rsp), %rax
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x3efd(%rip), %rsi      # 0xf9b2
movq %rax, %rdi
callq 0x30e0
movq 0x952c(%rip), %rsi      # 0x14ff0
movq 0x94f5(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x33e0
jmp 0xbd3f
movl $0x10, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x3ec6(%rip), %rsi      # 0xf9b2
movq %rax, %rdi
callq 0x30e0
movq 0x94f5(%rip), %rsi      # 0x14ff0
movq 0x94be(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x33e0
jmp 0xbd3f
movl $0x10, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x3e8f(%rip), %rsi      # 0xf9b2
movq %rax, %rdi
callq 0x30e0
movq 0x94be(%rip), %rsi      # 0x14ff0
movq 0x9487(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x33e0
jmp 0xbd3f
leaq 0x3ede(%rip), %rdi      # 0xfa2b
callq 0x3160
leaq 0x3ed2(%rip), %rdi      # 0xfa2b
callq 0x3310
leaq 0x3ec6(%rip), %rdi      # 0xfa2b
callq 0x3160
leaq 0x3eba(%rip), %rdi      # 0xfa2b
callq 0x3310
leaq 0x3ea9(%rip), %rdi      # 0xfa26
callq 0x3160
leaq 0x3e9d(%rip), %rdi      # 0xfa26
callq 0x3310
movl $0x10, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x3e10(%rip), %rsi      # 0xf9b2
movq %rax, %rdi
callq 0x30e0
movq 0x943f(%rip), %rsi      # 0x14ff0
movq 0x9408(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x33e0
jmp 0xbd3f
movl $0x10, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x3dd9(%rip), %rsi      # 0xf9b2
movq %rax, %rdi
callq 0x30e0
movq 0x9408(%rip), %rsi      # 0x14ff0
movq 0x93d1(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x33e0
jmp 0xbd3f
leaq 0x3e23(%rip), %rdi      # 0xfa26
callq 0x3160
leaq 0x3e17(%rip), %rdi      # 0xfa26
callq 0x3160
movl $0x10, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x3d8a(%rip), %rsi      # 0xf9b2
movq %rax, %rdi
callq 0x30e0
movq 0x93b9(%rip), %rsi      # 0x14ff0
movq 0x9382(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x33e0
jmp 0xbd3f
leaq 0x3dd4(%rip), %rdi      # 0xfa26
callq 0x3310
leaq 0x3dc8(%rip), %rdi      # 0xfa26
callq 0x3310
movl $0x10, %edi
callq 0x3120
movq %rax, %r14
leaq 0x3d23(%rip), %rsi      # 0xf99a
leaq 0xb0(%rsp), %rdi
movq %rbx, %rdx
callq 0xc4ef
leaq 0x3d20(%rip), %rsi      # 0xf9ae
leaq 0xb0(%rsp), %rdi
callq 0x3430
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xbcf4
movupd (%rcx), %xmm0
movupd %xmm0, (%r12)
jmp 0xbd01
movl $0x10, %edi
callq 0x3120
movq %rax, %rbx
leaq 0x3cfe(%rip), %rsi      # 0xf9d2
movq %rax, %rdi
callq 0x30e0
movq 0x930d(%rip), %rsi      # 0x14ff0
movq 0x92d6(%rip), %rdx      # 0x14fc0
movq %rbx, %rdi
callq 0x33e0
jmp 0xbd3f
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movb $0x1, %bl
movq %r14, %rdi
callq 0x33a0
xorl %ebx, %ebx
movq 0x92c0(%rip), %rsi      # 0x14ff0
movq 0x9289(%rip), %rdx      # 0x14fc0
movq %r14, %rdi
callq 0x33e0
movq %rax, %rbp
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0xbd59
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbd7a
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3250
testb %bl, %bl
jne 0xbdb6
jmp 0xbf86
movq %rax, %rbp
leaq 0xc0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xbdb6
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xbdb6
jmp 0xbec9
jmp 0xbe5a
movq %rax, %rbp
movq %r14, %rdi
callq 0x31d0
jmp 0xbf86
jmp 0xbec9
jmp 0xbe5a
jmp 0xbec9
jmp 0xbe5a
movq %rax, %rbp
jmp 0xbf25
jmp 0xbed1
jmp 0xbed1
jmp 0xbec9
jmp 0xbec9
jmp 0xbe5a
jmp 0xbdf7
movq %rax, %rbp
cmpl $0x0, (%rbx)
jne 0xbe02
movl %r13d, (%rbx)
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xbf2f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3250
jmp 0xbf2f
jmp 0xbe6e
jmp 0xbe6e
jmp 0xbe6e
jmp 0xbe6e
jmp 0xbe6e
movq %rax, %rbp
leaq 0x48(%rsp), %rdi
callq 0x4f46
leaq 0x80(%rsp), %rdi
callq 0x4eae
jmp 0xbf54
jmp 0xbec9
jmp 0xbe5a
jmp 0xbec9
jmp 0xbe5a
jmp 0xbec9
movq %rax, %rbp
movq %rbx, %rdi
callq 0x31d0
jmp 0xbf54
jmp 0xbe6e
jmp 0xbe6e
movq %rax, %rbp
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0xbedd
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x3250
jmp 0xbedd
jmp 0xbeda
movq %rax, %rbp
jmp 0xbf02
jmp 0xbec9
jmp 0xbec9
jmp 0xbec9
jmp 0xbec9
movq %rax, %rbp
cmpl $0x0, (%r13)
jne 0xbedd
movl %r15d, (%r13)
jmp 0xbedd
movq %rax, %rbp
cmpl $0x0, (%r13)
jne 0xbf02
movl %r12d, (%r13)
jmp 0xbf02
movq %rax, %rbp
cmpl $0x0, (%r13)
jne 0xbf02
movl %r15d, (%r13)
jmp 0xbf02
movq %rax, %rbp
jmp 0xbf54
movq %rax, %rbp
jmp 0xbf2f
jmp 0xbf18
jmp 0xbf18
movq %rax, %rbp
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0xbf02
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xbf54
movq 0x58(%rsp), %rsi
jmp 0xbf4c
movq %rax, %rbp
leaq 0x48(%rsp), %rdi
callq 0x4f46
leaq 0x20(%rsp), %rdi
callq 0x4eae
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0xbf54
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0xbf79
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x3250
movq 0xa0(%rsp), %rdi
callq 0x4cc4
leaq 0xe0(%rsp), %rdi
callq 0x3080
movq %rbp, %rdi
callq 0x3400
nop