// File: jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::printBlock(BlockChain::Block const*)
virtual void printBlock(const Block *block) // prints the contents of the block to the console for debugging purposes
	{
		printf("==========================================================================================\r\n");
		printf("Block #%s\r\n", formatNumber(block->blockIndex) );

		printf("ComputedBlockHash: ");
		printReverseHash(block->computedBlockHash);
		printf("\r\n");

		if ( block->previousBlockHash )
		{
			printf("PreviousBlockHash:");
			printReverseHash(block->previousBlockHash);
			printf("\r\n");
		}
		if ( block->nextBlockHash )
		{
			printf("NextBlockHash:");
			printReverseHash(block->nextBlockHash);
			printf("\r\n");
		}


		printf("Merkle root: ");
		printReverseHash(block->merkleRoot);
		printf("\r\n");

		printf("Number of Transactions: %s\r\n", formatNumber(block->transactionCount) );
		printf("Timestamp : %s\r\n", getTimeString(block->timeStamp ) );
		printf("Bits: %d Hex: %08X\r\n", block->bits, block->bits );
		printf("Size: %0.10f KB or %s bytes.\r\n", (float)block->blockLength / 1024.0f, formatNumber(block->blockLength) );
		printf("Version: %d\r\n", block->blockFormatVersion );
		printf("Nonce: %u\r\n", block->nonce );
		printf("BlockReward: %f\r\n", (float)block->blockReward / ONE_BTC );

		printf("%s transactions\r\n", formatNumber(block->transactionCount) );
		for (uint32_t i=0; i<block->transactionCount; i++)
		{
			const BlockTransaction &t = block->transactions[i];
			printf("Transaction %s : %s inputs %s outputs. VersionNumber: %d\r\n", formatNumber(i), formatNumber(t.inputCount), formatNumber(t.outputCount), t.transactionVersionNumber );
			printf("TransactionHash: ");
			printReverseHash(t.transactionHash);
			printf("\r\n");
			for (uint32_t i=0; i<t.inputCount; i++)
			{
				const BlockInput &input = t.inputs[i];
				printf("    Input %s : ResponsScriptLength: %s TransactionIndex: %s : TransactionHash: ", formatNumber(i), formatNumber(input.responseScriptLength), formatNumber(input.transactionIndex) );

				printReverseHash(input.transactionHash);

				printf("\r\n");

				if ( input.transactionIndex != 0xFFFFFFFF )
				{
					const BlockTransaction *t = readSingleTransaction(input.transactionHash);
					if ( t == NULL )
					{
						printf("ERROR: TransactionIndex[%d] FAILED TO LOCATE TRANSACTION FOR HASH: ", input.transactionIndex );
						printReverseHash(input.transactionHash);
						printf("\r\n");
					}
					else
					{
						if ( input.transactionIndex < t->outputCount )
						{
							const BlockOutput &o = t->outputs[input.transactionIndex];
							if ( o.publicKey )
							{
								char scratch[256];
								bool ok=true;
								if ( o.isRipeMD160 )
								{
									uint8_t temp[25];
									BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinRIPEMD160ToAddress(o.publicKey,temp);
									BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinAddressToAscii(temp,scratch,256);
								}
								else
								{
									ok = BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinPublicKeyToAscii(o.publicKey,scratch,256);
								}
								if ( ok )
								{
									printf("     Spending From Public Key: %s in the amount of: %0.4f\r\n", scratch, (float)o.value / ONE_BTC );
								}
								else
								{
									printf("ERROR: Unable to decode public key!\r\n");
								}
							}
							else
							{
								printf("ERROR: No public key found for this previous output.\r\n");
							}
						}
						else
						{
							printf("ERROR: Invalid transaction index!\r\n");
						}
					}
				}
			}
			for (uint32_t i=0; i<t.outputCount; i++)
			{
				const BlockOutput &output = t.outputs[i];
				printf("    Output: %s : %f BTC : ChallengeScriptLength: %s\r\n", formatNumber(i), (float)output.value / ONE_BTC, formatNumber(output.challengeScriptLength) );
				if ( output.publicKey )
				{
					char scratch[256];
					bool ok=true;
					if ( output.isRipeMD160 )
					{
						uint8_t temp[25];
						BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinRIPEMD160ToAddress(output.publicKey,temp);
						BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinAddressToAscii(temp,scratch,256);
					}
					else
					{
						ok = BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinPublicKeyToAscii(output.publicKey,scratch,256);
					}
					if ( ok )
					{
						printf("PublicKey: %s : %s\r\n", scratch, output.isRipeMD160 ? "RIPEMD160" : "ECDSA" );
					}
					else
					{
						printf("Failed to encode the public key.\r\n");
					}
				}
				else
				{
					printf("ERROR: Unable to derive a public key for this output!\r\n");
				}
			}
		}

		printf("==========================================================================================\r\n");
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq 0x165d0(%rip), %rdi     # 0x30f85
movb $0x0, %al
callq 0x2050
movq -0x10(%rbp), %rax
movl 0x50(%rax), %edi
callq 0x19c20
movq %rax, %rsi
leaq 0x16610(%rip), %rdi     # 0x30fe2
movb $0x0, %al
callq 0x2050
leaq 0x1660e(%rip), %rdi     # 0x30fee
movb $0x0, %al
callq 0x2050
movq -0x298(%rbp), %rdi
movq -0x10(%rbp), %rsi
addq $0x30, %rsi
callq 0x1c5f0
leaq 0x16a1a(%rip), %rdi     # 0x3141c
movb $0x0, %al
callq 0x2050
movq -0x10(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x1aa44
leaq 0x165e7(%rip), %rdi     # 0x31002
movb $0x0, %al
callq 0x2050
movq -0x298(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x1c5f0
leaq 0x169df(%rip), %rdi     # 0x3141c
movb $0x0, %al
callq 0x2050
movq -0x10(%rbp), %rax
cmpq $0x0, 0x70(%rax)
je 0x1aa7f
leaq 0x165bf(%rip), %rdi     # 0x31015
movb $0x0, %al
callq 0x2050
movq -0x298(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rsi
callq 0x1c5f0
leaq 0x169a4(%rip), %rdi     # 0x3141c
movb $0x0, %al
callq 0x2050
leaq 0x1659e(%rip), %rdi     # 0x31024
xorl %eax, %eax
movb %al, -0x2a1(%rbp)
callq 0x2050
movq -0x298(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x1c5f0
movb -0x2a1(%rbp), %al
leaq 0x16968(%rip), %rdi     # 0x3141c
callq 0x2050
movq -0x10(%rbp), %rax
movl 0x24(%rax), %edi
callq 0x19c20
movq %rax, %rsi
movb -0x2a1(%rbp), %al
leaq 0x1655d(%rip), %rdi     # 0x31032
callq 0x2050
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x19db0
movq %rax, %rsi
movb -0x2a1(%rbp), %al
leaq 0x16559(%rip), %rdi     # 0x3104f
callq 0x2050
movb -0x2a1(%rbp), %al
movq -0x10(%rbp), %rcx
movl 0x1c(%rcx), %edx
leaq 0x16551(%rip), %rdi     # 0x31060
movl %edx, %esi
callq 0x2050
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, %edi
cvtsi2ss %rax, %xmm0
movss 0x16109(%rip), %xmm1    # 0x30c34
mulss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x2b0(%rbp)
callq 0x19c20
movsd -0x2b0(%rbp), %xmm0
movq %rax, %rsi
leaq 0x16523(%rip), %rdi     # 0x31075
movb $0x1, %al
callq 0x2050
movb -0x2a1(%rbp), %al
movq -0x10(%rbp), %rcx
movl 0x4(%rcx), %esi
leaq 0x16527(%rip), %rdi     # 0x31094
callq 0x2050
movb -0x2a1(%rbp), %al
movq -0x10(%rbp), %rcx
movl 0x20(%rcx), %esi
leaq 0x1651c(%rip), %rdi     # 0x310a2
callq 0x2050
movq -0x10(%rbp), %rax
movq 0x68(%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, -0x2a0(%rbp)
testq %rax, %rax
movss %xmm0, -0x29c(%rbp)
js 0x1abd4
movss -0x2a0(%rbp), %xmm0
movss %xmm0, -0x29c(%rbp)
movss -0x29c(%rbp), %xmm0
movss 0x1604c(%rip), %xmm1    # 0x30c30
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x164bb(%rip), %rdi     # 0x310ae
movb $0x1, %al
callq 0x2050
movq -0x10(%rbp), %rax
movl 0x24(%rax), %edi
callq 0x19c20
movq %rax, %rsi
leaq 0x164b0(%rip), %rdi     # 0x310c0
movb $0x0, %al
callq 0x2050
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jae 0x1b120
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x14(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %edi
callq 0x19c20
movq %rax, -0x2c0(%rbp)
movq -0x20(%rbp), %rax
movl 0x4(%rax), %edi
callq 0x19c20
movq %rax, -0x2b8(%rbp)
movq -0x20(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x19c20
movq -0x2c0(%rbp), %rsi
movq -0x2b8(%rbp), %rdx
movq %rax, %rcx
movq -0x20(%rbp), %rax
movl (%rax), %r8d
leaq 0x16441(%rip), %rdi     # 0x310d2
movb $0x0, %al
callq 0x2050
leaq 0x164ac(%rip), %rdi     # 0x3114b
movb $0x0, %al
callq 0x2050
movq -0x298(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x24, %rsi
callq 0x1c5f0
leaq 0x1675b(%rip), %rdi     # 0x3141c
movb $0x0, %al
callq 0x2050
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x1af3c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x24(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %edi
callq 0x19c20
movq %rax, -0x2d0(%rbp)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x19c20
movq %rax, -0x2c8(%rbp)
movq -0x30(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x19c20
movq -0x2d0(%rbp), %rsi
movq -0x2c8(%rbp), %rdx
movq %rax, %rcx
leaq 0x163d2(%rip), %rdi     # 0x3110d
movb $0x0, %al
callq 0x2050
movq -0x298(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0x1c5f0
leaq 0x166c0(%rip), %rdi     # 0x3141c
movb $0x0, %al
callq 0x2050
movq -0x30(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x1af2c
movq -0x298(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq (%rdi), %rax
callq *0x18(%rax)
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1adcb
movq -0x30(%rbp), %rax
movl 0x8(%rax), %esi
leaq 0x163bf(%rip), %rdi     # 0x3115d
movb $0x0, %al
callq 0x2050
movq -0x298(%rbp), %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0x1c5f0
leaq 0x1665d(%rip), %rdi     # 0x3141c
movb $0x0, %al
callq 0x2050
jmp 0x1af2a
movq -0x30(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x38(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1af1a
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x30(%rbp), %rcx
movl 0x8(%rcx), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1af0a
movb $0x1, -0x141(%rbp)
movq -0x40(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x1ae47
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdi
leaq -0x160(%rbp), %rsi
callq 0x19710
leaq -0x160(%rbp), %rdi
leaq -0x140(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x197a0
jmp 0x1ae68
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdi
leaq -0x140(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x19600
andb $0x1, %al
movb %al, -0x141(%rbp)
testb $0x1, -0x141(%rbp)
je 0x1aefa
leaq -0x140(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x40(%rbp), %rax
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, -0x2d8(%rbp)
testq %rax, %rax
movss %xmm0, -0x2d4(%rbp)
js 0x1aecb
movss -0x2d8(%rbp), %xmm0
movss %xmm0, -0x2d4(%rbp)
movq -0x2e0(%rbp), %rsi
movss -0x2d4(%rbp), %xmm0
movss 0x15d4e(%rip), %xmm1    # 0x30c30
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x162b0(%rip), %rdi     # 0x311a1
movb $0x1, %al
callq 0x2050
jmp 0x1af08
leaq 0x162dc(%rip), %rdi     # 0x311dd
movb $0x0, %al
callq 0x2050
jmp 0x1af18
leaq 0x162f2(%rip), %rdi     # 0x31203
movb $0x0, %al
callq 0x2050
jmp 0x1af28
leaq 0x16319(%rip), %rdi     # 0x3123a
movb $0x0, %al
callq 0x2050
jmp 0x1af2a
jmp 0x1af2c
jmp 0x1af2e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1accf
movl $0x0, -0x164(%rbp)
movl -0x164(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1b110
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x164(%rbp), %ecx
leaq (%rcx,%rcx,4), %rcx
leaq (%rax,%rcx,8), %rax
movq %rax, -0x170(%rbp)
movl -0x164(%rbp), %edi
callq 0x19c20
movq %rax, -0x2f0(%rbp)
movq -0x170(%rbp), %rax
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, -0x2e8(%rbp)
testq %rax, %rax
movss %xmm0, -0x2e4(%rbp)
js 0x1afd3
movss -0x2e8(%rbp), %xmm0
movss %xmm0, -0x2e4(%rbp)
movss -0x2e4(%rbp), %xmm0
movss 0x15c4d(%rip), %xmm1    # 0x30c30
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x2f8(%rbp)
movq -0x170(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x19c20
movq -0x2f0(%rbp), %rsi
movsd -0x2f8(%rbp), %xmm0
movq %rax, %rdx
leaq 0x16243(%rip), %rdi     # 0x3125e
movb $0x1, %al
callq 0x2050
movq -0x170(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1b0ec
movb $0x1, -0x271(%rbp)
movq -0x170(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x1b079
movq -0x170(%rbp), %rax
movq 0x20(%rax), %rdi
leaq -0x290(%rbp), %rsi
callq 0x19710
leaq -0x290(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x197a0
jmp 0x1b09d
movq -0x170(%rbp), %rax
movq 0x20(%rax), %rdi
leaq -0x270(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x19600
andb $0x1, %al
movb %al, -0x271(%rbp)
testb $0x1, -0x271(%rbp)
je 0x1b0dc
leaq -0x270(%rbp), %rsi
movq -0x170(%rbp), %rax
movb 0x18(%rax), %cl
leaq 0x161f5(%rip), %rdx     # 0x312b3
leaq 0x161e4(%rip), %rax     # 0x312a9
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x161c1(%rip), %rdi     # 0x31294
movb $0x0, %al
callq 0x2050
jmp 0x1b0ea
leaq 0x161d6(%rip), %rdi     # 0x312b9
movb $0x0, %al
callq 0x2050
jmp 0x1b0fa
leaq 0x161e9(%rip), %rdi     # 0x312dc
movb $0x0, %al
callq 0x2050
jmp 0x1b0fc
movl -0x164(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x164(%rbp)
jmp 0x1af46
jmp 0x1b112
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1ac1e
leaq 0x15e5e(%rip), %rdi     # 0x30f85
movb $0x0, %al
callq 0x2050
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
nopw (%rax,%rax)