#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 */

/* Variables and functions */
void *dbLock();
int /*<<< orphan*/ dbUnlock(void *);
int /*<<< orphan*/ execSql(char *);
void createSchema() {
  void *lock = dbLock();
  execSql("CREATE TABLE IF NOT EXISTS fragmented_meta ("
          " outbound INTEGER NOT NULL,"
          " friend_id INTEGER NOT NULL,"
          " type INTEGER NOT NULL,"
          " frags_id INTEGER NOT NULL,"
          " timestamp_first INTEGER NOT NULL, timestamp_last INTEGER NOT NULL,"
          " frags_done INTEGER NOT NULL, frags_num INTEGER NOT NULL,"
          " PRIMARY KEY(outbound, friend_id, frags_id)); "
          "CREATE TABLE IF NOT EXISTS fragmented_data ("
          " outbound INTEGER NOT NULL,"
          " friend_id INTEGER NOT NULL,"
          " frags_id INTEGER NOT NULL,"
          " message BLOB NULL,"
          " confirmed BLOB NULL,"
          " receipt INTEGER NULL,"
          " PRIMARY KEY(outbound, friend_id, frags_id));");
  dbUnlock(lock);
}


x86 assembly (clang, -O0):
<createSchema>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <dbLock@plt>
mov    %rax,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
call   1030 <execSql@plt>
mov    -0x8(%rbp),%rdi
call   1040 <dbUnlock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createSchema>:
push   %rbx
xor    %eax,%eax
call   1050 <dbLock@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
call   1030 <execSql@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <dbUnlock@plt>

LLVM IR (-O0):
@.str = [553 x i8] c"CREATE TABLE IF NOT EXISTS fragmented_meta ( outbound INTEGER NOT NULL, friend_id INTEGER NOT NULL, type INTEGER NOT NULL, frags_id INTEGER NOT NULL, timestamp_first INTEGER NOT NULL, timestamp_last INTEGER NOT NULL, frags_done INTEGER NOT NULL, frags_num INTEGER NOT NULL, PRIMARY KEY(outbound, friend_id, frags_id)); CREATE TABLE IF NOT EXISTS fragmented_data ( outbound INTEGER NOT NULL, friend_id INTEGER NOT NULL, frags_id INTEGER NOT NULL, message BLOB NULL, confirmed BLOB NULL, receipt INTEGER NULL, PRIMARY KEY(outbound, friend_id, frags_id));\00"
define void @createSchema() {
%1 = alloca i8*
%2 = call i8* (...) @dbLock()
store i8* %2, i8** %1
%3 = call i32 @execSql(i8* getelementptr inbounds ([553 x i8], [553 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = call i32 @dbUnlock(i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [553 x i8] c"CREATE TABLE IF NOT EXISTS fragmented_meta ( outbound INTEGER NOT NULL, friend_id INTEGER NOT NULL, type INTEGER NOT NULL, frags_id INTEGER NOT NULL, timestamp_first INTEGER NOT NULL, timestamp_last INTEGER NOT NULL, frags_done INTEGER NOT NULL, frags_num INTEGER NOT NULL, PRIMARY KEY(outbound, friend_id, frags_id)); CREATE TABLE IF NOT EXISTS fragmented_data ( outbound INTEGER NOT NULL, friend_id INTEGER NOT NULL, frags_id INTEGER NOT NULL, message BLOB NULL, confirmed BLOB NULL, receipt INTEGER NULL, PRIMARY KEY(outbound, friend_id, frags_id));\00"
define void @createSchema() {
%1 = tail call i8* (...) @dbLock()
%2 = tail call i32 @execSql(i8* getelementptr inbounds ([553 x i8], [553 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @dbUnlock(i8* %1)
ret void
}