#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_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_string(const char *key, const char *value) {
  sqlite3_stmt *stmt = meta_set(key);
  if (!stmt) {
    return;
  }
  sqlite3_bind_text(stmt, 1, key, -1, NULL);
  sqlite3_bind_text(stmt, 2, value, -1, NULL);
  sqlite3_step(stmt);
  sqlite3_finalize(stmt);
}


x86 assembly (clang, -O0):
<db_meta_set_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <meta_set@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <db_meta_set_string+0x2d>
jmp    11b7 <db_meta_set_string+0x77>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1,%esi
mov    $0xffffffff,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <sqlite3_bind_text@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2,%esi
mov    $0xffffffff,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <sqlite3_bind_text@plt>
mov    -0x18(%rbp),%rdi
call   1040 <sqlite3_step@plt>
mov    -0x18(%rbp),%rdi
call   1060 <sqlite3_finalize@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_meta_set_string>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <meta_set@plt>
test   %rax,%rax
je     119d <db_meta_set_string+0x5d>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1050 <sqlite3_bind_text@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r14,%rdx
mov    $0xffffffff,%ecx
xor    %r8d,%r8d
call   1050 <sqlite3_bind_text@plt>
mov    %rbx,%rdi
call   1040 <sqlite3_step@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <sqlite3_finalize@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @db_meta_set_string(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %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 i8*, i8** %4
%17 = call i32 @sqlite3_bind_text(i32* %15, i32 2, i8* %16, i32 -1, i32* null)
%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_string(i8* %0, i8* %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_text(i32* %3, i32 2, i8* %1, i32 -1, i32* null)
%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
}