// File: gvaumour[P]cache-simulator/src/Predictor.cc
// Function: Predictor::printBParray(int, std::basic_ofstream<char, std::char_traits<char>>&)
void
Predictor::printBParray(int set , ofstream& out)
{
	for(unsigned i = 0 ; i < BP_missing_tags[set].size() ; i++)
	{
		if(BP_missing_tags[set][i]->isValid)
		{
			string alloc_site = BP_missing_tags[set][i]->allocSite ? "NVM" : "SRAM";
			out << "Index " << i << " - Addr = " << std::hex << BP_missing_tags[set][i]->addr \
			<< std::dec << " - Time = " << BP_missing_tags[set][i]->last_time_touched << " - Allocation = " << alloc_site << endl;		
		}
	}
	
}

// Assembly:
subq $0xc8, %rsp
movq %rdi, 0xc0(%rsp)
movl %esi, 0xbc(%rsp)
movq %rdx, 0xb0(%rsp)
movq 0xc0(%rsp), %rax
movq %rax, 0x68(%rsp)
movl $0x0, 0xac(%rsp)
movq 0x68(%rsp), %rdi
movl 0xac(%rsp), %eax
movq %rax, 0x60(%rsp)
addq $0x140, %rdi            # imm = 0x140
movslq 0xbc(%rsp), %rsi
callq 0x58920
movq %rax, %rdi
callq 0x58940
movq %rax, %rcx
movq 0x60(%rsp), %rax
cmpq %rcx, %rax
jae 0x57386
movq 0x68(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
movslq 0xbc(%rsp), %rsi
callq 0x58920
movq %rax, %rdi
movl 0xac(%rsp), %eax
movl %eax, %esi
callq 0x58860
movq (%rax), %rax
testb $0x1, 0x14(%rax)
je 0x5736e
movq 0x68(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
movslq 0xbc(%rsp), %rsi
callq 0x58920
movq %rax, %rdi
movl 0xac(%rsp), %eax
movl %eax, %esi
callq 0x58860
movq (%rax), %rax
movb 0x16(%rax), %dl
leaq 0x1a6a1(%rip), %rcx     # 0x71823
leaq 0x1a6a3(%rip), %rax     # 0x7182c
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, 0x50(%rsp)
leaq 0x87(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x56a0
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
leaq 0x88(%rsp), %rdi
callq 0x5530
jmp 0x571c0
leaq 0x87(%rsp), %rdi
callq 0x53e0
movq 0xb0(%rsp), %rdi
leaq 0x1c631(%rip), %rsi     # 0x7380d
callq 0x5380
movq %rax, 0x48(%rsp)
jmp 0x571e8
movq 0x48(%rsp), %rdi
movl 0xac(%rsp), %esi
callq 0x5510
movq %rax, 0x40(%rsp)
jmp 0x57200
movq 0x40(%rsp), %rdi
leaq 0x1c608(%rip), %rsi     # 0x73814
callq 0x5380
movq %rax, 0x38(%rsp)
jmp 0x57218
movq 0x38(%rsp), %rdi
leaq -0x47a24(%rip), %rsi    # 0xf800
callq 0x5160
movq %rax, 0x30(%rsp)
jmp 0x57230
movq 0x68(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
movslq 0xbc(%rsp), %rsi
callq 0x58920
movq %rax, %rdi
movl 0xac(%rsp), %eax
movl %eax, %esi
callq 0x58860
movq 0x30(%rsp), %rdi
movq (%rax), %rax
movq (%rax), %rsi
callq 0x50f0
movq %rax, 0x28(%rsp)
jmp 0x57271
movq 0x28(%rsp), %rdi
leaq -0x47a5d(%rip), %rsi    # 0xf820
callq 0x5160
movq %rax, 0x20(%rsp)
jmp 0x57289
movq 0x20(%rsp), %rdi
leaq 0x1c58a(%rip), %rsi     # 0x7381f
callq 0x5380
movq %rax, 0x18(%rsp)
jmp 0x572a1
movq 0x68(%rsp), %rdi
addq $0x140, %rdi            # imm = 0x140
movslq 0xbc(%rsp), %rsi
callq 0x58920
movq %rax, %rdi
movl 0xac(%rsp), %eax
movl %eax, %esi
callq 0x58860
movq 0x18(%rsp), %rdi
movq (%rax), %rax
movq 0x8(%rax), %rsi
callq 0x50f0
movq %rax, 0x10(%rsp)
jmp 0x572e3
movq 0x10(%rsp), %rdi
leaq 0x1c53b(%rip), %rsi     # 0x7382a
callq 0x5380
movq %rax, 0x8(%rsp)
jmp 0x572fb
movq 0x8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x5330
movq %rax, (%rsp)
jmp 0x57313
movq (%rsp), %rdi
movq 0x3bc9a(%rip), %rsi     # 0x92fb8
callq 0x53d0
jmp 0x57325
leaq 0x88(%rsp), %rdi
callq 0x5768
jmp 0x5736e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x87(%rsp), %rdi
callq 0x53e0
jmp 0x5738e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x78(%rsp)
movl %eax, 0x74(%rsp)
leaq 0x88(%rsp), %rdi
callq 0x5768
jmp 0x5738e
jmp 0x57370
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x570d6
addq $0xc8, %rsp
retq
movq 0x78(%rsp), %rdi
callq 0x5690
nopl (%rax,%rax)