#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 Entry {
  int dummy;
};
typedef int /*<<< orphan*/ stmt;
typedef int /*<<< orphan*/ sqlite3_stmt;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int SQLITE_DONE;
int SQLITE_OK;
int SQLITE_ROW;
struct Entry *find_entry(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(struct Entry *);
struct Entry *insert_into_list(struct Entry *, struct Entry *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *,
                           char *, char *, int, char *, char *);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_errmsg(int /*<<< orphan*/ *);
int sqlite3_open(char *, int /*<<< orphan*/ **);
int sqlite3_prepare_v2(int /*<<< orphan*/ *, char *, int, int /*<<< orphan*/ **,
                       char const **);
int sqlite3_step(int /*<<< orphan*/ *);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *,
                          int /*<<< orphan*/);
struct Entry *get_entry_by_reason(char *reason, int listflag) {
  char *listname = (0x02 == listflag) ? "whitelist" : "blacklist";
  sqlite3 *db;
  char stmt[1024];
  sqlite3_stmt *pp_stmt = 0;
  const char **p_tail = 0;
  int rc;
  struct Entry *p_root = NULL;
  struct Entry *p_entry = NULL;
  rc = sqlite3_open("db/phonefirewall.db", &db);
  if (rc) {
    syslog(LOG_ERR, "[%s] Can't open database: %s", "phone-firewall",
           sqlite3_errmsg(db));
    sqlite3_close(db);
    return NULL;
  }
  sprintf(stmt,
          "SELECT %1$s, %2$s, %3$s, %4$s, %5$s, %6$s FROM %8$s WHERE %6$s like "
          "\'%7$c%9$s%7$c\'",
          "priority", "countrycode", "areacode", "number", "name", "reason", 37,
          listname, reason);
  rc = sqlite3_prepare_v2(db, stmt, sizeof(stmt), &pp_stmt, p_tail);
  if (rc != SQLITE_OK) {
    syslog(LOG_ERR, "[%s] SQL error: %s", "phone-firewall", sqlite3_errmsg(db));
    sqlite3_close(db);
    return NULL;
  }
  while (rc != SQLITE_DONE) {
    rc = sqlite3_step(pp_stmt);
    if (SQLITE_ROW == rc) {
      if (NULL == (p_entry = find_entry(pp_stmt)))
        break;
      if (NULL == (p_root = insert_into_list(p_root, p_entry)))
        return NULL;
    }
  }
  free(p_entry);
  sqlite3_close(db);
  return p_root;
}


