LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: CMU-SAFARI[P]MQSim/src/host/SATA_HBA.cpp
// Function: Host_Components::SATA_HBA::Update_and_submit_ncq_completion_info()
void SATA_HBA::Update_and_submit_ncq_completion_info()
	{
		sata_ncq.Completion_queue_head++;
		if (sata_ncq.Completion_queue_head == sata_ncq.Completion_queue_size) {
			sata_ncq.Completion_queue_head = 0;
		}
		pcie_root_complex->Write_to_device(sata_ncq.Completion_head_register_address_on_device, sata_ncq.Completion_queue_head);//Based on NVMe protocol definition, the updated head pointer should be informed to the device
	}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movw 0x60(%rcx), %ax
addw $0x1, %ax
movw %ax, 0x60(%rcx)
movzwl 0x60(%rcx), %eax
movzwl 0x64(%rcx), %ecx
cmpl %ecx, %eax
jne 0x40596
movq 0x8(%rsp), %rax
movw $0x0, 0x60(%rax)
movq 0x8(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x68(%rax), %rsi
movzwl 0x60(%rax), %edx
callq 0x3f620
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Flash_Chip.cpp
// Function: NVM::FlashMemory::Flash_Chip::~Flash_Chip()
Flash_Chip::~Flash_Chip()
		{
			for (unsigned int dieID = 0; dieID < die_no; dieID++) {
				delete Dies[dieID];
			}
			delete[] Dies;
			delete[] _readLatency;
			delete[] _programLatency;
		}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x95716(%rip), %rcx     # 0xd8de0
addq $0x10, %rcx
movq %rcx, (%rax)
movl $0x0, 0x2c(%rsp)
movq 0x20(%rsp), %rcx
movl 0x2c(%rsp), %eax
cmpl 0x48(%rcx), %eax
jae 0x43726
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movl 0x2c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, %rax
je 0x43717
movq 0x18(%rsp), %rdi
callq 0x432b0
movq 0x18(%rsp), %rdi
callq 0x8410
jmp 0x43719
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x436d9
movq 0x20(%rsp), %rax
movq 0x40(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x43744
movq 0x10(%rsp), %rdi
callq 0x8570
movq 0x20(%rsp), %rax
movq 0x58(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x43762
movq 0x8(%rsp), %rdi
callq 0x8570
movq 0x20(%rsp), %rax
movq 0x60(%rax), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x4377e
movq (%rsp), %rdi
callq 0x8570
movq 0x20(%rsp), %rdi
addq $0xf0, %rdi
callq 0x45630
movq 0x20(%rsp), %rdi
callq 0x45690
addq $0x38, %rsp
retq
nop
// File: CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Flash_Chip.cpp
// Function: NVM::FlashMemory::Flash_Chip::Execute_simulator_event(MQSimEngine::Sim_Event*)
void Flash_Chip::Execute_simulator_event(MQSimEngine::Sim_Event* ev)
		{
			Chip_Sim_Event_Type eventType = (Chip_Sim_Event_Type)ev->Type;
			Flash_Command* command = (Flash_Command*)ev->Parameters;

			switch (eventType) {
				case Chip_Sim_Event_Type::COMMAND_FINISHED:
					finish_command_execution(command);
					break;
			}
		}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movq 0x18(%rsp), %rax
movl 0x18(%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x8(%rsp)
movl 0x14(%rsp), %eax
testl %eax, %eax
jne 0x43bb9
jmp 0x43bab
movq (%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x43bc0
addq $0x28, %rsp
retq
nop
// File: CMU-SAFARI[P]MQSim/src/nvm_chip/flash_memory/Plane.cpp
// Function: NVM::FlashMemory::Plane::Plane(unsigned int, unsigned int)
Plane::Plane(unsigned int BlocksNoPerPlane, unsigned int PagesNoPerBlock) :
			Read_count(0), Progam_count(0), Erase_count(0)
		{
			Healthy_block_no = BlocksNoPerPlane;
			Blocks = new Block*[BlocksNoPerPlane];
			for (unsigned int i = 0; i < BlocksNoPerPlane; i++) {
				Blocks[i] = new Block(PagesNoPerBlock, i);
			}
			Allocated_streams = NULL;
		}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movl 0x2c(%rsp), %ecx
movl %ecx, 0x8(%rax)
movl 0x2c(%rsp), %eax
movl $0x8, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
callq 0x8030
movq %rax, %rcx
movq 0x8(%rsp), %rax
movq %rcx, (%rax)
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x2c(%rsp), %eax
jae 0x46449
movl $0x10, %edi
callq 0x8450
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
movl 0x28(%rsp), %esi
movl 0x24(%rsp), %edx
callq 0x43050
jmp 0x4640f
movq (%rsp), %rdx
movq 0x8(%rsp), %rax
movq (%rax), %rax
movl 0x24(%rsp), %ecx
movq %rdx, (%rax,%rcx,8)
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x463e2
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0x8410
jmp 0x4645b
movq 0x8(%rsp), %rax
movq $0x0, 0x28(%rax)
addq $0x38, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0x8770
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::Reset()
void Engine::Reset()
	{
		_EventList->Clear();
		_ObjectList.clear();
		_sim_time = 0;
		stop = false;
		started = false;
		Utils::Logical_Address_Partitioning_Unit::Reset();
	}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rax), %rdi
callq 0x49a70
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0x46dd0
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movb $0x0, 0x48(%rax)
movb $0x0, 0x49(%rax)
callq 0xa54e0
addq $0x18, %rsp
retq
nopl (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::GetObject(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Sim_Object* Engine::GetObject(sim_object_id_type object_id)
	{
		auto itr = _ObjectList.find(object_id);
		if (itr == _ObjectList.end()) {
			return NULL;
		}

		return (*itr).second;
	}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq %rdi, 0x8(%rsp)
addq $0x10, %rdi
callq 0x46e00
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
addq $0x10, %rdi
callq 0x46e30
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x46f00
testb $0x1, %al
jne 0x468be
jmp 0x468c9
movq $0x0, 0x30(%rsp)
jmp 0x468dc
leaq 0x18(%rsp), %rdi
callq 0x46f20
movq 0x20(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::RemoveObject(MQSimEngine::Sim_Object*)
void Engine::RemoveObject(Sim_Object* obj)
	{
		std::unordered_map<sim_object_id_type, Sim_Object*>::iterator it = _ObjectList.find(obj->ID());
		if (it == _ObjectList.end()) {
			throw std::invalid_argument("Removing an unregistered object.");
		}
		_ObjectList.erase(it);
	}

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x8(%rsp)
addq $0x10, %rax
movq %rax, 0x10(%rsp)
movq 0x78(%rsp), %rsi
leaq 0x50(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xcdf0
movq 0x10(%rsp), %rdi
movq 0x18(%rsp), %rsi
callq 0x46e00
movq %rax, 0x20(%rsp)
jmp 0x46944
movq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x8848
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
callq 0x46e30
movq %rax, 0x38(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x46f00
testb $0x1, %al
jne 0x46980
jmp 0x469ec
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
leaq 0x659e3(%rip), %rsi     # 0xac37e
callq 0x87d0
jmp 0x469a2
movq (%rsp), %rdi
movq 0x9361b(%rip), %rsi     # 0xd9fc8
movq 0x935fc(%rip), %rdx     # 0xd9fb0
callq 0x8710
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x8848
jmp 0x46a16
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
callq 0x8330
jmp 0x46a16
movq 0x8(%rsp), %rdi
addq $0x10, %rdi
movq 0x70(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rsi
callq 0x46f40
movq %rax, 0x28(%rsp)
addq $0x88, %rsp
retq
movq 0x48(%rsp), %rdi
callq 0x8770
// File: CMU-SAFARI[P]MQSim/src/sim/Engine.cpp
// Function: MQSimEngine::Engine::Register_sim_event(unsigned long, MQSimEngine::Sim_Object*, void*, int)
Sim_Event* Engine::Register_sim_event(sim_time_type fireTime, Sim_Object* targetObject, void* parameters, int type)
	{
		Sim_Event* ev = new Sim_Event(fireTime, targetObject, parameters, type);
		DEBUG("RegisterEvent " << fireTime << " " << targetObject)
		_EventList->Insert_sim_event(ev);
		return ev;
	}

// Assembly:
subq $0x58, %rsp
movq %rdi, 0x50(%rsp)
movq %rsi, 0x48(%rsp)
movq %rdx, 0x40(%rsp)
movq %rcx, 0x38(%rsp)
movl %r8d, 0x34(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
movl $0x30, %edi
callq 0x8450
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
movq 0x48(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movl 0x34(%rsp), %r8d
callq 0x47010
jmp 0x46cb7
movq 0x8(%rsp), %rax
movq 0x10(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq 0x8(%rax), %rdi
movq 0x28(%rsp), %rsi
callq 0x492d0
movq 0x28(%rsp), %rax
addq $0x58, %rsp
retq
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x8410
movq 0x20(%rsp), %rdi
callq 0x8770
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::EventTree()
EventTree::EventTree()
	{
		// set up the sentinel node. the sentinel node is the key to a successfull
		// implementation and for understanding the red-black tree properties.
		SentinelNode = new EventTreeNode();
		SentinelNode->Left = NULL;
		SentinelNode->Right = NULL;
		SentinelNode->Parent = NULL;
		SentinelNode->Color = 1;
		rbTree = SentinelNode;
		lastNodeFound = SentinelNode;
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq 0x20(%rsp), %rax
movq %rax, (%rsp)
movl $0x38, %edi
callq 0x8450
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x49a90
jmp 0x48b7e
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x91b22(%rip)     # 0xda6b0
movq 0x91b1b(%rip), %rcx     # 0xda6b0
movq $0x0, 0x20(%rcx)
movq 0x91b0c(%rip), %rcx     # 0xda6b0
movq $0x0, 0x28(%rcx)
movq 0x91afd(%rip), %rcx     # 0xda6b0
movq $0x0, 0x30(%rcx)
movq 0x91aee(%rip), %rcx     # 0xda6b0
movl $0x1, 0x18(%rcx)
movq 0x91ae0(%rip), %rcx     # 0xda6b0
movq %rcx, 0x8(%rax)
movq 0x91ad5(%rip), %rcx     # 0xda6b0
movq %rcx, 0x10(%rax)
addq $0x28, %rsp
retq
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
callq 0x8410
movq 0x18(%rsp), %rdi
callq 0x8770
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::Add(unsigned long, MQSimEngine::Sim_Event*)
void EventTree::Add(sim_time_type key, Sim_Event* data)
	{
		// traverse tree - find where node belongs
		// create new node
		EventTreeNode* node = new EventTreeNode();
		// grab the rbTree node of the tree
		EventTreeNode* temp = rbTree;

		while (temp != SentinelNode) {
			// find Parent
			node->Parent = temp;
			
			if (key > temp->Key)
				temp = temp->Right;
			else
				temp = temp->Left;
		}

		// setup node
		node->Key = key;
		node->FirstSimEvent = data;
		node->LastSimEvent = data;
		node->Left = SentinelNode;
		node->Right = SentinelNode;

		// insert node into tree starting at parent's location
		if (node->Parent != NULL) {
			if (node->Key > (node->Parent->Key)) {
				node->Parent->Right = node;
			} else {
				node->Parent->Left = node;
			}
		} else {
			// first node added
			rbTree = node;
		}

		// restore red-black properities
		RestoreAfterInsert(node);
		lastNodeFound = node;
		Count++;
	}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
movl $0x38, %edi
callq 0x8450
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
callq 0x49a90
jmp 0x48c88
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x91a05(%rip), %rax     # 0xda6b0
je 0x48d07
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x30(%rax)
movq 0x38(%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq (%rcx), %rax
jbe 0x48cf7
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x48d05
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x8410
jmp 0x48dce
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x48c9f
movq 0x38(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x30(%rsp), %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x10(%rax)
movq 0x91979(%rip), %rcx     # 0xda6b0
movq 0x28(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x91969(%rip), %rcx     # 0xda6b0
movq 0x28(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x48d9a
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x30(%rcx), %rcx
cmpq (%rcx), %rax
jbe 0x48d86
movq 0x28(%rsp), %rcx
movq 0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x28(%rax)
jmp 0x48d98
movq 0x28(%rsp), %rcx
movq 0x28(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0x48da7
movq (%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq (%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x48de0
movq (%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, 0x10(%rax)
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
addq $0x48, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x8770
nopl (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::RotateLeft(MQSimEngine::EventTreeNode*)
void EventTree::RotateLeft(EventTreeNode* x)
	{
		// pushing node x down and to the Left to balance the tree. x's Right child (y)
		// replaces x (since y > x), and y's Left child becomes x's Right child 
		// (since it's < y but > x).

		EventTreeNode* y = x->Right;			// get x's Right node, this becomes y

												// set x's Right link
		x->Right = y->Left;					// y's Left child's becomes x's Right child

											// modify parents
		if (y->Left != SentinelNode)
			y->Left->Parent = x;				// sets y's Left Parent to x

		if (y != SentinelNode)
			y->Parent = x->Parent;			// set y's Parent to x's Parent

		if (x->Parent != NULL)
		{	// determine which side of it's Parent x was on
			if (x == x->Parent->Left)
				x->Parent->Left = y;			// set Left Parent to y
			else
				x->Parent->Right = y;			// set Right Parent to y
		}
		else
			rbTree = y;						// at rbTree, set it to y

											// link x and y 
		y->Left = x;							// put x on y's Left 
		if (x != SentinelNode)						// set y as x's Parent
			x->Parent = y;
	}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
cmpq 0x9163c(%rip), %rax     # 0xda6b0
je 0x49088
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rsp), %rax
cmpq 0x9161c(%rip), %rax     # 0xda6b0
je 0x490a8
movq -0x10(%rsp), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x490f0
movq -0x10(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0x30(%rcx), %rcx
cmpq 0x20(%rcx), %rax
jne 0x490dc
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0x490ee
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x28(%rax)
jmp 0x490fe
movq -0x20(%rsp), %rax
movq -0x18(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x20(%rax)
movq -0x10(%rsp), %rax
cmpq 0x91598(%rip), %rax     # 0xda6b0
je 0x49128
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::RotateRight(MQSimEngine::EventTreeNode*)
void EventTree::RotateRight(EventTreeNode* x)
	{
		// pushing node x down and to the Right to balance the tree. x's Left child (y)
		// replaces x (since x < y), and y's Right child becomes x's Left child 
		// (since it's < x but > y).

		EventTreeNode* y = x->Left;			// get x's Left node, this becomes y

												// set x's Right link
		x->Left = y->Right;					// y's Right child becomes x's Left child

											// modify parents
		if (y->Right != SentinelNode)
			y->Right->Parent = x;				// sets y's Right Parent to x

		if (y != SentinelNode)
			y->Parent = x->Parent;			// set y's Parent to x's Parent

		if (x->Parent != NULL)				// null=rbTree, could also have used rbTree
		{	// determine which side of it's Parent x was on
			if (x == x->Parent->Right)
				x->Parent->Right = y;			// set Right Parent to y
			else
				x->Parent->Left = y;			// set Left Parent to y
		}
		else
			rbTree = y;						// at rbTree, set it to y

											// link x and y 
		y->Right = x;						// put x on y's Right
		if (x != SentinelNode)				// set y as x's Parent
			x->Parent = y;
	}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x20(%rsp)
movq -0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x18(%rsp)
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rax
cmpq 0x9153c(%rip), %rax     # 0xda6b0
je 0x49188
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq 0x28(%rax), %rax
movq %rcx, 0x30(%rax)
movq -0x18(%rsp), %rax
cmpq 0x9151c(%rip), %rax     # 0xda6b0
je 0x491a8
movq -0x10(%rsp), %rax
movq 0x30(%rax), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x30(%rax)
movq -0x10(%rsp), %rax
cmpq $0x0, 0x30(%rax)
je 0x491f0
movq -0x10(%rsp), %rax
movq -0x10(%rsp), %rcx
movq 0x30(%rcx), %rcx
cmpq 0x28(%rcx), %rax
jne 0x491dc
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x28(%rax)
jmp 0x491ee
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq 0x30(%rax), %rax
movq %rcx, 0x20(%rax)
jmp 0x491fe
movq -0x20(%rsp), %rax
movq -0x18(%rsp), %rcx
movq %rcx, 0x8(%rax)
movq -0x10(%rsp), %rcx
movq -0x18(%rsp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rsp), %rax
cmpq 0x91498(%rip), %rax     # 0xda6b0
je 0x49228
movq -0x18(%rsp), %rcx
movq -0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::GetData(unsigned long)
Sim_Event* EventTree::GetData(sim_time_type key)
	{
		EventTreeNode* treeNode = rbTree;     // begin at root
		// traverse tree until node is found
		while (treeNode != SentinelNode)
		{
			if (key == treeNode->Key) {
				lastNodeFound = treeNode;
				return treeNode->FirstSimEvent;
			}
			if (key < (treeNode->Key)) {
				treeNode = treeNode->Left;
			} else {
				treeNode = treeNode->Right;
			}
		}
		return NULL;
	}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x28(%rsp)
movq 0x8(%rax), %rax
movq %rax, -0x20(%rsp)
movq -0x20(%rsp), %rax
cmpq 0x91457(%rip), %rax     # 0xda6b0
je 0x492b7
movq -0x18(%rsp), %rax
movq -0x20(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x49288
movq -0x28(%rsp), %rax
movq -0x20(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq -0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rsp)
jmp 0x492c0
movq -0x18(%rsp), %rax
movq -0x20(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x492a7
movq -0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x20(%rsp)
jmp 0x492b5
movq -0x20(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x20(%rsp)
jmp 0x4924d
movq $0x0, -0x8(%rsp)
movq -0x8(%rsp), %rax
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::Insert_sim_event(MQSimEngine::Sim_Event*)
void EventTree::Insert_sim_event(Sim_Event* event)
	{
		if (event->Fire_time < Engine::Instance()->Time()) {
			PRINT_ERROR("Illegal request to register a simulation event before Now!")
		}

		sim_time_type key = event->Fire_time;
		EventTreeNode* treeNode = rbTree;     // begin at root

												// traverse tree until node is found
		while (treeNode != SentinelNode)
		{
			if (key == treeNode->Key) {
				treeNode->LastSimEvent->Next_event = event;
				treeNode->LastSimEvent = event;
				return;
			}
			if (key < (treeNode->Key)) {
				treeNode = treeNode->Left;
			} else {
				treeNode = treeNode->Right;
			}
		}
		Add(event->Fire_time, event);
	}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x46500
movq %rax, %rdi
callq 0x46c50
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0x4935a
movq 0x90cda(%rip), %rdi     # 0xd9ff0
leaq 0x615cb(%rip), %rsi     # 0xaa8e8
callq 0x8440
movq 0x90cc7(%rip), %rdi     # 0xd9ff0
leaq 0x6306f(%rip), %rsi     # 0xac39f
callq 0x8440
movq %rax, %rdi
movq 0x90c19(%rip), %rsi     # 0xd9f58
callq 0x8480
movq 0x90c85(%rip), %rdi     # 0xd9fd0
callq 0x84f0
movl $0x1, %edi
callq 0x8500
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
movq (%rcx), %rcx
movq %rcx, 0x20(%rsp)
movq 0x8(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
cmpq 0x9132f(%rip), %rax     # 0xda6b0
je 0x493e3
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq (%rcx), %rax
jne 0x493b4
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x20(%rax)
movq 0x28(%rsp), %rcx
movq 0x18(%rsp), %rax
movq %rcx, 0x10(%rax)
jmp 0x493fa
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rcx
cmpq (%rcx), %rax
jae 0x493d3
movq 0x18(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x493e1
movq 0x18(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x18(%rsp)
jmp 0x49375
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq 0x28(%rsp), %rdx
callq 0x48c50
addq $0x38, %rsp
retq
nop
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::Get_min_node()
EventTreeNode* EventTree::Get_min_node()
	{
		EventTreeNode* treeNode = rbTree;

		// traverse to the extreme left to find the smallest key
		while (treeNode->Left != SentinelNode) {
			treeNode = treeNode->Left;
		}

		lastNodeFound = treeNode;

		return treeNode;
	}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x18(%rsp)
movq 0x8(%rax), %rax
movq %rax, -0x10(%rsp)
movq -0x10(%rsp), %rax
movq 0x20(%rax), %rax
cmpq 0x91268(%rip), %rax     # 0xda6b0
je 0x4945a
movq -0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x10(%rsp)
jmp 0x49438
movq -0x18(%rsp), %rax
movq -0x10(%rsp), %rcx
movq %rcx, 0x10(%rax)
movq -0x10(%rsp), %rax
retq
nop
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.cpp
// Function: MQSimEngine::EventTree::Remove(unsigned long)
void EventTree::Remove(sim_time_type key)
	{	
		// find node
		EventTreeNode* node;

		// see if node to be deleted was the last one found
		if (key == lastNodeFound->Key)
			node = lastNodeFound;
		else
		{	// not found, must search		
			node = rbTree;
			while (node != SentinelNode)
			{
				if (key == lastNodeFound->Key)
					break;
				if (key < lastNodeFound->Key)
					node = node->Left;
				else
					node = node->Right;
			}

			if (node == SentinelNode)
				return;				// key not found
		}

		Delete(node);

		Count--;
	}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq 0x20(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x18(%rsp), %rax
movq 0x10(%rcx), %rcx
cmpq (%rcx), %rax
jne 0x494c6
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x4953c
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x911d0(%rip), %rax     # 0xda6b0
je 0x4952a
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq 0x10(%rcx), %rcx
cmpq (%rcx), %rax
jne 0x494f7
jmp 0x4952a
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %rax
movq 0x10(%rcx), %rcx
cmpq (%rcx), %rax
jae 0x4951a
movq 0x10(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x49528
movq 0x10(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x10(%rsp)
jmp 0x494d4
movq 0x10(%rsp), %rax
cmpq 0x9117a(%rip), %rax     # 0xda6b0
jne 0x4953a
jmp 0x49557
jmp 0x4953c
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x49560
movq 0x8(%rsp), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
addq $0x28, %rsp
retq
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/sim/EventTree.h
// Function: MQSimEngine::EventTreeNode::EventTreeNode()
EventTreeNode()
		{
			Color = 0;
			Left = NULL;
			Right = NULL;
			Parent = NULL;
		}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movl $0x0, 0x18(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x30(%rax)
retq
nopw (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/../nvm_chip/flash_memory/Physical_Page_Address.h
// Function: NVM::FlashMemory::Physical_Page_Address::Physical_Page_Address(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, unsigned int)
Physical_Page_Address(const flash_channel_ID_type channel_id = 0, const flash_chip_ID_type chip_id = 0, const flash_die_ID_type die_id = 0,
				const flash_plane_ID_type plane_id = 0, const flash_block_ID_type block_id = 0, const flash_page_ID_type page_id = 0)
			{
				ChannelID = channel_id;
				ChipID = chip_id;
				DieID = die_id;
				PlaneID = plane_id;
				BlockID = block_id;
				PageID = page_id;
			}

// Assembly:
movl 0x8(%rsp), %eax
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movl %edx, -0x10(%rsp)
movl %ecx, -0x14(%rsp)
movl %r8d, -0x18(%rsp)
movl %r9d, -0x1c(%rsp)
movq -0x8(%rsp), %rax
movl -0xc(%rsp), %ecx
movl %ecx, (%rax)
movl -0x10(%rsp), %ecx
movl %ecx, 0x4(%rax)
movl -0x14(%rsp), %ecx
movl %ecx, 0x8(%rax)
movl -0x18(%rsp), %ecx
movl %ecx, 0xc(%rax)
movl -0x1c(%rsp), %ecx
movl %ecx, 0x10(%rax)
movl 0x8(%rsp), %ecx
movl %ecx, 0x14(%rax)
retq
nop
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::~Cached_Mapping_Table()
Cached_Mapping_Table::~Cached_Mapping_Table()
	{
		std::unordered_map<LPA_type, CMTSlotType*> addressMap;
		std::list<std::pair<LPA_type, CMTSlotType*>> lruList;

		auto entry = addressMap.begin();
		while (entry != addressMap.end()) {
			delete (*entry).second;
			addressMap.erase(entry++);
		}
	}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x589d0
leaq 0x40(%rsp), %rdi
callq 0x589e0
leaq 0x58(%rsp), %rdi
callq 0x589f0
movq %rax, 0x38(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x58a40
movq %rax, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x58a20
testb $0x1, %al
jne 0x4a353
jmp 0x4a3a9
leaq 0x38(%rsp), %rdi
callq 0x58a70
movq 0x8(%rax), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, %rax
je 0x4a376
movq 0x10(%rsp), %rdi
callq 0x8410
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
callq 0x58ad0
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x58a90
movq %rax, 0x8(%rsp)
jmp 0x4a39d
movq 0x8(%rsp), %rax
movq %rax, 0x20(%rsp)
jmp 0x4a32f
leaq 0x40(%rsp), %rdi
callq 0x58b00
leaq 0x58(%rsp), %rdi
callq 0x58b10
movq 0x18(%rsp), %rdi
addq $0x38, %rdi
callq 0x58b00
movq 0x18(%rsp), %rdi
callq 0x58b10
addq $0x98, %rsp
retq
movq %rax, %rdi
callq 0xd460
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Retrieve_ppa(unsigned short, unsigned long)
PPA_type Cached_Mapping_Table::Retrieve_ppa(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		assert(it != addressMap.end());
		assert(it->second->Status == CMTEntryStatus::VALID);
		lruList.splice(lruList.begin(), lruList, it->second->listPtr);
		
		return it->second->PPA;
	}

// Assembly:
subq $0x68, %rsp
movw %si, %ax
movq %rdi, 0x60(%rsp)
movw %ax, 0x5e(%rsp)
movq %rdx, 0x50(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x18(%rsp)
movzwl 0x5e(%rsp), %eax
shlq $0x38, %rax
orq 0x50(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rsi
callq 0x58b20
movq 0x18(%rsp), %rdi
movq %rax, 0x40(%rsp)
callq 0x58a40
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x58a20
testb $0x1, %al
jne 0x4a456
jmp 0x4a458
jmp 0x4a477
leaq 0x62151(%rip), %rdi     # 0xac5b0
leaq 0x62161(%rip), %rsi     # 0xac5c7
movl $0x30, %edx
leaq 0x62181(%rip), %rcx     # 0xac5f3
callq 0x82d0
leaq 0x40(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x4a48d
jmp 0x4a4ac
leaq 0x621c1(%rip), %rdi     # 0xac655
leaq 0x6212c(%rip), %rsi     # 0xac5c7
movl $0x31, %edx
leaq 0x6214c(%rip), %rcx     # 0xac5f3
callq 0x82d0
movq 0x18(%rsp), %rdi
movq %rdi, %rax
addq $0x38, %rax
movq %rax, 0x8(%rsp)
addq $0x38, %rdi
callq 0x58bc0
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x58bf0
movq 0x18(%rsp), %rax
addq $0x38, %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rsi
addq $0x18, %rsi
leaq 0x20(%rsp), %rdi
callq 0x58bf0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movq 0x30(%rsp), %rsi
movq 0x20(%rsp), %rcx
callq 0x58b70
leaq 0x40(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
movq (%rax), %rax
addq $0x68, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Get_bitmap_vector_of_written_sectors(unsigned short, unsigned long)
page_status_type Cached_Mapping_Table::Get_bitmap_vector_of_written_sectors(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		assert(it != addressMap.end());
		assert(it->second->Status == CMTEntryStatus::VALID);

		return it->second->WrittenStateBitmap;
	}

// Assembly:
subq $0x38, %rsp
movw %si, %ax
movq %rdi, 0x30(%rsp)
movw %ax, 0x2e(%rsp)
movq %rdx, 0x20(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, (%rsp)
movzwl 0x2e(%rsp), %eax
shlq $0x38, %rax
orq 0x20(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rsi
callq 0x58b20
movq (%rsp), %rdi
movq %rax, 0x10(%rsp)
callq 0x58a40
movq %rax, 0x8(%rsp)
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x58a20
testb $0x1, %al
jne 0x4a5a4
jmp 0x4a5a6
jmp 0x4a5c5
leaq 0x62003(%rip), %rdi     # 0xac5b0
leaq 0x62013(%rip), %rsi     # 0xac5c7
movl $0x3b, %edx
leaq 0x620c1(%rip), %rcx     # 0xac681
callq 0x82d0
leaq 0x10(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x4a5db
jmp 0x4a5fa
leaq 0x62073(%rip), %rdi     # 0xac655
leaq 0x61fde(%rip), %rsi     # 0xac5c7
movl $0x3c, %edx
leaq 0x6208c(%rip), %rcx     # 0xac681
callq 0x82d0
leaq 0x10(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Update_mapping_info(unsigned short, unsigned long, unsigned long, unsigned long)
void Cached_Mapping_Table::Update_mapping_info(const stream_id_type streamID, const LPA_type lpa, const PPA_type ppa, const page_status_type pageWriteState)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpa);
		auto it = addressMap.find(key);
		assert(it != addressMap.end());
		assert(it->second->Status == CMTEntryStatus::VALID);
		it->second->PPA = ppa;
		it->second->WrittenStateBitmap = pageWriteState;
		it->second->Dirty = true;
		it->second->Stream_id = streamID;
		DEBUG("Address mapping table update entry - Stream ID:" << streamID << ", LPA:" << lpa << ", PPA:" << ppa)
	}

// Assembly:
subq $0x68, %rsp
movw %si, %ax
movq %rdi, 0x60(%rsp)
movw %ax, 0x5e(%rsp)
movq %rdx, 0x50(%rsp)
movq %rcx, 0x48(%rsp)
movq %r8, 0x40(%rsp)
movq 0x60(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movzwl 0x5e(%rsp), %eax
shlq $0x38, %rax
orq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x38(%rsp), %rsi
callq 0x58b20
movq 0x20(%rsp), %rdi
movq %rax, 0x30(%rsp)
callq 0x58a40
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x58a20
testb $0x1, %al
jne 0x4a690
jmp 0x4a692
jmp 0x4a6b1
leaq 0x61f17(%rip), %rdi     # 0xac5b0
leaq 0x61f27(%rip), %rsi     # 0xac5c7
movl $0x45, %edx
leaq 0x62057(%rip), %rcx     # 0xac703
callq 0x82d0
leaq 0x30(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
cmpl $0x2, 0x14(%rax)
jne 0x4a6c7
jmp 0x4a6e6
leaq 0x61f87(%rip), %rdi     # 0xac655
leaq 0x61ef2(%rip), %rsi     # 0xac5c7
movl $0x46, %edx
leaq 0x62022(%rip), %rcx     # 0xac703
callq 0x82d0
movq 0x48(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x58b50
movq 0x8(%rsp), %rcx
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x58b50
movq 0x10(%rsp), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
movb $0x1, 0x10(%rax)
movw 0x5e(%rsp), %ax
movw %ax, 0x1e(%rsp)
leaq 0x30(%rsp), %rdi
callq 0x58b50
movw 0x1e(%rsp), %cx
movq 0x8(%rax), %rax
movw %cx, 0x20(%rax)
addq $0x68, %rsp
retq
nop
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Insert_new_mapping_info(unsigned short, unsigned long, unsigned long, unsigned long long)
void Cached_Mapping_Table::Insert_new_mapping_info(const stream_id_type streamID, const LPA_type lpa, const PPA_type ppa, const unsigned long long pageWriteState)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpa);
		auto it = addressMap.find(key);
		if (it == addressMap.end()) {
			throw std::logic_error("No slot is reserved!");
		}

		it->second->Status = CMTEntryStatus::VALID;
		it->second->PPA = ppa;
		it->second->WrittenStateBitmap = pageWriteState;
		it->second->Dirty = false;
		it->second->Stream_id = streamID;
		DEBUG("Address mapping table insert entry - Stream ID:" << streamID << ", LPA:" << lpa << ", PPA:" << ppa)
	}

// Assembly:
subq $0x78, %rsp
movw %si, %ax
movq %rdi, 0x70(%rsp)
movw %ax, 0x6e(%rsp)
movq %rdx, 0x60(%rsp)
movq %rcx, 0x58(%rsp)
movq %r8, 0x50(%rsp)
movq 0x70(%rsp), %rdi
movq %rdi, 0x20(%rsp)
movzwl 0x6e(%rsp), %eax
shlq $0x38, %rax
orq 0x60(%rsp), %rax
movq %rax, 0x48(%rsp)
leaq 0x48(%rsp), %rsi
callq 0x58b20
movq 0x20(%rsp), %rdi
movq %rax, 0x40(%rsp)
callq 0x58a40
movq %rax, 0x38(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x58c10
testb $0x1, %al
jne 0x4a7d0
jmp 0x4a828
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x18(%rsp)
leaq 0x61fa4(%rip), %rsi     # 0xac790
callq 0x8610
jmp 0x4a7f3
movq 0x18(%rsp), %rdi
movq 0x8f7c1(%rip), %rsi     # 0xd9fc0
movq 0x8f78a(%rip), %rdx     # 0xd9f90
callq 0x8710
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
callq 0x8330
jmp 0x4a8b4
leaq 0x40(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
movl $0x2, 0x14(%rax)
movq 0x58(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
callq 0x58b50
movq (%rsp), %rcx
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x58b50
movq 0x8(%rsp), %rcx
movq 0x8(%rax), %rax
movq %rcx, 0x8(%rax)
leaq 0x40(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
movb $0x0, 0x10(%rax)
movw 0x6e(%rsp), %ax
movw %ax, 0x16(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x58b50
movw 0x16(%rsp), %cx
movq 0x8(%rax), %rax
movw %cx, 0x20(%rax)
addq $0x78, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0x8770
nop
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Is_slot_reserved_for_lpn_and_waiting(unsigned short, unsigned long)
bool Cached_Mapping_Table::Is_slot_reserved_for_lpn_and_waiting(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		if (it != addressMap.end()) {
			if (it->second->Status == CMTEntryStatus::WAITING) {
				return true;
			}
		}

		return false;
	}

// Assembly:
subq $0x48, %rsp
movw %si, %ax
movq %rdi, 0x38(%rsp)
movw %ax, 0x36(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x38(%rsp), %rdi
movq %rdi, 0x8(%rsp)
movzwl 0x36(%rsp), %eax
shlq $0x38, %rax
orq 0x28(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x20(%rsp), %rsi
callq 0x58b20
movq 0x8(%rsp), %rdi
movq %rax, 0x18(%rsp)
callq 0x58a40
movq %rax, 0x10(%rsp)
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x58a20
testb $0x1, %al
jne 0x4a926
jmp 0x4a943
leaq 0x18(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
cmpl $0x1, 0x14(%rax)
jne 0x4a941
movb $0x1, 0x47(%rsp)
jmp 0x4a948
jmp 0x4a943
movb $0x0, 0x47(%rsp)
movb 0x47(%rsp), %al
andb $0x1, %al
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Reserve_slot_for_lpn(unsigned short, unsigned long)
void Cached_Mapping_Table::Reserve_slot_for_lpn(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);

		if (addressMap.find(key) != addressMap.end()) {
			throw std::logic_error("Duplicate lpa insertion into CMT!");
		}
		if (addressMap.size() >= capacity) {
			throw std::logic_error("CMT overfull!");
		}

		CMTSlotType* cmtEnt = new CMTSlotType();
		cmtEnt->Dirty = false;
		cmtEnt->Stream_id = streamID;
		lruList.push_front(std::pair<LPA_type, CMTSlotType*>(key, cmtEnt));
		cmtEnt->Status = CMTEntryStatus::WAITING;
		cmtEnt->listPtr = lruList.begin();
		addressMap[key] = cmtEnt;
	}

// Assembly:
subq $0x98, %rsp
movw %si, %ax
movq %rdi, 0x90(%rsp)
movw %ax, 0x8e(%rsp)
movq %rdx, 0x80(%rsp)
movq 0x90(%rsp), %rdi
movq %rdi, 0x30(%rsp)
movzwl 0x8e(%rsp), %eax
shlq $0x38, %rax
orq 0x80(%rsp), %rax
movq %rax, 0x78(%rsp)
leaq 0x78(%rsp), %rsi
callq 0x58b20
movq 0x30(%rsp), %rdi
movq %rax, 0x70(%rsp)
callq 0x58a40
movq %rax, 0x68(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x58a20
testb $0x1, %al
jne 0x4a9db
jmp 0x4aa33
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x28(%rsp)
leaq 0x61dae(%rip), %rsi     # 0xac7a5
callq 0x8610
jmp 0x4a9fe
movq 0x28(%rsp), %rdi
movq 0x8f5b6(%rip), %rsi     # 0xd9fc0
movq 0x8f57f(%rip), %rdx     # 0xd9f90
callq 0x8710
movq 0x28(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
callq 0x8330
jmp 0x4ab75
movq 0x30(%rsp), %rdi
callq 0x58c30
movq 0x30(%rsp), %rcx
movl 0x50(%rcx), %ecx
cmpq %rcx, %rax
jb 0x4aaa2
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x20(%rsp)
leaq 0x61d61(%rip), %rsi     # 0xac7c7
callq 0x8610
jmp 0x4aa6d
movq 0x20(%rsp), %rdi
movq 0x8f547(%rip), %rsi     # 0xd9fc0
movq 0x8f510(%rip), %rdx     # 0xd9f90
callq 0x8710
movq 0x20(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x60(%rsp)
movl %eax, 0x5c(%rsp)
callq 0x8330
jmp 0x4ab75
movl $0x28, %edi
callq 0x8450
movq %rax, %rdi
movq %rdi, 0x8(%rsp)
xorl %esi, %esi
movl $0x28, %edx
callq 0x8260
movq 0x8(%rsp), %rdi
callq 0x58c40
movq 0x8(%rsp), %rcx
movq 0x30(%rsp), %rax
movq %rcx, 0x50(%rsp)
movq 0x50(%rsp), %rcx
movb $0x0, 0x10(%rcx)
movw 0x8e(%rsp), %dx
movq 0x50(%rsp), %rcx
movw %dx, 0x20(%rcx)
addq $0x38, %rax
movq %rax, 0x10(%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x50(%rsp), %rdx
callq 0x58ca0
movq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x58c60
movq 0x30(%rsp), %rdi
movq 0x50(%rsp), %rax
movl $0x1, 0x14(%rax)
addq $0x38, %rdi
callq 0x58bc0
movq 0x30(%rsp), %rdi
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x18(%rax)
movq 0x50(%rsp), %rax
movq %rax, 0x18(%rsp)
leaq 0x78(%rsp), %rsi
callq 0x58cd0
movq 0x18(%rsp), %rcx
movq %rcx, (%rax)
addq $0x98, %rsp
retq
movq 0x60(%rsp), %rdi
callq 0x8770
nop
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Evict_one_slot(unsigned long&)
CMTSlotType Cached_Mapping_Table::Evict_one_slot(LPA_type& lpa)
	{
		assert(addressMap.size() > 0);
		addressMap.erase(lruList.back().first);
		lpa = UNIQUE_KEY_TO_LPN(lruList.back().second->Stream_id,lruList.back().first);
		CMTSlotType evictedItem = *lruList.back().second;
		delete lruList.back().second;
		lruList.pop_back();
	
		return evictedItem;
	}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x10(%rsp)
movq %rdi, 0x18(%rsp)
movq %rsi, 0x30(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x30(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x58c30
cmpq $0x0, %rax
jbe 0x4abaf
jmp 0x4abce
leaq 0x61c1f(%rip), %rdi     # 0xac7d5
leaq 0x61a0a(%rip), %rsi     # 0xac5c7
movl $0x85, %edx
leaq 0x61c22(%rip), %rcx     # 0xac7eb
callq 0x82d0
movq 0x20(%rsp), %rdi
addq $0x38, %rdi
callq 0x58d30
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x58d00
movq 0x20(%rsp), %rdi
addq $0x38, %rdi
callq 0x58d30
movq 0x20(%rsp), %rdi
movq 0x8(%rax), %rax
movzwl 0x20(%rax), %eax
shlq $0x38, %rax
xorq $-0x1, %rax
movq %rax, (%rsp)
addq $0x38, %rdi
callq 0x58d30
movq (%rsp), %rcx
movq 0x20(%rsp), %rdi
andq (%rax), %rcx
movq 0x28(%rsp), %rax
movq %rcx, (%rax)
addq $0x38, %rdi
callq 0x58d30
movq 0x10(%rsp), %rdi
movq 0x8(%rax), %rsi
movl $0x28, %edx
callq 0x8390
movq 0x20(%rsp), %rdi
addq $0x38, %rdi
callq 0x58d30
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x4ac70
movq 0x8(%rsp), %rdi
callq 0x8410
movq 0x20(%rsp), %rdi
addq $0x38, %rdi
callq 0x58d70
movq 0x18(%rsp), %rax
addq $0x38, %rsp
retq
nopl (%rax,%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Is_dirty(unsigned short, unsigned long)
bool Cached_Mapping_Table::Is_dirty(const stream_id_type streamID, const LPA_type lpa)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpa);
		auto it = addressMap.find(key);
		if (it == addressMap.end())
		{
			throw std::logic_error("The requested slot does not exist!");
		}

		return it->second->Dirty;
	}

// Assembly:
subq $0x58, %rsp
movw %si, %ax
movq %rdi, 0x50(%rsp)
movw %ax, 0x4e(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movzwl 0x4e(%rsp), %eax
shlq $0x38, %rax
orq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x38(%rsp), %rsi
callq 0x58b20
movq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
callq 0x58a40
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x58c10
testb $0x1, %al
jne 0x4acf6
jmp 0x4ad4b
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
leaq 0x61b26(%rip), %rsi     # 0xac838
callq 0x8610
jmp 0x4ad19
movq 0x8(%rsp), %rdi
movq 0x8f29b(%rip), %rsi     # 0xd9fc0
movq 0x8f264(%rip), %rdx     # 0xd9f90
callq 0x8710
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x8330
jmp 0x4ad63
leaq 0x30(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
movb 0x10(%rax), %al
andb $0x1, %al
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x8770
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Cached_Mapping_Table::Make_clean(unsigned short, unsigned long)
void Cached_Mapping_Table::Make_clean(const stream_id_type streamID, const LPA_type lpn)
	{
		LPA_type key = LPN_TO_UNIQUE_KEY(streamID, lpn);
		auto it = addressMap.find(key);
		if (it == addressMap.end()) {
			throw std::logic_error("The requested slot does not exist!");
		}

		it->second->Dirty = false;
	}

// Assembly:
subq $0x58, %rsp
movw %si, %ax
movq %rdi, 0x50(%rsp)
movw %ax, 0x4e(%rsp)
movq %rdx, 0x40(%rsp)
movq 0x50(%rsp), %rdi
movq %rdi, 0x10(%rsp)
movzwl 0x4e(%rsp), %eax
shlq $0x38, %rax
orq 0x40(%rsp), %rax
movq %rax, 0x38(%rsp)
leaq 0x38(%rsp), %rsi
callq 0x58b20
movq 0x10(%rsp), %rdi
movq %rax, 0x30(%rsp)
callq 0x58a40
movq %rax, 0x28(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x58c10
testb $0x1, %al
jne 0x4add6
jmp 0x4ae2b
movl $0x10, %edi
callq 0x8200
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x8(%rsp)
leaq 0x61a46(%rip), %rsi     # 0xac838
callq 0x8610
jmp 0x4adf9
movq 0x8(%rsp), %rdi
movq 0x8f1bb(%rip), %rsi     # 0xd9fc0
movq 0x8f184(%rip), %rdx     # 0xd9f90
callq 0x8710
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x8330
jmp 0x4ae42
leaq 0x30(%rsp), %rdi
callq 0x58b50
movq 0x8(%rax), %rax
movb $0x0, 0x10(%rax)
addq $0x58, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x8770
nopl (%rax)
// File: CMU-SAFARI[P]MQSim/src/ssd/Address_Mapping_Unit_Page_Level.cpp
// Function: SSD_Components::Address_Mapping_Unit_Page_Level::Store_mapping_table_on_flash_at_start()
void Address_Mapping_Unit_Page_Level::Store_mapping_table_on_flash_at_start()
	{
		if (mapping_table_stored_on_flash) {
			return;
		}
		//Since address translation functions work on flash transactions
		NVM_Transaction_Flash_WR* dummy_tr = new NVM_Transaction_Flash_WR(Transaction_Source_Type::MAPPING, 0, 0,
			NO_LPA, 0, NULL, 0, NULL, 0, 0);

		for (unsigned int stream_id = 0; stream_id < no_of_input_streams; stream_id++) {
			dummy_tr->Stream_id = stream_id;
			for (MVPN_type translation_page_id = 0; translation_page_id < domains[stream_id]->Total_translation_pages_no; translation_page_id++) {
				dummy_tr->LPA = (LPA_type)translation_page_id;
				allocate_plane_for_translation_write(dummy_tr);
				allocate_page_in_plane_for_translation_write(dummy_tr, (MVPN_type)dummy_tr->LPA, false);
				flash_controller->Change_flash_page_status_for_preconditioning(dummy_tr->Address, dummy_tr->LPA);
			}
		}
		mapping_table_stored_on_flash = true;
	}

// Assembly:
subq $0x68, %rsp
movq %rdi, 0x60(%rsp)
movq 0x60(%rsp), %rax
movq %rax, 0x38(%rsp)
testb $0x1, 0xa1(%rax)
je 0x4cad1
jmp 0x4cc2c
movl $0xb0, %edi
callq 0x8450
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x30(%rsp)
movq %rsp, %rax
movq $0x0, 0x20(%rax)
movq $0x0, 0x18(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x8(%rax)
movq $0x0, (%rax)
xorl %ecx, %ecx
movl %ecx, %r9d
movl $0x3, %esi
movq $-0x1, %r8
movl %ecx, %edx
callq 0x96320
jmp 0x4cb2a
movq 0x30(%rsp), %rax
movq %rax, 0x58(%rsp)
movl $0x0, 0x48(%rsp)
movq 0x38(%rsp), %rcx
movl 0x48(%rsp), %eax
cmpl 0x50(%rcx), %eax
jae 0x4cc20
movl 0x48(%rsp), %eax
movw %ax, %cx
movq 0x58(%rsp), %rax
movw %cx, (%rax)
movl $0x0, 0x44(%rsp)
movq 0x38(%rsp), %rcx
movl 0x44(%rsp), %eax
movq 0xa8(%rcx), %rcx
movl 0x48(%rsp), %edx
movq (%rcx,%rdx,8), %rcx
cmpl 0x268(%rcx), %eax
jae 0x4cc0e
movq 0x38(%rsp), %rdi
movl 0x44(%rsp), %eax
movl %eax, %ecx
movq 0x58(%rsp), %rax
movq %rcx, 0x58(%rax)
movq 0x58(%rsp), %rsi
callq 0x4cc40
movq 0x38(%rsp), %rdi
movq 0x58(%rsp), %rsi
movq 0x58(%rsp), %rax
movq 0x58(%rax), %rax
movl %eax, %edx
xorl %ecx, %ecx
callq 0x4cc70
movq 0x38(%rsp), %rax
movq 0x38(%rax), %rdi
movq 0x58(%rsp), %rsi
addq $0x38, %rsi
movq 0x58(%rsp), %rax
movq 0x58(%rax), %rdx
movq (%rdi), %rax
callq *0x60(%rax)
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x4cb65
movq 0x30(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x50(%rsp)
movl %eax, 0x4c(%rsp)
callq 0x8410
jmp 0x4cc31
jmp 0x4cc10
movl 0x48(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x48(%rsp)
jmp 0x4cb3c
movq 0x38(%rsp), %rax
movb $0x1, 0xa1(%rax)
addq $0x68, %rsp
retq
movq 0x50(%rsp), %rdi
callq 0x8770
nopl (%rax,%rax)