// File: /workspace/github_cpp_makefile_star2_O3/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 $0x128, %rsp            # imm = 0x128
leaq 0x40(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2711(%rip), %rsi      # 0x5026
leaq 0x273c(%rip), %rdx      # 0x5058
leaq 0x30(%rsp), %rdi
callq 0x35dc
leaq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x2e48
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2944
callq 0x2180
leaq 0x30(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x2706(%rip), %rsi      # 0x5059
leaq 0x272b(%rip), %rdx      # 0x5085
callq 0x35dc
leaq 0x110(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x2f12
leaq 0x110(%rsp), %rdi
callq 0x3002
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2992
callq 0x2180
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x26e4(%rip), %rsi      # 0x5086
leaq 0x26e5(%rip), %rdx      # 0x508e
movq %rsp, %rdi
callq 0x35dc
leaq 0x68(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x26ce(%rip), %rsi      # 0x508f
leaq 0x26e9(%rip), %rdx      # 0x50b1
leaq 0x58(%rsp), %rdi
callq 0x35dc
leaq 0x30(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
leaq 0x58(%rsp), %rcx
movl $0x2, %r8d
callq 0x3042
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x29fe
callq 0x2180
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2a11
callq 0x2180
leaq 0x269a(%rip), %rcx      # 0x50b2
leaq 0xf8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl $0x1a, %r8d
callq 0x3126
leaq 0xf8(%rsp), %rdi
callq 0x3002
leaq 0x266e(%rip), %rcx      # 0x50b7
leaq 0xe0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl $0x35, %r8d
callq 0x3126
leaq 0xe0(%rsp), %rdi
callq 0x3002
leaq 0x2642(%rip), %rcx      # 0x50bc
leaq 0xc8(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdx
movl $0x25, %r8d
callq 0x3126
leaq 0xc8(%rsp), %rdi
callq 0x3002
leaq 0xb0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
leaq 0x30(%rsp), %rdx
xorl %ecx, %ecx
movl $0x12, %r8d
callq 0x3218
leaq 0xb0(%rsp), %rdi
callq 0x3002
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x25df(%rip), %rsi      # 0x50c1
leaq 0x25fd(%rip), %rdx      # 0x50e6
callq 0x35dc
leaq 0x80(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x2f12
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2b16
callq 0x2180
movq 0x80(%rsp), %rbx
movq 0x88(%rsp), %rax
movq %rax, 0x78(%rsp)
cmpq %rax, %rbx
je 0x2ca9
movq %rsp, %r12
leaq 0x58(%rsp), %r14
leaq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq %r12, %rdi
leaq 0x2598(%rip), %rsi      # 0x50e7
leaq 0x2594(%rip), %rdx      # 0x50ea
callq 0x35dc
movq %rbx, %rdi
movq %r12, %rsi
callq 0x330a
movq %rax, %rdi
callq 0x253c
movl %eax, %r15d
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2b84
callq 0x2180
movq %rbp, 0x58(%rsp)
movq %r14, %rdi
leaq 0x2558(%rip), %rsi      # 0x50eb
leaq 0x2555(%rip), %rdx      # 0x50ef
callq 0x35dc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x330a
leaq 0x10(%rsp), %rcx
movq %rcx, (%rsp)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3546
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2bd4
callq 0x2180
movq %rbp, 0x58(%rsp)
movq %r14, %rdi
leaq 0x2508(%rip), %rsi      # 0x50eb
leaq 0x2505(%rip), %rdx      # 0x50ef
callq 0x35dc
movq %rbx, %rdi
movq %r14, %rsi
callq 0x330a
movb 0x20(%rax), %r13b
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2c0d
callq 0x2180
testb %r13b, %r13b
jne 0x2c87
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq 0x63a6(%rip), %rdi      # 0x8fc8
callq 0x2320
movq %rax, %r13
movl $0x4, %edx
movq %rax, %rdi
leaq 0x24b7(%rip), %rsi      # 0x50f0
callq 0x2320
movq %r13, %rdi
movl %r15d, %esi
callq 0x2120
movq %rax, %r15
movl $0xa, %edx
movq %rax, %rdi
leaq 0x249a(%rip), %rsi      # 0x50f5
callq 0x2320
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2360
movsbl %al, %esi
movq %r15, %rdi
callq 0x2190
movq %rax, %rdi
callq 0x2160
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2c9a
callq 0x2180
addq $0x30, %rbx
cmpq 0x78(%rsp), %rbx
jne 0x2b3c
movq %rsp, %rdi
leaq 0x10(%rsp), %rax
movq %rax, (%rdi)
leaq 0x2445(%rip), %rsi      # 0x5100
leaq 0x244f(%rip), %rdx      # 0x5111
callq 0x35dc
leaq 0x98(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movq %rsp, %rdx
leaq 0x40(%rsp), %rbx
callq 0x2f12
leaq 0x98(%rsp), %rdi
callq 0x3002
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d01
callq 0x2180
leaq 0x80(%rsp), %rdi
callq 0x3002
movq 0x30(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2d1d
callq 0x2180
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2d2c
callq 0x345a
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2df9
jmp 0x2dcd
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2d65
callq 0x2180
jmp 0x2d65
movq %rax, %rbx
leaq 0x40(%rsp), %r14
jmp 0x2e21
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2d86
callq 0x2180
jmp 0x2d86
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
jne 0x2e2b
jmp 0x2e30
jmp 0x2da1
jmp 0x2dc6
movq %rax, %rbx
jmp 0x2e30
movq %rax, %rbx
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e3f
callq 0x2180
jmp 0x2e3f
movq %rax, %rbx
jmp 0x2e3f
movq %rax, %rbx
jmp 0x2e21
jmp 0x2dcd
movq %rax, %rbx
jmp 0x2e0f
jmp 0x2df9
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x2dfc
callq 0x2180
jmp 0x2dfc
jmp 0x2df9
movq %rax, %rbx
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x2e0a
jmp 0x2e0f
movq %rax, %rbx
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x2e0f
callq 0x2180
leaq 0x40(%rsp), %r14
leaq 0x80(%rsp), %rdi
callq 0x3002
movq 0x30(%rsp), %rdi
cmpq %r14, %rdi
je 0x2e30
callq 0x2180
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2e3f
callq 0x345a
movq %rbx, %rdi
callq 0x2200
nop