#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int SQLITE_OK;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *malloc(scalar_t__);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
char *sqlite3_errmsg(int /*<<< orphan*/ *);
int sqlite3_exec(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/, char **);
int /*<<< orphan*/ sqlite3_free(char *);
int sqlite3_open(char *, int /*<<< orphan*/ **);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int delete_id_db(char *id) {
  sqlite3 *db = NULL;
  int rc;
  char *zErrMsg = 0;
  char *sql = NULL;
  rc = sqlite3_open("DataBase_facificator.db", &db);
  if (rc) {
    fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db));
  } else {
    fprintf(stderr, "Opened database successfully\n");
  }
  sql = "DELETE FROM FACIFICATOR WHERE ID = ";
  char *result = malloc(strlen(sql) + strlen(id) + 1);
  strcpy(result, sql);
  strcat(result, id);
  sql = result;
  char *tmp = ";";
  result = malloc(strlen(sql) + strlen(tmp) + 1);
  strcpy(result, sql);
  strcat(result, tmp);
  sql = result;
  printf("%s\n", sql);
  rc = sqlite3_exec(db, sql, NULL, 0, &zErrMsg);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "SQL error: %s\n", zErrMsg);
    sqlite3_free(zErrMsg);
  } else {
    fprintf(stdout, "Successfull destroy...\n\n");
  }
  sqlite3_close(db);
  return 0;
}


