// File: /workspace/github_cpp_makefile_star2_O2/Overv[P]pqpp/example.cc
// Function: main
int main() {
    auto db = pq::connection("host=127.0.0.1 dbname=test user=test password=test");

    db.exec("CREATE TABLE people (name TEXT, age INTEGER)");

    auto stmt = db.prepare("inserter", "INSERT INTO people VALUES ($1, $2)", 2);
    db.exec(stmt, "John", 26);
    db.exec(stmt, "Fred", 53);
    db.exec(stmt, "Lisa", 37);
    db.exec(stmt, nullptr, 18);

    auto rows = db.exec("SELECT * FROM people ORDER BY age ASC");

    for (auto& row : rows) {
        int age = row["age"];
        std::string name = row["name"];

        if (!row["name"].is_null()) {
            std::cout << name << " is " << age << " years old" << std::endl;
        }
    }

    db.exec("DROP TABLE people");

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
leaq 0x2b04(%rip), %rsi      # 0x500a
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x22c0
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x29d4
leaq 0x40(%rsp), %rdi
callq 0x21f0
leaq 0x2b08(%rip), %rsi      # 0x503d
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x22c0
leaq 0x120(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x2a7e
leaq 0x120(%rsp), %rdi
callq 0x2b88
leaq 0x40(%rsp), %rdi
callq 0x21f0
leaq 0x2af1(%rip), %rsi      # 0x506a
leaq 0x20(%rsp), %rdi
leaq 0x90(%rsp), %rdx
callq 0x22c0
leaq 0x2ae1(%rip), %rsi      # 0x5073
leaq 0x68(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x22c0
leaq 0x40(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x68(%rsp), %rcx
pushq $0x2
popq %r8
callq 0x2baa
leaq 0x68(%rsp), %rdi
callq 0x21f0
leaq 0x20(%rsp), %rdi
callq 0x21f0
leaq 0x2abd(%rip), %rcx      # 0x5096
leaq 0x108(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
pushq $0x1a
popq %r8
callq 0x2ca6
leaq 0x108(%rsp), %rdi
callq 0x2b88
leaq 0x2a93(%rip), %rcx      # 0x509b
leaq 0xf0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
pushq $0x35
popq %r8
callq 0x2ca6
leaq 0xf0(%rsp), %rdi
callq 0x2b88
leaq 0x2a69(%rip), %rcx      # 0x50a0
leaq 0xd8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
pushq $0x25
popq %r8
callq 0x2ca6
leaq 0xd8(%rsp), %rdi
callq 0x2b88
leaq 0xc0(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x40(%rsp), %rdx
pushq $0x12
popq %r8
xorl %ecx, %ecx
callq 0x2dac
leaq 0xc0(%rsp), %rdi
callq 0x2b88
leaq 0x2a15(%rip), %rsi      # 0x50a5
leaq 0x20(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x22c0
leaq 0x90(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x2a7e
leaq 0x20(%rsp), %rbx
movq %rbx, %rdi
callq 0x21f0
movq 0x90(%rsp), %r14
movq 0x98(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x68(%rsp), %r12
leaq 0x29e8(%rip), %r13      # 0x50cf
cmpq 0x88(%rsp), %r14
je 0x27d0
movq %rbx, %rdi
leaq 0x29cc(%rip), %rsi      # 0x50cb
movq %r12, %rdx
callq 0x22c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2eb2
movq %rax, %rdi
callq 0x247c
movl %eax, %r15d
movq %rbx, %rdi
callq 0x21f0
movq %r12, %rdi
movq %r13, %rsi
leaq 0xf(%rsp), %rdx
callq 0x22c0
movq %r14, %rdi
movq %r12, %rsi
callq 0x2eb2
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2140
movq %r12, %rdi
callq 0x21f0
movq %r12, %rdi
movq %r13, %rsi
leaq 0xf(%rsp), %rdx
callq 0x22c0
movq %r14, %rdi
movq %r12, %rsi
callq 0x2eb2
movb 0x20(%rax), %bpl
movq %r12, %rdi
callq 0x21f0
testb %bpl, %bpl
jne 0x27bf
movq 0x681a(%rip), %rdi      # 0x8fa0
movq %rbx, %rsi
callq 0x20e0
movq %rax, %rdi
leaq 0x293c(%rip), %rsi      # 0x50d4
callq 0x2160
movq %rax, %rdi
movl %r15d, %esi
callq 0x20f0
movq %rax, %rdi
leaq 0x2927(%rip), %rsi      # 0x50d9
callq 0x2160
movq %rax, %rdi
callq 0x22d0
movq %rbx, %rdi
callq 0x21f0
addq $0x30, %r14
jmp 0x26e7
leaq 0x290d(%rip), %rsi      # 0x50e4
leaq 0x20(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x22c0
leaq 0xa8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
leaq 0x20(%rsp), %rdx
callq 0x2a7e
leaq 0xa8(%rsp), %rdi
callq 0x2b88
leaq 0x20(%rsp), %rdi
callq 0x21f0
leaq 0x90(%rsp), %rdi
callq 0x2b88
leaq 0x40(%rsp), %rdi
callq 0x21f0
leaq 0x18(%rsp), %rdi
callq 0x3694
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28bd
jmp 0x28aa
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x21f0
jmp 0x28d7
jmp 0x2894
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x21f0
jmp 0x2870
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
jmp 0x28dc
jmp 0x287b
jmp 0x2894
movq %rax, %rbx
jmp 0x28e1
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x21f0
jmp 0x28eb
movq %rax, %rbx
jmp 0x28eb
movq %rax, %rbx
jmp 0x28d7
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x21f0
jmp 0x28c0
jmp 0x28aa
movq %rax, %rbx
jmp 0x28ca
jmp 0x28bd
jmp 0x28bd
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x28c5
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x21f0
leaq 0x90(%rsp), %rdi
callq 0x2b88
leaq 0x40(%rsp), %rdi
callq 0x21f0
leaq 0x18(%rsp), %rdi
callq 0x3694
movq %rbx, %rdi
callq 0x21d0