// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
testq %rsi, %rsi
je 0xc856
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x3771338(%rdi), %r13
movl 0x24(%rsi), %esi
movq %r13, %rdi
callq 0xcff6
testq %rax, %rax
je 0xc856
movl 0x5771370(%r12), %edx
cmpq $0x7a120, %rdx          # imm = 0x7A120
jae 0xc8e1
movq 0x5771378(%r12), %rcx
movq %rax, (%rcx,%rdx,8)
leal 0x1(%rdx), %ecx
movl %ecx, 0x5771370(%r12)
cmpl $0x0, 0x24(%rbx)
je 0xc856
xorl %r9d, %r9d
movq %rbx, -0x58(%rbp)
movq %r12, -0x60(%rbp)
movq %r13, -0x48(%rbp)
movq %rax, -0x50(%rbp)
movq 0x28(%rbx), %r10
movl %r9d, %r11d
imulq $0x58, %r11, %r8
shlq $0x5, %r11
movl 0x50(%rbx), %ecx
movl %ecx, (%rax,%r11)
movl 0x18(%rbx), %ecx
movl %ecx, 0x4(%rax,%r11)
movl 0x4(%r10,%r8), %esi
movl %esi, 0x8(%rax,%r11)
movl 0x10(%r10,%r8), %ecx
movl %ecx, 0xc(%rax,%r11)
movl 0x577134c(%r12), %edi
addl %edi, %esi
cmpl $0x5f5e100, %esi        # imm = 0x5F5E100
jae 0xc8c2
addq %rax, %r11
movq 0x5771360(%r12), %rdx
movl %esi, 0x577134c(%r12)
leaq (%rdx,%rdi,8), %rsi
movq %rsi, 0x10(%r11)
movl 0x5771350(%r12), %esi
addl %esi, %ecx
cmpl $0x5f5e100, %ecx        # imm = 0x5F5E100
jae 0xc8a3
movq 0x5771368(%r12), %rdi
movl %ecx, 0x5771350(%r12)
shlq $0x4, %rsi
addq %rdi, %rsi
movq %rsi, 0x18(%r11)
testq %rdx, %rdx
je 0xc856
testq %rdi, %rdi
je 0xc856
movq %r9, -0x68(%rbp)
addq %r8, %r10
cmpl $0x0, 0x10(%r10)
movq %r10, -0x40(%rbp)
movq %r11, -0x38(%rbp)
je 0xc731
movl $0x20, %ebx
movl $0x8, %r14d
xorl %r15d, %r15d
movq 0x18(%r10), %r13
movq 0x18(%r11), %r12
movl $0x0, -0x2c(%rbp)
movq (%r13,%rbx), %rsi
testq %rsi, %rsi
je 0xc70c
cmpb $0x1, -0x8(%r13,%rbx)
jne 0xc6df
movq -0x48(%rbp), %rdi
jmp 0xc6fb
movq (%r13,%rbx), %rdi
leaq -0x90(%rbp), %rsi
callq 0xb0d7
movq -0x48(%rbp), %rdi
leaq -0x8f(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
callq 0xd050
movq -0x40(%rbp), %r10
movq -0x38(%rbp), %r11
movl -0x2c(%rbp), %eax
movl %eax, (%r12,%r14)
movq -0x20(%r13,%rbx), %rax
movq %rax, -0x8(%r12,%r14)
incq %r15
movl 0x10(%r10), %eax
addq $0x28, %rbx
addq $0x10, %r14
cmpq %rax, %r15
jb 0xc6b8
cmpl $0x0, 0x4(%r10)
movq -0x60(%rbp), %r12
movq -0x48(%rbp), %r13
je 0xc83d
xorl %ebx, %ebx
movq 0x8(%r10), %r15
movq %rbx, %rax
shlq $0x5, %rax
movq 0x10(%r11), %r14
movq $0x0, (%r14,%rbx,8)
cmpl $-0x1, 0x8(%r15,%rax)
je 0xc82d
addq %rax, %r15
movq (%r15), %rsi
movq (%rsi), %rax
movq 0x8(%rsi), %rcx
movq 0x10(%rsi), %rdx
movq 0x18(%rsi), %rsi
movq %rcx, %rdi
xorq %rax, %rdi
movq %rdx, %r8
xorq %rsi, %r8
xorq %rdi, %r8
shrq $0x20, %r8
movl %ecx, %edi
xorl %eax, %edi
movl %edx, %r9d
xorl %edi, %r9d
movl %esi, %edi
xorl %r9d, %edi
xorl %r8d, %edi
andl $0x3fffff, %edi         # imm = 0x3FFFFF
movq 0x16f12f0(%r12,%rdi,8), %rdi
testq %rdi, %rdi
je 0xc7d3
cmpq %rax, (%rdi)
jne 0xc7cd
cmpq %rcx, 0x8(%rdi)
jne 0xc7cd
cmpq %rdx, 0x10(%rdi)
jne 0xc7cd
cmpq %rsi, 0x18(%rdi)
je 0xc7d5
movq 0x30(%rdi), %rdi
jmp 0xc7b1
xorl %edi, %edi
testq %rdi, %rdi
je 0xc865
movl 0x2c(%rdi), %esi
movq %r13, %rdi
callq 0xd1d4
testq %rax, %rax
je 0xc819
movl 0x8(%r15), %ecx
cmpl 0xc(%rax), %ecx
jae 0xc884
movq 0x18(%rax), %rax
shlq $0x4, %rcx
leaq (%rax,%rcx), %rdx
movq %rdx, (%r14,%rbx,8)
movl 0x8(%rax,%rcx), %esi
movq %r13, %rdi
callq 0xd236
jmp 0xc825
leaq 0xd22a(%rip), %rdi      # 0x19a4a
callq 0x2260
movq -0x40(%rbp), %r10
movq -0x38(%rbp), %r11
incq %rbx
movl 0x4(%r10), %eax
cmpq %rax, %rbx
jb 0xc746
movq -0x68(%rbp), %r9
incl %r9d
movq -0x58(%rbp), %rbx
cmpl 0x24(%rbx), %r9d
movq -0x50(%rbp), %rax
jb 0xc5ea
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb5aa(%rip), %rdi      # 0x17e16
leaq 0xaf7d(%rip), %rsi      # 0x177f0
leaq 0xb5a2(%rip), %rcx      # 0x17e1c
movl $0x132e, %edx           # imm = 0x132E
callq 0x20c0
leaq 0xb5d1(%rip), %rdi      # 0x17e5c
leaq 0xaf5e(%rip), %rsi      # 0x177f0
leaq 0xb583(%rip), %rcx      # 0x17e1c
movl $0x1338, %edx           # imm = 0x1338
callq 0x20c0
leaq 0xb727(%rip), %rdi      # 0x17fd1
leaq 0xaf3f(%rip), %rsi      # 0x177f0
leaq 0xb747(%rip), %rcx      # 0x17fff
movl $0xbea, %edx            # imm = 0xBEA
callq 0x20c0
leaq 0xb69b(%rip), %rdi      # 0x17f64
leaq 0xaf20(%rip), %rsi      # 0x177f0
leaq 0xb6b9(%rip), %rcx      # 0x17f90
movl $0xbde, %edx            # imm = 0xBDE
callq 0x20c0
leaq 0xb624(%rip), %rdi      # 0x17f0c
leaq 0xaf01(%rip), %rsi      # 0x177f0
leaq 0xb635(%rip), %rcx      # 0x17f2b
movl $0xb8f, %edx            # imm = 0xB8F
callq 0x20c0