// File: /workspace/github_cpp_makefile_star2_O1/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 0x669a(%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 0x373d(%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 0x3bce
xorl %r15d, %r15d
movq %r14, (%rsp)
movl $0x3, %edx
movq %rbx, %rdi
leaq 0x3713(%rip), %rsi      # 0x70d7
callq 0x2190
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %r12
cmpb $0x0, 0xe1(%rbx,%rax)
jne 0x39fc
movq %r12, %rdi
movl $0x20, %esi
callq 0x2150
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq (%rbx), %rax
movq -0x18(%rax), %rax
movq $0x6, 0x10(%rbx,%rax)
movq %rbx, %rdi
movl %r15d, %esi
callq 0x2250
movl $0x4, %edx
movq %rax, %rdi
leaq 0x36ac(%rip), %rsi      # 0x70db
callq 0x2190
cmpl $0x0, 0x24(%r14)
jle 0x3b9a
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 0x3c6e
movq %r12, %rdi
leaq 0x3622(%rip), %rsi      # 0x709e
callq 0x2070
movl %eax, %r12d
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x3a9b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
movl $0x4, %edx
movq %rbx, %rdi
testl %r12d, %r12d
je 0x3ab1
leaq 0x3639(%rip), %rsi      # 0x70e8
jmp 0x3ab8
leaq 0x3628(%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), %rax
leaq (%rbx,%rax), %r12
cmpb $0x0, 0xe1(%rbx,%rax)
movq %r14, %r15
jne 0x3b15
movq %r12, %rdi
movl $0x20, %esi
callq 0x2150
movb %al, 0xe0(%r12)
movb $0x1, 0xe1(%r12)
movb $0x20, 0xe0(%r12)
movq (%rbx), %rax
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 0x357c(%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 0x3a44
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 0x39b5
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