// File: /workspace/github_cpp_makefile_star2_O3/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, %r13
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
leaq -0x188(%rbp), %r12
movq %r12, %rdi
callq 0xb9f0
leaq -0xc8(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x11cca
leaq -0xf0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x88b4
movq %r13, %r15
leaq -0x130(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x100(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x12c42
movq -0x100(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa535
callq 0x3270
leaq -0xe0(%rbp), %rdi
callq 0xee88
xorps %xmm0, %xmm0
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x13198
cmpl $-0x1, %eax
je 0xa699
leaq -0x128(%rbp), %rcx
movq 0x10(%rcx), %rdx
cmpq %rcx, %rdx
je 0xa699
leaq -0x58(%rbp), %r12
cltq
leaq -0x68(%rbp), %r13
leaq (%rax,%rax,2), %rbx
shlq $0x4, %rbx
movq %r15, -0x40(%rbp)
movq %r15, %rax
movq %rdx, -0x48(%rbp)
movq 0x20(%rdx), %r15
movq %r12, -0x68(%rbp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x88b4
leaq -0x80(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
movq %r13, %rdx
movq %r15, %rcx
leaq -0xe0(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x128f0
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xa5e2
callq 0x3270
movq -0x80(%rbp), %r13
movq -0x78(%rbp), %r14
cmpq %r14, %r13
je 0xa668
movq (%r13), %r12
movq (%r12,%rbx), %rax
movq %rax, -0xb8(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq 0x8(%r12,%rbx), %rsi
movq 0x10(%r12,%rbx), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x88b4
addq %rbx, %r12
movl 0x28(%r12), %eax
movl %eax, -0x90(%rbp)
movq %r15, -0x88(%rbp)
movq -0x30(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xce36
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xa662
callq 0x3270
addq $0x18, %r13
jmp 0xa5ea
leaq -0x80(%rbp), %rdi
callq 0x7a6a
movq -0x48(%rbp), %rdi
callq 0x3320
movq %rax, %rdx
leaq -0x128(%rbp), %rax
cmpq %rax, %rdx
movq -0x40(%rbp), %r15
leaq -0x58(%rbp), %r12
leaq -0x68(%rbp), %r13
jne 0xa592
leaq -0xe0(%rbp), %rdi
callq 0x8854
leaq -0x130(%rbp), %rdi
callq 0x859c
leaq -0x188(%rbp), %rdi
callq 0xba7a
movq -0x30(%rbp), %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa6f7
movq %rax, %r14
jmp 0xa74d
movq %rax, %r14
movq -0x100(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa759
callq 0x3270
jmp 0xa759
jmp 0xa6f2
movq %rax, %r14
jmp 0xa759
movq %rax, %r14
jmp 0xa738
movq %rax, %r14
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xa738
callq 0x3270
jmp 0xa738
movq %rax, %r14
jmp 0xa72f
movq %rax, %r14
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xa72f
callq 0x3270
leaq -0x80(%rbp), %rdi
callq 0x7a6a
movq -0x30(%rbp), %rdi
callq 0xc97e
leaq -0xe0(%rbp), %rdi
callq 0x8854
leaq -0x130(%rbp), %rdi
callq 0x859c
leaq -0x188(%rbp), %rdi
callq 0xba7a
movq %r14, %rdi
callq 0x3480