// File: /workspace/github_cpp_makefile_star2_O1/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 0x843e
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 0x83b6
movq 0x20(%r15), %rax
movq %rax, 0x60(%rsp)
leaq 0x28(%r15), %rsi
leaq 0x68(%rsp), %rdi
callq 0xa90a
movq 0x60(%rsp), %rax
movq 0x68(%rsp), %r13
xorl %ebp, %ebp
movq 0x18(%rsp), %rcx
btq %rcx, %rax
setb %al
movq 0x70(%rsp), %r14
cmpq %r14, %r13
je 0x8389
movb %al, %bpl
movq (%r13), %rax
leaq (,%rax,2), %rax
addq %rbp, %rax
movq %rax, 0x58(%rsp)
movq 0x28(%rsp), %rsi
cmpq 0x30(%rsp), %rsi
je 0x8375
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x28(%rsp)
jmp 0x8380
movq %rbx, %rdi
movq %r12, %rdx
callq 0xb1c4
addq $0x8, %r13
cmpq %r14, %r13
jne 0x8347
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x83a0
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq %r15, %rdi
callq 0x54e0
movq %rax, %r15
cmpq 0x40(%rsp), %rax
jne 0x830b
leaq 0xf(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
movq 0x50(%rsp), %rdx
callq 0xc446
leaq 0x60(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0xc51c
movq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0xa5ac
leaq 0xc8(%rsp), %rdi
callq 0xb0c8
leaq 0x98(%rsp), %rdi
callq 0xb0c8
leaq 0x68(%rsp), %rdi
callq 0xb0c8
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x8426
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq 0x18(%rsp), %rcx
incq %rcx
movq %rcx, 0x18(%rsp)
cmpq 0x48(%rsp), %rcx
jne 0x82e1
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 0xa5d8
jmp 0x8487
jmp 0x8468
jmp 0x8468
movq %rax, %rbx
jmp 0x8487
movq %rax, %rbx
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x8487
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x849e
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5470
movq 0x10(%rsp), %rdi
callq 0xa5fc
movq %rbx, %rdi
callq 0x5790