// File: /workspace/github_c_makefile_star2_O2/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, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andq $0x0, 0x40(%rsp)
movq %rsp, %r15
andq $0x0, 0x10(%r15)
movaps %xmm0, (%r15)
movq 0x18(%rsi), %r13
leaq 0x8(%rsi), %rbx
leaq 0x48(%rsp), %r12
cmpq %rbx, %r13
je 0xd445
leaq 0x20(%r13), %rsi
movq %r12, %rdi
callq 0x729c
movq %r15, %rdi
movq %r12, %rsi
callq 0xdca4
movq %r12, %rdi
callq 0x72d6
movq %r13, %rdi
callq 0x6370
movq %rax, %r13
jmp 0xd414
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
pushq $0x1
popq %rbp
xorl %ebx, %ebx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
decq %rdx
cmpq %rbx, %rdx
jbe 0xd540
leaq 0x1(%rbx), %rdx
movq %rdx, 0x20(%rsp)
shlq $0x5, %rbx
movq %rbp, 0x28(%rsp)
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbp, %rdx
jbe 0xd52e
movq %rbp, %r13
shlq $0x5, %r13
xorl %r12d, %r12d
movq (%rsp), %rsi
addq %rbx, %rsi
movq %r14, %rdi
callq 0xdcd0
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0xd51d
movq (%rsp), %rsi
addq %rbx, %rsi
movq %r14, %rdi
callq 0xdcd0
movq (%rax), %rax
movl (%rax,%r12,4), %r15d
movq (%rsp), %rsi
addq %r13, %rsi
movq %r14, %rdi
callq 0xdcd0
movq (%rax), %rax
leaq 0x1(%r12), %rcx
cmpl (%rax,%r12,4), %r15d
movq %rcx, %r12
jne 0xd498
movq (%rsp), %rax
leaq (%rax,%rbx), %rsi
addq %rax, %r13
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r13, %rdx
callq 0xdd16
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xea6c
movq %r15, %rdi
callq 0x913e
incq %rbp
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
jmp 0xd47b
movq 0x28(%rsp), %rbp
incq %rbp
movq 0x20(%rsp), %rbx
jmp 0xd453
leaq 0x30(%rsp), %r14
movaps (%r14), %xmm0
movq 0x18(%rsp), %rbx
movups %xmm0, (%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%r14)
andq $0x0, 0x10(%r14)
movq %rsp, %rdi
callq 0x74e0
movq %r14, %rdi
callq 0x738e
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xd5ac
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x72d6
jmp 0xd5af
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x913e
jmp 0xd5af
jmp 0xd5ac
movq %rax, %rbx
movq %rsp, %rdi
callq 0x74e0
leaq 0x30(%rsp), %rdi
callq 0x738e
movq %rbx, %rdi
callq 0x65a0
nop