#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;

/* Variables and functions */
int /*<<< orphan*/ *meta_set(char const *);
int /*<<< orphan*/ sqlite3_bind_int(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ sqlite3_bind_text(int /*<<< orphan*/ *, int, char const *,
                                     int, int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_step(int /*<<< orphan*/ *);
void db_meta_set_int(const char *key, int value) {
  sqlite3_stmt *stmt = meta_set(key);
  if (!stmt) {
    return;
  }
  sqlite3_bind_text(stmt, 1, key, -1, NULL);
  sqlite3_bind_int(stmt, 2, value);
  sqlite3_step(stmt);
  sqlite3_finalize(stmt);
}


x86 assembly (clang, -O0):
<db_meta_set_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <meta_set@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117c <db_meta_set_int+0x2c>
jmp    11bb <db_meta_set_int+0x6b>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1,%esi
mov    $0xffffffff,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1060 <sqlite3_bind_text@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x2,%esi
call   1040 <sqlite3_bind_int@plt>
mov    -0x18(%rbp),%rdi
call   1050 <sqlite3_step@plt>
mov    -0x18(%rbp),%rdi
call   1070 <sqlite3_finalize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_meta_set_int>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbp
call   1030 <meta_set@plt>
test   %rax,%rax
je     11a3 <db_meta_set_int+0x53>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %rbp,%rdx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1060 <sqlite3_bind_text@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r14d,%edx
call   1040 <sqlite3_bind_int@plt>
mov    %rbx,%rdi
call   1050 <sqlite3_step@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1070 <sqlite3_finalize@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @db_meta_set_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32* @meta_set(i8* %6)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
br label %22
11: ; preds = %2
%12 = load i32*, i32** %5
%13 = load i8*, i8** %3
%14 = call i32 @sqlite3_bind_text(i32* %12, i32 1, i8* %13, i32 -1, i32* null)
%15 = load i32*, i32** %5
%16 = load i32, i32* %4
%17 = call i32 @sqlite3_bind_int(i32* %15, i32 2, i32 %16)
%18 = load i32*, i32** %5
%19 = call i32 @sqlite3_step(i32* %18)
%20 = load i32*, i32** %5
%21 = call i32 @sqlite3_finalize(i32* %20)
br label %22
22: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @db_meta_set_int(i8* %0, i32 %1) {
%3 = tail call i32* @meta_set(i8* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = tail call i32 @sqlite3_bind_text(i32* %3, i32 1, i8* %0, i32 -1, i32* null)
%7 = tail call i32 @sqlite3_bind_int(i32* %3, i32 2, i32 %1)
%8 = tail call i32 @sqlite3_step(i32* %3)
%9 = tail call i32 @sqlite3_finalize(i32* %3)
br label %10
10: ; preds = %2, %5
ret void
}