// File: /workspace/github_cpp_makefile_star2_O2/zimpha[P]MiniSQL/indexManager.cc
// Function: getRecord(BFM&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Table&, AttrType const&)
vector < pair <element, long> > getRecord(BFM &bfm, const string &dbName, Table &table, const AttrType &attr) {
    IndexManager im(bfm);
    RecordManager rm(bfm,im);
    if (DEBUG) cout << "RecordManagerGetAllOffsets " << dbName << endl;
    set<long> s = rm.RecordManagerGetAllOffsets(dbName, table);
    if (DEBUG) cout << "RecordManagerGetAllOffsets " << dbName << " done." << endl;
    Filter filter;
    vector < pair <element, long> > v;
    if (DEBUG) cout << "getIndexID" << endl;
    int idx = table.getIndexID(attr);
    if (DEBUG) cout << "getIndexID done." << endl;
    if (idx == -1) return v;
    for (long offset : s) {
        if (DEBUG) cout << "Select" << endl;
        vector < vector <element> > res = rm.RecordManagerRecordSelect(dbName, offset, filter, table);
        if (DEBUG) cout << "Select done" << endl;
        if (DEBUG) cout << "push_back" << endl;
        for (vector <element> &u : res) {
            v.push_back(make_pair(u[idx], offset));
        }
        if (DEBUG) cout << "push_back done" << endl;
    }
    return v;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %r8, %r14
movq %rcx, -0x38(%rbp)
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
leaq -0x188(%rbp), %r12
movq %r12, %rdi
callq 0x94c6
leaq -0x70(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xeb1a
leaq -0xa8(%rbp), %rdi
movq %rbx, %rsi
callq 0x3380
leaq -0xd8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
leaq -0xa8(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0xf604
leaq -0xa8(%rbp), %rdi
callq 0x34f8
leaq -0x88(%rbp), %rdi
callq 0xc5d8
xorps %xmm0, %xmm0
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0xfa4c
cmpl $-0x1, %eax
je 0x89b1
leaq -0xd0(%rbp), %rcx
movq 0x10(%rcx), %rcx
cltq
leaq -0xf8(%rbp), %r12
imulq $0x30, %rax, %r15
leaq -0x130(%rbp), %r14
movq %rbx, -0x40(%rbp)
leaq -0xd0(%rbp), %rax
cmpq %rax, %rcx
je 0x89b1
movq %rcx, -0x48(%rbp)
movq 0x20(%rcx), %r13
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3380
leaq -0x60(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movq %r12, %rdx
movq %r13, %rcx
leaq -0x88(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0xf3ac
movq %r12, %rdi
callq 0x34f8
movq -0x60(%rbp), %rbx
movq -0x58(%rbp), %r12
cmpq %r12, %rbx
je 0x898c
movq (%rbx), %rsi
addq %r15, %rsi
movq %r14, %rdi
callq 0x5e98
movq %r13, -0x100(%rbp)
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0xa75c
leaq -0x128(%rbp), %rdi
callq 0x34f8
addq $0x18, %rbx
jmp 0x8954
leaq -0x60(%rbp), %rdi
callq 0x5ec4
movq -0x48(%rbp), %rdi
callq 0x32f0
movq %rax, %rcx
movq -0x40(%rbp), %rbx
leaq -0xf8(%rbp), %r12
jmp 0x8903
leaq -0x88(%rbp), %rdi
callq 0x6d28
leaq -0xd8(%rbp), %rdi
callq 0x69f0
leaq -0x188(%rbp), %rdi
callq 0x9542
movq -0x30(%rbp), %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8a0a
movq %rax, %r14
jmp 0x8a52
movq %rax, %r14
leaq -0xa8(%rbp), %rdi
callq 0x34f8
jmp 0x8a5e
jmp 0x8a05
movq %rax, %r14
jmp 0x8a5e
movq %rax, %r14
jmp 0x8a3d
movq %rax, %r14
leaq -0xf8(%rbp), %rdi
callq 0x34f8
jmp 0x8a3d
movq %rax, %r14
jmp 0x8a34
movq %rax, %r14
leaq -0x128(%rbp), %rdi
callq 0x34f8
leaq -0x60(%rbp), %rdi
callq 0x5ec4
movq -0x30(%rbp), %rdi
callq 0xa104
leaq -0x88(%rbp), %rdi
callq 0x6d28
leaq -0xd8(%rbp), %rdi
callq 0x69f0
leaq -0x188(%rbp), %rdi
callq 0x9542
movq %r14, %rdi
callq 0x3450