// File: /workspace/github_c_makefile_star2_O3/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
movl $0x0, %ecx
cmpq %rbx, %r15
je 0xe4f2
leaq 0x58(%rsp), %rbp
leaq 0x48(%rsp), %r12
movq %rsp, %r13
leaq 0x20(%r15), %rsi
movq %r12, %rdi
callq 0x69a6
movq %r13, %rdi
movq %r12, %rsi
callq 0xed2c
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0xe4ca
callq 0x5300
movq 0x48(%rsp), %rdi
cmpq %rbp, %rdi
je 0xe4d9
callq 0x5300
movq %r15, %rdi
callq 0x5390
movq %rax, %r15
cmpq %rbx, %rax
jne 0xe4a4
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
cmpq $0x20, %rdx
je 0xe61b
movl $0x1, %edx
movq %rdx, 0x18(%rsp)
xorl %ebp, %ebp
leaq 0x1(%rbp), %rsi
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
movq %rsi, 0x28(%rsp)
cmpq %rsi, %rdx
jbe 0xe605
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 0xed6a
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
jbe 0xe5e6
movq (%rsp), %rsi
addq %rbp, %rsi
movq %r14, %rdi
callq 0xed6a
movq (%rax), %rax
movl (%rax,%r12,4), %r15d
movq (%rsp), %rsi
addq %r13, %rsi
movq %r14, %rdi
callq 0xed6a
movq (%rax), %rax
leaq 0x1(%r12), %rcx
cmpl (%rax,%r12,4), %r15d
movq %rcx, %r12
jne 0xe53d
movq (%rsp), %rax
leaq (%rax,%rbp), %rsi
addq %rax, %r13
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movq %r13, %rdx
callq 0xedbe
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0xfa62
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0xe5d2
callq 0x5300
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0xe5e6
callq 0x5300
incq %rbx
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, %rdx
subq %rax, %rdx
sarq $0x5, %rdx
cmpq %rbx, %rdx
ja 0xe533
decq %rdx
incq 0x18(%rsp)
movq 0x28(%rsp), %rbp
cmpq %rbp, %rdx
ja 0xe50e
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 0x6ca0
movq %r14, %rdi
callq 0x6b20
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 0x69f6
jmp 0xe68d
jmp 0xe68a
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xee1c
jmp 0xe68d
jmp 0xe68a
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6ca0
leaq 0x30(%rsp), %rdi
callq 0x6b20
movq %rbx, %rdi
callq 0x55b0
nop