#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 executeSQLCommand(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ openDBResponse(int);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int sqlite3_open(char *, int /*<<< orphan*/ **);
void createDatabase(char *databaseName) {
  sqlite3 *db;
  int rc = sqlite3_open(databaseName, &db);
  openDBResponse(rc);
  char *sql = "Create Table Database("
              "ID        Int       PRIMARY KEY  NOT NULL,"
              "IsAdmin   Int                    NOT NULL,"
              "Username  Text                   NOT NULL,"
              "Password  Char(100)              NOT NULL);"
              "Insert into Database values (1, 1, 'admin', '123456'); ";
  rc = executeSQLCommand(db, sql);
  sqlite3_close(db);
}


x86 assembly (clang, -O0):
<createDatabase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <sqlite3_open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <openDBResponse@plt>
lea    0xe95(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <executeSQLCommand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <sqlite3_close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createDatabase>:
push   %rax
mov    %rsp,%rsi
call   1040 <sqlite3_open@plt>
mov    %eax,%edi
call   1030 <openDBResponse@plt>
mov    (%rsp),%rdi
lea    0xea5(%rip),%rsi
call   1050 <executeSQLCommand@plt>
mov    (%rsp),%rdi
call   1060 <sqlite3_close@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [247 x i8] c"Create Table Database(ID Int PRIMARY KEY NOT NULL,IsAdmin Int NOT NULL,Username Text NOT NULL,Password Char(100) NOT NULL);Insert into Database values (1, 1, 'admin', '123456'); \00"
define void @createDatabase(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @sqlite3_open(i8* %6, i32** %3)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = call i32 @openDBResponse(i32 %8)
store i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0), i8** %5
%10 = load i32*, i32** %3
%11 = load i8*, i8** %5
%12 = call i32 @executeSQLCommand(i32* %10, i8* %11)
store i32 %12, i32* %4
%13 = load i32*, i32** %3
%14 = call i32 @sqlite3_close(i32* %13)
ret void
}

LLVM IR (-O2):
@.str = [247 x i8] c"Create Table Database(ID Int PRIMARY KEY NOT NULL,IsAdmin Int NOT NULL,Username Text NOT NULL,Password Char(100) NOT NULL);Insert into Database values (1, 1, 'admin', '123456'); \00"
define void @createDatabase(i8* %0) {
%2 = alloca i32*
%3 = bitcast i32** %2 to i8*
%4 = call i32 @sqlite3_open(i8* %0, i32** %2)
%5 = call i32 @openDBResponse(i32 %4)
%6 = load i32*, i32** %2
%7 = call i32 @executeSQLCommand(i32* %6, i8* getelementptr inbounds ([247 x i8], [247 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %2
%9 = call i32 @sqlite3_close(i32* %8)
ret void
}