// File: /workspace/github_cpp_makefile_star2_O2/zimpha[P]MiniSQL/interpreter.cc
// Function: Interpreter::printSelectResult(Table const&, Response const&)
void Interpreter::printSelectResult(const Table &nt, const Response &res) {
    std::vector<int> space(nt.attributes.size());
    for (size_t i = 0; i < space.size(); ++ i) {
        space[i] = nt.attributes[i].name.length() + 1;
    }
    for (size_t i = 0; i < res.result.size(); ++ i) {
        for (size_t j = 0; j < res.result[i].size(); ++ j) {
            std::strstream sin;
            switch (res.result[i][j].type) {
            case 0:
                sin << res.result[i][j].i;
                break;
            case 1:
                sin << res.result[i][j].f;
                break;
            case 2:
                sin << res.result[i][j].s;
                break;
            default: assert(false);
            }
            std::string s; sin >> s;
            space[j] = std::max(space[j], (int)s.length() + 1);
        }
    }
    int sum = std::accumulate(space.begin(), space.end(), space.size() + 1);
    for (int _ = 0; _ < sum; ++ _) std::cout << "-"; 
    std::cout << std::endl;
    std::cout << "|";
    for (size_t i = 0; i < nt.attributes.size(); ++ i) {
        std::cout << nt.attributes[i].name;
        int extra = space[i] - nt.attributes[i].name.length();
        for (int _ = 0; _ < extra; ++ _) std::cout << " ";
        std::cout << "|";
    }
    std::cout << std::endl;
    for (size_t i = 0; i < res.result.size(); ++ i) {
        std::cout << "|";
        for (size_t j = 0; j < res.result[i].size(); ++ j) {
            std::strstream sin;
            switch (res.result[i][j].type) {
            case 0:
                sin << res.result[i][j].i;
                break;
            case 1:
                sin << res.result[i][j].f;
                break;
            case 2:
                sin << res.result[i][j].s;
                break;
            default: assert(false);
            }
            std::string s; sin >> s;
            int extra = space[j] - s.length();
            res.result[i][j].print();
            for (int _ = 0; _ < extra; ++ _) std::cout << " ";
            std::cout << "|";
        }
        std::cout << std::endl;
    }
    for (int _ = 0; _ < sum; ++ _) std::cout << "-";
    std::cout << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rdx, -0x30(%rbp)
movq %rsi, %rbx
movq 0x30(%rsi), %rax
subq 0x28(%rsi), %rax
pushq $0x60
popq %rcx
cqto
idivq %rcx
leaq -0x80(%rbp), %r15
leaq -0x200(%rbp), %rdx
movq %r15, %rdi
movq %rax, %rsi
callq 0xe850
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
movq %rbx, -0x38(%rbp)
movq 0x28(%rbx), %rdx
addq $0x8, %rdx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0xe3c0
movl (%rdx), %edi
incl %edi
movl %edi, (%rax,%rsi,4)
incq %rsi
addq $0x60, %rdx
jmp 0xe3ab
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rcx
xorl %edi, %edi
leaq -0x200(%rbp), %r12
leaq -0x68(%rbp), %r13
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rax
subq %rcx, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
cmpq %rax, %rdi
jae 0xe4dd
movq %rdi, -0x40(%rbp)
imulq $0x18, %rdi, %r14
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0x8(%rcx,%r14), %rax
subq (%rcx,%r14), %rax
cqto
pushq $0x30
popq %rsi
idivq %rsi
cmpq %rax, %r15
jae 0xe4d1
movq %r12, %rdi
callq 0x3370
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax,%r14), %rax
movl 0x28(%rax,%rbx), %ecx
testl %ecx, %ecx
je 0xe46c
cmpl $0x1, %ecx
je 0xe458
cmpl $0x2, %ecx
jne 0xe7b6
leaq (%rax,%rbx), %rsi
addq $0x8, %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x3250
jmp 0xe47b
movss 0x4(%rax,%rbx), %xmm0
leaq -0x1f0(%rbp), %rdi
callq 0x31e0
jmp 0xe47b
movl (%rax,%rbx), %esi
leaq -0x1f0(%rbp), %rdi
callq 0x3440
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x3330
movq -0x80(%rbp), %rax
movl -0x60(%rbp), %ecx
incl %ecx
movl (%rax,%r15,4), %edx
cmpl %ecx, %edx
cmovgl %edx, %ecx
movl %ecx, (%rax,%r15,4)
movq %r13, %rdi
callq 0x34f8
movq %r12, %rdi
callq 0x34a0
incq %r15
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x30, %rbx
jmp 0xe3fe
movq -0x40(%rbp), %rdi
incq %rdi
jmp 0xe3d5
movq -0x80(%rbp), %rcx
movq -0x78(%rbp), %rdx
movq %rdx, %rax
subq %rcx, %rax
sarq $0x2, %rax
incq %rax
cmpq %rdx, %rcx
je 0xe502
movl (%rcx), %esi
addq %rsi, %rax
addq $0x4, %rcx
jmp 0xe4f2
xorl %ebx, %ebx
testl %eax, %eax
cmovgl %eax, %ebx
movq 0xaab8(%rip), %r15      # 0x18fc8
leaq 0x31b5(%rip), %r12      # 0x116cc
movl %ebx, -0x44(%rbp)
subl $0x1, %ebx
jb 0xe52c
movq %r15, %rdi
movq %r12, %rsi
callq 0x3280
jmp 0xe51a
movq 0xaa95(%rip), %rdi      # 0x18fc8
callq 0x3120
movq 0xaa89(%rip), %rdi      # 0x18fc8
leaq 0x3188(%rip), %rsi      # 0x116ce
callq 0x3280
movq 0xaa76(%rip), %r15      # 0x18fc8
leaq 0x3094(%rip), %r13      # 0x115ed
xorl %r14d, %r14d
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rsi
movq 0x30(%rax), %rax
subq %rsi, %rax
cqto
pushq $0x60
popq %rcx
idivq %rcx
cmpq %rax, %r14
jae 0xe5cc
imulq $0x60, %r14, %r12
addq %r12, %rsi
movq %r15, %rdi
callq 0x3250
movq -0x80(%rbp), %rax
movl (%rax,%r14,4), %ebx
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
subl 0x8(%rax,%r12), %ebx
testl %ebx, %ebx
movl $0x0, %eax
cmovlel %eax, %ebx
subl $0x1, %ebx
jb 0xe5b8
movq %r15, %rdi
movq %r13, %rsi
callq 0x3280
jmp 0xe5a6
movq %r15, %rdi
leaq 0x310c(%rip), %rsi      # 0x116ce
callq 0x3280
incq %r14
jmp 0xe55c
movq 0xa9f5(%rip), %rdi      # 0x18fc8
callq 0x3120
movq 0xa9e9(%rip), %r15      # 0x18fc8
leaq -0x200(%rbp), %rbx
leaq 0x3000(%rip), %r12      # 0x115ed
xorl %r14d, %r14d
movq -0x30(%rbp), %rcx
movq 0x30(%rcx), %rax
subq 0x28(%rcx), %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rax, %r14
jae 0xe76e
movq %r15, %rdi
leaq 0x30b7(%rip), %rsi      # 0x116ce
callq 0x3280
imulq $0x18, %r14, %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
movq %r14, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x38(%rbp), %rdx
movq 0x8(%rcx,%rdx), %rax
subq (%rcx,%rdx), %rax
cqto
pushq $0x30
popq %rcx
idivq %rcx
cmpq %rax, %r13
jae 0xe75e
movq %rbx, %rdi
callq 0x3370
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
movq (%rax,%rcx), %rsi
imulq $0x30, %r13, %r14
movl 0x28(%rsi,%r14), %eax
addq %r14, %rsi
testl %eax, %eax
je 0xe6af
cmpl $0x1, %eax
je 0xe69c
cmpl $0x2, %eax
jne 0xe7d5
addq $0x8, %rsi
leaq -0x1f0(%rbp), %rdi
callq 0x3250
jmp 0xe6bd
movss 0x4(%rsi), %xmm0
leaq -0x1f0(%rbp), %rdi
callq 0x31e0
jmp 0xe6bd
movl (%rsi), %esi
leaq -0x1f0(%rbp), %rdi
callq 0x3440
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
andq $0x0, -0x60(%rbp)
movb $0x0, -0x58(%rbp)
movq %rbx, %rdi
leaq -0x68(%rbp), %rsi
callq 0x3330
movq -0x80(%rbp), %rax
movq %r13, -0x40(%rbp)
movl (%rax,%r13,4), %r13d
movq -0x60(%rbp), %rbx
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x38(%rbp), %rcx
addq (%rax,%rcx), %r14
movq %r14, %rdi
callq 0xfbc4
movq -0x88(%rbp), %r14
subl %ebx, %r13d
testl %r13d, %r13d
movl $0x0, %eax
cmovlel %eax, %r13d
subl $0x1, %r13d
jb 0xe72b
movq %r15, %rdi
movq %r12, %rsi
callq 0x3280
jmp 0xe718
movq %r15, %rdi
leaq 0x2f99(%rip), %rsi      # 0x116ce
callq 0x3280
leaq -0x68(%rbp), %rdi
callq 0x34f8
leaq -0x200(%rbp), %rbx
movq %rbx, %rdi
callq 0x34a0
movq -0x40(%rbp), %r13
incq %r13
jmp 0xe62e
movq %r15, %rdi
callq 0x3120
incq %r14
jmp 0xe5f0
movq 0xa853(%rip), %rbx      # 0x18fc8
leaq 0x2f50(%rip), %r14      # 0x116cc
subl $0x1, -0x44(%rbp)
jb 0xe78f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3280
jmp 0xe77c
movq 0xa832(%rip), %rdi      # 0x18fc8
callq 0x3120
leaq -0x80(%rbp), %rdi
callq 0xe9ca
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29c2(%rip), %rdi      # 0x1117f
leaq 0x2eb4(%rip), %rsi      # 0x11678
leaq 0x2ebc(%rip), %rcx      # 0x11687
movl $0x176, %edx            # imm = 0x176
callq 0x31a0
leaq 0x29a3(%rip), %rdi      # 0x1117f
leaq 0x2e95(%rip), %rsi      # 0x11678
leaq 0x2e9d(%rip), %rcx      # 0x11687
movl $0x195, %edx            # imm = 0x195
callq 0x31a0
jmp 0xe80f
jmp 0xe80f
jmp 0xe80f
jmp 0xe80f
jmp 0xe80f
jmp 0xe80f
jmp 0xe80a
jmp 0xe80f
jmp 0xe816
jmp 0xe80f
jmp 0xe816
movq %rax, %rbx
jmp 0xe822
movq %rax, %rbx
jmp 0xe82e
jmp 0xe816
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x34f8
leaq -0x200(%rbp), %rdi
callq 0x34a0
leaq -0x80(%rbp), %rdi
callq 0xe9ca
movq %rbx, %rdi
callq 0x3450