x86 assembly (clang, -O0):
<delete_id_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
lea    0xe25(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <sqlite3_open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     121f <delete_id_db+0x6f>
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <sqlite3_errmsg@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%rdx
lea    0xe05(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1236 <delete_id_db+0x86>
mov    0x2db2(%rip),%rax
mov    (%rax),%edi
lea    0xe02(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    0xe12(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x50(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10c0 <strcat@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    0xddf(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x48(%rbp)
mov    -0x38(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x48(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   10b0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10c0 <strcat@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xd3e(%rip),%rdi
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
lea    -0x20(%rbp),%r8
call   1040 <sqlite3_exec@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2cd0(%rip),%rcx
cmp    (%rcx),%eax
je     1349 <delete_id_db+0x199>
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xd41(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   10d0 <sqlite3_free@plt>
jmp    1360 <delete_id_db+0x1b0>
mov    0x2c80(%rip),%rax
mov    (%rax),%edi
lea    0xd2b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <sqlite3_close@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_id_db>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe2d(%rip),%rdi
mov    %rsp,%rsi
call   1050 <sqlite3_open@plt>
mov    0x2df6(%rip),%r14
mov    (%r14),%ebp
test   %eax,%eax
je     1207 <delete_id_db+0x57>
mov    (%rsp),%rdi
call   1080 <sqlite3_errmsg@plt>
lea    0xe1f(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    1217 <delete_id_db+0x67>
lea    0xe23(%rip),%rsi
mov    %ebp,%edi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
lea    0x24(%rax),%rdi
call   10b0 <malloc@plt>
mov    %rax,%rbp
lea    0xe1d(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10c0 <strcat@plt>
mov    %rbp,%rdi
call   1060 <strlen@plt>
lea    0x2(%rax),%rdi
call   10b0 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
lea    0xe08(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <strcat@plt>
lea    0xdb3(%rip),%rdi
mov    %rbx,%rsi
call   1070 <printf@plt>
mov    (%rsp),%rdi
lea    0x8(%rsp),%r8
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <sqlite3_exec@plt>
mov    0x2d4a(%rip),%rcx
cmp    (%rcx),%eax
jne    12bb <delete_id_db+0x10b>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    0xdd2(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
jmp    12db <delete_id_db+0x12b>
mov    (%r14),%edi
mov    0x8(%rsp),%rdx
lea    0xdab(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    0x8(%rsp),%rdi
call   10d0 <sqlite3_free@plt>
mov    (%rsp),%rdi
call   10a0 <sqlite3_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"DataBase_facificator.db\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"Can't open database: %s\0A\00"
@.str.2 = [30 x i8] c"Opened database successfully\0A\00"
@.str.3 = [36 x i8] c"DELETE FROM FACIFICATOR WHERE ID = \00"
@.str.4 = [2 x i8] c";\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@SQLITE_OK = global i32 0
@.str.6 = [15 x i8] c"SQL error: %s\0A\00"
@stdout = global i32 0
@.str.7 = [25 x i8] c"Successfull destroy...\0A\0A\00"
define i32 @delete_id_db(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %2
store i32* null, i32** %3
store i8* null, i8** %5
store i8* null, i8** %6
%9 = call i32 @sqlite3_open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32** %3)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32, i32* @stderr
%14 = load i32*, i32** %3
%15 = call i8* @sqlite3_errmsg(i32* %14)
%16 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %15)
br label %20
17: ; preds = %1
%18 = load i32, i32* @stderr
%19 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %17, %12
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8** %6
%21 = load i8*, i8** %6
%22 = call i64 @strlen(i8* %21)
%23 = load i8*, i8** %2
%24 = call i64 @strlen(i8* %23)
%25 = add nsw i64 %22, %24
%26 = add nsw i64 %25, 1
%27 = call i8* @malloc(i64 %26)
store i8* %27, i8** %7
%28 = load i8*, i8** %7
%29 = load i8*, i8** %6
%30 = call i32 @strcpy(i8* %28, i8* %29)
%31 = load i8*, i8** %7
%32 = load i8*, i8** %2
%33 = call i32 @strcat(i8* %31, i8* %32)
%34 = load i8*, i8** %7
store i8* %34, i8** %6
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %8
%35 = load i8*, i8** %6
%36 = call i64 @strlen(i8* %35)
%37 = load i8*, i8** %8
%38 = call i64 @strlen(i8* %37)
%39 = add nsw i64 %36, %38
%40 = add nsw i64 %39, 1
%41 = call i8* @malloc(i64 %40)
store i8* %41, i8** %7
%42 = load i8*, i8** %7
%43 = load i8*, i8** %6
%44 = call i32 @strcpy(i8* %42, i8* %43)
%45 = load i8*, i8** %7
%46 = load i8*, i8** %8
%47 = call i32 @strcat(i8* %45, i8* %46)
%48 = load i8*, i8** %7
store i8* %48, i8** %6
%49 = load i8*, i8** %6
%50 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %49)
%51 = load i32*, i32** %3
%52 = load i8*, i8** %6
%53 = call i32 @sqlite3_exec(i32* %51, i8* %52, i32* null, i32 0, i8** %5)
store i32 %53, i32* %4
%54 = load i32, i32* %4
%55 = load i32, i32* @SQLITE_OK
%56 = icmp ne i32 %54, %55
br i1 %56, label %57, label %63
57: ; preds = %20
%58 = load i32, i32* @stderr
%59 = load i8*, i8** %5
%60 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %59)
%61 = load i8*, i8** %5
%62 = call i32 @sqlite3_free(i8* %61)
br label %66
63: ; preds = %20
%64 = load i32, i32* @stdout
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %66
66: ; preds = %63, %57
%67 = load i32*, i32** %3
%68 = call i32 @sqlite3_close(i32* %67)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"DataBase_facificator.db\00"
@stderr = global i32 0
@.str.1 = [25 x i8] c"Can't open database: %s\0A\00"
@.str.2 = [30 x i8] c"Opened database successfully\0A\00"
@.str.3 = [36 x i8] c"DELETE FROM FACIFICATOR WHERE ID = \00"
@.str.4 = [2 x i8] c";\00"
@.str.5 = [4 x i8] c"%s\0A\00"
@SQLITE_OK = global i32 0
@.str.6 = [15 x i8] c"SQL error: %s\0A\00"
@stdout = global i32 0
@.str.7 = [25 x i8] c"Successfull destroy...\0A\0A\00"
define i32 @delete_id_db(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = bitcast i32** %2 to i8*
store i32* null, i32** %2
%5 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%6 = call i32 @sqlite3_open(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32** %2)
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* @stderr
br i1 %7, label %13, label %9
9: ; preds = %1
%10 = load i32*, i32** %2
%11 = call i8* @sqlite3_errmsg(i32* %10)
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %15
13: ; preds = %1
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %9
%16 = call i64 @strlen(i8* dereferenceable(1) %0)
%17 = add nsw i64 %16, 36
%18 = call i8* @malloc(i64 %17)
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%20 = call i32 @strcat(i8* %18, i8* %0)
%21 = call i64 @strlen(i8* dereferenceable(1) %18)
%22 = add nsw i64 %21, 2
%23 = call i8* @malloc(i64 %22)
%24 = call i32 @strcpy(i8* %23, i8* %18)
%25 = call i32 @strcat(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* %23)
%27 = load i32*, i32** %2
%28 = call i32 @sqlite3_exec(i32* %27, i8* %23, i32* null, i32 0, i8** %3)
%29 = load i32, i32* @SQLITE_OK
%30 = icmp eq i32 %28, %29
br i1 %30, label %37, label %31
31: ; preds = %15
%32 = load i32, i32* @stderr
%33 = load i8*, i8** %3
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8* %33)
%35 = load i8*, i8** %3
%36 = call i32 @sqlite3_free(i8* %35)
br label %40
37: ; preds = %15
%38 = load i32, i32* @stdout
%39 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %40
40: ; preds = %37, %31
%41 = load i32*, i32** %2
%42 = call i32 @sqlite3_close(i32* %41)
ret i32 0
}