// File: sile[P]mphf/./hash.hh
// Function: MPHF::Hash::Data::Data(char const*)
Data(const char* filepath) 
	: mm(filepath), key_count(0), hash_value_limit(0), middle(0),
	  h(NULL), rank_bv(NULL), hash_assign_bv(NULL) {
	if(!mm)
	  return;
	
	const char* p=static_cast<const char*>(mm.ptr);
	
	key_count        = reinterpret_cast<const unsigned*>(p)[0];
	hash_value_limit = reinterpret_cast<const unsigned*>(p)[1];
	middle = hash_value_limit/2;
	p += sizeof(unsigned)*2;
	
	h = reinterpret_cast<const HashImpl*>(p);
        p += sizeof(HashImpl)*2;
      
        unsigned bit_length = reinterpret_cast<const unsigned*>(p)[0];
        p += sizeof(unsigned);
	rank_bv = new BitVector(bit_length, 
				reinterpret_cast<const unsigned*>(p), 
				reinterpret_cast<const unsigned*>(p)+BitVector::block_size(bit_length));
        p += sizeof(unsigned)*(BitVector::block_size(bit_length)+BitVector::rank_index_size(bit_length));

	bit_length = reinterpret_cast<const unsigned*>(p)[0];
	p += sizeof(unsigned);
	hash_assign_bv = new BitVector(bit_length, reinterpret_cast<const unsigned*>(p), NULL);
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x1e80
movq -0x38(%rbp), %rdi
movl $0x0, 0x10(%rdi)
movl $0x0, 0x14(%rdi)
movl $0x0, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
movq $0x0, 0x28(%rdi)
movq $0x0, 0x30(%rdi)
callq 0x1f40
movb %al, -0x2d(%rbp)
jmp 0x1cdd
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x1cfc
jmp 0x1ce6
jmp 0x1e26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x1e65
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rcx
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x14(%rax)
movl 0x14(%rax), %ecx
shrl %ecx
movl %ecx, 0x18(%rax)
movq -0x28(%rbp), %rcx
addq $0x8, %rcx
movq %rcx, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movl $0x18, %edi
callq 0x1110
movq %rax, -0x48(%rbp)
jmp 0x1d68
movl -0x2c(%rbp), %edi
movl %edi, -0x64(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x60(%rbp)
movq %rax, -0x58(%rbp)
callq 0x1f60
movl %eax, -0x4c(%rbp)
jmp 0x1d84
movq -0x58(%rbp), %rdx
movl -0x64(%rbp), %esi
movq -0x48(%rbp), %rdi
movq -0x60(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %ecx, %ecx
leaq (%rax,%rcx,4), %rcx
callq 0x1f80
jmp 0x1da3
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x28(%rax)
movl -0x2c(%rbp), %edi
callq 0x1f60
movl %eax, -0x68(%rbp)
jmp 0x1dbc
movl -0x2c(%rbp), %edi
callq 0x1fb0
movl %eax, -0x6c(%rbp)
jmp 0x1dc9
movl -0x6c(%rbp), %ecx
movl -0x68(%rbp), %eax
addl %ecx, %eax
movl %eax, %ecx
movq -0x28(%rbp), %rax
leaq (%rax,%rcx,4), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movl $0x18, %edi
callq 0x1110
movq %rax, -0x78(%rbp)
jmp 0x1e04
movq -0x78(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x1f80
jmp 0x1e1a
movq -0x40(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, 0x30(%rax)
addq $0x80, %rsp
popq %rbp
retq
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x18, %esi
callq 0x1120
jmp 0x1e65
movq -0x78(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x18, %esi
callq 0x1120
movq -0x38(%rbp), %rdi
callq 0x1fd0
movq -0x18(%rbp), %rdi
callq 0x11a0
nopw (%rax,%rax)