// File: /workspace/github_cpp_makefile_star2_O3/helchr[P]reMap/main.cpp
// Function: calculateAddressingFunction(std::map<unsigned long, std::vector<unsigned long, std::allocator<unsigned long>>, std::less<unsigned long>, std::allocator<std::pair<unsigned long const, std::vector<unsigned long, std::allocator<unsigned long>>>>> const&, unsigned long, unsigned long)
std::vector<Solver::Solution> calculateAddressingFunction(const std::map<size_t,std::vector<size_t>>& addresses, size_t addrFuncBits, size_t usableBits)
{
    std::vector<Solver::Solution> sList;
    for(size_t bit = 0; bit < addrFuncBits; bit++)
    {
        std::vector<uint64_t> matrix;
        Solver s;
        for(auto adrList : addresses)
        {
            uint64_t mask = 1ULL << bit;
            auto bitValue = (adrList.first & mask) >> bit;
            for(auto row : adrList.second)
            {
                auto rowWithResult = (row << 1ULL) | bitValue;
                matrix.push_back(rowWithResult);
            }
        }
        s.solve(matrix,usableBits);
        auto sol = s.getSolution(matrix);
        sList.push_back(sol);
    }
    return sList;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rcx, 0x50(%rsp)
movq %rsi, 0x38(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, 0x10(%rsp)
movq $0x0, 0x10(%rdi)
movq %rdx, 0x48(%rsp)
testq %rdx, %rdx
je 0x842d
movq 0x38(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x40(%rsp)
movq $0x0, 0x18(%rsp)
leaq 0x20(%rsp), %rbx
leaq 0x58(%rsp), %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
movb $0x0, 0xf(%rsp)
movq 0x38(%rsp), %rax
movq 0x18(%rax), %r15
cmpq 0x40(%rsp), %r15
je 0x83a5
movq 0x20(%r15), %rax
movq %rax, 0x60(%rsp)
leaq 0x28(%r15), %rsi
leaq 0x68(%rsp), %rdi
callq 0xa8c6
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %rbp
xorl %r14d, %r14d
movq 0x18(%rsp), %rcx
btq %rcx, %rax
setb %al
movq 0x70(%rsp), %r13
cmpq %r13, %rbp
je 0x837a
movb %al, %r14b
movq (%rbp), %rax
leaq (%r14,%rax,2), %rax
movq %rax, 0x58(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x8361
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x836c
movq %rbx, %rdi
movq %r12, %rdx
callq 0xb184
addq $0x8, %rbp
cmpq %r13, %rbp
jne 0x833a
movq 0x68(%rsp), %rbp
testq %rbp, %rbp
je 0x838f
movq 0x78(%rsp), %rsi
subq %rbp, %rsi
movq %rbp, %rdi
callq 0x5470
movq %r15, %rdi
callq 0x54e0
movq %rax, %r15
cmpq 0x40(%rsp), %rax
jne 0x82fd
leaq 0xf(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x50(%rsp), %rdx
callq 0xc3e6
leaq 0x60(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xc484
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xa56e
leaq 0xc8(%rsp), %rdi
callq 0xb082
leaq 0x98(%rsp), %rdi
callq 0xb082
leaq 0x68(%rsp), %rdi
callq 0xb082
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8415
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq 0x18(%rsp), %rcx
incq %rcx
movq %rcx, 0x18(%rsp)
cmpq 0x48(%rsp), %rcx
jne 0x82d3
movq 0x10(%rsp), %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0xa59a
jmp 0x8476
jmp 0x8457
jmp 0x8457
movq %rax, %rbx
jmp 0x8476
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x8476
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x848d
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq 0x10(%rsp), %rdi
callq 0xa5be
movq %rbx, %rdi
callq 0x5790