// File: /workspace/github_cpp_makefile_star2_O1/SaadBazaz[P]RIP-Protocol-Simulation/ProxyRouter.cpp
// Function: handlePacket(int const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void handlePacket(const int &client, string packet)
{
	auto vec = tokenizeData(packet, '&');
	// for (int i=0; i<vec.size(); i++){
	// 		std::cout<<vec[i]<<std::endl;
	// }


	if (vec[0] == "OK"){
		std::cout<<"Something good happened!"<<std::endl;
		return;
	}
	else if (vec[0] == "BAD"){
		std::cout<<"Oops, something went wrong..."<<std::endl;
		return;
	}


	switch (stoi(vec[0]))
	{
	case UPDATE:
	{
		// cout<<"In UPDATE..."<<endl;
		TableRow table_row(vec[3]);
		// cout<<"Made table_row..."<<endl;
		int index = findRowByFDAndID(client, table_row.identifier);

		if (index < 0)
		{

			// if match not found
			// remove all id = -1 values from table and add new table_row
			for (int i=0; i<table.size(); i++){
				if (table[i].identifier == -1){
					table.erase (table.begin() + i);
					i--;
				}
			} 

			table_row.fd = client;
			if (table_row.hop_count < 0)
			{
				table_row.hop_count = 0;
			}
			
			table.push_back(table_row);
			printTable();
			break;
		}


		if (table_row.identifier >= 0)
		{
			table[index].identifier = table_row.identifier;
		}

		// if (table_row.client_name >= 0){
		// 	table[index].client_name = table_row.client_name;
		// }

		if (table_row.status >= 0)
		{
			table[index].status = table_row.status;
		}

		if (table_row.hop_count >= 0)
		{
			table[index].hop_count = table_row.hop_count;
		}

		if (table_row.type != "")
		{
			table[index].type = table_row.type;
		}

		// if (table_row.in_use >= 0){
		table[index].in_use = table_row.in_use;
		// }

		if (table_row.send_port >= 0)
		{
			table[index].send_port = table_row.send_port;
		}

		if (table_row.receive_port >= 0)
		{
			table[index].receive_port = table_row.receive_port;
		}

		printTable();
		sendTableToAllRouters();

		break;
	}
	case ADD:
		break;

	case DELETE:
		break;

	case TABLE:{

		// auto index_vec = findAllRowsByFD(client);

		auto new_rows = deserialize(vec[3]);		


		// cout<<"New Rows - - - - - "<<endl;
		for (int i=0; i<new_rows.size(); i++){


			new_rows[i].fd = client;

			// cout<<new_rows[i].identifier<<endl;

		}
		// cout<<"- - - - - - - - - - "<<endl;



		// Clean useless data out of new_rows vector
		for (int i=0; i<table.size(); i++)
		{
			for (int j=0; j<new_rows.size(); j++){
				if (table[i] == new_rows[j] 
				or (table[i].fd == client and table[i].identifier == new_rows[j].identifier)
				or (table[i].identifier == new_rows[j].identifier and table[i].hop_count == 0)
				or (new_rows[j].hop_count >= 15)
				//  or new_rows[j].identifier == -1 or new_rows[j].identifier == port
				)

				{
					new_rows.erase(new_rows.begin() + j);
					j--;	
				}
			}
		}

		for (int j=0; j<new_rows.size(); j++){
			if (new_rows[j].identifier == -1 or new_rows[j].identifier == port){
				new_rows.erase(new_rows.begin() + j);
				j--;
			}
		}


		// cout<<"New Rows [CLEANED] - - - - - "<<endl;
		// for (int i=0; i<new_rows.size(); i++){
		// 	cout<<new_rows[i].identifier<<endl;
		// }
		// cout<<"- - - - - - - - - - "<<endl;



		// Add data from new_rows into table
		for (int i=0; i<new_rows.size(); i++){
				new_rows[i].hop_count ++;
				new_rows[i].fd = client;
				table.push_back(new_rows[i]);
		}

		// for (int i=0; i<new_rows.size(); i++){
		// 	if (new_rows[i].identifier != port)
		// 		table.push_back(new_rows[i]);
		// }

		printTable();
		sendTableToAllRouters(client);  //ignore this client when sending table to routers
		break;
	}

	case MESSAGE:
	{
        vector<string> Command = tokenizeData(vec[3],' ');
        if (Command[0]=="DNS")
        {
            if(Command[1]=="REQ"){
                while (Command[2].back() == '\n')
                {
                    Command[2].pop_back();
                }
                for (size_t i = 0; i < List.size(); i++)
                {
                    if (Command[2]==List[i].DomainName)
                    {
                        string Response = "DNS RES " + List[i].DomainName + " " + List[i].IPAddress;
                        string message = constructNewMessage(MESSAGE, port,stoi(vec[1]),(void*)Response.c_str());
                        cout << "Proxy Intervenes ...\n";

						if (vec.size() == 4){
							message += '&';
							message += to_string(port);
						}
						else {
							message += ',';
							message += to_string(port);			
						}

                        send(client, message.c_str(), strlen(message.c_str()), 0);
                        return;
                    }
                    
                }
                
            }
            else if (Command[1] == "RES"){
                cout << "Checking Response ... \n";
                int index = SearchDomain(Command[2],List);
                
                if (index < 0)
                {
                    Directory Entry ;
                    Entry.DomainName = Command[2] ;
                    for (size_t i = 0; i < 128; i++)
                    {
                        Entry.IPAddress[i] = Command[3][i];
                    }
                    List.push_back(Entry);
                    cout << "Saved the Entry in Cache ... \n";
                }
                else{
                    for (size_t i = 0; i < 128; i++)
                    {
                        List[index].IPAddress[i] = Command[3][i];
                    }
                }
                
            }
        }
        
		int index = findRowByID_MinHopCount(stoi(vec[2]));

		if (index < 0)
		{
			break;
		}

		if (vec.size() == 4){
			packet += '&';
			packet += to_string(port);
		}
		else {
			packet += ',';
			packet += to_string(port);			
		}
		// Forward packet to appropriate socket
		send(table[index].fd, packet.c_str(), strlen(packet.c_str()), 0);
		break;
	}
	default:
		break;
	}
	// if (vec[0] == UPDATE){
	// 	if ()

	// }
	// send(client, "OK", 2, 0); //Reply message to client
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x1b0(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rsi), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
leaq 0x1a0(%rsp), %r15
movq %r15, %rdi
callq 0x70c0
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movl $0x26, %edx
callq 0x25cc
movq 0x1a0(%rsp), %rdi
cmpq %r12, %rdi
je 0x3c74
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x2270
movq 0x30(%rsp), %rdi
leaq 0x4443(%rip), %rsi      # 0x80c3
callq 0x20a0
testl %eax, %eax
je 0x3ddb
movq 0x30(%rsp), %rdi
leaq 0x4446(%rip), %rsi      # 0x80df
callq 0x20a0
testl %eax, %eax
je 0x3de9
movq %rbx, 0x8(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %r12
callq 0x2040
movq %rax, %rbx
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x80(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x2300
cmpq %r12, (%r13)
je 0x488a
movslq %eax, %rcx
cmpq %rax, %rcx
jne 0x4899
movl (%rbx), %ecx
cmpl $0x22, %ecx
je 0x4899
testl %ecx, %ecx
movq 0x8(%rsp), %r15
jne 0x3d07
movl %ebp, (%rbx)
cmpl $0x1, %eax
je 0x3f8f
cmpl $0x4, %eax
je 0x3e4b
cmpl $0x2, %eax
jne 0x3e2f
movq 0x30(%rsp), %rax
leaq 0x190(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
leaq 0x180(%rsp), %rdi
callq 0x70c0
leaq 0x80(%rsp), %rdi
leaq 0x180(%rsp), %rsi
movl $0x2c, %edx
callq 0x6812
movq 0x180(%rsp), %rdi
cmpq %r14, %rdi
je 0x3d82
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x2270
movl 0x80(%rsp), %ecx
movq 0x74a0(%rip), %rsi      # 0xb230
movq 0x7491(%rip), %rax      # 0xb228
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
subq %rax, %rsi
je 0x437c
movl (%r15), %edi
sarq $0x6, %rsi
cmpq $0x1, %rsi
adcq $0x0, %rsi
leaq 0x4(%rax), %r9
xorl %r8d, %r8d
cmpl %edi, (%r9)
jne 0x3dca
cmpl %ecx, -0x4(%r9)
je 0x4379
incq %r8
addq $0x40, %r9
cmpq %r8, %rsi
jne 0x3dbb
jmp 0x437c
movl $0x18, %edx
leaq 0x42df(%rip), %rsi      # 0x80c6
jmp 0x3df5
movl $0x1d, %edx
leaq 0x42ee(%rip), %rsi      # 0x80e3
movq 0x71d4(%rip), %rbx      # 0xafd0
movq %rbx, %rdi
callq 0x22b0
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2240
movsbl %al, %esi
movq 0x71ae(%rip), %rdi      # 0xafd0
callq 0x2030
movq %rax, %rdi
callq 0x2190
leaq 0x30(%rsp), %rdi
callq 0x55fa
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %rax
leaq 0x150(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
leaq 0x140(%rsp), %rdi
callq 0x70c0
leaq 0x68(%rsp), %rdi
leaq 0x140(%rsp), %rsi
movl $0x20, %edx
callq 0x25cc
movq %rbx, (%rsp)
movq 0x140(%rsp), %rdi
cmpq %r15, %rdi
je 0x3eac
movq 0x150(%rsp), %rsi
incq %rsi
callq 0x2270
movq 0x68(%rsp), %rdi
leaq 0x4249(%rip), %rsi      # 0x8101
callq 0x20a0
testl %eax, %eax
je 0x41d7
movq 0x30(%rsp), %rax
movq 0x40(%rax), %rbx
movq (%rsp), %rax
movl (%rax), %ebp
movl $0x0, (%rax)
leaq 0x80(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x2300
cmpq %rbx, (%r12)
je 0x48a8
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
movq (%rsp), %rdx
jb 0x48b4
movl (%rdx), %ecx
cmpl $0x22, %ecx
je 0x48b4
testl %ecx, %ecx
jne 0x3f2b
movl %ebp, (%rdx)
movl %eax, %edi
callq 0x35b8
testl %eax, %eax
js 0x436a
movl %eax, %ebx
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
cmpq $0x80, %rax
jne 0x42e6
movq %r14, %rdi
movl $0x26, %esi
callq 0x2210
movl 0x72db(%rip), %esi      # 0xb240
leaq 0x80(%rsp), %rdi
callq 0x6d27
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %r14, %rdi
callq 0x20b0
jmp 0x431e
movq 0x30(%rsp), %rax
leaq 0x170(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
leaq 0x160(%rsp), %rdi
callq 0x70c0
leaq 0x80(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x2869
movq 0x160(%rsp), %rdi
cmpq %r14, %rdi
je 0x3fea
movq 0x170(%rsp), %rsi
incq %rsi
callq 0x2270
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
subq %rax, %rcx
je 0x401d
sarq $0x6, %rcx
cmpq $0x1, %rcx
adcq $0x0, %rcx
addq $0x4, %rax
movl (%r15), %edx
movl %edx, (%rax)
addq $0x40, %rax
decq %rcx
jne 0x400f
movq 0x720c(%rip), %rax      # 0xb230
cmpq 0x71fd(%rip), %rax      # 0xb228
je 0x40f9
xorl %r13d, %r13d
leaq 0x80(%rsp), %r14
movq 0x80(%rsp), %rax
cmpq %rax, 0x88(%rsp)
je 0x40db
xorl %r15d, %r15d
movq %r13, %rbp
shlq $0x6, %rbp
xorl %ebx, %ebx
movq 0x71c3(%rip), %r12      # 0xb228
addq %rbp, %r12
shlq $0x6, %r15
addq %rax, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x26ec
testb %al, %al
jne 0x40ad
movl 0x4(%r12), %eax
movq 0x8(%rsp), %rcx
cmpl (%rcx), %eax
jne 0x4095
movl (%r12), %eax
cmpl (%r15), %eax
je 0x40ad
movl (%r12), %eax
cmpl (%r15), %eax
jne 0x40a6
cmpl $0x0, 0xc(%r12)
je 0x40ad
cmpl $0xf, 0xc(%r15)
jl 0x40ba
movq %r14, %rdi
movq %r15, %rsi
callq 0x7852
decl %ebx
incl %ebx
movslq %ebx, %r15
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
subq %rax, %rcx
sarq $0x6, %rcx
cmpq %r15, %rcx
ja 0x405e
incq %r13
movq 0x714b(%rip), %rax      # 0xb230
subq 0x713c(%rip), %rax      # 0xb228
sarq $0x6, %rax
cmpq %r13, %rax
ja 0x403c
movq 0x80(%rsp), %rsi
cmpq %rsi, 0x88(%rsp)
movq 0x8(%rsp), %r12
je 0x415e
xorl %eax, %eax
leaq 0x80(%rsp), %r14
xorl %ebx, %ebx
shlq $0x6, %rax
movl (%rsi,%rax), %ecx
cmpl $-0x1, %ecx
je 0x4130
cmpl 0x7112(%rip), %ecx      # 0xb240
jne 0x413d
addq %rax, %rsi
movq %r14, %rdi
callq 0x7852
decl %ebx
incl %ebx
movslq %ebx, %rax
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rcx
subq %rsi, %rcx
sarq $0x6, %rcx
cmpq %rax, %rcx
ja 0x411c
movq 0x80(%rsp), %rax
cmpq %rax, 0x88(%rsp)
je 0x41b7
xorl %ebx, %ebx
leaq 0x70af(%rip), %r14      # 0xb228
xorl %r15d, %r15d
incl 0xc(%rax,%rbx)
leaq (%rax,%rbx), %rsi
movl (%r12), %ecx
movl %ecx, 0x4(%rax,%rbx)
movq %r14, %rdi
callq 0x6c66
incq %r15
movq 0x80(%rsp), %rax
movq 0x88(%rsp), %rcx
subq %rax, %rcx
sarq $0x6, %rcx
addq $0x40, %rbx
cmpq %r15, %rcx
ja 0x417c
callq 0x33d3
movl (%r12), %edi
callq 0x3823
leaq 0x80(%rsp), %rdi
callq 0x6ccc
jmp 0x3e2f
movq 0x68(%rsp), %rdi
addq $0x20, %rdi
leaq 0x3f1e(%rip), %rsi      # 0x8105
callq 0x20a0
movq 0x68(%rsp), %rdi
testl %eax, %eax
je 0x44fb
addq $0x20, %rdi
leaq 0x3f24(%rip), %rsi      # 0x8128
callq 0x20a0
testl %eax, %eax
jne 0x3ec5
movq 0x6db8(%rip), %rdi      # 0xafd0
leaq 0x3f0d(%rip), %rsi      # 0x812c
movl $0x17, %edx
callq 0x22b0
movq 0x68(%rsp), %rax
leaq 0x130(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x40(%rax), %rsi
movq 0x48(%rax), %rdx
addq %rsi, %rdx
leaq 0x120(%rsp), %rdi
callq 0x70c0
leaq 0x6fef(%rip), %rsi      # 0xb248
leaq 0x1c0(%rsp), %rdi
callq 0x6f46
leaq 0x120(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0x3af5
movl %eax, %ebx
leaq 0x1c0(%rsp), %rdi
callq 0x6dca
movq 0x120(%rsp), %rdi
cmpq %r15, %rdi
je 0x42a7
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x2270
testl %ebx, %ebx
js 0x45ee
movl %ebx, %eax
shlq $0x5, %rax
leaq (%rax,%rax,4), %rax
xorl %ecx, %ecx
movq 0x68(%rsp), %rdx
movq 0x60(%rdx), %rdx
movb (%rdx,%rcx), %dl
movq 0x6f7a(%rip), %rsi      # 0xb248
addq %rax, %rsi
movb %dl, 0x20(%rcx,%rsi)
incq %rcx
cmpq $0x80, %rcx
jne 0x42bb
jmp 0x3ec5
movq %r14, %rdi
movl $0x2c, %esi
callq 0x2210
movl 0x6f47(%rip), %esi      # 0xb240
leaq 0x80(%rsp), %rdi
callq 0x6d27
movq 0x80(%rsp), %rsi
movq 0x88(%rsp), %rdx
movq %r14, %rdi
callq 0x20b0
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x433f
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2270
movl %ebx, %eax
movq 0x6ee0(%rip), %rcx      # 0xb228
shlq $0x6, %rax
movl 0x4(%rcx,%rax), %ebx
movq (%r14), %r14
movq %r14, %rdi
callq 0x2110
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x2120
leaq 0x68(%rsp), %rdi
callq 0x55fa
jmp 0x3e2f
movl %r8d, %edx
testl %edx, %edx
js 0x4448
movl %edx, %r14d
testl %ecx, %ecx
js 0x4395
movq %r14, %rdx
shlq $0x6, %rdx
movl %ecx, (%rax,%rdx)
movzwl 0x88(%rsp), %ecx
testw %cx, %cx
js 0x43ae
movq %r14, %rdx
shlq $0x6, %rdx
movw %cx, 0x8(%rax,%rdx)
movl 0x8c(%rsp), %ecx
testl %ecx, %ecx
js 0x43c4
movq %r14, %rdx
shlq $0x6, %rdx
movl %ecx, 0xc(%rax,%rdx)
leaq 0x90(%rsp), %rbx
leaq 0x3cc4(%rip), %rsi      # 0x8097
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
je 0x43fd
movq 0x6e42(%rip), %rax      # 0xb228
movq %r14, %rcx
shlq $0x6, %rcx
leaq (%rax,%rcx), %rdi
addq $0x10, %rdi
movq %rbx, %rsi
callq 0x2140
movb 0xb0(%rsp), %cl
movq 0x6e1d(%rip), %rdx      # 0xb228
shlq $0x6, %r14
leaq (%rdx,%r14), %rax
movb %cl, 0x30(%rdx,%r14)
movl 0xb4(%rsp), %ecx
testl %ecx, %ecx
js 0x4426
movl %ecx, 0x34(%rax)
movl 0xb8(%rsp), %ecx
testl %ecx, %ecx
js 0x4434
movl %ecx, 0x38(%rax)
callq 0x33d3
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3823
jmp 0x44d1
movq 0x6dd9(%rip), %rsi      # 0xb228
cmpq %rsi, 0x6dda(%rip)      # 0xb230
je 0x4499
xorl %eax, %eax
leaq 0x6dc7(%rip), %r14      # 0xb228
xorl %ebx, %ebx
shlq $0x6, %rax
cmpl $-0x1, (%rsi,%rax)
jne 0x447a
addq %rax, %rsi
movq %r14, %rdi
callq 0x7852
decl %ebx
incl %ebx
movslq %ebx, %rax
movq 0x6daa(%rip), %rcx      # 0xb230
movq 0x6d9b(%rip), %rsi      # 0xb228
subq %rsi, %rcx
sarq $0x6, %rcx
cmpq %rax, %rcx
ja 0x4463
movl (%r15), %eax
movl %eax, 0x84(%rsp)
cmpl $0x0, 0x8c(%rsp)
jns 0x44b8
movl $0x0, 0x8c(%rsp)
leaq 0x6d69(%rip), %rdi      # 0xb228
leaq 0x80(%rsp), %rsi
callq 0x6c66
callq 0x33d3
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3e2f
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x3e2f
movq 0x40(%rdi), %r12
movq 0x48(%rdi), %r13
cmpb $0xa, -0x1(%r12,%r13)
jne 0x452d
addq $0x40, %rdi
callq 0x22d0
movq 0x68(%rsp), %rax
leaq 0x40(%rax), %rdi
movq 0x40(%rax), %r12
movq 0x48(%rax), %r13
cmpb $0xa, -0x1(%r12,%r13)
je 0x450f
movq 0x6d1c(%rip), %rax      # 0xb250
movq 0x6d0d(%rip), %rbp      # 0xb248
subq %rbp, %rax
je 0x3ec5
sarq $0x5, %rax
movabsq $-0x3333333333333333, %rbx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rbx
cmpq $0x1, %rbx
adcq $0x0, %rbx
movq $-0x20, %r15
cmpq 0x8(%rbp), %r13
jne 0x4583
testq %r13, %r13
je 0x459b
movq (%rbp), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x2280
testl %eax, %eax
je 0x459b
addq $-0xa0, %r15
addq $0xa0, %rbp
decq %rbx
jne 0x4565
jmp 0x3ec5
leaq 0x3b67(%rip), %rsi      # 0x8109
leaq 0x10(%rsp), %rdi
movq %rbp, %rdx
callq 0x6ebd
leaq 0x3c79(%rip), %rsi      # 0x822f
leaq 0x10(%rsp), %rdi
callq 0x23e0
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x4692
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
jmp 0x469a
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq 0x68(%rsp), %rsi
addq $0x40, %rsi
leaq 0x80(%rsp), %rdi
callq 0x2140
movl $0x20, %eax
movq 0x68(%rsp), %rcx
movq 0x60(%rcx), %rdx
movb -0x20(%rdx,%rax), %dl
movb %dl, 0x80(%rsp,%rax)
incq %rax
cmpq $0xa0, %rax
jne 0x4626
leaq 0x6c01(%rip), %rdi      # 0xb248
leaq 0x80(%rsp), %rsi
callq 0x6fe2
movq 0x6975(%rip), %rdi      # 0xafd0
leaq 0x3ae2(%rip), %rsi      # 0x8144
movl $0x1e, %edx
callq 0x22b0
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x3ec5
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x3ec5
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq 0x48(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x6b8b(%rip), %rsi      # 0xb248
subq %r15, %rsi
callq 0x23e0
leaq 0x90(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x46f6
movq %rdx, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x46fe
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4730
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2270
leaq 0x20(%rsp), %r14
movq -0x10(%r14), %rdi
cmpq %r14, %rdi
je 0x474b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2270
movl 0x6aef(%rip), %ebp      # 0xb240
movq 0x30(%rsp), %rdi
addq $0x20, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0x6e2b
movq 0x80(%rsp), %r8
leaq 0x48(%rsp), %rdi
movl $0x4, %esi
movl %ebp, %edx
movl %eax, %ecx
callq 0x2a0b
movq 0x6848(%rip), %rdi      # 0xafd0
leaq 0x3983(%rip), %rsi      # 0x8112
movl $0x15, %edx
callq 0x22b0
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
cmpq $0x80, %rax
jne 0x47e0
leaq 0x48(%rsp), %rdi
movl $0x26, %esi
callq 0x2210
movl 0x6a80(%rip), %esi      # 0xb240
leaq 0x10(%rsp), %rdi
callq 0x6d27
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x20b0
jmp 0x4813
leaq 0x48(%rsp), %rdi
movl $0x2c, %esi
callq 0x2210
movl 0x6a4b(%rip), %esi      # 0xb240
leaq 0x10(%rsp), %rdi
callq 0x6d27
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x48(%rsp), %rdi
callq 0x20b0
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x482a
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2270
movq 0x8(%rsp), %rax
movl (%rax), %ebx
movq 0x48(%rsp), %r14
movq %r14, %rdi
callq 0x2110
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x2120
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x4864
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2270
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
je 0x436a
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x436a
movq %rbx, %r14
leaq 0x3a20(%rip), %rdi      # 0x82b4
callq 0x2160
movq %rbx, %r14
leaq 0x3a11(%rip), %rdi      # 0x82b4
callq 0x2310
leaq 0x3a05(%rip), %rdi      # 0x82b4
callq 0x2160
leaq 0x39f9(%rip), %rdi      # 0x82b4
callq 0x2310
jmp 0x48c2
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r14, %rdi
je 0x4986
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x4986
jmp 0x4983
jmp 0x4983
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x490e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x490e
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a65
movq 0x20(%rsp), %rsi
jmp 0x49d1
jmp 0x4a4e
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x6dca
jmp 0x4944
movq %rax, %rbx
movq 0x120(%rsp), %rdi
cmpq %r15, %rdi
je 0x4a65
movq 0x130(%rsp), %rsi
jmp 0x49d1
jmp 0x4a4e
jmp 0x4a4e
movq %rax, %rbx
jmp 0x499d
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
jne 0x49c9
jmp 0x4a65
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x499d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2270
movq 0x80(%rsp), %rdi
cmpq %r12, %rdi
jne 0x49c9
jmp 0x4a65
jmp 0x49b1
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4a65
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x4a65
jmp 0x4a4e
jmp 0x4a4e
movq %rax, %rbx
movq 0x160(%rsp), %rdi
cmpq %r14, %rdi
je 0x4ae4
movq 0x170(%rsp), %rsi
jmp 0x4a91
movq %rax, %rbx
movq 0x140(%rsp), %rdi
cmpq %r15, %rdi
je 0x4ae4
movq 0x150(%rsp), %rsi
jmp 0x4a91
movq %rax, %rbx
movq 0x180(%rsp), %rdi
cmpq %r14, %rdi
je 0x4ae4
movq 0x190(%rsp), %rsi
jmp 0x4a91
jmp 0x4acf
jmp 0x4acf
jmp 0x4acf
movq %rax, %rbx
jmp 0x4a65
movq %rax, %rbx
movq (%rsp), %rax
cmpl $0x0, (%rax)
jne 0x4a65
movq (%rsp), %rax
movl %ebp, (%rax)
leaq 0x68(%rsp), %rdi
callq 0x55fa
jmp 0x4ae4
jmp 0x4ad4
jmp 0x4a75
movq %rax, %rbx
leaq 0xa0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4ae4
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x4ae4
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x4ae4
movl %ebp, (%r14)
jmp 0x4ae4
jmp 0x4ad4
movq %rax, %rbx
movq 0x1a0(%rsp), %rdi
cmpq %r12, %rdi
je 0x4aee
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x2270
jmp 0x4aee
jmp 0x4ad4
movq %rax, %rbx
jmp 0x4ae4
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x6ccc
leaq 0x30(%rsp), %rdi
callq 0x55fa
movq %rbx, %rdi
callq 0x23a0