// File: dramninjasUMD[P]BOBSim/Transaction.cpp
// Function: BOBSim::operator<<(std::ostream&, BOBSim::Transaction const&)
ostream& operator<<(ostream &out, const Transaction &t)
{
	if(t.transactionType == DATA_READ)
	{
		out <<"T"<<t.transactionID<<" [Read] [0x" << hex << setw(8)<<setfill('0')<<t.address << dec << "] port["<<t.portID<<"] core["<<t.coreID<<"] "<<((t.originatedFromLogicOp)?"[FromLogic]":"");
	}
	else if(t.transactionType == DATA_WRITE)
	{
		out <<"T"<<t.transactionID<<" [Write] [0x" << hex << setw(8)<<setfill('0')<<t.address << dec << "] port["<<t.portID<<"] core["<<t.coreID<<"] "<<((t.originatedFromLogicOp)?"[FromLogic]":"");
	}
	else if(t.transactionType == RETURN_DATA)
	{
		out << "T"<<t.transactionID<<" [Data] [0x" << hex << setw(8)<<setfill('0')<<t.address << dec << "] port["<<t.portID<<"] core["<<t.coreID<<"]";
	}
	else if(t.transactionType == LOGIC_OPERATION)
	{
		out << "T" << t.transactionID << " [LogicOp] [0x" << hex << setw(8) << setfill('0') << t.address << dec << "]";
	}
	else if(t.transactionType == LOGIC_RESPONSE)
	{
		out << "T" << t.transactionID << " [LogicResponse] [0x" << hex << setw(8) << setfill('0') << t.address << dec<<"]";
	}
	else
	{
		out << "T" << t.transactionID << " [?"<<t.transactionType<<"?] [0x" << hex << setw(8) << setfill('0') << t.address << dec<<"]";
		out << "unknown transaction type"<<endl;;
		exit(0);
	}

	return out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x295db
movq -0x8(%rbp), %rdi
leaq 0x2e26(%rip), %rsi      # 0x2c301
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2e0a(%rip), %rsi      # 0x2c303
callq 0x31c0
movq %rax, %rdi
leaq -0x10278(%rip), %rsi    # 0x19290
callq 0x30a0
movq %rax, -0x50(%rbp)
movl $0x8, %edi
callq 0x1e200
movq -0x50(%rbp), %rdi
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %esi
callq 0x3250
movq %rax, -0x48(%rbp)
movl $0x30, %edi
callq 0x1e220
movq -0x48(%rbp), %rdi
movb %al, -0x15(%rbp)
movzbl -0x15(%rbp), %esi
callq 0x3310
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
movq %rax, %rdi
leaq -0x102a2(%rip), %rsi    # 0x192c0
callq 0x30a0
movq %rax, %rdi
leaq 0x2d9e(%rip), %rsi      # 0x2c30f
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2d88(%rip), %rsi      # 0x2c317
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2c56(%rip), %rsi      # 0x2c203
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movb 0x30(%rax), %cl
leaq 0x1382(%rip), %rsi      # 0x2a945
leaq 0x2d55(%rip), %rax      # 0x2c31f
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x31c0
jmp 0x29a60
movq -0x10(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x296f3
movq -0x8(%rbp), %rdi
leaq 0x2d0e(%rip), %rsi      # 0x2c301
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2d1a(%rip), %rsi      # 0x2c32b
callq 0x31c0
movq %rax, %rdi
leaq -0x10390(%rip), %rsi    # 0x19290
callq 0x30a0
movq %rax, -0x60(%rbp)
movl $0x8, %edi
callq 0x1e200
movq -0x60(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %esi
callq 0x3250
movq %rax, -0x58(%rbp)
movl $0x30, %edi
callq 0x1e220
movq -0x58(%rbp), %rdi
movb %al, -0x1d(%rbp)
movzbl -0x1d(%rbp), %esi
callq 0x3310
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
movq %rax, %rdi
leaq -0x103ba(%rip), %rsi    # 0x192c0
callq 0x30a0
movq %rax, %rdi
leaq 0x2c86(%rip), %rsi      # 0x2c30f
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2c70(%rip), %rsi      # 0x2c317
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2b3e(%rip), %rsi      # 0x2c203
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movb 0x30(%rax), %cl
leaq 0x126a(%rip), %rsi      # 0x2a945
leaq 0x2c3d(%rip), %rax      # 0x2c31f
testb $0x1, %cl
cmovneq %rax, %rsi
callq 0x31c0
jmp 0x29a5e
movq -0x10(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x297e7
movq -0x8(%rbp), %rdi
leaq 0x2bf6(%rip), %rsi      # 0x2c301
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2c0f(%rip), %rsi      # 0x2c338
callq 0x31c0
movq %rax, %rdi
leaq -0x104a8(%rip), %rsi    # 0x19290
callq 0x30a0
movq %rax, -0x70(%rbp)
movl $0x8, %edi
callq 0x1e200
movq -0x70(%rbp), %rdi
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %esi
callq 0x3250
movq %rax, -0x68(%rbp)
movl $0x30, %edi
callq 0x1e220
movq -0x68(%rbp), %rdi
movb %al, -0x25(%rbp)
movzbl -0x25(%rbp), %esi
callq 0x3310
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
movq %rax, %rdi
leaq -0x104d2(%rip), %rsi    # 0x192c0
callq 0x30a0
movq %rax, %rdi
leaq 0x2b6e(%rip), %rsi      # 0x2c30f
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2b58(%rip), %rsi      # 0x2c317
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x1db8(%rip), %rsi      # 0x2b595
callq 0x31c0
jmp 0x29a5c
movq -0x10(%rbp), %rax
cmpl $0x3, (%rax)
jne 0x2989f
movq -0x8(%rbp), %rdi
leaq 0x2b02(%rip), %rsi      # 0x2c301
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2b27(%rip), %rsi      # 0x2c344
callq 0x31c0
movq %rax, %rdi
leaq -0x1059c(%rip), %rsi    # 0x19290
callq 0x30a0
movq %rax, -0x80(%rbp)
movl $0x8, %edi
callq 0x1e200
movq -0x80(%rbp), %rdi
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %esi
callq 0x3250
movq %rax, -0x78(%rbp)
movl $0x30, %edi
callq 0x1e220
movq -0x78(%rbp), %rdi
movb %al, -0x2d(%rbp)
movzbl -0x2d(%rbp), %esi
callq 0x3310
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
movq %rax, %rdi
leaq -0x105c6(%rip), %rsi    # 0x192c0
callq 0x30a0
movq %rax, %rdi
leaq 0x1d00(%rip), %rsi      # 0x2b595
callq 0x31c0
jmp 0x29a5a
movq -0x10(%rbp), %rax
cmpl $0x4, (%rax)
jne 0x29963
movq -0x8(%rbp), %rdi
leaq 0x2a4a(%rip), %rsi      # 0x2c301
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x2a7e(%rip), %rsi      # 0x2c353
callq 0x31c0
movq %rax, %rdi
leaq -0x10654(%rip), %rsi    # 0x19290
callq 0x30a0
movq %rax, -0x90(%rbp)
movl $0x8, %edi
callq 0x1e200
movq -0x90(%rbp), %rdi
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %esi
callq 0x3250
movq %rax, -0x88(%rbp)
movl $0x30, %edi
callq 0x1e220
movq -0x88(%rbp), %rdi
movb %al, -0x35(%rbp)
movzbl -0x35(%rbp), %esi
callq 0x3310
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
movq %rax, %rdi
leaq -0x1068a(%rip), %rsi    # 0x192c0
callq 0x30a0
movq %rax, %rdi
leaq 0x1c3c(%rip), %rsi      # 0x2b595
callq 0x31c0
jmp 0x29a58
movq -0x8(%rbp), %rdi
leaq 0x2993(%rip), %rsi      # 0x2c301
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl 0x18(%rax), %esi
callq 0x32d0
movq %rax, %rdi
leaq 0x29dc(%rip), %rsi      # 0x2c368
callq 0x31c0
movq %rax, %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
callq 0x3380
movq %rax, %rdi
leaq 0x29c3(%rip), %rsi      # 0x2c36c
callq 0x31c0
movq %rax, %rdi
leaq -0x10728(%rip), %rsi    # 0x19290
callq 0x30a0
movq %rax, -0xa0(%rbp)
movl $0x8, %edi
callq 0x1e200
movq -0xa0(%rbp), %rdi
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %esi
callq 0x3250
movq %rax, -0x98(%rbp)
movl $0x30, %edi
callq 0x1e220
movq -0x98(%rbp), %rdi
movb %al, -0x3d(%rbp)
movzbl -0x3d(%rbp), %esi
callq 0x3310
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x3070
movq %rax, %rdi
leaq -0x1075e(%rip), %rsi    # 0x192c0
callq 0x30a0
movq %rax, %rdi
leaq 0x1b68(%rip), %rsi      # 0x2b595
callq 0x31c0
movq -0x8(%rbp), %rdi
leaq 0x2936(%rip), %rsi      # 0x2c373
callq 0x31c0
movq %rax, %rdi
movq 0xe55c(%rip), %rsi      # 0x37fa8
callq 0x3200
xorl %edi, %edi
callq 0x3270
jmp 0x29a5a
jmp 0x29a5c
jmp 0x29a5e
jmp 0x29a60
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq