// File: /workspace/github_cpp_makefile_star2_O3/chinmayachaudhry[P]Branch-Predictor/btb.cpp
// Function: btb::display()
void btb :: display()
{
	cout << endl << "Final BTB Tag  Array Contents {valid, pc}:" << endl;
	for(int i = 0; i<sets; i++)
	{
		cout << "Set" << setfill(' ') << setw(6) << i << ":   ";
		for(int j = 0; j<(int)btb_assoc; j++)
		{
			if(cacheline[i][j].getValidity() == "Valid")
				cout << "{1, " << showbase << internal << setfill(' ') << hex << setw(10) << cacheline[i][j].getAddress() << "} " << dec;
			else
				cout << "{0, " << showbase << internal << setfill(' ') << hex << setw(10) << cacheline[i][j].getAddress() << "} " << dec;
		}
		cout << endl;	
	}
	cout << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movq 0x66a2(%rip), %rbx      # 0x9fd8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
movq %rax, %r15
leaq 0x3745(%rip), %rsi      # 0x70ac
movl $0x2a, %edx
movq %rax, %rdi
callq 0x2190
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
cmpq $0x0, 0x18(%r14)
jle 0x3bb6
xorl %r15d, %r15d
movq %r14, (%rsp)
movl $0x3, %edx
movq %rbx, %rdi
leaq 0x371b(%rip), %rsi      # 0x70d7
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rcx
leaq (%rbx,%rcx), %r12
cmpb $0x0, 0xe1(%rbx,%rcx)
jne 0x39ef
movq %r12, %rdi
movl $0x20, %esi
callq 0x2150
movb $0x1, 0xe1(%r12)
movq (%rbx), %rax
movb $0x20, 0xe0(%r12)
movq -0x18(%rax), %rax
movq $0x6, 0x10(%rbx,%rax)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2250
movl $0x4, %edx
movq %rax, %rdi
leaq 0x36bc(%rip), %rsi      # 0x70db
callq 0x2190
cmpl $0x0, 0x24(%r14)
jle 0x3b82
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r14), %rax
movq %r15, %r14
movq (%rax,%r15,8), %rax
leaq 0x18(%rsp), %r15
movq %r15, 0x8(%rsp)
movq 0x18(%rax,%r13), %rsi
movq 0x20(%rax,%r13), %rdx
addq %rsi, %rdx
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x3c56
movq %r12, %rdi
leaq 0x3632(%rip), %rsi      # 0x709e
callq 0x2070
movl %eax, %r12d
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3a8b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
movl $0x4, %edx
movq %rbx, %rdi
testl %r12d, %r12d
je 0x3aa1
leaq 0x3649(%rip), %rsi      # 0x70e8
jmp 0x3aa8
leaq 0x3638(%rip), %rsi      # 0x70e0
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rcx
orl $0x200, 0x18(%rbx,%rcx) # imm = 0x200
movq -0x18(%rax), %rcx
movl 0x18(%rbx,%rcx), %edx
movl $0xffffff4f, %esi       # imm = 0xFFFFFF4F
andl %esi, %edx
orl $0x10, %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rcx
leaq (%rbx,%rcx), %r12
cmpb $0x0, 0xe1(%rbx,%rcx)
movq %r14, %r15
jne 0x3b00
movq %r12, %rdi
movl $0x20, %esi
callq 0x2150
movb $0x1, 0xe1(%r12)
movq (%rbx), %rax
movb $0x20, 0xe0(%r12)
movq -0x18(%rax), %rcx
movl 0x18(%rbx,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rbx,%rcx)
movq -0x18(%rax), %rax
movq $0xa, 0x10(%rbx,%rax)
movq (%rsp), %r14
movq (%r14), %rax
movq (%rax,%r15,8), %rax
movq (%rax,%r13), %rsi
movq %rbx, %rdi
callq 0x2090
movq %rax, %r12
movl $0x2, %edx
movq %rax, %rdi
leaq 0x3594(%rip), %rsi      # 0x70e5
callq 0x2190
movq (%r12), %rax
movq -0x18(%rax), %rax
movl 0x18(%r12,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r12,%rax)
incq %rbp
movslq 0x24(%r14), %rax
addq $0x38, %r13
cmpq %rax, %rbp
jl 0x3a34
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
incq %r15
cmpq %r15, 0x18(%r14)
jg 0x39ad
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2150
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x20e0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq