// File: /workspace/github_cpp_makefile_star2_O1/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 0x22ed
movq 0x3dca(%rip), %r12      # 0x5fd8
leaq 0x124b(%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 0x1218(%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 0x11eb(%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
movq %r15, %rdi
callq 0x1040
movq %rax, %r12
cmpl $0x0, (%rbx)
je 0x234d
movq 0x3cd4(%rip), %r13      # 0x5fd8
leaq 0x11a8(%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
cmpl %r12d, 0x58(%rbx)
jne 0x2398
cmpl $0x0, (%rbx)
je 0x2431
movq 0x3c75(%rip), %r12      # 0x5fd8
leaq 0x118d(%rip), %rsi      # 0x34f7
movl $0x15, %edx
movq %r12, %rdi
callq 0x1100
testq %r15, %r15
je 0x23f0
movq %r15, %rdi
callq 0x1040
movq 0x3c4d(%rip), %rdi      # 0x5fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x1100
jmp 0x2409
movq 0x3c39(%rip), %r14      # 0x5fd8
leaq 0x112a(%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 0x25f7
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 0x2844
cmpl $0x0, (%rbx)
je 0x249c
movq 0x3b8b(%rip), %rdi      # 0x5fd8
leaq 0x10b9(%rip), %rsi      # 0x350d
movl $0x1c, %edx
callq 0x1100
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x3b6b(%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 0x253b
movq 0x3b15(%rip), %r14      # 0x5fd8
leaq 0x1060(%rip), %rsi      # 0x352a
movl $0x16, %edx
movq %r14, %rdi
callq 0x1100
testq %r15, %r15
je 0x24f8
movq %r15, %rdi
callq 0x1040
movq 0x3aed(%rip), %rdi      # 0x5fd8
movq %r15, %rsi
movq %rax, %rdx
callq 0x1100
jmp 0x2510
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 0x3aaa(%rip), %rdi      # 0x5fd8
callq 0x1030
movq %rax, %rdi
callq 0x1080
movb (%r15), %al
testb %al, %al
je 0x256c
incq %r15
xorl %r14d, %r14d
leaq 0x1131(%rip), %rcx      # 0x3680
shlq $0x4, %r14
movsbq %al, %rax
orq (%rcx,%rax,8), %r14
movb (%r15), %al
testb %al, %al
je 0x256f
incq %r15
testq %r14, %r14
jns 0x254f
jmp 0x256f
xorl %r14d, %r14d
cmpl $0x0, (%rbx)
je 0x25c5
movq 0x3a5d(%rip), %rdi      # 0x5fd8
leaq 0xfbf(%rip), %rsi       # 0x3541
movl $0x1d, %edx
callq 0x1100
movq 0x3a45(%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 0x25de
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10e0
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25f7
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 0x262b
jmp 0x260d
movq %rax, %rbx
leaq -0x58(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x262e
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x10e0
jmp 0x262e
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2647
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x10e0
movq %rbx, %rdi
callq 0x1150
nop