// File: /workspace/github_cpp_makefile_star2_O2/dramninjasUMD[P]BOBSim/BusPacket.cpp
// Function: BOBSim::operator<<(std::ostream&, BOBSim::BusPacket const&)
ostream& operator<<(ostream &out, const BusPacket &bp)
{

	switch(bp.busPacketType)
	{
	case READ:
		out<<"BP [READ]";
		break;
	case READ_P:
		out<<"BP [READ_P]";
		break;
	case WRITE:
		out<<"BP [WRITE]";
		break;
	case WRITE_P:
		out<<"BP [WRITE_P]";
		break;
	case ACTIVATE:
		out<<"BP [ACT]";
		break;
	case REFRESH:
		out<<"BP [REF]";
		break;
	case PRECHARGE:
		out<<"BP [PRE]";
		break;
	case WRITE_DATA:
		out<<"BP [WRITE_DATA]";
		break;
	case READ_DATA:
		out<<"BP [READ_DATA]";
		break;
	default:
		ERROR("Trying to print unknown kind of bus packet");
		ERROR("Type : "<<bp.busPacketType);
		exit(-1);
	}


	out << " id[" <<bp.transactionID<<"] r["<<bp.rank<<"] b["<<bp.bank<<"] row["<<hex<<bp.row<<"] col["<<bp.column<<dec<<"] bl["<<bp.burstLength<<"] "<<((bp.fromLogicOp)?"fromLogic":"");
	//reset format back to decimal
	return out;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl 0x4(%rsi), %eax
cmpq $0x9, %rax
jae 0x99ed
movq %rdi, %r14
leaq 0x67ff(%rip), %rcx      # 0x100dc
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
callq 0x2180
leaq 0x692e(%rip), %rsi      # 0x1021e
movq %r14, %rdi
callq 0x2180
movl 0x18(%rbx), %esi
movq %rax, %rdi
callq 0x2100
leaq 0x6919(%rip), %rsi      # 0x10223
movq %rax, %rdi
callq 0x2180
movl 0x14(%rbx), %esi
movq %rax, %rdi
callq 0x2100
leaq 0x6904(%rip), %rsi      # 0x10228
movq %rax, %rdi
callq 0x2180
movl 0x10(%rbx), %esi
movq %rax, %rdi
callq 0x2100
leaq 0x68ef(%rip), %rsi      # 0x1022d
movq %rax, %rdi
callq 0x2180
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x8, %edx
movl %edx, 0x18(%rax,%rcx)
movl 0xc(%rbx), %esi
movq %rax, %rdi
callq 0x2100
leaq 0x68c7(%rip), %rsi      # 0x10234
movq %rax, %rdi
callq 0x2180
movl 0x8(%rbx), %esi
movq %rax, %rdi
callq 0x2100
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
leaq 0x689f(%rip), %rsi      # 0x1023b
movq %rax, %rdi
callq 0x2180
movl 0x24(%rbx), %esi
movq %rax, %rdi
callq 0x2100
leaq 0x65c8(%rip), %rsi      # 0xff7e
movq %rax, %rdi
callq 0x2180
leaq 0x687c(%rip), %rcx      # 0x10241
leaq 0x5c1c(%rip), %rsi      # 0xf5e8
cmpb $0x0, (%rbx)
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x2180
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xc5fc(%rip), %r14      # 0x15ff0
leaq 0x5785(%rip), %r15      # 0xf180
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq 0x6731(%rip), %r12      # 0x1013e
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
leaq 0x570a(%rip), %r13      # 0xf129
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
pushq $0x7f
popq %rsi
movq %rax, %rdi
callq 0x22e0
leaq 0x5755(%rip), %rbp      # 0xf191
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2180
leaq 0x679d(%rip), %rsi      # 0x101eb
movq %rax, %rdi
callq 0x2180
movq %rax, %rdi
callq 0x20b0
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
movq %rax, %rdi
movq %r13, %rsi
callq 0x2180
movq %rax, %rdi
movl $0x80, %esi
callq 0x22e0
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2180
leaq 0x6778(%rip), %rsi      # 0x10216
movq %rax, %rdi
callq 0x2180
movl 0x4(%rbx), %esi
movq %rax, %rdi
callq 0x22e0
movq %rax, %rdi
callq 0x20b0
pushq $-0x1
popq %rdi
callq 0x21d0
nopl (%rax)