// File: /workspace/github_cpp_makefile_star2_O2/devanshdalal[P]cloud-computing-concepts-part-2/MP2Node.cpp
// Function: MP2Node::checkMessages()
void MP2Node::checkMessages()
{
	/*
	 * Implement this. Parts of it are already implemented
	 */
	char *data;
	int size;

	/*
	 * Declare your local variables here
	 */

	// dequeue all messages and handle them
	while (!memberNode->mp2q.empty())
	{
		/*
		 * Pop a message from the queue
		 */
		data = (char *)memberNode->mp2q.front().elt;
		size = memberNode->mp2q.front().size;
		memberNode->mp2q.pop();

		string message(data, data + size);

		/*
		 * Handle the message types here
		 */
		// std::cout << "message:" << message << "\n";
		Message msg(message);
		// {CREATE, READ, UPDATE, DELETE, REPLY, READREPLY};
		switch (msg.type)
		{
		case MessageType::READ:
		{
			const auto &key = msg.key;
			const auto value = readKey(key);
			std::cout << "MessageType::READ on " << memberNode->addr.getAddress()
					  << " from " << msg.fromAddr.getAddress()
					  << " " << key << ", " << value << "\n";
			if (not value.empty())
			{
				log->logReadSuccess(&(memberNode->addr), false /*is_coordinator*/, msg.transID, key, value);
				auto reply = Message(msg.transID, memberNode->addr, value);
				// std::cout << "reply.toString(): " << reply.toString() << "\n";
				emulNet->ENsend(&(memberNode->addr), &(msg.fromAddr), reply.toString());
			}
			else
			{
				log->logReadFail(&(memberNode->addr), false /*is_coordinator*/, msg.transID, key);
			}
			break;
		}
		case MessageType::UPDATE:
		{
			const auto &key = msg.key;
			const auto &value = msg.value;
			const auto &replica = msg.replica;
			if (updateKeyValue(key, value, replica))
			{
				if (msg.transID >= 0)
				{
					log->logUpdateSuccess(&(memberNode->addr), false /*is_coordinator*/, msg.transID, key, value);
					auto reply = Message(msg.transID, memberNode->addr, MessageType::REPLY, true);
					emulNet->ENsend(&(memberNode->addr), &(msg.fromAddr), reply.toString());
				}
			}
			else
			{
				log->logUpdateFail(&(memberNode->addr), false /*is_coordinator*/, msg.transID, key, value);
			}
			break;
		}
		case MessageType::CREATE:
		{
			const auto &key = msg.key;
			const auto &value = msg.value;
			const auto &replica = msg.replica;
			// std::cout << "MessageType::CREATE/UPDATE on " << memberNode->addr.getAddress()
			// 		  << " from " << msg.fromAddr.getAddress() << " key: "
			// 		  << key << "," << msg.replica << "\n";
			createKeyValue(key, value, replica);
			if (msg.transID >= 0)
			{
				log->logCreateSuccess(&(memberNode->addr), false /*is_coordinator*/, msg.transID, key, value);
				auto reply = Message(msg.transID, memberNode->addr, MessageType::REPLY, true);
				emulNet->ENsend(&(memberNode->addr), &(msg.fromAddr), reply.toString());
			}
			break;
		}
		case MessageType::DELETE:
		{
			const auto &key = msg.key;
			if (deletekey(key))
			{
				log->logDeleteSuccess(&(memberNode->addr), false /*is_coordinator*/, msg.transID, key);
				auto reply = Message(msg.transID, memberNode->addr, MessageType::REPLY, true);
				emulNet->ENsend(&(memberNode->addr), &(msg.fromAddr), reply.toString());
			}
			else
			{
				log->logDeleteFail(&(memberNode->addr), false /*is_coordinator*/, msg.transID, key);
			}
			break;
		}
		case MessageType::READREPLY:
		{
			auto it = local_state_.find(msg.transID);
			// for (auto &v : local_state_)
			// {
			// 	std::cout << "v: " << v.first << "???" << v.second.key << "\n";
			// }
			if (it != local_state_.end())
			{
				const auto &key = it->second.key;
				auto &value = it->second.value;
				auto &replies = it->second.replies;
				std::cout << "MessageType::READREPLY on " << memberNode->addr.getAddress()
						  << " from " << msg.fromAddr.getAddress() << " key: "
						  << key << "," << msg.value << "\n";
				if (value.empty())
				{
					value = msg.value;
				}
				++replies;
				if (replies >= READ_QUORUM)
				{
					// READ success
					log->logReadSuccess(&(memberNode->addr), true /*is_coordinator*/, msg.transID, key, value);
					local_state_.erase(it);
				}
			}
			break;
		}
		case MessageType::REPLY:
		{
			auto it = local_state_.find(msg.transID);
			if (it != local_state_.end())
			{
				auto &state = it->second;
				const auto &key = state.key;
				const auto &value = state.value;
				auto &replies = state.replies;
				std::cout << "MessageType::REPLY for " << memberNode->addr.getAddress()
						  << " from " << msg.fromAddr.getAddress() << " key: "
						  << key << "," << value << "," << msg.type << "\n";
				++replies;
				if (replies >= WRITE_QUORUM)
				{
					// READ success
					// std::cout << "log->logCreateSuccess\n";
					if (state.type == MessageType::CREATE)
					{
						log->logCreateSuccess(&(memberNode->addr), true /*is_coordinator*/, msg.transID, key, value);
					}
					else if (state.type == MessageType::UPDATE)
					{
						log->logUpdateSuccess(&(memberNode->addr), true /*is_coordinator*/, msg.transID, key, value);
					}
					else if (state.type == MessageType::DELETE)
					{
						log->logDeleteSuccess(&(memberNode->addr), true /*is_coordinator*/, msg.transID, key);
					}
					local_state_.erase(it);
				}
			}

			break;
		}

		default:
			break;
		}
	}

	/*
	 * This function should also ensure all READ and UPDATE operation
	 * get QUORUM replies
	 */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x548, %rsp            # imm = 0x548
leaq 0x80(%rdi), %rax
movq %rax, 0x8(%rsp)
movq %rdi, (%rsp)
leaq 0x88(%rdi), %rax
movq %rax, 0xa8(%rsp)
leaq 0x348(%rsp), %r12
movq (%rsp), %rax
movq 0x60(%rax), %rdi
movq 0xa8(%rdi), %rax
cmpq %rax, 0xc8(%rdi)
je 0xedbb
addq $0x98, %rdi
movq (%rax), %rbx
movslq 0x8(%rax), %r14
callq 0x536a
addq %rbx, %r14
leaq 0x158(%rsp), %rax
movq %rax, 0x148(%rsp)
leaq 0x148(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xf624
movq %r12, %rdi
movq %r15, %rsi
callq 0x3370
leaq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x114ac
movq %r12, %rdi
callq 0x3110
movl 0x10(%rsp), %eax
cmpq $0x5, %rax
ja 0xece5
leaq 0x491f(%rip), %rcx      # 0x12c34
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x268(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
leaq 0x428(%rsp), %r14
movq %r14, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3370
movl 0x14(%rsp), %ecx
movq (%rsp), %rdi
leaq 0x268(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
callq 0xddba
movq %r14, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movl 0x60(%rsp), %ebp
testl %ebp, %ebp
js 0xece5
movq (%rsp), %rax
movq 0x60(%rax), %r14
movq 0x78(%rax), %rbx
leaq 0x248(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
leaq 0x408(%rsp), %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3370
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebp, %ecx
leaq 0x248(%rsp), %rbx
movq %rbx, %r8
movq %r15, %r9
callq 0x9dbe
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movl 0x60(%rsp), %ebx
movq (%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0x13c(%rsp), %r14
movq %r14, %rdi
callq 0xa4e4
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
pushq $0x4
popq %rcx
pushq $0x1
popq %r8
callq 0x11ac2
movq (%rsp), %rax
movq 0x60(%rax), %rbx
movq 0x70(%rax), %r14
leaq 0x3e8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x11c40
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x58(%rsp), %rdx
movq %r12, %rcx
callq 0x5d28
jmp 0xe828
movq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x104f6
movq %rax, %rbp
cmpq 0xa8(%rsp), %rax
je 0xece5
movq 0xcb4a(%rip), %rdi      # 0x1afc8
leaq 0x485d(%rip), %rsi      # 0x12ce2
callq 0x3250
movq %rax, %rbx
movq (%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x8da4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x47fd(%rip), %rsi      # 0x12cbb
callq 0x3250
movq %rax, %rbx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x8da4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x4186(%rip), %rsi      # 0x12676
callq 0x3250
leaq 0x30(%rbp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x47d2(%rip), %rsi      # 0x12ce0
callq 0x3250
leaq 0x50(%rbp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x47b4(%rip), %rsi      # 0x12ce0
callq 0x3250
movl 0x10(%rsp), %esi
movq %rax, %rdi
callq 0x3440
movq %rax, %rdi
leaq 0x3dae(%rip), %rsi      # 0x122f5
callq 0x3250
leaq 0x88(%rsp), %rdi
callq 0x3110
leaq 0xb8(%rsp), %rdi
callq 0x3110
movq 0x78(%rbp), %rax
incq %rax
movq %rax, 0x78(%rbp)
cmpq $0x2, %rax
jb 0xece5
movl 0x28(%rbp), %eax
cmpl $0x3, %eax
je 0xed62
cmpl $0x2, %eax
je 0xed01
testl %eax, %eax
jne 0xeda9
movq (%rsp), %rax
movq 0x60(%rax), %r15
movq 0x78(%rax), %rbx
movl 0x60(%rsp), %r13d
leaq 0x1a8(%rsp), %rdi
movq %r14, %rsi
callq 0x3370
leaq 0x388(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x3370
addq $0x8, %r15
movq %rbx, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
movl %r13d, %ecx
leaq 0x1a8(%rsp), %rbx
movq %rbx, %r8
movq %r14, %r9
callq 0x9dbe
jmp 0xed58
leaq 0x2c8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
leaq 0x4a8(%rsp), %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3370
movl 0x14(%rsp), %ecx
movq (%rsp), %rdi
leaq 0x2c8(%rsp), %r14
movq %r14, %rsi
movq %r15, %rdx
callq 0xe038
movl %eax, %ebx
movq %r15, %rdi
callq 0x3110
movq %r14, %rdi
callq 0x3110
testb %bl, %bl
je 0xec37
movl 0x60(%rsp), %ebp
testl %ebp, %ebp
js 0xece5
movq (%rsp), %rax
movq 0x60(%rax), %r14
movq 0x78(%rax), %rbx
leaq 0x2a8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
leaq 0x488(%rsp), %r15
movq %r15, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3370
addq $0x8, %r14
movq %rbx, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebp, %ecx
leaq 0x2a8(%rsp), %rbx
movq %rbx, %r8
movq %r15, %r9
callq 0x9f42
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movl 0x60(%rsp), %ebx
movq (%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0x142(%rsp), %r14
movq %r14, %rdi
callq 0xa4e4
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
pushq $0x4
popq %rcx
pushq $0x1
popq %r8
callq 0x11ac2
movq (%rsp), %rax
movq 0x60(%rax), %rbx
movq 0x70(%rax), %r14
leaq 0x468(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x11c40
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x58(%rsp), %rdx
movq %r12, %rcx
callq 0x5d28
jmp 0xe828
leaq 0x228(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
movq (%rsp), %r15
movq %r15, %rdi
leaq 0x228(%rsp), %r14
movq %r14, %rsi
callq 0xe17e
movl %eax, %ebx
movq %r14, %rdi
callq 0x3110
movq 0x60(%r15), %r14
movq 0x78(%r15), %r12
movl 0x60(%rsp), %ebp
testb %bl, %bl
je 0xec05
leaq 0x208(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
addq $0x8, %r14
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebp, %ecx
leaq 0x208(%rsp), %rbx
movq %rbx, %r8
callq 0xa004
movq %rbx, %rdi
callq 0x3110
movl 0x60(%rsp), %ebx
movq (%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0x136(%rsp), %r14
movq %r14, %rdi
callq 0xa4e4
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
pushq $0x4
popq %rcx
pushq $0x1
popq %r8
callq 0x11ac2
movq (%rsp), %rax
movq 0x60(%rax), %rbx
movq 0x70(%rax), %r14
leaq 0x3c8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x11c40
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x58(%rsp), %rdx
movq %r12, %rcx
callq 0x5d28
movq %r12, %rdi
callq 0x3110
leaq 0xb8(%rsp), %rdi
callq 0xf466
jmp 0xece5
leaq 0x528(%rsp), %rbx
movq %rbx, %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
leaq 0x88(%rsp), %rdi
movq (%rsp), %rsi
movq %rbx, %rdx
callq 0xdefe
movq %rbx, %rdi
callq 0x3110
movq 0xc74e(%rip), %rdi      # 0x1afc8
leaq 0x4424(%rip), %rsi      # 0x12ca5
callq 0x3250
movq %rax, %rbx
movq (%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x8da4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x4401(%rip), %rsi      # 0x12cbb
callq 0x3250
movq %rax, %rbx
leaq 0x328(%rsp), %r14
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x8da4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x39ca(%rip), %rsi      # 0x122b6
callq 0x3250
movq %rax, %rdi
leaq 0x18(%rsp), %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x43ba(%rip), %rsi      # 0x12cc2
callq 0x3250
movq %rax, %rdi
leaq 0x88(%rsp), %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x39ce(%rip), %rsi      # 0x122f5
callq 0x3250
leaq 0x328(%rsp), %rdi
callq 0x3110
leaq 0xb8(%rsp), %rdi
callq 0x3110
cmpq $0x0, 0x90(%rsp)
movq (%rsp), %rax
movq 0x60(%rax), %r14
movq 0x78(%rax), %r12
je 0xec9c
movl 0x60(%rsp), %ebp
leaq 0x308(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
leaq 0x508(%rsp), %r15
movq %r15, %rdi
leaq 0x88(%rsp), %rsi
callq 0x3370
addq $0x8, %r14
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebp, %ecx
leaq 0x308(%rsp), %rbx
movq %rbx, %r8
movq %r15, %r9
callq 0x9e80
movq %r15, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movl 0x60(%rsp), %ebp
movq (%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0xb2(%rsp), %rdi
callq 0xa4e4
leaq 0x4e8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x88(%rsp), %rsi
callq 0x3370
leaq 0xb8(%rsp), %r15
movq %r15, %rdi
movl %ebp, %esi
leaq 0xb2(%rsp), %rdx
movq %rbx, %rcx
callq 0x11b82
movq %rbx, %rdi
callq 0x3110
movq (%rsp), %rax
movq 0x60(%rax), %rbx
movq 0x70(%rax), %r14
leaq 0x4c8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x11c40
addq $0x8, %rbx
movq %r14, %rdi
movq %rbx, %rsi
leaq 0x58(%rsp), %rdx
movq %r12, %rcx
callq 0x5d28
movq %r12, %rdi
callq 0x3110
leaq 0xb8(%rsp), %rdi
callq 0xf466
jmp 0xecd8
movq 0x8(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x104f6
movq %rax, %rbp
cmpq 0xa8(%rsp), %rax
je 0xece5
movq 0xc537(%rip), %rdi      # 0x1afc8
leaq 0x422d(%rip), %rsi      # 0x12cc5
callq 0x3250
movq %rax, %rbx
movq (%rsp), %rax
movq 0x60(%rax), %rsi
addq $0x8, %rsi
leaq 0xb8(%rsp), %r14
movq %r14, %rdi
callq 0x8da4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x41ea(%rip), %rsi      # 0x12cbb
callq 0x3250
movq %rax, %rbx
leaq 0x88(%rsp), %r14
movq %r14, %rdi
leaq 0x58(%rsp), %rsi
callq 0x8da4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x3b73(%rip), %rsi      # 0x12676
callq 0x3250
leaq 0x30(%rbp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x41bf(%rip), %rsi      # 0x12ce0
callq 0x3250
movq %rax, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3210
movq %rax, %rdi
leaq 0x37b8(%rip), %rsi      # 0x122f5
callq 0x3250
movq %rbp, %r12
addq $0x50, %r12
leaq 0x88(%rsp), %rdi
callq 0x3110
leaq 0xb8(%rsp), %rdi
callq 0x3110
cmpq $0x0, 0x58(%rbp)
jne 0xeb77
movq %r12, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3150
movq 0x78(%rbp), %rax
incq %rax
movq %rax, 0x78(%rbp)
cmpq $0x2, %rax
jb 0xece5
movq (%rsp), %rax
movq 0x60(%rax), %r15
movq 0x78(%rax), %rbx
movl 0x60(%rsp), %r13d
leaq 0x1c8(%rsp), %rdi
movq %r14, %rsi
callq 0x3370
leaq 0x3a8(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x3370
addq $0x8, %r15
movq %rbx, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
movl %r13d, %ecx
leaq 0x1c8(%rsp), %rbx
movq %rbx, %r8
movq %r14, %r9
callq 0x9e80
movq %r14, %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3110
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x1052a
jmp 0xece5
leaq 0x1e8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
addq $0x8, %r14
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebp, %ecx
leaq 0x1e8(%rsp), %rbx
movq %rbx, %r8
callq 0xa2e0
jmp 0xec97
movq (%rsp), %rax
movq 0x60(%rax), %r14
movq 0x78(%rax), %r15
movl 0x60(%rsp), %ebp
leaq 0x288(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
leaq 0x448(%rsp), %r12
movq %r12, %rdi
leaq 0x38(%rsp), %rsi
callq 0x3370
addq $0x8, %r14
movq %r15, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebp, %ecx
leaq 0x288(%rsp), %rbx
movq %rbx, %r8
movq %r12, %r9
callq 0xa21e
movq %r12, %rdi
callq 0x3110
movq %rbx, %rdi
jmp 0xece0
movl 0x60(%rsp), %ebx
leaq 0x2e8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x3370
addq $0x8, %r14
movq %r12, %rdi
movq %r14, %rsi
xorl %edx, %edx
movl %ebx, %ecx
leaq 0x2e8(%rsp), %rbx
movq %rbx, %r8
callq 0xa172
movq %rbx, %rdi
callq 0x3110
leaq 0x88(%rsp), %rdi
callq 0x3110
leaq 0x10(%rsp), %rdi
callq 0xf466
leaq 0x148(%rsp), %rdi
callq 0x3110
jmp 0xe280
movq (%rsp), %rax
movq 0x60(%rax), %r15
movq 0x78(%rax), %rbx
movl 0x60(%rsp), %r13d
leaq 0x188(%rsp), %rdi
movq %r14, %rsi
callq 0x3370
leaq 0x368(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x3370
addq $0x8, %r15
movq %rbx, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
movl %r13d, %ecx
leaq 0x188(%rsp), %rbx
movq %rbx, %r8
movq %r14, %r9
callq 0x9f42
movq %r14, %rdi
callq 0x3110
jmp 0xeda1
movq (%rsp), %rax
movq 0x60(%rax), %r15
movq 0x78(%rax), %r12
movl 0x60(%rsp), %ebx
leaq 0x168(%rsp), %rdi
movq %r14, %rsi
callq 0x3370
addq $0x8, %r15
movq %r12, %rdi
movq %r15, %rsi
pushq $0x1
popq %rdx
movl %ebx, %ecx
leaq 0x168(%rsp), %rbx
movq %rbx, %r8
callq 0xa004
movq %rbx, %rdi
callq 0x3110
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x1052a
jmp 0xece5
addq $0x548, %rsp            # imm = 0x548
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x168(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x368(%rsp), %rdi
callq 0x3110
jmp 0xedf2
movq %rax, %rbx
leaq 0x188(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x388(%rsp), %rdi
callq 0x3110
jmp 0xee14
movq %rax, %rbx
leaq 0x1a8(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x3a8(%rsp), %rdi
callq 0x3110
jmp 0xee36
movq %rax, %rbx
leaq 0x1c8(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x468(%rsp), %rdi
jmp 0xeeeb
jmp 0xeef2
movq %rax, %rbx
leaq 0x488(%rsp), %rdi
callq 0x3110
jmp 0xee6d
movq %rax, %rbx
leaq 0x2a8(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x2e8(%rsp), %rdi
jmp 0xf059
movq %rax, %rbx
leaq 0x448(%rsp), %rdi
callq 0x3110
jmp 0xee9f
movq %rax, %rbx
leaq 0x288(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x3c8(%rsp), %rdi
jmp 0xeeeb
jmp 0xeef2
movq %rax, %rbx
leaq 0x208(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x1e8(%rsp), %rdi
jmp 0xf066
jmp 0xf020
movq %rax, %rbx
leaq 0x3e8(%rsp), %rdi
callq 0x3110
jmp 0xeef5
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xf466
jmp 0xf06b
movq %rax, %rbx
leaq 0x408(%rsp), %rdi
callq 0x3110
jmp 0xef1c
movq %rax, %rbx
leaq 0x248(%rsp), %rdi
jmp 0xf066
jmp 0xf00b
jmp 0xf020
movq %rax, %rbx
leaq 0x4c8(%rsp), %rdi
callq 0x3110
jmp 0xef48
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xf466
jmp 0xf05e
movq %rax, %rbx
leaq 0x4e8(%rsp), %rdi
jmp 0xf059
movq %rax, %rbx
leaq 0x508(%rsp), %rdi
callq 0x3110
jmp 0xef84
jmp 0xf00b
movq %rax, %rbx
leaq 0x308(%rsp), %rdi
jmp 0xf059
jmp 0xf020
jmp 0xf01b
jmp 0xf020
jmp 0xf016
movq %rax, %rbx
leaq 0x528(%rsp), %rdi
jmp 0xf066
jmp 0xf020
movq %rax, %rbx
leaq 0x4a8(%rsp), %rdi
callq 0x3110
jmp 0xefdd
jmp 0xf020
movq %rax, %rbx
leaq 0x428(%rsp), %rdi
callq 0x3110
jmp 0xefea
movq %rax, %rbx
leaq 0x2c8(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x268(%rsp), %rdi
jmp 0xf066
jmp 0xf020
movq %rax, %rbx
leaq 0x228(%rsp), %rdi
jmp 0xf066
jmp 0xf020
jmp 0xf016
jmp 0xf00b
jmp 0xf020
movq %rax, %rbx
jmp 0xf037
jmp 0xf020
jmp 0xf020
jmp 0xf020
movq %rax, %rbx
jmp 0xf05e
movq %rax, %rbx
jmp 0xf051
movq %rax, %rbx
jmp 0xf06b
jmp 0xf027
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x3110
leaq 0xb8(%rsp), %rdi
jmp 0xf066
movq %rax, %rbx
leaq 0x328(%rsp), %rdi
callq 0x3110
leaq 0xb8(%rsp), %rdi
callq 0x3110
leaq 0x88(%rsp), %rdi
callq 0x3110
leaq 0x10(%rsp), %rdi
callq 0xf466
leaq 0x148(%rsp), %rdi
callq 0x3110
movq %rbx, %rdi
callq 0x3450
movq %rax, %rbx
jmp 0xf075
movq %rax, %rbx
leaq 0x348(%rsp), %rdi
callq 0x3110
jmp 0xf075
nop