// File: /workspace/github_c_makefile_star2_O2/perdisci[P]LSH/lsh.cpp
// Function: rp::LSH::compute_minhash_similarities(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<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 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>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>> const&)
std::vector<float> LSH::compute_minhash_similarities(const MinHashMap& mh_map, const std::vector<CandidatePair>& cpv) {
        
        std::vector<float> js_vect;
        
        for(CandidatePair cp : cpv) {
            std::set<std::uint32_t> v1(mh_map.at(cp.first).begin(),mh_map.at(cp.first).end());
            std::set<std::uint32_t> v2(mh_map.at(cp.second).begin(),mh_map.at(cp.second).end());
            
            unsigned common = 0;
            for(int i=0; i<mh_map.at(cp.first).size(); i++)
                if(mh_map.at(cp.first)[i] == mh_map.at(cp.second)[i])
                    common++;
            
            
            float js = float(common)/mh_map.at(cp.first).size(); // minhash-based Jaccard similarity
            js_vect.push_back(js);
        }
        
        return std::move(js_vect);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
movq (%rdx), %r15
movq 0x8(%rdx), %rax
movq %rax, 0x10(%rsp)
leaq 0xb8(%rsp), %r13
leaq 0x98(%rsp), %rbp
leaq 0x68(%rsp), %r12
cmpq 0x10(%rsp), %r15
je 0xd794
movq %rbp, %rdi
movq %r15, %rsi
callq 0x90d8
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdcd0
movq (%rax), %rbx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdcd0
movq 0x8(%rax), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0xdd4c
movq %r15, 0x18(%rsp)
movq %r14, %rdi
movq %r13, %rsi
callq 0xdcd0
movq (%rax), %rbx
movq %r14, %rdi
movq %r13, %rsi
callq 0xdcd0
movq 0x8(%rax), %rdx
leaq 0x38(%rsp), %rdi
movq %rbx, %rsi
callq 0xdd4c
xorl %r15d, %r15d
xorl %ebx, %ebx
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdcd0
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
cmpq %r15, %rcx
jbe 0xd713
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdcd0
movq (%rax), %rax
movl (%rax,%r15,4), %r12d
movq %r14, %rdi
movq %r13, %rsi
callq 0xdcd0
movq (%rax), %rax
xorl %ecx, %ecx
cmpl (%rax,%r15,4), %r12d
sete %cl
addl %ecx, %ebx
incq %r15
jmp 0xd6c8
movq %r14, %rdi
movq %rbp, %rsi
callq 0xdcd0
movq 0x18(%rsp), %r15
leaq 0x68(%rsp), %r12
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x2, %rcx
js 0xd73c
cvtsi2ss %rcx, %xmm0
jmp 0xd751
movq %rcx, %rax
shrq %rax
andl $0x1, %ecx
orq %rax, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
movl %ebx, %eax
cvtsi2ss %rax, %xmm1
divss %xmm0, %xmm1
movss %xmm1, 0x4(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0x4(%rsp), %rsi
callq 0xdd90
leaq 0x38(%rsp), %rdi
callq 0xe1aa
movq %r12, %rdi
callq 0xe1aa
movq %rbp, %rdi
callq 0x913e
addq $0x40, %r15
jmp 0xd656
leaq 0x20(%rsp), %rdi
movaps (%rdi), %xmm0
movq 0x8(%rsp), %rbx
movups %xmm0, (%rbx)
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0xb026
movq %rbx, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0xd806
jmp 0xd7e2
movq %rax, %rbx
jmp 0xd7f9
movq %rax, %rbx
jmp 0xd7ef
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xe1aa
leaq 0x68(%rsp), %rdi
callq 0xe1aa
leaq 0x98(%rsp), %rdi
callq 0x913e
leaq 0x20(%rsp), %rdi
callq 0xb026
movq %rbx, %rdi
callq 0x65a0