LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: RIPEMD160::computeRIPEMD160(void const*, unsigned int, unsigned char*)
void computeRIPEMD160(const void *_message,uint32_t length,uint8_t hashcode[20])
/*
 * returns RMD(message)
 * message should be a string terminated by '\0'
 */
{
	const uint8_t *message = (const uint8_t *)_message;
	uint32_t         MDbuf[RMDsize/32];   /* contains (A, B, C, D(, E))   */
	uint32_t         X[16];               /* current 16-word chunk        */

	/* initialize */
	MDinit(MDbuf);

	/* process message in 16-word chunks */
	for (uint32_t nbytes=length; nbytes > 63; nbytes-=64) 
	{
		for (uint32_t i=0; i<16; i++) 
		{
			X[i] = BYTES_TO_DWORD(message);
			message += 4;
		}
		compress(MDbuf, X);
	}	/* length mod 64 bytes left */

	/* finish: */
	MDfinish(MDbuf, message, length, 0);

	for (uint32_t i=0; i<RMDsize/8; i+=4) 
	{
		hashcode[i]   = (uint8_t)(MDbuf[i>>2]);         /* implicit cast to uint8_t  */
		hashcode[i+1] = (uint8_t)(MDbuf[i>>2] >>  8);  /*  extracts the 8 least  */
		hashcode[i+2] = (uint8_t)(MDbuf[i>>2] >> 16);  /*  significant bits.     */
		hashcode[i+3] = (uint8_t)(MDbuf[i>>2] >> 24);
	}

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %rbx
movl %esi, %edx
movq %rdi, %rsi
movaps 0x13121(%rip), %xmm0    # 0x17150
movaps %xmm0, -0x40(%rbp)
movl $0xc3d2e1f0, -0x30(%rbp) # imm = 0xC3D2E1F0
cmpl $0x40, %edx
jb 0x4086
leaq -0x80(%rbp), %r12
movl %edx, -0x2c(%rbp)
movl %edx, %r14d
movq %rsi, %r13
xorl %r15d, %r15d
movl (%r13,%r15), %eax
movl %eax, -0x80(%rbp,%r15)
addq $0x4, %r15
cmpq $0x40, %r15
jne 0x404f
leaq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0x2c1f
addl $-0x40, %r14d
leaq (%r15,%r13), %rsi
cmpl $0x3f, %r14d
ja 0x4049
addq %r15, %r13
movq %r13, %rsi
movl -0x2c(%rbp), %edx
leaq -0x40(%rbp), %rdi
xorl %ecx, %ecx
callq 0x3f49
movq $-0x4, %rax
movl -0x3c(%rbp,%rax), %ecx
movl %ecx, 0x4(%rbx,%rax)
addq $0x4, %rax
cmpq $0x10, %rax
jb 0x4098
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: SHA256::sha256_update(SHA256::sha256_ctx_t*, void const*, unsigned int)
void sha256_update(sha256_ctx_t * sc, const void *data, uint32_t len)
	{
		uint32_t bufferBytesLeft;
		uint32_t bytesToCopy;
		int needBurn = 0;

		if (sc->bufferLength) 
		{
			bufferBytesLeft = 64L - sc->bufferLength;
			bytesToCopy = bufferBytesLeft;
			if (bytesToCopy > len)
			{
				bytesToCopy = len;
			}
			memcpy(&sc->buffer.bytes[sc->bufferLength], data, bytesToCopy);
			sc->totalLength += bytesToCopy * 8L;
			sc->bufferLength += bytesToCopy;
			data = ((uint8_t *) data) + bytesToCopy;
			len -= bytesToCopy;
			if (sc->bufferLength == 64L) 
			{
				SHA256Guts(sc, sc->buffer.words);
				needBurn = 1;
				sc->bufferLength = 0L;
			}
		}

		while (len > 63L) 
		{
			sc->totalLength += 512L;

			SHA256Guts(sc, (const uint32_t *)data);
			needBurn = 1;

			data = ((uint8_t *) data) + 64L;
			len -= 64L;
		}

		if (len) 
		{
			memcpy(&sc->buffer.bytes[sc->bufferLength], data, len);
			sc->totalLength += len * 8L;
			sc->bufferLength += len;
		}

		if (needBurn)
		{
			burnStack(sizeof(uint32_t[74]) + sizeof(uint32_t *[6]) +  sizeof(int));
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movl 0x28(%rdi), %eax
testq %rax, %rax
je 0x4156
movl $0x40, %r12d
subl %eax, %r12d
cmpl %ebx, %r12d
cmovael %ebx, %r12d
leaq (%r14,%rax), %rdi
addq $0x2c, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2100
leaq (,%r12,8), %rax
addq %rax, (%r14)
movl %r12d, %eax
addl 0x28(%r14), %eax
subl %r12d, %ebx
movl %eax, 0x28(%r14)
addq %r12, %r15
cmpl $0x40, %eax
jne 0x4156
leaq 0x2c(%r14), %rsi
movq %r14, %rdi
callq 0x41ab
movl $0x0, 0x28(%r14)
cmpl $0x40, %ebx
jb 0x4179
addq $0x200, (%r14)          # imm = 0x200
movq %r14, %rdi
movq %r15, %rsi
callq 0x41ab
addq $0x40, %r15
addl $-0x40, %ebx
cmpl $0x3f, %ebx
ja 0x415b
testl %ebx, %ebx
je 0x41a2
movl %ebx, %r12d
movl 0x28(%r14), %eax
leaq (%r14,%rax), %rdi
addq $0x2c, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2100
shlq $0x3, %r12
addq %r12, (%r14)
addl %ebx, 0x28(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: SHA256::sha256_finalize(SHA256::sha256_ctx_t*, unsigned char*)
void sha256_finalize(sha256_ctx_t * sc, uint8_t hash[SHA256_HASH_SIZE])
	{
		uint32_t bytesToPad;
		uint64_t lengthPad;
		int i;

		bytesToPad = 120L - sc->bufferLength;
		if (bytesToPad > 64L)
		{
			bytesToPad -= 64L;
		}

		lengthPad = BYTESWAP64(sc->totalLength);

		sha256_update(sc, padding, bytesToPad);
		sha256_update(sc, &lengthPad, 8L);

		if (hash) 
		{
			for (i = 0; i < SHA256_HASH_WORDS; i++) 
			{
				*((uint32_t *) hash) = BYTESWAP(sc->hash[i]);
				hash += 4;
			}
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x28(%rdi), %eax
movl $0x78, %ecx
subl %eax, %ecx
movl $0x38, %edx
subl %eax, %edx
cmpl $0x41, %ecx
cmovbl %ecx, %edx
movq (%rdi), %rax
bswapq %rax
leaq -0x20(%rbp), %r15
movq %rax, (%r15)
leaq 0x115ea(%rip), %rsi     # 0x17260
callq 0x40e3
movq %r14, %rdi
movq %r15, %rsi
movl $0x8, %edx
callq 0x40e3
testq %rbx, %rbx
je 0x5ca5
xorl %eax, %eax
movl 0x8(%r14,%rax,4), %ecx
bswapl %ecx
movl %ecx, (%rbx,%rax,4)
incq %rax
cmpq $0x8, %rax
jne 0x5c92
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: SHA256::computeSHA256(void const*, unsigned int, unsigned char*)
void computeSHA256(const void *input,uint32_t size,uint8_t destHash[32])
	{
		sha256_ctx_t sc;
		sha256_init(&sc);
		sha256_update(&sc,input,size);
		sha256_finalize(&sc,destHash);
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rdx, %rbx
movl %esi, %edx
movq %rdi, %rsi
leaq -0x80(%rbp), %r14
movq $0x0, (%r14)
movaps 0x1148b(%rip), %xmm0    # 0x17160
movups %xmm0, 0x8(%r14)
movaps 0x1148f(%rip), %xmm0    # 0x17170
movups %xmm0, 0x18(%r14)
movl $0x0, 0x28(%r14)
movq %r14, %rdi
callq 0x40e3
movq %r14, %rdi
movq %rbx, %rsi
callq 0x5c3b
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: bitcoinPublicKeyToAddress(unsigned char const*, unsigned char*)
bool bitcoinPublicKeyToAddress(const uint8_t input[65], // The 65 bytes long ECDSA public key; first byte will always be 0x4 followed by two 32 byte components
							   uint8_t output[25])		// A bitcoin address (in binary( is always 25 bytes long.
{
	bool ret = false;

	if ( input[0] == 0x04)
	{
		uint8_t hash1[32]; // holds the intermediate SHA256 hash computations
		SHA256::computeSHA256(input,65,hash1);	// Compute the SHA256 hash of the input public ECSDA signature
		output[0] = 0;	// Store a network byte of 0 (i.e. 'main' network)
		RIPEMD160::computeRIPEMD160(hash1,32,&output[1]);	// Compute the RIPEMD160 (20 byte) hash of the SHA256 hash
		SHA256::computeSHA256(output,21,hash1);	// Compute the SHA256 hash of the RIPEMD16 hash + the one byte header (for a checksum)
		SHA256::computeSHA256(hash1,32,hash1); // now compute the SHA256 hash of the previously computed SHA256 hash (for a checksum)
		output[21] = hash1[0];	// Store the checksum in the last 4 bytes of the public key hash
		output[22] = hash1[1];
		output[23] = hash1[2];
		output[24] = hash1[3];
		ret = true;
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movb (%rdi), %r15b
cmpb $0x4, %r15b
jne 0x65be
movq %rsi, %rbx
leaq -0x40(%rbp), %r14
movl $0x41, %esi
movq %r14, %rdx
callq 0x5cb0
movb $0x0, (%rbx)
leaq 0x1(%rbx), %rdx
movq %r14, %rdi
movl $0x20, %esi
callq 0x400f
movq %rbx, %rdi
movl $0x15, %esi
movq %r14, %rdx
callq 0x5cb0
movq %r14, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0x5cb0
movb (%r14), %al
movb %al, 0x15(%rbx)
movb 0x1(%r14), %al
movb %al, 0x16(%rbx)
movb 0x2(%r14), %al
movb %al, 0x17(%rbx)
movb 0x3(%r14), %al
movb %al, 0x18(%rbx)
cmpb $0x4, %r15b
sete %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: bitcoinPublicKeyToAscii(unsigned char const*, char*, unsigned int)
bool bitcoinPublicKeyToAscii(const uint8_t input[65], // The 65 bytes long ECDSA public key; first byte will always be 0x4 followed by two 32 byte components
							 char *output,				// The output ascii representation.
							 uint32_t maxOutputLen) // convert a binary bitcoin address into ASCII
{
	bool ret = false;

	output[0] = 0;

	uint8_t hash2[25];

	if ( bitcoinPublicKeyToAddress(input,hash2))
	{
		ret = BASE58::encodeBase58(hash2,25,true,output,maxOutputLen);
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movl %edx, %ebx
movq %rsi, %r14
movb $0x0, (%rsi)
leaq -0x60(%rbp), %rsi
callq 0x6545
testb %al, %al
je 0x6654
movq $-0x19, %rax
leaq -0x48(%rbp), %rcx
movb (%rcx), %dl
movb %dl, -0x27(%rbp,%rax)
decq %rcx
incq %rax
jne 0x6600
leaq -0x157(%rbp), %r15
movl $0xe7, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x20b0
movaps -0x40(%rbp), %xmm0
movaps %xmm0, -0x19(%r15)
movups -0x37(%rbp), %xmm0
movups %xmm0, -0x10(%r15)
movl $0x19, 0xe7(%r15)
leaq -0x170(%rbp), %rdi
movq %r14, %rsi
movl %ebx, %edx
callq 0x6248
jmp 0x6656
xorl %eax, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: bitcoinAsciiToAddress(char const*, unsigned char*)
bool bitcoinAsciiToAddress(const char *input,uint8_t output[25]) // convert an ASCII bitcoin address into binary.
{
	bool ret = false;
	uint32_t len = BASE58::decodeBase58(input,output,25,true);
	if ( len == 25 ) // the output must be *exactly* 25 bytes!
	{
		uint8_t checksum[32];
		SHA256::computeSHA256(output,21,checksum);
		SHA256::computeSHA256(checksum,32,checksum);
		if ( output[21] == checksum[0] ||
			 output[22] == checksum[1] ||
			 output[23] == checksum[2] ||
			 output[24] == checksum[3] )
		{
			ret = true; // the cheksum matches!
		}
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movl $0x19, %edx
movl $0x1, %ecx
callq 0x6496
cmpl $0x19, %eax
jne 0x66ce
leaq -0x30(%rbp), %r14
movq %rbx, %rdi
movl $0x15, %esi
movq %r14, %rdx
callq 0x5cb0
movq %r14, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0x5cb0
movb 0x15(%rbx), %al
cmpb (%r14), %al
je 0x66ca
movb 0x16(%rbx), %al
cmpb -0x2f(%rbp), %al
je 0x66ca
movb 0x17(%rbx), %al
cmpb -0x2e(%rbp), %al
je 0x66ca
movb 0x18(%rbx), %al
cmpb -0x2d(%rbp), %al
jne 0x66ce
movb $0x1, %al
jmp 0x66d0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinAddress.cpp
// Function: bitcoinRIPEMD160ToAddress(unsigned char const*, unsigned char*)
void bitcoinRIPEMD160ToAddress(const uint8_t ripeMD160[20],uint8_t output[25])
{
	uint8_t hash1[32]; // holds the intermediate SHA256 hash computations
	output[0] = 0;	// Store a network byte of 0 (i.e. 'main' network)
	memcpy(&output[1],ripeMD160,20); // copy the 20 byte of the public key address
	SHA256::computeSHA256(output,21,hash1);	// Compute the SHA256 hash of the RIPEMD16 hash + the one byte header (for a checksum)
	SHA256::computeSHA256(hash1,32,hash1); // now compute the SHA256 hash of the previously computed SHA256 hash (for a checksum)
	output[21] = hash1[0];	// Store the checksum in the last 4 bytes of the public key hash
	output[22] = hash1[1];
	output[23] = hash1[2];
	output[24] = hash1[3];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movb $0x0, (%rsi)
movups (%rdi), %xmm0
movups %xmm0, 0x1(%rsi)
movl 0x10(%rdi), %eax
movl %eax, 0x11(%rsi)
leaq -0x30(%rbp), %r14
movq %rsi, %rdi
movl $0x15, %esi
movq %r14, %rdx
callq 0x5cb0
movq %r14, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0x5cb0
movb (%r14), %al
movb %al, 0x15(%rbx)
movb 0x1(%r14), %al
movb %al, 0x16(%rbx)
movb 0x2(%r14), %al
movb %al, 0x17(%rbx)
movb 0x3(%r14), %al
movb %al, 0x18(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BitcoinScript.cpp
// Function: BitcoinScriptImpl::Stack::push(unsigned char, unsigned char const*&)
void push(uint8_t size,const uint8_t *&script)
		{
			mStackElements[mStackIndex] = mStackPtr8;
			mStackSize[mStackIndex] = size;
			mStackIndex++;
			assert( mStackIndex < MAX_STACK_ELEMENTS );
			switch ( size )
			{
				case 0:
					// it is considered valid to push zero bytes onto the stack; essentially just increments the stack pointer
					break;
				case 1:
					*mStackPtr8++ = *script;	// copy one byte
					break;
				case 2:
					*mStackPtr16++ = *script; // copy two bytes
					break;
				case 4:
					*mStackPtr32++ = *script;	// copy 4 bytes
					break;
				case 8:
					*mStackPtr64++ = *script;	// copy 8 bytes
					break;
				default:
					memcpy(mStackPtr8,script,size);
					mStackPtr8+=size;
					break;
			}
			script+=size;	// advance the script intput instruction pointer.
			assert(mStackPtr8 < &mStack[MAX_STACK_SIZE]);	// assert that we have not had a stack overflow
		}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rdi
movl 0x808(%r14), %eax
movq %rdi, 0x810(%r14,%rax,8)
movb %sil, 0xa10(%r14,%rax)
incl %eax
movl %eax, 0x808(%r14)
cmpl $0x40, %eax
jae 0x73f8
movq %rdx, %rbx
leaq 0x808(%r14), %r12
movzbl %sil, %r15d
cmpb $0x8, %sil
ja 0x73a4
leaq 0x101e5(%rip), %rax     # 0x17570
movslq (%rax,%r15,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq (%rbx), %rax
movb (%rax), %al
leaq 0x1(%rdi), %rcx
movq %rcx, (%r14)
movb %al, (%rdi)
jmp 0x73e7
movq (%rbx), %rsi
movq %r15, %rdx
callq 0x2100
addq %r15, (%r14)
jmp 0x73e7
movq (%rbx), %rax
movzbl (%rax), %eax
leaq 0x2(%rdi), %rcx
movq %rcx, (%r14)
movw %ax, (%rdi)
jmp 0x73e7
movq (%rbx), %rax
movzbl (%rax), %eax
leaq 0x4(%rdi), %rcx
movq %rcx, (%r14)
movl %eax, (%rdi)
jmp 0x73e7
movq (%rbx), %rax
movzbl (%rax), %eax
leaq 0x8(%rdi), %rcx
movq %rcx, (%r14)
movq %rax, (%rdi)
addq %r15, (%rbx)
cmpq %r12, (%r14)
jae 0x7417
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1028c(%rip), %rdi     # 0x1768b
leaq 0x101b2(%rip), %rsi     # 0x175b8
leaq 0x1029f(%rip), %rcx     # 0x176ac
movl $0x97, %edx
callq 0x20c0
leaq 0x102cd(%rip), %rdi     # 0x176eb
leaq 0x10193(%rip), %rsi     # 0x175b8
leaq 0x10280(%rip), %rcx     # 0x176ac
movl $0xaf, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinPublicKeyToAddress(unsigned char const*, unsigned char*)
bool bitcoinPublicKeyToAddress(const uint8_t input[65], // The 65 bytes long ECDSA public key; first byte will always be 0x4 followed by two 32 byte components
							   uint8_t output[25])		// A bitcoin address (in binary( is always 25 bytes long.
{
	bool ret = false;

	if ( input[0] == 0x04)
	{
		uint8_t hash1[32]; // holds the intermediate SHA256 hash computations
		BLOCKCHAIN_SHA256::computeSHA256(input,65,hash1);	// Compute the SHA256 hash of the input public ECSDA signature
		output[0] = 0;	// Store a network byte of 0 (i.e. 'main' network)
		BLOCKCHAIN_RIPEMD160::computeRIPEMD160(hash1,32,&output[1]);	// Compute the RIPEMD160 (20 byte) hash of the SHA256 hash
		BLOCKCHAIN_SHA256::computeSHA256(output,21,hash1);	// Compute the SHA256 hash of the RIPEMD16 hash + the one byte header (for a checksum)
		BLOCKCHAIN_SHA256::computeSHA256(hash1,32,hash1); // now compute the SHA256 hash of the previously computed SHA256 hash (for a checksum)
		output[21] = hash1[0];	// Store the checksum in the last 4 bytes of the public key hash
		output[22] = hash1[1];
		output[23] = hash1[2];
		output[24] = hash1[3];
		ret = true;
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movb (%rdi), %r15b
cmpb $0x4, %r15b
jne 0xb0b2
movq %rsi, %rbx
leaq -0x40(%rbp), %r14
movl $0x41, %esi
movq %r14, %rdx
callq 0xa7a4
movb $0x0, (%rbx)
leaq 0x1(%rbx), %rdx
movq %r14, %rdi
movl $0x20, %esi
callq 0x8b03
movq %rbx, %rdi
movl $0x15, %esi
movq %r14, %rdx
callq 0xa7a4
movq %r14, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0xa7a4
movb (%r14), %al
movb %al, 0x15(%rbx)
movb 0x1(%r14), %al
movb %al, 0x16(%rbx)
movb 0x2(%r14), %al
movb %al, 0x17(%rbx)
movb 0x3(%r14), %al
movb %al, 0x18(%rbx)
cmpb $0x4, %r15b
sete %al
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinAsciiToAddress(char const*, unsigned char*)
bool bitcoinAsciiToAddress(const char *input,uint8_t output[25]) // convert an ASCII bitcoin address into binary.
{
	bool ret = false;
	uint32_t len = BLOCKCHAIN_BASE58::decodeBase58(input,output,25,true);
	if ( len == 25 ) // the output must be *exactly* 25 bytes!
	{
		uint8_t checksum[32];
		BLOCKCHAIN_SHA256::computeSHA256(output,21,checksum);
		BLOCKCHAIN_SHA256::computeSHA256(checksum,32,checksum);
		if ( output[21] == checksum[0] ||
			 output[22] == checksum[1] ||
			 output[23] == checksum[2] ||
			 output[24] == checksum[3] )
		{
			ret = true; // the cheksum matches!
		}
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movl $0x19, %edx
movl $0x1, %ecx
callq 0xaf8a
cmpl $0x19, %eax
jne 0xb1c2
leaq -0x30(%rbp), %r14
movq %rbx, %rdi
movl $0x15, %esi
movq %r14, %rdx
callq 0xa7a4
movq %r14, %rdi
movl $0x20, %esi
movq %r14, %rdx
callq 0xa7a4
movb 0x15(%rbx), %al
cmpb (%r14), %al
je 0xb1be
movb 0x16(%rbx), %al
cmpb -0x2f(%rbp), %al
je 0xb1be
movb 0x17(%rbx), %al
cmpb -0x2e(%rbp), %al
je 0xb1be
movb 0x18(%rbx), %al
cmpb -0x2d(%rbp), %al
jne 0xb1c2
movb $0x1, %al
jmp 0xb1c4
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: createBlockChain(char const*)
BlockChain *createBlockChain(const char *rootPath)
{
	BlockChainImpl *b = new BlockChainImpl(rootPath);
	if ( !b->isValid() )
	{
		delete b;
		b = NULL;
	}
	return static_cast<BlockChain *>(b);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x58472a0, %edi        # imm = 0x58472A0
callq 0x2170
movq %rax, %rbx
movq %rax, %rdi
movq %r14, %rsi
callq 0xb660
cmpq $0x0, 0x208(%rbx)
jne 0xb515
movq (%rbx), %rax
movq %rbx, %rdi
callq *0xa8(%rax)
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %r14
movl $0x58472a0, %esi        # imm = 0x58472A0
movq %rbx, %rdi
callq 0x2180
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: formatNumber(int)
static const char * formatNumber(int32_t number) // JWR  format this integer into a fancy comma delimited string
{
	char * dest = &gFormat[gIndex*MAXNUMERIC];
	gIndex++;
	if ( gIndex == MAXFNUM ) gIndex = 0;

	char scratch[512];

#ifdef _MSC_VER
	itoa(number,scratch,10);
#else
	snprintf(scratch, 10, "%d", number);
#endif

	char *source = scratch;
	char *str = dest;
	uint32_t len = (uint32_t)strlen(scratch);
	if ( scratch[0] == '-' )
	{
		*str++ = '-';
		source++;
		len--;
	}
	for (uint32_t i=0; i<len; i++)
	{
		int32_t place = (len-1)-i;
		*str++ = source[i];
		if ( place && (place%3) == 0 ) *str++ = ',';
	}
	*str = 0;

	return dest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movl %edi, %ecx
movslq 0x13ea4(%rip), %rax     # 0x1f3f0
leal 0x1(%rax), %edx
shlq $0x5, %rax
leaq 0x13c96(%rip), %rbx     # 0x1f1f0
addq %rax, %rbx
xorl %eax, %eax
cmpl $0x10, %edx
cmovel %eax, %edx
movl %edx, 0x13e85(%rip)     # 0x1f3f0
leaq 0xc588(%rip), %rdx      # 0x17afa
leaq -0x210(%rbp), %r14
movl $0xa, %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2280
movq %r14, %rdi
callq 0x2090
cmpb $0x2d, (%r14)
jne 0xb5a8
leaq 0x1(%rbx), %rcx
movb $0x2d, (%rbx)
leaq -0x20f(%rbp), %r14
decl %eax
jmp 0xb5ab
movq %rbx, %rcx
testl %eax, %eax
je 0xb601
movl %eax, %edx
decl %eax
xorl %esi, %esi
movl %eax, %r8d
movb (%r14,%rsi), %r9b
leaq 0x1(%rcx), %rdi
movb %r9b, (%rcx)
addl $-0x1, %eax
jae 0xb5f4
movslq %r8d, %r8
imulq $0x55555556, %r8, %r9   # imm = 0x55555556
movq %r9, %r10
shrq $0x3f, %r10
shrq $0x20, %r9
addl %r10d, %r9d
leal (%r9,%r9,2), %r9d
subl %r9d, %r8d
jne 0xb5f4
movb $0x2c, 0x1(%rcx)
addq $0x2, %rcx
movq %rcx, %rdi
incq %rsi
movq %rdi, %rcx
cmpq %rsi, %rdx
jne 0xb5b5
jmp 0xb604
movq %rcx, %rdi
movb $0x0, (%rdi)
movq %rbx, %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: getTimeString(unsigned int)
static const char *getTimeString(uint32_t timeStamp)
{
	if ( timeStamp == 0 )
	{
		return "NEVER";
	}
	static char scratch[1024];
	time_t t(timeStamp);
	struct tm *gtm = gmtime(&t);
	strftime(scratch, 1024, "%m/%d/%Y %H:%M:%S", gtm);
	return scratch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testl %edi, %edi
je 0xb64e
movl %edi, %eax
leaq -0x10(%rbp), %rdi
movq %rax, (%rdi)
callq 0x2110
leaq 0x13dcb(%rip), %rbx     # 0x1f400
leaq 0xc742(%rip), %rdx      # 0x17d7e
movl $0x400, %esi            # imm = 0x400
movq %rbx, %rdi
movq %rax, %rcx
callq 0x20f0
jmp 0xb655
leaq 0xc723(%rip), %rbx      # 0x17d78
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::BlockChainImpl(char const*)
BlockChainImpl(const char *rootPath)
	{
		sprintf(mRootDir,"%s",rootPath);
		mCurrentBlockData = mBlockDataBuffer;	// scratch buffers to read in up to 3 block.
		mTransactionCount = 0;
		mBlockIndex = 0;
		mBlockBase = 0;
		mReadCount = 0;
		for (uint32_t i=0; i<MAX_BLOCK_FILES; i++)
		{
			mBlockChain[i] = NULL;
		}
		mBlockCount = 0;
		mScanCount = 0;
		mBlockHeaders = NULL;
		mLastBlockHeaderCount = 0;
		mLastBlockHeader = NULL;
		mTotalInputCount = 0;
		mTotalOutputCount = 0;
		mTotalTransactionCount = 0;
		openBlock();	// open the input file
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x13468(%rip), %rax     # 0x1eae0
movq %rax, (%rdi)
xorl %eax, %eax
movq %rax, 0x1268(%rdi)
movl $0x0, 0x1264(%rdi)
movq %rax, 0x12b0(%rdi)
movl $0x1328, %eax           # imm = 0x1328
xorps %xmm0, %xmm0
movq $0x0, -0x38(%rbx,%rax)
movl $0x0, (%rbx,%rax)
movups %xmm0, -0x4c(%rbx,%rax)
addq $0x58, %rax
cmpq $0xb1328, %rax          # imm = 0xB1328
jne 0xb69d
movl $0xb12e8, %eax          # imm = 0xB12E8
movl $0x0, -0x4(%rbx,%rax)
movq $0x0, (%rbx,%rax)
addq $0x20, %rax
cmpq $0x1b12e8, %rax         # imm = 0x1B12E8
jne 0xb6c3
movl $0x1b12f0, %eax         # imm = 0x1B12F0
movl $0x0, -0x10(%rbx,%rax)
movq $0x0, -0x8(%rbx,%rax)
movb $0x0, (%rbx,%rax)
addq $0x28, %rax
cmpq $0x2f12f0, %rax         # imm = 0x2F12F0
jne 0xb6e4
leaq 0x16f12f0(%rbx), %rdi
xorl %r12d, %r12d
movq %r12, 0x36f12f8(%rbx)
movl $0x2000004, %edx        # imm = 0x2000004
xorl %esi, %esi
callq 0x20b0
leaq 0x36f1328(%rbx), %rdi
movq %r12, 0x3771330(%rbx)
movl $0x80004, %edx          # imm = 0x80004
xorl %esi, %esi
callq 0x20b0
leaq 0x3771338(%rbx), %r15
movq %r15, %rdi
callq 0xb7f4
leaq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x2140
leaq 0x2f12e8(%rbx), %rax
movq %rax, 0x2f12e0(%rbx)
movl %r12d, 0x16f12e8(%rbx)
movl %r12d, 0x1238(%rbx)
movl %r12d, 0x2f12d8(%rbx)
leaq 0x208(%rbx), %rdi
movl $0x1004, %edx           # imm = 0x1004
xorl %esi, %esi
callq 0x20b0
xorps %xmm0, %xmm0
movups %xmm0, 0x36f1300(%rbx)
movups %xmm0, 0x36f1310(%rbx)
movq $0x0, 0x36f1320(%rbx)
movq %rbx, %rdi
callq 0xbacc
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %r15, %rdi
callq 0xbbca
jmp 0xb7ca
movq %rax, %r14
movq 0x3771330(%rbx), %rdi
testq %rdi, %rdi
je 0xb7db
callq 0x2200
movq 0x36f12f8(%rbx), %rdi
testq %rdi, %rdi
je 0xb7ec
callq 0x2200
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::openBlock()
bool openBlock(void)
	{
		bool ret = false;

		char scratch[512];
#ifdef _MSC_VER
		sprintf(scratch,"%s\\blk%05d.dat", mRootDir, mBlockIndex );	// get the filename
#else
		sprintf(scratch,"%s/blk%05d.dat", mRootDir, mBlockIndex );	// get the filename
#endif
		FILE *fph = fopen(scratch,"rb");
		if ( fph )
		{
			fseek(fph,0L,SEEK_END);
			mFileLength = ftell(fph);
			fseek(fph,0L,SEEK_SET);
			mBlockChain[mBlockIndex] = fph;
			ret = true;
			printf("Successfully opened block-chain input file '%s'\r\n", scratch );
		}
		else
		{
			printf("Failed to open block-chain input file '%s'\r\n", scratch );
		}
		if ( mBlockHeaderMap.size() )
		{
			printf("Scanned %s block headers so far, %s since last time.\r\n", formatNumber(mBlockHeaderMap.size()), formatNumber(mBlockHeaderMap.size()-mLastBlockHeaderCount));
		}

		mLastBlockHeaderCount = mBlockHeaderMap.size();

		return ret;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
leaq 0x8(%rdi), %rdx
movl 0x1208(%rdi), %ecx
leaq 0xbf62(%rip), %rsi      # 0x17a52
xorl %r15d, %r15d
leaq -0x220(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2060
leaq 0xbf56(%rip), %rsi      # 0x17a61
movq %r14, %rdi
callq 0x21b0
movq %rax, %r14
testq %rax, %rax
je 0xbb5c
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2190
movq %r14, %rdi
callq 0x2030
movq %rax, 0x1210(%rbx)
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2190
movl 0x1208(%rbx), %eax
movq %r14, 0x208(%rbx,%rax,8)
leaq 0xbf0a(%rip), %rdi      # 0x17a64
jmp 0xbb63
leaq 0xbf33(%rip), %rdi      # 0x17a96
leaq -0x220(%rbp), %rsi
xorl %eax, %eax
callq 0x2050
movl 0x3771328(%rbx), %edi
testl %edi, %edi
je 0xbbaf
callq 0xb535
movq %rax, %r15
movl 0x3771328(%rbx), %edi
subl 0x36f1300(%rbx), %edi
callq 0xb535
leaq 0xbf28(%rip), %rdi      # 0x17ac3
movq %r15, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2050
movl 0x3771328(%rbx), %r15d
testq %r14, %r14
setne %al
movl %r15d, 0x36f1300(%rbx)
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::~BitcoinTransactionFactory()
~BitcoinTransactionFactory(void)
	{
		delete []mBlocks;
		delete []mTransactions;
		delete []mInputs;
		delete []mOutputs;
		delete []mTransactionReferences;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x2000040(%rdi), %rdi
testq %rdi, %rdi
je 0xbbe8
callq 0x2200
movq 0x2000020(%rbx), %rdi
testq %rdi, %rdi
je 0xbbf9
callq 0x2200
movq 0x2000028(%rbx), %rdi
testq %rdi, %rdi
je 0xbc0a
callq 0x2200
movq 0x2000030(%rbx), %rdi
testq %rdi, %rdi
je 0xbc1b
callq 0x2200
movq 0x2000048(%rbx), %rdi
testq %rdi, %rdi
je 0xbc2c
callq 0x2200
leaq 0x20d5ca8(%rbx), %r14
xorl %r15d, %r15d
leaq (%r14,%r15), %rdi
callq 0xcede
addq $-0x190, %r15           # imm = 0xFE70
cmpq $-0xd5de0, %r15         # imm = 0xFFF2A220
jne 0xbc36
movq 0x2000008(%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0xbc6a
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2200
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::printBlockHeaders()
virtual void printBlockHeaders(void) 
	{
		for (uint32_t i=0; i<mBlockCount; i++)
		{
			BlockHeader &h = *mBlockHeaders[i];
			printf("Block #%d : prevBlockHash:", i );
			printReverseHash(h.mPreviousBlockHash);
			printf("\r\n");
		}
	}

// Assembly:
cmpl $0x0, 0x36f1314(%rdi)
je 0xbd04
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xbb32(%rip), %r15      # 0x177d1
xorl %r13d, %r13d
movq 0x36f1320(%rbx), %rax
movq (%rax,%r13,8), %r14
leaq 0xbe49(%rip), %rdi      # 0x17afd
movl %r13d, %esi
xorl %eax, %eax
callq 0x2050
movl $0x4b, %r12d
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2050
decq %r12
cmpq $0x2b, %r12
jne 0xbcc4
leaq 0xdd8b(%rip), %rdi      # 0x19a6e
callq 0x2260
incq %r13
movl 0x36f1314(%rbx), %eax
cmpq %rax, %r13
jb 0xbca2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::reportCounts()
virtual void reportCounts(void)
	{
		printf("Total Blocks: %s\r\n", formatNumber(mBlockCount) );
		printf("Total Transactions: %s\r\n", formatNumber(mTotalTransactionCount));
		printf("Total Inputs: %s\r\n", formatNumber(mTotalInputCount));
		printf("Total Outputs: %s\r\n", formatNumber(mTotalOutputCount));
		mTransactionFactory.reportCounts();
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x36f1314(%rdi), %edi
callq 0xb535
leaq 0xc334(%rip), %rdi      # 0x18c39
movq %rax, %rsi
xorl %eax, %eax
callq 0x2050
movl 0x36f1304(%rbx), %edi
callq 0xb535
leaq 0xc32b(%rip), %rdi      # 0x18c4c
movq %rax, %rsi
xorl %eax, %eax
callq 0x2050
movl 0x36f1308(%rbx), %edi
callq 0xb535
leaq 0xc328(%rip), %rdi      # 0x18c65
movq %rax, %rsi
xorl %eax, %eax
callq 0x2050
movl 0x36f130c(%rbx), %edi
callq 0xb535
leaq 0xc31f(%rip), %rdi      # 0x18c78
movq %rax, %rsi
xorl %eax, %eax
callq 0x2050
addq $0x3771338, %rbx        # imm = 0x3771338
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0xfff2
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::~BlockChainImpl()
virtual ~BlockChainImpl(void)
	{
		for (uint32_t i=0; i<mBlockIndex; i++)
		{
			if ( mBlockChain[i] )
			{
				fclose(mBlockChain[i]);	// close the block-chain file pointer
			}
		}
		delete []mBlockHeaders;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x11ea3(%rip), %rax     # 0x1eae0
movq %rax, (%rdi)
movl 0x1208(%rdi), %eax
testl %eax, %eax
je 0xcc6f
xorl %r14d, %r14d
movq 0x208(%rbx,%r14,8), %rdi
testq %rdi, %rdi
je 0xcc65
callq 0x2160
movl 0x1208(%rbx), %eax
incq %r14
movl %eax, %ecx
cmpq %rcx, %r14
jb 0xcc4d
movq 0x36f1320(%rbx), %rdi
testq %rdi, %rdi
je 0xcc80
callq 0x2200
leaq 0x3771338(%rbx), %rdi
callq 0xbbca
movq 0x3771330(%rbx), %rdi
testq %rdi, %rdi
je 0xcc9d
callq 0x2200
movq 0x36f12f8(%rbx), %rdi
testq %rdi, %rdi
je 0xccb2
popq %rbx
popq %r14
popq %rbp
jmp 0x2200
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::processSingleBlock(void const*, unsigned int)
virtual const Block * processSingleBlock(const void *blockData,uint32_t blockLength) 
	{
		const Block *ret = NULL;
		if ( blockLength < MAX_BLOCK_SIZE )
		{
			mSingleBlock.blockIndex = 0;
			mSingleBlock.blockReward = 0;
			mSingleBlock.totalInputCount = 0;
			mSingleBlock.totalOutputCount = 0;
			mSingleBlock.fileIndex = 0;
			mSingleBlock.fileOffset =  0;
			uint32_t transactionIndex=0;
			mSingleBlock.processBlockData(blockData,blockLength,transactionIndex);
			ret = static_cast< Block *>(&mSingleBlock);
		}
		return ret;
	}

// Assembly:
xorl %eax, %eax
cmpl $0x9fffff, %edx         # imm = 0x9FFFFF
ja 0xce61
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x1240(%rdi), %rbx
movq $0x0, 0x12a8(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x1290(%rdi)
movl %eax, 0x12a0(%rdi)
leaq -0xc(%rbp), %rcx
movl %eax, (%rcx)
movq %rbx, %rdi
callq 0x10f02
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: StatRow::~StatRow()
~StatRow(void)
	{
		delete []mAddresses;
		delete []mNewAddresses;
		delete []mChangedAddresses;
		delete []mDeletedAddresses;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x158(%rdi), %rdi
testq %rdi, %rdi
je 0xcef8
callq 0x2200
movq 0x178(%rbx), %rdi
testq %rdi, %rdi
je 0xcf09
callq 0x2200
movq 0x180(%rbx), %rdi
testq %rdi, %rdi
je 0xcf1a
callq 0x2200
movq 0x188(%rbx), %rdi
addq $0x8, %rsp
testq %rdi, %rdi
je 0xcf31
popq %rbx
popq %rbp
jmp 0x2200
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BlockChainImpl::printReverseHash(unsigned char const*)
void printReverseHash(const uint8_t *hash)
	{
		if ( hash )
		{
			for (uint32_t i=0; i<32; i++)
			{
				printf("%02x", hash[31-i] );
			}
		}
		else
		{
			printf("NULL HASH");
		}
	}

// Assembly:
testq %rsi, %rsi
je 0xcf73
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl $0x20, %r15d
leaq 0xa87e(%rip), %r14      # 0x177d1
movzbl -0x1(%rbx,%r15), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2050
decq %r15
jne 0xcf53
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0xab9e(%rip), %rdi      # 0x17b18
xorl %eax, %eax
jmp 0x2050
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::getTransactions(unsigned int)
Transaction *getTransactions(uint32_t count)
	{
		init();
		Transaction *ret = NULL;
		assert( (mTransactionCount+count) < MAX_TOTAL_TRANSACTIONS );
		if ( (mTransactionCount+count) < MAX_TOTAL_TRANSACTIONS ) 
		{
			ret = &mTransactions[mTransactionCount];
			mTransactionCount+=count;
		}
		return ret;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
callq 0xd1f8
movl 0x2000010(%rbx), %eax
addl %eax, %r14d
cmpl $0x2625a00, %r14d       # imm = 0x2625A00
jae 0xcfbd
movl %r14d, 0x2000010(%rbx)
shlq $0x5, %rax
addq 0x2000020(%rbx), %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xaed3(%rip), %rdi      # 0x17e97
leaq 0xa825(%rip), %rsi      # 0x177f0
leaq 0xaef8(%rip), %rcx      # 0x17eca
movl $0xbd2, %edx            # imm = 0xBD2
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::getAddress(unsigned char const*, unsigned int&)
BitcoinAddress * getAddress(const uint8_t from[20],uint32_t &adr)
	{
		BitcoinAddress *ret = NULL;

		BitcoinAddress h(from);
		ret = mAddresses.find(h);

		if ( ret == NULL )
		{
			ret = mAddresses.insert(h);
		}
		if ( ret )
		{
			adr = mAddresses.getIndex(ret) + 1;
		}
		return ret;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq (%rsi), %r12
movq 0x8(%rsi), %r13
movl 0x10(%rsi), %ebx
movq %r13, %rax
xorq %r12, %rax
shrq $0x20, %rax
movl %r13d, %r15d
xorl %r12d, %r15d
xorl %ebx, %r15d
xorl %eax, %r15d
andl $0x3fffff, %r15d        # imm = 0x3FFFFF
movq (%rdi,%r15,8), %rax
testq %rax, %rax
je 0xd037
cmpq %r12, (%rax)
jne 0xd031
cmpq %r13, 0x8(%rax)
jne 0xd031
cmpl %ebx, 0x10(%rax)
je 0xd10a
movq 0x48(%rax), %rax
jmp 0xd018
movq 0x2000008(%rdi), %rax
testq %rax, %rax
jne 0xd0a4
movq %rdi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movl $0xbebc2000, %r14d      # imm = 0xBEBC2000
movl $0xbebc2000, %edi       # imm = 0xBEBC2000
callq 0x2040
xorl %ecx, %ecx
xorps %xmm0, %xmm0
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
xorl %esi, %esi
movl %ecx, 0x3c(%rax,%rsi)
movups %xmm0, (%rax,%rsi)
movl %ecx, 0x10(%rax,%rsi)
movups %xmm0, 0x14(%rax,%rsi)
movups %xmm0, 0x24(%rax,%rsi)
movq %rdx, 0x34(%rax,%rsi)
movups %xmm0, 0x40(%rax,%rsi)
addq $0x50, %rsi
cmpq %rsi, %r14
jne 0xd06c
movq -0x30(%rbp), %rdi
movq %rax, 0x2000008(%rdi)
movq -0x38(%rbp), %rdx
movl 0x2000000(%rdi), %ecx
cmpq $0x26259ff, %rcx        # imm = 0x26259FF
ja 0xd131
leaq (%rcx,%rcx,4), %rcx
shlq $0x4, %rcx
movq %r12, (%rax,%rcx)
movq %r13, 0x8(%rax,%rcx)
movl %ebx, 0x10(%rax,%rcx)
xorps %xmm0, %xmm0
movups %xmm0, 0x14(%rax,%rcx)
movups %xmm0, 0x24(%rax,%rcx)
movl $0x0, 0x34(%rax,%rcx)
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movq %rsi, 0x38(%rax,%rcx)
movq $0x0, 0x40(%rax,%rcx)
incl 0x2000000(%rdi)
addq %rcx, %rax
movq (%rdi,%r15,8), %rcx
movq %rax, (%rdi,%r15,8)
testq %rcx, %rcx
je 0xd10a
movq %rcx, 0x48(%rax)
movq %rax, %rcx
subq 0x2000008(%rdi), %rcx
shrq $0x4, %rcx
imull $0xcccccccd, %ecx, %ecx # imm = 0xCCCCCCCD
incl %ecx
movl %ecx, (%rdx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xac38(%rip), %rdi      # 0x17d70
leaq 0xa6b1(%rip), %rsi      # 0x177f0
leaq 0xaefc(%rip), %rcx      # 0x18042
movl $0x175, %edx            # imm = 0x175
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::getSingleTransaction(unsigned int)
Transaction * getSingleTransaction(uint32_t index)
	{
		Transaction *ret = NULL;
		assert( index < MAX_TOTAL_TRANSACTIONS );
		assert( index < mTransactionCount );
		if ( index < mTransactionCount )
		{
			ret = &mTransactions[index];
		}
		return ret;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cmpl $0x2625a00, %esi        # imm = 0x2625A00
jae 0xd173
cmpl %esi, 0x2000010(%rdi)
jbe 0xd192
movl %esi, %eax
shlq $0x5, %rax
addq 0x2000020(%rdi), %rax
popq %rbp
retq
leaq 0xaffe(%rip), %rdi      # 0x18178
leaq 0xa66f(%rip), %rsi      # 0x177f0
leaq 0xb00f(%rip), %rcx      # 0x18197
movl $0xbc4, %edx            # imm = 0xBC4
callq 0x20c0
leaq 0xb045(%rip), %rdi      # 0x181de
leaq 0xa650(%rip), %rsi      # 0x177f0
leaq 0xaff0(%rip), %rcx      # 0x18197
movl $0xbc5, %edx            # imm = 0xBC5
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::getAddress(unsigned int)
BitcoinAddress *getAddress(uint32_t a)
	{
		BitcoinAddress *ret = NULL;
		if ( a )
		{
			ret = mAddresses.getKey(a-1);
		}
		return ret;
	}

// Assembly:
testl %esi, %esi
je 0xd1d2
decl %esi
cmpl %esi, 0x2000000(%rdi)
jbe 0xd1d5
movl %esi, %eax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
addq 0x2000008(%rdi), %rax
retq
xorl %eax, %eax
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xb018(%rip), %rdi      # 0x181f8
leaq 0xa609(%rip), %rsi      # 0x177f0
leaq 0xb01e(%rip), %rcx      # 0x1820c
movl $0x143, %edx            # imm = 0x143
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::init()
void init(void)
	{
		if ( mTransactions == NULL )
		{
			mTransactions = new Transaction[MAX_TOTAL_TRANSACTIONS];
			mInputs = new TransactionInput[MAX_TOTAL_INPUTS];
			mOutputs = new TransactionOutput[MAX_TOTAL_OUTPUTS];
			mBlocks = new Transaction *[MAX_TOTAL_BLOCKS];
		}
	}

// Assembly:
cmpq $0x0, 0x2000020(%rdi)
je 0xd203
retq
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x4c4b4000, %edi       # imm = 0x4C4B4000
callq 0x2040
movl $0x8, %ecx
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%rcx)
addq $0x20, %rcx
cmpq $0x4c4b4008, %rcx       # imm = 0x4C4B4008
jne 0xd21f
movq %rax, 0x2000020(%rbx)
movl $0x2faf0800, %edi       # imm = 0x2FAF0800
callq 0x2040
movq %rax, %r14
movl $0x2faf0800, %edx       # imm = 0x2FAF0800
movq %rax, %rdi
xorl %esi, %esi
callq 0x20b0
movq %r14, 0x2000028(%rbx)
movl $0x5f5e1000, %edi       # imm = 0x5F5E1000
callq 0x2040
movl $0x8, %ecx
movq $0x0, -0x8(%rax,%rcx)
movl $0x0, (%rax,%rcx)
addq $0x10, %rcx
cmpq $0x5f5e1008, %rcx       # imm = 0x5F5E1008
jne 0xd269
movq %rax, 0x2000030(%rbx)
movl $0x3d0900, %edi         # imm = 0x3D0900
callq 0x2040
movq %rax, 0x2000040(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::printAddress(BitcoinAddress*)
void printAddress(BitcoinAddress *ba)
	{
		uint32_t i = mAddresses.getIndex(ba);
		printf("========================================\r\n");
		printf("PublicKey: %s[%d] has %s transactions associated with it.\r\n", getKey(i+1),i+1, formatNumber(ba->mTransactionCount) );
		printf("Balance: %0.4f : TotalReceived: %0.4f TotalSpent: %0.4f\r\n", (float) (ba->mTotalReceived-ba->mTotalSent)/ONE_BTC, (float)ba->mTotalReceived / ONE_BTC, (float) ba->mTotalSent / ONE_BTC );
		if ( ba->mLastInputTime )
		{
			printf("Last Input Time: %s\r\n", getTimeString(ba->mLastInputTime) );
		}
		if ( ba->mLastOutputTime )
		{
			printf("Last Output Time: %s\r\n", getTimeString(ba->mLastOutputTime) );
		}
		for (uint32_t j=0; j<ba->mTransactionCount; j++)
		{
			printTransaction(j,ba->mTransactions[j],i+1);
		}
		printf("========================================\r\n");
		printf("\r\n");
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rsi, %rsi
je 0xdfe2
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
subq 0x2000008(%rdi), %rax
shrq $0x4, %rax
imull $0xcccccccd, %eax, %r15d # imm = 0xCCCCCCCD
leaq 0xbabf(%rip), %rdi      # 0x19949
callq 0x2260
incl %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0xe002
movq %rax, %r12
movl 0x3c(%rbx), %edi
callq 0xb535
leaq 0xa4f3(%rip), %rdi      # 0x183a2
movq %r12, %rsi
movl %r15d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x2050
movq 0x20(%rbx), %rax
movq 0x28(%rbx), %rcx
movq %rcx, %rdx
subq %rax, %rdx
js 0xded6
cvtsi2ss %rdx, %xmm0
jmp 0xdeeb
movq %rdx, %rsi
shrq %rsi
andl $0x1, %edx
orq %rsi, %rdx
cvtsi2ss %rdx, %xmm0
addss %xmm0, %xmm0
movss 0x981d(%rip), %xmm2     # 0x17710
divss %xmm2, %xmm0
testq %rcx, %rcx
js 0xdf03
cvtsi2ss %rcx, %xmm1
jmp 0xdf18
movq %rcx, %rdx
shrq %rdx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm1
addss %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
divss %xmm2, %xmm1
cvtss2sd %xmm1, %xmm1
testq %rax, %rax
js 0xdf30
cvtsi2ss %rax, %xmm3
jmp 0xdf45
movq %rax, %rcx
shrq %rcx
andl $0x1, %eax
orq %rcx, %rax
cvtsi2ss %rax, %xmm3
addss %xmm3, %xmm3
divss %xmm2, %xmm3
xorps %xmm2, %xmm2
cvtss2sd %xmm3, %xmm2
leaq 0xa487(%rip), %rdi      # 0x183de
movb $0x3, %al
callq 0x2050
movl 0x14(%rbx), %edi
testl %edi, %edi
je 0xdf7b
callq 0xb616
leaq 0xa4a7(%rip), %rdi      # 0x18418
movq %rax, %rsi
xorl %eax, %eax
callq 0x2050
movl 0x18(%rbx), %edi
testl %edi, %edi
je 0xdf98
callq 0xb616
leaq 0xa4a0(%rip), %rdi      # 0x1842e
movq %rax, %rsi
xorl %eax, %eax
callq 0x2050
cmpl $0x0, 0x3c(%rbx)
je 0xdfc2
xorl %r12d, %r12d
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rdx
movq %r14, %rdi
movl %r12d, %esi
movl %r15d, %ecx
callq 0xe086
incq %r12
movl 0x3c(%rbx), %eax
cmpq %rax, %r12
jb 0xdfa1
leaq 0xb980(%rip), %rdi      # 0x19949
callq 0x2260
leaq 0xba99(%rip), %rdi      # 0x19a6e
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2260
leaq 0xc1ee(%rip), %rdi      # 0x1a1d7
leaq 0x9800(%rip), %rsi      # 0x177f0
leaq 0xa0e0(%rip), %rcx      # 0x180d7
movl $0x13b, %edx            # imm = 0x13B
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::getKey(unsigned int) const
const char *getKey(uint32_t a) const
	{
		static char scratch[256];
		const char *ret = "UNKNOWN ADDRESS";
		if ( a )
		{
			BitcoinAddress *ba = mAddresses.getKey(a-1);
			uint8_t address1[25];
			BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinRIPEMD160ToAddress((const uint8_t *)ba,address1);
			BLOCKCHAIN_BITCOIN_ADDRESS::bitcoinAddressToAscii(address1,scratch,256);
			ret = scratch;
		}
		return ret;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
testl %esi, %esi
je 0xe054
decl %esi
cmpl %esi, 0x2000000(%rdi)
jbe 0xe067
movl %esi, %eax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
addq 0x2000008(%rdi), %rax
leaq -0x30(%rbp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0xb1cd
leaq 0x117ce(%rip), %rbx     # 0x1f810
movq %r14, %rdi
movq %rbx, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0xb233
jmp 0xe05b
leaq 0xa3ea(%rip), %rbx      # 0x18445
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xa18a(%rip), %rdi      # 0x181f8
leaq 0x977b(%rip), %rsi      # 0x177f0
leaq 0xa190(%rip), %rcx      # 0x1820c
movl $0x143, %edx            # imm = 0x143
callq 0x20c0
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::printTransactions(unsigned int)
void printTransactions(uint32_t blockIndex)
	{
		uint32_t tcount;
		Transaction *t = getBlock(blockIndex,tcount);
		if ( t )
		{
			printf("===================================================\r\n");
			printf("Block #%s has %s transactions.\r\n", formatNumber(blockIndex), formatNumber(tcount) );
			for (uint32_t j=0; j<tcount; j++)
			{
				printTransaction(j,t,0);
				t++;
			}
			printf("===================================================\r\n");
			printf("\r\n");
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %r15d
movq %rdi, %rbx
leaq -0x24(%rbp), %rdx
callq 0xe400
testq %rax, %rax
je 0xe3f3
movq %rax, %r14
leaq 0xb5b5(%rip), %rdi      # 0x1993e
callq 0x2260
movl %r15d, %edi
callq 0xb535
movq %rax, %r12
movl -0x24(%rbp), %edi
callq 0xb535
leaq 0xa1b6(%rip), %rdi      # 0x1855e
xorl %r15d, %r15d
movq %r12, %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x2050
cmpl $0x0, -0x24(%rbp)
je 0xe3db
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0xe086
addq $0x20, %r14
incl %r15d
cmpl -0x24(%rbp), %r15d
jb 0xe3be
leaq 0xb55c(%rip), %rdi      # 0x1993e
callq 0x2260
leaq 0xb680(%rip), %rdi      # 0x19a6e
callq 0x2260
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinTransactionFactory::getBlock(unsigned int, unsigned int&) const
Transaction * getBlock(uint32_t index,uint32_t &tcount) const
	{
		Transaction *ret = NULL;
		assert( index < mBlockCount );
		if ( index < mBlockCount )
		{
			ret = mBlocks[index];
			if ( (index+1) == mBlockCount )
			{
				tcount = (uint32_t)(&mTransactions[mTransactionCount] - ret);
			}
			else
			{
				tcount = (uint32_t)(mBlocks[index+1] - ret);
			}
		}
		return ret;
	}

// Assembly:
movl 0x2000038(%rdi), %r8d
cmpl %esi, %r8d
jbe 0xe44a
movq 0x2000040(%rdi), %rcx
movl %esi, %eax
movq (%rcx,%rax,8), %rax
incl %esi
cmpl %r8d, %esi
jne 0xe43a
movl 0x2000010(%rdi), %ecx
shlq $0x5, %rcx
addq 0x2000020(%rdi), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
jmp 0xe447
movl %esi, %esi
movq (%rcx,%rsi,8), %rcx
subq %rax, %rcx
shrq $0x5, %rcx
movl %ecx, (%rdx)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0xa12a(%rip), %rdi      # 0x1857f
leaq 0x9394(%rip), %rsi      # 0x177f0
leaq 0xa130(%rip), %rcx      # 0x18593
movl $0xb9a, %edx            # imm = 0xB9A
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/jeffchan[P]blockchain-parser/BlockChain.cpp
// Function: BitcoinAddress::getDaysSinceLastUsed() const
uint32_t getDaysSinceLastUsed(void) const
	{
		time_t currentTime;
		time(&currentTime); // get the current time.
		uint32_t lastUsed = mLastInputTime; // the last time we sent money (not received because anyone can send us money).
		if ( mLastInputTime == 0 ) // if it has never had a spend.. then we use the time of first receive..
		{
			lastUsed = mFirstOutputTime;
		}
		double seconds = difftime(currentTime,time_t(lastUsed));
		double minutes = seconds/60;
		double hours = minutes/60;
		uint32_t days = (uint32_t) (hours/24);
		return days;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq -0x18(%rbp), %r14
movq %r14, %rdi
callq 0x2130
movl 0x14(%rbx), %esi
testl %esi, %esi
cmovel 0x1c(%rbx), %esi
movq (%r14), %rdi
callq 0x20a0
movsd 0x7841(%rip), %xmm1     # 0x177e0
divsd %xmm1, %xmm0
divsd %xmm1, %xmm0
divsd 0x7839(%rip), %xmm0     # 0x177e8
cvttsd2si %xmm0, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop