// File: jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::reportCounts()
void reportCounts(void)
	{
		if ( mTransactionCount )
		{
			printf("%s transactions.\r\n", formatNumber(mTransactionCount) );
			printf("%s inputs.\r\n", formatNumber(mTotalInputCount) );
			printf("%s outputs.\r\n", formatNumber(mTotalOutputCount) );
			printf("%s addresses.\r\n", formatNumber(mAddresses.size()) );

			enum StatType
			{
				ST_ZERO,
				ST_DUST,
				ST_LESSONE,
				ST_LESSTEN,
				ST_LESS_HUNDRED,
				ST_LESS_THOUSAND,
				ST_LESS_TEN_THOUSAND,
				ST_LESS_HUNDRED_THOUSAND,
				ST_GREATER_HUNDRED_THOUSAND,
				ST_LAST
			};
			uint32_t counts[ST_LAST];
			uint64_t balances[ST_LAST];
			for (uint32_t i=0; i<ST_LAST; i++)
			{
				counts[i] = 0;
				balances[i] = 0;
			}

			for (uint32_t i=0; i<mAddresses.size(); i++)
			{
				BitcoinAddress *ba = mAddresses.getKey(i);
				uint64_t balance = ba->mTotalReceived-ba->mTotalSent;
				uint32_t btc = (uint32_t)(balance/ONE_BTC);
				if ( balance == 0 )
				{
					counts[ST_ZERO]++;
				}
				else if ( balance < ONE_MBTC )
				{
					counts[ST_DUST]++;
					balances[ST_DUST]+=balance;
				}
				else if ( balance < ONE_BTC )
				{
					counts[ST_LESSONE]++;
					balances[ST_LESSONE]+=balance;
				}
				else if ( btc < 10 )
				{
					counts[ST_LESSTEN]++;
					balances[ST_LESSTEN]+=btc;
				}
				else if ( btc < 100 )
				{
					counts[ST_LESS_HUNDRED]++;
					balances[ST_LESS_HUNDRED]+=btc;
				}
				else if ( btc < 1000 )
				{
					counts[ST_LESS_THOUSAND]++;
					balances[ST_LESS_THOUSAND]+=btc;
				}
				else if ( btc < 10000 )
				{
					counts[ST_LESS_TEN_THOUSAND]++;
					balances[ST_LESS_TEN_THOUSAND]+=btc;
				}
				else if ( btc < 100000 )
				{
					counts[ST_LESS_HUNDRED_THOUSAND]++;
					balances[ST_LESS_HUNDRED_THOUSAND]+=btc;
				}
				else
				{
					counts[ST_GREATER_HUNDRED_THOUSAND]++;
					balances[ST_GREATER_HUNDRED_THOUSAND]+=btc;
				}
			}
			printf("Found %s addresses which have ever been used.\r\n", formatNumber(mAddresses.size()) );

			printf("Found %s addresses with a zero balance.\r\n", formatNumber( counts[ST_ZERO]) );

			printf("Found %s 'dust' addresses (less than 1mbtc) with a total balance of %0.5f BTC\r\n", 
				formatNumber( counts[ST_DUST] ), 
				(float)balances[ST_DUST] / ONE_BTC );

			printf("Found %s addresses with a balance greater than 1mbtc but less than 1btc, total balance %0.5f\r\n",
				formatNumber(counts[ST_LESSONE]),
				(float)balances[ST_LESSONE]/ONE_BTC );

			printf("Found %s addresses with a balance greater than 1btc but less than 10btc, total btc: %s\r\n",
				formatNumber(counts[ST_LESSTEN]),
				formatNumber((uint32_t)balances[ST_LESSTEN]));

			printf("Found %s addresses with a balance greater than 10btc but less than 100btc, total: %s\r\n",
				formatNumber(counts[ST_LESS_HUNDRED]),
				formatNumber((uint32_t)balances[ST_LESS_HUNDRED]));

			printf("Found %s addresses with a balance greater than 100btc but less than 1,000btc, total: %s\r\n",
				formatNumber(counts[ST_LESS_THOUSAND]),
				formatNumber((uint32_t)balances[ST_LESS_THOUSAND]));

			printf("Found %s addresses with a balance greater than 1,000btc but less than 10,000btc, total: %s\r\n",
				formatNumber(counts[ST_LESS_TEN_THOUSAND]),
				formatNumber((uint32_t)balances[ST_LESS_TEN_THOUSAND]));

			printf("Found %s addresses with a balance greater than 10,000btc but less than 100,000btc, total: %s\r\n",
				formatNumber(counts[ST_LESS_HUNDRED_THOUSAND]),
				formatNumber((uint32_t)balances[ST_LESS_HUNDRED_THOUSAND]));

			printf("Found %s addresses with a balance greater than 100,000btc, total: %s\r\n",
				formatNumber(counts[ST_GREATER_HUNDRED_THOUSAND]),
				formatNumber((uint32_t)balances[ST_GREATER_HUNDRED_THOUSAND]));


		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
cmpl $0x0, 0x2000010(%rax)
je 0x22209
movq -0xa8(%rbp), %rax
movl 0x2000010(%rax), %edi
callq 0x19c20
movq %rax, %rsi
leaq 0xfe2c(%rip), %rdi      # 0x31b2f
movb $0x0, %al
callq 0x2050
movq -0xa8(%rbp), %rax
movl 0x2000014(%rax), %edi
callq 0x19c20
movq %rax, %rsi
leaq 0x1056f(%rip), %rdi     # 0x32295
movb $0x0, %al
callq 0x2050
movq -0xa8(%rbp), %rax
movl 0x2000018(%rax), %edi
callq 0x19c20
movq %rax, %rsi
leaq 0x10559(%rip), %rdi     # 0x322a2
movb $0x0, %al
callq 0x2050
movq -0xa8(%rbp), %rdi
callq 0x1d960
movl %eax, %edi
callq 0x19c20
movq %rax, %rsi
leaq 0x10543(%rip), %rdi     # 0x322b0
movb $0x0, %al
callq 0x2050
movl $0x0, -0x84(%rbp)
cmpl $0x9, -0x84(%rbp)
jae 0x21db5
movl -0x84(%rbp), %eax
movl $0x0, -0x30(%rbp,%rax,4)
movl -0x84(%rbp), %eax
movq $0x0, -0x80(%rbp,%rax,8)
movl -0x84(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x21d7e
movl $0x0, -0x88(%rbp)
movq -0xa8(%rbp), %rdi
movl -0x88(%rbp), %eax
movl %eax, -0xac(%rbp)
callq 0x1d960
movl %eax, %ecx
movl -0xac(%rbp), %eax
cmpl %ecx, %eax
jae 0x21f94
movq -0xa8(%rbp), %rdi
movl -0x88(%rbp), %esi
callq 0x1d360
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x90(%rbp), %rcx
subq 0x20(%rcx), %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divq %rcx
movl %eax, -0x9c(%rbp)
cmpq $0x0, -0x98(%rbp)
jne 0x21e4c
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x21f7e
cmpq $0x186a0, -0x98(%rbp) # imm = 0x186A0
jae 0x21e76
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x98(%rbp), %rax
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x21f7c
cmpq $0x5f5e100, -0x98(%rbp) # imm = 0x5F5E100
jae 0x21ea0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movq -0x98(%rbp), %rax
addq -0x70(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x21f7a
cmpl $0xa, -0x9c(%rbp)
jae 0x21ec5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x9c(%rbp), %eax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x21f78
cmpl $0x64, -0x9c(%rbp)
jae 0x21eea
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x9c(%rbp), %eax
addq -0x60(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0x21f76
cmpl $0x3e8, -0x9c(%rbp)     # imm = 0x3E8
jae 0x21f0f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x9c(%rbp), %eax
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0x21f74
cmpl $0x2710, -0x9c(%rbp)    # imm = 0x2710
jae 0x21f34
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x9c(%rbp), %eax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x21f72
cmpl $0x186a0, -0x9c(%rbp)   # imm = 0x186A0
jae 0x21f59
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x9c(%rbp), %eax
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x21f70
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movl -0x9c(%rbp), %eax
addq -0x40(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x21f72
jmp 0x21f74
jmp 0x21f76
jmp 0x21f78
jmp 0x21f7a
jmp 0x21f7c
jmp 0x21f7e
jmp 0x21f80
movl -0x88(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x88(%rbp)
jmp 0x21dbf
movq -0xa8(%rbp), %rdi
callq 0x1d960
movl %eax, %edi
callq 0x19c20
movq %rax, %rsi
leaq 0x1030f(%rip), %rdi     # 0x322c0
xorl %eax, %eax
movb %al, -0xc1(%rbp)
callq 0x2050
movl -0x30(%rbp), %edi
callq 0x19c20
movq %rax, %rsi
movb -0xc1(%rbp), %al
leaq 0x1031a(%rip), %rdi     # 0x322f0
callq 0x2050
movl -0x2c(%rbp), %edi
callq 0x19c20
movq %rax, -0xc0(%rbp)
movq -0x78(%rbp), %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, -0xb4(%rbp)
testq %rax, %rax
movss %xmm0, -0xb0(%rbp)
js 0x2202f
movss -0xb4(%rbp), %xmm0
movss %xmm0, -0xb0(%rbp)
movq -0xc0(%rbp), %rsi
movss -0xb0(%rbp), %xmm0
movss 0xebea(%rip), %xmm1     # 0x30c30
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x102c5(%rip), %rdi     # 0x3231a
movb $0x1, %al
callq 0x2050
movl -0x28(%rbp), %edi
callq 0x19c20
movq %rax, -0xd8(%rbp)
movq -0x70(%rbp), %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, -0xcc(%rbp)
testq %rax, %rax
movss %xmm0, -0xc8(%rbp)
js 0x220b0
movss -0xcc(%rbp), %xmm0
movss %xmm0, -0xc8(%rbp)
movq -0xd8(%rbp), %rsi
movss -0xc8(%rbp), %xmm0
movss 0xeb69(%rip), %xmm1     # 0x30c30
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x10294(%rip), %rdi     # 0x3236a
movb $0x1, %al
callq 0x2050
movl -0x24(%rbp), %edi
callq 0x19c20
movq %rax, -0x108(%rbp)
movq -0x68(%rbp), %rax
movl %eax, %edi
callq 0x19c20
movq -0x108(%rbp), %rsi
movq %rax, %rdx
leaq 0x102c1(%rip), %rdi     # 0x323c9
movb $0x0, %al
callq 0x2050
movl -0x20(%rbp), %edi
callq 0x19c20
movq %rax, -0x100(%rbp)
movq -0x60(%rbp), %rax
movl %eax, %edi
callq 0x19c20
movq -0x100(%rbp), %rsi
movq %rax, %rdx
leaq 0x102e8(%rip), %rdi     # 0x32422
movb $0x0, %al
callq 0x2050
movl -0x1c(%rbp), %edi
callq 0x19c20
movq %rax, -0xf8(%rbp)
movq -0x58(%rbp), %rax
movl %eax, %edi
callq 0x19c20
movq -0xf8(%rbp), %rsi
movq %rax, %rdx
leaq 0x1030d(%rip), %rdi     # 0x32479
movb $0x0, %al
callq 0x2050
movl -0x18(%rbp), %edi
callq 0x19c20
movq %rax, -0xf0(%rbp)
movq -0x50(%rbp), %rax
movl %eax, %edi
callq 0x19c20
movq -0xf0(%rbp), %rsi
movq %rax, %rdx
leaq 0x10335(%rip), %rdi     # 0x324d3
movb $0x0, %al
callq 0x2050
movl -0x14(%rbp), %edi
callq 0x19c20
movq %rax, -0xe8(%rbp)
movq -0x48(%rbp), %rax
movl %eax, %edi
callq 0x19c20
movq -0xe8(%rbp), %rsi
movq %rax, %rdx
leaq 0x10360(%rip), %rdi     # 0x32530
movb $0x0, %al
callq 0x2050
movl -0x10(%rbp), %edi
callq 0x19c20
movq %rax, -0xe0(%rbp)
movq -0x40(%rbp), %rax
movl %eax, %edi
callq 0x19c20
movq -0xe0(%rbp), %rsi
movq %rax, %rdx
leaq 0x1038d(%rip), %rdi     # 0x3258f
movb $0x0, %al
callq 0x2050
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)