// File: eiskalteschatten[P]developersnotebook/src/models/AbstractSqliteModel.cpp
// Function: AbstractSqliteModel::delete_single()
void AbstractSqliteModel::delete_single() {
    try {
        if (!id) {
            fprintf(stderr, "Could not delete the entry because there was no id!");
            return;
        }

        SqliteConnectionManager connection_manager;

        char *error_message = 0;
        int connection;
        std::string sql = "DELETE FROM " + table_schema->table_name +
                          " 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);
        }
    }
    catch(const std::exception& e) {
        fprintf(stderr, "An exception occured while trying to delete from the database: %s\n", e.what());
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
cmpl $0x0, 0x58(%rax)
jne 0x221ad
movq 0x52de9(%rip), %rax     # 0x74f80
movq (%rax), %rdi
leaq 0x31961(%rip), %rsi     # 0x53b02
movb $0x0, %al
callq 0xa320
jmp 0x223fe
leaq -0x10(%rbp), %rdi
callq 0x1cc70
jmp 0x221b8
movq -0xe0(%rbp), %rax
movq $0x0, -0x28(%rbp)
movq 0x8(%rax), %rdx
leaq 0x31964(%rip), %rsi     # 0x53b36
leaq -0xb0(%rbp), %rdi
callq 0x110c0
jmp 0x221e0
leaq 0x31910(%rip), %rdx     # 0x53af7
leaq -0x90(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x10eb0
jmp 0x221fc
movq -0xe0(%rbp), %rax
movl 0x58(%rax), %esi
leaq -0xd0(%rbp), %rdi
callq 0x19050
jmp 0x22214
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rsi
leaq -0xd0(%rbp), %rdx
callq 0x23350
jmp 0x2222d
leaq 0x31580(%rip), %rdx     # 0x537b4
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x10eb0
jmp 0x22243
leaq -0x70(%rbp), %rdi
callq 0xb430
leaq -0xd0(%rbp), %rdi
callq 0xb430
leaq -0x90(%rbp), %rdi
callq 0xb430
leaq -0xb0(%rbp), %rdi
callq 0xb430
leaq -0x10(%rbp), %rdi
callq 0x1d940
movq %rax, -0xe8(%rbp)
jmp 0x22282
leaq -0x50(%rbp), %rdi
callq 0xa1d0
movq -0xe8(%rbp), %rdi
movq %rax, %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x28(%rbp), %r8
movq %rcx, %rdx
callq 0xa0e0
movl %eax, -0xec(%rbp)
jmp 0x222ad
movl -0xec(%rbp), %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x2238a
movq 0x52cb9(%rip), %rax     # 0x74f80
movq (%rax), %rdi
movq -0x28(%rbp), %rdx
leaq 0x314e1(%rip), %rsi     # 0x537b6
xorl %eax, %eax
callq 0xa320
movq -0x28(%rbp), %rdi
callq 0xb360
jmp 0x222e7
jmp 0x2238a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x223a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x2239e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x22365
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x22359
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x2234d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xb430
leaq -0xd0(%rbp), %rdi
callq 0xb430
leaq -0x90(%rbp), %rdi
callq 0xb430
leaq -0xb0(%rbp), %rdi
callq 0xb430
jmp 0x2239e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xb430
jmp 0x2239e
leaq -0x50(%rbp), %rdi
callq 0xb430
leaq -0x10(%rbp), %rdi
callq 0x1ccf0
jmp 0x223fe
leaq -0x10(%rbp), %rdi
callq 0x1ccf0
movl -0x1c(%rbp), %eax
movl $0x1, %ecx
cmpl %ecx, %eax
jne 0x22407
movq -0x18(%rbp), %rdi
callq 0xa0b0
movq %rax, -0xd8(%rbp)
movq 0x52bb6(%rip), %rax     # 0x74f80
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0xd8(%rbp), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0xf8(%rbp), %rdi
movq %rax, %rdx
leaq 0x31751(%rip), %rsi     # 0x53b43
movb $0x0, %al
callq 0xa320
callq 0xac00
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0xaa00