// File: /workspace/github_cpp_makefile_star2_O1/eiskalteschatten[P]developersnotebook/src/models/AbstractSqliteModel.cpp
// Function: AbstractSqliteModel::select_query(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void AbstractSqliteModel::select_query(std::string sql) {
    try {
        SqliteConnectionManager connection_manager;

        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) {
            tableRowMap 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)));
                row[column_name]        = column_text;
            }

            full_table.push_back(row);
        }

        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 $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x10(%rsp), %rdi
callq 0x12e2c
movq 0x10(%rsp), %rdi
movq (%rbx), %rsi
leaq 0x8(%rsp), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x8a60
testl %eax, %eax
jne 0x17331
leaq 0x58(%rsp), %r14
movq %r15, 0x18(%rsp)
leaq 0x40(%r15), %rax
movq %rax, 0x20(%rsp)
leaq 0x28(%rsp), %r15
leaq 0x48(%rsp), %r12
leaq 0x7(%rsp), %r13
leaq 0x68(%rsp), %rbp
movq 0x8(%rsp), %rdi
callq 0x8310
cmpl $0x64, %eax
jne 0x17301
movl $0x0, 0x70(%rsp)
xorl %ebx, %ebx
movq %rbx, 0x78(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x80(%rsp)
movq %rax, 0x88(%rsp)
movq %rbx, 0x90(%rsp)
movq 0x8(%rsp), %rdi
callq 0x8d60
cmpl %eax, %ebx
jge 0x172e7
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x8840
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xd45e
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x8130
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xd45e
movq %rbp, %rdi
movq %r15, %rsi
callq 0x18236
movq %rax, %rdi
movq %r12, %rsi
callq 0x8ed0
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x172c4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x172e0
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8170
incl %ebx
jmp 0x17251
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x182b2
movq %rbp, %rdi
callq 0x117ca
jmp 0x17212
movq 0x8(%rsp), %rdi
callq 0x8ad0
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *(%rax)
leaq 0x10(%rsp), %rdi
callq 0x12e56
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1fc48(%rip), %rax     # 0x36f80
movq (%rax), %rbx
movq 0x10(%rsp), %rdi
callq 0x8fa0
leaq 0x12230(%rip), %rsi     # 0x2957c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8240
jmp 0x171eb
movq %rdx, %rbx
movq %rax, %r15
jmp 0x173d5
jmp 0x1736a
jmp 0x17380
movq %rdx, %rbx
movq %rax, %r15
jmp 0x173cb
jmp 0x17380
jmp 0x17376
movq %rdx, %rbx
movq %rax, %r15
jmp 0x173a5
jmp 0x17380
movq %rdx, %rbx
movq %rax, %r15
jmp 0x173c1
movq %rdx, %rbx
movq %rax, %r15
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x173a5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x173c1
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8170
leaq 0x68(%rsp), %rdi
callq 0x117ca
leaq 0x10(%rsp), %rdi
callq 0x12e56
movq %r15, %rdi
cmpl $0x1, %ebx
jne 0x173e9
movl %ebx, %esi
callq 0x9208
jmp 0x1731f
callq 0x87b0