// File: /workspace/github_cpp_makefile_star2_O3/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 %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, (%rsp)
cmpb $0x1, 0xc8(%rdi)
jne 0x33746
movq 0xd0(%r14), %rdi
cmpb $0x1, 0xe0(%r14)
jne 0x338e2
movq 0x30(%rdi), %rax
movq 0x40(%rdi), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x3396b
movq %rbx, (%rax)
addq $0x8, 0x30(%rdi)
jmp 0x3397b
callq 0x28018
movq %rax, %r15
callq 0x28018
movq %rax, %rdi
callq 0x2841a
movq %rax, %rcx
movl (%rbx), %edi
movl 0x40(%r14), %r8d
movl 0x48(%r14), %r10d
movsd 0x50(%r14), %xmm0
movq 0x58(%r14), %r12
movq 0x60(%r14), %r11
leaq (%r11,%r12), %rsi
cmpl %r8d, %edi
jbe 0x3390e
movl %r8d, %eax
xorl %edx, %edx
divl %r10d
movl %eax, %r9d
movq 0x68(%r14), %xmm3
movl %edi, %eax
xorl %edx, %edx
divl %r8d
movq %rsi, %xmm5
movq 0x24118(%rip), %xmm1    # 0x578c0
punpckldq %xmm1, %xmm5    # xmm5 = xmm5[0],xmm1[0],xmm5[1],xmm1[1]
movapd 0x2411c(%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, %rsi
movq %rsi, %rdi
sarq $0x3f, %rdi
movsd 0x21851(%rip), %xmm3    # 0x55050
subsd %xmm3, %xmm5
cvttsd2si %xmm5, %r8
andq %rdi, %r8
orq %rsi, %r8
movq %r8, %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 %r12, %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 %r10d, %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 0x33941
movzwl 0x14(%rbx), %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 0x33970
movq %rbx, (%rcx)
addq $0x8, 0x30(%rax)
jmp 0x3397b
movl %edi, %eax
xorl %edx, %edx
divl %r10d
shrl %eax
cvtsi2sd %eax, %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, %rdx
subsd 0x21721(%rip), %xmm0    # 0x55050
cvttsd2si %xmm0, %rdi
sarq $0x3f, %rdx
andq %rdx, %rdi
orq %rax, %rdi
addq %rdi, %rsi
addq %rcx, %rsi
movl 0x10(%rbx), %r8d
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2841e
movb $0x1, 0xc8(%r14)
movzwl 0x14(%rbx), %eax
movl %eax, 0xe4(%r14)
jmp 0x3397b
movq %rsp, %rsi
jmp 0x33976
movq %rsp, %rsi
movq %rax, %rdi
callq 0x34782
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop