// File: /workspace/github_cpp_makefile_star2_O3/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 0xe0c5
movq 0x18(%r14), %rcx
shlq $0x4, %rax
xorl %edx, %edx
xorl %r12d, %r12d
addq (%rcx,%rdx), %r12
addq $0x10, %rdx
cmpq %rdx, %rax
jne 0xe0b6
jmp 0xe0c8
xorl %r12d, %r12d
movl 0x8(%r14), %eax
testq %rax, %rax
je 0xe0f0
movq 0x10(%r14), %rcx
xorl %edx, %edx
xorl %r13d, %r13d
movq (%rcx,%rdx,8), %rdi
testq %rdi, %rdi
je 0xe0e6
addq (%rdi), %r13
incq %rdx
cmpq %rdx, %rax
jne 0xe0da
jmp 0xe0f3
xorl %r13d, %r13d
movl %esi, %edi
callq 0xb535
movq %rax, %rbx
movl (%r14), %edi
callq 0xb535
movq %rax, %r15
movl 0x8(%r14), %edi
callq 0xb535
movq %rax, -0x48(%rbp)
movl 0xc(%r14), %edi
callq 0xb535
movq %rax, -0x40(%rbp)
movl 0x4(%r14), %edi
callq 0xb616
leaq 0xa323(%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 0xe156
cvtsi2ss %r13, %xmm0
jmp 0xe16e
movq %r13, %rax
shrq %rax
movl %r13d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
divss 0x959a(%rip), %xmm0     # 0x17710
testq %r12, %r12
js 0xe182
cvtsi2ss %r12, %xmm1
jmp 0xe19a
movq %r12, %rax
shrq %rax
movl %r12d, %ecx
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
divss 0x956a(%rip), %xmm1     # 0x17710
cvtss2sd %xmm1, %xmm1
subq %r13, %r12
js 0xe1b6
cvtsi2ss %r12, %xmm2
jmp 0xe1cc
movq %r12, %rax
shrq %rax
andl $0x1, %r12d
orq %rax, %r12
cvtsi2ss %r12, %xmm2
addss %xmm2, %xmm2
divss 0x953c(%rip), %xmm2     # 0x17710
cvtss2sd %xmm2, %xmm2
leaq 0xa2c2(%rip), %rdi      # 0x184a1
movb $0x3, %al
callq 0x2050
cmpl $0x0, 0x8(%r14)
je 0xe2a2
leaq 0xa322(%rip), %r15      # 0x1851a
leaq 0xa2ff(%rip), %r13      # 0x184fe
xorl %r12d, %r12d
movq 0x10(%r14), %rax
movq (%rax,%r12,8), %rbx
testq %rbx, %rbx
je 0xe24c
movl -0x2c(%rbp), %eax
cmpl %eax, 0x8(%rbx)
leaq 0xa2d1(%rip), %rdi      # 0x184ed
leaq 0xa2b9(%rip), %rax      # 0x184dc
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2050
movl 0x8(%rbx), %esi
movq -0x38(%rbp), %rdi
callq 0xe002
movq (%rbx), %rcx
testq %rcx, %rcx
js 0xe25b
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0xe273
movq %r15, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x2050
jmp 0xe292
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 0x9492(%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 0xe202
cmpl $0x0, 0xc(%r14)
je 0xe34d
movl $0x8, %ebx
leaq 0xa245(%rip), %r12      # 0x184fe
xorl %r13d, %r13d
movq 0x18(%r14), %r15
movl -0x2c(%rbp), %eax
cmpl %eax, (%r15,%rbx)
leaq 0xa27e(%rip), %rdi      # 0x1854c
leaq 0xa265(%rip), %rax      # 0x1853a
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x2050
movl (%r15,%rbx), %esi
movq -0x38(%rbp), %rdi
callq 0xe002
movq -0x8(%r15,%rbx), %rcx
testq %rcx, %rcx
js 0xe301
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
jmp 0xe319
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 0x93eb(%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 0xe2bc
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq