// File: CMU-SAFARI[P]MQSim/src/host/IO_Flow_Base.cpp
// Function: Host_Components::IO_Flow_Base::NVMe_consume_io_request(Completion_Queue_Entry*)
void IO_Flow_Base::NVMe_consume_io_request(Completion_Queue_Entry* cqe)
	{
		//Find the request and update statistics
		Host_IO_Request* request = nvme_software_request_queue[cqe->Command_Identifier];
		nvme_software_request_queue.erase(cqe->Command_Identifier);
		available_command_ids.insert(cqe->Command_Identifier);
		sim_time_type device_response_time = Simulator->Time() - request->Enqueue_time;
		sim_time_type request_delay = Simulator->Time() - request->Arrival_time;
		STAT_serviced_request_count++;
		STAT_serviced_request_count_short_term++;

		STAT_sum_device_response_time += device_response_time;
		STAT_sum_device_response_time_short_term += device_response_time;
		STAT_sum_request_delay += request_delay;
		STAT_sum_request_delay_short_term += request_delay;
		if (device_response_time > STAT_max_device_response_time) {
			STAT_max_device_response_time = device_response_time;
		}
		if (device_response_time < STAT_min_device_response_time) {
			STAT_min_device_response_time = device_response_time;
		}
		if (request_delay > STAT_max_request_delay) {
			STAT_max_request_delay = request_delay;
		}
		if (request_delay < STAT_min_request_delay) {
			STAT_min_request_delay = request_delay;
		}
		STAT_transferred_bytes_total += request->LBA_count * SECTOR_SIZE_IN_BYTE;
		
		if (request->Type == Host_IO_Request_Type::READ) {
			STAT_serviced_read_request_count++;
			STAT_sum_device_response_time_read += device_response_time;
			STAT_sum_request_delay_read += request_delay;
			if (device_response_time > STAT_max_device_response_time_read) {
				STAT_max_device_response_time_read = device_response_time;
			}
			if (device_response_time < STAT_min_device_response_time_read) {
				STAT_min_device_response_time_read = device_response_time;
			}
			if (request_delay > STAT_max_request_delay_read) {
				STAT_max_request_delay_read = request_delay;
			}
			if (request_delay < STAT_min_request_delay_read) {
				STAT_min_request_delay_read = request_delay;
			}
			STAT_transferred_bytes_read += request->LBA_count * SECTOR_SIZE_IN_BYTE;
		} else {
			STAT_serviced_write_request_count++;
			STAT_sum_device_response_time_write += device_response_time;
			STAT_sum_request_delay_write += request_delay;
			if (device_response_time > STAT_max_device_response_time_write) {
				STAT_max_device_response_time_write = device_response_time;
			}
			if (device_response_time < STAT_min_device_response_time_write) {
				STAT_min_device_response_time_write = device_response_time;
			}
			if (request_delay > STAT_max_request_delay_write) {
				STAT_max_request_delay_write = request_delay;
			}
			if (request_delay < STAT_min_request_delay_write) {
				STAT_min_request_delay_write = request_delay;
			}
			STAT_transferred_bytes_write += request->LBA_count * SECTOR_SIZE_IN_BYTE;
		}

		delete request;

		nvme_queue_pair.Submission_queue_head = cqe->SQ_Head;
		
		//MQSim always assumes that the request is processed correctly, so no need to check cqe->SF_P

		//If the submission queue is not full anymore, then enqueue waiting requests
		while(waiting_requests.size() > 0) {
			if (!NVME_SQ_FULL(nvme_queue_pair) && available_command_ids.size() > 0) {
				Host_IO_Request* new_req = waiting_requests.front();
				waiting_requests.pop_front();
				if (nvme_software_request_queue[*available_command_ids.begin()] != NULL) {
					PRINT_ERROR("Unexpteced situation in IO_Flow_Base! Overwriting a waiting I/O request in the queue!")
				} else {
					new_req->IO_queue_info = *available_command_ids.begin();
					nvme_software_request_queue[*available_command_ids.begin()] = new_req;
					available_command_ids.erase(available_command_ids.begin());
					request_queue_in_memory[nvme_queue_pair.Submission_queue_tail] = new_req;
					NVME_UPDATE_SQ_TAIL(nvme_queue_pair);
				}
				new_req->Enqueue_time = Simulator->Time();
				pcie_root_complex->Write_to_device(nvme_queue_pair.Submission_tail_register_address_on_device, nvme_queue_pair.Submission_queue_tail);//Based on NVMe protocol definition, the updated tail pointer should be informed to the device
			} else {
				break;
			}
		}

		delete cqe;

		//Announce simulation progress
		if (stop_time > 0) {
			progress = int(Simulator->Time() / (double)stop_time * 100);
		} else {
			progress = int(STAT_serviced_request_count / (double)total_requests_to_be_generated * 100);
		}

		if (progress >= next_progress_step) {
			std::string progress_bar;
			int barWidth = 100;
			progress_bar += "[";
			int pos = progress;
			for (int i = 0; i < barWidth; i += 5) {
				if (i < pos) {
					progress_bar += "=";
				} else if (i == pos) {
					progress_bar += ">";
				} else {
					progress_bar += " ";
				}
			}
			progress_bar += "] ";
			PRINT_MESSAGE(progress_bar << " " << progress << "% progress in " << ID() << std::endl)
			next_progress_step += 5;
		}

		if (Simulator->Time() > next_logging_milestone) {
			log_file << Simulator->Time() / SIM_TIME_TO_MICROSECONDS_COEFF << "\t" << Get_device_response_time_short_term() << "\t" << Get_end_to_end_request_delay_short_term() << std::endl;
			STAT_sum_device_response_time_short_term = 0;
			STAT_sum_request_delay_short_term = 0;
			STAT_serviced_request_count_short_term = 0;
			next_logging_milestone = Simulator->Time() + logging_period;
		}
	}

