#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 PATH_MAX;
#define SQLITE_BUSY 130
int SQLITE_DONE;
#define SQLITE_ERROR 129
int SQLITE_OK;
#define SQLITE_ROW 128
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
char **realloc(char **, int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *sqlite3_column_text(int /*<<< orphan*/ *, int /*<<< orphan*/);
char *sqlite3_errmsg(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int sqlite3_prepare(int /*<<< orphan*/ *, char *, int, int /*<<< orphan*/ **,
                    int /*<<< orphan*/);
int sqlite3_step(int /*<<< orphan*/ *);
int sqlite_sanatize(char const *, char *);
char *strdup(char *);
int sqlite_get_children(sqlite3 *database, const char *parent, int *childc,
                        char ***childv) {
  int rc;
  char cmd[50 + 2 * PATH_MAX];
  sqlite3_stmt *stmt;
  char temp[PATH_MAX];
  char *parent_s = malloc(2 * PATH_MAX * sizeof(char));
  *childc = 0;
  (*childv) = NULL;
  rc = sqlite_sanatize(parent, parent_s);
  snprintf(cmd, 50 + 2 * PATH_MAX, "SELECT Child FROM %s WHERE Parent='%s'",
           "MAP", parent_s);
  rc = sqlite3_prepare(database, cmd, (50 + 2 * PATH_MAX) * sizeof(char), &stmt,
                       0);
  if (rc != SQLITE_OK) {
    printf("sql error #%d: %s\n", rc, sqlite3_errmsg(database));
    return -1;
  } else {
    while ((*childc < 255) && (rc != SQLITE_DONE)) {
      rc = sqlite3_step(stmt);
      switch (rc) {
      case SQLITE_BUSY:
        printf("busy, wait 1 seconds\n");
        sleep(1);
        break;
      case SQLITE_ERROR:
        printf("step error: %s\n", sqlite3_errmsg(database));
        break;
      case SQLITE_ROW:
        sprintf(temp, "%s", sqlite3_column_text(stmt, 0));
        (*childv) = realloc((*childv), (*childc + 1) * sizeof(char *));
        (*childv)[*childc] = strdup(temp);
        *childc = *childc + 1;
        break;
      }
    }
  }
  sqlite3_finalize(stmt);
  free(parent_s);
  return 0;
}


x86 assembly (clang, -O0):
<sqlite_get_children>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    0x2dee(%rip),%rax
mov    (%rax),%edx
mov    %edx,%ecx
lea    0x32(%rcx,%rcx,1),%ecx
mov    %rsp,%rdx
mov    %rdx,-0x38(%rbp)
mov    %rcx,%rsi
add    $0xf,%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%rsp
mov    %rcx,-0x40(%rbp)
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x50(%rbp)
mov    0x2d9e(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x58(%rbp),%rsi
call   10b0 <sqlite_sanatize@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,-0x2c(%rbp)
mov    0x2d58(%rip),%rax
mov    (%rax),%esi
shl    $0x1,%esi
add    $0x32,%esi
mov    -0x58(%rbp),%r8
lea    0xd55(%rip),%rdx
lea    0xd75(%rip),%rcx
call   1050 <snprintf@plt>
mov    -0x68(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    0x2d2a(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
add    $0x32,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edx
lea    -0x48(%rbp),%rcx
xor    %r8d,%r8d
call   10c0 <sqlite3_prepare@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2cf1(%rip),%rcx
cmp    (%rcx),%eax
je     132d <sqlite_get_children+0x14d>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <sqlite3_errmsg@plt>
mov    -0x74(%rbp),%esi
mov    %rax,%rdx
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
jmp    1489 <sqlite_get_children+0x2a9>
jmp    1332 <sqlite_get_children+0x152>
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
cmpl   $0xff,(%rcx)
mov    %al,-0x75(%rbp)
jge    1359 <sqlite_get_children+0x179>
mov    -0x2c(%rbp),%eax
mov    0x2c7f(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x75(%rbp)
mov    -0x75(%rbp),%al
test   $0x1,%al
jne    1369 <sqlite_get_children+0x189>
jmp    1464 <sqlite_get_children+0x284>
mov    -0x48(%rbp),%rdi
call   1070 <sqlite3_step@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x7c(%rbp)
sub    $0x80,%eax
je     13ed <sqlite_get_children+0x20d>
jmp    138b <sqlite_get_children+0x1ab>
mov    -0x7c(%rbp),%eax
sub    $0x81,%eax
je     13ce <sqlite_get_children+0x1ee>
jmp    139e <sqlite_get_children+0x1be>
mov    -0x7c(%rbp),%eax
sub    $0x82,%eax
jne    145f <sqlite_get_children+0x27f>
jmp    13b1 <sqlite_get_children+0x1d1>
lea    0xc86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1100 <sleep@plt>
jmp    145f <sqlite_get_children+0x27f>
mov    -0x10(%rbp),%rdi
call   1060 <sqlite3_errmsg@plt>
mov    %rax,%rsi
lea    0xc73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    145f <sqlite_get_children+0x27f>
mov    -0x48(%rbp),%rdi
xor    %esi,%esi
call   1080 <sqlite3_column_text@plt>
mov    -0x70(%rbp),%rdi
mov    %rax,%rdx
lea    0xc5e(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%esi
call   10a0 <realloc@plt>
mov    -0x70(%rbp),%rdi
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
call   10f0 <strdup@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
jmp    1332 <sqlite_get_children+0x152>
jmp    1469 <sqlite_get_children+0x289>
mov    -0x48(%rbp),%rdi
call   10d0 <sqlite3_finalize@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x5c(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite_get_children>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,-0x30(%rbp)
mov    %rdi,%r12
mov    0x2ddb(%rip),%rax
mov    (%rax),%eax
lea    (%rax,%rax,1),%edi
lea    (%rax,%rax,1),%ecx
add    $0x32,%ecx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rbx
sub    %rcx,%rbx
mov    %rbx,%rsp
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
call   10b0 <malloc@plt>
mov    %rax,%r13
movl   $0x0,(%r14)
mov    %r15,-0x50(%rbp)
movq   $0x0,(%r15)
mov    -0x30(%rbp),%rdi
mov    %rax,%rsi
call   10d0 <sqlite_sanatize@plt>
mov    0x2d7d(%rip),%r15
mov    (%r15),%eax
lea    (%rax,%rax,1),%esi
add    $0x32,%esi
lea    0xd7d(%rip),%rdx
lea    0xd9d(%rip),%rcx
mov    %rbx,%rdi
mov    %r13,-0x40(%rbp)
mov    %r13,%r8
call   1070 <snprintf@plt>
mov    (%r15),%eax
lea    (%rax,%rax,1),%edx
add    $0x32,%edx
lea    -0x38(%rbp),%rcx
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %r8d,%r8d
call   10e0 <sqlite3_prepare@plt>
mov    %eax,%ebx
mov    0x2d23(%rip),%rax
cmp    (%rax),%ebx
jne    13f9 <sqlite_get_children+0x209>
mov    %r12,-0x30(%rbp)
cmpl   $0xfe,(%r14)
jg     13e3 <sqlite_get_children+0x1f3>
mov    0x2cf3(%rip),%r15
cmp    (%r15),%ebx
je     13e3 <sqlite_get_children+0x1f3>
cs nopw 0x0(%rax,%rax,1)
mov    -0x38(%rbp),%rdi
call   1090 <sqlite3_step@plt>
mov    %eax,%r13d
cmp    $0x80,%eax
je     1350 <sqlite_get_children+0x160>
cmp    $0x81,%r13d
je     13c0 <sqlite_get_children+0x1d0>
cmp    $0x82,%r13d
jne    13ab <sqlite_get_children+0x1bb>
lea    0xd2a(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   1110 <sleep@plt>
cmpl   $0xfe,(%r14)
jle    13b4 <sqlite_get_children+0x1c4>
jmp    13e3 <sqlite_get_children+0x1f3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
call   10a0 <sqlite3_column_text@plt>
mov    %r14,%r12
mov    -0x48(%rbp),%r14
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    -0x50(%rbp),%r15
mov    (%r15),%rdi
mov    (%r12),%eax
lea    0x8(,%rax,8),%esi
call   10c0 <realloc@plt>
mov    %rax,%rbx
mov    %rax,(%r15)
mov    0x2c3f(%rip),%r15
mov    %r14,%rdi
mov    %r12,%r14
call   1100 <strdup@plt>
movslq (%r12),%rcx
mov    %rax,(%rbx,%rcx,8)
lea    0x1(%rcx),%eax
mov    %eax,(%r12)
cmpl   $0xfe,(%r14)
jg     13e3 <sqlite_get_children+0x1f3>
cmp    (%r15),%r13d
jne    12f0 <sqlite_get_children+0x100>
jmp    13e3 <sqlite_get_children+0x1f3>
nop
mov    -0x30(%rbp),%rdi
call   1080 <sqlite3_errmsg@plt>
lea    0xc6e(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0xfe,(%r14)
jle    13b4 <sqlite_get_children+0x1c4>
mov    -0x38(%rbp),%rdi
call   10f0 <sqlite3_finalize@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
jmp    1419 <sqlite_get_children+0x229>
mov    %r12,%rdi
call   1080 <sqlite3_errmsg@plt>
lea    0xc23(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xffffffff,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [39 x i8] c"SELECT Child FROM %s WHERE Parent='%s'\00"
@.str.1 = [4 x i8] c"MAP\00"
@SQLITE_OK = global i32 0
@.str.2 = [19 x i8] c"sql error #%d: %s\0A\00"
@SQLITE_DONE = global i32 0
@.str.3 = [22 x i8] c"busy, wait 1 seconds\0A\00"
@.str.4 = [16 x i8] c"step error: %s\0A\00"
@.str.5 = [3 x i8] c"%s\00"
define i32 @sqlite_get_children(i32* %0, i8* %1, i32* %2, i8*** %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i8***
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32*
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i8*** %3, i8**** %9
%17 = load i32, i32* @PATH_MAX
%18 = mul nsw i32 2, %17
%19 = add nsw i32 50, %18
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %11
%22 = alloca i8, i64 %20
store i64 %20, i64* %12
%23 = load i32, i32* @PATH_MAX
%24 = zext i32 %23 to i64
%25 = alloca i8, i64 %24
store i64 %24, i64* %14
%26 = load i32, i32* @PATH_MAX
%27 = mul nsw i32 2, %26
%28 = sext i32 %27 to i64
%29 = mul i64 %28, 1
%30 = trunc i64 %29 to i32
%31 = call i8* @malloc(i32 %30)
store i8* %31, i8** %15
%32 = load i32*, i32** %8
store i32 0, i32* %32
%33 = load i8***, i8**** %9
store i8** null, i8*** %33
%34 = load i8*, i8** %7
%35 = load i8*, i8** %15
%36 = call i32 @sqlite_sanatize(i8* %34, i8* %35)
store i32 %36, i32* %10
%37 = load i32, i32* @PATH_MAX
%38 = mul nsw i32 2, %37
%39 = add nsw i32 50, %38
%40 = load i8*, i8** %15
%41 = call i32 @snprintf(i8* %22, i32 %39, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %40)
%42 = load i32*, i32** %6
%43 = load i32, i32* @PATH_MAX
%44 = mul nsw i32 2, %43
%45 = add nsw i32 50, %44
%46 = sext i32 %45 to i64
%47 = mul i64 %46, 1
%48 = trunc i64 %47 to i32
%49 = call i32 @sqlite3_prepare(i32* %42, i8* %22, i32 %48, i32** %13, i32 0)
store i32 %49, i32* %10
%50 = load i32, i32* %10
%51 = load i32, i32* @SQLITE_OK
%52 = icmp ne i32 %50, %51
br i1 %52, label %53, label %58
53: ; preds = %4
%54 = load i32, i32* %10
%55 = load i32*, i32** %6
%56 = call i8* @sqlite3_errmsg(i32* %55)
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %54, i8* %56)
store i32 -1, i32* %5
store i32 1, i32* %16
br label %112
58: ; preds = %4
br label %59
59: ; preds = %105, %58
%60 = load i32*, i32** %8
%61 = load i32, i32* %60
%62 = icmp slt i32 %61, 255
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = load i32, i32* %10
%65 = load i32, i32* @SQLITE_DONE
%66 = icmp ne i32 %64, %65
br label %67
67: ; preds = %63, %59
%68 = phi i1 [ false, %59 ], [ %66, %63 ]
br i1 %68, label %69, label %106
69: ; preds = %67
%70 = load i32*, i32** %13
%71 = call i32 @sqlite3_step(i32* %70)
store i32 %71, i32* %10
%72 = load i32, i32* %10
switch i32 %72, label %105 [
i32 130, label %73
i32 129, label %76
i32 128, label %80
]
73: ; preds = %69
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%75 = call i32 @sleep(i32 1)
br label %105
76: ; preds = %69
%77 = load i32*, i32** %6
%78 = call i8* @sqlite3_errmsg(i32* %77)
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %78)
br label %105
80: ; preds = %69
%81 = load i32*, i32** %13
%82 = call i8* @sqlite3_column_text(i32* %81, i32 0)
%83 = call i32 @sprintf(i8* %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %82)
%84 = load i8***, i8**** %9
%85 = load i8**, i8*** %84
%86 = load i32*, i32** %8
%87 = load i32, i32* %86
%88 = add nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = mul i64 %89, 8
%91 = trunc i64 %90 to i32
%92 = call i8** @realloc(i8** %85, i32 %91)
%93 = load i8***, i8**** %9
store i8** %92, i8*** %93
%94 = call i8* @strdup(i8* %25)
%95 = load i8***, i8**** %9
%96 = load i8**, i8*** %95
%97 = load i32*, i32** %8
%98 = load i32, i32* %97
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8*, i8** %96, i64 %99
store i8* %94, i8** %100
%101 = load i32*, i32** %8
%102 = load i32, i32* %101
%103 = add nsw i32 %102, 1
%104 = load i32*, i32** %8
store i32 %103, i32* %104
br label %105
105: ; preds = %69, %80, %76, %73
br label %59
106: ; preds = %67
br label %107
107: ; preds = %106
%108 = load i32*, i32** %13
%109 = call i32 @sqlite3_finalize(i32* %108)
%110 = load i8*, i8** %15
%111 = call i32 @free(i8* %110)
store i32 0, i32* %5
store i32 1, i32* %16
br label %112
112: ; preds = %107, %53
%113 = load i8*, i8** %11
%114 = load i32, i32* %5
ret i32 %114
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [39 x i8] c"SELECT Child FROM %s WHERE Parent='%s'\00"
@.str.1 = [4 x i8] c"MAP\00"
@SQLITE_OK = global i32 0
@.str.2 = [19 x i8] c"sql error #%d: %s\0A\00"
@SQLITE_DONE = global i32 0
@.str.4 = [16 x i8] c"step error: %s\0A\00"
@str = [21 x i8] c"busy, wait 1 seconds\00"
define i32 @sqlite_get_children(i32* %0, i8* %1, i32* nocapture %2, i8*** nocapture %3) {
%5 = alloca i32*
%6 = load i32, i32* @PATH_MAX
%7 = shl nsw i32 %6, 1
%8 = add nsw i32 %7, 50
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = bitcast i32** %5 to i8*
%12 = zext i32 %6 to i64
%13 = alloca i8, i64 %12
%14 = tail call i8* @malloc(i32 %7)
store i32 0, i32* %2
store i8** null, i8*** %3
%15 = tail call i32 @sqlite_sanatize(i8* %1, i8* %14)
%16 = load i32, i32* @PATH_MAX
%17 = shl nsw i32 %16, 1
%18 = add nsw i32 %17, 50
%19 = call i32 @snprintf(i8* %10, i32 %18, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%20 = load i32, i32* @PATH_MAX
%21 = shl nsw i32 %20, 1
%22 = add nsw i32 %21, 50
%23 = call i32 @sqlite3_prepare(i32* %0, i8* %10, i32 %22, i32** %5, i32 0)
%24 = load i32, i32* @SQLITE_OK
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %32
26: ; preds = %4
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 255
%29 = load i32, i32* @SQLITE_DONE
%30 = icmp ne i32 %23, %29
%31 = select i1 %28, i1 %30, i1 false
br i1 %31, label %35, label %64
32: ; preds = %4
%33 = call i8* @sqlite3_errmsg(i32* %0)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %23, i8* %33)
br label %68
35: ; preds = %26, %58
%36 = load i32*, i32** %5
%37 = call i32 @sqlite3_step(i32* %36)
switch i32 %37, label %58 [
i32 130, label %38
i32 129, label %41
i32 128, label %44
]
38: ; preds = %35
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%40 = call i32 @sleep(i32 1)
br label %58
41: ; preds = %35
%42 = call i8* @sqlite3_errmsg(i32* %0)
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* %42)
br label %58
44: ; preds = %35
%45 = load i32*, i32** %5
%46 = call i8* @sqlite3_column_text(i32* %45, i32 0)
%47 = call i8* @strcpy(i8* %13, i8* dereferenceable(1) %46)
%48 = load i8**, i8*** %3
%49 = load i32, i32* %2
%50 = shl i32 %49, 3
%51 = add i32 %50, 8
%52 = call i8** @realloc(i8** %48, i32 %51)
store i8** %52, i8*** %3
%53 = call i8* @strdup(i8* %13)
%54 = load i32, i32* %2
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %52, i64 %55
store i8* %53, i8** %56
%57 = add nsw i32 %54, 1
store i32 %57, i32* %2
br label %58
58: ; preds = %35, %44, %41, %38
%59 = load i32, i32* %2
%60 = icmp slt i32 %59, 255
%61 = load i32, i32* @SQLITE_DONE
%62 = icmp ne i32 %37, %61
%63 = select i1 %60, i1 %62, i1 false
br i1 %63, label %35, label %64
64: ; preds = %58, %26
%65 = load i32*, i32** %5
%66 = call i32 @sqlite3_finalize(i32* %65)
%67 = call i32 @free(i8* %14)
br label %68
68: ; preds = %64, %32
%69 = phi i32 [ -1, %32 ], [ 0, %64 ]
ret i32 %69
}