// File: /workspace/github_cpp_makefile_star2_O3/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 %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
leaq -0xe0(%rbp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0xc0(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
leaq -0x108(%rbp), %rdi
callq 0x17ac
leaq -0x108(%rbp), %rdi
callq 0x21f4
movl $0x0, -0x108(%rbp)
movq 0x4c49(%rip), %rbx      # 0x5fd8
leaq 0x1c6e(%rip), %rsi      # 0x3004
movl $0x15, %edx
movq %rbx, %rdi
callq 0x1110
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq 0x4c17(%rip), %rdi      # 0x5fd8
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x4c03(%rip), %rdi      # 0x5fd8
leaq 0x1c3e(%rip), %rsi      # 0x301a
movl $0x8, %edx
callq 0x1110
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq 0x4bdd(%rip), %rdi      # 0x5fd8
callq 0x1110
movq %rax, %rbx
leaq 0x1c19(%rip), %rsi      # 0x3023
movl $0x2, %edx
movq %rax, %rdi
callq 0x1110
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movq %rbx, %rdi
callq 0x1110
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x4b7a(%rip), %rdi      # 0x5fd8
leaq 0x1bc1(%rip), %rsi      # 0x3026
movl $0x11, %edx
callq 0x1110
movl -0xa0(%rbp), %esi
movq 0x4b5c(%rip), %rdi      # 0x5fd8
callq 0x1160
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x4b26(%rip), %rdi      # 0x5fd8
leaq 0x1b7f(%rip), %rsi      # 0x3038
movl $0x12, %edx
callq 0x1110
movl -0x98(%rbp), %esi
movq 0x4b08(%rip), %rdi      # 0x5fd8
callq 0x1160
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x4ad2(%rip), %rdi      # 0x5fd8
leaq 0x1b3e(%rip), %rsi      # 0x304b
movl $0xd, %edx
callq 0x1110
movl -0x34(%rbp), %esi
movq 0x4ab7(%rip), %rdi      # 0x5fd8
callq 0x1160
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x4a81(%rip), %rbx      # 0x5fd8
leaq 0x1afb(%rip), %rsi      # 0x3059
movl $0x10, %edx
movq %rbx, %rdi
callq 0x1110
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq 0x4a4f(%rip), %rdi      # 0x5fd8
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq -0x108(%rbp), %r14
leaq 0x1adf(%rip), %r15      # 0x3083
xorl %r12d, %r12d
xorl %ebx, %ebx
movl -0x90(%rbp), %edx
movl -0x88(%rbp), %ecx
movq %r14, %rdi
movl %r12d, %esi
callq 0x1ca6
movl -0x48(%rbp), %ecx
cmpl $0x1, %ecx
je 0x15dd
cmpl $0x3, %ecx
jne 0x16b0
cmpl -0x40(%rbp), %eax
jle 0x15f4
cmpl -0x38(%rbp), %eax
jl 0x15e2
jmp 0x15f4
cmpl -0x40(%rbp), %eax
jge 0x15f4
incl %ebx
movl -0x30(%rbp), %edx
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1040
incq %r12
cmpq $0x10000000, %r12       # imm = 0x10000000
jne 0x15a9
movq 0x49d1(%rip), %rdi      # 0x5fd8
leaq 0x1a7f(%rip), %rsi      # 0x308d
movl $0x9, %edx
callq 0x1110
movq 0x49b9(%rip), %rdi      # 0x5fd8
movl %ebx, %esi
callq 0x1160
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x4981(%rip), %rdi      # 0x5fd8
leaq 0x1a39(%rip), %rsi      # 0x3097
movl $0xb, %edx
callq 0x1110
leaq -0x108(%rbp), %rdi
callq 0x17c6
cvtss2sd %xmm0, %xmm0
movq 0x4959(%rip), %rdi      # 0x5fd8
callq 0x1140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
jmp 0x16f6
movq 0x4921(%rip), %rbx      # 0x5fd8
leaq 0x19ac(%rip), %rsi      # 0x306a
movl $0x18, %edx
movq %rbx, %rdi
callq 0x1110
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq 0x48ef(%rip), %rdi      # 0x5fd8
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
leaq -0xe0(%rbp), %rbx
je 0x1718
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x10f0
movq -0xf0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x1733
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x10f0
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x174f
jmp 0x174f
jmp 0x174f
jmp 0x174f
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x1766
movq %rbx, %rdi
callq 0x1170