// File: /workspace/github_cpp_makefile_star2_O1/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 %rsi, %rax
movq 0x30(%rsi), %rsi
movq %rax, -0x30(%rbp)
subq 0x28(%rax), %rsi
movq %rdx, %r14
sarq $0x5, %rsi
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
leaq -0x80(%rbp), %r15
leaq -0x1f8(%rbp), %rdx
movq %r15, %rdi
callq 0x118a6
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
je 0x11276
sarq $0x2, %rcx
movq -0x30(%rbp), %rdx
movq 0x28(%rdx), %rdx
cmpq $0x1, %rcx
adcq $0x0, %rcx
addq $0x8, %rdx
xorl %esi, %esi
movl (%rdx), %edi
incl %edi
movl %edi, (%rax,%rsi,4)
incq %rsi
addq $0x60, %rdx
cmpq %rsi, %rcx
jne 0x11263
movq 0x30(%r14), %rax
cmpq 0x28(%r14), %rax
movq %r14, -0x40(%rbp)
je 0x113cd
leaq -0x50(%rbp), %rbx
xorl %ecx, %ecx
leaq -0x1f8(%rbp), %r12
movq 0x28(%r14), %rax
movq %rcx, -0x38(%rbp)
leaq (%rcx,%rcx,2), %r14
movq 0x8(%rax,%r14,8), %rcx
cmpq (%rax,%r14,8), %rcx
je 0x1139c
xorl %r15d, %r15d
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x3390
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax,%r14,8), %rax
movl 0x28(%rax,%r15), %ecx
testl %ecx, %ecx
je 0x11311
cmpl $0x1, %ecx
je 0x112f9
cmpl $0x2, %ecx
jne 0x117a8
movq 0x8(%rax,%r15), %rsi
movq 0x10(%rax,%r15), %rdx
leaq -0x1e8(%rbp), %rdi
callq 0x3310
jmp 0x11321
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax,%r15), %xmm0
leaq -0x1e8(%rbp), %rdi
callq 0x3410
jmp 0x11321
movl (%rax,%r15), %esi
leaq -0x1e8(%rbp), %rdi
callq 0x3470
movq %rbx, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
movq %r12, %rdi
leaq -0x60(%rbp), %rsi
callq 0x3360
movq -0x80(%rbp), %rax
movl -0x58(%rbp), %ecx
incl %ecx
movl (%rax,%r13,4), %edx
cmpl %ecx, %edx
cmovgl %edx, %ecx
movl %ecx, (%rax,%r13,4)
movq -0x60(%rbp), %rdi
cmpq %rbx, %rdi
je 0x11361
callq 0x3270
movq %r12, %rdi
callq 0x34e0
incq %r13
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax,%r14,8), %rcx
subq (%rax,%r14,8), %rcx
sarq $0x4, %rcx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
addq $0x30, %r15
cmpq %rcx, %r13
jb 0x112b6
movq -0x40(%rbp), %r14
movq 0x30(%r14), %rax
subq 0x28(%r14), %rax
movq -0x38(%rbp), %rdx
incq %rdx
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rdx, %rcx
cmpq %rax, %rdx
jb 0x11295
movq -0x80(%rbp), %rax
movq -0x78(%rbp), %rcx
movq %rcx, %rsi
subq %rax, %rsi
sarq $0x2, %rsi
incq %rsi
cmpq %rax, %rcx
je 0x113f5
movl (%rax), %edx
addq %rdx, %rsi
addq $0x4, %rax
cmpq %rcx, %rax
jne 0x113e7
movq %rsi, -0x68(%rbp)
testl %esi, %esi
jle 0x11425
movq 0x9bc4(%rip), %r15      # 0x1afc8
leaq 0x32f1(%rip), %r12      # 0x146fc
movq -0x68(%rbp), %rax
movl %eax, %ebx
movl $0x1, %edx
movq %r15, %rdi
movq %r12, %rsi
callq 0x3310
decl %ebx
jne 0x11411
movq 0x9b9c(%rip), %rdi      # 0x1afc8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq 0x9b81(%rip), %rdi      # 0x1afc8
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movq 0x9b6d(%rip), %rdi      # 0x1afc8
leaq 0x329c(%rip), %rsi      # 0x146fe
movl $0x1, %edx
callq 0x3310
movq -0x30(%rbp), %rcx
movq 0x28(%rcx), %rax
cmpq %rax, 0x30(%rcx)
je 0x11517
xorl %ebx, %ebx
movq 0x9b41(%rip), %r12      # 0x1afc8
leaq 0x318f(%rip), %r13      # 0x1461d
leaq (%rbx,%rbx,2), %r15
shlq $0x5, %r15
movq (%rax,%r15), %rsi
movq 0x8(%rax,%r15), %rdx
movq %r12, %rdi
callq 0x3310
movq -0x80(%rbp), %rax
movl (%rax,%rbx,4), %r14d
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rax
subl 0x8(%rax,%r15), %r14d
testl %r14d, %r14d
jle 0x114d6
movl $0x1, %edx
movq %r12, %rdi
movq %r13, %rsi
callq 0x3310
decl %r14d
jne 0x114c1
movl $0x1, %edx
movq %r12, %rdi
leaq 0x3219(%rip), %rsi      # 0x146fe
callq 0x3310
incq %rbx
movq -0x30(%rbp), %rcx
movq 0x28(%rcx), %rax
movq 0x30(%rcx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rcx, %rbx
jb 0x1148e
movq 0x9aaa(%rip), %rdi      # 0x1afc8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq 0x9a8f(%rip), %r14      # 0x1afc8
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movq -0x40(%rbp), %r13
movq 0x30(%r13), %rax
cmpq 0x28(%r13), %rax
je 0x11731
movq $0x0, -0x38(%rbp)
leaq 0x30b3(%rip), %r15      # 0x1461d
movl $0x1, %edx
movq %r14, %rdi
leaq 0x3185(%rip), %rsi      # 0x146fe
callq 0x3310
movq 0x28(%r13), %rax
movq -0x38(%rbp), %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x8(%rax,%rdx,8), %rcx
movq %rdx, -0x30(%rbp)
cmpq (%rax,%rdx,8), %rcx
leaq -0x1f8(%rbp), %r12
je 0x116dc
xorl %ebx, %ebx
movq %r12, %rdi
callq 0x3390
movq 0x28(%r13), %rax
movq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
leaq (%rbx,%rbx,2), %r12
shlq $0x4, %r12
movl 0x28(%rax,%r12), %ecx
addq %r12, %rax
testl %ecx, %ecx
je 0x11605
cmpl $0x1, %ecx
je 0x115f2
cmpl $0x2, %ecx
jne 0x117c7
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
leaq -0x1e8(%rbp), %rdi
callq 0x3310
jmp 0x11613
cvtss2sd 0x4(%rax), %xmm0
leaq -0x1e8(%rbp), %rdi
callq 0x3410
jmp 0x11613
movl (%rax), %esi
leaq -0x1e8(%rbp), %rdi
callq 0x3470
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
movq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
leaq -0x1f8(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x3360
movq -0x80(%rbp), %rax
movq %r13, %rcx
movl (%rax,%rbx,4), %r13d
subl -0x58(%rbp), %r13d
movq 0x28(%rcx), %rax
movq -0x30(%rbp), %rcx
addq (%rax,%rcx,8), %r12
movq %r12, %rdi
callq 0x13254
testl %r13d, %r13d
jle 0x11674
movl $0x1, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x3310
decl %r13d
jne 0x1165f
movl $0x1, %edx
movq %r14, %rdi
leaq 0x307b(%rip), %rsi      # 0x146fe
callq 0x3310
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x1169a
callq 0x3270
leaq -0x1f8(%rbp), %r12
movq %r12, %rdi
callq 0x34e0
movq -0x40(%rbp), %r13
movq 0x28(%r13), %rax
movq -0x30(%rbp), %rdx
movq 0x8(%rax,%rdx,8), %rcx
subq (%rax,%rdx,8), %rcx
incq %rbx
sarq $0x4, %rcx
movabsq $-0x5555555555555555, %rax # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
cmpq %rcx, %rbx
jb 0x115a6
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq %r14, %rdi
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movq 0x30(%r13), %rax
subq 0x28(%r13), %rax
movq -0x38(%rbp), %rdx
incq %rdx
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
movq %rdx, -0x38(%rbp)
cmpq %rax, %rdx
jb 0x1156a
movq -0x68(%rbp), %r12
testl %r12d, %r12d
jle 0x1175d
movq 0x9887(%rip), %rbx      # 0x1afc8
leaq 0x2fb4(%rip), %r15      # 0x146fc
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3310
decl %r12d
jne 0x11748
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x3280
movsbl %al, %esi
movq 0x984d(%rip), %rdi      # 0x1afc8
callq 0x3040
movq %rax, %rdi
callq 0x31c0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x11796
callq 0x3270
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29d0(%rip), %rdi      # 0x1417f
leaq 0x2ef2(%rip), %rsi      # 0x146a8
leaq 0x2efa(%rip), %rcx      # 0x146b7
movl $0x176, %edx            # imm = 0x176
callq 0x31a0
leaq 0x29b1(%rip), %rdi      # 0x1417f
leaq 0x2ed3(%rip), %rsi      # 0x146a8
leaq 0x2edb(%rip), %rcx      # 0x146b7
movl $0x195, %edx            # imm = 0x195
callq 0x31a0
jmp 0x1180d
jmp 0x1180d
jmp 0x1180d
jmp 0x1180d
jmp 0x1180d
jmp 0x1180d
jmp 0x1180d
jmp 0x117f8
jmp 0x11814
movq %rax, %r14
jmp 0x11829
movq %rax, %r14
movq -0x60(%rbp), %rdi
cmpq %rbx, %rdi
jne 0x11824
jmp 0x11829
jmp 0x1180d
movq %rax, %r14
jmp 0x11835
jmp 0x11814
movq %rax, %r14
movq -0x60(%rbp), %rdi
leaq -0x50(%rbp), %rax
cmpq %rax, %rdi
je 0x11829
callq 0x3270
leaq -0x1f8(%rbp), %rdi
callq 0x34e0
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x11843
callq 0x3270
movq %r14, %rdi
callq 0x3480