// File: /workspace/github_c_makefile_star2_O1/perdisci[P]LSH/lsh.cpp
// Function: rp::LSH::compute_candidate_pairs(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::vector<unsigned int, std::allocator<unsigned int>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::vector<unsigned int, std::allocator<unsigned int>>>>> const&)
std::vector<CandidatePair> LSH::compute_candidate_pairs(const BandsHashMap& bh_map) {

        std::vector<CandidatePair> cpv;
        
        std::vector<string> keys;
        for(auto b : bh_map)
            keys.push_back(b.first);
        
        for(int i=0; i<keys.size()-1; i++) {
            for(int j = i+1; j<keys.size(); j++) {
                for(int k=0; k<bh_map.at(keys[i]).size(); k++) {
                    if(bh_map.at(keys[i])[k] == bh_map.at(keys[j])[k]) {
                        cpv.push_back({keys[i],keys[j]});
                        break;
                    }
                }
            }
        }
        return std::move(cpv);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %r14
movq %rdi, 0x20(%rsp)
xorl %eax, %eax
movq %rax, 0x40(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movq %rax, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x18(%rsi), %r15
leaq 0x8(%rsi), %rbx
cmpq %rbx, %r15
je 0xf59a
leaq 0x58(%rsp), %rbp
leaq 0x48(%rsp), %r12
movq %rsp, %r13
leaq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x79b0
movq %r13, %rdi
movq %r12, %rsi
callq 0xfe2c
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0xf57b
callq 0x6300
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xf58a
callq 0x6300
movq %r15, %rdi
callq 0x6390
movq %rax, %r15
cmpq %rbx, %rax
jne 0xf555
movq 0x8(%rsp), %rax
subq (%rsp), %rax
cmpq $0x20, %rax
je 0xf6d0
movl $0x1, %eax
movq %rax, 0x18(%rsp)
xorl %ebp, %ebp
leaq 0x1(%rbp), %rcx
movq 0x8(%rsp), %rax
subq (%rsp), %rax
sarq $0x5, %rax
movq %rcx, 0x28(%rsp)
cmpq %rcx, %rax
jbe 0xf6ad
shlq $0x5, %rbp
movq 0x18(%rsp), %rbx
movq %rbx, %r13
shlq $0x5, %r13
xorl %r12d, %r12d
movq (%rsp), %rsi
addq %rbp, %rsi
movq %r14, %rdi
callq 0xfe6a
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0xf694
movq (%rsp), %rsi
addq %rbp, %rsi
movq %r14, %rdi
callq 0xfe6a
movq (%rax), %rax
movl (%rax,%r12,4), %r15d
movq (%rsp), %rsi
addq %r13, %rsi
movq %r14, %rdi
callq 0xfe6a
movq (%rax), %rax
leaq 0x1(%r12), %rcx
cmpl (%rax,%r12,4), %r15d
movq %rcx, %r12
jne 0xf5eb
movq (%rsp), %rax
leaq (%rax,%rbp), %rsi
addq %rax, %r13
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r13, %rdx
callq 0xfebe
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x10c06
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xf680
callq 0x6300
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xf694
callq 0x6300
incq %rbx
movq 0x8(%rsp), %rax
subq (%rsp), %rax
sarq $0x5, %rax
cmpq %rbx, %rax
ja 0xf5e1
movq 0x8(%rsp), %rax
subq (%rsp), %rax
sarq $0x5, %rax
decq %rax
incq 0x18(%rsp)
movq 0x28(%rsp), %rbp
cmpq %rbp, %rax
ja 0xf5b9
leaq 0x30(%rsp), %r14
movaps (%r14), %xmm0
movq 0x20(%rsp), %rbx
movups %xmm0, (%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq %rsp, %rdi
callq 0x7caa
movq %r14, %rdi
callq 0x7b2a
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x7a00
jmp 0xf742
jmp 0xf73f
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xff1c
jmp 0xf742
jmp 0xf73f
movq %rax, %rbx
movq %rsp, %rdi
callq 0x7caa
leaq 0x30(%rsp), %rdi
callq 0x7b2a
movq %rbx, %rdi
callq 0x65b0