// File: /workspace/github_cpp_makefile_star2_O2/monikakushwaha28[P]Fiduccia_Matthesys-using-c-/Fiduccia_Mattheyses_v1.0.cpp
// Function: main
int main(int argc, char** argv)
{
	if (argc < 2)
	{
		cout << "missing argument: " << endl;
		cout << "Please provide files in correct format." << endl;
		return 0;
	}
	else if (argc == 2)
	{
		string aux_f, auxline;
		vector<string> aux_val;
		aux_f = argv[1];
		const char* aux_fi = argv[1];
		string node_f;
		string net_f;
		bool is_node = false, is_net = false;
		if (aux_f == "design.aux");
		{
			aux_file.open(aux_fi);
			while (getline(aux_file, auxline))
			{
				aux_val = split(auxline, ' ');
				for (int au = 0; au < aux_val.size(); au++)
				{
					if (aux_val[au] == "design.nodes")
					{
						node_f = aux_val[au];
						is_node = true;
					}
					if (aux_val[au] == "design.nets")
					{
						net_f = aux_val[au];
						is_net = true;
					}
					if (is_node && is_net)
					{
						break;
					}
				}
			}
		}
		if (is_node && is_net)
		{
			//Fetching Data from Nodes file;
			node_file.open(node_f.c_str());
			while (getline(node_file, nodeline))
			{
				sep_node = split(nodeline, ' ');
				node_type = sep_node[1];
				sep_node2 = split(sep_node[0], '_');
				istringstream(sep_node2[1]) >> instance;
				free_nodes.push_back(instance);

				if (node_type == "FDRE") weight = 5;
				else if (node_type == "LUT6") weight = 7;
				else if (node_type == "LUT5") weight = 6;
				else if (node_type == "LUT4") weight = 5;
				else if (node_type == "LUT3") weight = 4;
				else if (node_type == "LUT2") weight = 3;
				else if (node_type == "LUT1") weight = 2;
				else if (node_type == "CARRY8") weight = 34;
				else if (node_type == "DSP48E") weight = 429;
				else if (node_type == "RAMB36E2") weight = 379;
				else if (node_type == "BUFGCE") weight = 3;
				else if (node_type == "IBUF") weight = 2;
				else if (node_type == "OBUF") weight = 2;

				if ((part_count % 2) == 0) {
					node_map[instance].push_back(weight);
					node_map[instance].push_back(1);
					wp1 = wp1 + weight;
				}
				else if ((part_count % 2) != 0) {
					node_map[instance].push_back(weight);
					node_map[instance].push_back(-1);
					wpn1 = wpn1 + weight;
				}
				node_map[instance].push_back(0); //pushing back fix;
				part_count++;
			}
			node_file.close();

			//writing into files
			if (part_count == 3336)
			{
				output_f.open("Sain_Kushwaha_output_FPGA-example1_rc1.txt");
				output_f << "Benchmark Name : FPGA-example1" << endl;
				is_benc = true;
			}
			else if (part_count == 542239)
			{
				output_f.open("Sain_Kushwaha_output_FPGA-example2_rc1.txt");
				output_f << "Benchmark Name : FPGA-example2" << endl;
				is_benc = true;
			}
			else if (part_count == 427800)
			{
				output_f.open("Sain_Kushwaha_output_FPGA-example3_rc1.txt");
				output_f << "Benchmark Name : FPGA-example3" << endl;
				is_benc = true;
			}
			else if (part_count == 844184)
			{
				output_f.open("Sain_Kushwaha_output_FPGA-example4_rc1.txt");
				output_f << "Benchmark Name : FPGA-example4" << endl;
				is_benc = true;
			}

			net_file.open(net_f.c_str());
			while (getline(net_file, netline))
			{
				count1 = 0;
				countn1 = 0;
				if (netline.substr(0, 3) == "net")
				{
					int a = 0;
					while (netline.substr(a + 4, 1) != " ")
					{
						a = a++;
					}
					netname = netline.substr(4, a);   //NET is HERE.
					getline(net_file, net_nodeline);

					while (net_nodeline.substr(0, 6) != "endnet")
					{
						int b = 0;
						while (net_nodeline.substr(b + 1, 1) != " ")
						{
							b = b++;
						}
						sep_node = split(net_nodeline.substr(1, b), '_');  //NODE is HERE.
						istringstream(sep_node[1]) >> nodename;
						node_net_map[nodename].push_back(netname);
						net_node_map[netname].push_back(nodename);

						if (node_map[nodename][1] == 1)
						{
							count1 = count1 + 1;
						}
						else
						{
							countn1 = countn1 + 1;
						}

						getline(net_file, net_nodeline);
					}
					net_card[netname].push_back(count1);
					net_card[netname].push_back(countn1);
				}
			}
			net_file.close();

			//Removing Duplicates
			for (net_nodeiter iter = node_net_map.begin(); iter != node_net_map.end(); iter++)
			{
				node_net_map[iter->first].erase(unique(node_net_map[iter->first].begin(), node_net_map[iter->first].end()), node_net_map[iter->first].end());
			}

			//Initial Gain Bucket Calculation
			for (int i = 0; i < free_nodes.size(); i++)
			{
				int current_node = free_nodes[i];
				gain = 0;
				for (int var = 0; var < node_net_map[current_node].size(); var++)
				{
					current_net = node_net_map[current_node].at(var);
					net_count1 = net_card[current_net].at(0);
					net_countn1 = net_card[current_net].at(1);
					current_part = node_map[current_node].at(1);
					if (current_part == 1)
					{
						if (net_count1 == 1)
						{
							gain = gain + 1;
						}
						else if (net_countn1 == 0)
						{
							gain = gain - 1;
						}
					}
					else
					{
						if (net_count1 == 0)
						{
							gain = gain - 1;
						}
						else if (net_countn1 == 1)
						{
							gain = gain + 1;
						}
					}
				}
				gain_bucket[gain].push_back(current_node);
				node_map[current_node].push_back(gain);
			}


			//Initial Cutset 
			for (netcarditer a = net_card.begin(); a != net_card.end(); a++)
			{
				if ((net_card[a->first][0] != 0) && (net_card[a->first][1] != 0))
				{
					cutset = cutset + 1;
					initial_cutset = cutset;
				}
			}

			for (fg = 1; fg < 9; fg++)
			{
				cutset = cutset_cal(cutset);
			}
		}
	}

	end:int stop_s = clock(); //Timing of code ends here

	int time_ms = (stop_s - start_s) / double(CLOCKS_PER_SEC) * 1000;
	int time_hours = (time_ms) / (1000 * 60 * 60);
	int time_minutes = (time_ms - time_hours * (60 * 60 * 1000)) / (1000 * 60);
	int time_seconds = (time_ms - time_minutes * (1000 * 60)) / (1000);
	cout << "Execution Time:" << endl;
	cout << "HH: " << time_hours << " MM: " << time_minutes << " SS: " << time_seconds << endl; //Printing out total execution time.
	cout << "Execution Time: " << time_ms << endl;

	if (is_benc)
	{
		output_f << "Execution Time: " << " HH: " << time_hours << " MM: " << time_minutes << " SS: " << time_seconds << endl;
		output_f << "Starting Cut: " << initial_cutset << endl;
		output_f << "Final Cut: " << cutset << endl;
		output_f << "Percentage Change: " << (((initial_cutset - cutset) / initial_cutset) * 100) << "%" << endl;
		output_f << "Ratio Cut: " << (wp1 / wpn1) << endl;
	}

	output_f.close();
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
cmpl $0x1, %edi
jg 0x40ad
movq 0x5f56(%rip), %rbx      # 0x9fd0
leaq 0x2fbf(%rip), %rsi      # 0x7040
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
leaq 0x2fbb(%rip), %rsi      # 0x7053
movq %rbx, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
jmp 0x4e35
cmpl $0x2, %edi
jne 0x4bf9
movq %rsi, %rbx
leaq -0xb8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
leaq -0x58(%rbp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
andq $0x0, -0x30(%rbp)
movq 0x8(%rsi), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x2300
movq 0x8(%rbx), %rbx
leaq -0x98(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x78(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x2f55(%rip), %rsi      # 0x707b
leaq -0xc8(%rbp), %rdi
callq 0x5122
leaq 0x648f(%rip), %rdi      # 0xa5c8
pushq $0x8
popq %rdx
movq %rbx, %rsi
callq 0x2130
xorl %r12d, %r12d
leaq -0x68(%rbp), %r15
leaq -0xe8(%rbp), %r13
leaq 0x2f3a(%rip), %r14      # 0x7093
xorl %ebx, %ebx
leaq 0x6466(%rip), %rdi      # 0xa5c8
movq %r15, %rsi
callq 0x2060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4247
movq %r13, %rdi
movq %r15, %rsi
callq 0x2230
leaq -0x2c8(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
pushq $0x20
popq %rdx
callq 0x283c
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x642a
movq %r15, %rdi
callq 0x4f10
movq %r13, %rdi
callq 0x2318
xorl %r15d, %r15d
xorl %r13d, %r13d
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %r13, %rax
jbe 0x4237
addq %r15, %rdi
leaq 0x2eaa(%rip), %rsi      # 0x7086
callq 0x5122
testb %al, %al
je 0x41fa
movq -0x40(%rbp), %rsi
addq %r15, %rsi
movb $0x1, %bl
leaq -0xa8(%rbp), %rdi
callq 0x2100
movq -0x40(%rbp), %rdi
addq %r15, %rdi
movq %r14, %rsi
callq 0x5122
testb %al, %al
je 0x4223
movq -0x40(%rbp), %rsi
addq %r15, %rsi
movb $0x1, %r12b
leaq -0x88(%rbp), %rdi
callq 0x2100
testb $0x1, %bl
je 0x422e
testb $0x1, %r12b
jne 0x4237
incq %r13
addq $0x20, %r15
jmp 0x41be
leaq -0x68(%rbp), %r15
leaq -0xe8(%rbp), %r13
jmp 0x415b
testb $0x1, %bl
je 0x4bc3
testb $0x1, %r12b
je 0x4bc3
movq -0xa8(%rbp), %rsi
leaq 0x5f50(%rip), %rdi      # 0xa1b8
pushq $0x8
popq %rdx
callq 0x2130
leaq -0x2c8(%rbp), %r12
leaq -0x128(%rbp), %rbx
leaq 0x684b(%rip), %r14      # 0xaad0
leaq 0x691c(%rip), %r15      # 0xaba8
leaq 0x5f25(%rip), %rdi      # 0xa1b8
leaq 0x6736(%rip), %rsi      # 0xa9d0
callq 0x2060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x45bd
leaq -0x148(%rbp), %r13
movq %r13, %rdi
leaq 0x670e(%rip), %rsi      # 0xa9d0
callq 0x2230
movq %r12, %rdi
movq %r13, %rsi
pushq $0x20
popq %rdx
callq 0x283c
leaq 0x689c(%rip), %rdi      # 0xab78
movq %r12, %rsi
callq 0x642a
movq %r12, %rdi
callq 0x4f10
movq %r13, %rdi
callq 0x2318
movq 0x687d(%rip), %rsi      # 0xab78
addq $0x20, %rsi
leaq 0x66ea(%rip), %rdi      # 0xa9f0
callq 0x2100
movq 0x6866(%rip), %rsi      # 0xab78
movq %rbx, %rdi
callq 0x2230
movq %r12, %rdi
movq %rbx, %rsi
pushq $0x5f
popq %rdx
callq 0x283c
leaq 0x6861(%rip), %rdi      # 0xab90
movq %r12, %rsi
callq 0x642a
movq %r12, %rdi
callq 0x4f10
movq %rbx, %rdi
callq 0x2318
movq 0x6842(%rip), %rsi      # 0xab90
addq $0x20, %rsi
movq %r12, %rdi
pushq $0x8
popq %rdx
callq 0x22b0
movq %r12, %rdi
movq %r14, %rsi
callq 0x2120
movq %r12, %rdi
callq 0x20d0
leaq 0x6921(%rip), %rdi      # 0xac98
movq %r14, %rsi
callq 0x505c
leaq 0x666a(%rip), %rdi      # 0xa9f0
leaq 0x2d12(%rip), %rsi      # 0x709f
callq 0x5122
pushq $0x5
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x664c(%rip), %rdi      # 0xa9f0
leaq 0x2cf9(%rip), %rsi      # 0x70a4
callq 0x5122
pushq $0x7
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x662e(%rip), %rdi      # 0xa9f0
leaq 0x2ce0(%rip), %rsi      # 0x70a9
callq 0x5122
pushq $0x6
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x6610(%rip), %rdi      # 0xa9f0
leaq 0x2cc7(%rip), %rsi      # 0x70ae
callq 0x5122
pushq $0x5
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x65f2(%rip), %rdi      # 0xa9f0
leaq 0x2cae(%rip), %rsi      # 0x70b3
callq 0x5122
pushq $0x4
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x65d4(%rip), %rdi      # 0xa9f0
leaq 0x2c95(%rip), %rsi      # 0x70b8
callq 0x5122
pushq $0x3
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x65b6(%rip), %rdi      # 0xa9f0
leaq 0x2c7c(%rip), %rsi      # 0x70bd
callq 0x5122
pushq $0x2
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x6598(%rip), %rdi      # 0xa9f0
leaq 0x2c63(%rip), %rsi      # 0x70c2
callq 0x5122
pushq $0x22
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x657a(%rip), %rdi      # 0xa9f0
leaq 0x2c4c(%rip), %rsi      # 0x70c9
callq 0x5122
movl $0x1ad, %ecx            # imm = 0x1AD
testb %al, %al
jne 0x44f5
leaq 0x655e(%rip), %rdi      # 0xa9f0
leaq 0x2c37(%rip), %rsi      # 0x70d0
callq 0x5122
movl $0x17b, %ecx            # imm = 0x17B
testb %al, %al
jne 0x44f5
leaq 0x6542(%rip), %rdi      # 0xa9f0
leaq 0x2c24(%rip), %rsi      # 0x70d9
callq 0x5122
pushq $0x3
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x6528(%rip), %rdi      # 0xa9f0
leaq 0x2c11(%rip), %rsi      # 0x70e0
callq 0x5122
pushq $0x2
popq %rcx
testb %al, %al
jne 0x44f5
leaq 0x650e(%rip), %rdi      # 0xa9f0
leaq 0x2bfc(%rip), %rsi      # 0x70e5
callq 0x5122
pushq $0x2
popq %rcx
testb %al, %al
je 0x44fb
movl %ecx, 0x65d9(%rip)      # 0xaad4
testb $0x1, 0x65d6(%rip)      # 0xaad8
jne 0x4547
movq %r15, %rdi
movq %r14, %rsi
callq 0x4fa0
movq %rax, %rdi
leaq 0x65bb(%rip), %rsi      # 0xaad4
callq 0x505c
movq %r15, %rdi
movq %r14, %rsi
callq 0x4fa0
movl $0x1, -0x2c8(%rbp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x6496
leaq 0x65b3(%rip), %rax      # 0xaaf8
jmp 0x4585
movq %r15, %rdi
movq %r14, %rsi
callq 0x4fa0
movq %rax, %rdi
leaq 0x6578(%rip), %rsi      # 0xaad4
callq 0x505c
movq %r15, %rdi
movq %r14, %rsi
callq 0x4fa0
orl $-0x1, -0x2c8(%rbp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x6496
leaq 0x6577(%rip), %rax      # 0xaafc
cvtsi2ssl 0x6547(%rip), %xmm0 # 0xaad4
addss (%rax), %xmm0
movss %xmm0, (%rax)
movq %r15, %rdi
movq %r14, %rsi
callq 0x4fa0
andl $0x0, -0x2c8(%rbp)
movq %rax, %rdi
movq %r12, %rsi
callq 0x6496
incl 0x6520(%rip)            # 0xaad8
jmp 0x428c
leaq 0x5bf4(%rip), %rdi      # 0xa1b8
callq 0x2070
movl 0x6509(%rip), %eax      # 0xaad8
cmpl $0xce198, %eax          # imm = 0xCE198
je 0x464c
cmpl $0x68718, %eax          # imm = 0x68718
je 0x460e
cmpl $0x8461f, %eax          # imm = 0x8461F
je 0x462d
cmpl $0xd08, %eax            # imm = 0xD08
jne 0x4684
leaq 0x61da(%rip), %rdi      # 0xa7d0
leaq 0x2aed(%rip), %rsi      # 0x70ea
pushq $0x10
popq %rdx
callq 0x2040
leaq 0x2b09(%rip), %rsi      # 0x7115
jmp 0x4669
leaq 0x61bb(%rip), %rdi      # 0xa7d0
leaq 0x2b62(%rip), %rsi      # 0x717e
pushq $0x10
popq %rdx
callq 0x2040
leaq 0x2b7e(%rip), %rsi      # 0x71a9
jmp 0x4669
leaq 0x619c(%rip), %rdi      # 0xa7d0
leaq 0x2af9(%rip), %rsi      # 0x7134
pushq $0x10
popq %rdx
callq 0x2040
leaq 0x2b15(%rip), %rsi      # 0x715f
jmp 0x4669
leaq 0x617d(%rip), %rdi      # 0xa7d0
leaq 0x2b6e(%rip), %rsi      # 0x71c8
pushq $0x10
popq %rdx
callq 0x2040
leaq 0x2b8a(%rip), %rsi      # 0x71f3
leaq 0x6160(%rip), %rdi      # 0xa7d0
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
movb $0x1, 0x64f2(%rip)      # 0xab76
movq -0x88(%rbp), %rsi
leaq 0x5d2e(%rip), %rdi      # 0xa3c0
pushq $0x8
popq %rdx
callq 0x2130
leaq -0x2c8(%rbp), %r15
pushq $0x1
popq %r13
leaq 0x6384(%rip), %r14      # 0xaa30
leaq -0x108(%rbp), %r12
leaq 0x5d06(%rip), %rdi      # 0xa3c0
leaq 0x634f(%rip), %rsi      # 0xaa10
callq 0x2060
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x491d
andl $0x0, 0x6401(%rip)      # 0xaae0
andl $0x0, 0x63fe(%rip)      # 0xaae4
movq %r15, %rdi
leaq 0x6320(%rip), %rsi      # 0xaa10
xorl %edx, %edx
pushq $0x3
popq %rcx
callq 0x21d0
movq %r15, %rdi
leaq 0x2b11(%rip), %rsi      # 0x7215
callq 0x5122
movl %eax, %ebx
movq %r15, %rdi
callq 0x2318
testb %bl, %bl
je 0x46b3
movq %r15, %rdi
leaq 0x62ef(%rip), %rsi      # 0xaa10
pushq $0x4
popq %rdx
movq %r13, %rcx
callq 0x21d0
movq %r15, %rdi
leaq 0x2b14(%rip), %rsi      # 0x724a
callq 0x5132
movl %eax, %ebx
movq %r15, %rdi
callq 0x2318
testb %bl, %bl
jne 0x4717
movq %r15, %rdi
leaq 0x62bd(%rip), %rsi      # 0xaa10
pushq $0x4
popq %rdx
xorl %ecx, %ecx
callq 0x21d0
leaq 0x62ec(%rip), %rdi      # 0xaa50
movq %r15, %rsi
callq 0x2210
movq %r15, %rdi
callq 0x2318
leaq 0x5c45(%rip), %rdi      # 0xa3c0
movq %r14, %rsi
callq 0x2060
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
pushq $0x6
popq %rcx
callq 0x21d0
movq %r15, %rdi
leaq 0x2a75(%rip), %rsi      # 0x7212
callq 0x5132
movl %eax, %ebx
movq %r15, %rdi
callq 0x2318
testb %bl, %bl
je 0x48d4
movq %r15, %rdi
movq %r14, %rsi
movq %r13, %rdx
movq %r13, %rcx
callq 0x21d0
movq %r15, %rdi
leaq 0x2a7b(%rip), %rsi      # 0x724a
callq 0x5132
movl %eax, %ebx
movq %r15, %rdi
callq 0x2318
testb %bl, %bl
jne 0x47b4
movq %r12, %rbx
movq %r12, %rdi
movq %r14, %rsi
movq %r13, %rdx
xorl %ecx, %ecx
callq 0x21d0
movq %r15, %rdi
movq %rbx, %rsi
pushq $0x5f
popq %rdx
callq 0x283c
leaq 0x636e(%rip), %rdi      # 0xab78
movq %r15, %rsi
callq 0x642a
movq %r15, %rdi
callq 0x4f10
movq %rbx, %rdi
callq 0x2318
movq 0x634f(%rip), %rsi      # 0xab78
addq $0x20, %rsi
movq %r15, %rdi
pushq $0x8
popq %rdx
callq 0x22b0
movq %r15, %rdi
leaq 0x629a(%rip), %rbx      # 0xaadc
movq %rbx, %rsi
callq 0x2120
movq %r15, %rdi
callq 0x20d0
leaq 0x637f(%rip), %rdi      # 0xabd8
movq %rbx, %rsi
callq 0x50a4
movq %rax, %rdi
leaq 0x61e5(%rip), %rsi      # 0xaa50
callq 0x4f64
leaq 0x6391(%rip), %rdi      # 0xac08
leaq 0x61d2(%rip), %rsi      # 0xaa50
callq 0x4ff2
movq %rax, %rdi
leaq 0x624f(%rip), %rsi      # 0xaadc
callq 0x505c
leaq 0x630f(%rip), %rdi      # 0xaba8
leaq 0x623c(%rip), %rsi      # 0xaadc
callq 0x4fa0
movq (%rax), %rax
cmpl $0x1, 0x4(%rax)
leaq 0x6231(%rip), %rax      # 0xaae4
leaq 0x6226(%rip), %rcx      # 0xaae0
cmoveq %rcx, %rax
incl (%rax)
leaq 0x5af9(%rip), %rdi      # 0xa3c0
movq %r14, %rsi
callq 0x2060
jmp 0x4783
leaq 0x638d(%rip), %rdi      # 0xac68
leaq 0x616e(%rip), %rsi      # 0xaa50
callq 0x4ff2
movq %rax, %rdi
leaq 0x61ef(%rip), %rsi      # 0xaae0
callq 0x505c
leaq 0x636b(%rip), %rdi      # 0xac68
leaq 0x614c(%rip), %rsi      # 0xaa50
callq 0x4ff2
movq %rax, %rdi
leaq 0x61d1(%rip), %rsi      # 0xaae4
callq 0x505c
jmp 0x46b3
leaq 0x5a9c(%rip), %rdi      # 0xa3c0
callq 0x2070
movq 0x62c0(%rip), %r14      # 0xabf0
leaq 0x62a1(%rip), %rbx      # 0xabd8
leaq 0x62a2(%rip), %rax      # 0xabe0
cmpq %rax, %r14
je 0x49a4
leaq 0x20(%r14), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x50a4
movq %rax, %r15
movq %rbx, %rdi
movq %r12, %rsi
callq 0x50a4
movq (%rax), %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0x50a4
movq 0x8(%rax), %rsi
movq %r13, %rdi
callq 0x659e
movq %rax, %r13
movq %rbx, %rdi
movq %r12, %rsi
callq 0x50a4
movq 0x8(%rax), %rdx
movq %r15, %rdi
movq %r13, %rsi
callq 0x5140
movq %r14, %rdi
callq 0x2150
movq %rax, %r14
jmp 0x4937
xorl %edx, %edx
leaq 0x622b(%rip), %rbx      # 0xabd8
leaq -0x2c8(%rbp), %r14
leaq 0x60b5(%rip), %r15      # 0xaa70
pushq $0x1
popq %r13
movq 0x62da(%rip), %rcx      # 0xaca0
movq 0x62cb(%rip), %rax      # 0xac98
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
jbe 0x4b20
movq %rdx, -0x48(%rbp)
movl (%rax,%rdx,4), %eax
movl %eax, -0x2c8(%rbp)
andl $0x0, 0x612b(%rip)      # 0xab1c
xorl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50a4
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x5, %rcx
cmpq %r12, %rcx
jbe 0x4ad8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x50a4
movq %rax, %rdi
movq %r12, %rsi
callq 0x50f6
movq %r15, %rdi
movq %rax, %rsi
callq 0x2100
leaq 0x622d(%rip), %rdi      # 0xac68
movq %r15, %rsi
callq 0x4ff2
movq %rax, %rdi
xorl %esi, %esi
callq 0x5082
movl (%rax), %eax
movl %eax, 0x60bf(%rip)      # 0xab14
leaq 0x620c(%rip), %rdi      # 0xac68
movq %r15, %rsi
callq 0x4ff2
movq %rax, %rdi
movq %r13, %rsi
callq 0x5082
movl (%rax), %eax
movl %eax, 0x60a1(%rip)      # 0xab18
leaq 0x612a(%rip), %rdi      # 0xaba8
movq %r14, %rsi
callq 0x4fa0
movq %rax, %rdi
movq %r13, %rsi
callq 0x5082
movl (%rax), %eax
movl %eax, 0x6077(%rip)      # 0xab10
movl 0x6075(%rip), %ecx      # 0xab14
cmpl $0x1, %eax
jne 0x4ab7
pushq $0x1
popq %rax
cmpl $0x1, %ecx
je 0x4aca
cmpl $0x0, 0x6065(%rip)      # 0xab18
pushq $-0x1
jmp 0x4ac7
pushq $-0x1
popq %rax
testl %ecx, %ecx
je 0x4aca
cmpl $0x1, 0x6053(%rip)      # 0xab18
pushq $0x1
popq %rax
jne 0x4ad0
addl %eax, 0x604c(%rip)      # 0xab1c
incq %r12
jmp 0x49f4
leaq 0x6159(%rip), %rdi      # 0xac38
leaq 0x6036(%rip), %rsi      # 0xab1c
callq 0x4fa0
movq %rax, %rdi
movq %r14, %rsi
callq 0x505c
leaq 0x60ab(%rip), %rdi      # 0xaba8
movq %r14, %rsi
callq 0x4fa0
movq %rax, %rdi
leaq 0x600d(%rip), %rsi      # 0xab1c
callq 0x505c
movq -0x48(%rbp), %rdx
incq %rdx
jmp 0x49bf
movq 0x6159(%rip), %r14      # 0xac80
leaq 0x6142(%rip), %r12      # 0xac70
leaq 0x6133(%rip), %rbx      # 0xac68
cmpq %r12, %r14
je 0x4b92
leaq 0x20(%r14), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4ff2
movq (%rax), %rax
cmpl $0x0, (%rax)
je 0x4b85
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4ff2
movq (%rax), %rax
cmpl $0x0, 0x4(%rax)
je 0x4b85
movss 0x5f87(%rip), %xmm0     # 0xaaf4
addss 0x24ab(%rip), %xmm0     # 0x7020
movss %xmm0, 0x5f77(%rip)     # 0xaaf4
movss %xmm0, 0x5f6b(%rip)     # 0xaaf0
movq %r14, %rdi
callq 0x2150
movq %rax, %r14
jmp 0x4b35
pushq $0x1
popq %rax
movl %eax, 0x55fd(%rip)      # 0xa198
cmpl $0x8, %eax
jg 0x4bc3
cvttss2si 0x5f4c(%rip), %edi # 0xaaf4
callq 0x3c50
cvtsi2ss %eax, %xmm0
movss %xmm0, 0x5f3b(%rip)     # 0xaaf4
movl 0x55d9(%rip), %eax      # 0xa198
incl %eax
jmp 0x4b95
leaq -0x88(%rbp), %rdi
callq 0x2318
leaq -0xa8(%rbp), %rdi
callq 0x2318
leaq -0x40(%rbp), %rdi
callq 0x4f10
leaq -0x68(%rbp), %rdi
callq 0x2318
leaq -0xc8(%rbp), %rdi
callq 0x2318
callq 0x2140
subl 0x55b0(%rip), %eax      # 0xa1b4
cvtsi2sd %eax, %xmm0
divsd 0x2400(%rip), %xmm0     # 0x7010
mulsd 0x2400(%rip), %xmm0     # 0x7018
cvttsd2si %xmm0, %r15d
movl $0x36ee80, %ecx         # imm = 0x36EE80
movl %r15d, %eax
cltd
idivl %ecx
movl %eax, %r12d
imull $0xffc91180, %eax, %eax # imm = 0xFFC91180
addl %r15d, %eax
movl $0xea60, %ecx           # imm = 0xEA60
cltd
idivl %ecx
movl %eax, %r14d
imull $0xffff15a0, %eax, %eax # imm = 0xFFFF15A0
addl %r15d, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cltd
idivl %ecx
movl %eax, %ebx
movq 0x5377(%rip), %r13      # 0x9fd0
leaq 0x25b9(%rip), %rsi      # 0x7219
movq %r13, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
leaq 0x25d0(%rip), %rsi      # 0x7247
movq %r13, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r12d, %esi
callq 0x22d0
leaq 0x2598(%rip), %rsi      # 0x7229
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r14d, %esi
callq 0x22d0
leaq 0x2584(%rip), %rsi      # 0x722f
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %ebx, %esi
callq 0x22d0
movq %rax, %rdi
callq 0x20e0
leaq 0x2569(%rip), %rsi      # 0x7235
movq %r13, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r15d, %esi
callq 0x22d0
movq %rax, %rdi
callq 0x20e0
cmpb $0x1, 0x5e88(%rip)      # 0xab76
jne 0x4e29
leaq 0x5ad5(%rip), %r15      # 0xa7d0
leaq 0x2533(%rip), %rsi      # 0x7235
movq %r15, %rdi
callq 0x21a0
leaq 0x2535(%rip), %rsi      # 0x7246
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r12d, %esi
callq 0x22d0
leaq 0x24fe(%rip), %rsi      # 0x7229
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %r14d, %esi
callq 0x22d0
leaq 0x24ea(%rip), %rsi      # 0x722f
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
movl %ebx, %esi
callq 0x22d0
movq %rax, %rdi
callq 0x20e0
leaq 0x24e6(%rip), %rsi      # 0x724c
movq %r15, %rdi
callq 0x21a0
movss 0x5d7a(%rip), %xmm0     # 0xaaf0
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20e0
leaq 0x24ce(%rip), %rsi      # 0x725b
movq %r15, %rdi
callq 0x21a0
movss 0x5d57(%rip), %xmm0     # 0xaaf4
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20e0
leaq 0x24b3(%rip), %rsi      # 0x7267
movq %r15, %rdi
callq 0x21a0
movss 0x5d2c(%rip), %xmm1     # 0xaaf0
movaps %xmm1, %xmm0
subss 0x5d25(%rip), %xmm0     # 0xaaf4
divss %xmm1, %xmm0
mulss 0x2249(%rip), %xmm0     # 0x7024
movq %rax, %rdi
callq 0x2160
leaq 0x2491(%rip), %rsi      # 0x727b
movq %rax, %rdi
callq 0x21a0
movq %rax, %rdi
callq 0x20e0
leaq 0x247c(%rip), %rsi      # 0x727d
movq %r15, %rdi
callq 0x21a0
movss 0x5ce7(%rip), %xmm0     # 0xaaf8
divss 0x5ce3(%rip), %xmm0     # 0xaafc
movq %rax, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20e0
leaq 0x59a0(%rip), %rdi      # 0xa7d0
callq 0x2240
xorl %eax, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4eea
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4e9f
movq %rax, %rbx
leaq -0x128(%rbp), %rdi
jmp 0x4ebe
jmp 0x4ecf
movq %rax, %rbx
leaq -0x148(%rbp), %rdi
jmp 0x4ebe
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
movq %rax, %rbx
leaq -0xe8(%rbp), %rdi
jmp 0x4ebe
jmp 0x4ecf
jmp 0x4ecf
movq %rax, %rbx
leaq -0x2c8(%rbp), %rdi
callq 0x20d0
jmp 0x4ed2
jmp 0x4ecf
jmp 0x4ecf
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x2318
jmp 0x4ed2
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
jmp 0x4ecf
movq %rax, %rbx
leaq -0x88(%rbp), %rdi
callq 0x2318
leaq -0xa8(%rbp), %rdi
callq 0x2318
leaq -0x40(%rbp), %rdi
callq 0x4f10
leaq -0x68(%rbp), %rdi
callq 0x2318
leaq -0xc8(%rbp), %rdi
callq 0x2318
movq %rbx, %rdi
callq 0x22e0