#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 */
struct odem_particle_node {
  int dummy;
};
typedef int /*<<< orphan*/ sqlite_msg;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int SQLITE_OK;
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ odem_alloc_particle(double, double, double *, double *);
struct odem_particle_node *odem_alloc_particle_node(int /*<<< orphan*/);
int /*<<< orphan*/ odem_dealloc_particle_list(struct odem_particle_node *);
int /*<<< orphan*/ odem_init_results_db(int /*<<< orphan*/ *);
int /*<<< orphan*/ odem_mparticle_list_push(struct odem_particle_node **,
                                            int /*<<< orphan*/);
int /*<<< orphan*/ odem_record_model_data(int /*<<< orphan*/ *, int const,
                                          double const, double *);
int /*<<< orphan*/ odem_record_particle_data(int /*<<< orphan*/ *,
                                             struct odem_particle_node *);
int /*<<< orphan*/ odem_run_analysis(int /*<<< orphan*/ *,
                                     struct odem_particle_node *, double *,
                                     int const, double const, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
char *sqlite3_errmsg(int /*<<< orphan*/ *);
int sqlite3_open(char const *, int /*<<< orphan*/ **);
int main(int argc, char *argv[]) {
  double c1[2] = {0.0, 5.0};
  double c2[2] = {5.0, 0.0};
  double c3[2] = {10.0, 0.0};
  double c4[2] = {0.0, 10.0};
  double v1[2] = {1.0, 0.0};
  double v2[2] = {0.0, 1.0};
  double v3[2] = {0.5, 0.0};
  double v4[2] = {0.0, 0.7};
  struct odem_particle_node *ppart_list =
      odem_alloc_particle_node(odem_alloc_particle(12.1, 3.2, c1, v1));
  odem_mparticle_list_push(&ppart_list, odem_alloc_particle(3.2, 1.0, c2, v2));
  odem_mparticle_list_push(&ppart_list, odem_alloc_particle(3.2, 0.7, c3, v3));
  odem_mparticle_list_push(&ppart_list, odem_alloc_particle(3.2, 1.0, c4, v4));
  const int iters = 550;
  const double delta_time = 0.1;
  double bounds[2 * 2] = {0.0, 20.0, 0.0, 20.0};
  sqlite3 *db;
  int rc;
  char *errmsg;
  char sqlite_msg[256];
  size_t msg_size = sizeof(sqlite_msg);
  const char *data_file = "results.db";
  rc = sqlite3_open(data_file, &db);
  if (rc != SQLITE_OK) {
    snprintf(sqlite_msg, msg_size, "ERROR opening database: %s\n",
             sqlite3_errmsg(db));
    die(sqlite_msg);
  }
  printf("Initializing results database: %s\n", data_file);
  odem_init_results_db(db);
  odem_record_particle_data(db, ppart_list);
  odem_record_model_data(db, iters, delta_time, bounds);
  odem_run_analysis(db, ppart_list, bounds, iters, delta_time, 1);
  printf("Freeing dynamic memory...\n");
  sqlite3_close(db);
  odem_dealloc_particle_list(ppart_list);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe30(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe2d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe2a(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe27(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe24(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe21(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe1e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe1b(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe18(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe15(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe12(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe0f(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe0c(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe09(%rip),%rax
mov    %rax,-0x78(%rbp)
mov    0xe06(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xe00(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x60(%rbp),%rsi
movsd  0xd61(%rip),%xmm0
movsd  0xd41(%rip),%xmm1
call   1030 <odem_alloc_particle@plt>
mov    %eax,%edi
call   10b0 <odem_alloc_particle_node@plt>
mov    %rax,-0x98(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x70(%rbp),%rsi
movsd  0xd1e(%rip),%xmm0
movsd  0xd1e(%rip),%xmm1
call   1030 <odem_alloc_particle@plt>
mov    %eax,%esi
lea    -0x98(%rbp),%rdi
call   10a0 <odem_mparticle_list_push@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
movsd  0xcf3(%rip),%xmm0
movsd  0xcfb(%rip),%xmm1
call   1030 <odem_alloc_particle@plt>
mov    %eax,%esi
lea    -0x98(%rbp),%rdi
call   10a0 <odem_mparticle_list_push@plt>
lea    -0x50(%rbp),%rdi
lea    -0x90(%rbp),%rsi
movsd  0xcc5(%rip),%xmm0
movsd  0xcc5(%rip),%xmm1
call   1030 <odem_alloc_particle@plt>
mov    %eax,%esi
lea    -0x98(%rbp),%rdi
call   10a0 <odem_mparticle_list_push@plt>
movl   $0x226,-0x9c(%rbp)
movsd  0xc90(%rip),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    0xd31(%rip),%rax
mov    %rax,-0xd0(%rbp)
mov    0xd2b(%rip),%rax
mov    %rax,-0xc8(%rbp)
mov    0xd25(%rip),%rax
mov    %rax,-0xc0(%rbp)
mov    0xd1f(%rip),%rax
mov    %rax,-0xb8(%rbp)
movq   $0x100,-0x1f8(%rbp)
lea    0xd0e(%rip),%rax
mov    %rax,-0x200(%rbp)
mov    -0x200(%rbp),%rdi
lea    -0xd8(%rbp),%rsi
call   1060 <sqlite3_open@plt>
mov    %eax,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
mov    0x2bf9(%rip),%rcx
cmp    (%rcx),%eax
je     1448 <main+0x268>
lea    -0x1f0(%rbp),%rax
mov    %rax,-0x210(%rbp)
mov    -0x1f8(%rbp),%rax
mov    %rax,-0x208(%rbp)
mov    -0xd8(%rbp),%rdi
call   10d0 <sqlite3_errmsg@plt>
mov    -0x210(%rbp),%rdi
mov    -0x208(%rbp),%rsi
mov    %rax,%rcx
lea    0xca4(%rip),%rdx
call   1080 <snprintf@plt>
lea    -0x1f0(%rbp),%rdi
call   10f0 <die@plt>
mov    -0x200(%rbp),%rsi
lea    0xca1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xd8(%rbp),%rdi
call   1050 <odem_init_results_db@plt>
mov    -0xd8(%rbp),%rdi
mov    -0x98(%rbp),%rsi
call   1040 <odem_record_particle_data@plt>
mov    -0xd8(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
mov    $0x226,%esi
movsd  0xb69(%rip),%xmm0
call   10c0 <odem_record_model_data@plt>
mov    -0xd8(%rbp),%rdi
mov    -0x98(%rbp),%rsi
lea    -0xd0(%rbp),%rdx
mov    $0x226,%ecx
movsd  0xb42(%rip),%xmm0
mov    $0x1,%r8d
call   1090 <odem_run_analysis@plt>
lea    0xc4a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0xd8(%rbp),%rdi
call   10e0 <sqlite3_close@plt>
mov    -0x98(%rbp),%rdi
call   1100 <odem_dealloc_particle_list@plt>
xor    %eax,%eax
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1b0,%rsp
movaps 0xe31(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe32(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe36(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe3a(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe3e(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe42(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe46(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe4a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movsd  0xd9d(%rip),%xmm0
movsd  0xd9d(%rip),%xmm1
lea    0x80(%rsp),%rdi
lea    0x40(%rsp),%rsi
call   1030 <odem_alloc_particle@plt>
mov    %eax,%edi
call   10c0 <odem_alloc_particle_node@plt>
mov    %rax,0x8(%rsp)
movsd  0xd7f(%rip),%xmm1
lea    0x70(%rsp),%rdi
lea    0x30(%rsp),%rsi
movsd  0xd65(%rip),%xmm0
call   1030 <odem_alloc_particle@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   10b0 <odem_mparticle_list_push@plt>
movsd  0xd59(%rip),%xmm1
lea    0x60(%rsp),%rdi
lea    0x20(%rsp),%rsi
movsd  0xd37(%rip),%xmm0
call   1030 <odem_alloc_particle@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   10b0 <odem_mparticle_list_push@plt>
lea    0x50(%rsp),%rdi
lea    0x10(%rsp),%rsi
movsd  0xd16(%rip),%xmm0
movsd  0xd16(%rip),%xmm1
call   1030 <odem_alloc_particle@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   10b0 <odem_mparticle_list_push@plt>
movaps 0xdb0(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xd91(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
lea    0xda2(%rip),%rdi
mov    %rsp,%rsi
call   1070 <sqlite3_open@plt>
mov    0x2cab(%rip),%rcx
cmp    (%rcx),%eax
je     1371 <main+0x181>
mov    (%rsp),%rdi
call   10e0 <sqlite3_errmsg@plt>
lea    0xd8a(%rip),%rdx
lea    0xb0(%rsp),%rbx
mov    $0x100,%esi
mov    %rbx,%rdi
mov    %rax,%rcx
call   1090 <snprintf@plt>
mov    %rbx,%rdi
call   1100 <die@plt>
lea    0xd7f(%rip),%rdi
lea    0xd51(%rip),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%rsp),%rdi
call   1050 <odem_init_results_db@plt>
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <odem_record_particle_data@plt>
mov    (%rsp),%rdi
movsd  0xc77(%rip),%xmm0
lea    0x90(%rsp),%rbx
mov    $0x226,%esi
mov    %rbx,%rdx
call   10d0 <odem_record_model_data@plt>
mov    (%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
mov    $0x226,%ecx
movsd  0xc49(%rip),%xmm0
mov    $0x1,%r8d
call   10a0 <odem_run_analysis@plt>
lea    0xd31(%rip),%rdi
call   1060 <puts@plt>
mov    (%rsp),%rdi
call   10f0 <sqlite3_close@plt>
mov    0x8(%rsp),%rdi
call   1110 <odem_dealloc_particle_list@plt>
xor    %eax,%eax
add    $0x1b0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.odem_particle_node = type { i32 }
@__const.main.c1 = [2 x double] [double 0.000000e+00, double 5.000000e+00]
@__const.main.c2 = [2 x double] [double 5.000000e+00, double 0.000000e+00]
@__const.main.c3 = [2 x double] [double 1.000000e+01, double 0.000000e+00]
@__const.main.c4 = [2 x double] [double 0.000000e+00, double 1.000000e+01]
@__const.main.v1 = [2 x double] [double 1.000000e+00, double 0.000000e+00]
@__const.main.v2 = [2 x double] [double 0.000000e+00, double 1.000000e+00]
@__const.main.v3 = [2 x double] [double 5.000000e-01, double 0.000000e+00]
@__const.main.v4 = [2 x double] [double 0.000000e+00, double 0x3FE6666666666666]
@__const.main.bounds = [4 x double] [double 0.000000e+00, double 2.000000e+01, double 0.000000e+00, double 2.000000e+01]
@.str = [11 x i8] c"results.db\00"
@SQLITE_OK = global i32 0
@.str.1 = [28 x i8] c"ERROR opening database: %s\0A\00"
@.str.2 = [35 x i8] c"Initializing results database: %s\0A\00"
@.str.3 = [27 x i8] c"Freeing dynamic memory...\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x double]
%7 = alloca [2 x double]
%8 = alloca [2 x double]
%9 = alloca [2 x double]
%10 = alloca [2 x double]
%11 = alloca [2 x double]
%12 = alloca [2 x double]
%13 = alloca [2 x double]
%14 = alloca %struct.odem_particle_node*
%15 = alloca i32
%16 = alloca double
%17 = alloca [4 x double]
%18 = alloca i32*
%19 = alloca i32
%20 = alloca i8*
%21 = alloca [256 x i8]
%22 = alloca i64
%23 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = bitcast [2 x double]* %6 to i8*
%25 = bitcast [2 x double]* %7 to i8*
%26 = bitcast [2 x double]* %8 to i8*
%27 = bitcast [2 x double]* %9 to i8*
%28 = bitcast [2 x double]* %10 to i8*
%29 = bitcast [2 x double]* %11 to i8*
%30 = bitcast [2 x double]* %12 to i8*
%31 = bitcast [2 x double]* %13 to i8*
%32 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
%33 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%34 = call i32 @odem_alloc_particle(double 1.210000e+01, double 3.200000e+00, double* %32, double* %33)
%35 = call %struct.odem_particle_node* @odem_alloc_particle_node(i32 %34)
store %struct.odem_particle_node* %35, %struct.odem_particle_node** %14
%36 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%37 = getelementptr inbounds [2 x double], [2 x double]* %11, i64 0, i64 0
%38 = call i32 @odem_alloc_particle(double 3.200000e+00, double 1.000000e+00, double* %36, double* %37)
%39 = call i32 @odem_mparticle_list_push(%struct.odem_particle_node** %14, i32 %38)
%40 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%41 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%42 = call i32 @odem_alloc_particle(double 3.200000e+00, double 0x3FE6666666666666, double* %40, double* %41)
%43 = call i32 @odem_mparticle_list_push(%struct.odem_particle_node** %14, i32 %42)
%44 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%45 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%46 = call i32 @odem_alloc_particle(double 3.200000e+00, double 1.000000e+00, double* %44, double* %45)
%47 = call i32 @odem_mparticle_list_push(%struct.odem_particle_node** %14, i32 %46)
store i32 550, i32* %15
store double 1.000000e-01, double* %16
%48 = bitcast [4 x double]* %17 to i8*
store i64 256, i64* %22
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %23
%49 = load i8*, i8** %23
%50 = call i32 @sqlite3_open(i8* %49, i32** %18)
store i32 %50, i32* %19
%51 = load i32, i32* %19
%52 = load i32, i32* @SQLITE_OK
%53 = icmp ne i32 %51, %52
br i1 %53, label %54, label %62
54: ; preds = %2
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%56 = load i64, i64* %22
%57 = load i32*, i32** %18
%58 = call i8* @sqlite3_errmsg(i32* %57)
%59 = call i32 @snprintf(i8* %55, i64 %56, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %58)
%60 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%61 = call i32 @die(i8* %60)
br label %62
62: ; preds = %54, %2
%63 = load i8*, i8** %23
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* %63)
%65 = load i32*, i32** %18
%66 = call i32 @odem_init_results_db(i32* %65)
%67 = load i32*, i32** %18
%68 = load %struct.odem_particle_node*, %struct.odem_particle_node** %14
%69 = call i32 @odem_record_particle_data(i32* %67, %struct.odem_particle_node* %68)
%70 = load i32*, i32** %18
%71 = getelementptr inbounds [4 x double], [4 x double]* %17, i64 0, i64 0
%72 = call i32 @odem_record_model_data(i32* %70, i32 550, double 1.000000e-01, double* %71)
%73 = load i32*, i32** %18
%74 = load %struct.odem_particle_node*, %struct.odem_particle_node** %14
%75 = getelementptr inbounds [4 x double], [4 x double]* %17, i64 0, i64 0
%76 = call i32 @odem_run_analysis(i32* %73, %struct.odem_particle_node* %74, double* %75, i32 550, double 1.000000e-01, i32 1)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%78 = load i32*, i32** %18
%79 = call i32 @sqlite3_close(i32* %78)
%80 = load %struct.odem_particle_node*, %struct.odem_particle_node** %14
%81 = call i32 @odem_dealloc_particle_list(%struct.odem_particle_node* %80)
ret i32 0
}

LLVM IR (-O2):
%struct.odem_particle_node = type { i32 }
@__const.main.c1 = [2 x double] [double 0.000000e+00, double 5.000000e+00]
@__const.main.c2 = [2 x double] [double 5.000000e+00, double 0.000000e+00]
@__const.main.c3 = [2 x double] [double 1.000000e+01, double 0.000000e+00]
@__const.main.c4 = [2 x double] [double 0.000000e+00, double 1.000000e+01]
@__const.main.v1 = [2 x double] [double 1.000000e+00, double 0.000000e+00]
@__const.main.v2 = [2 x double] [double 0.000000e+00, double 1.000000e+00]
@__const.main.v3 = [2 x double] [double 5.000000e-01, double 0.000000e+00]
@__const.main.v4 = [2 x double] [double 0.000000e+00, double 0x3FE6666666666666]
@__const.main.bounds = [4 x double] [double 0.000000e+00, double 2.000000e+01, double 0.000000e+00, double 2.000000e+01]
@.str = [11 x i8] c"results.db\00"
@SQLITE_OK = global i32 0
@.str.1 = [28 x i8] c"ERROR opening database: %s\0A\00"
@.str.2 = [35 x i8] c"Initializing results database: %s\0A\00"
@str = [26 x i8] c"Freeing dynamic memory...\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x double]
%4 = alloca [2 x double]
%5 = alloca [2 x double]
%6 = alloca [2 x double]
%7 = alloca [2 x double]
%8 = alloca [2 x double]
%9 = alloca [2 x double]
%10 = alloca [2 x double]
%11 = alloca %struct.odem_particle_node*
%12 = alloca [4 x double]
%13 = alloca i32*
%14 = alloca [256 x i8]
%15 = bitcast [2 x double]* %3 to i8*
%16 = bitcast [2 x double]* %4 to i8*
%17 = bitcast [2 x double]* %5 to i8*
%18 = bitcast [2 x double]* %6 to i8*
%19 = bitcast [2 x double]* %7 to i8*
%20 = bitcast [2 x double]* %8 to i8*
%21 = bitcast [2 x double]* %9 to i8*
%22 = bitcast [2 x double]* %10 to i8*
%23 = bitcast %struct.odem_particle_node** %11 to i8*
%24 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%25 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%26 = call i32 @odem_alloc_particle(double 1.210000e+01, double 3.200000e+00, double* %24, double* %25)
%27 = call %struct.odem_particle_node* @odem_alloc_particle_node(i32 %26)
store %struct.odem_particle_node* %27, %struct.odem_particle_node** %11
%28 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
%29 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%30 = call i32 @odem_alloc_particle(double 3.200000e+00, double 1.000000e+00, double* %28, double* %29)
%31 = call i32 @odem_mparticle_list_push(%struct.odem_particle_node** %11, i32 %30)
%32 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%33 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 0
%34 = call i32 @odem_alloc_particle(double 3.200000e+00, double 0x3FE6666666666666, double* %32, double* %33)
%35 = call i32 @odem_mparticle_list_push(%struct.odem_particle_node** %11, i32 %34)
%36 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
%37 = getelementptr inbounds [2 x double], [2 x double]* %10, i64 0, i64 0
%38 = call i32 @odem_alloc_particle(double 3.200000e+00, double 1.000000e+00, double* %36, double* %37)
%39 = call i32 @odem_mparticle_list_push(%struct.odem_particle_node** %11, i32 %38)
%40 = bitcast [4 x double]* %12 to i8*
%41 = bitcast i32** %13 to i8*
%42 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%43 = call i32 @sqlite3_open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32** %13)
%44 = load i32, i32* @SQLITE_OK
%45 = icmp eq i32 %43, %44
br i1 %45, label %51, label %46
46: ; preds = %2
%47 = load i32*, i32** %13
%48 = call i8* @sqlite3_errmsg(i32* %47)
%49 = call i32 @snprintf(i8* %42, i64 256, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %48)
%50 = call i32 @die(i8* %42)
br label %51
51: ; preds = %46, %2
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%53 = load i32*, i32** %13
%54 = call i32 @odem_init_results_db(i32* %53)
%55 = load i32*, i32** %13
%56 = load %struct.odem_particle_node*, %struct.odem_particle_node** %11
%57 = call i32 @odem_record_particle_data(i32* %55, %struct.odem_particle_node* %56)
%58 = load i32*, i32** %13
%59 = getelementptr inbounds [4 x double], [4 x double]* %12, i64 0, i64 0
%60 = call i32 @odem_record_model_data(i32* %58, i32 550, double 1.000000e-01, double* %59)
%61 = load i32*, i32** %13
%62 = load %struct.odem_particle_node*, %struct.odem_particle_node** %11
%63 = call i32 @odem_run_analysis(i32* %61, %struct.odem_particle_node* %62, double* %59, i32 550, double 1.000000e-01, i32 1)
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%65 = load i32*, i32** %13
%66 = call i32 @sqlite3_close(i32* %65)
%67 = load %struct.odem_particle_node*, %struct.odem_particle_node** %11
%68 = call i32 @odem_dealloc_particle_list(%struct.odem_particle_node* %67)
ret i32 0
}