// File: CMU-SAFARI[P]MQSim/src/ssd/TSU_Priority_OutOfOrder.cpp
// Function: SSD_Components::TSU_Priority_OutOfOrder::~TSU_Priority_OutOfOrder()
TSU_Priority_OutOfOrder::~TSU_Priority_OutOfOrder()
{
    for (unsigned int channelID = 0; channelID < channel_count; channelID++)
    {
        for (unsigned int chipId = 0; chipId < chip_no_per_channel; chipId++)
        {
            delete[] UserReadTRQueue[channelID][chipId];
            delete[] UserWriteTRQueue[channelID][chipId];
        }
        delete[] nextPriorityClassRead[channelID];
        delete[] nextPriorityClassWrite[channelID];
        delete[] currentWeightRead[channelID];
        delete[] currentWeightWrite[channelID];
        delete[] GCReadTRQueue[channelID];
        delete[] GCWriteTRQueue[channelID];
        delete[] GCEraseTRQueue[channelID];
        delete[] MappingReadTRQueue[channelID];
        delete[] MappingWriteTRQueue[channelID];
    }
    delete[] UserReadTRQueue;
    delete[] UserWriteTRQueue;
    delete[] nextPriorityClassRead;
    delete[] nextPriorityClassWrite;
    delete[] currentWeightRead;
    delete[] currentWeightWrite;
    delete[] GCReadTRQueue;
    delete[] GCWriteTRQueue;
    delete[] GCEraseTRQueue;
    delete[] MappingReadTRQueue;
    delete[] MappingWriteTRQueue;
}

