#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 /*<<< orphan*/ odem_exec_noselect_db(int /*<<< orphan*/ *, char *);
void odem_init_results_db(sqlite3 *db) {
  odem_exec_noselect_db(db, "PRAGMA foreign_keys = ON");
  odem_exec_noselect_db(
      db, "CREATE TABLE particle"
          "(particle_id INTEGER PRIMARY KEY AUTOINCREMENT, mass REAL,"
          " radius REAL)");
  odem_exec_noselect_db(
      db, "CREATE TABLE model"
          "(iters INTEGER, delta_time REAL, x_min REAL, x_max REAL,"
          " y_min REAL, y_max REAL)");
  odem_exec_noselect_db(
      db, "CREATE TABLE motion (time REAL, particle_id INTEGER, x REAL,"
          " y REAL, v_x REAL, v_y REAL, a_x REAL, a_y REAL, f_x REAL,"
          " f_y REAL, FOREIGN KEY(particle_id) REFERENCES"
          " particle(particle_id))");
  odem_exec_noselect_db(
      db, "CREATE INDEX time_particle_id_idx ON motion (time, particle_id)");
}


x86 assembly (clang, -O0):
<odem_init_results_db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <odem_exec_noselect_db@plt>
mov    -0x8(%rbp),%rdi
lea    0xee2(%rip),%rsi
call   1030 <odem_exec_noselect_db@plt>
mov    -0x8(%rbp),%rdi
lea    0xf2f(%rip),%rsi
call   1030 <odem_exec_noselect_db@plt>
mov    -0x8(%rbp),%rdi
lea    0xf82(%rip),%rsi
call   1030 <odem_exec_noselect_db@plt>
mov    -0x8(%rbp),%rdi
lea    0x102e(%rip),%rsi
call   1030 <odem_exec_noselect_db@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<odem_init_results_db>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <odem_exec_noselect_db@plt>
lea    0xef2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <odem_exec_noselect_db@plt>
lea    0xf40(%rip),%rsi
mov    %rbx,%rdi
call   1030 <odem_exec_noselect_db@plt>
lea    0xf94(%rip),%rsi
mov    %rbx,%rdi
call   1030 <odem_exec_noselect_db@plt>
lea    0x1041(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <odem_exec_noselect_db@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"PRAGMA foreign_keys = ON\00"
@.str.1 = [93 x i8] c"CREATE TABLE particle(particle_id INTEGER PRIMARY KEY AUTOINCREMENT, mass REAL, radius REAL)\00"
@.str.2 = [99 x i8] c"CREATE TABLE model(iters INTEGER, delta_time REAL, x_min REAL, x_max REAL, y_min REAL, y_max REAL)\00"
@.str.3 = [188 x i8] c"CREATE TABLE motion (time REAL, particle_id INTEGER, x REAL, y REAL, v_x REAL, v_y REAL, a_x REAL, a_y REAL, f_x REAL, f_y REAL, FOREIGN KEY(particle_id) REFERENCES particle(particle_id))\00"
@.str.4 = [64 x i8] c"CREATE INDEX time_particle_id_idx ON motion (time, particle_id)\00"
define void @odem_init_results_db(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @odem_exec_noselect_db(i32* %3, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @odem_exec_noselect_db(i32* %5, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @odem_exec_noselect_db(i32* %7, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.2, i64 0, i64 0))
%9 = load i32*, i32** %2
%10 = call i32 @odem_exec_noselect_db(i32* %9, i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32*, i32** %2
%12 = call i32 @odem_exec_noselect_db(i32* %11, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"PRAGMA foreign_keys = ON\00"
@.str.1 = [93 x i8] c"CREATE TABLE particle(particle_id INTEGER PRIMARY KEY AUTOINCREMENT, mass REAL, radius REAL)\00"
@.str.2 = [99 x i8] c"CREATE TABLE model(iters INTEGER, delta_time REAL, x_min REAL, x_max REAL, y_min REAL, y_max REAL)\00"
@.str.3 = [188 x i8] c"CREATE TABLE motion (time REAL, particle_id INTEGER, x REAL, y REAL, v_x REAL, v_y REAL, a_x REAL, a_y REAL, f_x REAL, f_y REAL, FOREIGN KEY(particle_id) REFERENCES particle(particle_id))\00"
@.str.4 = [64 x i8] c"CREATE INDEX time_particle_id_idx ON motion (time, particle_id)\00"
define void @odem_init_results_db(i32* %0) {
%2 = tail call i32 @odem_exec_noselect_db(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @odem_exec_noselect_db(i32* %0, i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @odem_exec_noselect_db(i32* %0, i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @odem_exec_noselect_db(i32* %0, i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @odem_exec_noselect_db(i32* %0, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0))
ret void
}