#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;
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
int LOG_INFO;
int LOG_LOCAL6;
int SQLITE_DONE;
int SQLITE_OK;
int /*<<< orphan*/ *getcwd(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, ...);
int /*<<< orphan*/ sqlite3_bind_int(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_errmsg(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int sqlite3_open(char *, int /*<<< orphan*/ **);
int /*<<< orphan*/ sqlite3_prepare_v2(int /*<<< orphan*/ *, char *,
                                      int /*<<< orphan*/, int /*<<< orphan*/ **,
                                      int /*<<< orphan*/ *);
int sqlite3_step(int /*<<< orphan*/ *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ syslog(int, char *, char *, int /*<<< orphan*/);
int sqlite_add_host_port_hit_all(int ix, int ip_addr_ix, int the_port,
                                 int add_cnt, const char *db_loc) {
  char cwd[512 / 2];
  char DB_LOCATION[512 + 1];
  if (db_loc) {
    snprintf(DB_LOCATION, 512, "%s", db_loc);
  } else {
    if (getcwd(cwd, sizeof(cwd)) == NULL) {
      return 1;
    } else {
      snprintf(DB_LOCATION, 512, "%s%s", cwd, "/db/gargoyle_attack_detect.db");
    }
  }
  sqlite3 *db;
  sqlite3_stmt *stmt;
  int rc;
  char sql[512];
  rc = sqlite3_open(DB_LOCATION, &db);
  if (rc != SQLITE_OK) {
    syslog(LOG_INFO | LOG_LOCAL6,
           "ERROR opening SQLite DB '%s' from function "
           "[sqlite_add_host_port_hit]: %s",
           DB_LOCATION, sqlite3_errmsg(db));
    return 1;
  }
  snprintf(
      sql, 512,
      "INSERT INTO %s (ix, host_ix,port_number,hit_count) VALUES (?1,?2,?3,?4)",
      "hosts_ports_hits");
  sqlite3_prepare_v2(db, sql, strlen(sql), &stmt, NULL);
  sqlite3_bind_int(stmt, 1, ix);
  sqlite3_bind_int(stmt, 2, ip_addr_ix);
  sqlite3_bind_int(stmt, 3, the_port);
  sqlite3_bind_int(stmt, 4, add_cnt);
  rc = sqlite3_step(stmt);
  if (rc != SQLITE_DONE) {
    syslog(LOG_INFO | LOG_LOCAL6,
           "%s inserting data from function [sqlite_add_host_port_hit] failed "
           "with this msg: %s",
           "INFO:", sqlite3_errmsg(db));
    sqlite3_finalize(stmt);
    sqlite3_close(db);
    return -1;
  }
  sqlite3_finalize(stmt);
  sqlite3_close(db);
  return 0;
}


x86 assembly (clang, -O0):
<sqlite_add_host_port_hit_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x580,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11f9 <sqlite_add_host_port_hit_all+0x49>
lea    -0x330(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x200,%esi
lea    0xe7d(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    124d <sqlite_add_host_port_hit_all+0x9d>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   1070 <getcwd@plt>
cmp    $0x0,%rax
jne    1220 <sqlite_add_host_port_hit_all+0x70>
movl   $0x1,-0x4(%rbp)
jmp    1437 <sqlite_add_host_port_hit_all+0x287>
lea    -0x330(%rbp),%rdi
lea    -0x120(%rbp),%rcx
mov    $0x200,%esi
lea    0xdc6(%rip),%rdx
lea    0xdc4(%rip),%r8
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    124d <sqlite_add_host_port_hit_all+0x9d>
lea    -0x330(%rbp),%rdi
lea    -0x338(%rbp),%rsi
call   1030 <sqlite3_open@plt>
mov    %eax,-0x344(%rbp)
mov    -0x344(%rbp),%eax
mov    0x2d6d(%rip),%rcx
cmp    (%rcx),%eax
je     12d4 <sqlite_add_host_port_hit_all+0x124>
mov    0x2d46(%rip),%rax
mov    (%rax),%eax
mov    0x2d5d(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x55c(%rbp)
lea    -0x330(%rbp),%rax
mov    %rax,-0x558(%rbp)
mov    -0x338(%rbp),%rdi
call   1080 <sqlite3_errmsg@plt>
mov    -0x55c(%rbp),%edi
mov    -0x558(%rbp),%rdx
mov    %eax,%ecx
lea    0xd60(%rip),%rsi
call   10b0 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    1437 <sqlite_add_host_port_hit_all+0x287>
lea    -0x550(%rbp),%rdi
mov    $0x200,%esi
lea    0xd86(%rip),%rdx
lea    0xdc7(%rip),%rcx
mov    $0x0,%al
call   1060 <snprintf@plt>
mov    -0x338(%rbp),%rax
mov    %rax,-0x570(%rbp)
lea    -0x550(%rbp),%rax
mov    %rax,-0x568(%rbp)
lea    -0x550(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x570(%rbp),%rdi
mov    -0x568(%rbp),%rsi
mov    %eax,%edx
lea    -0x340(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   10d0 <sqlite3_prepare_v2@plt>
mov    -0x340(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1040 <sqlite3_bind_int@plt>
mov    -0x340(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x2,%esi
call   1040 <sqlite3_bind_int@plt>
mov    -0x340(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    $0x3,%esi
call   1040 <sqlite3_bind_int@plt>
mov    -0x340(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    $0x4,%esi
call   1040 <sqlite3_bind_int@plt>
mov    -0x340(%rbp),%rdi
call   1090 <sqlite3_step@plt>
mov    %eax,-0x344(%rbp)
mov    -0x344(%rbp),%eax
mov    0x2c23(%rip),%rcx
cmp    (%rcx),%eax
je     1418 <sqlite_add_host_port_hit_all+0x268>
mov    0x2c0c(%rip),%rax
mov    (%rax),%eax
mov    0x2c23(%rip),%rcx
or     (%rcx),%eax
mov    %eax,-0x574(%rbp)
mov    -0x338(%rbp),%rdi
call   1080 <sqlite3_errmsg@plt>
mov    -0x574(%rbp),%edi
mov    %eax,%ecx
lea    0xcde(%rip),%rsi
lea    0xd2b(%rip),%rdx
call   10b0 <syslog@plt>
mov    -0x340(%rbp),%rdi
call   10c0 <sqlite3_finalize@plt>
mov    -0x338(%rbp),%rdi
call   10a0 <sqlite3_close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1437 <sqlite_add_host_port_hit_all+0x287>
mov    -0x340(%rbp),%rdi
call   10c0 <sqlite3_finalize@plt>
mov    -0x338(%rbp),%rdi
call   10a0 <sqlite3_close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x580,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite_add_host_port_hit_all>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x538,%rsp
mov    %ecx,%ebx
mov    %edx,%r15d
mov    %esi,%r12d
mov    %edi,%r13d
test   %r8,%r8
je     11f1 <sqlite_add_host_port_hit_all+0x41>
lea    0xe92(%rip),%rdx
lea    0x120(%rsp),%rdi
mov    $0x200,%esi
mov    %r8,%rcx
xor    %eax,%eax
call   1060 <snprintf@plt>
jmp    1230 <sqlite_add_host_port_hit_all+0x80>
lea    0x20(%rsp),%rdi
mov    $0x100,%esi
call   1070 <getcwd@plt>
test   %rax,%rax
je     1349 <sqlite_add_host_port_hit_all+0x199>
lea    0xdf0(%rip),%rdx
lea    0xdee(%rip),%r8
lea    0x120(%rsp),%rdi
lea    0x20(%rsp),%rcx
mov    $0x200,%esi
xor    %eax,%eax
call   1060 <snprintf@plt>
lea    0x120(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <sqlite3_open@plt>
mov    0x2d97(%rip),%rcx
cmp    (%rcx),%eax
jne    1315 <sqlite_add_host_port_hit_all+0x165>
lea    0xe15(%rip),%rdx
lea    0xe56(%rip),%rcx
mov    %ebx,0x1c(%rsp)
xor    %ebx,%ebx
lea    0x330(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x200,%esi
xor    %eax,%eax
call   1060 <snprintf@plt>
mov    0x10(%rsp),%r14
mov    %rbp,%rdi
call   1050 <strlen@plt>
lea    0x8(%rsp),%rcx
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %r8d,%r8d
call   10d0 <sqlite3_prepare_v2@plt>
mov    0x8(%rsp),%rdi
mov    $0x1,%esi
mov    %r13d,%edx
call   1040 <sqlite3_bind_int@plt>
mov    0x8(%rsp),%rdi
mov    $0x2,%esi
mov    %r12d,%edx
call   1040 <sqlite3_bind_int@plt>
mov    0x8(%rsp),%rdi
mov    $0x3,%esi
mov    %r15d,%edx
call   1040 <sqlite3_bind_int@plt>
mov    0x8(%rsp),%rdi
mov    $0x4,%esi
mov    0x1c(%rsp),%edx
call   1040 <sqlite3_bind_int@plt>
mov    0x8(%rsp),%rdi
call   1090 <sqlite3_step@plt>
mov    0x2cd8(%rip),%rcx
cmp    (%rcx),%eax
jne    1350 <sqlite_add_host_port_hit_all+0x1a0>
mov    0x8(%rsp),%rdi
call   10c0 <sqlite3_finalize@plt>
mov    0x10(%rsp),%rdi
call   10a0 <sqlite3_close@plt>
jmp    139c <sqlite_add_host_port_hit_all+0x1ec>
mov    0x2cac(%rip),%rax
mov    0x2cc5(%rip),%rcx
mov    (%rcx),%ebx
or     (%rax),%ebx
mov    0x10(%rsp),%rdi
call   1080 <sqlite3_errmsg@plt>
lea    0xceb(%rip),%rsi
lea    0x120(%rsp),%rdx
mov    %ebx,%edi
mov    %eax,%ecx
call   10b0 <syslog@plt>
mov    $0x1,%ebx
jmp    139c <sqlite_add_host_port_hit_all+0x1ec>
mov    0x2c71(%rip),%rax
mov    0x2c8a(%rip),%rcx
mov    (%rcx),%ebx
or     (%rax),%ebx
mov    0x10(%rsp),%rdi
call   1080 <sqlite3_errmsg@plt>
lea    0xd53(%rip),%rsi
lea    0xda0(%rip),%rdx
mov    %ebx,%edi
mov    %eax,%ecx
call   10b0 <syslog@plt>
mov    0x8(%rsp),%rdi
call   10c0 <sqlite3_finalize@plt>
mov    0x10(%rsp),%rdi
call   10a0 <sqlite3_close@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x538,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [30 x i8] c"/db/gargoyle_attack_detect.db\00"
@SQLITE_OK = global i32 0
@LOG_INFO = global i32 0
@LOG_LOCAL6 = global i32 0
@.str.3 = [74 x i8] c"ERROR opening SQLite DB '%s' from function [sqlite_add_host_port_hit]: %s\00"
@.str.4 = [72 x i8] c"INSERT INTO %s (ix, host_ix,port_number,hit_count) VALUES (?1,?2,?3,?4)\00"
@.str.5 = [17 x i8] c"hosts_ports_hits\00"
@SQLITE_DONE = global i32 0
@.str.6 = [84 x i8] c"%s inserting data from function [sqlite_add_host_port_hit] failed with this msg: %s\00"
@.str.7 = [6 x i8] c"INFO:\00"
define i32 @sqlite_add_host_port_hit_all(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca [256 x i8]
%13 = alloca [513 x i8]
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32
%17 = alloca [512 x i8]
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
%18 = load i8*, i8** %11
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %24
20: ; preds = %5
%21 = getelementptr inbounds [513 x i8], [513 x i8]* %13, i64 0, i64 0
%22 = load i8*, i8** %11
%23 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %21, i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %22)
br label %34
24: ; preds = %5
%25 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%26 = call i32* @getcwd(i8* %25, i32 256)
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %29
28: ; preds = %24
store i32 1, i32* %6
br label %89
29: ; preds = %24
%30 = getelementptr inbounds [513 x i8], [513 x i8]* %13, i64 0, i64 0
%31 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%32 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %30, i32 512, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %31, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %29
br label %34
34: ; preds = %33, %20
%35 = getelementptr inbounds [513 x i8], [513 x i8]* %13, i64 0, i64 0
%36 = call i32 @sqlite3_open(i8* %35, i32** %14)
store i32 %36, i32* %16
%37 = load i32, i32* %16
%38 = load i32, i32* @SQLITE_OK
%39 = icmp ne i32 %37, %38
br i1 %39, label %40, label %48
40: ; preds = %34
%41 = load i32, i32* @LOG_INFO
%42 = load i32, i32* @LOG_LOCAL6
%43 = or i32 %41, %42
%44 = getelementptr inbounds [513 x i8], [513 x i8]* %13, i64 0, i64 0
%45 = load i32*, i32** %14
%46 = call i32 @sqlite3_errmsg(i32* %45)
%47 = call i32 @syslog(i32 %43, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0), i8* %44, i32 %46)
store i32 1, i32* %6
br label %89
48: ; preds = %34
%49 = getelementptr inbounds [512 x i8], [512 x i8]* %17, i64 0, i64 0
%50 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %49, i32 512, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%51 = load i32*, i32** %14
%52 = getelementptr inbounds [512 x i8], [512 x i8]* %17, i64 0, i64 0
%53 = getelementptr inbounds [512 x i8], [512 x i8]* %17, i64 0, i64 0
%54 = call i32 @strlen(i8* %53)
%55 = call i32 @sqlite3_prepare_v2(i32* %51, i8* %52, i32 %54, i32** %15, i32* null)
%56 = load i32*, i32** %15
%57 = load i32, i32* %7
%58 = call i32 @sqlite3_bind_int(i32* %56, i32 1, i32 %57)
%59 = load i32*, i32** %15
%60 = load i32, i32* %8
%61 = call i32 @sqlite3_bind_int(i32* %59, i32 2, i32 %60)
%62 = load i32*, i32** %15
%63 = load i32, i32* %9
%64 = call i32 @sqlite3_bind_int(i32* %62, i32 3, i32 %63)
%65 = load i32*, i32** %15
%66 = load i32, i32* %10
%67 = call i32 @sqlite3_bind_int(i32* %65, i32 4, i32 %66)
%68 = load i32*, i32** %15
%69 = call i32 @sqlite3_step(i32* %68)
store i32 %69, i32* %16
%70 = load i32, i32* %16
%71 = load i32, i32* @SQLITE_DONE
%72 = icmp ne i32 %70, %71
br i1 %72, label %73, label %84
73: ; preds = %48
%74 = load i32, i32* @LOG_INFO
%75 = load i32, i32* @LOG_LOCAL6
%76 = or i32 %74, %75
%77 = load i32*, i32** %14
%78 = call i32 @sqlite3_errmsg(i32* %77)
%79 = call i32 @syslog(i32 %76, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %78)
%80 = load i32*, i32** %15
%81 = call i32 @sqlite3_finalize(i32* %80)
%82 = load i32*, i32** %14
%83 = call i32 @sqlite3_close(i32* %82)
store i32 -1, i32* %6
br label %89
84: ; preds = %48
%85 = load i32*, i32** %15
%86 = call i32 @sqlite3_finalize(i32* %85)
%87 = load i32*, i32** %14
%88 = call i32 @sqlite3_close(i32* %87)
store i32 0, i32* %6
br label %89
89: ; preds = %84, %73, %40, %28
%90 = load i32, i32* %6
ret i32 %90
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"%s%s\00"
@.str.2 = [30 x i8] c"/db/gargoyle_attack_detect.db\00"
@SQLITE_OK = global i32 0
@LOG_INFO = global i32 0
@LOG_LOCAL6 = global i32 0
@.str.3 = [74 x i8] c"ERROR opening SQLite DB '%s' from function [sqlite_add_host_port_hit]: %s\00"
@.str.4 = [72 x i8] c"INSERT INTO %s (ix, host_ix,port_number,hit_count) VALUES (?1,?2,?3,?4)\00"
@.str.5 = [17 x i8] c"hosts_ports_hits\00"
@SQLITE_DONE = global i32 0
@.str.6 = [84 x i8] c"%s inserting data from function [sqlite_add_host_port_hit] failed with this msg: %s\00"
@.str.7 = [6 x i8] c"INFO:\00"
define i32 @sqlite_add_host_port_hit_all(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca [256 x i8]
%7 = alloca [513 x i8]
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca [512 x i8]
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%12 = getelementptr inbounds [513 x i8], [513 x i8]* %7, i64 0, i64 0
%13 = icmp eq i8* %4, null
br i1 %13, label %16, label %14
14: ; preds = %5
%15 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %12, i32 512, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %21
16: ; preds = %5
%17 = call i32* @getcwd(i8* %11, i32 256)
%18 = icmp eq i32* %17, null
br i1 %18, label %70, label %19
19: ; preds = %16
%20 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %12, i32 512, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %14
%22 = bitcast i32** %8 to i8*
%23 = bitcast i32** %9 to i8*
%24 = getelementptr inbounds [512 x i8], [512 x i8]* %10, i64 0, i64 0
%25 = call i32 @sqlite3_open(i8* %12, i32** %8)
%26 = load i32, i32* @SQLITE_OK
%27 = icmp eq i32 %25, %26
br i1 %27, label %35, label %28
28: ; preds = %21
%29 = load i32, i32* @LOG_INFO
%30 = load i32, i32* @LOG_LOCAL6
%31 = or i32 %30, %29
%32 = load i32*, i32** %8
%33 = call i32 @sqlite3_errmsg(i32* %32)
%34 = call i32 @syslog(i32 %31, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0), i8* %12, i32 %33)
br label %68
35: ; preds = %21
%36 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* %24, i32 512, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%37 = load i32*, i32** %8
%38 = call i32 @strlen(i8* %24)
%39 = call i32 @sqlite3_prepare_v2(i32* %37, i8* %24, i32 %38, i32** %9, i32* null)
%40 = load i32*, i32** %9
%41 = call i32 @sqlite3_bind_int(i32* %40, i32 1, i32 %0)
%42 = load i32*, i32** %9
%43 = call i32 @sqlite3_bind_int(i32* %42, i32 2, i32 %1)
%44 = load i32*, i32** %9
%45 = call i32 @sqlite3_bind_int(i32* %44, i32 3, i32 %2)
%46 = load i32*, i32** %9
%47 = call i32 @sqlite3_bind_int(i32* %46, i32 4, i32 %3)
%48 = load i32*, i32** %9
%49 = call i32 @sqlite3_step(i32* %48)
%50 = load i32, i32* @SQLITE_DONE
%51 = icmp eq i32 %49, %50
br i1 %51, label %63, label %52
52: ; preds = %35
%53 = load i32, i32* @LOG_INFO
%54 = load i32, i32* @LOG_LOCAL6
%55 = or i32 %54, %53
%56 = load i32*, i32** %8
%57 = call i32 @sqlite3_errmsg(i32* %56)
%58 = call i32 @syslog(i32 %55, i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 %57)
%59 = load i32*, i32** %9
%60 = call i32 @sqlite3_finalize(i32* %59)
%61 = load i32*, i32** %8
%62 = call i32 @sqlite3_close(i32* %61)
br label %68
63: ; preds = %35
%64 = load i32*, i32** %9
%65 = call i32 @sqlite3_finalize(i32* %64)
%66 = load i32*, i32** %8
%67 = call i32 @sqlite3_close(i32* %66)
br label %68
68: ; preds = %63, %52, %28
%69 = phi i32 [ 1, %28 ], [ -1, %52 ], [ 0, %63 ]
br label %70
70: ; preds = %16, %68
%71 = phi i32 [ %69, %68 ], [ 1, %16 ]
ret i32 %71
}