// File: /workspace/github_cpp_makefile_star2_O1/CMU-SAFARI[P]MQSim/src/ssd/TSU_Base.cpp
// Function: SSD_Components::TSU_Base::TSU_Base(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, SSD_Components::FTL*, SSD_Components::NVM_PHY_ONFI_NVDDR2*, SSD_Components::Flash_Scheduling_Type, unsigned int, unsigned int, unsigned int, unsigned int, bool, bool, unsigned long, unsigned long, unsigned long)
TSU_Base::TSU_Base(const sim_object_id_type& id, FTL* ftl, NVM_PHY_ONFI_NVDDR2* NVMController, Flash_Scheduling_Type Type,
		unsigned int ChannelCount, unsigned int chip_no_per_channel, unsigned int DieNoPerChip, unsigned int PlaneNoPerDie,
		bool EraseSuspensionEnabled, bool ProgramSuspensionEnabled,
		sim_time_type WriteReasonableSuspensionTimeForRead,
		sim_time_type EraseReasonableSuspensionTimeForRead,
		sim_time_type EraseReasonableSuspensionTimeForWrite)
		: Sim_Object(id), ftl(ftl), _NVMController(NVMController), type(Type),
		channel_count(ChannelCount), chip_no_per_channel(chip_no_per_channel), die_no_per_chip(DieNoPerChip), plane_no_per_die(PlaneNoPerDie),
		eraseSuspensionEnabled(EraseSuspensionEnabled), programSuspensionEnabled(ProgramSuspensionEnabled),
		writeReasonableSuspensionTimeForRead(WriteReasonableSuspensionTimeForRead), eraseReasonableSuspensionTimeForRead(EraseReasonableSuspensionTimeForRead),
		eraseReasonableSuspensionTimeForWrite(EraseReasonableSuspensionTimeForWrite), opened_scheduling_reqs(0)
	{
		_my_instance = this;
		Round_robin_turn_of_channel = new flash_chip_ID_type[channel_count];
		for (unsigned int channelID = 0; channelID < channel_count; channelID++) {
			Round_robin_turn_of_channel[channelID] = 0;
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, 0x8(%rsp)
movq %rcx, 0x10(%rsp)
movq %rdx, %r12
movq %rdi, %rbx
movq 0xa8(%rsp), %rax
movq %rax, 0x18(%rsp)
movups 0x98(%rsp), %xmm0
movaps %xmm0, 0x20(%rsp)
movb 0x90(%rsp), %al
movb %al, 0x7(%rsp)
movb 0x88(%rsp), %r14b
movl 0x80(%rsp), %r13d
movl 0x78(%rsp), %ebp
movl 0x70(%rsp), %r15d
callq 0x165ce
leaq 0x23c9f(%rip), %rax     # 0x6ebc0
movq %rax, (%rbx)
movq %r12, 0x30(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x38(%rbx)
movl 0x8(%rsp), %eax
movl %eax, 0x40(%rbx)
movl 0xc(%rsp), %edx
movl %edx, 0x44(%rbx)
movl %r15d, 0x48(%rbx)
movl %ebp, 0x4c(%rbx)
movl %r13d, 0x50(%rbx)
movb %r14b, 0x54(%rbx)
movb 0x7(%rsp), %al
movb %al, 0x55(%rbx)
movaps 0x20(%rsp), %xmm0
movups %xmm0, 0x58(%rbx)
movq 0x18(%rsp), %rax
movq %rax, 0x68(%rbx)
leaq 0x78(%rbx), %r15
movq %r15, 0x80(%rbx)
movq %r15, 0x78(%rbx)
xorl %eax, %eax
movq %rax, 0x88(%rbx)
leaq 0x90(%rbx), %rcx
movq %rcx, 0x98(%rbx)
movq %rcx, 0x90(%rbx)
movq %rax, 0xa0(%rbx)
movl $0x0, 0xa8(%rbx)
movq %rbx, 0x28bec(%rip)     # 0x73b98
movl %edx, %edi
shlq $0x2, %rdi
callq 0x7030
movq %rax, 0x70(%rbx)
movl 0x44(%rbx), %edx
testq %rdx, %rdx
je 0x4afdf
shlq $0x2, %rdx
movq %rax, %rdi
xorl %esi, %esi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7230
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x4b009
movq (%rdi), %r12
callq 0x7370
movq %r12, %rdi
cmpq %r15, %r12
jne 0x4aff9
movq %rbx, %rdi
callq 0x7a55
movq %r14, %rdi
callq 0x7620
nop