// File: jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::printTransaction(unsigned int, Transaction*, unsigned int)
void printTransaction(uint32_t index,Transaction *t,uint32_t address)
	{

		uint64_t totalInput=0;
		uint64_t totalOutput=0;
		uint64_t coinBase=0;

		for (uint32_t i=0; i<t->mOutputCount; i++)
		{
			TransactionOutput &o = t->mOutputs[i];
			totalOutput+=o.mValue;
		}
		for (uint32_t i=0; i<t->mInputCount; i++)
		{
			TransactionInput &input = t->mInputs[i];
			if ( input.mOutput )
			{
				TransactionOutput &o = *input.mOutput;
				totalInput+=o.mValue;
			}
		}

		printf("    Transaction #%s From Block: %s has %s inputs and %s outputs time: %s.\r\n", formatNumber(index), formatNumber(t->mBlock), formatNumber(t->mInputCount), formatNumber(t->mOutputCount), getTimeString(t->mTime) );

		printf("    Total Input: %0.4f Total Output: %0.4f : Fees: %0.4f\r\n", 
			(float)totalInput / ONE_BTC, 
			(float) totalOutput / ONE_BTC, 
			(float)((totalOutput-totalInput)-coinBase) / ONE_BTC );

		for (uint32_t i=0; i<t->mInputCount; i++)
		{
			TransactionInput &input = t->mInputs[i];
			if ( input.mOutput )
			{
				TransactionOutput &o = *input.mOutput;
				if ( o.mAddress == address )
				{
					printf("        [Input] "); 
				}
				else
				{
					printf("         Input  "); 
				}
				printf("%d : %s[%d] : Value %0.4f\r\n", i, getKey(o.mAddress),o.mAddress, (float)o.mValue / ONE_BTC );
			}
			else
			{
				printf("        [Input] %d : COINBASE\r\n", i );
			}
		}

		for (uint32_t i=0; i<t->mOutputCount; i++)
		{
			TransactionOutput &o = t->mOutputs[i];
			if ( o.mAddress == address )
			{
				printf("        [Output] ");
			}
			else
			{
				printf("         Output  ");
			}
			printf("%d : %s[%d] : Value %0.4f\r\n", i, getKey(o.mAddress),o.mAddress, (float)o.mValue / ONE_BTC );
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x1f0bf
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x3c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq (%rax), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x1f083
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x1f119
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x4c(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
cmpq $0x0, (%rax)
je 0x1f10c
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq (%rax), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x1f10e
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x1f0c6
movl -0xc(%rbp), %edi
callq 0x19c20
movq %rax, -0xc0(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x19c20
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x19c20
movq %rax, -0xb0(%rbp)
movq -0x18(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x19c20
movq %rax, -0xa8(%rbp)
movq -0x18(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x19db0
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movq -0xb0(%rbp), %rcx
movq -0xa8(%rbp), %r8
movq %rax, %r9
leaq 0x12886(%rip), %rdi     # 0x31a18
xorl %eax, %eax
callq 0x2050
movq -0x28(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x98(%rbp)
testq %rax, %rax
movss %xmm0, -0x94(%rbp)
js 0x1f1e5
movss -0x98(%rbp), %xmm0
movss %xmm0, -0x94(%rbp)
movss -0x94(%rbp), %xmm0
movss 0x11a3b(%rip), %xmm1    # 0x30c30
movss %xmm1, -0xdc(%rbp)
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0xd8(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0xc8(%rbp)
testq %rax, %rax
movss %xmm0, -0xc4(%rbp)
js 0x1f259
movss -0xc8(%rbp), %xmm0
movss %xmm0, -0xc4(%rbp)
movq -0xa0(%rbp), %rcx
movq -0xd0(%rbp), %rax
movss -0xdc(%rbp), %xmm1
movss -0xc4(%rbp), %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0xf0(%rbp)
subq %rcx, %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0xe4(%rbp)
testq %rax, %rax
movss %xmm0, -0xe0(%rbp)
js 0x1f2d2
movss -0xe4(%rbp), %xmm0
movss %xmm0, -0xe0(%rbp)
movsd -0xf0(%rbp), %xmm1
movsd -0xd8(%rbp), %xmm0
movss -0xe0(%rbp), %xmm2
movss 0x1193e(%rip), %xmm3    # 0x30c30
divss %xmm3, %xmm2
cvtss2sd %xmm2, %xmm2
leaq 0x12763(%rip), %rdi     # 0x31a64
movb $0x3, %al
callq 0x2050
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jae 0x1f448
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x64(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpq $0x0, (%rax)
je 0x1f427
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x1f36a
leaq 0x1273e(%rip), %rdi     # 0x31a9f
movb $0x0, %al
callq 0x2050
jmp 0x1f378
leaq 0x1273f(%rip), %rdi     # 0x31ab0
movb $0x0, %al
callq 0x2050
movq -0x90(%rbp), %rdi
movl -0x64(%rbp), %eax
movl %eax, -0x10c(%rbp)
movq -0x78(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x1efc0
movq %rax, -0x108(%rbp)
movq -0x78(%rbp), %rax
movl 0x8(%rax), %ecx
movl %ecx, -0xfc(%rbp)
movq (%rax), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0xf8(%rbp)
testq %rax, %rax
movss %xmm0, -0xf4(%rbp)
js 0x1f3ec
movss -0xf8(%rbp), %xmm0
movss %xmm0, -0xf4(%rbp)
movl -0xfc(%rbp), %ecx
movq -0x108(%rbp), %rdx
movl -0x10c(%rbp), %esi
movss -0xf4(%rbp), %xmm0
movss 0x11821(%rip), %xmm1    # 0x30c30
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x126a3(%rip), %rdi     # 0x31ac1
movb $0x1, %al
callq 0x2050
jmp 0x1f438
movl -0x64(%rbp), %esi
leaq 0x126ac(%rip), %rdi     # 0x31add
movb $0x0, %al
callq 0x2050
jmp 0x1f43a
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0x1f30f
movl $0x0, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x1f566
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x7c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x1c(%rbp), %eax
jne 0x1f497
leaq 0x1266f(%rip), %rdi     # 0x31afd
movb $0x0, %al
callq 0x2050
jmp 0x1f4a5
leaq 0x12671(%rip), %rdi     # 0x31b0f
movb $0x0, %al
callq 0x2050
movq -0x90(%rbp), %rdi
movl -0x7c(%rbp), %eax
movl %eax, -0x124(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x1efc0
movq %rax, -0x120(%rbp)
movq -0x88(%rbp), %rax
movl 0x8(%rax), %ecx
movl %ecx, -0x118(%rbp)
movq (%rax), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x114(%rbp)
testq %rax, %rax
movss %xmm0, -0x110(%rbp)
js 0x1f51f
movss -0x114(%rbp), %xmm0
movss %xmm0, -0x110(%rbp)
movl -0x118(%rbp), %ecx
movq -0x120(%rbp), %rdx
movl -0x124(%rbp), %esi
movss -0x110(%rbp), %xmm0
movss 0x116ee(%rip), %xmm1    # 0x30c30
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x12570(%rip), %rdi     # 0x31ac1
movb $0x1, %al
callq 0x2050
movl -0x7c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x7c(%rbp)
jmp 0x1f44f
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop