LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: narges64[P]SIMBA/common.cpp
// Function: dram_info::dram_info(parameter_value*)
dram_info::dram_info(parameter_value * parameters)
{
	map = new map_info();
	int page_num = parameters->page_block*parameters->block_plane*parameters->plane_lun*parameters->lun_num;
	map->count = page_num * (1-parameters->overprovide); 
	map->map_entry = new entry[page_num];

	dram_capacity = parameters->dram_capacity;
	gcb_capacity = 0; // parameters->gcb_capacity; 
	int io_share = dram_capacity - gcb_capacity; 
	buffer = new write_buffer(io_share, parameters->subpage_page);
	gc_buffer = buffer; // new write_buffer(gcb_capacity , parameters->subpage_page);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x10, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
callq 0x53f0
jmp 0x4593
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rcx
movl 0x234(%rcx), %ecx
movq -0x10(%rbp), %rdx
imull 0x230(%rdx), %ecx
movq -0x10(%rbp), %rdx
imull 0x22c(%rdx), %ecx
movq -0x10(%rbp), %rdx
imull 0x88(%rdx), %ecx
movl %ecx, -0x20(%rbp)
cvtsi2ssl -0x20(%rbp), %xmm0
movq -0x10(%rbp), %rcx
movss 0xaa32(%rip), %xmm1     # 0xf010
subss 0x25c(%rcx), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %ecx
movq 0x10(%rax), %rax
movl %ecx, 0x8(%rax)
movslq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x10, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x50(%rbp)
callq 0x2040
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x40(%rbp)
cmpq $0x0, %rax
je 0x4671
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rdx
shlq $0x4, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x60(%rbp)
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq %rdi, -0x68(%rbp)
callq 0x5410
jmp 0x465c
movq -0x60(%rbp), %rcx
movq -0x68(%rbp), %rax
addq $0x10, %rax
cmpq %rcx, %rax
movq %rax, -0x58(%rbp)
jne 0x464d
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rdx
movq 0x10(%rcx), %rax
movq %rdx, (%rax)
movq -0x10(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, (%rcx)
movl $0x0, 0x4(%rcx)
movl (%rcx), %eax
movl 0x4(%rcx), %ecx
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movl $0x28, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x70(%rbp)
movl -0x24(%rbp), %esi
movq -0x10(%rbp), %rax
movl 0x238(%rax), %edx
callq 0x5430
jmp 0x46c5
movq -0x38(%rbp), %rax
movq -0x70(%rbp), %rcx
movq %rcx, 0x18(%rax)
movq 0x18(%rax), %rcx
movq %rcx, 0x20(%rax)
addq $0x70, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x10, %esi
callq 0x2140
jmp 0x4730
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0x2270
jmp 0x4730
movq -0x70(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x28, %esi
callq 0x2140
movq -0x18(%rbp), %rdi
callq 0x2230
nopl (%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: blk_info::blk_info(parameter_value*)
blk_info::blk_info(parameter_value * parameters)
{
	free_page_num = parameters->page_block;	// all pages are free
	last_write_page = -1;	// no page has been programmed
	last_write_time = 0; 
	page_num = parameters->page_block;
	invalid_page_num = 0;

	page_head = new page_info*[parameters->page_block];
	for(int i = 0; i<parameters->page_block; i++)
	{
		page_head[i] = new page_info();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movl 0x234(%rcx), %ecx
movl %ecx, 0x4(%rax)
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rcx
movl 0x234(%rcx), %ecx
movl %ecx, 0xc(%rax)
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x234(%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x234(%rcx), %eax
jae 0x484a
movl $0x8, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
callq 0x4740
jmp 0x480f
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x47e5
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x8, %esi
callq 0x2140
jmp 0x4850
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2230
nopl (%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: plane_info::plane_info(parameter_value*)
plane_info::plane_info(parameter_value  * parameters)
{
	free_page=parameters->block_plane*parameters->page_block;
	invalid_page = 0; 
	
	blk_head = new blk_info*[parameters->block_plane];
	for(int i = 0; i<parameters->block_plane; i++)
	{
		blk_head[i] = new blk_info(parameters);
	}
	block_num = parameters->block_plane;
	active_block = 0;
	cold_active_block = 1; 
	erase_count = 0;
	program_count = 0;
	GCMode = false;
	current_state = PLANE_MODE_IDLE;
	next_state = PLANE_MODE_IDLE;
	current_time = 0;
	next_state_predict_time = 0;
	state_time = new int64_t[PLANE_MODE_NUM];
	for (int i = 0; i < PLANE_MODE_NUM; i++){
		state_time[i] = 0;
	}
	scheduled_gc = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rcx
movl 0x230(%rcx), %ecx
movq -0x10(%rbp), %rdx
imull 0x234(%rdx), %ecx
movl %ecx, %ecx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movl 0x230(%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x20(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x230(%rcx), %eax
jae 0x4943
movl $0x28, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rsi
callq 0x4760
jmp 0x4905
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x48d7
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x28, %esi
callq 0x2140
jmp 0x49ea
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x230(%rcx), %ecx
movq %rcx, 0x28(%rax)
movq $0x0, 0x10(%rax)
movq $0x1, 0x18(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x40(%rax)
movb $0x0, 0x68(%rax)
movl $0x0, 0x48(%rax)
movl $0x0, 0x4c(%rax)
movq $0x0, 0x50(%rax)
movq $0x0, 0x58(%rax)
movl $0x18, %edi
callq 0x2040
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x60(%rax)
movl $0x0, -0x28(%rbp)
cmpl $0x3, -0x28(%rbp)
jge 0x49d8
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movslq -0x28(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x49b3
movq -0x30(%rbp), %rax
movq $0x0, 0x70(%rax)
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2230
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: lun_info::lun_info(parameter_value*)
lun_info::lun_info(parameter_value * parameter)
{
	current_state = LUN_MODE_IDLE;
	next_state = LUN_MODE_IDLE;
	current_time = 0;
	next_state_predict_time = 0;
	read_count = 0;
	program_count = 0;
	erase_count = 0;
	read_avg = 0;
	program_avg = 0;
	gc_avg = 0;
	plane_token = 0;

	GCMode = false;
	plane_head = new plane_info*[parameter->plane_lun];
	for (int i = 0; i<parameter->plane_lun; i++)
	{
		plane_head[i] = new plane_info(parameter);
	}

	state_time = new int64_t [LUN_MODE_NUM];
	for (int i = 0; i < LUN_MODE_NUM; i++)
		state_time[i] = 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
addq $0x48, %rdi
callq 0x5350
movq -0x30(%rbp), %rdi
addq $0x60, %rdi
callq 0x5350
movq -0x30(%rbp), %rdi
addq $0x78, %rdi
callq 0x5350
movq -0x30(%rbp), %rdi
addq $0xa0, %rdi
callq 0x53c0
movq -0x30(%rbp), %rdi
addq $0xc0, %rdi
callq 0x53c0
movq -0x30(%rbp), %rdi
addq $0xe0, %rdi
callq 0x53c0
movq -0x30(%rbp), %rax
movl $0x0, 0x14(%rax)
movl $0x0, 0x20(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x28(%rax)
movl $0x0, 0x10(%rax)
movl $0x0, 0xc(%rax)
movl $0x0, 0x8(%rax)
movq $0x0, 0x38(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x40(%rax)
movl $0x0, 0x9c(%rax)
movb $0x0, 0x98(%rax)
movq -0x10(%rbp), %rax
movl 0x22c(%rax), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x22c(%rcx), %eax
jae 0x4b9f
movl $0x78, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rsi
callq 0x4860
jmp 0x4b65
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4b37
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x78, %esi
callq 0x2140
jmp 0x4bec
movl $0x18, %edi
callq 0x2040
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x90(%rax)
movl $0x0, -0x28(%rbp)
cmpl $0x3, -0x28(%rbp)
jge 0x4be6
movq -0x30(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0x28(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x4bbe
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x2230
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: channel_info::channel_info(int, parameter_value*)
channel_info::channel_info(int channel_number, parameter_value * parameters) {
	// set the parameter of each channel
	lun_num = parameters->lun_channel[channel_number];
	current_state = CHANNEL_MODE_IDLE;
	next_state = CHANNEL_MODE_IDLE;
	current_time = 0;
	next_state_predict_time = 0;
	lun_head = new lun_info*[lun_num];

	for (int j = 0; j< lun_num; j++)
	{
		lun_head[j] = new lun_info(parameters);
	}

	state_time = new int64_t[CHANNEL_MODE_NUM];
	for (int i = 0; i < CHANNEL_MODE_NUM; i++){
		state_time[i] = 0;
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movl 0x9c(%rcx,%rdx,4), %ecx
movl %ecx, (%rax)
movl $0x0, 0x38(%rax)
movl $0x0, 0x3c(%rax)
movq $0x0, 0x40(%rax)
movq $0x0, 0x48(%rax)
movslq (%rax), %rax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x2040
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x50(%rax)
movl $0x0, -0x1c(%rbp)
movq -0x38(%rbp), %rcx
movl -0x1c(%rbp), %eax
cmpl (%rcx), %eax
jge 0x4d35
movl $0x100, %edi            # imm = 0x100
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rsi
callq 0x4a30
jmp 0x4cfa
movq -0x40(%rbp), %rdx
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x4cd0
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x100, %esi            # imm = 0x100
callq 0x2140
jmp 0x4d7c
movl $0x18, %edi
callq 0x2040
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x58(%rax)
movl $0x0, -0x30(%rbp)
cmpl $0x3, -0x30(%rbp)
jge 0x4d76
movq -0x38(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x30(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x4d51
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x2230
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: file_assert(int, char const*)
void file_assert(int error,const char *s){
	if(error == 0) return;
	printf("open %s error\n",s);
	getchar();
	exit(-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0x4dab
addq $0x10, %rsp
popq %rbp
retq
movq -0x10(%rbp), %rsi
leaq 0xa683(%rip), %rdi      # 0xf439
movb $0x0, %al
callq 0x2050
callq 0x21d0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21a0
nopl (%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: trace_assert(long, int, unsigned int, int, int)
void trace_assert(int64_t time,int device,unsigned int lsn,int size,int ope)
{
	if(time <0 || device < 0  || size < 0 || ope < 0)
	{
		cout << "trace error: " << time << "  " << device << " " << lsn << " " << size << "  " << ope << endl;
		getchar();
		exit(-1);
	}
	if(time == 0 && device == 0 && lsn == 0 && size == 0 && ope == 0)
	{
		printf("probable read a blank line\n");
		getchar();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl %r8d, -0x18(%rbp)
cmpq $0x0, -0x8(%rbp)
jl 0x4e06
cmpl $0x0, -0xc(%rbp)
jl 0x4e06
cmpl $0x0, -0x14(%rbp)
jl 0x4e06
cmpl $0x0, -0x18(%rbp)
jge 0x4eab
movq 0xf1c3(%rip), %rdi      # 0x13fd0
leaq 0xa634(%rip), %rsi      # 0xf448
callq 0x2110
movq %rax, %rdi
movq -0x8(%rbp), %rsi
callq 0x2240
movq %rax, %rdi
leaq 0xa627(%rip), %rsi      # 0xf456
callq 0x2110
movq %rax, %rdi
movl -0xc(%rbp), %esi
callq 0x2220
movq %rax, %rdi
leaq 0xb177(%rip), %rsi      # 0xffc0
callq 0x2110
movq %rax, %rdi
movl -0x10(%rbp), %esi
callq 0x21c0
movq %rax, %rdi
leaq 0xb15d(%rip), %rsi      # 0xffc0
callq 0x2110
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x2220
movq %rax, %rdi
leaq 0xa5d9(%rip), %rsi      # 0xf456
callq 0x2110
movq %rax, %rdi
movl -0x18(%rbp), %esi
callq 0x2220
movq %rax, %rdi
movq 0xf129(%rip), %rsi      # 0x13fc0
callq 0x2150
callq 0x21d0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21a0
cmpq $0x0, -0x8(%rbp)
jne 0x4edd
cmpl $0x0, -0xc(%rbp)
jne 0x4edd
cmpl $0x0, -0x10(%rbp)
jne 0x4edd
cmpl $0x0, -0x14(%rbp)
jne 0x4edd
cmpl $0x0, -0x18(%rbp)
jne 0x4edd
leaq 0xa588(%rip), %rdi      # 0xf459
movb $0x0, %al
callq 0x2050
callq 0x21d0
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: size(unsigned long)
unsigned int size(uint64_t stored){
	unsigned int i,total=0;
	uint64_t mask=0x800000000000;

	for(i=1;i<=64;i++)
	{
		if(stored & mask) total++;
		stored<<=1;
	}

	return total;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movabsq $0x800000000000, %rax   # imm = 0x800000000000
movq %rax, -0x18(%rbp)
movl $0x1, -0xc(%rbp)
cmpl $0x40, -0xc(%rbp)
ja 0x4f47
movq -0x8(%rbp), %rax
andq -0x18(%rbp), %rax
cmpq $0x0, %rax
je 0x4f31
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
shlq %rax
movq %rax, -0x8(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x4f14
movl -0x10(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: SubQueue::get_subreq(int)
sub_request * SubQueue::get_subreq(int index){

	if (index < 0) return NULL;
	int temp = 0;
	sub_request * qsub = queue_head;

	while (qsub != NULL) {
		if (temp == index) return qsub;
		qsub = qsub->next_node;
		temp++;
	}

	return NULL;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
jge 0x4f73
movq $0x0, -0x8(%rbp)
jmp 0x4fbd
movq -0x28(%rbp), %rax
movl $0x0, -0x18(%rbp)
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x4fb5
movl -0x18(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0x4f9e
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4fbd
movq -0x20(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x4f85
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: SubQueue::find_subreq(sub_request*)
bool SubQueue::find_subreq(sub_request * sub){
	// is there any request for the same location and same operation (read and write FIXME??? )
	sub_request * qsub = queue_head;

	while (qsub != NULL){

		if (qsub == sub) return true;
		if (qsub->lpn == sub->lpn) return true;
		if (qsub->location->channel == sub->location->channel && qsub->location->lun == sub->location->lun && qsub->location->plane == sub->location->plane){

			if (qsub->location->block == sub->location->block && qsub->location->page == sub->location->page) {
				// FIXME do we need to compare state??
				return true;

			}

		}

		qsub = qsub->next_node;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x50ad
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jne 0x5005
movb $0x1, -0x1(%rbp)
jmp 0x50b1
movq -0x20(%rbp), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jne 0x501e
movb $0x1, -0x1(%rbp)
jmp 0x50b1
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movl (%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl (%rcx), %eax
jne 0x509c
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x4(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl 0x4(%rcx), %eax
jne 0x509c
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x8(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl 0x8(%rcx), %eax
jne 0x509c
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movl 0xc(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl 0xc(%rcx), %eax
jne 0x509a
movq -0x20(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x10(%rax), %eax
movq -0x18(%rbp), %rcx
movq 0x60(%rcx), %rcx
cmpl 0x10(%rcx), %eax
jne 0x509a
movb $0x1, -0x1(%rbp)
jmp 0x50b1
jmp 0x509c
movq -0x20(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x4fe7
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopl (%rax,%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: SubQueue::push_tail(sub_request*)
void SubQueue::push_tail(sub_request * sub){
	if (sub == NULL) return;

	size++;

	if (queue_tail == NULL){
		queue_head = sub;
		queue_tail = sub;
		return;
	}

	queue_tail->next_node = sub;
	queue_tail = sub;
	sub->next_node = NULL;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x50dd
jmp 0x512a
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
cmpq $0x0, 0x8(%rax)
jne 0x5106
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x512a
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rdx
movq 0x8(%rax), %rcx
movq %rdx, 0x70(%rcx)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x70(%rax)
popq %rbp
retq
nopl (%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: SubQueue::push_head(sub_request*)
void SubQueue::push_head(sub_request * sub){
	if (sub == NULL) return;

	size++;
	if (queue_tail == NULL){
		queue_head = sub;
		queue_tail = sub;
		return;
	}

	sub->next_node = queue_head;
	queue_head = sub;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x514d
jmp 0x518c
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
cmpq $0x0, 0x8(%rax)
jne 0x5176
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x518c
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rcx
movq %rdx, 0x70(%rcx)
movq -0x10(%rbp), %rcx
movq %rcx, (%rax)
popq %rbp
retq
nop
// File: narges64[P]SIMBA/common.cpp
// Function: SubQueue::remove_node(sub_request*)
void SubQueue::remove_node(sub_request * sub){
	if (sub == NULL) return;

	size--;
	if (sub == queue_head) {
		queue_head = queue_head->next_node;

		if (queue_head == NULL)
			queue_tail = NULL;

		return;
	}
	sub_request * temp = queue_head;
	while (temp!= NULL && temp->next_node != sub){
		temp = temp->next_node;
	}

	if (temp == NULL){
		printf("ERROR couldn't find the sub request \n");
		return;
	}

	if (temp->next_node == sub){
		temp->next_node = sub->next_node;
		if (temp->next_node == NULL){
			queue_tail = temp;
		}
	}

	//delete sub;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x51b4
jmp 0x527d
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
movq -0x10(%rbp), %rax
cmpq (%rcx), %rax
jne 0x51ef
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq 0x70(%rcx), %rcx
movq %rcx, (%rax)
cmpq $0x0, (%rax)
jne 0x51ea
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
jmp 0x527d
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x21(%rbp)
je 0x5218
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
cmpq -0x10(%rbp), %rax
setne %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x5221
jmp 0x522f
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x51fa
cmpq $0x0, -0x18(%rbp)
jne 0x5246
leaq 0xa238(%rip), %rdi      # 0xf475
movb $0x0, %al
callq 0x2050
jmp 0x527d
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
cmpq -0x10(%rbp), %rax
jne 0x527d
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x70(%rax)
jne 0x527b
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x527d
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/common.cpp
// Function: SubQueue::target_request(int, int, int)
sub_request * SubQueue::target_request(int plane, int block, int page ){

	sub_request * sub = queue_head;

	while (sub != NULL){
		if (sub->location->plane == plane)
			if (block == -1 || sub->location->block == block )
				if (page == -1 || sub->location->page == page)
					return sub;


		sub = sub->next_node;

	}

	return sub;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x530b
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x8(%rax), %eax
cmpl -0x14(%rbp), %eax
jne 0x52fd
cmpl $-0x1, -0x18(%rbp)
je 0x52d9
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rax
movl 0xc(%rax), %eax
cmpl -0x18(%rbp), %eax
jne 0x52fb
cmpl $-0x1, -0x1c(%rbp)
je 0x52ef
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x10(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x52f9
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x5313
jmp 0x52fb
jmp 0x52fd
movq -0x28(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x52ac
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
nopl (%rax)
// File: narges64[P]SIMBA/./common.hh
// Function: Stat::Stat()
Stat(){
		count = 0; 	
		sum = 0; 
		squared_sum = 0; 
		min = INT64_MAX; 
		max = 0; 
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq $0x0, 0x8(%rax)
movq $0x0, 0x10(%rax)
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
movq %rcx, 0x20(%rax)
movq $0x0, 0x18(%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: narges64[P]SIMBA/./common.hh
// Function: write_buffer::write_buffer(int, int)
write_buffer(int size, int sector_page){ // size in MB , sector_page total number of sector in a page (16 means 8KB page)
		buffer_capacity = size * 1024 * 2 / sector_page;
		entry_count = 0;
		buffer_head = NULL;
		buffer_tail = NULL;
		buffer_first_outlier = NULL; 
		read_hit = 0; 
		write_hit = 0; 
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
shll $0xa, %eax
shll %eax
cltd
idivl -0x10(%rbp)
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x0, 0xc(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movl $0x0, (%rax)
movl $0x0, 0x4(%rax)
popq %rbp
retq
nopl (%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: invalid_old_page(ssd_info*, int, local*)
STATE invalid_old_page(ssd_info * ssd, const int lpn, local * location){
	if (ssd->dram->map->map_entry[lpn].state == false) {
		if (ssd->current_time > 0){
			#if DEBUG 
			cout << "error in invalid old page error 1 " << endl;
			#endif 
		}
		return FAIL;
	}
	int old_ppn = ssd->dram->map->map_entry[lpn].pn;
	find_location(ssd, old_ppn, location);
	if( update_physical_page(ssd, old_ppn, -1) == FAIL) {
			cout << "could not update physical page " << endl;
			return FAIL;
	}
	if (update_map_entry(ssd, lpn, -1) == FAIL ) {
		cout << "could not update mapping entry " << endl;
		return FAIL;
	}
	return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movb 0x4(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5892
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jle 0x5886
jmp 0x5886
movl $0x0, -0x4(%rbp)
jmp 0x594a
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x5c70
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7d80
cmpl $0x0, %eax
jne 0x5902
movq 0xe6f2(%rip), %rdi      # 0x13fd0
leaq 0x9def(%rip), %rsi      # 0xf6d4
callq 0x2110
movq %rax, %rdi
movq 0xe6cc(%rip), %rsi      # 0x13fc0
callq 0x2150
movl $0x0, -0x4(%rbp)
jmp 0x594a
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7cc0
cmpl $0x0, %eax
jne 0x5943
movq 0xe6b1(%rip), %rdi      # 0x13fd0
leaq 0x9dce(%rip), %rsi      # 0xf6f4
callq 0x2110
movq %rax, %rdi
movq 0xe68b(%rip), %rsi      # 0x13fc0
callq 0x2150
movl $0x0, -0x4(%rbp)
jmp 0x594a
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: get_new_ppn(ssd_info*, int, local const*, bool)
int get_new_ppn(ssd_info *ssd, int lpn, const local * location, bool hot){ // hot specify if we need a page in hot or cold active block 
	local * new_location;
	if (location != NULL) {
		new_location = new local(location->channel, location->lun, location->plane);
	}else {
		new_location = new local(0,0,0);
		allocate_plane(ssd, new_location);
	}
	if (allocate_page_in_plane(ssd, new_location, hot) != SUCCESS){
		delete new_location;
		return -1;
	}
	int ppn = find_ppn(ssd, new_location);
	delete new_location;
	return ppn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x59d1
movl $0x18, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %esi
movl 0x4(%rax), %edx
movl 0x8(%rax), %ecx
callq 0x8b20
jmp 0x59a8
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x5a28
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x18, %esi
callq 0x2140
jmp 0x5ab4
movl $0x18, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x50(%rbp)
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x8b20
jmp 0x59f2
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x81b0
jmp 0x5a28
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
movl $0x18, %esi
callq 0x2140
jmp 0x5ab4
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movb -0x21(%rbp), %al
andb $0x1, %al
movzbl %al, %edx
callq 0x82e0
cmpl $0x1, %eax
je 0x5a70
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x5a67
movq -0x58(%rbp), %rdi
callq 0x8b50
movq -0x58(%rbp), %rdi
movl $0x18, %esi
callq 0x2140
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x5aab
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x8480
movl %eax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
cmpq $0x0, %rax
je 0x5aa5
movq -0x60(%rbp), %rdi
callq 0x8b50
movq -0x60(%rbp), %rdi
movl $0x18, %esi
callq 0x2140
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x2230
nopl (%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: check_need_gc(ssd_info*, int)
bool check_need_gc(ssd_info * ssd, int ppn){
	local * location = new local(0,0,0);
	find_location(ssd, ppn, location);

	int free_page = ssd->channel_head[location->channel]->
				lun_head[location->lun]->plane_head[location->plane]->free_page;
	int all_page = ssd->parameter->page_block*ssd->parameter->block_plane;

	if (free_page > (all_page * ssd->parameter->gc_down_threshold)){
		delete location;
		return false;
	}
	delete location;
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x18, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x8b20
jmp 0x5b50
movq -0x40(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x5c70
movq -0x10(%rbp), %rax
movq 0x90(%rax), %rax
movq -0x20(%rbp), %rcx
movslq (%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x4(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movq -0x20(%rbp), %rcx
movslq 0x8(%rcx), %rcx
movq (%rax,%rcx,8), %rax
movq (%rax), %rax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x234(%rax), %eax
movq -0x10(%rbp), %rcx
movq 0x58(%rcx), %rcx
imull 0x230(%rcx), %eax
movl %eax, -0x34(%rbp)
cvtsi2ssl -0x30(%rbp), %xmm0
cvtsi2ssl -0x34(%rbp), %xmm1
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
mulss 0x28c(%rax), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x5c29
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
je 0x5c07
movq -0x48(%rbp), %rdi
callq 0x8b50
movq -0x48(%rbp), %rdi
movl $0x18, %esi
callq 0x2140
movb $0x0, -0x1(%rbp)
jmp 0x5c52
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x18, %esi
callq 0x2140
jmp 0x5c5d
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
je 0x5c4e
movq -0x50(%rbp), %rdi
callq 0x8b50
movq -0x50(%rbp), %rdi
movl $0x18, %esi
callq 0x2140
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x2230
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: invalid_old_page(ssd_info*, sub_request*)
STATE invalid_old_page(ssd_info * ssd, sub_request * sub){ // const int lpn){
	int lpn = sub->lpn;
	if (ssd->dram->map->map_entry[lpn].state == false){
		#if DUBG 
		cout << "error 1 " << sub->lpn  << endl; 	
		#endif 
		 return FAIL;
	}
	int old_ppn = ssd->dram->map->map_entry[lpn].pn;
	find_location(ssd, old_ppn, sub->location);
	if( update_map_entry(ssd, lpn, -1) == FAIL) {
		cout << "error 2" << endl; 
		return FAIL;
	}
	if (update_physical_page(ssd, old_ppn, -1)  == FAIL) {
		cout << "error 3 " << endl; 
		return FAIL;
	} 
	return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movb 0x4(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x67ad
movl $0x0, -0x4(%rbp)
jmp 0x6869
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
movq -0x18(%rbp), %rax
movq 0x60(%rax), %rdx
callq 0x5c70
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7cc0
cmpl $0x0, %eax
jne 0x6821
movq 0xd7d3(%rip), %rdi      # 0x13fd0
leaq 0x8f10(%rip), %rsi      # 0xf714
callq 0x2110
movq %rax, %rdi
movq 0xd7ad(%rip), %rsi      # 0x13fc0
callq 0x2150
movl $0x0, -0x4(%rbp)
jmp 0x6869
movq -0x10(%rbp), %rdi
movl -0x20(%rbp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7d80
cmpl $0x0, %eax
jne 0x6862
movq 0xd792(%rip), %rdi      # 0x13fd0
leaq 0x8ed7(%rip), %rsi      # 0xf71c
callq 0x2110
movq %rax, %rdi
movq 0xd76c(%rip), %rsi      # 0x13fc0
callq 0x2150
movl $0x0, -0x4(%rbp)
jmp 0x6869
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: process(ssd_info*)
ssd_info *process( ssd_info *ssd)   {
	// use some random to stop always prioritizing a single channel (channel 0)
	int random = rand();
	for(int chan=0;chan<ssd->parameter->channel_number;chan++)
	{
		int c = ( chan + random ) % ssd->parameter->channel_number;
		unsigned int flag=0;
		if(find_channel_state(ssd, c) == CHANNEL_MODE_IDLE)
		{
			services_2_io(ssd, c, &flag);
			if(flag == 0)
				services_2_gc(ssd, c, &flag);
		}
	}
	return ssd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x2090
movl %eax, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x98(%rcx), %eax
jae 0x6914
movl -0x10(%rbp), %eax
addl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
xorl %edx, %edx
divl 0x98(%rcx)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x9730
cmpl $0x0, %eax
jne 0x6907
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x18(%rbp), %rdx
callq 0x6920
cmpl $0x0, -0x18(%rbp)
jne 0x6905
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
leaq -0x18(%rbp), %rdx
callq 0x6e00
jmp 0x6907
jmp 0x6909
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x689b
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: narges64[P]SIMBA/ftl.cpp
// Function: update_map_entry(ssd_info*, int, int)
STATE update_map_entry(ssd_info * ssd, int lpn, int ppn){
	bool full_page= true;
	if (ppn == -1) {
		ssd->dram->map->map_entry[lpn].pn = -1;
		ssd->dram->map->map_entry[lpn].state = false;
		ssd->dram->map->map_entry[lpn].buf_ent = NULL;
	} else {
		ssd->dram->map->map_entry[lpn].pn=ppn;
		ssd->dram->map->map_entry[lpn].state = true;
	}

	return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb $0x1, -0x11(%rbp)
cmpl $-0x1, -0x10(%rbp)
jne 0x7d3a
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl $0xffffffff, (%rax)     # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movb $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
jmp 0x7d77
movl -0x10(%rbp), %ecx
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movl %ecx, (%rax)
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movb $0x1, 0x4(%rax)
movl $0x1, %eax
popq %rbp
retq
nop
// File: narges64[P]SIMBA/ftl.cpp
// Function: set_entry_state(ssd_info*, int, unsigned int)
uint64_t set_entry_state(ssd_info *ssd, int lsn,unsigned int size){
	uint64_t temp,state,move;

	temp=~(0xffffffffffffffff<<size);
	move=lsn%ssd->parameter->subpage_page;
	state=temp<<move;

	return state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x10(%rbp), %eax
movl %eax, %ecx
movq $-0x1, %rax
shlq %cl, %rax
xorq $-0x1, %rax
movq %rax, -0x18(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
xorl %edx, %edx
divl 0x238(%rcx)
movl %edx, %eax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq -0x28(%rbp), %rcx
shlq %cl, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: allocate_plane(ssd_info*, local*)
STATE allocate_plane( ssd_info * ssd , local * location){
	sub_request * update=NULL;
	unsigned int channel_num=0,lun_num=0,plane_num=0;
	if (location == NULL) location = new local(0,0,0);
	channel_num = ssd->parameter->channel_number;
	lun_num=ssd->parameter->lun_channel[0];
	plane_num=ssd->parameter->plane_lun;

	unsigned int target_lun = get_target_lun(ssd);
	location->channel=target_lun % channel_num;
	location->lun= (target_lun / channel_num) % ssd->parameter->lun_channel[location->channel];
	location->plane= get_target_plane(ssd, location->channel, location->lun);
	return SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x822e
movl $0x18, %edi
callq 0x2130
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
xorl %ecx, %ecx
movl %ecx, %esi
movl %ecx, %edx
callq 0x8b20
jmp 0x8205
movq -0x40(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x822e
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
movl $0x18, %esi
callq 0x2140
jmp 0x82cc
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x98(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x9c(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x22c(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x85e0
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
xorl %edx, %edx
divl -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl %edx, (%rax)
movl -0x38(%rbp), %eax
xorl %edx, %edx
divl -0x1c(%rbp)
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
movq -0x10(%rbp), %rdx
movslq (%rdx), %rsi
xorl %edx, %edx
divl 0x9c(%rcx,%rsi,4)
movq -0x10(%rbp), %rax
movl %edx, 0x4(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x8620
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movl $0x1, %eax
addq $0x40, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0x2230
nopw %cs:(%rax,%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: find_ppn(ssd_info*, local const*)
int find_ppn(ssd_info * ssd,const local * location){
	unsigned int channel = location->channel;
	unsigned int lun = location->lun;
	unsigned int plane = location->plane;
	unsigned int block = location->block;
	unsigned int page = location->page;

	int ppn=0;

	int page_plane=0,page_lun=0;
	int page_channel[100];

	page_plane=ssd->parameter->page_block*ssd->parameter->block_plane;
	page_lun=page_plane*ssd->parameter->plane_lun;

	unsigned int i=0;
	while(i<ssd->parameter->channel_number)
	{
		page_channel[i]=ssd->parameter->lun_channel[i]*page_lun;
		i++;
	}


	i=0;
	while(i<channel)
	{
		ppn=ppn+page_channel[i];
		i++;
	}
	ppn=ppn+page_lun*lun+page_plane*plane+block*ssd->parameter->page_block+page;

	return ppn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x234(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
imull 0x230(%rcx), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
imull 0x22c(%rcx), %eax
movl %eax, -0x30(%rbp)
movl $0x0, -0x1c4(%rbp)
movl -0x1c4(%rbp), %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x98(%rcx), %eax
jae 0x8565
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl -0x1c4(%rbp), %ecx
movl 0x9c(%rax,%rcx,4), %ecx
imull -0x30(%rbp), %ecx
movl -0x1c4(%rbp), %eax
movl %ecx, -0x1c0(%rbp,%rax,4)
movl -0x1c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
jmp 0x8518
movl $0x0, -0x1c4(%rbp)
movl -0x1c4(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x859e
movl -0x28(%rbp), %eax
movl -0x1c4(%rbp), %ecx
addl -0x1c0(%rbp,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movl -0x1c4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c4(%rbp)
jmp 0x856f
movl -0x28(%rbp), %eax
movl -0x30(%rbp), %ecx
imull -0x18(%rbp), %ecx
addl %ecx, %eax
movl -0x2c(%rbp), %ecx
imull -0x1c(%rbp), %ecx
addl %ecx, %eax
movl -0x20(%rbp), %ecx
movq -0x8(%rbp), %rdx
movq 0x58(%rdx), %rdx
imull 0x234(%rdx), %ecx
addl %ecx, %eax
addl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopl (%rax)
// File: narges64[P]SIMBA/ftl.cpp
// Function: get_target_plane(ssd_info*, int, int)
int get_target_plane(ssd_info * ssd, int channel, int lun) {
	int target_plane = ssd->channel_head[channel]->lun_head[lun]->plane_token;
	ssd->channel_head[channel]->lun_head[lun]->plane_token =
			(ssd->channel_head[channel]->lun_head[lun]->plane_token + 1) % ssd->parameter->plane_lun;
	return target_plane;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x9c(%rax), %eax
addl $0x1, %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
xorl %edx, %edx
divl 0x22c(%rcx)
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x50(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl %edx, 0x9c(%rax)
movl -0x14(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: narges64[P]SIMBA/./common.hh
// Function: write_buffer::hit_read(buffer_entry*)
void hit_read(buffer_entry * entry){
		if (entry == NULL) {
			cout << "Error in hit read " << endl;
			return;
		}
		read_hit++;
		if (entry->outlier) 
			cout << "outlier shouldn't get a hit in read " << endl; 
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8ba3
movq 0xb44a(%rip), %rdi      # 0x13fd0
leaq 0x6bd7(%rip), %rsi      # 0xf764
callq 0x2110
movq %rax, %rdi
movq 0xb424(%rip), %rsi      # 0x13fc0
callq 0x2150
jmp 0x8bda
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x8bda
movq 0xb411(%rip), %rdi      # 0x13fd0
leaq 0x6bb1(%rip), %rsi      # 0xf777
callq 0x2110
movq %rax, %rdi
movq 0xb3eb(%rip), %rsi      # 0x13fc0
callq 0x2150
addq $0x20, %rsp
popq %rbp
retq
// File: narges64[P]SIMBA/./common.hh
// Function: write_buffer::hit_write(buffer_entry*)
void hit_write(buffer_entry * entry){
		if (entry == NULL){
		//	cout << "Error in hit write " << endl;
			return;
		}
		write_hit++;
		entry->modified = true;
		if (entry->outlier) 
			cout << "outlier shouldn't get a hit in write " << endl; 
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8c91
jmp 0x8cd2
movq -0x18(%rbp), %rax
movl 0x4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rax)
movq -0x10(%rbp), %rax
movb $0x1, 0x1(%rax)
movq -0x10(%rbp), %rax
testb $0x1, 0x8(%rax)
je 0x8cd2
movq 0xb319(%rip), %rdi      # 0x13fd0
leaq 0x6b3d(%rip), %rsi      # 0xf7fb
callq 0x2110
movq %rax, %rdi
movq 0xb2f3(%rip), %rsi      # 0x13fc0
callq 0x2150
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: narges64[P]SIMBA/./common.hh
// Function: write_buffer::remove_entry(buffer_entry*)
buffer_entry * remove_entry (buffer_entry * entry){
		if (entry == NULL) return NULL;
		if (entry_count == 0) return NULL;
		if (entry == buffer_first_outlier) {
			buffer_first_outlier = entry->prev_entry; 
		} 
		if (entry == buffer_head) {
			return remove_head();
		}
		if (entry == buffer_tail){
			return remove_tail();
		}
		entry->prev_entry->next_entry = entry->next_entry;
		entry->next_entry->prev_entry = entry->prev_entry;
		entry->next_entry = NULL;
		entry->prev_entry = NULL;
		entry_count--;

		if (buffer_head == NULL && buffer_tail != NULL){
			cout << "**** Buffer head and tail problem 1 8" << endl;

		}
		if (buffer_head != NULL && buffer_tail == NULL){
			cout << "**** Buffer head and tail problem 2 8" << endl;
		}
	
		return entry;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x8dbc
movq $0x0, -0x8(%rbp)
jmp 0x8ef2
movq -0x20(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x8dd3
movq $0x0, -0x8(%rbp)
jmp 0x8ef2
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq 0x20(%rcx), %rax
jne 0x8df1
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq %rcx, 0x20(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq 0x10(%rcx), %rax
jne 0x8e11
movq -0x20(%rbp), %rdi
callq 0x9360
movq %rax, -0x8(%rbp)
jmp 0x8ef2
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
cmpq 0x18(%rcx), %rax
jne 0x8e31
movq -0x20(%rbp), %rdi
callq 0x94e0
movq %rax, -0x8(%rbp)
jmp 0x8ef2
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rdx
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rcx
movq %rdx, 0x18(%rcx)
movq -0x18(%rbp), %rcx
movq 0x20(%rcx), %rdx
movq -0x18(%rbp), %rcx
movq 0x18(%rcx), %rcx
movq %rdx, 0x20(%rcx)
movq -0x18(%rbp), %rcx
movq $0x0, 0x18(%rcx)
movq -0x18(%rbp), %rcx
movq $0x0, 0x20(%rcx)
movl 0xc(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0xc(%rax)
cmpq $0x0, 0x10(%rax)
jne 0x8eb2
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8eb2
movq 0xb139(%rip), %rdi      # 0x13fd0
leaq 0x6983(%rip), %rsi      # 0xf821
callq 0x2110
movq %rax, %rdi
movq 0xb113(%rip), %rsi      # 0x13fc0
callq 0x2150
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x8eea
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x8eea
movq 0xb101(%rip), %rdi      # 0x13fd0
leaq 0x6971(%rip), %rsi      # 0xf847
callq 0x2110
movq %rax, %rdi
movq 0xb0db(%rip), %rsi      # 0x13fc0
callq 0x2150
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)