// File: /workspace/github_cpp_makefile_star2_O3/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 0x12e50
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 0x17307
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 0x172d7
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 0x172bd
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x8840
movq %r15, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0xd42c
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x8130
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0xd42c
movq %rbp, %rdi
movq %r15, %rsi
callq 0x18210
movq %rax, %rdi
movq %r12, %rsi
callq 0x8ed0
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x1729a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x172b6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8170
incl %ebx
jmp 0x17227
movq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x1828c
movq %rbp, %rdi
callq 0x117ee
jmp 0x171e8
movq 0x8(%rsp), %rdi
callq 0x8ad0
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
callq *(%rax)
leaq 0x10(%rsp), %rdi
callq 0x12e7a
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x1fc72(%rip), %rax     # 0x36f80
movq (%rax), %rbx
movq 0x10(%rsp), %rdi
callq 0x8fa0
leaq 0x1225a(%rip), %rsi     # 0x2957c
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8240
jmp 0x171c1
movq %rdx, %rbx
movq %rax, %r15
jmp 0x173ab
jmp 0x17340
jmp 0x17356
movq %rdx, %rbx
movq %rax, %r15
jmp 0x173a1
jmp 0x17356
jmp 0x1734c
movq %rdx, %rbx
movq %rax, %r15
jmp 0x1737b
jmp 0x17356
movq %rdx, %rbx
movq %rax, %r15
jmp 0x17397
movq %rdx, %rbx
movq %rax, %r15
movq 0x48(%rsp), %rdi
cmpq %r14, %rdi
je 0x1737b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x17397
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x8170
leaq 0x68(%rsp), %rdi
callq 0x117ee
leaq 0x10(%rsp), %rdi
callq 0x12e7a
movq %r15, %rdi
cmpl $0x1, %ebx
jne 0x173bf
movl %ebx, %esi
callq 0x9206
jmp 0x172f5
callq 0x87b0