// File: /workspace/github_cpp_makefile_star2_O3/BU-DiSC[P]BF-Shared-Hashing/BF_bit.cpp
// Function: BFHash::getLevelwiseHashDigest(int)
vector<uint64_t>* BFHash::getLevelwiseHashDigest(int level){
        if((!share_hash_across_levels_ && level != -1)|| hash_digests_->size() == 0 || reset){
	    if(hash_digests_ == nullptr){
		hash_digests_ = new vector<uint64_t>(num_filter_units_, 0);
	    }
	    if(share_hash_across_filter_units_ == 0){
                for(int i = 0; i < num_filter_units_; i++){
                    hash_digests_->at(i) = getFilterUnitwiseHashDigest(i);
                }
            }else if(share_hash_across_filter_units_ == 1){
                uint64_t last_hash_digest = getFilterUnitwiseHashDigest(0);
                hash_digests_->at(0) = last_hash_digest;
		uint64_t delta = last_hash_digest << 17 | last_hash_digest >> 15;
                for(int i = 1; i < num_filter_units_; i++){
                   last_hash_digest = last_hash_digest + delta; 
                   hash_digests_->at(i) = last_hash_digest;
                }
            }else{
                uint64_t hash_digest1 = getFilterUnitwiseHashDigest(0);
                if(num_filter_units_ == 1){
                   hash_digests_->at(0) = hash_digest1;
                }else{
		   HashType ht = filter_unit_hash_funcs_[0];
		   HashType ht2 = MD5;
                   for(auto t_ht: { MD5, MurMurhash, CRC, XXhash, MurMur64, SHA2}){
                      if(t_ht != ht){
                          ht2 = t_ht;
			  break;
                      }
                   }
                   uint32_t seed = filter_unit_seeds_[0];
	           uint64_t hash_digest2 = get_hash_digest(key_, ht2, seed + (seed << 17 | seed >> 15));
                   for(int i = 0; i < num_filter_units_; i++){
                       hash_digests_->at(i) = hash_digest1 + i*hash_digest2;
                   }
                }
                
            }
	    reset = false;
	}
	return hash_digests_;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x27da7(%rip), %rbx     # 0x394a0
cmpl $-0x1, %esi
je 0x11742
cmpb $0x0, 0x27cc3(%rip)     # 0x393c8
jne 0x11742
testq %rbx, %rbx
jne 0x11758
movl $0x18, %edi
callq 0x5410
movq %rax, %rbx
movslq 0x27cb0(%rip), %rsi     # 0x393d0
leaq 0x8(%rsp), %rdx
movq $0x0, (%rdx)
leaq 0x7(%rsp), %rcx
movq %rax, %rdi
callq 0xd0d0
movq %rbx, 0x27d60(%rip)     # 0x394a0
jmp 0x11758
movq 0x8(%rbx), %rax
cmpq (%rbx), %rax
je 0x11758
cmpb $0x0, 0x27c86(%rip)     # 0x393d8
je 0x1191a
movl 0x27c6e(%rip), %eax     # 0x393cc
cmpl $0x1, %eax
je 0x117cf
testl %eax, %eax
jne 0x11860
cmpl $0x0, 0x27c5e(%rip)     # 0x393d0
jle 0x11913
xorl %r15d, %r15d
movq 0x27cee(%rip), %rax     # 0x39470
movl (%rax,%r15,4), %esi
movq 0x27cfb(%rip), %rax     # 0x39488
movl (%rax,%r15,4), %edx
movq %r14, %rdi
callq 0x1157e
movq 0x27d00(%rip), %rbx     # 0x394a0
movq (%rbx), %rcx
movq 0x8(%rbx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %r15, %rdx
jbe 0x11927
movq %rax, (%rcx,%r15,8)
incq %r15
movslq 0x27c0b(%rip), %rax     # 0x393d0
cmpq %rax, %r15
jl 0x1177b
jmp 0x11913
movq 0x27c9a(%rip), %rax     # 0x39470
movl (%rax), %esi
movq 0x27ca9(%rip), %rax     # 0x39488
movl (%rax), %edx
movq %r14, %rdi
callq 0x1157e
movq 0x27cb0(%rip), %rbx     # 0x394a0
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
movq %rsi, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
cmpq %rcx, %rsi
je 0x1194d
movq %rax, (%rcx)
movslq 0x27bbc(%rip), %rdi     # 0x393d0
cmpq $0x2, %rdi
jl 0x11913
movq %rax, %rsi
shlq $0x11, %rsi
movq %rax, %r8
shrq $0xf, %r8
orq %rsi, %r8
cmpq $0x1, %rdx
movq %rdx, %rsi
adcq $0x0, %rsi
addq %r8, %rax
movl $0x1, %r9d
cmpq %r9, %rsi
je 0x11933
movq %rax, (%rcx,%r9,8)
incq %r9
addq %r8, %rax
cmpq %r9, %rdi
jne 0x11843
jmp 0x11913
movq 0x27c09(%rip), %rax     # 0x39470
movl (%rax), %esi
movq 0x27c18(%rip), %rax     # 0x39488
movl (%rax), %edx
movq %r14, %rdi
callq 0x1157e
movq %rax, %r15
cmpl $0x1, 0x27b4c(%rip)     # 0x393d0
jne 0x1189f
movq 0x27c13(%rip), %rbx     # 0x394a0
movq (%rbx), %rax
cmpq %rax, 0x8(%rbx)
je 0x11958
movq %r15, (%rax)
jmp 0x11913
movq 0x27bca(%rip), %rax     # 0x39470
movl (%rax), %eax
xorl %ecx, %ecx
leaq 0x17e37(%rip), %rdx     # 0x296e8
movl (%rcx,%rdx), %esi
cmpl %eax, %esi
jne 0x118c4
addq $0x4, %rcx
cmpq $0x18, %rcx
jne 0x118b1
xorl %esi, %esi
movq 0x27bbd(%rip), %rax     # 0x39488
movl (%rax), %eax
movl %eax, %edx
roll $0x11, %edx
addl %eax, %edx
movq %r14, %rdi
callq 0x1157e
movslq 0x27aed(%rip), %rcx     # 0x393d0
movq 0x27bb6(%rip), %rbx     # 0x394a0
testq %rcx, %rcx
jle 0x11913
movq (%rbx), %rsi
movq 0x8(%rbx), %rdx
subq %rsi, %rdx
sarq $0x3, %rdx
xorl %edi, %edi
cmpq %rdi, %rdx
je 0x1193c
movq %r15, (%rsi,%rdi,8)
incq %rdi
addq %rax, %r15
cmpq %rdi, %rcx
jne 0x118ff
movb $0x0, 0x27abe(%rip)     # 0x393d8
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x17745(%rip), %rdi     # 0x29073
movq %r15, %rsi
jmp 0x11946
leaq 0x17739(%rip), %rdi     # 0x29073
jmp 0x11946
leaq 0x17730(%rip), %rdi     # 0x29073
movq %rdx, %rsi
xorl %eax, %eax
callq 0x55d0
leaq 0x1771f(%rip), %rdi     # 0x29073
xorl %esi, %esi
jmp 0x11946
leaq 0x17714(%rip), %rdi     # 0x29073
xorl %esi, %esi
xorl %edx, %edx
jmp 0x11946
movq %rax, %r14
movq %rbx, %rdi
callq 0x53d0
movq %r14, %rdi
callq 0x56b0