// File: 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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movq %rax, -0x18(%rbp)
subq $0x8, %rax
ja 0x19086
movq -0x18(%rbp), %rax
leaq 0x124c8(%rip), %rcx     # 0x2b488
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rdi
leaq 0x1255b(%rip), %rsi     # 0x2b52f
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x12550(%rip), %rsi     # 0x2b539
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x12547(%rip), %rsi     # 0x2b545
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x1253d(%rip), %rsi     # 0x2b550
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x12535(%rip), %rsi     # 0x2b55d
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x12529(%rip), %rsi     # 0x2b566
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x1251d(%rip), %rsi     # 0x2b56f
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x12511(%rip), %rsi     # 0x2b578
callq 0x31c0
jmp 0x19175
movq -0x8(%rbp), %rdi
leaq 0x1250c(%rip), %rsi     # 0x2b588
callq 0x31c0
jmp 0x19175
movq 0x1ef63(%rip), %rdi     # 0x37ff0
leaq 0x1107c(%rip), %rsi     # 0x2a110
callq 0x31c0
movq %rax, %rdi
leaq 0x12447(%rip), %rsi     # 0x2b4ea
callq 0x31c0
movq %rax, %rdi
leaq 0x11007(%rip), %rsi     # 0x2a0b9
callq 0x31c0
movq %rax, %rdi
movl $0x7f, %esi
callq 0x3380
movq %rax, %rdi
leaq 0x11053(%rip), %rsi     # 0x2a121
callq 0x31c0
movq %rax, %rdi
leaq 0x124ba(%rip), %rsi     # 0x2b597
callq 0x31c0
movq %rax, %rdi
movq 0x1eebc(%rip), %rsi     # 0x37fa8
callq 0x3200
movq 0x1eef8(%rip), %rdi     # 0x37ff0
leaq 0x11011(%rip), %rsi     # 0x2a110
callq 0x31c0
movq %rax, %rdi
leaq 0x123dc(%rip), %rsi     # 0x2b4ea
callq 0x31c0
movq %rax, %rdi
leaq 0x10f9c(%rip), %rsi     # 0x2a0b9
callq 0x31c0
movq %rax, %rdi
movl $0x80, %esi
callq 0x3380
movq %rax, %rdi
leaq 0x10fe8(%rip), %rsi     # 0x2a121
callq 0x31c0
movq %rax, %rdi
leaq 0x1247a(%rip), %rsi     # 0x2b5c2
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x4(%rax), %esi
callq 0x3380
movq %rax, %rdi
movq 0x1ee42(%rip), %rsi     # 0x37fa8
callq 0x3200
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3270
movq -0x8(%rbp), %rdi
leaq 0x1244a(%rip), %rsi     # 0x2b5ca
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x12431(%rip), %rsi     # 0x2b5cf
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x14(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x12418(%rip), %rsi     # 0x2b5d4
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x123ff(%rip), %rsi     # 0x2b5d9
callq 0x31c0
movq %rax, %rdi
leaq 0xa7(%rip), %rsi        # 0x19290
callq 0x30a0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x123d9(%rip), %rsi     # 0x2b5e0
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x9b(%rip), %rsi        # 0x192c0
callq 0x30a0
movq %rax, %rdi
leaq 0x123b3(%rip), %rsi     # 0x2b5e7
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x12fb1(%rip), %rsi     # 0x2c203
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movb (%rax), %cl
leaq 0x116de(%rip), %rsi     # 0x2a945
leaq 0x1237f(%rip), %rax     # 0x2b5ed
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x31c0
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop