#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 /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int SQLITE_DONE;
int SQLITE_OK;
int SQLITE_OPEN_READWRITE;
int /*<<< orphan*/ SQLITE_STATIC;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int sqlite3_bind_parameter_count(int /*<<< orphan*/ *);
int sqlite3_bind_parameter_index(int /*<<< orphan*/ *, char *);
char *sqlite3_bind_parameter_name(int /*<<< orphan*/ *, int);
int sqlite3_bind_text(int /*<<< orphan*/ *, int, char const *const, int,
                      int /*<<< orphan*/);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_close_v2(int /*<<< orphan*/ *);
char *sqlite3_errmsg(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int sqlite3_initialize();
int sqlite3_open_v2(char *, int /*<<< orphan*/ **, int, int /*<<< orphan*/ *);
int sqlite3_prepare_v2(int /*<<< orphan*/ *, char *, int, int /*<<< orphan*/ **,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_shutdown();
int sqlite3_step(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  sqlite3 *db = NULL;
  sqlite3_stmt *stmt = NULL;
  int flags = SQLITE_OPEN_READWRITE;
  int rc = 0;
  int idx = -1;
  char *sql_str = "INSERT INTO addressbook (fullname, alias, email)"
                  "VALUES(:name, @aka, $mail)";
  if (argc != 5) {
    fprintf(stderr, "Usage: %s <DB>,<name>,<alias>,<email>\n", argv[0]);
    exit(EXIT_FAILURE);
  }
  const char *const str_fullname = (argc && argv[2]) ? argv[2] : "";
  const char *const str_alias = (argc && argv[3]) ? argv[3] : "";
  const char *const str_email = (argc && argv[4]) ? argv[4] : "";
  if (sqlite3_initialize() != SQLITE_OK) {
    fprintf(stderr, "Err. Unable to initialize the library.\n");
    exit(EXIT_FAILURE);
  }
  rc = sqlite3_open_v2(argv[1], &db, flags, NULL);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "Err. can't create database: %s\n", sqlite3_errmsg(db));
    sqlite3_close(db);
    exit(EXIT_FAILURE);
  }
  rc = sqlite3_prepare_v2(db, sql_str, -1, &stmt, NULL);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "Err. Can't prepare the statement.\n");
    sqlite3_close(db);
    exit(EXIT_FAILURE);
  }
  idx = sqlite3_bind_parameter_index(stmt, ":name");
  rc = sqlite3_bind_text(stmt, idx, str_fullname, -1, SQLITE_STATIC);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "Err. Binding the value (%i).\n", rc);
    return 1;
  }
  idx = sqlite3_bind_parameter_index(stmt, "@aka");
  rc = sqlite3_bind_text(stmt, idx, str_alias, -1, SQLITE_STATIC);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "Err. Binding the value (%i).\n", rc);
    return 1;
  }
  idx = sqlite3_bind_parameter_index(stmt, "$mail");
  rc = sqlite3_bind_text(stmt, idx, str_email, -1, SQLITE_STATIC);
  if (rc != SQLITE_OK) {
    fprintf(stderr, "Err. Binding the value (%i).\n", rc);
    return 1;
  }
  printf("Total bound parameters: %d\n", sqlite3_bind_parameter_count(stmt));
  printf("\'%5s\' index \'%d\'\n", sqlite3_bind_parameter_name(stmt, 1),
         sqlite3_bind_parameter_index(stmt, ":name"));
  printf("\'%5s\' index \'%d\'\n", sqlite3_bind_parameter_name(stmt, 2),
         sqlite3_bind_parameter_index(stmt, "@aka"));
  printf("\'%5s\' index \'%d\'\n", sqlite3_bind_parameter_name(stmt, 3),
         sqlite3_bind_parameter_index(stmt, "$mail"));
  rc = sqlite3_step(stmt);
  if (rc != SQLITE_DONE) {
    fprintf(stderr, "Err. Stepping through the statement.\n");
  } else
    puts("... Statement successfully executed.");
  sqlite3_finalize(stmt);
  sqlite3_close_v2(db);
  sqlite3_shutdown();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    0x2db0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0xffffffff,-0x2c(%rbp)
lea    0xda6(%rip),%rax
mov    %rax,-0x38(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     1294 <main+0x84>
mov    0x2d61(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdcc(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    0x2d2b(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
je     12be <main+0xae>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     12be <main+0xae>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x58(%rbp)
jmp    12ce <main+0xbe>
lea    0xe74(%rip),%rax
mov    %rax,-0x58(%rbp)
jmp    12ce <main+0xbe>
mov    -0x58(%rbp),%rax
mov    %rax,-0x40(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1300 <main+0xf0>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x18(%rax)
je     1300 <main+0xf0>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x60(%rbp)
jmp    1310 <main+0x100>
lea    0xe32(%rip),%rax
mov    %rax,-0x60(%rbp)
jmp    1310 <main+0x100>
mov    -0x60(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1342 <main+0x132>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x20(%rax)
je     1342 <main+0x132>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x68(%rbp)
jmp    1352 <main+0x142>
lea    0xdf0(%rip),%rax
mov    %rax,-0x68(%rbp)
jmp    1352 <main+0x142>
mov    -0x68(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    $0x0,%al
call   1030 <sqlite3_initialize@plt>
mov    0x2c78(%rip),%rcx
cmp    (%rcx),%eax
je     1395 <main+0x185>
mov    0x2c59(%rip),%rax
mov    (%rax),%edi
lea    0xcf2(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    0x2c2a(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x24(%rbp),%edx
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
call   1110 <sqlite3_open_v2@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2c26(%rip),%rcx
cmp    (%rcx),%eax
je     1402 <main+0x1f2>
mov    0x2c07(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <sqlite3_errmsg@plt>
mov    -0x6c(%rbp),%edi
mov    %rax,%rdx
lea    0xcb6(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <sqlite3_close@plt>
mov    0x2bbd(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
mov    $0xffffffff,%edx
lea    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1100 <sqlite3_prepare_v2@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2bb6(%rip),%rcx
cmp    (%rcx),%eax
je     1460 <main+0x250>
mov    0x2b97(%rip),%rax
mov    (%rax),%edi
lea    0xc78(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   10d0 <sqlite3_close@plt>
mov    0x2b5f(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>
mov    -0x20(%rbp),%rdi
lea    0xc72(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x40(%rbp),%rdx
mov    0x2b43(%rip),%rax
mov    (%rax),%r8d
mov    $0xffffffff,%ecx
call   10e0 <sqlite3_bind_text@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2b41(%rip),%rcx
cmp    (%rcx),%eax
je     14cd <main+0x2bd>
mov    0x2b22(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    0xc29(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16d3 <main+0x4c3>
mov    -0x20(%rbp),%rdi
lea    0xc29(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x48(%rbp),%rdx
mov    0x2ad6(%rip),%rax
mov    (%rax),%r8d
mov    $0xffffffff,%ecx
call   10e0 <sqlite3_bind_text@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2ad4(%rip),%rcx
cmp    (%rcx),%eax
je     153a <main+0x32a>
mov    0x2ab5(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    0xbbc(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16d3 <main+0x4c3>
mov    -0x20(%rbp),%rdi
lea    0xbc1(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x50(%rbp),%rdx
mov    0x2a69(%rip),%rax
mov    (%rax),%r8d
mov    $0xffffffff,%ecx
call   10e0 <sqlite3_bind_text@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2a67(%rip),%rcx
cmp    (%rcx),%eax
je     15a7 <main+0x397>
mov    0x2a48(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
lea    0xb4f(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16d3 <main+0x4c3>
mov    -0x20(%rbp),%rdi
call   1080 <sqlite3_bind_parameter_count@plt>
mov    %eax,%esi
lea    0xb53(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x1,%esi
call   1050 <sqlite3_bind_parameter_name@plt>
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xafd(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    -0x88(%rbp),%rsi
mov    %eax,%edx
lea    0xb33(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x2,%esi
call   1050 <sqlite3_bind_parameter_name@plt>
mov    %rax,-0x80(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xae8(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    -0x80(%rbp),%rsi
mov    %eax,%edx
lea    0xafd(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1050 <sqlite3_bind_parameter_name@plt>
mov    %rax,-0x78(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xab7(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    -0x78(%rbp),%rsi
mov    %eax,%edx
lea    0xac7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%rdi
call   10b0 <sqlite3_step@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    0x2942(%rip),%rcx
cmp    (%rcx),%eax
je     16a2 <main+0x492>
mov    0x2943(%rip),%rax
mov    (%rax),%edi
lea    0xaa4(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
jmp    16ae <main+0x49e>
lea    0xab7(%rip),%rdi
call   1040 <puts@plt>
mov    -0x20(%rbp),%rdi
call   10f0 <sqlite3_finalize@plt>
mov    -0x18(%rbp),%rdi
call   1130 <sqlite3_close_v2@plt>
mov    $0x0,%al
call   1070 <sqlite3_shutdown@plt>
mov    0x28e2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
movq   $0x0,0x10(%rsp)
movq   $0x0,0x8(%rsp)
cmp    $0x5,%edi
jne    14aa <main+0x29a>
mov    0x2dad(%rip),%rax
mov    (%rax),%ebp
mov    0x10(%rbx),%r12
test   %r12,%r12
lea    0xee6(%rip),%rax
cmove  %rax,%r12
mov    0x18(%rbx),%r15
test   %r15,%r15
cmove  %rax,%r15
mov    0x20(%rbx),%r14
test   %r14,%r14
cmove  %rax,%r14
xor    %eax,%eax
call   1030 <sqlite3_initialize@plt>
mov    0x2d65(%rip),%r13
cmp    0x0(%r13),%eax
jne    14c6 <main+0x2b6>
mov    0x8(%rbx),%rdi
lea    0x10(%rsp),%rsi
mov    %ebp,%edx
xor    %ecx,%ecx
call   1110 <sqlite3_open_v2@plt>
cmp    0x0(%r13),%eax
jne    14df <main+0x2cf>
mov    0x10(%rsp),%rdi
lea    0xd53(%rip),%rsi
lea    0x8(%rsp),%rcx
mov    $0xffffffff,%edx
xor    %r8d,%r8d
call   1100 <sqlite3_prepare_v2@plt>
cmp    0x0(%r13),%eax
jne    1507 <main+0x2f7>
mov    0x8(%rsp),%rdi
lea    0xe08(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    0x8(%rsp),%rdi
mov    0x2ce2(%rip),%rbx
mov    (%rbx),%r8d
mov    %eax,%esi
mov    %r12,%rdx
mov    $0xffffffff,%ecx
call   10e0 <sqlite3_bind_text@plt>
cmp    0x0(%r13),%eax
jne    1440 <main+0x230>
mov    0x8(%rsp),%rdi
lea    0xdf3(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    0x8(%rsp),%rdi
mov    (%rbx),%r8d
mov    %eax,%esi
mov    %r15,%rdx
mov    $0xffffffff,%ecx
call   10e0 <sqlite3_bind_text@plt>
cmp    0x0(%r13),%eax
jne    1440 <main+0x230>
mov    0x8(%rsp),%rdi
lea    0xdc6(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    0x8(%rsp),%rdi
mov    (%rbx),%r8d
mov    %eax,%esi
mov    %r14,%rdx
mov    $0xffffffff,%ecx
call   10e0 <sqlite3_bind_text@plt>
cmp    0x0(%r13),%eax
jne    1440 <main+0x230>
mov    0x8(%rsp),%rdi
call   1080 <sqlite3_bind_parameter_count@plt>
lea    0xd95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
call   1050 <sqlite3_bind_parameter_name@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%rdi
lea    0xd3f(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
lea    0xd7e(%rip),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rdi
mov    $0x2,%esi
call   1050 <sqlite3_bind_parameter_name@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%rdi
lea    0xd2a(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rdi
mov    $0x3,%esi
call   1050 <sqlite3_bind_parameter_name@plt>
mov    %rax,%rbp
mov    0x8(%rsp),%rdi
lea    0xcfd(%rip),%rsi
call   1090 <sqlite3_bind_parameter_index@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%rdi
call   10b0 <sqlite3_step@plt>
mov    0x2b92(%rip),%rcx
cmp    (%rcx),%eax
jne    146d <main+0x25d>
lea    0xd27(%rip),%rdi
call   1040 <puts@plt>
jmp    1484 <main+0x274>
mov    0x2b89(%rip),%rcx
mov    (%rcx),%edi
lea    0xc93(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b5c(%rip),%rax
mov    (%rax),%edi
lea    0xcbd(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    0x8(%rsp),%rdi
call   10f0 <sqlite3_finalize@plt>
mov    0x10(%rsp),%rdi
call   1130 <sqlite3_close_v2@plt>
xor    %eax,%eax
call   1070 <sqlite3_shutdown@plt>
mov    0x2b0a(%rip),%rax
mov    (%rax),%eax
jmp    145e <main+0x24e>
mov    0x2b1f(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xb8e(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
jmp    1528 <main+0x318>
mov    0x2b03(%rip),%rax
mov    (%rax),%edi
lea    0xb9c(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
jmp    1528 <main+0x318>
mov    0x2aea(%rip),%rax
mov    (%rax),%ebx
mov    0x10(%rsp),%rdi
call   10a0 <sqlite3_errmsg@plt>
lea    0xba1(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
jmp    151e <main+0x30e>
mov    0x2ac2(%rip),%rax
mov    (%rax),%edi
lea    0xba3(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    0x10(%rsp),%rdi
call   10d0 <sqlite3_close@plt>
mov    0x2a89(%rip),%rax
mov    (%rax),%edi
call   1120 <exit@plt>

LLVM IR (-O0):
@SQLITE_OPEN_READWRITE = global i32 0
@.str = [75 x i8] c"INSERT INTO addressbook (fullname, alias, email)VALUES(:name, @aka, $mail)\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c"Usage: %s <DB>,<name>,<alias>,<email>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [1 x i8] zeroinitializer
@SQLITE_OK = global i32 0
@.str.3 = [40 x i8] c"Err. Unable to initialize the library.\0A\00"
@.str.4 = [32 x i8] c"Err. can't create database: %s\0A\00"
@.str.5 = [35 x i8] c"Err. Can't prepare the statement.\0A\00"
@.str.6 = [6 x i8] c":name\00"
@SQLITE_STATIC = global i32 0
@.str.7 = [30 x i8] c"Err. Binding the value (%i).\0A\00"
@.str.8 = [5 x i8] c"@aka\00"
@.str.9 = [6 x i8] c"$mail\00"
@.str.10 = [28 x i8] c"Total bound parameters: %d\0A\00"
@.str.11 = [18 x i8] c"'%5s' index '%d'\0A\00"
@SQLITE_DONE = global i32 0
@.str.12 = [38 x i8] c"Err. Stepping through the statement.\0A\00"
@.str.13 = [37 x i8] c"... Statement successfully executed.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
store i32* null, i32** %7
%15 = load i32, i32* @SQLITE_OPEN_READWRITE
store i32 %15, i32* %8
store i32 0, i32* %9
store i32 -1, i32* %10
store i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8** %11
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 5
br i1 %17, label %18, label %26
18: ; preds = %2
%19 = load i32, i32* @stderr
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %2
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %38
29: ; preds = %26
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = icmp ne i8* %32, null
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
br label %39
38: ; preds = %29, %26
br label %39
39: ; preds = %38, %34
%40 = phi i8* [ %37, %34 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %38 ]
store i8* %40, i8** %12
%41 = load i32, i32* %4
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %52
43: ; preds = %39
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 3
%46 = load i8*, i8** %45
%47 = icmp ne i8* %46, null
br i1 %47, label %48, label %52
48: ; preds = %43
%49 = load i8**, i8*** %5
%50 = getelementptr inbounds i8*, i8** %49, i64 3
%51 = load i8*, i8** %50
br label %53
52: ; preds = %43, %39
br label %53
53: ; preds = %52, %48
%54 = phi i8* [ %51, %48 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %52 ]
store i8* %54, i8** %13
%55 = load i32, i32* %4
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %66
57: ; preds = %53
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 4
%60 = load i8*, i8** %59
%61 = icmp ne i8* %60, null
br i1 %61, label %62, label %66
62: ; preds = %57
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 4
%65 = load i8*, i8** %64
br label %67
66: ; preds = %57, %53
br label %67
67: ; preds = %66, %62
%68 = phi i8* [ %65, %62 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), %66 ]
store i8* %68, i8** %14
%69 = call i32 (...) @sqlite3_initialize()
%70 = load i32, i32* @SQLITE_OK
%71 = icmp ne i32 %69, %70
br i1 %71, label %72, label %77
72: ; preds = %67
%73 = load i32, i32* @stderr
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%75 = load i32, i32* @EXIT_FAILURE
%76 = call i32 @exit(i32 %75)
unreachable
77: ; preds = %67
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = load i32, i32* %8
%82 = call i32 @sqlite3_open_v2(i8* %80, i32** %6, i32 %81, i32* null)
store i32 %82, i32* %9
%83 = load i32, i32* %9
%84 = load i32, i32* @SQLITE_OK
%85 = icmp ne i32 %83, %84
br i1 %85, label %86, label %95
86: ; preds = %77
%87 = load i32, i32* @stderr
%88 = load i32*, i32** %6
%89 = call i8* @sqlite3_errmsg(i32* %88)
%90 = call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8* %89)
%91 = load i32*, i32** %6
%92 = call i32 @sqlite3_close(i32* %91)
%93 = load i32, i32* @EXIT_FAILURE
%94 = call i32 @exit(i32 %93)
unreachable
95: ; preds = %77
%96 = load i32*, i32** %6
%97 = load i8*, i8** %11
%98 = call i32 @sqlite3_prepare_v2(i32* %96, i8* %97, i32 -1, i32** %7, i32* null)
store i32 %98, i32* %9
%99 = load i32, i32* %9
%100 = load i32, i32* @SQLITE_OK
%101 = icmp ne i32 %99, %100
br i1 %101, label %102, label %109
102: ; preds = %95
%103 = load i32, i32* @stderr
%104 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%105 = load i32*, i32** %6
%106 = call i32 @sqlite3_close(i32* %105)
%107 = load i32, i32* @EXIT_FAILURE
%108 = call i32 @exit(i32 %107)
unreachable
109: ; preds = %95
%110 = load i32*, i32** %7
%111 = call i32 @sqlite3_bind_parameter_index(i32* %110, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
store i32 %111, i32* %10
%112 = load i32*, i32** %7
%113 = load i32, i32* %10
%114 = load i8*, i8** %12
%115 = load i32, i32* @SQLITE_STATIC
%116 = call i32 @sqlite3_bind_text(i32* %112, i32 %113, i8* %114, i32 -1, i32 %115)
store i32 %116, i32* %9
%117 = load i32, i32* %9
%118 = load i32, i32* @SQLITE_OK
%119 = icmp ne i32 %117, %118
br i1 %119, label %120, label %124
120: ; preds = %109
%121 = load i32, i32* @stderr
%122 = load i32, i32* %9
%123 = call i32 (i32, i8*, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %122)
store i32 1, i32* %3
br label %190
124: ; preds = %109
%125 = load i32*, i32** %7
%126 = call i32 @sqlite3_bind_parameter_index(i32* %125, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
store i32 %126, i32* %10
%127 = load i32*, i32** %7
%128 = load i32, i32* %10
%129 = load i8*, i8** %13
%130 = load i32, i32* @SQLITE_STATIC
%131 = call i32 @sqlite3_bind_text(i32* %127, i32 %128, i8* %129, i32 -1, i32 %130)
store i32 %131, i32* %9
%132 = load i32, i32* %9
%133 = load i32, i32* @SQLITE_OK
%134 = icmp ne i32 %132, %133
br i1 %134, label %135, label %139
135: ; preds = %124
%136 = load i32, i32* @stderr
%137 = load i32, i32* %9
%138 = call i32 (i32, i8*, ...) @fprintf(i32 %136, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %137)
store i32 1, i32* %3
br label %190
139: ; preds = %124
%140 = load i32*, i32** %7
%141 = call i32 @sqlite3_bind_parameter_index(i32* %140, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
store i32 %141, i32* %10
%142 = load i32*, i32** %7
%143 = load i32, i32* %10
%144 = load i8*, i8** %14
%145 = load i32, i32* @SQLITE_STATIC
%146 = call i32 @sqlite3_bind_text(i32* %142, i32 %143, i8* %144, i32 -1, i32 %145)
store i32 %146, i32* %9
%147 = load i32, i32* %9
%148 = load i32, i32* @SQLITE_OK
%149 = icmp ne i32 %147, %148
br i1 %149, label %150, label %154
150: ; preds = %139
%151 = load i32, i32* @stderr
%152 = load i32, i32* %9
%153 = call i32 (i32, i8*, ...) @fprintf(i32 %151, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %152)
store i32 1, i32* %3
br label %190
154: ; preds = %139
%155 = load i32*, i32** %7
%156 = call i32 @sqlite3_bind_parameter_count(i32* %155)
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %156)
%158 = load i32*, i32** %7
%159 = call i8* @sqlite3_bind_parameter_name(i32* %158, i32 1)
%160 = load i32*, i32** %7
%161 = call i32 @sqlite3_bind_parameter_index(i32* %160, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %159, i32 %161)
%163 = load i32*, i32** %7
%164 = call i8* @sqlite3_bind_parameter_name(i32* %163, i32 2)
%165 = load i32*, i32** %7
%166 = call i32 @sqlite3_bind_parameter_index(i32* %165, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %164, i32 %166)
%168 = load i32*, i32** %7
%169 = call i8* @sqlite3_bind_parameter_name(i32* %168, i32 3)
%170 = load i32*, i32** %7
%171 = call i32 @sqlite3_bind_parameter_index(i32* %170, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %169, i32 %171)
%173 = load i32*, i32** %7
%174 = call i32 @sqlite3_step(i32* %173)
store i32 %174, i32* %9
%175 = load i32, i32* %9
%176 = load i32, i32* @SQLITE_DONE
%177 = icmp ne i32 %175, %176
br i1 %177, label %178, label %181
178: ; preds = %154
%179 = load i32, i32* @stderr
%180 = call i32 (i32, i8*, ...) @fprintf(i32 %179, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0))
br label %183
181: ; preds = %154
%182 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
br label %183
183: ; preds = %181, %178
%184 = load i32*, i32** %7
%185 = call i32 @sqlite3_finalize(i32* %184)
%186 = load i32*, i32** %6
%187 = call i32 @sqlite3_close_v2(i32* %186)
%188 = call i32 (...) @sqlite3_shutdown()
%189 = load i32, i32* @EXIT_SUCCESS
store i32 %189, i32* %3
br label %190
190: ; preds = %183, %150, %135, %120
%191 = load i32, i32* %3
ret i32 %191
}

LLVM IR (-O2):
@SQLITE_OPEN_READWRITE = global i32 0
@.str = [75 x i8] c"INSERT INTO addressbook (fullname, alias, email)VALUES(:name, @aka, $mail)\00"
@stderr = global i32 0
@.str.1 = [39 x i8] c"Usage: %s <DB>,<name>,<alias>,<email>\0A\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [1 x i8] zeroinitializer
@SQLITE_OK = global i32 0
@.str.3 = [40 x i8] c"Err. Unable to initialize the library.\0A\00"
@.str.4 = [32 x i8] c"Err. can't create database: %s\0A\00"
@.str.5 = [35 x i8] c"Err. Can't prepare the statement.\0A\00"
@.str.6 = [6 x i8] c":name\00"
@SQLITE_STATIC = global i32 0
@.str.7 = [30 x i8] c"Err. Binding the value (%i).\0A\00"
@.str.8 = [5 x i8] c"@aka\00"
@.str.9 = [6 x i8] c"$mail\00"
@.str.10 = [28 x i8] c"Total bound parameters: %d\0A\00"
@.str.11 = [18 x i8] c"'%5s' index '%d'\0A\00"
@SQLITE_DONE = global i32 0
@.str.12 = [38 x i8] c"Err. Stepping through the statement.\0A\00"
@.str.13 = [37 x i8] c"... Statement successfully executed.\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = bitcast i32** %3 to i8*
store i32* null, i32** %3
%6 = bitcast i32** %4 to i8*
store i32* null, i32** %4
%7 = load i32, i32* @SQLITE_OPEN_READWRITE
%8 = icmp eq i32 %0, 5
br i1 %8, label %15, label %9
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %1
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 2
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
%19 = select i1 %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %17
%20 = getelementptr inbounds i8*, i8** %1, i64 3
%21 = load i8*, i8** %20
%22 = icmp eq i8* %21, null
%23 = select i1 %22, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %21
%24 = getelementptr inbounds i8*, i8** %1, i64 4
%25 = load i8*, i8** %24
%26 = icmp eq i8* %25, null
%27 = select i1 %26, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* %25
%28 = tail call i32 (...) @sqlite3_initialize()
%29 = load i32, i32* @SQLITE_OK
%30 = icmp eq i32 %28, %29
br i1 %30, label %36, label %31
31: ; preds = %15
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%34 = load i32, i32* @EXIT_FAILURE
%35 = tail call i32 @exit(i32 %34)
unreachable
36: ; preds = %15
%37 = getelementptr inbounds i8*, i8** %1, i64 1
%38 = load i8*, i8** %37
%39 = call i32 @sqlite3_open_v2(i8* %38, i32** %3, i32 %7, i32* null)
%40 = load i32, i32* @SQLITE_OK
%41 = icmp eq i32 %39, %40
br i1 %41, label %51, label %42
42: ; preds = %36
%43 = load i32, i32* @stderr
%44 = load i32*, i32** %3
%45 = call i8* @sqlite3_errmsg(i32* %44)
%46 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0), i8* %45)
%47 = load i32*, i32** %3
%48 = call i32 @sqlite3_close(i32* %47)
%49 = load i32, i32* @EXIT_FAILURE
%50 = call i32 @exit(i32 %49)
unreachable
51: ; preds = %36
%52 = load i32*, i32** %3
%53 = call i32 @sqlite3_prepare_v2(i32* %52, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i32 -1, i32** %4, i32* null)
%54 = load i32, i32* @SQLITE_OK
%55 = icmp eq i32 %53, %54
br i1 %55, label %63, label %56
56: ; preds = %51
%57 = load i32, i32* @stderr
%58 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.5, i64 0, i64 0))
%59 = load i32*, i32** %3
%60 = call i32 @sqlite3_close(i32* %59)
%61 = load i32, i32* @EXIT_FAILURE
%62 = call i32 @exit(i32 %61)
unreachable
63: ; preds = %51
%64 = load i32*, i32** %4
%65 = call i32 @sqlite3_bind_parameter_index(i32* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%66 = load i32*, i32** %4
%67 = load i32, i32* @SQLITE_STATIC
%68 = call i32 @sqlite3_bind_text(i32* %66, i32 %65, i8* %19, i32 -1, i32 %67)
%69 = load i32, i32* @SQLITE_OK
%70 = icmp eq i32 %68, %69
br i1 %70, label %74, label %71
71: ; preds = %63
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %68)
br label %131
74: ; preds = %63
%75 = load i32*, i32** %4
%76 = call i32 @sqlite3_bind_parameter_index(i32* %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%77 = load i32*, i32** %4
%78 = load i32, i32* @SQLITE_STATIC
%79 = call i32 @sqlite3_bind_text(i32* %77, i32 %76, i8* %23, i32 -1, i32 %78)
%80 = load i32, i32* @SQLITE_OK
%81 = icmp eq i32 %79, %80
br i1 %81, label %85, label %82
82: ; preds = %74
%83 = load i32, i32* @stderr
%84 = call i32 (i32, i8*, ...) @fprintf(i32 %83, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %79)
br label %131
85: ; preds = %74
%86 = load i32*, i32** %4
%87 = call i32 @sqlite3_bind_parameter_index(i32* %86, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%88 = load i32*, i32** %4
%89 = load i32, i32* @SQLITE_STATIC
%90 = call i32 @sqlite3_bind_text(i32* %88, i32 %87, i8* %27, i32 -1, i32 %89)
%91 = load i32, i32* @SQLITE_OK
%92 = icmp eq i32 %90, %91
br i1 %92, label %96, label %93
93: ; preds = %85
%94 = load i32, i32* @stderr
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %90)
br label %131
96: ; preds = %85
%97 = load i32*, i32** %4
%98 = call i32 @sqlite3_bind_parameter_count(i32* %97)
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %98)
%100 = load i32*, i32** %4
%101 = call i8* @sqlite3_bind_parameter_name(i32* %100, i32 1)
%102 = load i32*, i32** %4
%103 = call i32 @sqlite3_bind_parameter_index(i32* %102, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %101, i32 %103)
%105 = load i32*, i32** %4
%106 = call i8* @sqlite3_bind_parameter_name(i32* %105, i32 2)
%107 = load i32*, i32** %4
%108 = call i32 @sqlite3_bind_parameter_index(i32* %107, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %106, i32 %108)
%110 = load i32*, i32** %4
%111 = call i8* @sqlite3_bind_parameter_name(i32* %110, i32 3)
%112 = load i32*, i32** %4
%113 = call i32 @sqlite3_bind_parameter_index(i32* %112, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* %111, i32 %113)
%115 = load i32*, i32** %4
%116 = call i32 @sqlite3_step(i32* %115)
%117 = load i32, i32* @SQLITE_DONE
%118 = icmp eq i32 %116, %117
br i1 %118, label %122, label %119
119: ; preds = %96
%120 = load i32, i32* @stderr
%121 = call i32 (i32, i8*, ...) @fprintf(i32 %120, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0))
br label %124
122: ; preds = %96
%123 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
br label %124
124: ; preds = %122, %119
%125 = load i32*, i32** %4
%126 = call i32 @sqlite3_finalize(i32* %125)
%127 = load i32*, i32** %3
%128 = call i32 @sqlite3_close_v2(i32* %127)
%129 = call i32 (...) @sqlite3_shutdown()
%130 = load i32, i32* @EXIT_SUCCESS
br label %131
131: ; preds = %124, %93, %82, %71
%132 = phi i32 [ 1, %71 ], [ 1, %82 ], [ 1, %93 ], [ %130, %124 ]
ret i32 %132
}