// File: superblocks[P]superblocks/precom.cpp
// Function: main
int main( int argc, char **argv )
{

  Superblocks s;
	s.timer_start();
	s.init();
	s.debug = 0;

	int step = 1;
	cout << "# Lucky Hash Cut Outs" << endl;
	cout << "# for: [" << s.coin << "] " << s.coin_name << endl;
	cout << "# cutout: start: " << s.cutout_start[step] << endl;
	cout << "# cutout: length: " << s.cutout_length[step] << endl;
	cout << "# reward[0]: " << s.reward[0] << endl;

	cout << "# CUTOUT, reward" << endl;

	int found = 0;
	long x;

	int seed_low  = 0; // = 0000000
	int seed_high = 268435455; // = fffffff
	//int seed_high = 12356; // test

	for (x = seed_low; x <= seed_high; x++) {

		int rand = s.generateMTRandom(x, s.rnd_range_low[step], s.rnd_range_high[step]);

		switch( s.luck_type[step] ) {
			default: 
				cout << "error: unknown luck type" << endl;
				return 0;
			case 1: // LUCK_WITH_LESS_THAN_X
				if( rand < s.luck_x[step] ) { 
					found++; 
					//printf("%07x, %d, %d\n", x, x, rand); 
					printf("%07x, %d\n", x, s.reward[step]); 
				}	
				break;
			case 3: // LUCK_WITH_MORE_THAN_X_AND_LESS_THAN_Y
				if( rand > s.luck_x[step] && rand < s.luck_y[step] ) { 
					found++; 
					//printf("%07x, %d, %d\n", x, x, rand); 
					printf("%07x, %d\n", x, s.reward[step]); 
				}	
				break;
		}

	}

	cout << "# found: " << found << endl;
	cout << "# seconds: " << s.timer_end() << endl;

	return 0;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1c0, %rsp            # imm = 0x1C0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0xf0(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0x2910
movq -0x128(%rbp), %rdi
callq 0x2970
jmp 0x246a
leaq -0xf0(%rbp), %rdi
callq 0x3e00
jmp 0x2478
movl $0x0, -0xf0(%rbp)
movl $0x1, -0x100(%rbp)
movq 0x4b45(%rip), %rdi      # 0x6fd8
leaq 0x1b6a(%rip), %rsi      # 0x4004
callq 0x2130
movq %rax, -0x130(%rbp)
jmp 0x24a8
movq -0x130(%rbp), %rdi
movq 0x4b12(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x24bd
movq 0x4b14(%rip), %rdi      # 0x6fd8
leaq 0x1b4f(%rip), %rsi      # 0x401a
callq 0x2130
movq %rax, -0x138(%rbp)
jmp 0x24d9
movq -0x138(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x2120
movq %rax, -0x140(%rbp)
jmp 0x24f5
movq -0x140(%rbp), %rdi
leaq 0x1b20(%rip), %rsi      # 0x4023
callq 0x2130
movq %rax, -0x148(%rbp)
jmp 0x2511
movq -0x148(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2120
movq %rax, -0x150(%rbp)
jmp 0x252d
movq -0x150(%rbp), %rdi
movq 0x4a8d(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x2542
movq 0x4a8f(%rip), %rdi      # 0x6fd8
leaq 0x1ad6(%rip), %rsi      # 0x4026
callq 0x2130
movq %rax, -0x158(%rbp)
jmp 0x255e
movq -0x158(%rbp), %rdi
movslq -0x100(%rbp), %rax
movl -0x8c(%rbp,%rax,4), %esi
callq 0x2210
movq %rax, -0x160(%rbp)
jmp 0x2581
movq -0x160(%rbp), %rdi
movq 0x4a39(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x2596
movq 0x4a3b(%rip), %rdi      # 0x6fd8
leaq 0x1a94(%rip), %rsi      # 0x4038
callq 0x2130
movq %rax, -0x168(%rbp)
jmp 0x25b2
movq -0x168(%rbp), %rdi
movslq -0x100(%rbp), %rax
movl -0x84(%rbp,%rax,4), %esi
callq 0x2210
movq %rax, -0x170(%rbp)
jmp 0x25d5
movq -0x170(%rbp), %rdi
movq 0x49e5(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x25ea
movq 0x49e7(%rip), %rdi      # 0x6fd8
leaq 0x1a53(%rip), %rsi      # 0x404b
callq 0x2130
movq %rax, -0x178(%rbp)
jmp 0x2606
movq -0x178(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x2210
movq %rax, -0x180(%rbp)
jmp 0x261e
movq -0x180(%rbp), %rdi
movq 0x499c(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x2633
movq 0x499e(%rip), %rdi      # 0x6fd8
leaq 0x1a18(%rip), %rsi      # 0x4059
callq 0x2130
movq %rax, -0x188(%rbp)
jmp 0x264f
movq -0x188(%rbp), %rdi
movq 0x496b(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x2664
movl $0x0, -0x104(%rbp)
movl $0x0, -0x114(%rbp)
movl $0xfffffff, -0x118(%rbp) # imm = 0xFFFFFFF
movslq -0x114(%rbp), %rax
movq %rax, -0x110(%rbp)
movq -0x110(%rbp), %rax
movslq -0x118(%rbp), %rcx
cmpq %rcx, %rax
jg 0x2829
movl -0x110(%rbp), %esi
movslq -0x100(%rbp), %rax
movl -0x7c(%rbp,%rax,4), %edx
movl -0x74(%rbp,%rax,4), %ecx
leaq -0xf0(%rbp), %rdi
callq 0x2e30
movl %eax, -0x18c(%rbp)
jmp 0x26d0
movl -0x18c(%rbp), %eax
movl %eax, -0x11c(%rbp)
movslq -0x100(%rbp), %rax
movl -0x34(%rbp,%rax,4), %eax
movl %eax, -0x190(%rbp)
subl $0x1, %eax
je 0x276f
jmp 0x26f4
movl -0x190(%rbp), %eax
subl $0x3, %eax
je 0x27b6
jmp 0x2728
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf8(%rbp)
movl %eax, -0xfc(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x2940
jmp 0x2902
movq 0x48a9(%rip), %rdi      # 0x6fd8
leaq 0x1934(%rip), %rsi      # 0x406a
callq 0x2130
movq %rax, -0x198(%rbp)
jmp 0x2744
movq -0x198(%rbp), %rdi
movq 0x4876(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x2759
movl $0x0, -0x4(%rbp)
movl $0x1, -0x120(%rbp)
jmp 0x28ea
movl -0x11c(%rbp), %eax
movslq -0x100(%rbp), %rcx
cmpl -0x2c(%rbp,%rcx,4), %eax
jge 0x27b4
movl -0x104(%rbp), %eax
incl %eax
movl %eax, -0x104(%rbp)
movq -0x110(%rbp), %rsi
movslq -0x100(%rbp), %rax
movl -0x1c(%rbp,%rax,4), %edx
leaq 0x18da(%rip), %rdi      # 0x4083
xorl %eax, %eax
callq 0x2030
jmp 0x27b2
jmp 0x27b4
jmp 0x2810
movl -0x11c(%rbp), %eax
movslq -0x100(%rbp), %rcx
cmpl -0x2c(%rbp,%rcx,4), %eax
jle 0x280e
movl -0x11c(%rbp), %eax
movslq -0x100(%rbp), %rcx
cmpl -0x24(%rbp,%rcx,4), %eax
jge 0x280e
movl -0x104(%rbp), %eax
incl %eax
movl %eax, -0x104(%rbp)
movq -0x110(%rbp), %rsi
movslq -0x100(%rbp), %rax
movl -0x1c(%rbp,%rax,4), %edx
leaq 0x1880(%rip), %rdi      # 0x4083
xorl %eax, %eax
callq 0x2030
jmp 0x280c
jmp 0x280e
jmp 0x2810
jmp 0x2812
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x110(%rbp)
jmp 0x2690
movq 0x47a8(%rip), %rdi      # 0x6fd8
leaq 0x1856(%rip), %rsi      # 0x408d
callq 0x2130
movq %rax, -0x1a0(%rbp)
jmp 0x2845
movq -0x1a0(%rbp), %rdi
movl -0x104(%rbp), %esi
callq 0x2210
movq %rax, -0x1a8(%rbp)
jmp 0x2860
movq -0x1a8(%rbp), %rdi
movq 0x475a(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x2875
movq 0x475c(%rip), %rdi      # 0x6fd8
leaq 0x1814(%rip), %rsi      # 0x4097
callq 0x2130
movq %rax, -0x1b0(%rbp)
jmp 0x2891
leaq -0xf0(%rbp), %rdi
callq 0x29a0
movss %xmm0, -0x1b4(%rbp)
jmp 0x28a7
movss -0x1b4(%rbp), %xmm0
movq -0x1b0(%rbp), %rdi
callq 0x20e0
movq %rax, -0x1c0(%rbp)
jmp 0x28c4
movq -0x1c0(%rbp), %rdi
movq 0x46f6(%rip), %rsi      # 0x6fc8
callq 0x2150
jmp 0x28d9
movl $0x0, -0x4(%rbp)
movl $0x1, -0x120(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x2940
movl -0x4(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
movq -0xf8(%rbp), %rdi
callq 0x2220
nop