// File: /workspace/github_cpp_makefile_star2_O2/eiskalteschatten[P]developersnotebook/src/models/AbstractSqliteModel.cpp
// Function: AbstractSqliteModel::insert_new_row()
void AbstractSqliteModel::insert_new_row() {
    try {
        SqliteConnectionManager connection_manager;
        char *error_message = 0;
        int connection;

        std::string insert_sql_columns;
        std::string insert_sql_values;
        std::vector<SqliteSchema::ColumnSchema> table_columns = table_schema->columns;

        for (unsigned int c = 0; c < table_columns.size(); c++) {
            insert_sql_columns += table_columns[c].column_name;
            insert_sql_values  += table_columns[c].default_value.empty() ? "\"\"" : "\"" + table_columns[c].default_value + "\"";

            if ((c + 1) < table_columns.size()) {
                insert_sql_columns += ",";
                insert_sql_values  += ",";
            }
        }

        std::string insert_sql = "INSERT INTO " + table_schema->table_name +
                                 " (" + insert_sql_columns + ")" +
                                 " VALUES (" + insert_sql_values + ");";

        connection = sqlite3_exec(connection_manager.get_db(), insert_sql.c_str(), NULL, 0, &error_message);

        if(connection != SQLITE_OK) {
            fprintf(stderr, "SQL error: %s\n", error_message);
            sqlite3_free(error_message);
        }

        id = sqlite3_last_insert_rowid(connection_manager.get_db());
    }
    catch(const std::exception& e) {
        fprintf(stderr, "An exception occured while trying to save to the database: %s\n", e.what());
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
callq 0xf86c
andq $0x0, 0x10(%rsp)
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
leaq 0x88(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %cl, (%rax)
movb %cl, (%rdx)
movq %rbx, 0x30(%rsp)
movq 0x8(%rbx), %rsi
addq $0x20, %rsi
leaq 0x18(%rsp), %rdi
callq 0xff56
pushq $0x1
popq %rbx
leaq 0x38(%rsp), %r12
leaq 0x78(%rsp), %rbp
leaq 0x158(%rsp), %r15
leal -0x1(%rbx), %r14d
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rax
subq %rsi, %rax
sarq $0x7, %rax
cmpq %r14, %rax
jbe 0x11acf
shlq $0x7, %r14
addq %r14, %rsi
leaq 0x58(%rsp), %rdi
callq 0x8bc0
movq 0x18(%rsp), %rax
movq 0x68(%rax,%r14), %r13
testq %r13, %r13
je 0x11a5f
leaq (%rax,%r14), %rdx
addq $0x60, %rdx
movq %r15, %rdi
leaq 0x10dee(%rip), %r14     # 0x22835
movq %r14, %rsi
callq 0xb117
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xb059
jmp 0x11a73
movq %r12, %rdi
leaq 0x11cb6(%rip), %rsi     # 0x2371f
leaq 0x7(%rsp), %rdx
callq 0xb078
movq %rbp, %rdi
movq %r12, %rsi
callq 0x8bc0
movq %r12, %rdi
callq 0x9120
testq %r13, %r13
je 0x11a93
movq %r15, %rdi
callq 0x9120
movl %ebx, %eax
movq 0x20(%rsp), %rcx
subq 0x18(%rsp), %rcx
sarq $0x7, %rcx
cmpq %rax, %rcx
jbe 0x11ac8
leaq 0x58(%rsp), %rdi
leaq 0x10e30(%rip), %rsi     # 0x228e4
callq 0x8830
movq %rbp, %rdi
leaq 0x10e21(%rip), %rsi     # 0x228e4
callq 0x8830
incl %ebx
jmp 0x119f7
movq 0x30(%rsp), %rbx
movq 0x8(%rbx), %rdx
leaq 0x10cf9(%rip), %rsi     # 0x227d8
leaq 0x98(%rsp), %rdi
callq 0xb117
leaq 0x10ac0(%rip), %rdx     # 0x225b3
leaq 0xb8(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xb059
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0xbabb
leaq 0x1164f(%rip), %rdx     # 0x23178
leaq 0xf8(%rsp), %rdi
leaq 0xd8(%rsp), %rsi
callq 0xb059
leaq 0x10a67(%rip), %rdx     # 0x225ac
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0xb059
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0xbabb
leaq 0x10a08(%rip), %rdx     # 0x22583
leaq 0x38(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0xb059
leaq 0x138(%rsp), %rdi
callq 0x9120
leaq 0x118(%rsp), %rdi
callq 0x9120
leaq 0xf8(%rsp), %rdi
callq 0x9120
leaq 0xd8(%rsp), %rdi
callq 0x9120
leaq 0xb8(%rsp), %rdi
callq 0x9120
leaq 0x98(%rsp), %rdi
callq 0x9120
movq 0x8(%rsp), %rdi
movq 0x38(%rsp), %rsi
leaq 0x10(%rsp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x80c0
testl %eax, %eax
jne 0x11c48
movq 0x8(%rsp), %rdi
callq 0x8770
movl %eax, 0x58(%rbx)
leaq 0x38(%rsp), %rdi
callq 0x9120
leaq 0x18(%rsp), %rdi
callq 0xffaa
leaq 0x78(%rsp), %rdi
callq 0x9120
leaq 0x58(%rsp), %rdi
callq 0x9120
leaq 0x8(%rsp), %rdi
callq 0xf8c0
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20341(%rip), %rax     # 0x31f90
movq (%rax), %rdi
movq 0x10(%rsp), %rdx
leaq 0x10928(%rip), %rsi     # 0x22586
xorl %eax, %eax
callq 0x8250
movq 0x10(%rsp), %rdi
callq 0x9060
jmp 0x11bf7
movq %rdx, %rbx
movq %rax, %r14
leaq 0x138(%rsp), %rdi
callq 0x9120
jmp 0x11c8c
movq %rdx, %rbx
movq %rax, %r14
leaq 0x118(%rsp), %rdi
callq 0x9120
jmp 0x11ca1
movq %rdx, %rbx
movq %rax, %r14
leaq 0xf8(%rsp), %rdi
callq 0x9120
jmp 0x11cb6
movq %rdx, %rbx
movq %rax, %r14
leaq 0xd8(%rsp), %rdi
callq 0x9120
jmp 0x11ccb
movq %rdx, %rbx
movq %rax, %r14
leaq 0xb8(%rsp), %rdi
callq 0x9120
leaq 0x98(%rsp), %rdi
jmp 0x11d32
movq %rdx, %rbx
movq %rax, %r14
jmp 0x11cd8
jmp 0x11d39
movq %rdx, %rbx
movq %rax, %r14
jmp 0x11d49
movq %rdx, %rbx
movq %rax, %r14
jmp 0x11d67
movq %rdx, %rbx
movq %rax, %r14
leaq 0x38(%rsp), %rdi
jmp 0x11d32
jmp 0x11d39
movq %rdx, %rbx
movq %rax, %r14
jmp 0x11d2a
jmp 0x11d39
movq %rdx, %rbx
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x9120
testq %r13, %r13
je 0x11d3f
leaq 0x158(%rsp), %rdi
callq 0x9120
jmp 0x11d3f
movq %rdx, %rbx
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0xffaa
leaq 0x78(%rsp), %rdi
callq 0x9120
leaq 0x58(%rsp), %rdi
callq 0x9120
leaq 0x8(%rsp), %rdi
callq 0xf8c0
movq %r14, %rdi
cmpl $0x1, %ebx
jne 0x11da5
callq 0x8090
movq 0x20215(%rip), %rcx     # 0x31f90
movq (%rcx), %rbx
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
leaq 0x10a57(%rip), %rsi     # 0x227e5
movq %rbx, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8250
callq 0x89d0
jmp 0x11c36
callq 0x87f0