// File: /workspace/github_cpp_makefile_star2_O3/superblocks[P]superblocks/utils.cpp
// Function: Superblocks::gethashcutout(int, char const*)
long Superblocks::gethashcutout( int step, const char* hash ) 
{
	if( debug ) { 
		cout << "gethashcutout: step: " << step << endl; 
		cout << "gethashcutout: cutout_start: "  << cutout_start[step] << endl;
		cout << "gethashcutout: cutout_length: " << cutout_length[step] << endl; 
	}

	int hlen = strlen(hash);
	if( debug ) { cout << "gethashcutout: srlen(hash): " << hlen << endl; }
	if( hlen != hash_length ) {
		cout << "gethashcutout: error: hash length not " << hash_length << endl;
		return 0;
	}
	if( debug ) { cout << "gethashcutout: hash: " << hash << endl; }
	string hash_string(hash);
	if( debug ) { cout << "gethashcutout: hash_string: " << hash_string << endl; }
	std::string cseed_str = hash_string.substr( cutout_start[step], cutout_length[step]);
	const char* cseed = cseed_str.c_str();
	if( debug ) { cout << "gethashcutout: cseed: " << cseed << endl; }
	long seed = hex2long(cseed);
	if( debug ) { cout << "gethashcutout: return: seed: " << seed << endl; }
	return seed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rdi, %rbx
cmpl $0x0, (%rdi)
movslq %esi, %r14
je 0x234a
movq 0x3dd2(%rip), %r12      # 0x5fd8
leaq 0x1253(%rip), %rsi      # 0x3460
movl $0x15, %edx
movq %r12, %rdi
callq 0x1100
movq %r12, %rdi
movl %r14d, %esi
callq 0x1140
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq 0x1220(%rip), %rsi      # 0x3476
movl $0x1d, %edx
movq %r12, %rdi
callq 0x1100
movl 0x64(%rbx,%r14,4), %esi
movq %r12, %rdi
callq 0x1140
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq 0x11f3(%rip), %rsi      # 0x3494
movl $0x1e, %edx
movq %r12, %rdi
callq 0x1100
movl 0x6c(%rbx,%r14,4), %esi
movq %r12, %rdi
callq 0x1140
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movl (%rbx), %r13d
movq %r15, %rdi
callq 0x1040
movq %rax, %r12
testl %r13d, %r13d
je 0x2355
movq 0x3cd9(%rip), %r13      # 0x5fd8
leaq 0x11ad(%rip), %rsi      # 0x34b3
movl $0x1c, %edx
movq %r13, %rdi
callq 0x1100
movq %r13, %rdi
movl %r12d, %esi
callq 0x1140
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r13, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
jmp 0x2355
movq %r15, %rdi
callq 0x1040
movq %rax, %r12
cmpl %r12d, 0x58(%rbx)
jne 0x23a0
cmpl $0x0, (%rbx)
je 0x2439
movq 0x3c6d(%rip), %r12      # 0x5fd8
leaq 0x1185(%rip), %rsi      # 0x34f7
movl $0x15, %edx
movq %r12, %rdi
callq 0x1100
testq %r15, %r15
je 0x23f8
movq %r15, %rdi
callq 0x1040
movq 0x3c45(%rip), %rdi      # 0x5fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x1100
jmp 0x2411
movq 0x3c31(%rip), %r14      # 0x5fd8
leaq 0x1122(%rip), %rsi      # 0x34d0
movl $0x26, %edx
movq %r14, %rdi
callq 0x1100
movl 0x58(%rbx), %esi
movq %r14, %rdi
callq 0x1140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
xorl %r14d, %r14d
jmp 0x25ff
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x1130
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r12, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rdx
movq %r15, %rsi
callq 0x288e
cmpl $0x0, (%rbx)
je 0x24a4
movq 0x3b83(%rip), %rdi      # 0x5fd8
leaq 0x10b1(%rip), %rsi      # 0x350d
movl $0x1c, %edx
callq 0x1100
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x3b63(%rip), %rdi      # 0x5fd8
callq 0x1100
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %r15, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
movslq 0x64(%rbx,%r14,4), %rdx
movslq 0x6c(%rbx,%r14,4), %rcx
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x10f0
movq -0x68(%rbp), %r15
cmpl $0x0, (%rbx)
je 0x2543
movq 0x3b0d(%rip), %r14      # 0x5fd8
leaq 0x1058(%rip), %rsi      # 0x352a
movl $0x16, %edx
movq %r14, %rdi
callq 0x1100
testq %r15, %r15
je 0x2500
movq %r15, %rdi
callq 0x1040
movq 0x3ae5(%rip), %rdi      # 0x5fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x1100
jmp 0x2518
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x1130
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq 0x3aa2(%rip), %rdi      # 0x5fd8
callq 0x1030
movq %rax, %rdi
callq 0x1080
movb (%r15), %al
testb %al, %al
je 0x2574
incq %r15
xorl %r14d, %r14d
leaq 0x1129(%rip), %rcx      # 0x3680
shlq $0x4, %r14
movsbq %al, %rax
orq (%rcx,%rax,8), %r14
movb (%r15), %al
testb %al, %al
je 0x2577
incq %r15
testq %r14, %r14
jns 0x2557
jmp 0x2577
xorl %r14d, %r14d
cmpl $0x0, (%rbx)
je 0x25cd
movq 0x3a55(%rip), %rdi      # 0x5fd8
leaq 0xfb7(%rip), %rsi       # 0x3541
movl $0x1d, %edx
callq 0x1100
movq 0x3a3d(%rip), %rdi      # 0x5fd8
movq %r14, %rsi
callq 0x10c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1080
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25e6
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10e0
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25ff
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10e0
movq %r14, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2633
jmp 0x2615
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2636
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10e0
jmp 0x2636
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x264f
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10e0
movq %rbx, %rdi
callq 0x1150
nop