#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_stmt;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int SQLITE_OK;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
char *sqlite3_errmsg(int /*<<< orphan*/ *);
int sqlite3_prepare_v2(int /*<<< orphan*/ *, char const *, scalar_t__,
                       int /*<<< orphan*/ **, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
scalar_t__ strlen(char const *);
sqlite3_stmt *Bank_int_MakeStatemnt(sqlite3 *Database, const char *Query) {
  int rv;
  sqlite3_stmt *ret;
  rv = sqlite3_prepare_v2(Database, Query, strlen(Query) + 1, &ret, NULL);
  if (rv != SQLITE_OK) {
    fprintf(stderr, "SQLite Error: %s\n", sqlite3_errmsg(Database));
    fprintf(stderr, "query = \"%s\"\n", Query);
    return NULL;
  }
  return ret;
}


x86 assembly (clang, -O0):
<Bank_int_MakeStatemnt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
lea    -0x28(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1060 <sqlite3_prepare_v2@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2e55(%rip),%rcx
cmp    (%rcx),%eax
je     11e8 <Bank_int_MakeStatemnt+0xa8>
mov    0x2e36(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <sqlite3_errmsg@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%rdx
lea    0xe43(%rip),%rsi
call   1050 <fprintf@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe3c(%rip),%rsi
call   1050 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    11f0 <Bank_int_MakeStatemnt+0xb0>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bank_int_MakeStatemnt>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %rsp,%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %r8d,%r8d
call   1060 <sqlite3_prepare_v2@plt>
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%eax
jne    117b <Bank_int_MakeStatemnt+0x3b>
mov    (%rsp),%rax
jmp    11b2 <Bank_int_MakeStatemnt+0x72>
mov    0x2e56(%rip),%r15
mov    (%r15),%ebp
mov    %r14,%rdi
call   1040 <sqlite3_errmsg@plt>
lea    0xe6c(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1050 <fprintf@plt>
mov    (%r15),%edi
lea    0xe6a(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"SQLite Error: %s\0A\00"
@.str.1 = [14 x i8] c"query = \22%s\22\0A\00"
define i32* @Bank_int_MakeStatemnt(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i8* %1, i8** %5
%8 = load i32*, i32** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %5
%11 = call i64 @strlen(i8* %10)
%12 = add nsw i64 %11, 1
%13 = call i32 @sqlite3_prepare_v2(i32* %8, i8* %9, i64 %12, i32** %7, i32* null)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* @SQLITE_OK
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i32*, i32** %4
%20 = call i8* @sqlite3_errmsg(i32* %19)
%21 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %5
%24 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %23)
store i32* null, i32** %3
br label %27
25: ; preds = %2
%26 = load i32*, i32** %7
store i32* %26, i32** %3
br label %27
27: ; preds = %25, %17
%28 = load i32*, i32** %3
ret i32* %28
}

LLVM IR (-O2):
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str = [18 x i8] c"SQLite Error: %s\0A\00"
@.str.1 = [14 x i8] c"query = \22%s\22\0A\00"
define i32* @Bank_int_MakeStatemnt(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add nsw i64 %5, 1
%7 = call i32 @sqlite3_prepare_v2(i32* %0, i8* %1, i64 %6, i32** %3, i32* null)
%8 = load i32, i32* @SQLITE_OK
%9 = icmp eq i32 %7, %8
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i8* @sqlite3_errmsg(i32* %0)
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = load i32, i32* @stderr
%15 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %18
16: ; preds = %2
%17 = load i32*, i32** %3
br label %18
18: ; preds = %16, %10
%19 = phi i32* [ null, %10 ], [ %17, %16 ]
ret i32* %19
}