// File: CMU-SAFARI[P]MQSim/src/exec/Host_System.cpp
// Function: Host_System::Host_System(Host_Parameter_Set*, bool, SSD_Components::Host_Interface_Base*)
Host_System::Host_System(Host_Parameter_Set* parameters, bool preconditioning_required, SSD_Components::Host_Interface_Base* ssd_host_interface):
	MQSimEngine::Sim_Object("Host"), preconditioning_required(preconditioning_required)
{
	Simulator->AddObject(this);

	//Create the main components of the host system
	if (((SSD_Components::Host_Interface_NVMe*)ssd_host_interface)->GetType() == HostInterface_Types::SATA) {
		this->SATA_hba = new Host_Components::SATA_HBA(ID() + ".SATA_HBA", ((SSD_Components::Host_Interface_SATA*)ssd_host_interface)->Get_ncq_depth(), parameters->SATA_Processing_Delay, NULL, NULL);
	} else {
		this->SATA_hba = NULL;
	}
	this->Link = new Host_Components::PCIe_Link(this->ID() + ".PCIeLink", NULL, NULL, parameters->PCIe_Lane_Bandwidth, parameters->PCIe_Lane_Count);
	this->PCIe_root_complex = new Host_Components::PCIe_Root_Complex(this->Link, ssd_host_interface->GetType(), this->SATA_hba, NULL);
	this->Link->Set_root_complex(this->PCIe_root_complex);
	this->PCIe_switch = new Host_Components::PCIe_Switch(this->Link, ssd_host_interface);
	this->Link->Set_pcie_switch(this->PCIe_switch);
	Simulator->AddObject(this->Link);

	//Create IO flows
	LHA_type address_range_per_flow = ssd_host_interface->Get_max_logical_sector_address() / parameters->IO_Flow_Definitions.size();
	for (uint16_t flow_id = 0; flow_id < parameters->IO_Flow_Definitions.size(); flow_id++) {
		Host_Components::IO_Flow_Base* io_flow = NULL;
		//No flow should ask for I/O queue id 0, it is reserved for NVMe Admin command queue pair
		//Hence, we use flow_id + 1 (which is equal to 1, 2, ...) as the requested I/O queue id
		uint16_t nvme_sq_size = 0, nvme_cq_size = 0;
		switch (((SSD_Components::Host_Interface_NVMe*)ssd_host_interface)->GetType()) {
			case HostInterface_Types::NVME:
				nvme_sq_size = ((SSD_Components::Host_Interface_NVMe*)ssd_host_interface)->Get_submission_queue_depth();
				nvme_cq_size = ((SSD_Components::Host_Interface_NVMe*)ssd_host_interface)->Get_completion_queue_depth();
				break;
			default:
				break;
		}

		switch (parameters->IO_Flow_Definitions[flow_id]->Type) {
			case Flow_Type::SYNTHETIC: {
				IO_Flow_Parameter_Set_Synthetic* flow_param = (IO_Flow_Parameter_Set_Synthetic*)parameters->IO_Flow_Definitions[flow_id];
				if (flow_param->Working_Set_Percentage > 100 || flow_param->Working_Set_Percentage < 1) {
					flow_param->Working_Set_Percentage = 100;
				}
				io_flow = new Host_Components::IO_Flow_Synthetic(this->ID() + ".IO_Flow.Synth.No_" + std::to_string(flow_id), flow_id,
					Utils::Logical_Address_Partitioning_Unit::Start_lha_available_to_flow(flow_id),
					Utils::Logical_Address_Partitioning_Unit::End_lha_available_to_flow(flow_id),
					((double)flow_param->Working_Set_Percentage / 100.0), FLOW_ID_TO_Q_ID(flow_id), nvme_sq_size, nvme_cq_size,
					flow_param->Priority_Class, flow_param->Read_Percentage / double(100.0), flow_param->Address_Distribution, flow_param->Percentage_of_Hot_Region / double(100.0),
					flow_param->Request_Size_Distribution, flow_param->Average_Request_Size, flow_param->Variance_Request_Size,
					flow_param->Synthetic_Generator_Type, (flow_param->Bandwidth == 0? 0 :NanoSecondCoeff / ((flow_param->Bandwidth / SECTOR_SIZE_IN_BYTE) / flow_param->Average_Request_Size)),
					flow_param->Average_No_of_Reqs_in_Queue, flow_param->Generated_Aligned_Addresses, flow_param->Address_Alignment_Unit,
					flow_param->Seed, flow_param->Stop_Time, flow_param->Initial_Occupancy_Percentage / double(100.0), flow_param->Total_Requests_To_Generate, ssd_host_interface->GetType(), this->PCIe_root_complex, this->SATA_hba,
					parameters->Enable_ResponseTime_Logging, parameters->ResponseTime_Logging_Period_Length, parameters->Input_file_path + ".IO_Flow.No_" + std::to_string(flow_id) + ".log");
				this->IO_flows.push_back(io_flow);
				break;
			}
			case Flow_Type::TRACE: {
				IO_Flow_Parameter_Set_Trace_Based * flow_param = (IO_Flow_Parameter_Set_Trace_Based*)parameters->IO_Flow_Definitions[flow_id];
				io_flow = new Host_Components::IO_Flow_Trace_Based(this->ID() + ".IO_Flow.Trace." + flow_param->File_Path, flow_id,
					Utils::Logical_Address_Partitioning_Unit::Start_lha_available_to_flow(flow_id), Utils::Logical_Address_Partitioning_Unit::End_lha_available_to_flow(flow_id),
					FLOW_ID_TO_Q_ID(flow_id), nvme_sq_size, nvme_cq_size,
					flow_param->Priority_Class, flow_param->Initial_Occupancy_Percentage / double(100.0),
					flow_param->File_Path, flow_param->Time_Unit, flow_param->Relay_Count, flow_param->Percentage_To_Be_Executed,
					ssd_host_interface->GetType(), this->PCIe_root_complex, this->SATA_hba,
					parameters->Enable_ResponseTime_Logging, parameters->ResponseTime_Logging_Period_Length, parameters->Input_file_path + ".IO_Flow.No_" + std::to_string(flow_id) + ".log");

				this->IO_flows.push_back(io_flow);
				break;
			}
			default:
				throw "The specified IO flow type is not supported.\n";
		}
		Simulator->AddObject(io_flow);
	}
	this->PCIe_root_complex->Set_io_flows(&this->IO_flows);
	if (((SSD_Components::Host_Interface_NVMe*)ssd_host_interface)->GetType() == HostInterface_Types::SATA) {
		this->SATA_hba->Set_io_flows(&this->IO_flows);
		this->SATA_hba->Set_root_complex(this->PCIe_root_complex);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x598, %rsp            # imm = 0x598
movb %dl, %al
movq %rdi, 0x590(%rsp)
movq %rsi, 0x588(%rsp)
andb $0x1, %al
movb %al, 0x587(%rsp)
movq %rcx, 0x578(%rsp)
movq 0x590(%rsp), %rax
movq %rax, 0x260(%rsp)
leaq 0x557(%rsp), %rdi
movq %rdi, 0x268(%rsp)
callq 0x8780
movq 0x268(%rsp), %rdx
leaq 0x8d238(%rip), %rsi     # 0xab0e0
leaq 0x558(%rsp), %rdi
callq 0x85d0
jmp 0x1deb7
movq 0x260(%rsp), %rdi
leaq 0x558(%rsp), %rsi
callq 0x1fd60
jmp 0x1dece
leaq 0x558(%rsp), %rdi
callq 0x8848
leaq 0x557(%rsp), %rdi
callq 0x84a0
movq 0x260(%rsp), %rdi
addq $0x30, %rdi
callq 0x1fde0
movq 0x260(%rsp), %rdi
leaq 0xbaa70(%rip), %rax     # 0xd8978
movq %rax, (%rdi)
leaq 0xbaa9e(%rip), %rax     # 0xd89b0
movq %rax, 0x30(%rdi)
addq $0x58, %rdi
movq %rdi, 0x250(%rsp)
callq 0x1fe00
movq 0x260(%rsp), %rax
movb 0x587(%rsp), %cl
andb $0x1, %cl
movb %cl, 0x78(%rax)
callq 0x46500
movq %rax, 0x258(%rsp)
jmp 0x1df4b
movq 0x260(%rsp), %rsi
movq 0x258(%rsp), %rdi
callq 0x465c0
jmp 0x1df62
movq 0x578(%rsp), %rdi
callq 0x1fe10
movl %eax, 0x24c(%rsp)
jmp 0x1df78
movl 0x24c(%rsp), %eax
cmpl $0x0, %eax
jne 0x1e139
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x8450
movq %rax, 0x240(%rsp)
jmp 0x1df9c
movq 0x260(%rsp), %rsi
movb $0x1, 0x4ff(%rsp)
leaq 0x500(%rsp), %rdi
callq 0xcdf0
jmp 0x1dfbb
leaq 0x8d123(%rip), %rdx     # 0xab0e5
leaq 0x520(%rsp), %rdi
leaq 0x500(%rsp), %rsi
callq 0xd060
jmp 0x1dfd9
movq 0x578(%rsp), %rdi
callq 0x8b270
movw %ax, 0x23e(%rsp)
jmp 0x1dff0
movq 0x240(%rsp), %rdi
movw 0x23e(%rsp), %ax
leaq 0xbc621(%rip), %rcx     # 0xda628
movq (%rcx), %rcx
movzwl %ax, %edx
xorl %eax, %eax
movl %eax, %r9d
leaq 0x520(%rsp), %rsi
movq %r9, %r8
callq 0x3f970
jmp 0x1e024
movq 0x260(%rsp), %rax
movq 0x240(%rsp), %rcx
movb $0x0, 0x4ff(%rsp)
movq %rcx, 0x50(%rax)
leaq 0x520(%rsp), %rdi
callq 0x8848
leaq 0x500(%rsp), %rdi
callq 0x8848
jmp 0x1e149
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1e096
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
leaq 0x558(%rsp), %rdi
callq 0x8848
leaq 0x557(%rsp), %rdi
callq 0x84a0
jmp 0x1f282
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f268
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1e11b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1e10e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
leaq 0x520(%rsp), %rdi
callq 0x8848
leaq 0x500(%rsp), %rdi
callq 0x8848
testb $0x1, 0x4ff(%rsp)
jne 0x1e127
jmp 0x1e134
movq 0x240(%rsp), %rdi
callq 0x8410
jmp 0x1f268
movq 0x260(%rsp), %rax
movq $0x0, 0x50(%rax)
movl $0x100, %edi            # imm = 0x100
callq 0x8450
movq %rax, 0x230(%rsp)
jmp 0x1e15d
movq 0x260(%rsp), %rsi
movb $0x1, 0x4b7(%rsp)
leaq 0x4b8(%rsp), %rdi
callq 0xcdf0
jmp 0x1e17c
leaq 0x8cf6c(%rip), %rdx     # 0xab0ef
leaq 0x4d8(%rsp), %rdi
leaq 0x4b8(%rsp), %rsi
callq 0xd060
jmp 0x1e19a
movq 0x230(%rsp), %rdi
leaq 0xbc3af(%rip), %rax     # 0xda558
movsd (%rax), %xmm0
leaq 0xbc3ac(%rip), %rax     # 0xda560
movl (%rax), %r8d
movq %rsp, %rax
movl $0x2, 0x10(%rax)
movl $0x6, 0x8(%rax)
movl $0x80, (%rax)
xorl %eax, %eax
movl %eax, %ecx
leaq 0x4d8(%rsp), %rsi
movl $0x14, %r9d
movq %rcx, %rdx
callq 0x3de50
jmp 0x1e1ea
movq 0x260(%rsp), %rax
movq 0x230(%rsp), %rcx
movb $0x0, 0x4b7(%rsp)
movq %rcx, 0x40(%rax)
leaq 0x4d8(%rsp), %rdi
callq 0x8848
leaq 0x4b8(%rsp), %rdi
callq 0x8848
movl $0x20, %edi
callq 0x8450
movq %rax, 0x228(%rsp)
jmp 0x1e234
movq 0x260(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x218(%rsp)
movq 0x578(%rsp), %rdi
callq 0x1fe10
movl %eax, 0x224(%rsp)
jmp 0x1e25e
movl 0x224(%rsp), %edx
movq 0x218(%rsp), %rsi
movq 0x228(%rsp), %rdi
movq 0x260(%rsp), %rax
movq 0x50(%rax), %rcx
xorl %eax, %eax
movl %eax, %r8d
callq 0x3f4f0
jmp 0x1e28d
movq 0x260(%rsp), %rax
movq 0x228(%rsp), %rcx
movq %rcx, 0x38(%rax)
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdi
callq 0x3df60
jmp 0x1e2b0
movl $0x10, %edi
callq 0x8450
movq %rax, 0x210(%rsp)
jmp 0x1e2c4
movq 0x210(%rsp), %rdi
movq 0x260(%rsp), %rax
movq 0x40(%rax), %rsi
movq 0x578(%rsp), %rdx
callq 0x3f800
jmp 0x1e2e7
movq 0x260(%rsp), %rax
movq 0x210(%rsp), %rcx
movq %rcx, 0x48(%rax)
movq 0x40(%rax), %rdi
movq 0x48(%rax), %rsi
callq 0x3df80
jmp 0x1e30a
callq 0x46500
movq %rax, 0x208(%rsp)
jmp 0x1e319
movq 0x208(%rsp), %rdi
movq 0x260(%rsp), %rax
movq 0x40(%rax), %rsi
callq 0x465c0
jmp 0x1e334
movq 0x578(%rsp), %rdi
callq 0x84880
movq %rax, 0x200(%rsp)
jmp 0x1e34b
leaq 0xbc306(%rip), %rdi     # 0xda658
callq 0x11420
movq %rax, %rcx
movq 0x200(%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, 0x4a8(%rsp)
movw $0x0, 0x4a6(%rsp)
movzwl 0x4a6(%rsp), %eax
movq %rax, 0x1f8(%rsp)
leaq 0xbc2c8(%rip), %rdi     # 0xda658
callq 0x11420
movq %rax, %rcx
movq 0x1f8(%rsp), %rax
cmpq %rcx, %rax
jae 0x1f1ed
movq $0x0, 0x498(%rsp)
movw $0x0, 0x496(%rsp)
movw $0x0, 0x494(%rsp)
movq 0x578(%rsp), %rdi
callq 0x1fe10
movl %eax, 0x1f4(%rsp)
jmp 0x1e3df
movl 0x1f4(%rsp), %eax
subl $0x1, %eax
je 0x1e4b8
jmp 0x1e508
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1e44e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1e441
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
leaq 0x4d8(%rsp), %rdi
callq 0x8848
leaq 0x4b8(%rsp), %rdi
callq 0x8848
testb $0x1, 0x4b7(%rsp)
jne 0x1e45a
jmp 0x1e467
movq 0x230(%rsp), %rdi
callq 0x8410
jmp 0x1f268
movq 0x228(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
callq 0x8410
jmp 0x1f268
movq 0x210(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
callq 0x8410
jmp 0x1f268
movq 0x578(%rsp), %rdi
callq 0x86e50
movw %ax, 0x1f2(%rsp)
jmp 0x1e4cf
movw 0x1f2(%rsp), %ax
movw %ax, 0x496(%rsp)
movq 0x578(%rsp), %rdi
callq 0x86e70
movw %ax, 0x1f0(%rsp)
jmp 0x1e4f6
movw 0x1f0(%rsp), %ax
movw %ax, 0x494(%rsp)
jmp 0x1e50a
jmp 0x1e50a
movzwl 0x4a6(%rsp), %eax
movl %eax, %esi
leaq 0xbc13d(%rip), %rdi     # 0xda658
callq 0x1fe20
movq (%rax), %rax
movl 0xc(%rax), %eax
movl %eax, 0x1ec(%rsp)
testl %eax, %eax
je 0x1e548
jmp 0x1e533
movl 0x1ec(%rsp), %eax
subl $0x1, %eax
je 0x1ec5f
jmp 0x1f180
movzwl 0x4a6(%rsp), %eax
movl %eax, %esi
leaq 0xbc0ff(%rip), %rdi     # 0xda658
callq 0x1fe20
movq (%rax), %rax
movq %rax, 0x488(%rsp)
movq 0x488(%rsp), %rax
cmpl $0x64, 0x4c(%rax)
ja 0x1e585
movq 0x488(%rsp), %rax
cmpl $0x1, 0x4c(%rax)
jae 0x1e594
movq 0x488(%rsp), %rax
movl $0x64, 0x4c(%rax)
movl $0x520, %edi            # imm = 0x520
callq 0x8450
movq %rax, 0x1e0(%rsp)
jmp 0x1e5a8
movq 0x260(%rsp), %rsi
movb $0x1, 0x387(%rsp)
leaq 0x428(%rsp), %rdi
callq 0xcdf0
jmp 0x1e5c7
leaq 0x8cb2b(%rip), %rdx     # 0xab0f9
leaq 0x448(%rsp), %rdi
leaq 0x428(%rsp), %rsi
callq 0xd060
jmp 0x1e5e5
movzwl 0x4a6(%rsp), %esi
leaq 0x408(%rsp), %rdi
callq 0xd1a0
jmp 0x1e5fc
leaq 0x468(%rsp), %rdi
leaq 0x448(%rsp), %rsi
leaq 0x408(%rsp), %rdx
callq 0xd0b0
jmp 0x1e61b
movw 0x4a6(%rsp), %ax
movw %ax, 0x1d6(%rsp)
movzwl %ax, %edi
callq 0xa6870
movq %rax, 0x1d8(%rsp)
jmp 0x1e63d
movzwl 0x4a6(%rsp), %edi
callq 0xa6940
movq %rax, 0x1c8(%rsp)
jmp 0x1e654
movq 0x488(%rsp), %rax
movl 0x4c(%rax), %eax
cvtsi2sd %rax, %xmm0
movsd 0x8ca6c(%rip), %xmm1    # 0xab0d8
divsd %xmm1, %xmm0
movsd %xmm0, 0x188(%rsp)
movzwl 0x4a6(%rsp), %eax
addl $0x1, %eax
movw %ax, 0x196(%rsp)
movw 0x496(%rsp), %ax
movw %ax, 0x198(%rsp)
movw 0x494(%rsp), %ax
movw %ax, 0x19a(%rsp)
movq 0x488(%rsp), %rax
movl 0x10(%rax), %eax
movl %eax, 0x19c(%rsp)
movq 0x488(%rsp), %rax
movsbl 0x54(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x8ca02(%rip), %xmm1    # 0xab0d8
divsd %xmm1, %xmm0
movsd %xmm0, 0x1a0(%rsp)
movq 0x488(%rsp), %rax
movl 0x58(%rax), %eax
movl %eax, 0x1ac(%rsp)
movq 0x488(%rsp), %rax
movsbl 0x5c(%rax), %eax
cvtsi2sd %eax, %xmm0
movsd 0x8c9cb(%rip), %xmm1    # 0xab0d8
divsd %xmm1, %xmm0
movsd %xmm0, 0x1b0(%rsp)
movq 0x488(%rsp), %rax
movl 0x64(%rax), %eax
movl %eax, 0x1b8(%rsp)
movq 0x488(%rsp), %rax
movl 0x68(%rax), %eax
movl %eax, 0x1bc(%rsp)
movq 0x488(%rsp), %rax
movl 0x6c(%rax), %eax
movl %eax, 0x1c0(%rsp)
movq 0x488(%rsp), %rax
movl 0x50(%rax), %eax
movl %eax, 0x1c4(%rsp)
movq 0x488(%rsp), %rax
cmpl $0x0, 0x78(%rax)
jne 0x1e77b
xorl %eax, %eax
movl %eax, 0x184(%rsp)
jmp 0x1e7a8
movq 0x488(%rsp), %rax
movl 0x78(%rax), %eax
shrl $0x9, %eax
movq 0x488(%rsp), %rcx
xorl %edx, %edx
divl 0x68(%rcx)
movl %eax, %ecx
movl $0x3b9aca00, %eax       # imm = 0x3B9ACA00
xorl %edx, %edx
divl %ecx
movl %eax, 0x184(%rsp)
movl 0x184(%rsp), %eax
movl %eax, %eax
movq %rax, 0x150(%rsp)
movq 0x488(%rsp), %rax
movl 0x74(%rax), %ecx
movl %ecx, 0x158(%rsp)
movb 0x5d(%rax), %cl
movb %cl, 0x15f(%rsp)
movl 0x60(%rax), %ecx
movl %ecx, 0x160(%rsp)
movl 0x70(%rax), %ecx
movl %ecx, 0x164(%rsp)
movq 0x80(%rax), %rcx
movq %rcx, 0x168(%rsp)
movl 0x38(%rax), %ecx
cvtsi2sd %rcx, %xmm0
movsd 0x8c8d0(%rip), %xmm1    # 0xab0d8
divsd %xmm1, %xmm0
movsd %xmm0, 0x170(%rsp)
movl 0x88(%rax), %eax
movl %eax, 0x17c(%rsp)
movq 0x578(%rsp), %rdi
callq 0x1fe10
movl %eax, 0x180(%rsp)
jmp 0x1e838
movq 0x260(%rsp), %rax
movq 0x38(%rax), %rcx
movq %rcx, 0x130(%rsp)
movq 0x50(%rax), %rax
movq %rax, 0x138(%rsp)
leaq 0xbbdd1(%rip), %rax     # 0xda630
movb (%rax), %al
movb %al, 0x147(%rsp)
leaq 0xbbcf9(%rip), %rax     # 0xda568
movq (%rax), %rax
movq %rax, 0x148(%rsp)
leaq 0xbbdb7(%rip), %rsi     # 0xda638
leaq 0x8c884(%rip), %rdx     # 0xab10c
leaq 0x3a8(%rsp), %rdi
callq 0x1fe40
jmp 0x1e897
movzwl 0x4a6(%rsp), %esi
leaq 0x388(%rsp), %rdi
callq 0xd1a0
jmp 0x1e8ae
leaq 0x3c8(%rsp), %rdi
leaq 0x3a8(%rsp), %rsi
leaq 0x388(%rsp), %rdx
callq 0xd0b0
jmp 0x1e8cd
leaq 0x8c845(%rip), %rdx     # 0xab119
leaq 0x3e8(%rsp), %rdi
leaq 0x3c8(%rsp), %rsi
callq 0xd060
jmp 0x1e8eb
movsd 0x170(%rsp), %xmm3
movsd 0x1b0(%rsp), %xmm2
movsd 0x1a0(%rsp), %xmm1
movsd 0x188(%rsp), %xmm0
movq 0x1c8(%rsp), %r8
movq 0x1d8(%rsp), %rcx
movq 0x1e0(%rsp), %rdi
movw 0x1d6(%rsp), %dx
movw 0x198(%rsp), %r9w
movw 0x19a(%rsp), %r10w
movl 0x19c(%rsp), %r11d
movl 0x1ac(%rsp), %ebx
movl 0x1b8(%rsp), %ebp
movl 0x1bc(%rsp), %r14d
movl 0x1c0(%rsp), %r15d
movl 0x1c4(%rsp), %r12d
movq 0x150(%rsp), %r13
movq %rsp, %rsi
movq %rsi, 0x128(%rsp)
leaq 0x3e8(%rsp), %rax
movq %rax, 0xa0(%rsi)
movq 0x148(%rsp), %rax
movq %rax, 0x98(%rsi)
movb 0x147(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x90(%rsi)
movq 0x138(%rsp), %rax
movq %rax, 0x88(%rsi)
movq 0x130(%rsp), %rax
movq %rax, 0x80(%rsi)
movl 0x180(%rsp), %eax
movl %eax, 0x78(%rsi)
movl 0x17c(%rsp), %eax
movl %eax, 0x70(%rsi)
movq 0x168(%rsp), %rax
movq %rax, 0x68(%rsi)
movl 0x164(%rsp), %eax
movl %eax, 0x60(%rsi)
movl 0x160(%rsp), %eax
movl %eax, 0x58(%rsi)
movb 0x15f(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x50(%rsi)
movl 0x158(%rsp), %eax
movl %eax, 0x48(%rsi)
movw 0x196(%rsp), %ax
movq %r13, 0x40(%rsi)
movl %r12d, 0x38(%rsi)
movl %r15d, 0x30(%rsi)
movl %r14d, 0x28(%rsi)
movl %ebp, 0x20(%rsi)
movl %ebx, 0x18(%rsi)
movl %r11d, 0x10(%rsi)
movzwl %r10w, %r10d
movl %r10d, 0x8(%rsi)
movzwl %r9w, %r9d
movl %r9d, (%rsi)
movzwl %dx, %edx
movzwl %ax, %r9d
leaq 0x468(%rsp), %rsi
callq 0x37b40
jmp 0x1ea66
movq 0x1e0(%rsp), %rax
movb $0x0, 0x387(%rsp)
movq %rax, 0x498(%rsp)
leaq 0x3e8(%rsp), %rdi
callq 0x8848
leaq 0x3c8(%rsp), %rdi
callq 0x8848
leaq 0x388(%rsp), %rdi
callq 0x8848
leaq 0x3a8(%rsp), %rdi
callq 0x8848
leaq 0x468(%rsp), %rdi
callq 0x8848
leaq 0x408(%rsp), %rdi
callq 0x8848
leaq 0x448(%rsp), %rdi
callq 0x8848
leaq 0x428(%rsp), %rdi
callq 0x8848
movq 0x260(%rsp), %rdi
addq $0x58, %rdi
leaq 0x498(%rsp), %rsi
callq 0x1fed0
jmp 0x1eb01
jmp 0x1f1ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ec41
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ec34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ec27
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ec1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ec0d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ec00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ebf3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1ebe6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
leaq 0x3e8(%rsp), %rdi
callq 0x8848
leaq 0x3c8(%rsp), %rdi
callq 0x8848
leaq 0x388(%rsp), %rdi
callq 0x8848
leaq 0x3a8(%rsp), %rdi
callq 0x8848
leaq 0x468(%rsp), %rdi
callq 0x8848
leaq 0x408(%rsp), %rdi
callq 0x8848
leaq 0x448(%rsp), %rdi
callq 0x8848
leaq 0x428(%rsp), %rdi
callq 0x8848
testb $0x1, 0x387(%rsp)
jne 0x1ec4d
jmp 0x1ec5a
movq 0x1e0(%rsp), %rdi
callq 0x8410
jmp 0x1f268
movzwl 0x4a6(%rsp), %eax
movl %eax, %esi
leaq 0xbb9e8(%rip), %rdi     # 0xda658
callq 0x1fe20
movq (%rax), %rax
movq %rax, 0x378(%rsp)
movl $0x6d0, %edi            # imm = 0x6D0
callq 0x8450
movq %rax, 0x120(%rsp)
jmp 0x1ec94
movq 0x260(%rsp), %rsi
movb $0x1, 0x277(%rsp)
leaq 0x318(%rsp), %rdi
callq 0xcdf0
jmp 0x1ecb3
leaq 0x8c464(%rip), %rdx     # 0xab11e
leaq 0x338(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0xd060
jmp 0x1ecd1
movq 0x378(%rsp), %rdx
addq $0x50, %rdx
leaq 0x358(%rsp), %rdi
leaq 0x338(%rsp), %rsi
callq 0x1ff40
jmp 0x1ecf4
movw 0x4a6(%rsp), %ax
movw %ax, 0x116(%rsp)
movzwl %ax, %edi
callq 0xa6870
movq %rax, 0x118(%rsp)
jmp 0x1ed16
movzwl 0x4a6(%rsp), %edi
callq 0xa6940
movq %rax, 0x108(%rsp)
jmp 0x1ed2d
movzwl 0x4a6(%rsp), %eax
incl %eax
movw %ax, 0xf6(%rsp)
movw 0x496(%rsp), %ax
movw %ax, 0xf8(%rsp)
movw 0x494(%rsp), %ax
movw %ax, 0xfa(%rsp)
movq 0x378(%rsp), %rsi
movl 0x10(%rsi), %eax
movl %eax, 0xfc(%rsp)
movl 0x38(%rsi), %eax
cvtsi2sd %rax, %xmm0
movsd 0x8c357(%rip), %xmm1    # 0xab0d8
divsd %xmm1, %xmm0
movsd %xmm0, 0x100(%rsp)
addq $0x50, %rsi
leaq 0x2f8(%rsp), %rdi
callq 0x81a0
jmp 0x1eda1
movq 0x378(%rsp), %rax
movl 0x78(%rax), %ecx
movl %ecx, 0xe4(%rsp)
movl 0x70(%rax), %ecx
movl %ecx, 0xe8(%rsp)
movl 0x74(%rax), %eax
movl %eax, 0xec(%rsp)
movq 0x578(%rsp), %rdi
callq 0x1fe10
movl %eax, 0xf0(%rsp)
jmp 0x1eddd
movq 0x260(%rsp), %rax
movq 0x38(%rax), %rcx
movq %rcx, 0xc0(%rsp)
movq 0x50(%rax), %rax
movq %rax, 0xc8(%rsp)
leaq 0xbb82c(%rip), %rax     # 0xda630
movb (%rax), %al
movb %al, 0xd7(%rsp)
leaq 0xbb754(%rip), %rax     # 0xda568
movq (%rax), %rax
movq %rax, 0xd8(%rsp)
leaq 0xbb812(%rip), %rsi     # 0xda638
leaq 0x8c2df(%rip), %rdx     # 0xab10c
leaq 0x298(%rsp), %rdi
callq 0x1fe40
jmp 0x1ee3c
movzwl 0x4a6(%rsp), %esi
leaq 0x278(%rsp), %rdi
callq 0xd1a0
jmp 0x1ee53
leaq 0x2b8(%rsp), %rdi
leaq 0x298(%rsp), %rsi
leaq 0x278(%rsp), %rdx
callq 0xd0b0
jmp 0x1ee72
leaq 0x8c2a0(%rip), %rdx     # 0xab119
leaq 0x2d8(%rsp), %rdi
leaq 0x2b8(%rsp), %rsi
callq 0xd060
jmp 0x1ee90
movsd 0x100(%rsp), %xmm0
movq 0x108(%rsp), %r8
movq 0x118(%rsp), %rcx
movq 0x120(%rsp), %rdi
movw 0x116(%rsp), %dx
movw 0xf8(%rsp), %r9w
movw 0xfa(%rsp), %r10w
movl 0xfc(%rsp), %r11d
movl 0xe4(%rsp), %ebx
movl 0xec(%rsp), %ebp
movl 0xe8(%rsp), %r14d
movl 0xf0(%rsp), %r15d
movq 0xc0(%rsp), %r12
movq 0xc8(%rsp), %r13
movq %rsp, %rsi
movq %rsi, 0xb8(%rsp)
leaq 0x2d8(%rsp), %rax
movq %rax, 0x60(%rsi)
movq 0xd8(%rsp), %rax
movq %rax, 0x58(%rsi)
movb 0xd7(%rsp), %al
movzbl %al, %eax
andl $0x1, %eax
movl %eax, 0x50(%rsi)
movw 0xf6(%rsp), %ax
movq %r13, 0x48(%rsi)
movq %r12, 0x40(%rsi)
movl %r15d, 0x38(%rsi)
movl %r14d, 0x30(%rsi)
movl %ebp, 0x28(%rsi)
movl %ebx, 0x20(%rsi)
leaq 0x2f8(%rsp), %rbx
movq %rbx, 0x18(%rsi)
movl %r11d, 0x10(%rsi)
movzwl %r10w, %r10d
movl %r10d, 0x8(%rsi)
movzwl %r9w, %r9d
movl %r9d, (%rsi)
movzwl %dx, %edx
movzwl %ax, %r9d
leaq 0x358(%rsp), %rsi
callq 0x39130
jmp 0x1ef87
movq 0x120(%rsp), %rax
movb $0x0, 0x277(%rsp)
movq %rax, 0x498(%rsp)
leaq 0x2d8(%rsp), %rdi
callq 0x8848
leaq 0x2b8(%rsp), %rdi
callq 0x8848
leaq 0x278(%rsp), %rdi
callq 0x8848
leaq 0x298(%rsp), %rdi
callq 0x8848
leaq 0x2f8(%rsp), %rdi
callq 0x8848
leaq 0x358(%rsp), %rdi
callq 0x8848
leaq 0x338(%rsp), %rdi
callq 0x8848
leaq 0x318(%rsp), %rdi
callq 0x8848
movq 0x260(%rsp), %rdi
addq $0x58, %rdi
leaq 0x498(%rsp), %rsi
callq 0x1fed0
jmp 0x1f022
jmp 0x1f1ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f162
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f155
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f148
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f13b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f12e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f121
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f114
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
jmp 0x1f107
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x548(%rsp)
movl %eax, 0x544(%rsp)
leaq 0x2d8(%rsp), %rdi
callq 0x8848
leaq 0x2b8(%rsp), %rdi
callq 0x8848
leaq 0x278(%rsp), %rdi
callq 0x8848
leaq 0x298(%rsp), %rdi
callq 0x8848
leaq 0x2f8(%rsp), %rdi
callq 0x8848
leaq 0x358(%rsp), %rdi
callq 0x8848
leaq 0x338(%rsp), %rdi
callq 0x8848
leaq 0x318(%rsp), %rdi
callq 0x8848
testb $0x1, 0x277(%rsp)
jne 0x1f16e
jmp 0x1f17b
movq 0x120(%rsp), %rdi
callq 0x8410
jmp 0x1f268
movl $0x8, %edi
callq 0x8200
movq %rax, %rdi
leaq 0x8bf9a(%rip), %rax     # 0xab12e
movq %rax, (%rdi)
movq 0xbadc2(%rip), %rsi     # 0xd9f60
xorl %eax, %eax
movl %eax, %edx
callq 0x8710
jmp 0x1f28f
callq 0x46500
movq %rax, 0xb0(%rsp)
jmp 0x1f1bb
movq 0xb0(%rsp), %rdi
movq 0x498(%rsp), %rsi
callq 0x465c0
jmp 0x1f1d2
jmp 0x1f1d4
movw 0x4a6(%rsp), %ax
addw $0x1, %ax
movw %ax, 0x4a6(%rsp)
jmp 0x1e379
movq 0x260(%rsp), %rsi
movq 0x38(%rsi), %rdi
addq $0x58, %rsi
callq 0x3f7e0
jmp 0x1f204
movq 0x578(%rsp), %rdi
callq 0x1fe10
movl %eax, 0xac(%rsp)
jmp 0x1f21a
movl 0xac(%rsp), %eax
cmpl $0x0, %eax
jne 0x1f256
movq 0x260(%rsp), %rsi
movq 0x50(%rsi), %rdi
addq $0x58, %rsi
callq 0x408a0
jmp 0x1f23d
movq 0x260(%rsp), %rax
movq 0x38(%rax), %rsi
movq 0x50(%rax), %rdi
callq 0x408c0
jmp 0x1f254
jmp 0x1f256
addq $0x598, %rsp            # imm = 0x598
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x250(%rsp), %rdi
callq 0xce20
movq 0x260(%rsp), %rdi
callq 0x1ff90
movq 0x548(%rsp), %rdi
callq 0x8770
nop