// File: /workspace/github_cpp_makefile_star2_O1/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), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq -0x108(%rbp), %rdi
callq 0x17bc
leaq -0x108(%rbp), %rdi
callq 0x21f0
movl $0x0, -0x108(%rbp)
movq 0x4c4b(%rip), %rbx      # 0x5fd8
leaq 0x1c70(%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 0x4c19(%rip), %rdi      # 0x5fd8
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq 0x4c05(%rip), %rdi      # 0x5fd8
leaq 0x1c40(%rip), %rsi      # 0x301a
movl $0x8, %edx
callq 0x1110
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movq 0x4bdf(%rip), %rdi      # 0x5fd8
callq 0x1110
movq %rax, %rbx
leaq 0x1c1b(%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 0x4b7c(%rip), %rdi      # 0x5fd8
leaq 0x1bc3(%rip), %rsi      # 0x3026
movl $0x11, %edx
callq 0x1110
movl -0xa0(%rbp), %esi
movq 0x4b5e(%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 0x4b28(%rip), %rdi      # 0x5fd8
leaq 0x1b81(%rip), %rsi      # 0x3038
movl $0x12, %edx
callq 0x1110
movl -0x98(%rbp), %esi
movq 0x4b0a(%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 0x4ad4(%rip), %rdi      # 0x5fd8
leaq 0x1b40(%rip), %rsi      # 0x304b
movl $0xd, %edx
callq 0x1110
movl -0x34(%rbp), %esi
movq 0x4ab9(%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 0x4a83(%rip), %rbx      # 0x5fd8
leaq 0x1afd(%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 0x4a51(%rip), %rbx      # 0x5fd8
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
leaq -0x108(%rbp), %r15
leaq 0x1ac5(%rip), %r13      # 0x306a
xorl %r12d, %r12d
xorl %r14d, %r14d
movl -0x90(%rbp), %edx
movl -0x88(%rbp), %ecx
movq %r15, %rdi
movl %r12d, %esi
callq 0x1ca6
movl -0x48(%rbp), %ecx
cmpl $0x1, %ecx
je 0x15dd
cmpl $0x3, %ecx
jne 0x15ff
movb $0x1, %cl
cmpl -0x40(%rbp), %eax
jle 0x1638
cmpl -0x38(%rbp), %eax
jl 0x15e4
jmp 0x1638
movb $0x1, %cl
cmpl -0x40(%rbp), %eax
jge 0x1638
incl %r14d
movl -0x30(%rbp), %edx
leaq 0x1a92(%rip), %rdi      # 0x3083
movq %r12, %rsi
xorl %eax, %eax
callq 0x1040
movb $0x1, %cl
jmp 0x1638
movl $0x18, %edx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1110
movq (%rbx), %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
xorl %ecx, %ecx
testb %cl, %cl
je 0x16ff
incq %r12
cmpq $0x10000000, %r12       # imm = 0x10000000
jne 0x15ab
movq 0x4981(%rip), %rdi      # 0x5fd8
leaq 0x1a2f(%rip), %rsi      # 0x308d
movl $0x9, %edx
callq 0x1110
movq 0x4969(%rip), %rdi      # 0x5fd8
movl %r14d, %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 0x4930(%rip), %rdi      # 0x5fd8
leaq 0x19e8(%rip), %rsi      # 0x3097
movl $0xb, %edx
callq 0x1110
leaq -0x108(%rbp), %rdi
callq 0x17d6
cvtss2sd %xmm0, %xmm0
movq 0x4908(%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
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0x1721
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x10f0
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0x1743
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 0x175d
jmp 0x175d
jmp 0x175d
movq %rax, %rbx
leaq -0x108(%rbp), %rdi
callq 0x1774
movq %rbx, %rdi
callq 0x1170