// File: CMU-SAFARI[P]MQSim/src/ssd/Data_Cache_Manager_Flash_Simple.cpp
// Function: SSD_Components::Data_Cache_Manager_Flash_Simple::Data_Cache_Manager_Flash_Simple(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, SSD_Components::Host_Interface_Base*, SSD_Components::NVM_Firmware*, SSD_Components::NVM_PHY_ONFI*, unsigned int, unsigned int, unsigned int, unsigned int, unsigned long, unsigned long, unsigned long, SSD_Components::Caching_Mode*, unsigned int, unsigned int, unsigned int)
Data_Cache_Manager_Flash_Simple::Data_Cache_Manager_Flash_Simple(const sim_object_id_type& id, Host_Interface_Base* host_interface, NVM_Firmware* firmware, NVM_PHY_ONFI* flash_controller,
		unsigned int total_capacity_in_bytes,
		unsigned int dram_row_size, unsigned int dram_data_rate, unsigned int dram_busrt_size, sim_time_type dram_tRCD, sim_time_type dram_tCL, sim_time_type dram_tRP,
		Caching_Mode* caching_mode_per_input_stream, unsigned int stream_count, unsigned int sector_no_per_page, unsigned int back_pressure_buffer_max_depth)
		: Data_Cache_Manager_Base(id, host_interface, firmware, dram_row_size, dram_data_rate, dram_busrt_size, dram_tRCD, dram_tCL, dram_tRP, caching_mode_per_input_stream, Cache_Sharing_Mode::SHARED, stream_count),
		flash_controller(flash_controller), capacity_in_bytes(total_capacity_in_bytes), sector_no_per_page(sector_no_per_page),	request_queue_turn(0), back_pressure_buffer_max_depth(back_pressure_buffer_max_depth)
	{
		capacity_in_pages = capacity_in_bytes / (SECTOR_SIZE_IN_BYTE * sector_no_per_page);
		data_cache = new Data_Cache_Flash(capacity_in_pages);
		dram_execution_queue = new std::queue<Memory_Transfer_Info*>[stream_count];
		waiting_user_requests_queue_for_dram_free_slot = new std::list<User_Request*>[stream_count];
		this->back_pressure_buffer_depth = 0;
		bloom_filter = new std::set<LPA_type>[stream_count];
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movl 0x198(%rsp), %eax
movl 0x190(%rsp), %eax
movl 0x188(%rsp), %eax
movq 0x180(%rsp), %rax
movq 0x178(%rsp), %rax
movq 0x170(%rsp), %rax
movq 0x168(%rsp), %rax
movl 0x160(%rsp), %eax
movl 0x158(%rsp), %eax
movl 0x150(%rsp), %eax
movq %rdi, 0x120(%rsp)
movq %rsi, 0x118(%rsp)
movq %rdx, 0x110(%rsp)
movq %rcx, 0x108(%rsp)
movq %r8, 0x100(%rsp)
movl %r9d, 0xfc(%rsp)
movq 0x120(%rsp), %rdi
movq %rdi, 0xd8(%rsp)
movq 0x118(%rsp), %rsi
movq 0x110(%rsp), %rdx
movq 0x108(%rsp), %rcx
movl 0x150(%rsp), %r8d
movl 0x158(%rsp), %r9d
movl 0x160(%rsp), %r10d
movq 0x168(%rsp), %r11
movq 0x170(%rsp), %rbx
movq 0x178(%rsp), %r14
movq 0x180(%rsp), %r15
movl 0x188(%rsp), %ebp
movq %rsp, %rax
movl %ebp, 0x30(%rax)
movq %r15, 0x20(%rax)
movq %r14, 0x18(%rax)
movq %rbx, 0x10(%rax)
movq %r11, 0x8(%rax)
movl %r10d, (%rax)
movl $0x0, 0x28(%rax)
callq 0x67920
movq 0xd8(%rsp), %rax
leaq 0x6a5be(%rip), %rcx     # 0xd92c0
movq %rcx, (%rax)
movq 0x100(%rsp), %rcx
movq %rcx, 0xa8(%rax)
movl 0xfc(%rsp), %ecx
movl %ecx, 0xb0(%rax)
movl 0x190(%rsp), %ecx
movl %ecx, 0xb8(%rax)
movl $0x0, 0xd8(%rax)
movl 0x198(%rsp), %ecx
movl %ecx, 0xdc(%rax)
movq $0x3b9aca00, 0xf0(%rax) # imm = 0x3B9ACA00
movq $0x0, 0xf8(%rax)
movl 0xb0(%rax), %eax
movl 0x190(%rsp), %ecx
shll $0x9, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movq 0xd8(%rsp), %rax
movl %ecx, 0xb4(%rax)
movl $0x58, %edi
callq 0x8450
movq %rax, 0xe0(%rsp)
jmp 0x6ed93
movq 0xe0(%rsp), %rdi
movq 0xd8(%rsp), %rax
movl 0xb4(%rax), %esi
callq 0x64350
jmp 0x6edb0
movq 0xd8(%rsp), %rax
movq 0xe0(%rsp), %rcx
movq %rcx, 0xc0(%rax)
movl 0x188(%rsp), %eax
movq %rax, 0xc8(%rsp)
shlq $0x4, %rax
leaq 0x8(%rax,%rax,4), %rdi
callq 0x8030
movq %rax, 0xd0(%rsp)
jmp 0x6edee
movq 0xc8(%rsp), %rax
movq 0xd0(%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0xc0(%rsp)
cmpq $0x0, %rax
je 0x6ee75
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
imulq $0x50, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0xb0(%rsp)
movq %rax, 0xb8(%rsp)
movq 0xb8(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0x6bf50
jmp 0x6ee54
movq 0xb0(%rsp), %rcx
movq 0xa8(%rsp), %rax
addq $0x50, %rax
cmpq %rcx, %rax
movq %rax, 0xb8(%rsp)
jne 0x6ee3d
movq 0xd8(%rsp), %rax
movq 0xc0(%rsp), %rcx
movq %rcx, 0xc8(%rax)
movl 0x188(%rsp), %eax
movq %rax, 0x98(%rsp)
leaq (%rax,%rax,2), %rax
leaq 0x8(,%rax,8), %rdi
callq 0x8030
movq %rax, 0xa0(%rsp)
jmp 0x6eeb6
movq 0x98(%rsp), %rax
movq 0xa0(%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0x90(%rsp)
cmpq $0x0, %rax
je 0x6ef35
movq 0x90(%rsp), %rax
movq 0x98(%rsp), %rcx
imulq $0x18, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
movq %rdi, 0x78(%rsp)
callq 0x6bf90
movq 0x78(%rsp), %rax
movq 0x80(%rsp), %rcx
addq $0x18, %rax
cmpq %rcx, %rax
movq %rax, 0x88(%rsp)
jne 0x6ef05
movq 0xd8(%rsp), %rax
movq 0x90(%rsp), %rcx
movq %rcx, 0xd0(%rax)
movl $0x0, 0xe0(%rax)
movl 0x188(%rsp), %eax
movq %rax, 0x68(%rsp)
shlq $0x4, %rax
leaq 0x8(%rax,%rax,2), %rdi
callq 0x8030
movq %rax, 0x70(%rsp)
jmp 0x6ef77
movq 0x68(%rsp), %rax
movq 0x70(%rsp), %rcx
movq %rax, (%rcx)
addq $0x8, %rcx
movq %rcx, 0x60(%rsp)
cmpq $0x0, %rax
je 0x6efd8
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rcx
imulq $0x30, %rcx, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, 0x50(%rsp)
movq %rax, 0x58(%rsp)
movq 0x58(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x21570
movq 0x48(%rsp), %rax
movq 0x50(%rsp), %rcx
addq $0x30, %rax
cmpq %rcx, %rax
movq %rax, 0x58(%rsp)
jne 0x6efb1
movq 0xd8(%rsp), %rax
movq 0x60(%rsp), %rcx
movq %rcx, 0xe8(%rax)
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
jmp 0x6f099
movq 0xe0(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xf0(%rsp)
movl %eax, 0xec(%rsp)
callq 0x8410
jmp 0x6f099
movq 0xc0(%rsp), %rcx
movq %rax, %rsi
movq 0xa8(%rsp), %rax
movq %rsi, 0xf0(%rsp)
movl %edx, 0xec(%rsp)
cmpq %rax, %rcx
movq %rax, 0x40(%rsp)
je 0x6f08c
movq 0x40(%rsp), %rdi
addq $-0x50, %rdi
movq %rdi, 0x38(%rsp)
callq 0x6bf80
movq 0xc0(%rsp), %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x40(%rsp)
jne 0x6f062
movq 0xd0(%rsp), %rdi
callq 0x8570
movq 0xd8(%rsp), %rdi
callq 0x67ae0
movq 0xf0(%rsp), %rdi
callq 0x8770
nopw %cs:(%rax,%rax)