// Assembly:
subq $0x178, %rsp            # imm = 0x178
movq %rdi, 0x170(%rsp)
movq %rsi, 0x168(%rsp)
movq 0x170(%rsp), %rdi
movq %rdi, 0x88(%rsp)
addq $0x118, %rdi            # imm = 0x118
movq 0x168(%rsp), %rax
movzwl 0xc(%rax), %eax
movq %rax, 0x158(%rsp)
leaq 0x158(%rsp), %rsi
callq 0x34310
movq 0x88(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x160(%rsp)
addq $0x118, %rdi            # imm = 0x118
movq 0x168(%rsp), %rax
movzwl 0xc(%rax), %eax
movq %rax, 0x150(%rsp)
leaq 0x150(%rsp), %rsi
callq 0x34340
movq 0x88(%rsp), %rdi
addq $0xb8, %rdi
movq 0x168(%rsp), %rsi
addq $0xc, %rsi
callq 0x34020
movq %rax, 0x140(%rsp)
movb %dl, 0x148(%rsp)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq 0x160(%rsp), %rcx
subq 0x8(%rcx), %rax
movq %rax, 0x138(%rsp)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq 0x88(%rsp), %rcx
movq 0x160(%rsp), %rdx
subq (%rdx), %rax
movq %rax, 0x130(%rsp)
movl 0x160(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x160(%rcx)
movl 0x468(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x468(%rcx)
movq 0x138(%rsp), %rax
addq 0x170(%rcx), %rax
movq %rax, 0x170(%rcx)
movq 0x138(%rsp), %rax
addq 0x458(%rcx), %rax
movq %rax, 0x458(%rcx)
movq 0x130(%rsp), %rax
addq 0x1b8(%rcx), %rax
movq %rax, 0x1b8(%rcx)
movq 0x130(%rsp), %rax
addq 0x460(%rcx), %rax
movq %rax, 0x460(%rcx)
movq 0x138(%rsp), %rax
cmpq 0x1a0(%rcx), %rax
jbe 0x313a0
movq 0x88(%rsp), %rax
movq 0x138(%rsp), %rcx
movq %rcx, 0x1a0(%rax)
movq 0x88(%rsp), %rcx
movq 0x138(%rsp), %rax
cmpq 0x188(%rcx), %rax
jae 0x313d0
movq 0x88(%rsp), %rax
movq 0x138(%rsp), %rcx
movq %rcx, 0x188(%rax)
movq 0x88(%rsp), %rcx
movq 0x130(%rsp), %rax
cmpq 0x1e8(%rcx), %rax
jbe 0x31400
movq 0x88(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, 0x1e8(%rax)
movq 0x88(%rsp), %rcx
movq 0x130(%rsp), %rax
cmpq 0x1d0(%rcx), %rax
jae 0x31430
movq 0x88(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, 0x1d0(%rax)
movq 0x88(%rsp), %rax
movq 0x160(%rsp), %rcx
movl 0x18(%rcx), %ecx
shll $0x9, %ecx
movl %ecx, %ecx
addq 0x200(%rax), %rcx
movq %rcx, 0x200(%rax)
movq 0x160(%rsp), %rax
cmpl $0x0, 0x1c(%rax)
jne 0x3158e
movq 0x88(%rsp), %rcx
movl 0x164(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x164(%rcx)
movq 0x138(%rsp), %rax
addq 0x178(%rcx), %rax
movq %rax, 0x178(%rcx)
movq 0x130(%rsp), %rax
addq 0x1c0(%rcx), %rax
movq %rax, 0x1c0(%rcx)
movq 0x138(%rsp), %rax
cmpq 0x1a8(%rcx), %rax
jbe 0x314d3
movq 0x88(%rsp), %rax
movq 0x138(%rsp), %rcx
movq %rcx, 0x1a8(%rax)
movq 0x88(%rsp), %rcx
movq 0x138(%rsp), %rax
cmpq 0x190(%rcx), %rax
jae 0x31503
movq 0x88(%rsp), %rax
movq 0x138(%rsp), %rcx
movq %rcx, 0x190(%rax)
movq 0x88(%rsp), %rcx
movq 0x130(%rsp), %rax
cmpq 0x1f0(%rcx), %rax
jbe 0x31533
movq 0x88(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, 0x1f0(%rax)
movq 0x88(%rsp), %rcx
movq 0x130(%rsp), %rax
cmpq 0x1d8(%rcx), %rax
jae 0x31563
movq 0x88(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, 0x1d8(%rax)
movq 0x88(%rsp), %rax
movq 0x160(%rsp), %rcx
movl 0x18(%rcx), %ecx
shll $0x9, %ecx
movl %ecx, %ecx
addq 0x208(%rax), %rcx
movq %rcx, 0x208(%rax)
jmp 0x316af
movq 0x88(%rsp), %rcx
movl 0x168(%rcx), %eax
addl $0x1, %eax
movl %eax, 0x168(%rcx)
movq 0x138(%rsp), %rax
addq 0x180(%rcx), %rax
movq %rax, 0x180(%rcx)
movq 0x130(%rsp), %rax
addq 0x1c8(%rcx), %rax
movq %rax, 0x1c8(%rcx)
movq 0x138(%rsp), %rax
cmpq 0x1b0(%rcx), %rax
jbe 0x315f9
movq 0x88(%rsp), %rax
movq 0x138(%rsp), %rcx
movq %rcx, 0x1b0(%rax)
movq 0x88(%rsp), %rcx
movq 0x138(%rsp), %rax
cmpq 0x198(%rcx), %rax
jae 0x31629
movq 0x88(%rsp), %rax
movq 0x138(%rsp), %rcx
movq %rcx, 0x198(%rax)
movq 0x88(%rsp), %rcx
movq 0x130(%rsp), %rax
cmpq 0x1f8(%rcx), %rax
jbe 0x31659
movq 0x88(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, 0x1f8(%rax)
movq 0x88(%rsp), %rcx
movq 0x130(%rsp), %rax
cmpq 0x1e0(%rcx), %rax
jae 0x31689
movq 0x88(%rsp), %rax
movq 0x130(%rsp), %rcx
movq %rcx, 0x1e0(%rax)
movq 0x88(%rsp), %rax
movq 0x160(%rsp), %rcx
movl 0x18(%rcx), %ecx
shll $0x9, %ecx
movl %ecx, %ecx
addq 0x210(%rax), %rcx
movq %rcx, 0x210(%rax)
movq 0x160(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, %rax
je 0x316d2
movq 0x80(%rsp), %rdi
callq 0x8410
movq 0x88(%rsp), %rax
movq 0x168(%rsp), %rcx
movw 0x8(%rcx), %cx
movw %cx, 0x80(%rax)
movq 0x88(%rsp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x34370
cmpq $0x0, %rax
jbe 0x319f9
movq 0x88(%rsp), %rcx
movzwl 0x82(%rcx), %eax
movzwl 0x84(%rcx), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x3174b
movq 0x88(%rsp), %rcx
movzwl 0x82(%rcx), %eax
addl $0x1, %eax
movzwl 0x80(%rcx), %ecx
cmpl %ecx, %eax
je 0x319f2
jmp 0x31763
movq 0x88(%rsp), %rax
movzwl 0x80(%rax), %eax
cmpl $0x0, %eax
je 0x319f2
movq 0x88(%rsp), %rdi
addq $0xb8, %rdi
callq 0x343a0
cmpq $0x0, %rax
jbe 0x319f2
movq 0x88(%rsp), %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x343b0
movq 0x88(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x128(%rsp)
addq $0x100, %rdi            # imm = 0x100
callq 0x343e0
movq 0x88(%rsp), %rdi
movq %rdi, %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, 0x78(%rsp)
addq $0xb8, %rdi
callq 0x34410
movq %rax, 0x118(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x34440
movq 0x78(%rsp), %rdi
movzwl (%rax), %eax
movq %rax, 0x120(%rsp)
leaq 0x120(%rsp), %rsi
callq 0x34310
cmpq $0x0, (%rax)
je 0x31859
movq 0xa87db(%rip), %rdi     # 0xd9ff0
leaq 0x790cc(%rip), %rsi     # 0xaa8e8
callq 0x8440
movq 0xa87c8(%rip), %rdi     # 0xd9ff0
leaq 0x7a277(%rip), %rsi     # 0xabaa6
callq 0x8440
movq %rax, %rdi
movq 0xa871a(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0xa8786(%rip), %rdi     # 0xd9fd0
callq 0x84f0
movl $0x1, %edi
callq 0x8500
movq 0x88(%rsp), %rdi
addq $0xb8, %rdi
callq 0x34410
movq %rax, 0x110(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x34440
movq 0x88(%rsp), %rdi
movw (%rax), %cx
movq 0x128(%rsp), %rax
movw %cx, 0x20(%rax)
movq 0x128(%rsp), %rax
movq %rax, 0x60(%rsp)
movq %rdi, %rax
addq $0x118, %rax            # imm = 0x118
movq %rax, 0x58(%rsp)
addq $0xb8, %rdi
callq 0x34410
movq %rax, 0x100(%rsp)
leaq 0x100(%rsp), %rdi
callq 0x34440
movq 0x58(%rsp), %rdi
movzwl (%rax), %eax
movq %rax, 0x108(%rsp)
leaq 0x108(%rsp), %rsi
callq 0x34310
movq 0x60(%rsp), %rcx
movq 0x88(%rsp), %rdi
movq %rcx, (%rax)
movq %rdi, %rax
addq $0xb8, %rax
movq %rax, 0x68(%rsp)
addq $0xb8, %rdi
callq 0x34410
movq 0x68(%rsp), %rdi
movq %rax, 0xf8(%rsp)
movq 0xf8(%rsp), %rsi
callq 0x34460
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, 0xf0(%rsp)
movq 0x128(%rsp), %rcx
movq %rcx, 0x70(%rsp)
movq %rax, %rdi
addq $0xe8, %rdi
movzwl 0x82(%rax), %eax
movl %eax, %esi
callq 0x344b0
movq 0x70(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq %rdx, (%rax)
movw 0x82(%rcx), %ax
addw $0x1, %ax
movw %ax, 0x82(%rcx)
movzwl 0x82(%rcx), %eax
movzwl 0x84(%rcx), %ecx
cmpl %ecx, %eax
jne 0x319b3
movq 0x88(%rsp), %rax
movw $0x0, 0x82(%rax)
jmp 0x319b5
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq %rax, %rdx
movq 0x88(%rsp), %rax
movq 0x128(%rsp), %rcx
movq %rdx, 0x8(%rcx)
movq 0x58(%rax), %rdi
movq 0x88(%rax), %rsi
movzwl 0x82(%rax), %edx
callq 0x3f620
jmp 0x319f4
jmp 0x319f9
jmp 0x316ed
movq 0x168(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
je 0x31a16
movq 0x50(%rsp), %rdi
callq 0x8410
movq 0x88(%rsp), %rax
cmpq $0x0, 0x48(%rax)
jbe 0x31a98
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq %rax, %rcx
movq 0x88(%rsp), %rax
movq %rcx, %xmm0
movaps 0x79f67(%rip), %xmm3    # 0xab9b0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x79f6b(%rip), %xmm2    # 0xab9c0
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x48(%rax), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0x79650(%rip), %xmm1    # 0xab0d8
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x218(%rax)
jmp 0x31acd
movq 0x88(%rsp), %rax
movl 0x50(%rax), %ecx
movl 0x160(%rax), %edx
cvtsi2sd %rdx, %xmm0
cvtsi2sd %rcx, %xmm1
divsd %xmm1, %xmm0
movsd 0x79619(%rip), %xmm1    # 0xab0d8
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %ecx
movl %ecx, 0x218(%rax)
movq 0x88(%rsp), %rcx
movl 0x218(%rcx), %eax
cmpl 0x21c(%rcx), %eax
jl 0x31d27
leaq 0xd0(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x85e0
movq 0x48(%rsp), %rdi
movl $0x64, 0xcc(%rsp)
leaq 0x79f82(%rip), %rsi     # 0xaba92
callq 0x8430
jmp 0x31b17
movq 0x88(%rsp), %rax
movl 0x218(%rax), %eax
movl %eax, 0xb8(%rsp)
movl $0x0, 0xb4(%rsp)
movl 0xb4(%rsp), %eax
cmpl 0xcc(%rsp), %eax
jge 0x31be6
movl 0xb4(%rsp), %eax
cmpl 0xb8(%rsp), %eax
jge 0x31b8c
leaq 0x77a8f(%rip), %rsi     # 0xa95f1
leaq 0xd0(%rsp), %rdi
callq 0x8430
jmp 0x31b71
jmp 0x31bce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x31d15
movl 0xb4(%rsp), %eax
cmpl 0xb8(%rsp), %eax
jne 0x31bb4
leaq 0x779df(%rip), %rsi     # 0xa9582
leaq 0xd0(%rsp), %rdi
callq 0x8430
jmp 0x31bb2
jmp 0x31bcc
leaq 0x7a2e3(%rip), %rsi     # 0xabe9e
leaq 0xd0(%rsp), %rdi
callq 0x8430
jmp 0x31bca
jmp 0x31bcc
jmp 0x31bce
jmp 0x31bd0
movl 0xb4(%rsp), %eax
addl $0x5, %eax
movl %eax, 0xb4(%rsp)
jmp 0x31b37
leaq 0x79ea7(%rip), %rsi     # 0xaba94
leaq 0xd0(%rsp), %rdi
callq 0x8430
jmp 0x31bfc
movq 0xa8395(%rip), %rdi     # 0xd9f98
leaq 0xd0(%rsp), %rsi
callq 0x83e0
movq %rax, 0x40(%rsp)
jmp 0x31c17
movq 0x40(%rsp), %rdi
leaq 0x7a27b(%rip), %rsi     # 0xabe9e
callq 0x8440
movq %rax, 0x38(%rsp)
jmp 0x31c2f
movq 0x38(%rsp), %rdi
movq 0x88(%rsp), %rax
movl 0x218(%rax), %esi
callq 0x8730
movq %rax, 0x30(%rsp)
jmp 0x31c4e
movq 0x30(%rsp), %rdi
leaq 0x79e3d(%rip), %rsi     # 0xaba97
callq 0x8440
movq %rax, 0x28(%rsp)
jmp 0x31c66
movq 0x88(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0xcdf0
jmp 0x31c7d
movq 0x28(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x83e0
movq %rax, 0x20(%rsp)
jmp 0x31c96
movq 0x20(%rsp), %rdi
movq 0xa82b6(%rip), %rsi     # 0xd9f58
callq 0x8480
movq %rax, 0x18(%rsp)
jmp 0x31cae
movq 0x18(%rsp), %rdi
movq 0xa829e(%rip), %rsi     # 0xd9f58
callq 0x8480
jmp 0x31cc1
leaq 0x90(%rsp), %rdi
callq 0x8848
movq 0x88(%rsp), %rax
movl 0x21c(%rax), %ecx
addl $0x5, %ecx
movl %ecx, 0x21c(%rax)
leaq 0xd0(%rsp), %rdi
callq 0x8848
jmp 0x31d27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x8848
leaq 0xd0(%rsp), %rdi
callq 0x8848
jmp 0x31e3d
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq 0x88(%rsp), %rcx
cmpq 0x230(%rcx), %rax
jbe 0x31e35
movq 0x88(%rsp), %rax
addq $0x258, %rax            # imm = 0x258
movq %rax, (%rsp)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq (%rsp), %rdi
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movq %rax, %rsi
callq 0x8100
movq %rax, %rdi
leaq 0x79cf6(%rip), %rsi     # 0xaba7e
callq 0x8440
movq 0x88(%rsp), %rdi
movq %rax, 0x8(%rsp)
callq 0x31160
movq 0x8(%rsp), %rdi
movl %eax, %esi
callq 0x85b0
movq %rax, %rdi
leaq 0x79cc9(%rip), %rsi     # 0xaba7e
callq 0x8440
movq 0x88(%rsp), %rdi
movq %rax, 0x10(%rsp)
callq 0x311b0
movq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0x85b0
movq %rax, %rdi
movq 0xa8176(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0x88(%rsp), %rax
movq $0x0, 0x458(%rax)
movq $0x0, 0x460(%rax)
movl $0x0, 0x468(%rax)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq %rax, %rcx
movq 0x88(%rsp), %rax
addq 0x228(%rax), %rcx
movq %rcx, 0x230(%rax)
addq $0x178, %rsp            # imm = 0x178
retq
movq 0xc0(%rsp), %rdi
callq 0x8770
nopw (%rax,%rax)