x86 assembly (clang, -O0):
<get_entry_by_reason>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x488,%rsp
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
mov    $0x2,%edx
lea    0xe48(%rip),%rax
lea    0xe37(%rip),%rcx
cmp    %esi,%edx
cmove  %rcx,%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x438(%rbp)
movq   $0x0,-0x440(%rbp)
movq   $0x0,-0x450(%rbp)
movq   $0x0,-0x458(%rbp)
lea    0xe0e(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <sqlite3_open@plt>
mov    %eax,-0x444(%rbp)
cmpl   $0x0,-0x444(%rbp)
je     126b <get_entry_by_reason+0xcb>
mov    0x2d97(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x45c(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <sqlite3_errmsg@plt>
mov    -0x45c(%rbp),%edi
mov    %eax,%ecx
lea    0xddf(%rip),%rsi
lea    0xdf5(%rip),%rdx
call   1090 <syslog@plt>
mov    -0x30(%rbp),%rdi
call   1070 <sqlite3_close@plt>
movq   $0x0,-0x10(%rbp)
jmp    1418 <get_entry_by_reason+0x278>
lea    -0x430(%rbp),%rdi
mov    -0x28(%rbp),%r10
mov    -0x18(%rbp),%rax
lea    0xdd3(%rip),%rsi
lea    0xe1f(%rip),%rdx
lea    0xe21(%rip),%rcx
lea    0xe26(%rip),%r8
lea    0xe28(%rip),%r9
lea    0xe28(%rip),%rbx
lea    0xe26(%rip),%r11
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
movl   $0x25,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   10c0 <sprintf@plt>
mov    -0x30(%rbp),%rdi
lea    -0x430(%rbp),%rsi
mov    -0x440(%rbp),%r8
mov    $0x400,%edx
lea    -0x438(%rbp),%rcx
call   10a0 <sqlite3_prepare_v2@plt>
mov    %eax,-0x444(%rbp)
mov    -0x444(%rbp),%eax
mov    0x2ce7(%rip),%rcx
cmp    (%rcx),%eax
je     1352 <get_entry_by_reason+0x1b2>
mov    0x2cb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x460(%rbp)
mov    -0x30(%rbp),%rdi
call   1050 <sqlite3_errmsg@plt>
mov    -0x460(%rbp),%edi
mov    %eax,%ecx
lea    0xda8(%rip),%rsi
lea    0xd0e(%rip),%rdx
call   1090 <syslog@plt>
mov    -0x30(%rbp),%rdi
call   1070 <sqlite3_close@plt>
movq   $0x0,-0x10(%rbp)
jmp    1418 <get_entry_by_reason+0x278>
jmp    1357 <get_entry_by_reason+0x1b7>
mov    -0x444(%rbp),%eax
mov    0x2c74(%rip),%rcx
cmp    (%rcx),%eax
je     13f8 <get_entry_by_reason+0x258>
mov    -0x438(%rbp),%rdi
call   1060 <sqlite3_step@plt>
mov    %eax,-0x444(%rbp)
mov    0x2c4b(%rip),%rax
mov    (%rax),%eax
cmp    -0x444(%rbp),%eax
jne    13f3 <get_entry_by_reason+0x253>
mov    -0x438(%rbp),%rdi
call   10b0 <find_entry@plt>
mov    %rax,%rcx
mov    %rcx,-0x458(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    13b9 <get_entry_by_reason+0x219>
jmp    13f8 <get_entry_by_reason+0x258>
mov    -0x450(%rbp),%rdi
mov    -0x458(%rbp),%rsi
call   1080 <insert_into_list@plt>
mov    %rax,%rcx
mov    %rcx,-0x450(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    13ee <get_entry_by_reason+0x24e>
movq   $0x0,-0x10(%rbp)
jmp    1418 <get_entry_by_reason+0x278>
jmp    13f3 <get_entry_by_reason+0x253>
jmp    1357 <get_entry_by_reason+0x1b7>
mov    -0x458(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1070 <sqlite3_close@plt>
mov    -0x450(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x488,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_entry_by_reason>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x410,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
lea    0xe50(%rip),%rdi
mov    %rsp,%rsi
call   1040 <sqlite3_open@plt>
test   %eax,%eax
je     11ee <get_entry_by_reason+0x4e>
mov    0x2de9(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%rdi
call   1050 <sqlite3_errmsg@plt>
lea    0xe3f(%rip),%rsi
jmp    12a8 <get_entry_by_reason+0x108>
cmp    $0x2,%ebp
lea    0xe08(%rip),%rax
lea    0xe0b(%rip),%rbp
cmove  %rax,%rbp
sub    $0x8,%rsp
lea    0xec3(%rip),%rax
lea    0xeb7(%rip),%r10
lea    0xe38(%rip),%rsi
lea    0xe84(%rip),%rdx
lea    0xe86(%rip),%rcx
lea    0xe8b(%rip),%r8
lea    0xe8d(%rip),%r9
lea    0x18(%rsp),%r14
mov    %r14,%rdi
push   %rbx
push   %rbp
push   $0x25
push   %rax
push   %r10
call   10c0 <sprintf@plt>
add    $0x30,%rsp
mov    (%rsp),%rdi
lea    0x8(%rsp),%rcx
mov    %r14,%rsi
mov    $0x400,%edx
xor    %r8d,%r8d
call   10a0 <sqlite3_prepare_v2@plt>
mov    0x2d78(%rip),%rcx
cmp    (%rcx),%eax
jne    128f <get_entry_by_reason+0xef>
mov    0x2d5d(%rip),%r15
cmp    (%r15),%eax
jne    12d7 <get_entry_by_reason+0x137>
xor    %r14d,%r14d
xor    %ebx,%ebx
mov    %rbx,%rdi
call   1030 <free@plt>
jmp    12bb <get_entry_by_reason+0x11b>
mov    0x2d2a(%rip),%rax
mov    (%rax),%ebx
mov    (%rsp),%rdi
call   1050 <sqlite3_errmsg@plt>
lea    0xe30(%rip),%rsi
lea    0xd96(%rip),%rdx
mov    %ebx,%edi
mov    %eax,%ecx
call   1090 <syslog@plt>
xor    %r14d,%r14d
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
mov    %r14,%rax
add    $0x410,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2cf2(%rip),%r12
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    12f5 <get_entry_by_reason+0x155>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    (%r15),%ebp
je     1285 <get_entry_by_reason+0xe5>
mov    0x8(%rsp),%rdi
call   1060 <sqlite3_step@plt>
mov    %eax,%ebp
cmp    %eax,(%r12)
jne    12f0 <get_entry_by_reason+0x150>
mov    0x8(%rsp),%rdi
call   10b0 <find_entry@plt>
test   %rax,%rax
je     1283 <get_entry_by_reason+0xe3>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1080 <insert_into_list@plt>
mov    %rax,%r14
test   %rax,%rax
jne    12f0 <get_entry_by_reason+0x150>
xor    %r14d,%r14d
jmp    12c4 <get_entry_by_reason+0x124>

LLVM IR (-O0):
%struct.Entry = type { i32 }
@.str = [10 x i8] c"whitelist\00"
@.str.1 = [10 x i8] c"blacklist\00"
@.str.2 = [20 x i8] c"db/phonefirewall.db\00"
@LOG_ERR = global i32 0
@.str.3 = [29 x i8] c"[%s] Can't open database: %s\00"
@.str.4 = [15 x i8] c"phone-firewall\00"
@.str.5 = [83 x i8] c"SELECT %1$s, %2$s, %3$s, %4$s, %5$s, %6$s FROM %8$s WHERE %6$s like '%7$c%9$s%7$c'\00"
@.str.6 = [9 x i8] c"priority\00"
@.str.7 = [12 x i8] c"countrycode\00"
@.str.8 = [9 x i8] c"areacode\00"
@.str.9 = [7 x i8] c"number\00"
@.str.10 = [5 x i8] c"name\00"
@.str.11 = [7 x i8] c"reason\00"
@SQLITE_OK = global i32 0
@.str.12 = [19 x i8] c"[%s] SQL error: %s\00"
@SQLITE_DONE = global i32 0
@SQLITE_ROW = global i32 0
define %struct.Entry* @get_entry_by_reason(i8* %0, i32 %1) {
%3 = alloca %struct.Entry*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca [1024 x i8]
%9 = alloca i32*
%10 = alloca i8**
%11 = alloca i32
%12 = alloca %struct.Entry*
%13 = alloca %struct.Entry*
store i8* %0, i8** %4
store i32 %1, i32* %5
%14 = load i32, i32* %5
%15 = icmp eq i32 2, %14
%16 = zext i1 %15 to i64
%17 = select i1 %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
store i8* %17, i8** %6
store i32* null, i32** %9
store i8** null, i8*** %10
store %struct.Entry* null, %struct.Entry** %12
store %struct.Entry* null, %struct.Entry** %13
%18 = call i32 @sqlite3_open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32** %7)
store i32 %18, i32* %11
%19 = load i32, i32* %11
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %2
%22 = load i32, i32* @LOG_ERR
%23 = load i32*, i32** %7
%24 = call i32 @sqlite3_errmsg(i32* %23)
%25 = call i32 @syslog(i32 %22, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %24)
%26 = load i32*, i32** %7
%27 = call i32 @sqlite3_close(i32* %26)
store %struct.Entry* null, %struct.Entry** %3
br label %77
28: ; preds = %2
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%30 = load i8*, i8** %6
%31 = load i8*, i8** %4
%32 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 37, i8* %30, i8* %31)
%33 = load i32*, i32** %7
%34 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%35 = load i8**, i8*** %10
%36 = call i32 @sqlite3_prepare_v2(i32* %33, i8* %34, i32 1024, i32** %9, i8** %35)
store i32 %36, i32* %11
%37 = load i32, i32* %11
%38 = load i32, i32* @SQLITE_OK
%39 = icmp ne i32 %37, %38
br i1 %39, label %40, label %47
40: ; preds = %28
%41 = load i32, i32* @LOG_ERR
%42 = load i32*, i32** %7
%43 = call i32 @sqlite3_errmsg(i32* %42)
%44 = call i32 @syslog(i32 %41, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %43)
%45 = load i32*, i32** %7
%46 = call i32 @sqlite3_close(i32* %45)
store %struct.Entry* null, %struct.Entry** %3
br label %77
47: ; preds = %28
br label %48
48: ; preds = %70, %47
%49 = load i32, i32* %11
%50 = load i32, i32* @SQLITE_DONE
%51 = icmp ne i32 %49, %50
br i1 %51, label %52, label %71
52: ; preds = %48
%53 = load i32*, i32** %9
%54 = call i32 @sqlite3_step(i32* %53)
store i32 %54, i32* %11
%55 = load i32, i32* @SQLITE_ROW
%56 = load i32, i32* %11
%57 = icmp eq i32 %55, %56
br i1 %57, label %58, label %70
58: ; preds = %52
%59 = load i32*, i32** %9
%60 = call %struct.Entry* @find_entry(i32* %59)
store %struct.Entry* %60, %struct.Entry** %13
%61 = icmp eq %struct.Entry* null, %60
br i1 %61, label %62, label %63
62: ; preds = %58
br label %71
63: ; preds = %58
%64 = load %struct.Entry*, %struct.Entry** %12
%65 = load %struct.Entry*, %struct.Entry** %13
%66 = call %struct.Entry* @insert_into_list(%struct.Entry* %64, %struct.Entry* %65)
store %struct.Entry* %66, %struct.Entry** %12
%67 = icmp eq %struct.Entry* null, %66
br i1 %67, label %68, label %69
68: ; preds = %63
store %struct.Entry* null, %struct.Entry** %3
br label %77
69: ; preds = %63
br label %70
70: ; preds = %69, %52
br label %48
71: ; preds = %62, %48
%72 = load %struct.Entry*, %struct.Entry** %13
%73 = call i32 @free(%struct.Entry* %72)
%74 = load i32*, i32** %7
%75 = call i32 @sqlite3_close(i32* %74)
%76 = load %struct.Entry*, %struct.Entry** %12
store %struct.Entry* %76, %struct.Entry** %3
br label %77
77: ; preds = %71, %68, %40, %21
%78 = load %struct.Entry*, %struct.Entry** %3
ret %struct.Entry* %78
}

LLVM IR (-O2):
%struct.Entry = type { i32 }
@.str = [10 x i8] c"whitelist\00"
@.str.1 = [10 x i8] c"blacklist\00"
@.str.2 = [20 x i8] c"db/phonefirewall.db\00"
@LOG_ERR = global i32 0
@.str.3 = [29 x i8] c"[%s] Can't open database: %s\00"
@.str.4 = [15 x i8] c"phone-firewall\00"
@.str.5 = [83 x i8] c"SELECT %1$s, %2$s, %3$s, %4$s, %5$s, %6$s FROM %8$s WHERE %6$s like '%7$c%9$s%7$c'\00"
@.str.6 = [9 x i8] c"priority\00"
@.str.7 = [12 x i8] c"countrycode\00"
@.str.8 = [9 x i8] c"areacode\00"
@.str.9 = [7 x i8] c"number\00"
@.str.10 = [5 x i8] c"name\00"
@.str.11 = [7 x i8] c"reason\00"
@SQLITE_OK = global i32 0
@.str.12 = [19 x i8] c"[%s] SQL error: %s\00"
@SQLITE_DONE = global i32 0
@SQLITE_ROW = global i32 0
define %struct.Entry* @get_entry_by_reason(i8* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca [1024 x i8]
%5 = alloca i32*
%6 = bitcast i32** %3 to i8*
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = bitcast i32** %5 to i8*
store i32* null, i32** %5
%9 = call i32 @sqlite3_open(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32** %3)
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %2
%12 = load i32, i32* @LOG_ERR
%13 = load i32*, i32** %3
%14 = call i32 @sqlite3_errmsg(i32* %13)
%15 = call i32 @syslog(i32 %12, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %14)
br label %55
16: ; preds = %2
%17 = icmp eq i32 %1, 2
%18 = select i1 %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%19 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([83 x i8], [83 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0), i32 37, i8* %18, i8* %0)
%20 = load i32*, i32** %3
%21 = call i32 @sqlite3_prepare_v2(i32* %20, i8* %7, i32 1024, i32** %5, i8** null)
%22 = load i32, i32* @SQLITE_OK
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %16
%25 = load i32, i32* @SQLITE_DONE
%26 = icmp eq i32 %21, %25
br i1 %26, label %51, label %32
27: ; preds = %16
%28 = load i32, i32* @LOG_ERR
%29 = load i32*, i32** %3
%30 = call i32 @sqlite3_errmsg(i32* %29)
%31 = call i32 @syslog(i32 %28, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i32 %30)
br label %55
32: ; preds = %24, %46
%33 = phi %struct.Entry* [ %48, %46 ], [ null, %24 ]
%34 = phi %struct.Entry* [ %47, %46 ], [ null, %24 ]
%35 = load i32*, i32** %5
%36 = call i32 @sqlite3_step(i32* %35)
%37 = load i32, i32* @SQLITE_ROW
%38 = icmp eq i32 %37, %36
br i1 %38, label %39, label %46
39: ; preds = %32
%40 = load i32*, i32** %5
%41 = call %struct.Entry* @find_entry(i32* %40)
%42 = icmp eq %struct.Entry* %41, null
br i1 %42, label %51, label %43
43: ; preds = %39
%44 = call %struct.Entry* @insert_into_list(%struct.Entry* %34, %struct.Entry* %41)
%45 = icmp eq %struct.Entry* %44, null
br i1 %45, label %59, label %46
46: ; preds = %43, %32
%47 = phi %struct.Entry* [ %44, %43 ], [ %34, %32 ]
%48 = phi %struct.Entry* [ %41, %43 ], [ %33, %32 ]
%49 = load i32, i32* @SQLITE_DONE
%50 = icmp eq i32 %36, %49
br i1 %50, label %51, label %32
51: ; preds = %46, %39, %24
%52 = phi %struct.Entry* [ null, %24 ], [ %34, %39 ], [ %47, %46 ]
%53 = phi %struct.Entry* [ null, %24 ], [ null, %39 ], [ %48, %46 ]
%54 = call i32 @free(%struct.Entry* %53)
br label %55
55: ; preds = %11, %27, %51
%56 = phi %struct.Entry* [ %52, %51 ], [ null, %27 ], [ null, %11 ]
%57 = load i32*, i32** %3
%58 = call i32 @sqlite3_close(i32* %57)
br label %59
59: ; preds = %43, %55
%60 = phi %struct.Entry* [ %56, %55 ], [ null, %43 ]
ret %struct.Entry* %60
}