// File: /workspace/github_cpp_makefile_star2_O1/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 0xb89a
leaq -0xc8(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x11b72
leaq -0xf0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq (%r13), %rsi
movq 0x8(%r13), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x8766
movq %r13, %r15
leaq -0x130(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x100(%rbp), %rdx
movq -0x38(%rbp), %rcx
callq 0x12ade
movq -0x100(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa3e9
callq 0x3270
leaq -0xe0(%rbp), %rdi
callq 0xed7c
xorps %xmm0, %xmm0
movq -0x30(%rbp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq -0x38(%rbp), %rdi
movq %r14, %rsi
callq 0x13068
cmpl $-0x1, %eax
je 0xa54d
leaq -0x128(%rbp), %rcx
movq 0x10(%rcx), %rdx
cmpq %rcx, %rdx
je 0xa54d
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 0x8766
leaq -0x80(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
movq %r13, %rdx
movq %r15, %rcx
leaq -0xe0(%rbp), %r8
movq -0x38(%rbp), %r9
callq 0x1278c
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xa496
callq 0x3270
movq -0x80(%rbp), %r13
movq -0x78(%rbp), %r14
cmpq %r14, %r13
je 0xa51c
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 0x8766
addq %rbx, %r12
movl 0x28(%r12), %eax
movl %eax, -0x90(%rbp)
movq %r15, -0x88(%rbp)
movq -0x30(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xccf2
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xa516
callq 0x3270
addq $0x18, %r13
jmp 0xa49e
leaq -0x80(%rbp), %rdi
callq 0x7926
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 0xa446
leaq -0xe0(%rbp), %rdi
callq 0x870c
leaq -0x130(%rbp), %rdi
callq 0x8454
leaq -0x188(%rbp), %rdi
callq 0xb924
movq -0x30(%rbp), %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xa5ab
movq %rax, %r14
jmp 0xa601
movq %rax, %r14
movq -0x100(%rbp), %rdi
cmpq %rbx, %rdi
je 0xa60d
callq 0x3270
jmp 0xa60d
jmp 0xa5a6
movq %rax, %r14
jmp 0xa60d
movq %rax, %r14
jmp 0xa5ec
movq %rax, %r14
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0xa5ec
callq 0x3270
jmp 0xa5ec
movq %rax, %r14
jmp 0xa5e3
movq %rax, %r14
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xa5e3
callq 0x3270
leaq -0x80(%rbp), %rdi
callq 0x7926
movq -0x30(%rbp), %rdi
callq 0xc844
leaq -0xe0(%rbp), %rdi
callq 0x870c
leaq -0x130(%rbp), %rdi
callq 0x8454
leaq -0x188(%rbp), %rdi
callq 0xb924
movq %r14, %rdi
callq 0x3480