// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Manager_Flash_Advanced.cpp
// Function: SSD_Components::Data_Cache_Manager_Flash_Advanced::service_dram_access_request(SSD_Components::Memory_Transfer_Info*)
void Data_Cache_Manager_Flash_Advanced::service_dram_access_request(Memory_Transfer_Info* request_info)
	{
		if (memory_channel_is_busy) {
			if(shared_dram_request_queue) {
				dram_execution_queue[0].push(request_info);
			} else {
				dram_execution_queue[request_info->Stream_id].push(request_info);
			}
		} else {
			Simulator->Register_sim_event(Simulator->Time() + estimate_dram_access_time(request_info->Size_in_bytes, dram_row_size,
				dram_busrt_size, dram_burst_transfer_time_ddr, dram_tRCD, dram_tCL, dram_tRP),
				this, request_info, static_cast<int>(request_info->next_event_type));
			memory_channel_is_busy = true;
			dram_execution_list_turn = request_info->Stream_id;
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
cmpb $0x1, 0xc8(%rdi)
jne 0x3417a
movq 0xd0(%rbx), %rdi
cmpb $0x1, 0xe0(%rbx)
jne 0x34316
movq 0x30(%rdi), %rax
movq 0x40(%rdi), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x343a1
movq %rsi, (%rax)
addq $0x8, 0x30(%rdi)
jmp 0x343b5
callq 0x281b4
movq %rax, %r14
callq 0x281b4
movq %rax, %rdi
callq 0x285a6
movq %rax, %r10
movq 0x8(%rsp), %rcx
movl (%rcx), %edi
movl 0x40(%rbx), %r8d
movl 0x48(%rbx), %esi
movsd 0x50(%rbx), %xmm0
movq 0x58(%rbx), %r15
movq 0x60(%rbx), %r11
cmpl %r8d, %edi
jbe 0x34342
movl %r8d, %eax
xorl %edx, %edx
divl %esi
movl %eax, %r9d
movq 0x68(%rbx), %xmm3
movl %edi, %eax
xorl %edx, %edx
divl %r8d
leaq (%r11,%r15), %rdi
movq %rdi, %xmm5
movq 0x236e3(%rip), %xmm1    # 0x578c0
punpckldq %xmm1, %xmm5    # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
movapd 0x236e7(%rip), %xmm2    # 0x578d0
subpd %xmm2, %xmm5
movapd %xmm5, %xmm4
unpckhpd %xmm5, %xmm4            # xmm4 = xmm4[1],xmm5[1]
addsd %xmm5, %xmm4
shrl %r9d
xorps %xmm5, %xmm5
cvtsi2sd %r9d, %xmm5
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
subpd %xmm2, %xmm3
movapd %xmm3, %xmm6
unpckhpd %xmm3, %xmm6            # xmm6 = xmm6[1],xmm3[1]
addsd %xmm3, %xmm6
mulsd %xmm0, %xmm5
addsd %xmm6, %xmm5
cvttsd2si %xmm5, %rdi
movq %rdi, %r8
sarq $0x3f, %r8
movsd 0x20e1c(%rip), %xmm3    # 0x55050
subsd %xmm3, %xmm5
cvttsd2si %xmm5, %r9
andq %r8, %r9
orq %rdi, %r9
movq %r9, %xmm5
punpckldq %xmm1, %xmm5    # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
subpd %xmm2, %xmm5
movapd %xmm5, %xmm6
unpckhpd %xmm5, %xmm6            # xmm6 = xmm6[1],xmm5[1]
addsd %xmm5, %xmm6
shrl %eax
xorps %xmm5, %xmm5
cvtsi2sd %eax, %xmm5
mulsd %xmm6, %xmm5
addsd %xmm4, %xmm5
movq %r15, %xmm4
punpckldq %xmm1, %xmm4    # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
subpd %xmm2, %xmm4
movapd %xmm4, %xmm6
unpckhpd %xmm4, %xmm6            # xmm6 = xmm6[1],xmm4[1]
addsd %xmm4, %xmm6
addsd %xmm5, %xmm6
movq %r11, %xmm5
punpckldq %xmm1, %xmm5    # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
subpd %xmm2, %xmm5
movapd %xmm5, %xmm4
unpckhpd %xmm5, %xmm4            # xmm4 = xmm4[1],xmm5[1]
addsd %xmm5, %xmm4
xorps %xmm5, %xmm5
cvtsi2sd %rdx, %xmm5
addsd %xmm6, %xmm4
movl %esi, %eax
xorps %xmm6, %xmm6
cvtsi2sd %rax, %xmm6
mulsd %xmm0, %xmm6
divsd %xmm6, %xmm5
cvttsd2si %xmm5, %rax
movq %rax, %rdx
subsd %xmm3, %xmm5
cvttsd2si %xmm5, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rax, %rsi
movq %rsi, %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
subpd %xmm2, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd %xmm4, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
subsd %xmm3, %xmm1
cvttsd2si %xmm1, %rsi
andq %rdx, %rsi
orq %rax, %rsi
jmp 0x34377
movzwl 0x14(%rsi), %eax
leaq (%rax,%rax,4), %rdx
shll $0x4, %edx
leaq (%rdi,%rdx), %rax
movq 0x30(%rdi,%rdx), %rcx
movq 0x40(%rdi,%rdx), %rdx
addq $-0x8, %rdx
cmpq %rdx, %rcx
je 0x343a8
movq %rsi, (%rcx)
addq $0x8, 0x30(%rax)
jmp 0x343b5
addq %r15, %r11
movl %edi, %eax
xorl %edx, %edx
divl %esi
shrl %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rdx
subsd 0x20ceb(%rip), %xmm0    # 0x55050
cvttsd2si %xmm0, %rsi
sarq $0x3f, %rdx
andq %rdx, %rsi
orq %rax, %rsi
addq %r11, %rsi
addq %r10, %rsi
movl 0x10(%rcx), %r8d
movq %r14, %rdi
movq %rbx, %rdx
callq 0x285aa
movb $0x1, 0xc8(%rbx)
movq 0x8(%rsp), %rax
movzwl 0x14(%rax), %eax
movl %eax, 0xe4(%rbx)
jmp 0x343b5
leaq 0x8(%rsp), %rsi
jmp 0x343b0
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0x351e0
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop