// File: 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
subq $0xe0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x98(%rbp)
cmpl $0x0, (%rax)
je 0x3659
movq 0x4a17(%rip), %rdi      # 0x7fd8
leaq 0x1e98(%rip), %rsi      # 0x5460
callq 0x2110
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x49e6(%rip), %rsi      # 0x7fc8
callq 0x2130
movq 0x49ea(%rip), %rdi      # 0x7fd8
leaq 0x1e81(%rip), %rsi      # 0x5476
callq 0x2110
movq %rax, %rdi
movq -0x98(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl 0x64(%rax,%rcx,4), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x49ad(%rip), %rsi      # 0x7fc8
callq 0x2130
movq 0x49b1(%rip), %rdi      # 0x7fd8
leaq 0x1e66(%rip), %rsi      # 0x5494
callq 0x2110
movq %rax, %rdi
movq -0x98(%rbp), %rax
movslq -0x14(%rbp), %rcx
movl 0x6c(%rax,%rcx,4), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x4974(%rip), %rsi      # 0x7fc8
callq 0x2130
movq -0x20(%rbp), %rdi
callq 0x2070
movq %rax, %rcx
movq -0x98(%rbp), %rax
movl %ecx, -0x24(%rbp)
cmpl $0x0, (%rax)
je 0x36a1
movq 0x495d(%rip), %rdi      # 0x7fd8
leaq 0x1e31(%rip), %rsi      # 0x54b3
callq 0x2110
movq %rax, %rdi
movl -0x24(%rbp), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x492c(%rip), %rsi      # 0x7fc8
callq 0x2130
movq -0x98(%rbp), %rcx
movl -0x24(%rbp), %eax
cmpl 0x58(%rcx), %eax
je 0x36f1
movq 0x4921(%rip), %rdi      # 0x7fd8
leaq 0x1e12(%rip), %rsi      # 0x54d0
callq 0x2110
movq %rax, %rdi
movq -0x98(%rbp), %rax
movl 0x58(%rax), %esi
callq 0x21f0
movq %rax, %rdi
movq 0x48e9(%rip), %rsi      # 0x7fc8
callq 0x2130
movq $0x0, -0x8(%rbp)
jmp 0x3946
movq -0x98(%rbp), %rax
cmpl $0x0, (%rax)
je 0x372b
movq 0x48d4(%rip), %rdi      # 0x7fd8
leaq 0x1dec(%rip), %rsi      # 0x54f7
callq 0x2110
movq %rax, %rdi
movq -0x20(%rbp), %rsi
callq 0x2110
movq %rax, %rdi
movq 0x48a2(%rip), %rsi      # 0x7fc8
callq 0x2130
movq -0x20(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0xa0(%rbp)
callq 0x2210
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
leaq -0x48(%rbp), %rdi
callq 0x31c0
jmp 0x375f
leaq -0x49(%rbp), %rdi
callq 0x2150
movq -0x98(%rbp), %rax
cmpl $0x0, (%rax)
je 0x37eb
movq 0x485d(%rip), %rdi      # 0x7fd8
leaq 0x1d8b(%rip), %rsi      # 0x550d
callq 0x2110
movq %rax, -0xb0(%rbp)
jmp 0x3790
movq -0xb0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2100
movq %rax, -0xb8(%rbp)
jmp 0x37a9
movq -0xb8(%rbp), %rdi
movq 0x4811(%rip), %rsi      # 0x7fc8
callq 0x2130
jmp 0x37be
jmp 0x37eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x49(%rbp), %rdi
callq 0x2150
jmp 0x3953
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x393b
movq -0x98(%rbp), %rax
movslq -0x14(%rbp), %rcx
movslq 0x64(%rax,%rcx,4), %rdx
movslq 0x6c(%rax,%rcx,4), %rcx
leaq -0x80(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x2120
jmp 0x380f
leaq -0x80(%rbp), %rdi
callq 0x2060
movq %rax, %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x88(%rbp)
cmpl $0x0, (%rax)
je 0x3897
movq 0x47a3(%rip), %rdi      # 0x7fd8
leaq 0x1cee(%rip), %rsi      # 0x552a
callq 0x2110
movq %rax, -0xc0(%rbp)
jmp 0x384a
movq -0xc0(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x2110
movq %rax, -0xc8(%rbp)
jmp 0x3866
movq -0xc8(%rbp), %rdi
movq 0x4754(%rip), %rsi      # 0x7fc8
callq 0x2130
jmp 0x387b
jmp 0x3897
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2080
jmp 0x393b
movq -0x98(%rbp), %rdi
movq -0x88(%rbp), %rsi
callq 0x3960
movq %rax, -0xd0(%rbp)
jmp 0x38b3
movq -0x98(%rbp), %rax
movq -0xd0(%rbp), %rcx
movq %rcx, -0x90(%rbp)
cmpl $0x0, (%rax)
je 0x391c
movq 0x4704(%rip), %rdi      # 0x7fd8
leaq 0x1c66(%rip), %rsi      # 0x5541
callq 0x2110
movq %rax, -0xd8(%rbp)
jmp 0x38e9
movq -0xd8(%rbp), %rdi
movq -0x90(%rbp), %rsi
callq 0x2230
movq %rax, -0xe0(%rbp)
jmp 0x3905
movq -0xe0(%rbp), %rdi
movq 0x46b5(%rip), %rsi      # 0x7fc8
callq 0x2130
jmp 0x391a
jmp 0x391c
movq -0x90(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x2080
leaq -0x48(%rbp), %rdi
callq 0x2080
jmp 0x3946
leaq -0x48(%rbp), %rdi
callq 0x2080
jmp 0x3953
movq -0x8(%rbp), %rax
addq $0xe0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x2200
nopl (%rax)