#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int sqlite3_exec(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/, char **);
int /*<<< orphan*/ sqlite3_free(char *);
int /*<<< orphan*/ stderr;
void DirectExecNoResult(sqlite3 *db, const char *sql) {
  int rc;
  char *errmsg = NULL;
  rc = sqlite3_exec(db, sql, NULL, 0, &errmsg);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "SQL error in '%s': %s\n", sql, errmsg);
    sqlite3_free(errmsg);
    (void)sqlite3_close(db);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<DirectExecNoResult>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
lea    -0x20(%rbp),%r8
call   1030 <sqlite3_exec@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e5c(%rip),%rcx
cmp    (%rcx),%eax
je     11cd <DirectExecNoResult+0x7d>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe54(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <sqlite3_free@plt>
mov    -0x8(%rbp),%rdi
call   1050 <sqlite3_close@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DirectExecNoResult>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movq   $0x0,(%rsp)
mov    %rsp,%r8
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <sqlite3_exec@plt>
mov    0x2e73(%rip),%rcx
cmp    (%rcx),%eax
jne    1181 <DirectExecNoResult+0x31>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rcx
lea    0xe6b(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    (%rsp),%rdi
call   1060 <sqlite3_free@plt>
mov    %r14,%rdi
call   1050 <sqlite3_close@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"SQL error in '%s': %s\0A\00"
define void @DirectExecNoResult(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
store i8* null, i8** %6
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i32 @sqlite3_exec(i32* %7, i8* %8, i32* null, i32 0, i8** %6)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* @SQLITE_OK
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %2
%14 = load i32, i32* @stderr
%15 = load i8*, i8** %4
%16 = load i8*, i8** %6
%17 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i8*, i8** %6
%19 = call i32 @sqlite3_free(i8* %18)
%20 = load i32*, i32** %3
%21 = call i32 @sqlite3_close(i32* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %2
ret void
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str = [23 x i8] c"SQL error in '%s': %s\0A\00"
define void @DirectExecNoResult(i32* %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @sqlite3_exec(i32* %0, i8* %1, i32* null, i32 0, i8** %3)
%6 = load i32, i32* @SQLITE_OK
%7 = icmp eq i32 %5, %6
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @sqlite3_free(i8* %12)
%14 = call i32 @sqlite3_close(i32* %0)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
ret void
}