// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x60(%rsp)
movq %rdi, %rax
movq %rax, 0x68(%rsp)
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
leaq 0x130(%rsp), %rdi
callq 0x249e0
leaq 0x118(%rsp), %rdi
callq 0x15360
movq 0x148(%rsp), %rax
movq %rax, 0x110(%rsp)
movq 0x110(%rsp), %rdi
callq 0x24f70
movq %rax, 0x108(%rsp)
movq 0x110(%rsp), %rdi
callq 0x24fa0
movq %rax, 0x100(%rsp)
leaq 0x108(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x24fd0
testb $0x1, %al
jne 0x23516
jmp 0x235a7
leaq 0x108(%rsp), %rdi
callq 0x24ff0
movq %rax, %rsi
leaq 0xc8(%rsp), %rdi
callq 0xa000
jmp 0x23535
leaq 0x118(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0x25220
jmp 0x2354c
leaq 0xc8(%rsp), %rdi
callq 0xa130
leaq 0x108(%rsp), %rdi
callq 0x25180
jmp 0x234f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
jmp 0x23832
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xa130
jmp 0x23832
movl $0x0, 0xb8(%rsp)
movslq 0xb8(%rsp), %rax
movq %rax, 0x58(%rsp)
leaq 0x118(%rsp), %rdi
callq 0xf8c0
movq %rax, %rcx
movq 0x58(%rsp), %rax
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x237f9
movl 0xb8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
movslq 0xb4(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x118(%rsp), %rdi
callq 0xf8c0
movq %rax, %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
jae 0x237e1
movl $0x0, 0xb0(%rsp)
movslq 0xb0(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x40(%rsp)
movslq 0xb8(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x25340
movq 0x40(%rsp), %rdi
movq %rax, %rsi
callq 0x25290
movq %rax, 0x48(%rsp)
jmp 0x2366b
movq 0x48(%rsp), %rdi
callq 0xb700
movq %rax, %rcx
movq 0x38(%rsp), %rax
cmpq %rcx, %rax
jae 0x237c9
movq 0x148(%rsp), %rax
movq %rax, 0x28(%rsp)
movslq 0xb8(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x25340
movq 0x28(%rsp), %rdi
movq %rax, %rsi
callq 0x25290
movq %rax, 0x30(%rsp)
jmp 0x236bc
movq 0x30(%rsp), %rdi
movslq 0xb0(%rsp), %rsi
callq 0x25360
movl (%rax), %eax
movl %eax, 0x14(%rsp)
movq 0x148(%rsp), %rax
movq %rax, 0x18(%rsp)
movslq 0xb4(%rsp), %rsi
leaq 0x118(%rsp), %rdi
callq 0x25340
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x25290
movq %rax, 0x20(%rsp)
jmp 0x2370a
movq 0x20(%rsp), %rdi
movslq 0xb0(%rsp), %rsi
callq 0x25360
movq %rax, %rcx
movl 0x14(%rsp), %eax
cmpl (%rcx), %eax
jne 0x237b1
movslq 0xb8(%rsp), %rsi
leaq 0x118(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x25340
movq (%rsp), %rdi
movq %rax, 0x8(%rsp)
movslq 0xb4(%rsp), %rsi
callq 0x25340
movq 0x8(%rsp), %rsi
movq %rax, %rdx
leaq 0x70(%rsp), %rdi
callq 0x253b0
jmp 0x2376e
leaq 0x130(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x25380
jmp 0x23782
leaq 0x70(%rsp), %rdi
callq 0x11470
jmp 0x237c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xc0(%rsp)
movl %eax, 0xbc(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x11470
jmp 0x23832
jmp 0x237b3
movl 0xb0(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb0(%rsp)
jmp 0x23628
jmp 0x237cb
movl 0xb4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb4(%rsp)
jmp 0x235f2
jmp 0x237e3
movl 0xb8(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xb8(%rsp)
jmp 0x235b2
movq 0x60(%rsp), %rdi
leaq 0x130(%rsp), %rsi
callq 0x25420
leaq 0x118(%rsp), %rdi
callq 0xa7e0
leaq 0x130(%rsp), %rdi
callq 0xa450
movq 0x68(%rsp), %rax
addq $0x158, %rsp            # imm = 0x158
retq
leaq 0x118(%rsp), %rdi
callq 0xa7e0
leaq 0x130(%rsp), %rdi
callq 0xa450
movq 0xc0(%rsp), %rdi
callq 0x8820
nopl (%rax)