// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, -0x2c(%rbp)
movq %rdx, %r14
movq %rdi, -0x38(%rbp)
movl 0xc(%rdx), %eax
testq %rax, %rax
je 0xe103
movq 0x18(%r14), %rcx
shlq $0x4, %rax
xorl %edx, %edx
xorl %r12d, %r12d
addq (%rcx,%rdx), %r12
addq $0x10, %rdx
cmpq %rdx, %rax
jne 0xe0f4
jmp 0xe106
xorl %r12d, %r12d
movl 0x8(%r14), %eax
testq %rax, %rax
je 0xe12e
movq 0x10(%r14), %rcx
xorl %edx, %edx
xorl %r13d, %r13d
movq (%rcx,%rdx,8), %rdi
testq %rdi, %rdi
je 0xe124
addq (%rdi), %r13
incq %rdx
cmpq %rdx, %rax
jne 0xe118
jmp 0xe131
xorl %r13d, %r13d
movl %esi, %edi
callq 0xb5d3
movq %rax, %rbx
movl (%r14), %edi
callq 0xb5d3
movq %rax, %r15
movl 0x8(%r14), %edi
callq 0xb5d3
movq %rax, -0x48(%rbp)
movl 0xc(%r14), %edi
callq 0xb5d3
movq %rax, -0x40(%rbp)
movl 0x4(%r14), %edi
callq 0xb6b4
leaq 0xa2e5(%rip), %rdi      # 0x18455
movq %rbx, %rsi
movq %r15, %rdx
movq -0x48(%rbp), %rcx
movq -0x40(%rbp), %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x2050
testq %r13, %r13
js 0xe194
cvtsi2ss %r13, %xmm0
jmp 0xe1ac
movq %r13, %rax
shrq %rax
movl %r13d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
divss 0x955c(%rip), %xmm0     # 0x17710
testq %r12, %r12
js 0xe1c0
cvtsi2ss %r12, %xmm1
jmp 0xe1d8
movq %r12, %rax
shrq %rax
movl %r12d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
divss 0x952c(%rip), %xmm1     # 0x17710
cvtss2sd %xmm1, %xmm1
subq %r13, %r12
js 0xe1f4
cvtsi2ss %r12, %xmm2
jmp 0xe20a
movq %r12, %rax
shrq %rax
andl $0x1, %r12d
orq %rax, %r12
cvtsi2ss %r12, %xmm2
addss %xmm2, %xmm2
divss 0x94fe(%rip), %xmm2     # 0x17710
cvtss2sd %xmm2, %xmm2
leaq 0xa284(%rip), %rdi      # 0x184a1
movb $0x3, %al
callq 0x2050
cmpl $0x0, 0x8(%r14)
je 0xe2e0
leaq 0xa2e4(%rip), %r15      # 0x1851a
leaq 0xa2c1(%rip), %r13      # 0x184fe
xorl %r12d, %r12d
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rbx
testq %rbx, %rbx
je 0xe28a
movl -0x2c(%rbp), %eax
cmpl %eax, 0x8(%rbx)
leaq 0xa293(%rip), %rdi      # 0x184ed
leaq 0xa27b(%rip), %rax      # 0x184dc
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2050
movl 0x8(%rbx), %esi
movq -0x38(%rbp), %rdi
callq 0xe040
movq (%rbx), %rcx
testq %rcx, %rcx
js 0xe299
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0xe2b1
movq %r15, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x2050
jmp 0xe2d0
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movl 0x8(%rbx), %ecx
divss 0x9454(%rip), %xmm0     # 0x17710
cvtss2sd %xmm0, %xmm0
movq %r13, %rdi
movl %r12d, %esi
movq %rax, %rdx
movb $0x1, %al
callq 0x2050
incq %r12
movl 0x8(%r14), %eax
cmpq %rax, %r12
jb 0xe240
cmpl $0x0, 0xc(%r14)
je 0xe38b
movl $0x8, %ebx
leaq 0xa207(%rip), %r12      # 0x184fe
xorl %r13d, %r13d
movq 0x18(%r14), %r15
movl -0x2c(%rbp), %eax
cmpl %eax, (%r15,%rbx)
leaq 0xa240(%rip), %rdi      # 0x1854c
leaq 0xa227(%rip), %rax      # 0x1853a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2050
movl (%r15,%rbx), %esi
movq -0x38(%rbp), %rdi
callq 0xe040
movq -0x8(%r15,%rbx), %rcx
testq %rcx, %rcx
js 0xe33f
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0xe357
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movl (%r15,%rbx), %ecx
divss 0x93ad(%rip), %xmm0     # 0x17710
cvtss2sd %xmm0, %xmm0
movq %r12, %rdi
movl %r13d, %esi
movq %rax, %rdx
movb $0x1, %al
callq 0x2050
incq %r13
movl 0xc(%r14), %eax
addq $0x10, %rbx
cmpq %rax, %r13
jb 0xe2fa
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq