// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x198, %rsp            # imm = 0x198
movq %rdi, 0x60(%rsp)
movq %rdi, %rax
movq %rax, 0x68(%rsp)
movq %rdi, 0x190(%rsp)
movq %rsi, 0x188(%rsp)
movq %rdx, 0x180(%rsp)
leaq 0x168(%rsp), %rdi
callq 0x249f0
movq 0x180(%rsp), %rax
movq %rax, 0x160(%rsp)
movq 0x160(%rsp), %rdi
callq 0x17ff0
movq %rax, 0x158(%rsp)
movq 0x160(%rsp), %rdi
callq 0x18020
movq %rax, 0x150(%rsp)
leaq 0x158(%rsp), %rdi
leaq 0x150(%rsp), %rsi
callq 0x183a0
testb $0x1, %al
jne 0x23941
jmp 0x23c8b
leaq 0x158(%rsp), %rdi
callq 0x18410
movq %rax, %rsi
leaq 0x110(%rsp), %rdi
callq 0x11290
jmp 0x23960
movq 0x188(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x25290
movq %rax, 0x58(%rsp)
jmp 0x2397c
movq 0x58(%rsp), %rdi
callq 0xb820
movq %rax, 0xc8(%rsp)
movq 0x188(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x25290
movq %rax, 0x50(%rsp)
jmp 0x239aa
movq 0x50(%rsp), %rdi
callq 0xb850
movq %rax, 0xc0(%rsp)
movq 0xc8(%rsp), %rsi
movq 0xc0(%rsp), %rdx
leaq 0xd0(%rsp), %rdi
callq 0x25490
jmp 0x239db
movq 0x188(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x25290
movq %rax, 0x48(%rsp)
jmp 0x239f7
movq 0x48(%rsp), %rdi
callq 0xb820
movq %rax, 0x88(%rsp)
movq 0x188(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x25290
movq %rax, 0x40(%rsp)
jmp 0x23a25
movq 0x40(%rsp), %rdi
callq 0xb850
movq %rax, 0x80(%rsp)
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rdx
leaq 0x90(%rsp), %rdi
callq 0x25490
jmp 0x23a56
movl $0x0, 0x7c(%rsp)
movl $0x0, 0x78(%rsp)
movslq 0x78(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x188(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x25290
movq %rax, 0x38(%rsp)
jmp 0x23a8c
movq 0x38(%rsp), %rdi
callq 0xb700
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jae 0x23b9e
movq 0x188(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x25290
movq %rax, 0x28(%rsp)
jmp 0x23ac3
movq 0x28(%rsp), %rdi
movslq 0x78(%rsp), %rsi
callq 0x25360
movl (%rax), %eax
movl %eax, 0x1c(%rsp)
movq 0x188(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x25290
movq %rax, 0x20(%rsp)
jmp 0x23af4
movq 0x20(%rsp), %rdi
movslq 0x78(%rsp), %rsi
callq 0x25360
movq %rax, %rcx
movl 0x1c(%rsp), %eax
cmpl (%rcx), %eax
jne 0x23b8c
movl 0x7c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x7c(%rsp)
jmp 0x23b8c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
jmp 0x23cb7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
jmp 0x23c7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
jmp 0x23c6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x108(%rsp)
movl %eax, 0x104(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x25590
jmp 0x23c6f
jmp 0x23b8e
movl 0x78(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x78(%rsp)
jmp 0x23a66
movl 0x7c(%rsp), %eax
cvtsi2ss %rax, %xmm0
movss %xmm0, 0xc(%rsp)
movq 0x188(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x25290
movq %rax, 0x10(%rsp)
jmp 0x23bc9
movq 0x10(%rsp), %rdi
callq 0xb700
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x4(%rsp)
testq %rax, %rax
movss %xmm0, 0x8(%rsp)
js 0x23c0c
movss 0x4(%rsp), %xmm0
movss %xmm0, 0x8(%rsp)
movss 0xc(%rsp), %xmm0
movss 0x8(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x74(%rsp)
leaq 0x168(%rsp), %rdi
leaq 0x74(%rsp), %rsi
callq 0x25520
jmp 0x23c36
leaq 0x90(%rsp), %rdi
callq 0x25590
leaq 0xd0(%rsp), %rdi
callq 0x25590
leaq 0x110(%rsp), %rdi
callq 0x11470
leaq 0x158(%rsp), %rdi
callq 0x18420
jmp 0x23923
leaq 0xd0(%rsp), %rdi
callq 0x25590
leaq 0x110(%rsp), %rdi
callq 0x11470
jmp 0x23cb7
movq 0x60(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x255a0
leaq 0x168(%rsp), %rdi
callq 0xa3f0
movq 0x68(%rsp), %rax
addq $0x198, %rsp            # imm = 0x198
retq
leaq 0x168(%rsp), %rdi
callq 0xa3f0
movq 0x108(%rsp), %rdi
callq 0x8820
nopw %cs:(%rax,%rax)