// File: /workspace/github_cpp_makefile_star2_O2/eiskalteschatten[P]developersnotebook/src/models/AbstractSqliteModel.cpp
// Function: AbstractSqliteModel::select_one()
void AbstractSqliteModel::select_one() {
    try {
        SqliteConnectionManager connection_manager;

        std::string sql = "SELECT * FROM " + table_schema->table_name + " WHERE ID=" + std::to_string(id) + ";";
        int connection;
        sqlite3_stmt *stmt;

        connection = sqlite3_prepare_v2(connection_manager.get_db(), sql.c_str(), -1, &stmt, NULL);

        if(connection != SQLITE_OK) {
            fprintf(stderr, "SQL error: %s\n", sqlite3_errmsg(connection_manager.get_db()));
        }

        while ((connection = sqlite3_step(stmt)) == SQLITE_ROW) {
            for (int i = 0; i < sqlite3_column_count(stmt); i++) {
                std::string column_name = std::string(reinterpret_cast<const char*>(sqlite3_column_name(stmt, i)));
                std::string column_text = std::string(reinterpret_cast<const char*>(sqlite3_column_text(stmt, i)));
                contents[column_name]   = column_text;
            }

            break; // We only want one row. There should only be one with the id, but just be sure.
        }

        sqlite3_finalize(stmt);

        fill_model();
    }
    catch(const std::exception& e) {
        fprintf(stderr, "An exception occured while trying to set up the database: %s\n", e.what());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rbx
movq %rsp, %rdi
callq 0xf86c
movq 0x8(%rbx), %rdx
leaq 0x101f5(%rip), %rsi     # 0x228c6
leaq 0x8(%rsp), %rdi
callq 0xb117
leaq 0x101f3(%rip), %rdx     # 0x228d5
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0xb059
movl 0x58(%rbx), %esi
leaq 0x68(%rsp), %rdi
callq 0xe22b
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x12de5
leaq 0xfe6b(%rip), %rdx      # 0x22584
leaq 0x88(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0xb059
leaq 0x48(%rsp), %rdi
callq 0x9120
leaq 0x68(%rsp), %rdi
callq 0x9120
leaq 0x28(%rsp), %rdi
callq 0x9120
leaq 0x8(%rsp), %rdi
callq 0x9120
movq (%rsp), %rdi
movq 0x88(%rsp), %rsi
pushq $-0x1
popq %rdx
leaq 0x8(%rsp), %rcx
xorl %r8d, %r8d
callq 0x8a80
testl %eax, %eax
jne 0x12844
movq 0x8(%rsp), %rdi
callq 0x8320
cmpl $0x64, %eax
jne 0x1280b
leaq 0x10(%rbx), %r14
xorl %ebp, %ebp
leaq 0x48(%rsp), %r15
leaq 0x28(%rsp), %r12
leaq 0x68(%rsp), %r13
movq 0x8(%rsp), %rdi
callq 0x8db0
cmpl %eax, %ebp
jge 0x1280b
movq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x8880
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xb078
movq 0x8(%rsp), %rdi
movl %ebp, %esi
callq 0x8130
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xb078
movq %r14, %rdi
movq %r15, %rsi
callq 0x12e4c
movq %rax, %rdi
movq %r12, %rsi
callq 0x8f00
movq %r12, %rdi
callq 0x9120
movq %r15, %rdi
callq 0x9120
incl %ebp
jmp 0x1279f
movq 0x8(%rsp), %rdi
callq 0x8b10
movq (%rbx), %rax
movq %rbx, %rdi
callq *(%rax)
leaq 0x88(%rsp), %rdi
callq 0x9120
movq %rsp, %rdi
callq 0xf8c0
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1f745(%rip), %rax     # 0x31f90
movq (%rax), %r14
movq (%rsp), %rdi
callq 0x8ff0
leaq 0xfd28(%rip), %rsi      # 0x22586
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8250
jmp 0x12777
movq %rdx, %rbx
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x9120
jmp 0x12888
movq %rdx, %rbx
movq %rax, %r14
leaq 0x68(%rsp), %rdi
callq 0x9120
jmp 0x1289a
movq %rdx, %rbx
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x9120
jmp 0x128ac
movq %rdx, %rbx
movq %rax, %r14
leaq 0x8(%rsp), %rdi
jmp 0x128fd
movq %rdx, %rbx
movq %rax, %r14
jmp 0x12902
movq %rdx, %rbx
movq %rax, %r14
jmp 0x1290a
jmp 0x128d3
jmp 0x128d3
jmp 0x128c9
movq %rdx, %rbx
movq %rax, %r14
jmp 0x128eb
jmp 0x128d3
movq %rdx, %rbx
movq %rax, %r14
jmp 0x128f5
movq %rdx, %rbx
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x9120
leaq 0x48(%rsp), %rdi
callq 0x9120
leaq 0x88(%rsp), %rdi
callq 0x9120
movq %rsp, %rdi
callq 0xf8c0
movq %r14, %rdi
cmpl $0x1, %ebx
jne 0x12948
callq 0x8090
movq 0x1f672(%rip), %rcx     # 0x31f90
movq (%rcx), %rbx
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0xfc85(%rip), %rsi      # 0x225b6
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8250
callq 0x89d0
jmp 0x12832
callq 0x87f0
nop