// File: jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::processTransactions(BlockChain::Block const*)
virtual void processTransactions(const Block *block) // process the transactions in this block and assign them to individual wallets
	{
		if ( !block ) return;

		Transaction *transactions = mTransactionFactory.getTransactions(block->transactionCount);
		if ( !transactions ) return;

		mTransactionFactory.markBlock(transactions);

		for (uint32_t i=0; i<block->transactionCount; i++)
		{

			const BlockTransaction &t = block->transactions[i];
			Transaction &trans = transactions[i];
			trans.mBlock = block->blockIndex;
			trans.mTime = block->timeStamp;
			trans.mInputCount = t.inputCount;
			trans.mOutputCount = t.outputCount;

			trans.mInputs   = mTransactionFactory.getInputs(trans.mInputCount);
			trans.mOutputs  = mTransactionFactory.getOutputs(trans.mOutputCount);

			if ( trans.mInputs == NULL || trans.mOutputs == NULL )
			{
				break;
			}

			for (uint32_t i=0; i<t.outputCount; i++)
			{
				const BlockOutput &output = t.outputs[i];
				TransactionOutput &to = trans.mOutputs[i];

				uint32_t adr = 0;

				if ( output.publicKey )
				{
					if ( output.isRipeMD160 )
					{
						mTransactionFactory.getAddress(output.publicKey,adr);
					}
					else
					{
						uint8_t address[25];
						BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinPublicKeyToAddress(output.publicKey,address);
						mTransactionFactory.getAddress(&address[1],adr);
					}
				}
				to.mAddress = adr;
				to.mValue = output.value;
			}

			for (uint32_t i=0; i<t.inputCount; i++)
			{
				const BlockInput &input = t.inputs[i];
				TransactionInput &tin = trans.mInputs[i];
				tin.mOutput = NULL;

				if ( input.transactionIndex != 0xFFFFFFFF )
				{
					Hash256 h(input.transactionHash);
					FileLocation key(h,0,0,0,0);
					FileLocation *found = mTransactionMap.find(key);
					assert(found);
					if ( found )
					{
						Transaction *previousTransaction = mTransactionFactory.getSingleTransaction(found->mTransactionIndex);
						if ( previousTransaction == NULL )
						{
							printf("ERROR: FAILED TO LOCATE TRANSACTION!\r\n");
						}
						else
						{
							assert( input.transactionIndex < previousTransaction->mOutputCount );
							if ( input.transactionIndex < previousTransaction->mOutputCount )
							{
								tin.mOutput = &previousTransaction->mOutputs[input.transactionIndex];
								mTransactionFactory.getAddress(tin.mOutput->mAddress);
							}
						}
					}
				}
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x1b48a
jmp 0x1b85d
movq -0xf0(%rbp), %rdi
addq $0x3771338, %rdi        # imm = 0x3771338
movq -0x10(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x1c8b0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x1b4b4
jmp 0x1b85d
movq -0xf0(%rbp), %rdi
addq $0x3771338, %rdi        # imm = 0x3771338
movq -0x18(%rbp), %rsi
callq 0x1c960
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0x24(%rcx), %eax
jae 0x1b85d
movq -0xf0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl -0x1c(%rbp), %ecx
imulq $0x58, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl -0x1c(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x4(%rax)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x28(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x30(%rbp), %rax
movl %ecx, 0xc(%rax)
addq $0x3771338, %rdi        # imm = 0x3771338
movq -0x30(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x1c9f0
movq -0xf0(%rbp), %rdi
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x3771338, %rdi        # imm = 0x3771338
movq -0x30(%rbp), %rax
movl 0xc(%rax), %esi
callq 0x1ca90
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x1b5a1
movq -0x30(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x1b5a6
jmp 0x1b85d
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x1b67e
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x40(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x1b658
movq -0x40(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x1b626
movq -0xf0(%rbp), %rdi
addq $0x3771338, %rdi        # imm = 0x3771338
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rsi
leaq -0x4c(%rbp), %rdx
callq 0x1cb30
jmp 0x1b656
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdi
leaq -0x70(%rbp), %rsi
callq 0x19550
movq -0xf0(%rbp), %rdi
addq $0x3771338, %rdi        # imm = 0x3771338
leaq -0x70(%rbp), %rsi
addq $0x1, %rsi
leaq -0x4c(%rbp), %rdx
callq 0x1cb30
jmp 0x1b658
movl -0x4c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x40(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x1b5ad
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x1b84d
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x74(%rbp), %ecx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x74(%rbp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq $0x0, (%rax)
movq -0x80(%rbp), %rax
cmpl $-0x1, 0x8(%rax)
je 0x1b83d
movq -0x80(%rbp), %rax
movq (%rax), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x1c660
leaq -0xd8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
xorl %r9d, %r9d
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
callq 0x1c6a0
movq -0xf0(%rbp), %rdi
addq $0x16f12f0, %rdi        # imm = 0x16F12F0
leaq -0xd8(%rbp), %rsi
callq 0x1c700
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
je 0x1b73f
jmp 0x1b75e
leaq 0x15c6c(%rip), %rdi     # 0x313b2
leaq 0x15503(%rip), %rsi     # 0x30c50
movl $0x132e, %edx           # imm = 0x132E
leaq 0x15c5f(%rip), %rcx     # 0x313b8
callq 0x20c0
cmpq $0x0, -0xe0(%rbp)
je 0x1b83b
movq -0xf0(%rbp), %rdi
addq $0x3771338, %rdi        # imm = 0x3771338
movq -0xe0(%rbp), %rax
movl 0x2c(%rax), %esi
callq 0x1cbc0
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
jne 0x1b7ad
leaq 0x15c57(%rip), %rdi     # 0x313f8
movb $0x0, %al
callq 0x2050
jmp 0x1b839
movq -0x80(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xe8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x1b7c2
jmp 0x1b7e1
leaq 0x15c56(%rip), %rdi     # 0x3141f
leaq 0x15480(%rip), %rsi     # 0x30c50
movl $0x1338, %edx           # imm = 0x1338
leaq 0x15bdc(%rip), %rcx     # 0x313b8
callq 0x20c0
movq -0x80(%rbp), %rax
movl 0x8(%rax), %eax
movq -0xe8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x1b837
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x80(%rbp), %rax
movl 0x8(%rax), %eax
shlq $0x4, %rax
addq %rax, %rcx
movq -0x88(%rbp), %rax
movq %rcx, (%rax)
addq $0x3771338, %rdi        # imm = 0x3771338
movq -0x88(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %esi
callq 0x1cc70
jmp 0x1b839
jmp 0x1b83b
jmp 0x1b83d
jmp 0x1b83f
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1b685
jmp 0x1b84f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x1b4d2
addq $0xf0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)