// File: jeffchan[P]blockchain-parser/main.cpp
// Function: BlockChainCommand::process()
bool process(void)
	{
		uint32_t argc;
		const char **argv = getInputString(argc);

		if ( argv )
		{
			if ( strcmp(argv[0],"scan") == 0 )
			{
				if ( mMode == CM_SCAN )
				{
					printf("Pausing block-chain scan at block #%d\r\n", mLastBlockScan );
					mMode = CM_NONE;
				}
				else
				{
					printf("Scanning block-chain re-started from block %d up to a maximum of %d blocks..\r\n", mLastBlockScan, mMaxBlock);
					mMode = CM_SCAN;
				}
			}
			else if ( strcmp(argv[0],"exit") == 0 ||  strcmp(argv[0],"bye") == 0 || strcmp(argv[0],"quit") == 0  )
			{
				mMode = CM_EXIT;
			}
			else if ( strcmp(argv[0],"stop_scan") == 0 )
			{
				if ( mFinishedScanning )
				{
					printf("Already finished scanning the block-chain headers.  Found %d blocks.\r\n", mLastBlockScan );
				}
				else
				{
					stopScanning();
				}
			}
			else if ( strcmp(argv[0],"help") == 0 )
			{
				help();
			}
			else if ( strcmp(argv[0],"max_blocks") == 0 )
			{
				if ( argc >= 2 )
				{
					mMaxBlock = atoi(argv[1]);
					if ( mMaxBlock < 1 ) mMaxBlock = 1;
					printf("Maximum block scan set to %d\r\n", mMaxBlock );
				}
			}
			else if ( strcmp(argv[0],"by_day") == 0 )
			{
				mStatResolution = SR_DAY;
				printf("Will accumulate statistics on a per-day basis.\r\n");
				if ( !mProcessTransactions )
				{
					printf("Note: You must enable 'statistics' for this to take effect.\r\n");
				}
			}
			else if ( strcmp(argv[0],"by_month") == 0 )
			{
				mStatResolution = SR_MONTH;
				printf("Will accumulate statistics on a monthly basis.\r\n");
				if ( !mProcessTransactions )
				{
					printf("Note: You must enable 'statistics' for this to take effect.\r\n");
				}
			}
			else if ( strcmp(argv[0],"by_year") == 0 )
			{
				mStatResolution = SR_YEAR;
				printf("Will accumulate statistics on an annual basis.\r\n");
				if ( !mProcessTransactions )
				{
					printf("Note: You must enable 'statistics' for this to take effect.\r\n");
				}
			}
			else if ( strcmp(argv[0],"record_addresses") == 0 )
			{
				mRecordAddresses = mRecordAddresses ? false : true;
				printf("record_addresses set to %s\r\n", mRecordAddresses ? "true" : "false");
			}
			else if ( strcmp(argv[0],"adr") == 0 )
			{
				if ( argc == 1 )
				{
					printf("You must supply an address to output.\r\n");
				}
				else
				{
					for (uint32_t i=1; i<argc; i++)
					{
						const char *adr = argv[i];
						mBlockChain->printAddress(adr);
					}
				}
			}
			else if ( strcmp(argv[0],"process") == 0 )
			{
				if ( mMode == CM_PROCESS )
				{
					printf("Pausing processing block-chain blocks at block #%d of %d\r\n", mProcessBlock, mBlockChain->getBlockCount() );
					mMode = CM_NONE;
				}
				else
				{
					if ( !mFinishedScanning )
					{
						stopScanning();
					}
					mProcessBlock = 0;
					mMode = CM_PROCESS;
					printf("Beginning processing of %d blocks : Gathering Statistics=%s\r\n", 
					mBlockChain->getBlockCount(), 
					mProcessTransactions ? "true":"false");
				}
			}
			else if ( strcmp(argv[0],"statistics") == 0 )
			{
				mProcessTransactions = mProcessTransactions ? false : true;
				if ( mProcessTransactions )
				{
					printf("Block Processing will gather statistics.\r\n");
					printf("*** WARNING : This will consume an enormous amount of memory! ***\r\n");
				}
				else
				{
					printf("Block processing will not gather statistics.\r\n");
				}
			}
			else if ( strcmp(argv[0],"load_record") == 0 )
			{
				if ( mAddresses )
				{
					mAddresses->release();
					mAddresses = NULL;
				}
				printf("Loading previously recorded addresses from file 'BlockChainAddresses.bin\r\n");
				mAddresses = createBlockChainAddresses("BlockChainAddresses.bin");
			}
			else if ( strcmp(argv[0],"min_balance") == 0 )
			{
				if ( argc == 1 )
				{
					printf("No minimum balance specified, defaulting to 1btc.\r\n");
				}
				else
				{
					mMinBalance = (uint32_t)atoi(argv[1]);
					if ( mMinBalance < 1 )
					{
						mMinBalance = 1;
					}
					else
					{
						if ( mMinBalance > 1000000 )
						{
							mMinBalance = 1000000;
						}
					}
					printf("Minimum balance set to %d bitcoins.\r\n", mMinBalance );
				}
			}
			else if ( strcmp(argv[0],"top_balance") == 0 )
			{
				uint32_t tcount = 100;
				if ( argc >= 2 )
				{
					tcount = atoi(argv[1]);
					if ( tcount < 1 )
					{
						tcount = 1;
					}
				}
				printf("Printing the most valuable %d bitcoin addresses with a balance of more than %d bitcoins.\r\n", tcount, mMinBalance );
				mBlockChain->printTopBalances(tcount,mMinBalance);
			}
			else if ( strcmp(argv[0],"oldest") == 0 )
			{
				uint32_t tcount = 100;
				if ( argc >= 2 )
				{
					tcount = atoi(argv[1]);
					if ( tcount < 1 )
					{
						tcount = 1;
					}
				}
				printf("Printing the %d oldest bitcoin addresses with a balance of more than %d bitcoins.\r\n", tcount, mMinBalance );
				mBlockChain->printOldest(tcount,mMinBalance);
			}
			else if ( strcmp(argv[0],"zombie") == 0 )
			{
				uint32_t zdays = 365;
				if ( argc >=2 )
				{
					zdays = atoi(argv[1]);
					if ( zdays < 1 )
					{
						zdays = 1;
					}
				}
				printf("Generating Zombie Count for addresses older than %d days with a balance of more than %d bitcoins.\r\n", zdays, mMinBalance );
				mBlockChain->zombieReport(zdays,mMinBalance);
			}
			else if ( strcmp(argv[0],"by_day") == 0 )
			{
				mStatResolution = SR_DAY;
				printf("Gathering statistics every day.\r\n");
			}
			else if ( strcmp(argv[0],"by_month") == 0 )
			{
				mStatResolution = SR_MONTH;
				printf("Gathering statistics every month.\r\n");
			}
			else if ( strcmp(argv[0],"by_year") == 0 )
			{
				mStatResolution = SR_YEAR;
				printf("Gathering statistics every year.\r\n");
			}
			else if ( strcmp(argv[0],"counts") == 0 )
			{
				mBlockChain->reportCounts();
			}
			else if ( strcmp(argv[0],"block") == 0 )
			{
				if ( argc == 1 )
				{
					if ( mCurrentBlock )
					{
						mBlockChain->printBlock(mCurrentBlock);
						mCurrentBlock = mBlockChain->readBlock(mCurrentBlock->blockIndex+1);
					}
				}
				else
				{
					for (uint32_t i=1; i<argc; i++)
					{
						uint32_t index = (uint32_t)atoi(argv[i]);
						mCurrentBlock = getBlock(index);
						if ( mCurrentBlock )
						{
							mBlockChain->printBlock(mCurrentBlock);
						}
					}
				}
			}
		}
		switch ( mMode )
		{
			case CM_PROCESS:
				if ( mProcessBlock < mBlockChain->getBlockCount() )
				{
					mCurrentBlock = mBlockChain->readBlock(mProcessBlock);
					if ( mCurrentBlock && mProcessTransactions )
					{

						if ( mLastTime == 0 )
						{
							mLastTime = mCurrentBlock->timeStamp;
							mSatoshiTime = mCurrentBlock->timeStamp;
						}
						else
						{
							uint32_t currentTime = mCurrentBlock->timeStamp;
							time_t tnow(currentTime);
							struct tm beg;
							beg = *localtime(&tnow);
							time_t tbefore(mLastTime);
							struct tm before;
							before = *localtime(&tbefore);
							bool getStats = false;
							switch ( mStatResolution )
							{
								case SR_DAY:
									if ( beg.tm_yday != before.tm_yday )
									{
										getStats = true;
									}
									break;
								case SR_MONTH:
									if ( beg.tm_mon != before.tm_mon )
									{
										getStats = true;
									}
									break;
								case SR_YEAR:
									if ( beg.tm_year != before.tm_year )
									{
										getStats = true;
									}
									break;
							}
							if ( getStats )
							{
								const char *months[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" };
								printf("Gathering statistics for %s %d, %d to %s %d, %d\r\n", 
									months[before.tm_mon], before.tm_mday, before.tm_year+1900,
									months[beg.tm_mon], beg.tm_mday, beg.tm_year+1900);
								mBlockChain->gatherStatistics(mLastTime,(uint32_t)zombieDate,mRecordAddresses);
								mLastTime = currentTime;
							}
						}
						mBlockChain->processTransactions(mCurrentBlock);  // process transactions into individual addresses
					}
					mProcessBlock++;
					if ( (mProcessBlock%10000) == 0 )
					{
						printf("Processed block #%d of %d total.\r\n", mProcessBlock, mBlockChain->getBlockCount() );
					}
				}
				else
				{
					printf("Finished processing all blocks in the blockchain.\r\n");
					mBlockChain->reportCounts();
					if ( mProcessTransactions )
					{
						printf("Gathering final statistics.\r\n");
						mBlockChain->gatherStatistics(mLastTime,(uint32_t)zombieDate,mRecordAddresses);
						printf("Saving statistics to file 'stats.csv\r\n");
						mBlockChain->saveStatistics(mRecordAddresses);
					}
					mMode = CM_NONE;
					mProcessBlock = 0;
				}
				break;
			case CM_SCAN:
				{
					bool ok = mBlockChain->readBlockHeaders(mMaxBlock,mLastBlockScan);
					if ( !ok )
					{
						mFinishedScanning = true;
						mMode = CM_NONE; // done scanning.
						mLastBlockScan = mBlockChain->buildBlockChain();
						printf("Finished scanning block headers. Built block-chain with %d blocks found..\r\n", mLastBlockScan);
						printf("To resolve transactions you must execute the 'process' command.\r\n");
						printf("To gather statistics so you can ouput balances of individual addresses, you must execute the 'statistics' command prior to running the process command.\r\n");
					}
				}
				break;
		}
		return mMode != CM_EXIT;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x160, %rsp            # imm = 0x160
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x140(%rbp)
leaq -0xc(%rbp), %rdi
callq 0x2e800
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2f5fc
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4deb(%rip), %rsi      # 0x33adb
callq 0x21f0
cmpl $0x0, %eax
jne 0x2ed5a
movq -0x140(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x2ed2d
movq -0x140(%rbp), %rax
movl 0x14(%rax), %esi
leaq 0x4d3a(%rip), %rdi      # 0x33a51
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movl $0x0, (%rax)
jmp 0x2ed55
movq -0x140(%rbp), %rax
movl 0x14(%rax), %esi
movl 0x10(%rax), %edx
leaq 0x4d38(%rip), %rdi      # 0x33a79
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movl $0x1, (%rax)
jmp 0x2f5fa
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4d60(%rip), %rsi      # 0x33ac8
callq 0x21f0
cmpl $0x0, %eax
je 0x2eda2
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4d4d(%rip), %rsi      # 0x33acd
callq 0x21f0
cmpl $0x0, %eax
je 0x2eda2
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4d39(%rip), %rsi      # 0x33ad1
callq 0x21f0
cmpl $0x0, %eax
jne 0x2edb4
movq -0x140(%rbp), %rax
movl $0x3, (%rax)
jmp 0x2f5f8
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4d14(%rip), %rsi      # 0x33ad6
callq 0x21f0
cmpl $0x0, %eax
jne 0x2ee04
movq -0x140(%rbp), %rax
testb $0x1, 0x5(%rax)
je 0x2edf3
movq -0x140(%rbp), %rax
movl 0x14(%rax), %esi
leaq 0x4cf6(%rip), %rdi      # 0x33ae0
movb $0x0, %al
callq 0x2050
jmp 0x2edff
movq -0x140(%rbp), %rdi
callq 0x2fbc0
jmp 0x2f5f6
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4d15(%rip), %rsi      # 0x33b27
callq 0x21f0
cmpl $0x0, %eax
jne 0x2ee2d
movq -0x140(%rbp), %rdi
callq 0x2fa70
jmp 0x2f5f4
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4cf1(%rip), %rsi      # 0x33b2c
callq 0x21f0
cmpl $0x0, %eax
jne 0x2ee95
cmpl $0x2, -0xc(%rbp)
jb 0x2ee90
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2230
movl %eax, %ecx
movq -0x140(%rbp), %rax
movl %ecx, 0x10(%rax)
cmpl $0x1, 0x10(%rax)
jae 0x2ee78
movq -0x140(%rbp), %rax
movl $0x1, 0x10(%rax)
movq -0x140(%rbp), %rax
movl 0x10(%rax), %esi
leaq 0x4cae(%rip), %rdi      # 0x33b37
movb $0x0, %al
callq 0x2050
jmp 0x2f5f2
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4cb3(%rip), %rsi      # 0x33b56
callq 0x21f0
cmpl $0x0, %eax
jne 0x2eee9
movq -0x140(%rbp), %rax
movl $0x0, 0x8(%rax)
leaq 0x4c9b(%rip), %rdi      # 0x33b5d
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
testb $0x1, 0x6(%rax)
jne 0x2eee4
leaq 0x4cb1(%rip), %rdi      # 0x33b8e
movb $0x0, %al
callq 0x2050
jmp 0x2f5f0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4cd5(%rip), %rsi      # 0x33bcc
callq 0x21f0
cmpl $0x0, %eax
jne 0x2ef3d
movq -0x140(%rbp), %rax
movl $0x1, 0x8(%rax)
leaq 0x4cbf(%rip), %rdi      # 0x33bd5
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
testb $0x1, 0x6(%rax)
jne 0x2ef38
leaq 0x4c5d(%rip), %rdi      # 0x33b8e
movb $0x0, %al
callq 0x2050
jmp 0x2f5ee
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4cbb(%rip), %rsi      # 0x33c06
callq 0x21f0
cmpl $0x0, %eax
jne 0x2ef91
movq -0x140(%rbp), %rax
movl $0x2, 0x8(%rax)
leaq 0x4ca4(%rip), %rdi      # 0x33c0e
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
testb $0x1, 0x6(%rax)
jne 0x2ef8c
leaq 0x4c09(%rip), %rdi      # 0x33b8e
movb $0x0, %al
callq 0x2050
jmp 0x2f5ec
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4ca0(%rip), %rsi      # 0x33c3f
callq 0x21f0
cmpl $0x0, %eax
jne 0x2efe9
movq -0x140(%rbp), %rax
movb 0x4(%rax), %cl
andb $0x1, %cl
decb %cl
andb $0x1, %cl
movb %cl, 0x4(%rax)
movb 0x4(%rax), %cl
leaq 0x4caa(%rip), %rsi      # 0x33c72
leaq 0x4c9e(%rip), %rax      # 0x33c6d
testb $0x1, %cl
cmovneq %rax, %rsi
leaq 0x4c73(%rip), %rdi      # 0x33c50
movb $0x0, %al
callq 0x2050
jmp 0x2f5ea
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4c81(%rip), %rsi      # 0x33c78
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f05c
cmpl $0x1, -0xc(%rbp)
jne 0x2f017
leaq 0x4c6e(%rip), %rdi      # 0x33c7c
movb $0x0, %al
callq 0x2050
jmp 0x2f057
movl $0x1, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x2f055
movq -0x140(%rbp), %rax
movq -0x18(%rbp), %rcx
movl -0x1c(%rbp), %edx
movq (%rcx,%rdx,8), %rcx
movq %rcx, -0x28(%rbp)
movq 0x28(%rax), %rdi
movq -0x28(%rbp), %rsi
movq (%rdi), %rax
callq *0x78(%rax)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2f01e
jmp 0x2f057
jmp 0x2f5e8
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4c3a(%rip), %rsi      # 0x33ca4
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f12c
movq -0x140(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x2f0c2
movq -0x140(%rbp), %rax
movl 0xc(%rax), %ecx
movl %ecx, -0x144(%rbp)
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movl -0x144(%rbp), %esi
movl %eax, %edx
leaq 0x4c00(%rip), %rdi      # 0x33cac
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movl $0x0, (%rax)
jmp 0x2f127
movq -0x140(%rbp), %rax
testb $0x1, 0x5(%rax)
jne 0x2f0db
movq -0x140(%rbp), %rdi
callq 0x2fbc0
movq -0x140(%rbp), %rax
movl $0x0, 0xc(%rax)
movl $0x2, (%rax)
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movl %eax, %esi
movq -0x140(%rbp), %rax
movb 0x6(%rax), %cl
leaq 0x4b67(%rip), %rdx      # 0x33c72
leaq 0x4b5b(%rip), %rax      # 0x33c6d
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x4bc7(%rip), %rdi      # 0x33ce7
movb $0x0, %al
callq 0x2050
jmp 0x2f5e6
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4beb(%rip), %rsi      # 0x33d25
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f190
movq -0x140(%rbp), %rax
movb 0x6(%rax), %cl
andb $0x1, %cl
decb %cl
andb $0x1, %cl
movb %cl, 0x6(%rax)
testb $0x1, 0x6(%rax)
je 0x2f17d
leaq 0x4bca(%rip), %rdi      # 0x33d30
movb $0x0, %al
callq 0x2050
leaq 0x4be7(%rip), %rdi      # 0x33d5b
movb $0x0, %al
callq 0x2050
jmp 0x2f18b
leaq 0x4c1b(%rip), %rdi      # 0x33d9f
movb $0x0, %al
callq 0x2050
jmp 0x2f5e4
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4c30(%rip), %rsi      # 0x33dce
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f203
movq -0x140(%rbp), %rax
cmpq $0x0, 0x40(%rax)
je 0x2f1d6
movq -0x140(%rbp), %rax
movq 0x40(%rax), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
movq -0x140(%rbp), %rax
movq $0x0, 0x40(%rax)
leaq 0x4bfd(%rip), %rdi      # 0x33dda
movb $0x0, %al
callq 0x2050
leaq 0x2fcf(%rip), %rdi      # 0x321ba
callq 0x24490
movq %rax, %rcx
movq -0x140(%rbp), %rax
movq %rcx, 0x40(%rax)
jmp 0x2f5e2
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4c14(%rip), %rsi      # 0x33e25
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f2a1
cmpl $0x1, -0xc(%rbp)
jne 0x2f235
leaq 0x4c05(%rip), %rdi      # 0x33e31
movb $0x0, %al
callq 0x2050
jmp 0x2f29c
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2230
movl %eax, %ecx
movq -0x140(%rbp), %rax
movl %ecx, 0x38(%rax)
cmpl $0x1, 0x38(%rax)
jae 0x2f264
movq -0x140(%rbp), %rax
movl $0x1, 0x38(%rax)
jmp 0x2f284
movq -0x140(%rbp), %rax
cmpl $0xf4240, 0x38(%rax)    # imm = 0xF4240
jbe 0x2f282
movq -0x140(%rbp), %rax
movl $0xf4240, 0x38(%rax)    # imm = 0xF4240
jmp 0x2f284
movq -0x140(%rbp), %rax
movl 0x38(%rax), %esi
leaq 0x4bd0(%rip), %rdi      # 0x33e65
movb $0x0, %al
callq 0x2050
jmp 0x2f5e0
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4bdc(%rip), %rsi      # 0x33e8b
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f31f
movl $0x64, -0x2c(%rbp)
cmpl $0x2, -0xc(%rbp)
jb 0x2f2e5
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2230
movl %eax, -0x2c(%rbp)
cmpl $0x1, -0x2c(%rbp)
jae 0x2f2e3
movl $0x1, -0x2c(%rbp)
jmp 0x2f2e5
movq -0x140(%rbp), %rax
movl -0x2c(%rbp), %esi
movl 0x38(%rax), %edx
leaq 0x4b9e(%rip), %rdi      # 0x33e97
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0x2c(%rbp), %esi
movl 0x38(%rax), %edx
movq (%rdi), %rax
callq *0x80(%rax)
jmp 0x2f5de
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4bc5(%rip), %rsi      # 0x33ef2
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f39d
movl $0x64, -0x30(%rbp)
cmpl $0x2, -0xc(%rbp)
jb 0x2f363
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2230
movl %eax, -0x30(%rbp)
cmpl $0x1, -0x30(%rbp)
jae 0x2f361
movl $0x1, -0x30(%rbp)
jmp 0x2f363
movq -0x140(%rbp), %rax
movl -0x30(%rbp), %esi
movl 0x38(%rax), %edx
leaq 0x4b82(%rip), %rdi      # 0x33ef9
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0x30(%rbp), %esi
movl 0x38(%rax), %edx
movq (%rdi), %rax
callq *0x88(%rax)
jmp 0x2f5dc
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4ba2(%rip), %rsi      # 0x33f4d
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f41b
movl $0x16d, -0x34(%rbp)     # imm = 0x16D
cmpl $0x2, -0xc(%rbp)
jb 0x2f3e1
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2230
movl %eax, -0x34(%rbp)
cmpl $0x1, -0x34(%rbp)
jae 0x2f3df
movl $0x1, -0x34(%rbp)
jmp 0x2f3e1
movq -0x140(%rbp), %rax
movl -0x34(%rbp), %esi
movl 0x38(%rax), %edx
leaq 0x4b5f(%rip), %rdi      # 0x33f54
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movl -0x34(%rbp), %esi
movl 0x38(%rax), %edx
movq (%rdi), %rax
callq *0x90(%rax)
jmp 0x2f5da
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x472d(%rip), %rsi      # 0x33b56
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f454
movq -0x140(%rbp), %rax
movl $0x0, 0x8(%rax)
leaq 0x4b70(%rip), %rdi      # 0x33fb8
movb $0x0, %al
callq 0x2050
jmp 0x2f5d8
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x476a(%rip), %rsi      # 0x33bcc
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f48d
movq -0x140(%rbp), %rax
movl $0x1, 0x8(%rax)
leaq 0x4b59(%rip), %rdi      # 0x33fda
movb $0x0, %al
callq 0x2050
jmp 0x2f5d6
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x476b(%rip), %rsi      # 0x33c06
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f4c6
movq -0x140(%rbp), %rax
movl $0x2, 0x8(%rax)
leaq 0x4b44(%rip), %rdi      # 0x33ffe
movb $0x0, %al
callq 0x2050
jmp 0x2f5d4
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4b4d(%rip), %rsi      # 0x34021
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f4f4
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
jmp 0x2f5d2
movq -0x18(%rbp), %rax
movq (%rax), %rdi
leaq 0x4b26(%rip), %rsi      # 0x34028
callq 0x21f0
cmpl $0x0, %eax
jne 0x2f5d0
cmpl $0x1, -0xc(%rbp)
jne 0x2f564
movq -0x140(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x2f562
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movq 0x20(%rax), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movq 0x20(%rax), %rax
movl 0x50(%rax), %esi
addl $0x1, %esi
movq (%rdi), %rax
callq *0x20(%rax)
movq %rax, %rcx
movq -0x140(%rbp), %rax
movq %rcx, 0x20(%rax)
jmp 0x2f5ce
movl $0x1, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x2f5cc
movq -0x18(%rbp), %rax
movl -0x38(%rbp), %ecx
movq (%rax,%rcx,8), %rdi
callq 0x2230
movq -0x140(%rbp), %rdi
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %esi
callq 0x2fc20
movq %rax, %rcx
movq -0x140(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpq $0x0, 0x20(%rax)
je 0x2f5bf
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movq 0x20(%rax), %rsi
movq (%rdi), %rax
callq *0x10(%rax)
jmp 0x2f5c1
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x2f56b
jmp 0x2f5ce
jmp 0x2f5d0
jmp 0x2f5d2
jmp 0x2f5d4
jmp 0x2f5d6
jmp 0x2f5d8
jmp 0x2f5da
jmp 0x2f5dc
jmp 0x2f5de
jmp 0x2f5e0
jmp 0x2f5e2
jmp 0x2f5e4
jmp 0x2f5e6
jmp 0x2f5e8
jmp 0x2f5ea
jmp 0x2f5ec
jmp 0x2f5ee
jmp 0x2f5f0
jmp 0x2f5f2
jmp 0x2f5f4
jmp 0x2f5f6
jmp 0x2f5f8
jmp 0x2f5fa
jmp 0x2f5fc
movq -0x140(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x148(%rbp)
subl $0x1, %eax
je 0x2f968
jmp 0x2f616
movl -0x148(%rbp), %eax
subl $0x2, %eax
jne 0x2f9e7
jmp 0x2f627
movq -0x140(%rbp), %rax
movl 0xc(%rax), %ecx
movl %ecx, -0x14c(%rbp)
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movl %eax, %ecx
movl -0x14c(%rbp), %eax
cmpl %ecx, %eax
jae 0x2f8ca
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movl 0xc(%rax), %esi
movq (%rdi), %rax
callq *0x20(%rax)
movq %rax, %rcx
movq -0x140(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpq $0x0, 0x20(%rax)
je 0x2f875
movq -0x140(%rbp), %rax
testb $0x1, 0x6(%rax)
je 0x2f875
movq -0x140(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x2f6bb
movq -0x140(%rbp), %rax
movq 0x20(%rax), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x30(%rax)
movq 0x20(%rax), %rcx
movl 0x18(%rcx), %ecx
movl %ecx, 0x34(%rax)
jmp 0x2f860
movq -0x140(%rbp), %rax
movq 0x20(%rax), %rax
movl 0x18(%rax), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x20d0
movq %rax, %rcx
movq -0x140(%rbp), %rax
movq 0x30(%rcx), %rdx
movq %rdx, -0x50(%rbp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movaps %xmm2, -0x60(%rbp)
movaps %xmm1, -0x70(%rbp)
movaps %xmm0, -0x80(%rbp)
movl 0x30(%rax), %eax
movq %rax, -0x88(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x20d0
movq %rax, %rcx
movq -0x140(%rbp), %rax
movq 0x30(%rcx), %rdx
movq %rdx, -0x90(%rbp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups 0x20(%rcx), %xmm2
movaps %xmm2, -0xa0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm0, -0xc0(%rbp)
movb $0x0, -0xc1(%rbp)
movl 0x8(%rax), %eax
movl %eax, -0x150(%rbp)
testl %eax, %eax
je 0x2f780
jmp 0x2f766
movl -0x150(%rbp), %eax
subl $0x1, %eax
je 0x2f794
jmp 0x2f773
movl -0x150(%rbp), %eax
subl $0x2, %eax
je 0x2f7a8
jmp 0x2f7bc
movl -0x64(%rbp), %eax
cmpl -0xa4(%rbp), %eax
je 0x2f792
movb $0x1, -0xc1(%rbp)
jmp 0x2f7bc
movl -0x70(%rbp), %eax
cmpl -0xb0(%rbp), %eax
je 0x2f7a6
movb $0x1, -0xc1(%rbp)
jmp 0x2f7bc
movl -0x6c(%rbp), %eax
cmpl -0xac(%rbp), %eax
je 0x2f7ba
movb $0x1, -0xc1(%rbp)
jmp 0x2f7bc
testb $0x1, -0xc1(%rbp)
je 0x2f85e
leaq -0x130(%rbp), %rdi
leaq 0x9589(%rip), %rsi      # 0x38d60
movl $0x60, %edx
callq 0x20f0
movslq -0xb0(%rbp), %rax
movq -0x130(%rbp,%rax,8), %rsi
movl -0xb4(%rbp), %edx
movl -0xac(%rbp), %ecx
addl $0x76c, %ecx            # imm = 0x76C
movslq -0x70(%rbp), %rax
movq -0x130(%rbp,%rax,8), %r8
movl -0x74(%rbp), %r9d
movl -0x6c(%rbp), %eax
addl $0x76c, %eax            # imm = 0x76C
leaq 0x480d(%rip), %rdi      # 0x3402e
movl %eax, (%rsp)
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movl 0x30(%rax), %esi
movq 0x9920(%rip), %rcx      # 0x39160
movl %ecx, %edx
movb 0x4(%rax), %cl
movq (%rdi), %rax
andb $0x1, %cl
movzbl %cl, %ecx
callq *0x38(%rax)
movq -0x140(%rbp), %rax
movl -0x40(%rbp), %ecx
movl %ecx, 0x30(%rax)
jmp 0x2f860
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movq 0x20(%rax), %rsi
movq (%rdi), %rax
callq *0x28(%rax)
movq -0x140(%rbp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
movl 0xc(%rax), %eax
movl $0x2710, %ecx           # imm = 0x2710
xorl %edx, %edx
divl %ecx
cmpl $0x0, %edx
jne 0x2f8c5
movq -0x140(%rbp), %rax
movl 0xc(%rax), %ecx
movl %ecx, -0x154(%rbp)
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *(%rax)
movl -0x154(%rbp), %esi
movl %eax, %edx
leaq 0x47a2(%rip), %rdi      # 0x34060
movb $0x0, %al
callq 0x2050
jmp 0x2f966
leaq 0x47b2(%rip), %rdi      # 0x34083
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movq -0x140(%rbp), %rax
testb $0x1, 0x6(%rax)
je 0x2f952
leaq 0x47ba(%rip), %rdi      # 0x340b7
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movl 0x30(%rax), %esi
movq 0x9847(%rip), %rcx      # 0x39160
movl %ecx, %edx
movb 0x4(%rax), %cl
movq (%rdi), %rax
andb $0x1, %cl
movzbl %cl, %ecx
callq *0x38(%rax)
leaq 0x47a4(%rip), %rdi      # 0x340d5
movb $0x0, %al
callq 0x2050
movq -0x140(%rbp), %rax
movq 0x28(%rax), %rdi
movb 0x4(%rax), %cl
movq (%rdi), %rax
andb $0x1, %cl
movzbl %cl, %esi
callq *0x50(%rax)
movq -0x140(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, 0xc(%rax)
jmp 0x2f9e7
movq -0x140(%rbp), %rdx
movq 0x28(%rdx), %rdi
movl 0x10(%rdx), %esi
addq $0x14, %rdx
movq (%rdi), %rax
callq *0x68(%rax)
andb $0x1, %al
movb %al, -0x131(%rbp)
testb $0x1, -0x131(%rbp)
jne 0x2f9e5
movq -0x140(%rbp), %rax
movb $0x1, 0x5(%rax)
movl $0x0, (%rax)
movq 0x28(%rax), %rdi
movq (%rdi), %rax
callq *0x70(%rax)
movl %eax, %ecx
movq -0x140(%rbp), %rax
movl %ecx, 0x14(%rax)
movl 0x14(%rax), %esi
leaq 0x473a(%rip), %rdi      # 0x340fc
movb $0x0, %al
callq 0x2050
leaq 0x4778(%rip), %rdi      # 0x34148
movb $0x0, %al
callq 0x2050
leaq 0x47ac(%rip), %rdi      # 0x3418a
movb $0x0, %al
callq 0x2050
jmp 0x2f9e7
movq -0x140(%rbp), %rax
cmpl $0x3, (%rax)
setne %al
andb $0x1, %al
addq $0x160, %rsp            # imm = 0x160
popq %rbp
retq
nop