// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xe0, %rsp
leaq -0xd8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0xb8(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x100(%rbp), %rdi
callq 0x1598
leaq -0x100(%rbp), %rdi
callq 0x1ce4
andl $0x0, -0x100(%rbp)
movq 0x3c6e(%rip), %rdi      # 0x4fd8
leaq 0xc93(%rip), %rsi       # 0x2004
callq 0x1100
movq %rax, %rdi
callq 0x1060
movq 0x3c53(%rip), %rdi      # 0x4fd8
leaq 0xc8e(%rip), %rsi       # 0x201a
callq 0x1100
leaq -0xe8(%rbp), %rsi
movq %rax, %rdi
callq 0x10e0
leaq 0xc7c(%rip), %rsi       # 0x2023
movq %rax, %rdi
callq 0x1100
leaq -0xc8(%rbp), %rsi
movq %rax, %rdi
callq 0x10e0
movq %rax, %rdi
callq 0x1060
movq 0x3c0b(%rip), %rdi      # 0x4fd8
leaq 0xc52(%rip), %rsi       # 0x2026
callq 0x1100
movl -0x98(%rbp), %esi
movq %rax, %rdi
callq 0x1130
movq %rax, %rdi
callq 0x1060
movq 0x3be2(%rip), %rdi      # 0x4fd8
leaq 0xc3b(%rip), %rsi       # 0x2038
callq 0x1100
movl -0x90(%rbp), %esi
movq %rax, %rdi
callq 0x1130
movq %rax, %rdi
callq 0x1060
movq 0x3bb9(%rip), %rdi      # 0x4fd8
leaq 0xc25(%rip), %rsi       # 0x204b
callq 0x1100
movl -0x2c(%rbp), %esi
movq %rax, %rdi
callq 0x1130
movq %rax, %rdi
callq 0x1060
movq 0x3b93(%rip), %rdi      # 0x4fd8
leaq 0xc0d(%rip), %rsi       # 0x2059
callq 0x1100
movq %rax, %rdi
callq 0x1060
leaq -0x100(%rbp), %r14
leaq 0xc1c(%rip), %r15       # 0x2083
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq $0x10000000, %r12       # imm = 0x10000000
je 0x14c2
movl -0x88(%rbp), %edx
movl -0x80(%rbp), %ecx
movq %r14, %rdi
movl %r12d, %esi
callq 0x184a
movl -0x40(%rbp), %ecx
cmpl $0x1, %ecx
je 0x14a6
cmpl $0x3, %ecx
jne 0x151b
cmpl -0x38(%rbp), %eax
jle 0x14bd
cmpl -0x30(%rbp), %eax
jl 0x14ab
jmp 0x14bd
cmpl -0x38(%rbp), %eax
jge 0x14bd
incl %ebx
movl -0x28(%rbp), %edx
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1030
incq %r12
jmp 0x146c
movq 0x3b0f(%rip), %rdi      # 0x4fd8
leaq 0xbbd(%rip), %rsi       # 0x208d
callq 0x1100
movq %rax, %rdi
movl %ebx, %esi
callq 0x1130
movq %rax, %rdi
callq 0x1060
movq 0x3aea(%rip), %rdi      # 0x4fd8
leaq 0xba2(%rip), %rsi       # 0x2097
callq 0x1100
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x15b2
movq %rbx, %rdi
callq 0x10b0
movq %rax, %rdi
callq 0x1060
jmp 0x1536
movq 0x3ab6(%rip), %rdi      # 0x4fd8
leaq 0xb41(%rip), %rsi       # 0x206a
callq 0x1100
movq %rax, %rdi
callq 0x1060
leaq -0x100(%rbp), %rdi
callq 0x1574
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x155c
jmp 0x155c
jmp 0x155c
jmp 0x155c
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0x1574
movq %rbx, %rdi
callq 0x1140
nop