// File: /workspace/github_cpp_makefile_star2_O1/eiskalteschatten[P]developersnotebook/src/models/AbstractSqliteModel.cpp
// Function: AbstractSqliteModel::abstract_save_all()
void AbstractSqliteModel::abstract_save_all() {
    try {
        if (!id) {
            insert_new_row();
        }

        std::string set = "";

        for (auto const &column : contents) {
            set.append(column.first);
            set.append("=\"");
            set.append(text_escape(column.second));
            set.append("\",");
        }

        if (set != "") {
            set = set.substr(0, set.size()-1); // Remove the dangling comma

            SqliteConnectionManager connection_manager;

            char *error_message = 0;
            int connection;
            std::string sql = "UPDATE " + table_schema->table_name +
                              " SET " + set +
                              " WHERE id=" + std::to_string(id) + ";";

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

            if(connection != SQLITE_OK) {
                fprintf(stderr, "SQL error: %s\n", error_message);
                sqlite3_free(error_message);
            }
        }
        else {
            fprintf(stderr, "There are no contents to save!");
        }
    }
    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 $0x138, %rsp            # imm = 0x138
movq %rdi, %rbx
cmpl $0x0, 0x58(%rdi)
jne 0x17a98
movq %rbx, %rdi
callq 0x15976
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x11ead(%rip), %rdx     # 0x29955
leaq 0x30(%rsp), %rdi
movq %rdx, %rsi
callq 0xd5b4
movq 0x28(%rbx), %r14
movq %rbx, 0xf0(%rsp)
leaq 0x18(%rbx), %rbp
cmpq %rbp, %r14
je 0x17b97
leaq 0x108(%rsp), %r12
leaq 0x30(%rsp), %r15
leaq 0xf8(%rsp), %r13
leaq 0x11de9(%rip), %rbx     # 0x298d3
movq 0x20(%r14), %rsi
movq 0x28(%r14), %rdx
movq %r15, %rdi
callq 0x8940
movq %r15, %rdi
leaq 0x11dcc(%rip), %rsi     # 0x298d0
callq 0x87f0
movq %r12, 0xf8(%rsp)
movq 0x40(%r14), %rsi
movq 0x48(%r14), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0xd524
movq %rsp, %rdi
movq %r13, %rdx
callq 0x16b20
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r15, %rdi
callq 0x8940
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x17b5b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0x17b78
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x8170
movq %r15, %rdi
movq %rbx, %rsi
callq 0x87f0
movq %r14, %rdi
callq 0x8cb0
movq %rax, %r14
cmpq %rbp, %rax
jne 0x17aea
leaq 0x11db7(%rip), %rsi     # 0x29955
leaq 0x30(%rsp), %rdi
callq 0x8c00
testl %eax, %eax
je 0x18010
leaq 0x30(%rsp), %rsi
movq 0x8(%rsi), %rcx
decq %rcx
movq %rsp, %rdi
xorl %edx, %edx
callq 0x8ce0
leaq 0x30(%rsp), %rdi
movq %rsp, %rbx
movq %rbx, %rsi
callq 0x8630
movq (%rbx), %rdi
leaq 0x10(%rsp), %r12
cmpq %r12, %rdi
movq 0xf0(%rsp), %r14
je 0x17bf8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8170
leaq 0x28(%rsp), %rdi
callq 0x12e2c
movq $0x0, 0x20(%rsp)
movq 0x8(%r14), %rdx
leaq 0x11bfe(%rip), %rsi     # 0x29814
leaq 0x118(%rsp), %rdi
callq 0xd49b
leaq 0x11bf2(%rip), %rsi     # 0x2981c
leaq 0x118(%rsp), %rdi
callq 0x87f0
leaq 0xc0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x17c67
movq %rdx, 0xb0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xc0(%rsp)
jmp 0x17c6d
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0xb0(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
callq 0x8940
leaq 0xe0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x17ccb
movq %rdx, 0xd0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xe0(%rsp)
jmp 0x17cd1
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
leaq 0xd0(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x11b30(%rip), %rsi     # 0x29827
callq 0x87f0
leaq 0xa0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x17d2f
movq %rsi, %r13
movq %rdx, 0x90(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xa0(%rsp)
jmp 0x17d38
movups (%rcx), %xmm0
movq %rsi, %r13
movups %xmm0, (%rsi)
movq 0x8(%rax), %rdx
movq %rdx, 0x98(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movl 0x58(%r14), %ebx
movl %ebx, %ebp
negl %ebp
cmovsl %ebx, %ebp
movl $0x1, %r14d
cmpl $0xa, %ebp
jb 0x17db2
movl $0x4, %r14d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x17da9
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x17daf
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x17db2
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r14d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x17d76
addl $-0x3, %r14d
jmp 0x17db2
addl $-0x2, %r14d
jmp 0x17db2
decl %r14d
shrl $0x1f, %ebx
leal (%r14,%rbx), %esi
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x70(%rsp), %rdi
movl $0x2d, %edx
callq 0x8740
addq 0x70(%rsp), %rbx
movq %rbx, %rdi
movl %r14d, %esi
movl %ebp, %edx
callq 0x1175c
movq 0x90(%rsp), %rcx
movq 0x98(%rsp), %r8
movq 0x78(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r13, %rcx
je 0x17e11
movq 0xa0(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x17e2f
movl $0xf, %esi
cmpq %r15, 0x70(%rsp)
je 0x17e2a
movq 0x80(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x17e43
movq 0x70(%rsp), %rsi
leaq 0x90(%rsp), %rdi
callq 0x8940
jmp 0x17e51
leaq 0x70(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x81e0
leaq 0x60(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x17e75
movq %rsi, 0x50(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x60(%rsp)
jmp 0x17e7b
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x58(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x116db(%rip), %rsi     # 0x2957a
leaq 0x50(%rsp), %rdi
callq 0x87f0
movq %r12, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x17eca
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x17ed2
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17f05
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x17f1f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
leaq 0xc0(%rsp), %r15
je 0x17f44
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x17f69
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0xb0(%rsp), %rdi
cmpq %r15, %rdi
je 0x17f86
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8170
leaq 0x128(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17fa7
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0x28(%rsp), %rdi
movq (%rsp), %rsi
leaq 0x20(%rsp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x80c0
testl %eax, %eax
jne 0x18017
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x17fd8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8170
leaq 0x28(%rsp), %rdi
callq 0x12e56
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x17ffe
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8170
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x92a4
jmp 0x17fe2
movq 0x1ef62(%rip), %rax     # 0x36f80
movq (%rax), %rdi
movq 0x20(%rsp), %rdx
leaq 0x1154f(%rip), %rsi     # 0x2957c
xorl %eax, %eax
callq 0x8240
movq 0x20(%rsp), %rdi
callq 0x9010
jmp 0x17fc2
jmp 0x18160
movq %rdx, %rbx
movq %rax, %r14
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1806e
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x8170
jmp 0x1806e
movq %rdx, %rbx
movq %rax, %r14
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x18090
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x8170
jmp 0x18090
movq %rdx, %rbx
movq %rax, %r14
movq 0x90(%rsp), %rdi
cmpq %r13, %rdi
je 0x180b5
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x8170
jmp 0x180b5
movq %rdx, %rbx
movq %rax, %r14
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x180e2
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x8170
jmp 0x180e2
movq %rdx, %rbx
movq %rax, %r14
movq 0xb0(%rsp), %rdi
leaq 0xc0(%rsp), %rax
cmpq %rax, %rdi
je 0x1810f
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x8170
jmp 0x1810f
movq %rdx, %rbx
movq %rax, %r14
leaq 0x128(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1814d
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x8170
jmp 0x1814d
movq %rdx, %rbx
movq %rax, %r14
jmp 0x1814d
jmp 0x181b2
jmp 0x181b2
movq %rdx, %rbx
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r12, %rdi
jne 0x18159
leaq 0x28(%rsp), %rdi
callq 0x12e56
jmp 0x181b8
movq 0x10(%rsp), %rsi
jmp 0x18128
movq %rdx, %rbx
movq %rax, %r14
jmp 0x181d4
jmp 0x181b2
movq %rdx, %rbx
movq %rax, %r14
jmp 0x18193
movq %rdx, %rbx
movq %rax, %r14
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x18193
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x8170
movq 0xf8(%rsp), %rdi
cmpq %r12, %rdi
je 0x181b8
movq 0x108(%rsp), %rsi
incq %rsi
callq 0x8170
jmp 0x181b8
movq %rdx, %rbx
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x181d4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x8170
movq %r14, %rdi
cmpl $0x1, %ebx
jne 0x181e8
movl %ebx, %esi
callq 0x9270
jmp 0x17ffe
callq 0x87b0
nop