// File: /workspace/github_c_makefile_star2_O0/perdisci[P]LSH/lsh.cpp
// Function: rp::LSH::compute_ngram_similarities(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>, 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::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>> 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_ngram_similarities(const CorpusNGramsMap& ng_map, const std::vector<CandidatePair>& cpv) {
        
        std::vector<float> js_vect;
        
        for(CandidatePair cp : cpv) {
            std::set<std::string> v1 = ng_map.at(cp.first);
            std::set<std::string> v2 = ng_map.at(cp.second);
            
            std::vector<std::string> v_int;
            std::vector<std::string> v_uni;
            std::set_intersection(v1.begin(), v1.end(),
                                  v2.begin(), v2.end(),
                                  std::back_inserter(v_int));
            std::set_union(v1.begin(), v1.end(),
                           v2.begin(), v2.end(),
                           std::back_inserter(v_uni));
            
            float js = float(v_int.size())/v_uni.size(); // Jaccard similarity
            js_vect.push_back(js);
        }
        
        return std::move(js_vect);
    }

// Assembly:
subq $0x218, %rsp            # imm = 0x218
movq %rdi, 0x78(%rsp)
movq %rdi, %rax
movq %rax, 0x80(%rsp)
movq %rdi, 0x210(%rsp)
movq %rsi, 0x208(%rsp)
movq %rdx, 0x200(%rsp)
leaq 0x1e8(%rsp), %rdi
callq 0x249f0
movq 0x200(%rsp), %rax
movq %rax, 0x1e0(%rsp)
movq 0x1e0(%rsp), %rdi
callq 0x17ff0
movq %rax, 0x1d8(%rsp)
movq 0x1e0(%rsp), %rdi
callq 0x18020
movq %rax, 0x1d0(%rsp)
leaq 0x1d8(%rsp), %rdi
leaq 0x1d0(%rsp), %rsi
callq 0x183a0
testb $0x1, %al
jne 0x23dd4
jmp 0x2419a
leaq 0x1d8(%rsp), %rdi
callq 0x18410
movq %rax, %rsi
leaq 0x190(%rsp), %rdi
callq 0x11290
jmp 0x23df3
movq 0x208(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x255d0
movq %rax, 0x70(%rsp)
jmp 0x23e0f
movq 0x70(%rsp), %rsi
leaq 0x150(%rsp), %rdi
callq 0x25680
jmp 0x23e23
movq 0x208(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x255d0
movq %rax, 0x68(%rsp)
jmp 0x23e3f
movq 0x68(%rsp), %rsi
leaq 0x120(%rsp), %rdi
callq 0x25680
jmp 0x23e53
leaq 0x108(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0x15360
leaq 0xf0(%rsp), %rdi
callq 0x15360
leaq 0x150(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x19760
movq 0x48(%rsp), %rdi
movq %rax, 0xe8(%rsp)
callq 0x19790
movq %rax, 0xe0(%rsp)
leaq 0x120(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x19760
movq 0x50(%rsp), %rdi
movq %rax, 0xd8(%rsp)
callq 0x19790
movq 0x58(%rsp), %rdi
movq %rax, 0xd0(%rsp)
callq 0x25740
movq %rax, 0x60(%rsp)
jmp 0x23edb
movq 0x60(%rsp), %rax
movq %rax, 0xc8(%rsp)
movq 0xe8(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movq 0xd8(%rsp), %rdx
movq 0xd0(%rsp), %rcx
movq 0xc8(%rsp), %r8
callq 0x256b0
movq %rax, 0x40(%rsp)
jmp 0x23f1c
movq 0x40(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0x150(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x19760
movq 0x28(%rsp), %rdi
movq %rax, 0xb8(%rsp)
callq 0x19790
movq %rax, 0xb0(%rsp)
leaq 0x120(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x19760
movq 0x30(%rsp), %rdi
movq %rax, 0xa8(%rsp)
callq 0x19790
movq %rax, 0xa0(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x25740
movq %rax, 0x38(%rsp)
jmp 0x23f95
movq 0x38(%rsp), %rax
movq %rax, 0x98(%rsp)
movq 0xb8(%rsp), %rdi
movq 0xb0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0xa0(%rsp), %rcx
movq 0x98(%rsp), %r8
callq 0x25770
movq %rax, 0x20(%rsp)
jmp 0x23fd6
movq 0x20(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0x108(%rsp), %rdi
callq 0xf8c0
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, 0x18(%rsp)
testq %rax, %rax
movss %xmm0, 0x1c(%rsp)
js 0x24029
movss 0x18(%rsp), %xmm0
movss %xmm0, 0x1c(%rsp)
movss 0x1c(%rsp), %xmm0
movss %xmm0, 0xc(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xf8c0
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, 0x10(%rsp)
testq %rax, %rax
movss %xmm0, 0x14(%rsp)
js 0x2407b
movss 0x10(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movss 0xc(%rsp), %xmm0
movss 0x14(%rsp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, 0x8c(%rsp)
leaq 0x1e8(%rsp), %rdi
leaq 0x8c(%rsp), %rsi
callq 0x25520
jmp 0x240ab
leaq 0xf0(%rsp), %rdi
callq 0xa7e0
leaq 0x108(%rsp), %rdi
callq 0xa7e0
leaq 0x120(%rsp), %rdi
callq 0xc240
leaq 0x150(%rsp), %rdi
callq 0xc240
leaq 0x190(%rsp), %rdi
callq 0x11470
leaq 0x1d8(%rsp), %rdi
callq 0x18420
jmp 0x23db6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x241c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x2418b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
jmp 0x2417e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x188(%rsp)
movl %eax, 0x184(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0xa7e0
leaq 0x108(%rsp), %rdi
callq 0xa7e0
leaq 0x120(%rsp), %rdi
callq 0xc240
leaq 0x150(%rsp), %rdi
callq 0xc240
leaq 0x190(%rsp), %rdi
callq 0x11470
jmp 0x241c9
movq 0x78(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0x255a0
leaq 0x1e8(%rsp), %rdi
callq 0xa3f0
movq 0x80(%rsp), %rax
addq $0x218, %rsp            # imm = 0x218
retq
leaq 0x1e8(%rsp), %rdi
callq 0xa3f0
movq 0x188(%rsp), %rdi
callq 0x8820
nopw %cs:(%rax,%rax)