// Assembly:
subq $0x178, %rsp            # imm = 0x178
movq %rdi, 0x170(%rsp)
movq 0x170(%rsp), %rax
movq %rax, 0x160(%rsp)
leaq 0x389fa(%rip), %rcx     # 0xd9cb0
addq $0x10, %rcx
movq %rcx, (%rax)
movl $0x0, 0x16c(%rsp)
movq 0x160(%rsp), %rcx
movl 0x16c(%rsp), %eax
cmpl 0x44(%rcx), %eax
jae 0xa185f
movl $0x0, 0x168(%rsp)
movq 0x160(%rsp), %rcx
movl 0x168(%rsp), %eax
cmpl 0x48(%rcx), %eax
jae 0xa1471
movq 0x160(%rsp), %rax
movq 0xb0(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x168(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x158(%rsp)
cmpq $0x0, %rax
je 0xa13ae
movq 0x158(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x148(%rsp)
imulq $0x108, -0x8(%rcx), %rdx # imm = 0x108
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0x150(%rsp)
je 0xa13a1
movq 0x150(%rsp), %rdi
addq $-0x108, %rdi           # imm = 0xFEF8
movq %rdi, 0x140(%rsp)
callq 0x90f30
movq 0x158(%rsp), %rcx
movq 0x140(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x150(%rsp)
jne 0xa1368
movq 0x148(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xb8(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movl 0x168(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x138(%rsp)
cmpq $0x0, %rax
je 0xa1459
movq 0x138(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x128(%rsp)
imulq $0x108, -0x8(%rcx), %rdx # imm = 0x108
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0x130(%rsp)
je 0xa144c
movq 0x130(%rsp), %rdi
addq $-0x108, %rdi           # imm = 0xFEF8
movq %rdi, 0x120(%rsp)
callq 0x90f30
movq 0x138(%rsp), %rcx
movq 0x120(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x130(%rsp)
jne 0xa1413
movq 0x128(%rsp), %rdi
callq 0x8570
jmp 0xa145b
movl 0x168(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x168(%rsp)
jmp 0xa12eb
movq 0x160(%rsp), %rax
movq 0xe8(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x118(%rsp)
cmpq $0x0, %rax
je 0xa14a6
movq 0x118(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xf0(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x110(%rsp)
cmpq $0x0, %rax
je 0xa14db
movq 0x110(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xf8(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x108(%rsp)
cmpq $0x0, %rax
je 0xa1510
movq 0x108(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0x100(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x100(%rsp)
cmpq $0x0, %rax
je 0xa1545
movq 0x100(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xc0(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0xf8(%rsp)
cmpq $0x0, %rax
je 0xa15e5
movq 0xf8(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0xe8(%rsp)
imulq $0x108, -0x8(%rcx), %rdx # imm = 0x108
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0xf0(%rsp)
je 0xa15d8
movq 0xf0(%rsp), %rdi
addq $-0x108, %rdi           # imm = 0xFEF8
movq %rdi, 0xe0(%rsp)
callq 0x90f30
movq 0xf8(%rsp), %rcx
movq 0xe0(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xf0(%rsp)
jne 0xa159f
movq 0xe8(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xc8(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0xd8(%rsp)
cmpq $0x0, %rax
je 0xa1685
movq 0xd8(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0xc8(%rsp)
imulq $0x108, -0x8(%rcx), %rdx # imm = 0x108
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0xd0(%rsp)
je 0xa1678
movq 0xd0(%rsp), %rdi
addq $-0x108, %rdi           # imm = 0xFEF8
movq %rdi, 0xc0(%rsp)
callq 0x90f30
movq 0xd8(%rsp), %rcx
movq 0xc0(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xd0(%rsp)
jne 0xa163f
movq 0xc8(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xd0(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0xb8(%rsp)
cmpq $0x0, %rax
je 0xa1725
movq 0xb8(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0xa8(%rsp)
imulq $0x108, -0x8(%rcx), %rdx # imm = 0x108
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0xb0(%rsp)
je 0xa1718
movq 0xb0(%rsp), %rdi
addq $-0x108, %rdi           # imm = 0xFEF8
movq %rdi, 0xa0(%rsp)
callq 0x90f30
movq 0xb8(%rsp), %rcx
movq 0xa0(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xb0(%rsp)
jne 0xa16df
movq 0xa8(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xd8(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x98(%rsp)
cmpq $0x0, %rax
je 0xa17c5
movq 0x98(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x88(%rsp)
imulq $0x108, -0x8(%rcx), %rdx # imm = 0x108
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0x90(%rsp)
je 0xa17b8
movq 0x90(%rsp), %rdi
addq $-0x108, %rdi           # imm = 0xFEF8
movq %rdi, 0x80(%rsp)
callq 0x90f30
movq 0x98(%rsp), %rcx
movq 0x80(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x90(%rsp)
jne 0xa177f
movq 0x88(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xe0(%rax), %rax
movl 0x16c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x78(%rsp)
cmpq $0x0, %rax
je 0xa1847
movq 0x78(%rsp), %rcx
movq %rcx, %rax
addq $-0x8, %rax
movq %rax, 0x68(%rsp)
imulq $0x108, -0x8(%rcx), %rdx # imm = 0x108
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, 0x70(%rsp)
je 0xa183d
movq 0x70(%rsp), %rdi
addq $-0x108, %rdi           # imm = 0xFEF8
movq %rdi, 0x60(%rsp)
callq 0x90f30
movq 0x78(%rsp), %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x70(%rsp)
jne 0xa1813
movq 0x68(%rsp), %rdi
callq 0x8570
jmp 0xa1849
movl 0x16c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x16c(%rsp)
jmp 0xa12c8
movq 0x160(%rsp), %rax
movq 0xb0(%rax), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, %rax
je 0xa1883
movq 0x58(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xb8(%rax), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, %rax
je 0xa18a7
movq 0x50(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xe8(%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, %rax
je 0xa18cb
movq 0x48(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xf0(%rax), %rax
movq %rax, 0x40(%rsp)
cmpq $0x0, %rax
je 0xa18ef
movq 0x40(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xf8(%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, %rax
je 0xa1913
movq 0x38(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0x100(%rax), %rax
movq %rax, 0x30(%rsp)
cmpq $0x0, %rax
je 0xa1937
movq 0x30(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xc0(%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, %rax
je 0xa195b
movq 0x28(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xc8(%rax), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, %rax
je 0xa197f
movq 0x20(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xd0(%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0xa19a3
movq 0x18(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xd8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0xa19c7
movq 0x10(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rax
movq 0xe0(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0xa19eb
movq 0x8(%rsp), %rdi
callq 0x8570
movq 0x160(%rsp), %rdi
callq 0x9b090
addq $0x178, %rsp            # imm = 0x178
retq