// File: narges64[P]SIMBA/ssd.cpp
// Function: remove_request(ssd_info*, request**, request**)
void remove_request(ssd_info * ssd, request ** req, request ** pre_node){
	if(*pre_node == NULL)
	{
		if((*req)->next_node == NULL)
		{
			delete (*req);
			*req = NULL;
			ssd->request_queue = NULL;
			ssd->request_tail = NULL;
			ssd->request_queue_length--;
		}
		else
		{
			ssd->request_queue = (*req)->next_node;
			(*pre_node) = (*req);
			(*req) = (*req)->next_node;
			delete (*pre_node);
			*pre_node = NULL;
			ssd->request_queue_length--;
		}
	}
	else
	{
		if((*req)->next_node == NULL)
		{
			(*pre_node)->next_node = NULL;
			delete (*req);
			*req = NULL;
			ssd->request_tail = (*pre_node);
			ssd->request_queue_length--;
		}
		else
		{
			(*pre_node)->next_node = (*req)->next_node;
			delete (*req);
			(*req) = (*pre_node)->next_node;
			ssd->request_queue_length--;
		}
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0xdeb2
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x38(%rax)
jne 0xde3a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0xde08
movq -0x20(%rbp), %rdi
callq 0xe260
movq -0x20(%rbp), %rdi
movl $0x48, %esi
callq 0x2140
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x68(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x70(%rax)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0xdead
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0xde95
movq -0x28(%rbp), %rdi
callq 0xe260
movq -0x28(%rbp), %rdi
movl $0x48, %esi
callq 0x2140
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0xdf7f
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpq $0x0, 0x38(%rax)
jne 0xdf20
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0xdef7
movq -0x30(%rbp), %rdi
callq 0xe260
movq -0x30(%rbp), %rdi
movl $0x48, %esi
callq 0x2140
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0xdf7d
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rcx
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0xdf5e
movq -0x38(%rbp), %rdi
callq 0xe260
movq -0x38(%rbp), %rdi
movl $0x48, %esi
callq 0x2140
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq 0x38(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0xdf7f
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)