LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/./agentpns.h
// Function: AgentPNS::Node::to_s[abi:cxx11]() const
string to_s() const {
			return "Node: move " + move.to_s() +
					", phi " + to_str(phi) +
					", delta " + to_str(delta) +
					", work " + to_str(work) +
//					", outcome " + to_str((int)outcome) + "/" + to_str((int)proofdepth) +
//					", best " + bestmove.to_s() +
					", children " + to_str(children.num());
		}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rsi, %r14
addq $0x14, %rsi
leaq 0x180(%rsp), %r15
movq %rdi, %rbx
xorl %edx, %edx
movq %r15, %rdi
callq 0x8178
leaq 0x6923(%rip), %rsi      # 0x1fc52
leaq 0x80(%rsp), %rdi
movq %r15, %rdx
callq 0x8423
leaq 0x71a0(%rip), %rdx      # 0x204e6
leaq 0xa0(%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0x6821
movl (%r14), %esi
leaq 0x60(%rsp), %rdi
callq 0x83cc
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
leaq 0x60(%rsp), %rdx
callq 0x8365
leaq 0x7164(%rip), %rdx      # 0x204ed
leaq 0xe0(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
callq 0x6821
movl 0x4(%r14), %esi
leaq 0x40(%rsp), %rdi
callq 0x83cc
leaq 0x100(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x8365
leaq 0x7129(%rip), %rdx      # 0x204f6
leaq 0x120(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x6821
movq 0x8(%r14), %rsi
leaq 0x20(%rsp), %rdi
callq 0xaf8f
leaq 0x140(%rsp), %rdi
leaq 0x120(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x8365
leaq 0x6871(%rip), %rdx      # 0x1fc82
leaq 0x160(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x6821
movq 0x18(%r14), %rax
xorl %esi, %esi
cmpq $0x2, %rax
jb 0x19436
movzwl 0x6(%rax), %esi
movq %rsp, %rdi
callq 0x83cc
leaq 0x160(%rsp), %rsi
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x8365
movq %rsp, %rdi
callq 0x4130
leaq 0x160(%rsp), %rdi
callq 0x4130
leaq 0x140(%rsp), %rdi
callq 0x4130
leaq 0x20(%rsp), %rdi
callq 0x4130
leaq 0x120(%rsp), %rdi
callq 0x4130
leaq 0x100(%rsp), %rdi
callq 0x4130
leaq 0x40(%rsp), %rdi
callq 0x4130
leaq 0xe0(%rsp), %rdi
callq 0x4130
leaq 0xc0(%rsp), %rdi
callq 0x4130
leaq 0x60(%rsp), %rdi
callq 0x4130
leaq 0xa0(%rsp), %rdi
callq 0x4130
leaq 0x80(%rsp), %rdi
callq 0x4130
leaq 0x180(%rsp), %rdi
callq 0x4130
movq %rbx, %rax
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbx
popq %r14
popq %r15
retq
movq %rsp, %rdi
movq %rax, %rbx
callq 0x4130
jmp 0x1950c
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0x4130
jmp 0x1951e
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x4130
jmp 0x19530
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4130
jmp 0x1953f
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0x4130
leaq 0x100(%rsp), %rdi
callq 0x4130
leaq 0x40(%rsp), %rdi
callq 0x4130
leaq 0xe0(%rsp), %rdi
callq 0x4130
leaq 0xc0(%rsp), %rdi
callq 0x4130
leaq 0x60(%rsp), %rdi
callq 0x4130
leaq 0xa0(%rsp), %rdi
callq 0x4130
leaq 0x80(%rsp), %rdi
callq 0x4130
leaq 0x180(%rsp), %rdi
callq 0x4130
movq %rbx, %rdi
callq 0x4590
movq %rax, %rbx
jmp 0x1954c
movq %rax, %rbx
jmp 0x19559
movq %rax, %rbx
jmp 0x19563
movq %rax, %rbx
jmp 0x19570
movq %rax, %rbx
jmp 0x1957d
movq %rax, %rbx
jmp 0x19587
movq %rax, %rbx
jmp 0x19594
movq %rax, %rbx
jmp 0x195a1
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/./agentpns.h
// Function: AgentPNS::~AgentPNS()
~AgentPNS(){
		stop_threads();

		numthreads = 0;
		reset_threads(); //shut down the theads properly

		root.dealloc(ctmem);
		ctmem.compact();
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x11538(%rip), %rax     # 0x2abc0
movq %rdi, %rbx
movq %rax, (%rdi)
callq 0x186a6
andl $0x0, 0xadc(%rbx)
movq %rbx, %rdi
callq 0x18700
leaq 0xae0(%rbx), %r15
leaq 0x50(%rbx), %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x1960a
vxorps %xmm0, %xmm0, %xmm0
vxorps %xmm1, %xmm1, %xmm1
movq %r14, %rdi
callq 0x18ce8
movq %r15, %rdi
callq 0xb06a
leaq 0xa70(%rbx), %rdi
callq 0xb0a2
leaq 0xa10(%rbx), %rdi
callq 0xb0a2
addq $0x9f8, %rbx            # imm = 0x9F8
movq %rbx, %rdi
callq 0xb248
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xb0d8
movq %rax, %rdi
callq 0x7611
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/./agentpns.h
// Function: AgentPNS::set_board(Board const&, bool)
void set_board(const Board & board, bool clear = true){
		rootboard = board;
		reset();
		if(clear)
			clear_mem();

		reset_threads(); //needed since the threads aren't started before a board it set
	}

// Assembly:
pushq %rbx
movq 0x20(%rsi), %rax
movq %rdi, %rbx
movq %rax, 0x30(%rdi)
vmovups (%rsi), %ymm0
vmovups %ymm0, 0x10(%rdi)
andl $0x0, 0x9e0(%rdi)
andq $0x0, 0x9e8(%rdi)
movb $0x0, 0x8(%rdi)
testl %edx, %edx
je 0x1976e
movq (%rbx), %rax
movq %rbx, %rdi
vzeroupper
callq *0x38(%rax)
movq %rbx, %rdi
popq %rbx
vzeroupper
jmp 0x18700
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/agentab.cpp
// Function: AgentAB::move_stats[abi:cxx11](std::vector<Move, std::allocator<Move>>) const
string AgentAB::move_stats(vector<Move> moves) const {
	string s = "";

	Board b = rootboard;
	for(vector<Move>::iterator m = moves.begin(); m != moves.end(); ++m)
		b.move(*m);

	for(MoveIterator move(b); !move.done(); ++move){
		s += "move: " + move->to_s() + ", ";
		if(const Node * n = tt_get(move.board())) {
			s += n->to_s() + "\n";
		} else {
			s += "unknown\n";
		}
	}
	return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
leaq 0x1b02(%rip), %rsi      # 0x1cab9
movq %rdx, %r15
movq %rsp, %rdx
movq %rdi, %rbx
callq 0x40f0
movq 0x30(%r14), %rax
leaq 0xb0(%rsp), %r12
movq %rax, 0x20(%r12)
vmovups 0x10(%r14), %ymm0
vmovups %ymm0, (%r12)
movq (%r15), %r13
cmpq 0x8(%r15), %r13
je 0x1b000
movl (%r13), %esi
movq %r12, %rdi
vzeroupper
callq 0x7ada
addq $0x4, %r13
jmp 0x1afe5
movq %rsp, %rdi
leaq 0xb0(%rsp), %rsi
pushq $-0x1
popq %rdx
vzeroupper
callq 0xac78
leaq 0x90(%rsp), %r13
leaq 0x50(%rsp), %r15
leaq 0x70(%rsp), %rbp
movq %rsp, %r12
cmpb $0x24, 0x30(%rsp)
jge 0x1b0f7
leaq 0x30(%rsp), %rsi
movq %r13, %rdi
xorl %edx, %edx
callq 0x8178
leaq 0x59ab(%rip), %rsi      # 0x209f7
movq %r15, %rdi
movq %r13, %rdx
callq 0x8423
leaq 0x590e(%rip), %rdx      # 0x2096c
movq %rbp, %rdi
movq %r15, %rsi
callq 0x6821
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4610
movq %rbp, %rdi
callq 0x4130
movq %r15, %rdi
callq 0x4130
movq %r13, %rdi
callq 0x4130
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1af68
testq %rax, %rax
je 0x1b0db
movq %r15, %rdi
movq %rax, %rsi
pushq $0x8
popq %rdx
callq 0x1b40a
leaq 0x1a05(%rip), %rdx      # 0x1cab8
movq %rbp, %rdi
movq %r15, %rsi
callq 0x6821
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x4610
movq %rbp, %rdi
callq 0x4130
movq %r15, %rdi
callq 0x4130
jmp 0x1b0ea
leaq 0x591c(%rip), %rsi      # 0x209fe
movq %rbx, %rdi
callq 0x45e0
movq %r12, %rdi
callq 0xad32
jmp 0x1b02b
leaq 0x38(%rsp), %rdi
callq 0xb368
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1b167
leaq 0x70(%rsp), %rdi
movq %rax, %r14
callq 0x4130
jmp 0x1b12c
jmp 0x1b16c
movq %rax, %r14
leaq 0x50(%rsp), %rdi
jmp 0x1b15c
movq %rax, %r14
jmp 0x1b154
movq %rax, %r14
jmp 0x1b14a
leaq 0x70(%rsp), %rdi
movq %rax, %r14
callq 0x4130
leaq 0x50(%rsp), %rdi
callq 0x4130
leaq 0x90(%rsp), %rdi
callq 0x4130
jmp 0x1b16f
jmp 0x1b16c
jmp 0x1b16c
movq %rax, %r14
jmp 0x1b179
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0xb368
movq %rbx, %rdi
callq 0x4130
movq %r14, %rdi
callq 0x4590
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/agentab.cpp
// Function: AgentAB::return_move(Board const&, int) const
Move AgentAB::return_move(const Board & board, int verbose) const {
	if(const Node * n = tt_get(board))
		return n->bestmove;

	int score = SCORE_LOSS;
	Move best = M_RESIGN;
	for(MoveIterator move(board); !move.done(); ++move){
		if(const Node * n = tt_get(move.board())) {
			if(score < n->score){
				score = n->score;
				best = *move;
			}
		} else if (score == SCORE_LOSS && best == M_RESIGN) {
			best = M_UNKNOWN;
		}
	}
	return best;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x1af68
testq %rax, %rax
je 0x1b1b5
movl 0xc(%rax), %ebp
movl %ebp, %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
jmp 0x1b234
leaq 0x8(%rsp), %r14
pushq $-0x1
popq %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0xac78
movl $0xffff8001, %r13d      # imm = 0xFFFF8001
movw $0x8efe, %bp            # imm = 0x8EFE
leaq 0x10(%rsp), %r15
movl $0x8efc, %r12d          # imm = 0x8EFC
cmpb $0x24, 0x38(%rsp)
jge 0x1b228
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1af68
testq %rax, %rax
je 0x1b207
movswl 0x8(%rax), %eax
cmpl %eax, %r13d
cmovlw 0x38(%rsp), %bp
cmovlel %eax, %r13d
jmp 0x1b21e
cmpl $0xffff8001, %r13d      # imm = 0xFFFF8001
jne 0x1b21e
cmpb $-0x2, %bpl
movl $0xffff8001, %r13d      # imm = 0xFFFF8001
cmovel %r12d, %ebp
movq %r14, %rdi
callq 0xad32
jmp 0x1b1dd
leaq 0x40(%rsp), %rdi
callq 0xb368
xorl %ecx, %ecx
movzwl %bp, %eax
orl %ecx, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1b24a
leaq 0x40(%rsp), %rdi
movq %rax, %rbx
callq 0xb368
movq %rbx, %rdi
callq 0x4590
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/agentab.cpp
// Function: AgentAB::get_pv() const
vector<Move> AgentAB::get_pv() const {
	vector<Move> pv;

	Board b = rootboard;
	int i = 20;
	while (i--) {
		Move m = return_move(b);
		if(m == M_UNKNOWN || m == M_RESIGN)
			break;
		pv.push_back(m);
		bool move_success = b.move(m);
		assert(move_success);
	}

	if(pv.size() == 0)
		pv.push_back(Move(M_RESIGN));

	return pv;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
vxorps %xmm0, %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
leaq 0x10(%rsp), %r15
movq %rsi, %r14
movq %rdi, %rbx
vmovups %xmm0, (%rdi)
movq 0x30(%rsi), %rax
movq %rax, 0x20(%r15)
vmovups 0x10(%rsi), %ymm0
vmovups %ymm0, (%r15)
pushq $-0x14
popq %rbp
leaq 0xc(%rsp), %r12
testl %ebp, %ebp
je 0x1b2e0
movq %r14, %rdi
movq %r15, %rsi
vzeroupper
callq 0x1b18a
movw %ax, 0xc(%rsp)
andl $0xfd, %eax
cmpl $0xfc, %eax
je 0x1b2e0
movq %rbx, %rdi
movq %r12, %rsi
callq 0xb4c4
movl 0xc(%rsp), %esi
movq %r15, %rdi
callq 0x7ada
testb %al, %al
je 0x1b311
incl %ebp
jmp 0x1b29e
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
jne 0x1b2fe
leaq 0xc(%rsp), %rsi
movw $0x8efe, (%rsi)         # imm = 0x8EFE
movq %rbx, %rdi
vzeroupper
callq 0x16aca
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
vzeroupper
retq
leaq 0x1f3c(%rip), %rdi      # 0x1d254
leaq 0x568d(%rip), %rsi      # 0x209ac
leaq 0x56e1(%rip), %rcx      # 0x20a07
movl $0xb2, %edx
callq 0x41c0
jmp 0x1b334
jmp 0x1b334
movq %rbx, %rdi
movq %rax, %r14
callq 0x8958
movq %r14, %rdi
callq 0x4590
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/agentab.cpp
// Function: AgentAB::tt(unsigned long) const
uint64_t mix_bits(uint64_t h){
	h ^= (h >> 17);
	h ^= (h << 31);
	h ^= (h >>  8);
	return h;
}

// Assembly:
movq %rsi, %rax
shrq $0x11, %rax
xorl %edx, %edx
xorq %rsi, %rax
movq %rax, %rcx
shlq $0x1f, %rcx
xorq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
xorq %rcx, %rax
divq 0x40(%rdi)
imulq $0x18, %rdx, %rax
addq 0x38(%rdi), %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/./agentab.h
// Function: AgentAB::clear_mem()
void clear_mem(){
		reset();
		if(TT){
			delete[] TT;
			TT = NULL;
		}
	}

// Assembly:
pushq %rbx
movb $0x0, 0x8(%rdi)
vxorps %xmm0, %xmm0, %xmm0
movq %rdi, %rbx
andl $0x0, 0x50(%rdi)
vmovups %xmm0, 0x58(%rdi)
movq 0x38(%rdi), %rdi
testq %rdi, %rdi
je 0x1b7c4
callq 0x43d0
andq $0x0, 0x38(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/tewalds[P]pentagod/./xorshift.h
// Function: XORShift_uint32::rand()
uint32_t rand(){
		r ^= (r << 13);
		r ^= (r >> 17);
		r ^= (r <<  5);
		return r;
	}

// Assembly:
movl (%rdi), %eax
movl %eax, %ecx
shll $0xd, %ecx
xorl %eax, %ecx
movl %ecx, %edx
shrl $0x11, %edx
xorl %ecx, %edx
movl %edx, %eax
shll $0x5, %eax
xorl %edx, %eax
movl %eax, (%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/main.cpp
// Function: command_line_args(char**, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
void command_line_args(char* argv[], string& input_file_path, string& workload_file_path)
{

	for (int arg_cntr = 1; arg_cntr < 5; arg_cntr++) {
		string arg = argv[arg_cntr];

		char file_path_switch[] = "-i";
		if (arg.compare(0, strlen(file_path_switch), file_path_switch) == 0) {
			input_file_path.assign(argv[++arg_cntr]);
			//cout << input_file_path << endl;
			continue;
		}

		char workload_path_switch[] = "-w";
		if (arg.compare(0, strlen(workload_path_switch), workload_path_switch) == 0) {
			workload_file_path.assign(argv[++arg_cntr]);
			//cout << workload_file_path << endl;
			continue;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq %rdi, %r15
pushq $0x1
popq %rbx
leaq 0x18(%rsp), %r12
leaq 0x4(%rsp), %r13
movq %rsp, %rbp
cmpl $0x5, %ebx
jge 0x8332
movslq %ebx, %r14
movq (%r15,%r14,8), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x7150
movb $0x0, 0x6(%rsp)
movw $0x692d, 0x4(%rsp)      # imm = 0x692D
movq %r13, %rdi
callq 0x7170
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rdx
movq %r13, %rcx
callq 0x7460
testl %eax, %eax
je 0x8312
movb $0x0, 0x2(%rsp)
movw $0x772d, (%rsp)         # imm = 0x772D
movq %rbp, %rdi
callq 0x7170
movq %r12, %rdi
xorl %esi, %esi
movq %rax, %rdx
movq %rbp, %rcx
callq 0x7460
testl %eax, %eax
jne 0x8323
movq 0x8(%r15,%r14,8), %rsi
movq 0x8(%rsp), %rdi
callq 0x7640
jmp 0x8321
movq 0x8(%r15,%r14,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x7640
incl %ebx
movq %r12, %rdi
callq 0x7678
incl %ebx
jmp 0x8297
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8343
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x7678
movq %rbx, %rdi
callq 0x75d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/exec/Execution_Parameter_Set.cpp
// Function: Execution_Parameter_Set::XML_serialize(Utils::XmlWriter&)
void Execution_Parameter_Set::XML_serialize(Utils::XmlWriter& xmlwriter)
{
	std::string tmp;
	tmp = "Execution_Parameter_Set";
	xmlwriter.Write_open_tag(tmp);

	Host_Configuration.XML_serialize(xmlwriter);
	SSD_Device_Configuration.XML_serialize(xmlwriter);

	xmlwriter.Write_close_tag();
}

// Assembly:
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x343ef(%rip), %rsi     # 0x4313b
movq %rsp, %rdi
callq 0x7640
leaq 0x20(%rsp), %rdi
movq %rsp, %rsi
callq 0x7480
leaq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x419e0
leaq 0x20(%rsp), %rdi
callq 0x7678
leaq 0x53669(%rip), %rdi     # 0x623e8
movq %rbx, %rsi
callq 0x10414
leaq 0x53662(%rip), %rdi     # 0x623f0
movq %rbx, %rsi
callq 0xb5b0
movq %rbx, %rdi
callq 0x41c5c
movq %rsp, %rdi
callq 0x7678
addq $0x40, %rsp
popq %rbx
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x7678
jmp 0xedbe
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7678
movq %rbx, %rdi
callq 0x75d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/exec/Host_System.cpp
// Function: Host_System::~Host_System()
Host_System::~Host_System() 
{
	delete this->Link;
	delete this->PCIe_root_complex;
	delete this->PCIe_switch;
	if (ssd_device->Host_interface->GetType() == HostInterface_Types::SATA) {
		delete this->SATA_hba;
	}
	for (uint16_t flow_id = 0; flow_id < this->IO_flows.size(); flow_id++) {
		delete this->IO_flows[flow_id];
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4f2d0(%rip), %rax     # 0x60968
movq %rax, (%rdi)
leaq 0x4f2fe(%rip), %rax     # 0x609a0
movq %rax, 0x30(%rdi)
movq 0x40(%rdi), %r14
testq %r14, %r14
je 0x116b7
movq %r14, %rdi
callq 0x11ca0
movq %r14, %rdi
callq 0x7340
movq 0x38(%rbx), %rdi
callq 0x7340
movq 0x48(%rbx), %rdi
callq 0x7340
movq 0x70(%rbx), %rax
movq 0x40(%rax), %rax
cmpl $0x0, 0x38(%rax)
jne 0x116f8
movq 0x50(%rbx), %r14
testq %r14, %r14
je 0x116f0
movq %r14, %rdi
callq 0x1d14e
movq %r14, %rdi
callq 0x7340
leaq 0x58(%rbx), %r14
xorl %r12d, %r12d
movzwl %r12w, %r12d
movq 0x58(%rbx), %rax
movq 0x60(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0x11735
movq (%rax,%r12,8), %r15
testq %r15, %r15
je 0x11728
movq %r15, %rdi
callq 0x1785a
movq %r15, %rdi
callq 0x7340
incl %r12d
jmp 0x116ff
movq %r14, %rdi
callq 0xb5a0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x11c8c
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/exec/Host_System.cpp
// Function: Host_System::Start_simulation()
void Host_System::Start_simulation()
{
	switch (ssd_device->Host_interface->GetType()) {
		case HostInterface_Types::NVME:
			for (uint16_t flow_cntr = 0; flow_cntr < IO_flows.size(); flow_cntr++) {
				((SSD_Components::Host_Interface_NVMe*) ssd_device->Host_interface)->Create_new_stream(
					IO_flows[flow_cntr]->Priority_class(),
					IO_flows[flow_cntr]->Get_start_lsa_on_device(), IO_flows[flow_cntr]->Get_end_lsa_address_on_device(),
					IO_flows[flow_cntr]->Get_nvme_queue_pair_info()->Submission_queue_memory_base_address, IO_flows[flow_cntr]->Get_nvme_queue_pair_info()->Completion_queue_memory_base_address);
			}
			break;
		case HostInterface_Types::SATA:
			((SSD_Components::Host_Interface_SATA*) ssd_device->Host_interface)->Set_ncq_address(
				SATA_hba->Get_sata_ncq_info()->Submission_queue_memory_base_address, SATA_hba->Get_sata_ncq_info()->Completion_queue_memory_base_address);
		default:
			break;
	}

	if (preconditioning_required) {
		std::vector<Utils::Workload_Statistics*> workload_stats = get_workloads_statistics();
		ssd_device->Perform_preconditioning(workload_stats);
		for (auto &stat : workload_stats) {
			delete stat;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %rbx
movq 0x70(%rdi), %rax
movq 0x40(%rax), %r14
movl 0x38(%r14), %eax
testl %eax, %eax
je 0x11858
cmpl $0x1, %eax
jne 0x1187d
xorl %r14d, %r14d
movzwl %r14w, %r14d
movq 0x58(%rbx), %rax
movq 0x60(%rbx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x1187d
movq 0x70(%rbx), %rcx
movq 0x40(%rcx), %rcx
movq %rcx, 0x10(%rsp)
leal (,%r14,8), %ebp
movq (%rax,%rbp), %rdi
movl 0x78(%rdi), %eax
movl %eax, 0xc(%rsp)
callq 0x187dc
movq %rax, %r15
movq 0x58(%rbx), %rax
movq (%rax,%rbp), %rdi
callq 0x187e2
movq %rax, %r12
movq 0x58(%rbx), %rax
movq (%rax,%rbp), %rdi
callq 0x187d4
movq 0x10(%rax), %r13
movq 0x58(%rbx), %rax
movq (%rax,%rbp), %rdi
callq 0x187d4
movq 0x28(%rax), %r9
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
movq %r15, %rdx
movq %r12, %rcx
movq %r13, %r8
callq 0x35178
incl %r14d
jmp 0x117c3
movq 0x50(%rbx), %rdi
callq 0x1d75e
movq 0x10(%rax), %r15
movq 0x50(%rbx), %rdi
callq 0x1d75e
movq 0x28(%rax), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x36860
cmpb $0x1, 0x78(%rbx)
jne 0x118f2
leaq 0x18(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x11926
movq 0x70(%rbx), %rbx
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x11d1e
leaq 0x30(%rsp), %rsi
movq %rbx, %rdi
callq 0x169e6
leaq 0x30(%rsp), %rdi
callq 0x120f0
movq 0x18(%rsp), %r14
movq 0x20(%rsp), %r15
cmpq %r15, %r14
je 0x118e8
movq (%r14), %rbx
testq %rbx, %rbx
je 0x118da
movq %rbx, %rdi
callq 0x11d6c
movq %rbx, %rdi
callq 0x7340
addq $0x8, %r14
jmp 0x118c5
leaq 0x18(%rsp), %rdi
callq 0x120f0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x120f0
jmp 0x11913
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x120f0
movq %rbx, %rdi
callq 0x75d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/exec/Host_System.cpp
// Function: Host_System::get_workloads_statistics()
std::vector<Utils::Workload_Statistics*> Host_System::get_workloads_statistics()
{
	std::vector<Utils::Workload_Statistics*> stats;

	for (auto &workload : IO_flows) {
		Utils::Workload_Statistics* s = new Utils::Workload_Statistics;
		workload->Get_statistics(*s, ssd_device->Convert_host_logical_address_to_device_address, ssd_device->Find_NVM_subunit_access_bitmap);
		stats.push_back(s);
	}

	return stats;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x58(%rsi), %rbp
movq 0x60(%rsi), %r14
leaq 0x5426(%rip), %r15      # 0x16d74
movq %rsp, %r12
cmpq %r14, %rbp
je 0x11997
movl $0x1b0, %edi            # imm = 0x1B0
callq 0x7370
movq %rax, %r13
movq %rax, %rdi
callq 0x11dc2
movq %r13, (%rsp)
movq (%rbp), %rdi
movq (%rdi), %rax
movq %r13, %rsi
leaq 0x53dc(%rip), %rdx      # 0x16d5c
movq %r15, %rcx
callq *0x40(%rax)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x11e6c
addq $0x8, %rbp
jmp 0x11951
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x120f0
movq %r14, %rdi
callq 0x75d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/exec/SSD_Device.cpp
// Function: SSD_Device::~SSD_Device()
SSD_Device::~SSD_Device()
{
	for (unsigned int channel_cntr = 0; channel_cntr < Channel_count; channel_cntr++)
	{
		for (unsigned int chip_cntr = 0; chip_cntr < Chip_no_per_channel; chip_cntr++)
		{
			delete ((SSD_Components::ONFI_Channel_NVDDR2 *)this->Channels[channel_cntr])->Chips[chip_cntr];
		}
		delete this->Channels[channel_cntr];
	}

	delete this->PHY;
	delete ((SSD_Components::FTL *)this->Firmware)->TSU;
	delete ((SSD_Components::FTL *)this->Firmware)->BlockManager;
	delete ((SSD_Components::FTL *)this->Firmware)->Address_Mapping_Unit;
	delete ((SSD_Components::FTL *)this->Firmware)->GC_and_WL_Unit;
	delete this->Firmware;
	delete this->Cache_manager;
	delete this->Host_interface;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x4a227(%rip), %rax     # 0x60ae8
movq %rax, (%rdi)
leaq 0x4a255(%rip), %rax     # 0x60b20
movq %rax, 0x30(%rdi)
leaq 0x60(%rdi), %r14
xorl %r12d, %r12d
movl 0x78(%rbx), %eax
cmpq %rax, %r12
jae 0x1691d
xorl %r13d, %r13d
movl 0x7c(%rbx), %eax
movq 0x60(%rbx), %rcx
movq (%rcx,%r12,8), %rdi
cmpq %rax, %r13
jae 0x16913
movq 0x8(%rdi), %rax
movq (%rax,%r13,8), %r15
testq %r15, %r15
je 0x16906
movq %r15, %rdi
callq 0x1e3b6
movq %r15, %rdi
callq 0x7340
incq %r13
jmp 0x168e1
callq 0x7340
incq %r12
jmp 0x168d6
movq 0x58(%rbx), %r15
testq %r15, %r15
je 0x1692e
movq %r15, %rdi
callq 0x3740e
movq %r15, %rdi
callq 0x7340
movq 0x50(%rbx), %rax
movq 0x50(%rax), %rdi
testq %rdi, %rdi
je 0x1694d
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x50(%rbx), %rax
movq 0x40(%rax), %rdi
testq %rdi, %rdi
je 0x16960
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x50(%rbx), %rax
movq 0x38(%rax), %rdi
testq %rdi, %rdi
je 0x16973
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x50(%rbx), %rax
movq 0x48(%rax), %r15
testq %r15, %r15
je 0x16984
movq %r15, %rdi
callq 0x16e52
movq %r15, %rdi
callq 0x7340
movq 0x50(%rbx), %r15
testq %r15, %r15
je 0x1699d
movq %r15, %rdi
callq 0x11c8c
movq %r15, %rdi
callq 0x7340
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x169b4
movq (%rdi), %rax
callq *0x28(%rax)
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x169c3
movq (%rdi), %rax
callq *0x28(%rax)
movq %r14, %rdi
callq 0x16ec6
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x11c8c
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/exec/SSD_Device.cpp
// Function: SSD_Device::Perform_preconditioning(std::vector<Utils::Workload_Statistics*, std::allocator<Utils::Workload_Statistics*>>)
void SSD_Device::Perform_preconditioning(std::vector<Utils::Workload_Statistics *> workload_stats)
{
	if (Preconditioning_required)
	{
		time_t start_time = time(0);
		PRINT_MESSAGE("SSD Device preconditioning started .........");
		this->Firmware->Perform_precondition(workload_stats);
		this->Cache_manager->Do_warmup(workload_stats);
		time_t end_time = time(0);
		uint64_t duration = (uint64_t)difftime(end_time, start_time);
		PRINT_MESSAGE("Finished preconditioning. Duration of preconditioning: " << duration / 3600 << ":" << (duration % 3600) / 60 << ":" << ((duration % 3600) % 60));
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
cmpb $0x1, 0x38(%rdi)
jne 0x16b20
movq %rsi, %r14
movq %rdi, %r15
xorl %edi, %edi
callq 0x7320
movq %rax, %rbx
movq 0x4b564(%rip), %rdi     # 0x61f78
leaq 0x2ec42(%rip), %rsi     # 0x4565d
callq 0x7360
movq %rax, %rdi
callq 0x71a0
movq 0x50(%r15), %r13
leaq 0x18(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x11d1e
movq (%r13), %rax
movq %r13, %rdi
movq %r12, %rsi
callq *0x30(%rax)
leaq 0x18(%rsp), %rdi
callq 0x120f0
movq 0x48(%r15), %r15
movq %rsp, %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x11d1e
movq (%r15), %rax
movq %r15, %rdi
movq %r12, %rsi
callq *0x30(%rax)
movq %rsp, %rdi
callq 0x120f0
xorl %edi, %edi
callq 0x7320
movq %rax, %rdi
movq %rbx, %rsi
callq 0x71c0
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x2c5b1(%rip), %xmm0    # 0x43050
cvttsd2si %xmm0, %rbx
andq %rcx, %rbx
orq %rax, %rbx
movq 0x4b4c7(%rip), %rdi     # 0x61f78
leaq 0x2ebd2(%rip), %rsi     # 0x4568a
callq 0x7360
movq %rax, %rdi
movl $0xe10, %ecx            # imm = 0xE10
movq %rbx, %rax
xorl %edx, %edx
divq %rcx
movq %rdx, %rbx
movq %rax, %rsi
callq 0x7270
leaq 0x2daae(%rip), %r14     # 0x4458d
movq %rax, %rdi
movq %r14, %rsi
callq 0x7360
movq %rax, %rdi
movw $0x3c, %cx
movl %ebx, %eax
xorl %edx, %edx
divw %cx
movl %edx, %ebx
movzwl %ax, %esi
callq 0x7270
movq %rax, %rdi
movq %r14, %rsi
callq 0x7360
movzwl %bx, %esi
movq %rax, %rdi
callq 0x7270
movq %rax, %rdi
callq 0x71a0
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0x16b30
movq %rax, %rbx
movq %r12, %rdi
callq 0x120f0
movq %rbx, %rdi
callq 0x75d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Base.cpp
// Function: Host_Components::IO_Flow_Base::~IO_Flow_Base()
IO_Flow_Base::~IO_Flow_Base()
	{
		log_file.close();
		for(auto &req : waiting_requests) {
			if (req) {
				delete req;
			}
		}

		switch (SSD_device_type) {
			case HostInterface_Types::NVME:
				for (auto &req : nvme_software_request_queue) {
					if (req.second) {
						delete req.second;
					}
				}
				break;
			case HostInterface_Types::SATA:
				break;
			default:
				PRINT_ERROR("Unsupported host interface type in IO_Flow_Base!")
		}

	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x49304(%rip), %rax     # 0x60b70
movq %rax, (%rdi)
leaq 0x49352(%rip), %rax     # 0x60bc8
movq %rax, 0x30(%rdi)
leaq 0x258(%rdi), %r14
movq %r14, %rdi
callq 0x74a0
leaq 0x100(%rbx), %r15
movq %r15, %r12
movq (%r12), %r12
cmpq %r15, %r12
je 0x178ad
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x17893
callq 0x7340
jmp 0x17893
movl 0x54(%rbx), %eax
testl %eax, %eax
je 0x178da
cmpl $0x1, %eax
jne 0x1792d
leaq 0x128(%rbx), %r12
movq (%r12), %r12
testq %r12, %r12
je 0x178da
movq 0x10(%r12), %rdi
testq %rdi, %rdi
je 0x178c0
callq 0x7340
jmp 0x178c0
movq %r14, %rdi
callq 0x74e0
leaq 0x238(%rbx), %rdi
callq 0x7678
leaq 0x118(%rbx), %rdi
callq 0x19984
movq %r15, %rdi
callq 0x19a0a
leaq 0xe8(%rbx), %rdi
callq 0x19a76
leaq 0xb8(%rbx), %rdi
callq 0x19a2e
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x11c8c
movq 0x4a6bc(%rip), %rdi     # 0x61ff0
leaq 0x2cc4d(%rip), %rsi     # 0x44588
callq 0x7360
movq 0x4a6a9(%rip), %rdi     # 0x61ff0
leaq 0x2df48(%rip), %rsi     # 0x45896
callq 0x7360
movq %rax, %rdi
callq 0x71a0
movq 0x4a66e(%rip), %rdi     # 0x61fd0
callq 0x73d0
pushq $0x1
popq %rdi
callq 0x73e0
movq %rax, %r15
movq %r14, %rdi
callq 0x74e0
leaq 0x238(%rbx), %rdi
callq 0x7678
leaq 0x118(%rbx), %rdi
callq 0x19958
leaq 0x100(%rbx), %rdi
callq 0x1995e
leaq 0xe8(%rbx), %rdi
callq 0x19964
leaq 0xb8(%rbx), %rdi
callq 0x1996a
movq %rbx, %rdi
callq 0x11c8c
movq %r15, %rdi
callq 0x7420
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Base.cpp
// Function: Host_Components::IO_Flow_Base::Start_simulation()
void IO_Flow_Base::Start_simulation()
	{
		next_logging_milestone = logging_period;
		if (enabled_logging) {
			log_file.open(logging_file_path, std::ofstream::out);
		}
		log_file << "SimulationTime(us)\t" << "ReponseTime(us)\t" << "EndToEndDelay(us)"<< std::endl;
		STAT_sum_device_response_time_short_term = 0;
		STAT_serviced_request_count_short_term = 0;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x228(%rdi), %rax
movq %rax, 0x230(%rdi)
cmpb $0x1, 0x220(%rdi)
jne 0x179f7
leaq 0x258(%rbx), %rdi
leaq 0x238(%rbx), %rsi
pushq $0x10
popq %rdx
callq 0x7190
leaq 0x258(%rbx), %rdi
leaq 0x2dec2(%rip), %rsi     # 0x458c7
callq 0x7360
leaq 0x2deca(%rip), %rsi     # 0x458db
movq %rax, %rdi
callq 0x7360
leaq 0x2decc(%rip), %rsi     # 0x458ec
movq %rax, %rdi
callq 0x7360
movq %rax, %rdi
callq 0x71a0
andq $0x0, 0x458(%rbx)
andl $0x0, 0x468(%rbx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Base.cpp
// Function: Host_Components::IO_Flow_Base::NVMe_read_sqe(unsigned long)
Submission_Queue_Entry* IO_Flow_Base::NVMe_read_sqe(uint64_t address)
	{
		Submission_Queue_Entry* sqe = new Submission_Queue_Entry;
		Host_IO_Request* request = request_queue_in_memory[(uint16_t)((address - nvme_queue_pair.Submission_queue_memory_base_address) / sizeof(Submission_Queue_Entry))];
		
		if (request == NULL) {
			throw std::invalid_argument(this->ID() + ": Request to access a submission queue entry that does not exist.");
		}

		sqe->Command_Identifier = request->IO_queue_info;
		if (request->Type == Host_IO_Request_Type::READ) {
			sqe->Opcode = NVME_READ_OPCODE;
			sqe->Command_specific[0] = (uint32_t) request->Start_LBA;
			sqe->Command_specific[1] = (uint32_t)(request->Start_LBA >> 32);
			sqe->Command_specific[2] = ((uint32_t)((uint16_t)request->LBA_count)) & (uint32_t)(0x0000ffff);
			sqe->PRP_entry_1 = (DATA_MEMORY_REGION);//Dummy addresses, just to emulate data read/write access
			sqe->PRP_entry_2 = (DATA_MEMORY_REGION + 0x1000);//Dummy addresses
		} else {
			sqe->Opcode = NVME_WRITE_OPCODE;
			sqe->Command_specific[0] = (uint32_t)request->Start_LBA;
			sqe->Command_specific[1] = (uint32_t)(request->Start_LBA >> 32);
			sqe->Command_specific[2] = ((uint32_t)((uint16_t)request->LBA_count)) & (uint32_t)(0x0000ffff);
			sqe->PRP_entry_1 = (DATA_MEMORY_REGION);//Dummy addresses, just to emulate data read/write access
			sqe->PRP_entry_2 = (DATA_MEMORY_REGION + 0x1000);//Dummy addresses
		}

		return sqe;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x48
popq %r15
movq %r15, %rdi
callq 0x7370
movq %rax, %rcx
subq 0x90(%r14), %rbx
movq %rbx, %rax
xorl %edx, %edx
divq %r15
movzwl %ax, %eax
movq 0xe8(%r14), %rdx
movq (%rdx,%rax,8), %rax
testq %rax, %rax
je 0x1856f
movzwl 0x20(%rax), %edx
movw %dx, 0x2(%rcx)
xorl %edx, %edx
cmpl $0x1, 0x1c(%rax)
adcb $0x1, %dl
movzwl 0x18(%rax), %esi
movq 0x10(%rax), %rax
movb %dl, (%rcx)
movl %eax, 0x30(%rcx)
shrq $0x20, %rax
movl %eax, 0x34(%rcx)
movl %esi, 0x38(%rcx)
movabsq $0xff0000000000, %rax   # imm = 0xFF0000000000
movq %rax, 0x20(%rcx)
orq $0x1000, %rax           # imm = 0x1000
movq %rax, 0x28(%rcx)
movq %rcx, %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x71b0
movq %rax, %rbx
addq $0x8, %r14
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x7480
leaq 0x2d3d6(%rip), %rdx     # 0x45968
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x9b29
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x75b0
xorl %ebp, %ebp
movq 0x49a0e(%rip), %rsi     # 0x61fc8
movq 0x499e7(%rip), %rdx     # 0x61fa8
movq %rbx, %rdi
callq 0x7590
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x7678
jmp 0x185de
movq %rax, %r14
movb $0x1, %bpl
leaq 0x8(%rsp), %rdi
callq 0x7678
testb %bpl, %bpl
jne 0x185f2
jmp 0x185fa
movq %rax, %r14
movq %rbx, %rdi
callq 0x72a0
movq %r14, %rdi
callq 0x75d0
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::~IO_Flow_Synthetic()
IO_Flow_Synthetic::~IO_Flow_Synthetic()
	{
		delete random_request_type_generator;
		delete random_address_generator;
		delete random_hot_cold_generator;
		delete random_hot_address_generator;
		delete random_request_size_generator;
		delete random_time_interval_generator;
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x464a7(%rip), %rax     # 0x60c18
movq %rax, (%rdi)
leaq 0x464f5(%rip), %rax     # 0x60c70
movq %rax, 0x30(%rdi)
movq 0x480(%rdi), %rdi
callq 0x7340
movq 0x498(%rbx), %rdi
callq 0x7340
movq 0x4a8(%rbx), %rdi
callq 0x7340
movq 0x4b8(%rbx), %rdi
callq 0x7340
movq 0x4e8(%rbx), %rdi
callq 0x7340
movq 0x4f8(%rbx), %rdi
callq 0x7340
movq %rbx, %rdi
popq %rbx
jmp 0x1785a
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::NVMe_consume_io_request(Completion_Queue_Entry*)
void IO_Flow_Synthetic::NVMe_consume_io_request(Completion_Queue_Entry* io_request)
	{
		IO_Flow_Base::NVMe_consume_io_request(io_request);
		IO_Flow_Base::NVMe_update_and_submit_completion_queue_tail();
		if (generator_type == Utils::Request_Generator_Type::QUEUE_DEPTH) {
			Host_IO_Request* request = Generate_next_request();
			
			/* In the demand based execution mode, the Generate_next_request() function may return NULL
			* if 1) the simulation stop is met, or 2) the number of generated I/O requests reaches its threshold.*/
			if (request != NULL) {
				Submit_io_request(request);
			}
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x17ed4
movq %rbx, %rdi
callq 0x187a2
cmpl $0x1, 0x4f4(%rbx)
jne 0x1ab30
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testq %rax, %rax
je 0x1ab30
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x18602
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::SATA_consume_io_request(Host_Components::Host_IO_Request*)
void IO_Flow_Synthetic::SATA_consume_io_request(Host_IO_Request* io_request)
	{
		IO_Flow_Base::SATA_consume_io_request(io_request);
		if (generator_type == Utils::Request_Generator_Type::QUEUE_DEPTH) {
			Host_IO_Request* request = Generate_next_request();
			/* In the demand based execution mode, the Generate_next_request() function may return NULL
			* if 1) the simulation stop is met, or 2) the number of generated I/O requests reaches its threshold.*/
			if (request != NULL) {
				Submit_io_request(request);
			}
		}
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x17a42
cmpl $0x1, 0x4f4(%rbx)
jne 0x1ab5e
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testq %rax, %rax
je 0x1ab5e
movq %rbx, %rdi
movq %rax, %rsi
popq %rbx
jmp 0x18602
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::Start_simulation()
void IO_Flow_Synthetic::Start_simulation() 
	{
		IO_Flow_Base::Start_simulation();

		if (address_distribution == Utils::Address_Distribution_Type::STREAMING) {
			streaming_next_address = random_address_generator->Uniform_ulong(start_lsa_on_device, end_lsa_on_device);
			if (generate_aligned_addresses) {
				streaming_next_address -= streaming_next_address % alignment_value;
			}
		}

		if (generator_type == Utils::Request_Generator_Type::BANDWIDTH) {
			Simulator->Register_sim_event((sim_time_type)random_time_interval_generator->Exponential((double)Average_inter_arrival_time_nano_sec), this, 0, 0);
		} else {
			Simulator->Register_sim_event((sim_time_type)1, this, 0, 0);
		}
	}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x179c6
cmpl $0x1, 0x48c(%rbx)
jne 0x1abb1
movq 0x498(%rbx), %rdi
movq 0x68(%rbx), %rsi
movq 0x70(%rbx), %rdx
callq 0x41280
movq %rax, 0x4d0(%rbx)
cmpb $0x1, 0x514(%rbx)
jne 0x1abb1
movq %rax, %rcx
movl 0x518(%rbx), %esi
xorl %edx, %edx
divq %rsi
subq %rdx, %rcx
movq %rcx, 0x4d0(%rbx)
movl 0x4f4(%rbx), %ebp
callq 0x1f784
movq %rax, %r14
testl %ebp, %ebp
je 0x1abc8
pushq $0x1
popq %rsi
jmp 0x1ac16
movsd 0x508(%rbx), %xmm1
unpcklps 0x2abf9(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2ac01(%rip), %xmm1    # 0x457e0
movq 0x4f8(%rbx), %rdi
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x412e6
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x28445(%rip), %xmm0    # 0x43050
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %rbp
jmp 0x1fb00
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/IO_Flow_Synthetic.cpp
// Function: Host_Components::IO_Flow_Synthetic::Execute_simulator_event(MQSimEngine::Sim_Event*)
void IO_Flow_Synthetic::Execute_simulator_event(MQSimEngine::Sim_Event* event)
	{
		if (generator_type == Utils::Request_Generator_Type::BANDWIDTH) {
			Host_IO_Request* req = Generate_next_request();
			if (req != NULL) {
				Submit_io_request(req);
				Simulator->Register_sim_event(Simulator->Time() + (sim_time_type)random_time_interval_generator->Exponential((double)Average_inter_arrival_time_nano_sec), this, 0, 0);
			}
		} else {
			for (unsigned int i = 0; i < average_number_of_enqueued_requests; i++) {
				Submit_io_request(Generate_next_request());
			}
		}
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x4f4(%rdi)
je 0x1ac65
xorl %ebp, %ebp
cmpl 0x510(%rbx), %ebp
jae 0x1ad05
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18602
incl %ebp
jmp 0x1ac41
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x20(%rax)
testq %rax, %rax
je 0x1ad05
movq %rbx, %rdi
movq %rax, %rsi
callq 0x18602
callq 0x1f784
movq %rax, %r14
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %r15
movsd 0x508(%rbx), %xmm1
unpcklps 0x2ab27(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x2ab2f(%rip), %xmm1    # 0x457e0
movq 0x4f8(%rbx), %rdi
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
callq 0x412e6
cvttsd2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subsd 0x28373(%rip), %xmm0    # 0x43050
cvttsd2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
addq %r15, %rsi
movq %r14, %rdi
movq %rbx, %rdx
xorl %ecx, %ecx
xorl %r8d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1fb00
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/../utils/StringTools.h
// Function: Utils::Helper_Functions::Tokenize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, char, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
static void Tokenize(const std::string& str, char delimiter, std::vector<std::string>& output_tokens_list)
		{
			int size = (int) str.size();
			int start = 0, end = 0;
			while (end < size) {
				if (str[end] == delimiter && start <= end) {
					output_tokens_list.push_back(std::string(str.substr(start, end - start + 1)));
					start = end + 1;
				}
				end++;
			}
			if (str[end - 1] != delimiter) {
				output_tokens_list.push_back(std::string(str.substr(start, end - start)));
			}
		}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, (%rsp)
movq %rdi, %r14
movl 0x8(%rdi), %ebx
xorl %r13d, %r13d
testl %ebx, %ebx
cmovlel %r13d, %ebx
movl %esi, %ebp
movq %rbx, %r12
negq %r12
leaq 0x8(%rsp), %r15
movq (%r14), %rax
movslq %r13d, %rdx
incq %r13
leaq (%r12,%r13), %rcx
cmpq $0x1, %rcx
je 0x1bd1d
leaq -0x1(%r13), %rcx
cmpb %bpl, -0x1(%rax,%r13)
setne %sil
cmpq %rdx, %rcx
setl %cl
orb %sil, %cl
cmpb $0x1, %cl
je 0x1bccc
movl %r13d, %eax
subl %edx, %eax
movslq %eax, %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x7380
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x1bdc6
movq %r15, %rdi
callq 0x7678
jmp 0x1bcc6
cmpb %bpl, -0x1(%rax,%rbx)
je 0x1bd4f
subl %edx, %ebx
movslq %ebx, %rcx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x7380
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x1bdc6
leaq 0x8(%rsp), %rdi
callq 0x7678
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1bd60
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x7678
movq %rbx, %rdi
callq 0x75d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/PCIe_Link.cpp
// Function: Host_Components::PCIe_Link::Deliver(Host_Components::PCIe_Message*)
void PCIe_Link::Deliver(PCIe_Message* message)
	{
		switch (message->Destination) {
			case PCIe_Destination_Type::HOST://Message from SSD device to the host
				Message_buffer_toward_root_complex.push(message);
				if (Message_buffer_toward_root_complex.size() > 1) {//There are active transfers
					return;
				}
				Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(message), this, (void*)(intptr_t)PCIe_Destination_Type::HOST, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				break;
			case PCIe_Destination_Type::DEVICE://Message from Host to the SSD device
				Message_buffer_toward_ssd_device.push(message);
				if (Message_buffer_toward_ssd_device.size() > 1) {
					return;
				}
				Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(message), this, (void*)(intptr_t)PCIe_Destination_Type::DEVICE, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				break;
			default:
				break;
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsi, 0x8(%rsp)
movl (%rsi), %eax
cmpl $0x1, %eax
je 0x1c731
testl %eax, %eax
jne 0x1c78c
leaq 0xb0(%rbx), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1cb28
movq %r14, %rdi
callq 0x1cbc4
cmpq $0x1, %rax
ja 0x1c78c
callq 0x1f784
movq %rax, %r14
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %r15
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1c8b4
addq %rax, %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
jmp 0x1c784
leaq 0x60(%rbx), %r14
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
callq 0x1cb28
movq %r14, %rdi
callq 0x1cbc4
cmpq $0x1, %rax
ja 0x1c78c
callq 0x1f784
movq %rax, %r14
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %r15
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1c8b4
addq %rax, %r15
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
callq 0x1fb00
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/PCIe_Link.cpp
// Function: Host_Components::PCIe_Link::Execute_simulator_event(MQSimEngine::Sim_Event*)
void PCIe_Link::Execute_simulator_event(MQSimEngine::Sim_Event* event)
	{
		PCIe_Message* message = NULL;
		PCIe_Destination_Type destination = (PCIe_Destination_Type)(intptr_t)event->Parameters;
		switch (destination) {
			case PCIe_Destination_Type::HOST:
				message = Message_buffer_toward_root_complex.front();
				Message_buffer_toward_root_complex.pop();
				root_complex->Consume_pcie_message(message);
				if (Message_buffer_toward_root_complex.size() > 0) {//There are active transfers
					Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(Message_buffer_toward_root_complex.front()),
						this, (void*)(intptr_t)PCIe_Destination_Type::HOST, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				}
				break;
			case PCIe_Destination_Type::DEVICE:
				message = Message_buffer_toward_ssd_device.front();
				Message_buffer_toward_ssd_device.pop();
				pcie_switch->Deliver_to_device(message);
				if (Message_buffer_toward_ssd_device.size() > 0) {
					Simulator->Register_sim_event(Simulator->Time() + estimate_transfer_time(Message_buffer_toward_ssd_device.front()),
						this, (void*)(intptr_t)PCIe_Destination_Type::DEVICE, static_cast<int>(PCIe_Link_Event_Type::DELIVER));
				}
				break;
		}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x10(%rsi), %eax
cmpl $0x1, %eax
je 0x1c822
testl %eax, %eax
jne 0x1c891
leaq 0xb0(%rbx), %r14
movq 0xc0(%rbx), %rax
movq (%rax), %r15
movq %r14, %rdi
callq 0x1cd50
movq 0x30(%rbx), %rdi
movq %r15, %rsi
callq 0x1c91e
movq %r14, %rdi
callq 0x1cbc4
testq %rax, %rax
je 0x1c891
callq 0x1f784
movq %rax, %r14
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %r15
movq 0xc0(%rbx), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x1c8b4
addq %rax, %r15
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
jmp 0x1c884
leaq 0x60(%rbx), %r14
movq 0x70(%rbx), %rax
movq (%rax), %r15
movq %r14, %rdi
callq 0x1cd50
movq 0x38(%rbx), %rdi
movq %r15, %rsi
callq 0x1cf20
movq %r14, %rdi
callq 0x1cbc4
testq %rax, %rax
je 0x1c891
callq 0x1f784
movq %rax, %r14
callq 0x1f784
movq %rax, %rdi
callq 0x1fafc
movq %rax, %r15
movq 0x70(%rbx), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x1c8b4
addq %rax, %r15
pushq $0x1
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movq %rbx, %rdx
xorl %r8d, %r8d
popq %rbx
popq %r14
popq %r15
jmp 0x1fb00
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/PCIe_Link.h
// Function: Host_Components::PCIe_Link::estimate_transfer_time(Host_Components::PCIe_Message*)
sim_time_type estimate_transfer_time(PCIe_Message* message)
		{
			switch (message->Type) {
				case PCIe_Message_Type::READ_COMP:
				case PCIe_Message_Type::WRITE_REQ:
				{
					int total_transfered_bytes = (message->Payload_size / tlp_max_payload_size) * (tlp_max_payload_size + packet_overhead)
						+ (message->Payload_size % tlp_max_payload_size == 0 ? 0 : message->Payload_size % tlp_max_payload_size + packet_overhead);
					return (sim_time_type)(((double)((total_transfered_bytes / lane_count) + (total_transfered_bytes % lane_count == 0 ? 0 : 1))) / lane_bandwidth_GBPs);
				}
				case PCIe_Message_Type::READ_REQ:
					return (sim_time_type)((((packet_overhead + 4) / lane_count) + ((packet_overhead + 4) % lane_count == 0 ? 0 : 1)) / lane_bandwidth_GBPs);
			}
			
			return 0;
		}

// Assembly:
movl 0x4(%rsi), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jae 0x1c8dc
movl 0x10(%rsi), %eax
movl 0x50(%rdi), %esi
movl 0x5c(%rdi), %ecx
xorl %edx, %edx
divl %esi
addl %ecx, %esi
imull %esi, %eax
addl %edx, %ecx
testl %edx, %edx
cmovel %edx, %ecx
addl %eax, %ecx
jmp 0x1c8e6
testl %eax, %eax
jne 0x1c91b
movl 0x5c(%rdi), %ecx
addl $0x4, %ecx
movl %ecx, %eax
cltd
idivl 0x48(%rdi)
cmpl $0x1, %edx
sbbl $-0x1, %eax
cvtsi2sd %eax, %xmm0
divsd 0x40(%rdi), %xmm0
cvttsd2si %xmm0, %rcx
movq %rcx, %rdx
sarq $0x3f, %rdx
subsd 0x26741(%rip), %xmm0    # 0x43050
cvttsd2si %xmm0, %rax
andq %rdx, %rax
orq %rcx, %rax
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/CMU-SAFARI[P]MQSim/src/host/PCIe_Root_Complex.h
// Function: Host_Components::PCIe_Root_Complex::Consume_pcie_message(Host_Components::PCIe_Message*)
void Consume_pcie_message(PCIe_Message* messages)//Modern processors support DDIO, where all writes to memory are going through LLC
		{
			switch (messages->Type)
			{
			case PCIe_Message_Type::READ_REQ:
				Read_from_memory(messages->Address, (unsigned int)(intptr_t)messages->Payload);
				break;
			case PCIe_Message_Type::WRITE_REQ:
				Write_to_memory(messages->Address, messages->Payload);
				break;
			default:
				break;
			}
			delete messages;
		}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movl 0x4(%rsi), %eax
cmpl $0x1, %eax
je 0x1c93c
testl %eax, %eax
jne 0x1c949
movq 0x18(%rbx), %rsi
movl 0x8(%rbx), %edx
callq 0x1ce78
jmp 0x1c949
movq 0x8(%rbx), %rdx
movq 0x18(%rbx), %rsi
callq 0x1cdb0
movq %rbx, %rdi
popq %rbx
jmp 0x7340