#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*/ sql_cmd;

/* Variables and functions */
int SQLITE_ERROR;
int SQLITE_OK;
int SQLITE_ROW;
int /*<<< orphan*/ W_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
int get_time(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
char *sqlite3_column_text(int /*<<< orphan*/ *, int /*<<< orphan*/);
char *sqlite3_errmsg(int /*<<< orphan*/ *);
int sqlite3_exec(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *, char **);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int sqlite3_open(char *, int /*<<< orphan*/ **);
int /*<<< orphan*/ sqlite3_prepare(int /*<<< orphan*/ *, char *, int,
                                   int /*<<< orphan*/ **, int /*<<< orphan*/);
int sqlite3_step(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char *);
int /*<<< orphan*/ system(char *);
char *traffic_upload_create() {
  int rc = 0;
  sqlite3 *db = NULL;
  sqlite3_stmt *ppstmt = NULL;
  char sql_cmd[100] = {0};
  char *errmsg = NULL;
  const char *box_id = NULL;
  char box_id_tmp[10] = {0};
  char db_filename[20] = {0};
  char *db_filename_full = (char *)malloc(sizeof(char) * 200);
  char shell_cmd[200] = {0};
  int cnt = 0;
  while (cnt < 20) {
    rc = sqlite3_open("/ailvgo/www/database/box.db", &db);
    if (rc == SQLITE_ERROR)
      printf("open box.db failed");
    ppstmt = NULL;
    memset(sql_cmd, 0, sizeof(sql_cmd));
    strcpy(sql_cmd, "select box_id from box_info");
    sqlite3_prepare(db, sql_cmd, -1, &ppstmt, 0);
    rc = sqlite3_step(ppstmt);
    if (rc == SQLITE_ROW) {
      box_id = sqlite3_column_text(ppstmt, 0);
      strcpy(box_id_tmp, box_id);
      printf("box_id : %s\n", box_id_tmp);
      sqlite3_finalize(ppstmt);
      sqlite3_close(db);
      break;
    } else {
      printf("select box_id failure!\n");
      sqlite3_finalize(ppstmt);
      sqlite3_close(db);
      sleep(3);
      cnt++;
    }
  }
  if (strlen(box_id_tmp) < 4) {
    printf("get box_id failure!\n");
    free(db_filename_full);
    return "null";
  }
  sprintf(db_filename, "%s_%4d%02d%02d.db", box_id_tmp, get_time(1),
          get_time(2), get_time(3));
  printf("db_filename for upload : %s\n", db_filename);
  sprintf(db_filename_full, "/ailvgo/system/traffic/%s", db_filename);
  printf("db_filename_full for upload : %s\n", db_filename_full);
  if (access(db_filename_full, W_OK) == -1) {
    printf("creating %s for upload\n", db_filename);
    sprintf(shell_cmd, "cp -f /ailvgo/system/traffic/traffic.db %s",
            db_filename_full);
    printf("shell_cmd : %s\n", shell_cmd);
    system(shell_cmd);
    sleep(1);
    cnt = 0;
    while (cnt < 20) {
      rc = sqlite3_open(db_filename_full, &db);
      if (rc != SQLITE_OK)
        fprintf(stderr, "Cannot open boxid_date.db:%s\n", sqlite3_errmsg(db));
      rc = sqlite3_exec(db, "delete from traffic_info", NULL, NULL, &errmsg);
      if (SQLITE_OK == rc) {
        printf("delete boxid_date.db success!\n");
        sqlite3_close(db);
        break;
      } else {
        printf("delete boxid_date.db error:%s\n", errmsg);
        sqlite3_close(db);
        sleep(2);
        cnt++;
      }
    }
    cnt = 0;
    while (cnt < 20) {
      rc = sqlite3_open(db_filename_full, &db);
      if (rc != SQLITE_OK)
        fprintf(stderr, "Cannot open boxid_date.db:%s\n", sqlite3_errmsg(db));
      rc = sqlite3_exec(db, "vacuum traffic_info", NULL, NULL, &errmsg);
      if (SQLITE_OK == rc) {
        printf("vacuum boxid_date.db success!\n");
        sqlite3_close(db);
        break;
      } else {
        printf("vacuum boxid_date.db error:%s\n", errmsg);
        sqlite3_close(db);
        sleep(2);
        cnt++;
      }
    }
  } else
    printf("%s : exist, don't need create!\n", db_filename);
  return db_filename_full;
}


x86 assembly (clang, -O0):
<traffic_upload_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
movq   $0x0,-0x98(%rbp)
movq   $0x0,-0xa0(%rbp)
lea    -0xaa(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   10a0 <memset@plt>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   10a0 <memset@plt>
mov    $0xc8,%edi
call   1110 <malloc@plt>
mov    %rax,-0xc8(%rbp)
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   10a0 <memset@plt>
movl   $0x0,-0x194(%rbp)
cmpl   $0x14,-0x194(%rbp)
jge    1416 <traffic_upload_create+0x1d6>
lea    0xd0d(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <sqlite3_open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2cc7(%rip),%rcx
cmp    (%rcx),%eax
jne    131f <traffic_upload_create+0xdf>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movq   $0x0,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10a0 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xce7(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0xffffffff,%edx
lea    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1130 <sqlite3_prepare@plt>
mov    -0x20(%rbp),%rdi
call   10d0 <sqlite3_step@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2c41(%rip),%rcx
cmp    (%rcx),%eax
jne    13d8 <traffic_upload_create+0x198>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1100 <sqlite3_column_text@plt>
mov    %rax,-0xa0(%rbp)
lea    -0xaa(%rbp),%rdi
mov    -0xa0(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0xaa(%rbp),%rsi
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1140 <sqlite3_finalize@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
jmp    1416 <traffic_upload_create+0x1d6>
lea    0xc79(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1140 <sqlite3_finalize@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
mov    $0x3,%edi
call   1160 <sleep@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    12df <traffic_upload_create+0x9f>
lea    -0xaa(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x4,%eax
jge    1455 <traffic_upload_create+0x215>
lea    0xc3e(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0xc8(%rbp),%rdi
call   1030 <free@plt>
lea    0xc39(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1794 <traffic_upload_create+0x554>
lea    -0xc0(%rbp),%rax
mov    %rax,-0x1b0(%rbp)
lea    -0xaa(%rbp),%rax
mov    %rax,-0x1a8(%rbp)
mov    $0x1,%edi
call   10b0 <get_time@plt>
mov    %eax,-0x19c(%rbp)
mov    $0x2,%edi
call   10b0 <get_time@plt>
mov    %eax,-0x198(%rbp)
mov    $0x3,%edi
call   10b0 <get_time@plt>
mov    -0x1b0(%rbp),%rdi
mov    -0x1a8(%rbp),%rdx
mov    -0x19c(%rbp),%ecx
mov    -0x198(%rbp),%r8d
mov    %eax,%r9d
lea    0xbca(%rip),%rsi
mov    $0x0,%al
call   1150 <sprintf@plt>
lea    -0xc0(%rbp),%rsi
lea    0xbc7(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0xc8(%rbp),%rdi
lea    -0xc0(%rbp),%rdx
lea    0xbc8(%rip),%rsi
mov    $0x0,%al
call   1150 <sprintf@plt>
mov    -0xc8(%rbp),%rsi
lea    0xbcd(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0xc8(%rbp),%rdi
mov    0x2ac5(%rip),%rax
mov    (%rax),%esi
call   1120 <access@plt>
cmp    $0xffffffff,%eax
jne    1774 <traffic_upload_create+0x534>
lea    -0xc0(%rbp),%rsi
lea    0xbbc(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x190(%rbp),%rdi
mov    -0xc8(%rbp),%rdx
lea    0xbb8(%rip),%rsi
mov    $0x0,%al
call   1150 <sprintf@plt>
lea    -0x190(%rbp),%rsi
lea    0xbce(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
lea    -0x190(%rbp),%rdi
call   1080 <system@plt>
mov    $0x1,%edi
call   1160 <sleep@plt>
movl   $0x0,-0x194(%rbp)
cmpl   $0x14,-0x194(%rbp)
jge    167b <traffic_upload_create+0x43b>
mov    -0xc8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <sqlite3_open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2a2d(%rip),%rcx
cmp    (%rcx),%eax
je     15f0 <traffic_upload_create+0x3b0>
mov    0x29fe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x18(%rbp),%rdi
call   10c0 <sqlite3_errmsg@plt>
mov    -0x1b4(%rbp),%edi
mov    %rax,%rdx
lea    0xb5d(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xb6b(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x98(%rbp),%r8
mov    %rcx,%rdx
call   1050 <sqlite3_exec@plt>
mov    %eax,-0xc(%rbp)
mov    0x29d0(%rip),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    163f <traffic_upload_create+0x3ff>
lea    0xb55(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
jmp    167b <traffic_upload_create+0x43b>
mov    -0x98(%rbp),%rsi
lea    0xb51(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
mov    $0x2,%edi
call   1160 <sleep@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1591 <traffic_upload_create+0x351>
movl   $0x0,-0x194(%rbp)
cmpl   $0x14,-0x194(%rbp)
jge    176f <traffic_upload_create+0x52f>
mov    -0xc8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <sqlite3_open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2939(%rip),%rcx
cmp    (%rcx),%eax
je     16e4 <traffic_upload_create+0x4a4>
mov    0x290a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x18(%rbp),%rdi
call   10c0 <sqlite3_errmsg@plt>
mov    -0x1b8(%rbp),%edi
mov    %rax,%rdx
lea    0xa69(%rip),%rsi
call   10e0 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xace(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x98(%rbp),%r8
mov    %rcx,%rdx
call   1050 <sqlite3_exec@plt>
mov    %eax,-0xc(%rbp)
mov    0x28dc(%rip),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1733 <traffic_upload_create+0x4f3>
lea    0xab3(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
jmp    176f <traffic_upload_create+0x52f>
mov    -0x98(%rbp),%rsi
lea    0xaaf(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10f0 <sqlite3_close@plt>
mov    $0x2,%edi
call   1160 <sleep@plt>
mov    -0x194(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x194(%rbp)
jmp    1685 <traffic_upload_create+0x445>
jmp    1789 <traffic_upload_create+0x549>
lea    -0xc0(%rbp),%rsi
lea    0xa8d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
mov    -0xc8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traffic_upload_create>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movl   $0x0,0xb0(%rsp)
movq   $0x0,0x18(%rsp)
movw   $0x0,0x28(%rsp)
movq   $0x0,0x20(%rsp)
movaps %xmm0,0x30(%rsp)
movl   $0x0,0x40(%rsp)
mov    $0xc8,%edi
call   1120 <malloc@plt>
mov    %rax,0x10(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movq   $0x0,0x180(%rsp)
mov    $0x14,%r15d
lea    0x50(%rsp),%rbx
lea    0xcd2(%rip),%rbp
lea    0x8(%rsp),%r14
mov    0x2c57(%rip),%r13
lea    0xea4(%rip),%r12
lea    0xc89(%rip),%rdi
mov    %rsp,%rsi
call   1070 <sqlite3_open@plt>
mov    0x2c4a(%rip),%rcx
cmp    (%rcx),%eax
jne    1398 <traffic_upload_create+0x148>
lea    0xc8b(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
movq   $0x0,0x8(%rsp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
mov    $0xffffffff,%edx
mov    %r14,%rcx
xor    %r8d,%r8d
call   1140 <sqlite3_prepare@plt>
mov    0x8(%rsp),%rdi
call   10e0 <sqlite3_step@plt>
cmp    0x0(%r13),%eax
je     1413 <traffic_upload_create+0x1c3>
mov    %r12,%rdi
call   1050 <puts@plt>
mov    0x8(%rsp),%rdi
call   1150 <sqlite3_finalize@plt>
mov    (%rsp),%rdi
call   1100 <sqlite3_close@plt>
mov    $0x3,%edi
call   1170 <sleep@plt>
add    $0xffffffff,%r15d
jne    1370 <traffic_upload_create+0x120>
jmp    1453 <traffic_upload_create+0x203>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
call   1110 <sqlite3_column_text@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
lea    0xc15(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x8(%rsp),%rdi
call   1150 <sqlite3_finalize@plt>
mov    (%rsp),%rdi
call   1100 <sqlite3_close@plt>
lea    0x20(%rsp),%rdi
call   1080 <strlen@plt>
cmp    $0x3,%eax
jg     1484 <traffic_upload_create+0x234>
lea    0xd97(%rip),%rdi
call   1050 <puts@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
lea    0xbd9(%rip),%rbp
jmp    16f1 <traffic_upload_create+0x4a1>
mov    $0x1,%edi
call   10c0 <get_time@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   10c0 <get_time@plt>
mov    %eax,%ebp
mov    $0x3,%edi
call   10c0 <get_time@plt>
lea    0xbb0(%rip),%rsi
lea    0x30(%rsp),%r14
lea    0x20(%rsp),%rdx
mov    %r14,%rdi
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
xor    %eax,%eax
call   1160 <sprintf@plt>
lea    0xb9f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xbab(%rip),%rsi
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1160 <sprintf@plt>
lea    0xbac(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0x2ad5(%rip),%rax
mov    (%rax),%esi
mov    %rbp,%rdi
call   1130 <access@plt>
cmp    $0xffffffff,%eax
je     1532 <traffic_upload_create+0x2e2>
lea    0xc83(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    16f1 <traffic_upload_create+0x4a1>
lea    0xb8f(%rip),%rdi
lea    0x30(%rsp),%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
lea    0xb94(%rip),%rsi
lea    0xc0(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1160 <sprintf@plt>
lea    0xba3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    %rbx,%rdi
call   1090 <system@plt>
mov    $0x1,%edi
call   1170 <sleep@plt>
mov    $0x14,%r14d
mov    0x2a57(%rip),%r12
lea    0xba1(%rip),%r13
lea    0x18(%rsp),%rbx
lea    0xbae(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %rsp,%rsi
call   1070 <sqlite3_open@plt>
cmp    (%r12),%eax
je     15e9 <traffic_upload_create+0x399>
mov    0x2a00(%rip),%rax
mov    (%rax),%ebp
mov    (%rsp),%rdi
call   10d0 <sqlite3_errmsg@plt>
mov    %ebp,%edi
mov    0x10(%rsp),%rbp
lea    0xb3a(%rip),%rsi
mov    %rax,%rdx
call   10f0 <fprintf@plt>
mov    (%rsp),%rdi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1060 <sqlite3_exec@plt>
cmp    %eax,(%r12)
je     162c <traffic_upload_create+0x3dc>
mov    0x18(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%rsp),%rdi
call   1100 <sqlite3_close@plt>
mov    $0x2,%edi
call   1170 <sleep@plt>
add    $0xffffffff,%r14d
jne    15b0 <traffic_upload_create+0x360>
jmp    1641 <traffic_upload_create+0x3f1>
lea    0xbaf(%rip),%rdi
call   1050 <puts@plt>
mov    (%rsp),%rdi
call   1100 <sqlite3_close@plt>
mov    $0x14,%r14d
lea    0xb23(%rip),%r15
lea    0x18(%rsp),%rbx
lea    0xb2b(%rip),%r13
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rsp,%rsi
call   1070 <sqlite3_open@plt>
cmp    (%r12),%eax
je     1699 <traffic_upload_create+0x449>
mov    0x2950(%rip),%rax
mov    (%rax),%ebp
mov    (%rsp),%rdi
call   10d0 <sqlite3_errmsg@plt>
mov    %ebp,%edi
mov    0x10(%rsp),%rbp
lea    0xa8a(%rip),%rsi
mov    %rax,%rdx
call   10f0 <fprintf@plt>
mov    (%rsp),%rdi
mov    %r15,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1060 <sqlite3_exec@plt>
cmp    %eax,(%r12)
je     16dc <traffic_upload_create+0x48c>
mov    0x18(%rsp),%rsi
mov    %r13,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    (%rsp),%rdi
call   1100 <sqlite3_close@plt>
mov    $0x2,%edi
call   1170 <sleep@plt>
add    $0xffffffff,%r14d
jne    1660 <traffic_upload_create+0x410>
jmp    16f1 <traffic_upload_create+0x4a1>
lea    0xae1(%rip),%rdi
call   1050 <puts@plt>
mov    (%rsp),%rdi
call   1100 <sqlite3_close@plt>
mov    %rbp,%rax
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"/ailvgo/www/database/box.db\00"
@SQLITE_ERROR = global i32 0
@.str.1 = [19 x i8] c"open box.db failed\00"
@.str.2 = [28 x i8] c"select box_id from box_info\00"
@SQLITE_ROW = global i32 0
@.str.3 = [13 x i8] c"box_id : %s\0A\00"
@.str.4 = [24 x i8] c"select box_id failure!\0A\00"
@.str.5 = [21 x i8] c"get box_id failure!\0A\00"
@.str.6 = [5 x i8] c"null\00"
@.str.7 = [18 x i8] c"%s_%4d%02d%02d.db\00"
@.str.8 = [29 x i8] c"db_filename for upload : %s\0A\00"
@.str.9 = [26 x i8] c"/ailvgo/system/traffic/%s\00"
@.str.10 = [34 x i8] c"db_filename_full for upload : %s\0A\00"
@W_OK = global i32 0
@.str.11 = [24 x i8] c"creating %s for upload\0A\00"
@.str.12 = [43 x i8] c"cp -f /ailvgo/system/traffic/traffic.db %s\00"
@.str.13 = [16 x i8] c"shell_cmd : %s\0A\00"
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str.14 = [30 x i8] c"Cannot open boxid_date.db:%s\0A\00"
@.str.15 = [25 x i8] c"delete from traffic_info\00"
@.str.16 = [31 x i8] c"delete boxid_date.db success!\0A\00"
@.str.17 = [31 x i8] c"delete boxid_date.db error:%s\0A\00"
@.str.18 = [20 x i8] c"vacuum traffic_info\00"
@.str.19 = [31 x i8] c"vacuum boxid_date.db success!\0A\00"
@.str.20 = [31 x i8] c"vacuum boxid_date.db error:%s\0A\00"
@.str.21 = [32 x i8] c"%s : exist, don't need create!\0A\00"
define i8* @traffic_upload_create() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [100 x i8]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [10 x i8]
%9 = alloca [20 x i8]
%10 = alloca i8*
%11 = alloca [200 x i8]
%12 = alloca i32
store i32 0, i32* %2
store i32* null, i32** %3
store i32* null, i32** %4
%13 = bitcast [100 x i8]* %5 to i8*
store i8* null, i8** %6
store i8* null, i8** %7
%14 = bitcast [10 x i8]* %8 to i8*
%15 = bitcast [20 x i8]* %9 to i8*
%16 = call i64 @malloc(i32 200)
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %10
%18 = bitcast [200 x i8]* %11 to i8*
store i32 0, i32* %12
br label %19
19: ; preds = %63, %0
%20 = load i32, i32* %12
%21 = icmp slt i32 %20, 20
br i1 %21, label %22, label %64
22: ; preds = %19
%23 = call i32 @sqlite3_open(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32** %3)
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = load i32, i32* @SQLITE_ERROR
%26 = icmp eq i32 %24, %25
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %27, %22
store i32* null, i32** %4
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%31 = call i32 @memset(i8* %30, i32 0, i32 100)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%33 = call i32 @strcpy(i8* %32, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%34 = load i32*, i32** %3
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%36 = call i32 @sqlite3_prepare(i32* %34, i8* %35, i32 -1, i32** %4, i32 0)
%37 = load i32*, i32** %4
%38 = call i32 @sqlite3_step(i32* %37)
store i32 %38, i32* %2
%39 = load i32, i32* %2
%40 = load i32, i32* @SQLITE_ROW
%41 = icmp eq i32 %39, %40
br i1 %41, label %42, label %54
42: ; preds = %29
%43 = load i32*, i32** %4
%44 = call i8* @sqlite3_column_text(i32* %43, i32 0)
store i8* %44, i8** %7
%45 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%46 = load i8*, i8** %7
%47 = call i32 @strcpy(i8* %45, i8* %46)
%48 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %48)
%50 = load i32*, i32** %4
%51 = call i32 @sqlite3_finalize(i32* %50)
%52 = load i32*, i32** %3
%53 = call i32 @sqlite3_close(i32* %52)
br label %64
54: ; preds = %29
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%56 = load i32*, i32** %4
%57 = call i32 @sqlite3_finalize(i32* %56)
%58 = load i32*, i32** %3
%59 = call i32 @sqlite3_close(i32* %58)
%60 = call i32 @sleep(i32 3)
%61 = load i32, i32* %12
%62 = add nsw i32 %61, 1
store i32 %62, i32* %12
br label %63
63: ; preds = %54
br label %19
64: ; preds = %42, %19
%65 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%66 = call i32 @strlen(i8* %65)
%67 = icmp slt i32 %66, 4
br i1 %67, label %68, label %72
68: ; preds = %64
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0))
%70 = load i8*, i8** %10
%71 = call i32 @free(i8* %70)
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %1
br label %174
72: ; preds = %64
%73 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%74 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%75 = call i32 @get_time(i32 1)
%76 = call i32 @get_time(i32 2)
%77 = call i32 @get_time(i32 3)
%78 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %73, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %74, i32 %75, i32 %76, i32 %77)
%79 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %79)
%81 = load i8*, i8** %10
%82 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%83 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %81, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %82)
%84 = load i8*, i8** %10
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i8* %84)
%86 = load i8*, i8** %10
%87 = load i32, i32* @W_OK
%88 = call i32 @access(i8* %86, i32 %87)
%89 = icmp eq i32 %88, -1
br i1 %89, label %90, label %169
90: ; preds = %72
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %91)
%93 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%94 = load i8*, i8** %10
%95 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %93, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %94)
%96 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8* %96)
%98 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%99 = call i32 @system(i8* %98)
%100 = call i32 @sleep(i32 1)
store i32 0, i32* %12
br label %101
101: ; preds = %133, %90
%102 = load i32, i32* %12
%103 = icmp slt i32 %102, 20
br i1 %103, label %104, label %134
104: ; preds = %101
%105 = load i8*, i8** %10
%106 = call i32 @sqlite3_open(i8* %105, i32** %3)
store i32 %106, i32* %2
%107 = load i32, i32* %2
%108 = load i32, i32* @SQLITE_OK
%109 = icmp ne i32 %107, %108
br i1 %109, label %110, label %115
110: ; preds = %104
%111 = load i32, i32* @stderr
%112 = load i32*, i32** %3
%113 = call i8* @sqlite3_errmsg(i32* %112)
%114 = call i32 @fprintf(i32 %111, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i8* %113)
br label %115
115: ; preds = %110, %104
%116 = load i32*, i32** %3
%117 = call i32 @sqlite3_exec(i32* %116, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i32* null, i32* null, i8** %6)
store i32 %117, i32* %2
%118 = load i32, i32* @SQLITE_OK
%119 = load i32, i32* %2
%120 = icmp eq i32 %118, %119
br i1 %120, label %121, label %125
121: ; preds = %115
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0))
%123 = load i32*, i32** %3
%124 = call i32 @sqlite3_close(i32* %123)
br label %134
125: ; preds = %115
%126 = load i8*, i8** %6
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i8* %126)
%128 = load i32*, i32** %3
%129 = call i32 @sqlite3_close(i32* %128)
%130 = call i32 @sleep(i32 2)
%131 = load i32, i32* %12
%132 = add nsw i32 %131, 1
store i32 %132, i32* %12
br label %133
133: ; preds = %125
br label %101
134: ; preds = %121, %101
store i32 0, i32* %12
br label %135
135: ; preds = %167, %134
%136 = load i32, i32* %12
%137 = icmp slt i32 %136, 20
br i1 %137, label %138, label %168
138: ; preds = %135
%139 = load i8*, i8** %10
%140 = call i32 @sqlite3_open(i8* %139, i32** %3)
store i32 %140, i32* %2
%141 = load i32, i32* %2
%142 = load i32, i32* @SQLITE_OK
%143 = icmp ne i32 %141, %142
br i1 %143, label %144, label %149
144: ; preds = %138
%145 = load i32, i32* @stderr
%146 = load i32*, i32** %3
%147 = call i8* @sqlite3_errmsg(i32* %146)
%148 = call i32 @fprintf(i32 %145, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i8* %147)
br label %149
149: ; preds = %144, %138
%150 = load i32*, i32** %3
%151 = call i32 @sqlite3_exec(i32* %150, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i32* null, i32* null, i8** %6)
store i32 %151, i32* %2
%152 = load i32, i32* @SQLITE_OK
%153 = load i32, i32* %2
%154 = icmp eq i32 %152, %153
br i1 %154, label %155, label %159
155: ; preds = %149
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.19, i64 0, i64 0))
%157 = load i32*, i32** %3
%158 = call i32 @sqlite3_close(i32* %157)
br label %168
159: ; preds = %149
%160 = load i8*, i8** %6
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.20, i64 0, i64 0), i8* %160)
%162 = load i32*, i32** %3
%163 = call i32 @sqlite3_close(i32* %162)
%164 = call i32 @sleep(i32 2)
%165 = load i32, i32* %12
%166 = add nsw i32 %165, 1
store i32 %166, i32* %12
br label %167
167: ; preds = %159
br label %135
168: ; preds = %155, %135
br label %172
169: ; preds = %72
%170 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 0, i64 0
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.21, i64 0, i64 0), i8* %170)
br label %172
172: ; preds = %169, %168
%173 = load i8*, i8** %10
store i8* %173, i8** %1
br label %174
174: ; preds = %172, %68
%175 = load i8*, i8** %1
ret i8* %175
}

LLVM IR (-O2):
@.str = [28 x i8] c"/ailvgo/www/database/box.db\00"
@SQLITE_ERROR = global i32 0
@.str.1 = [19 x i8] c"open box.db failed\00"
@.str.2 = [28 x i8] c"select box_id from box_info\00"
@SQLITE_ROW = global i32 0
@.str.3 = [13 x i8] c"box_id : %s\0A\00"
@.str.6 = [5 x i8] c"null\00"
@.str.7 = [18 x i8] c"%s_%4d%02d%02d.db\00"
@.str.8 = [29 x i8] c"db_filename for upload : %s\0A\00"
@.str.9 = [26 x i8] c"/ailvgo/system/traffic/%s\00"
@.str.10 = [34 x i8] c"db_filename_full for upload : %s\0A\00"
@W_OK = global i32 0
@.str.11 = [24 x i8] c"creating %s for upload\0A\00"
@.str.12 = [43 x i8] c"cp -f /ailvgo/system/traffic/traffic.db %s\00"
@.str.13 = [16 x i8] c"shell_cmd : %s\0A\00"
@SQLITE_OK = global i32 0
@stderr = global i32 0
@.str.14 = [30 x i8] c"Cannot open boxid_date.db:%s\0A\00"
@.str.15 = [25 x i8] c"delete from traffic_info\00"
@.str.17 = [31 x i8] c"delete boxid_date.db error:%s\0A\00"
@.str.18 = [20 x i8] c"vacuum traffic_info\00"
@.str.20 = [31 x i8] c"vacuum boxid_date.db error:%s\0A\00"
@.str.21 = [32 x i8] c"%s : exist, don't need create!\0A\00"
@str = [30 x i8] c"vacuum boxid_date.db success!\00"
@str.22 = [30 x i8] c"delete boxid_date.db success!\00"
@str.23 = [20 x i8] c"get box_id failure!\00"
@str.24 = [23 x i8] c"select box_id failure!\00"
define i8* @traffic_upload_create() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca [100 x i8]
%4 = alloca i8*
%5 = alloca [10 x i8]
%6 = alloca [20 x i8]
%7 = alloca [200 x i8]
%8 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%9 = bitcast i32** %2 to i8*
store i32* null, i32** %2
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%11 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
%14 = tail call i64 @malloc(i32 200)
%15 = inttoptr i64 %14 to i8*
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
br label %17
17: ; preds = %0, %42
%18 = phi i32 [ 0, %0 ], [ %49, %42 ]
%19 = call i32 @sqlite3_open(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32** %1)
%20 = load i32, i32* @SQLITE_ERROR
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
store i32* null, i32** %2
%25 = call i32 @memset(i8* %10, i32 0, i32 100)
%26 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%27 = load i32*, i32** %1
%28 = call i32 @sqlite3_prepare(i32* %27, i8* %10, i32 -1, i32** %2, i32 0)
%29 = load i32*, i32** %2
%30 = call i32 @sqlite3_step(i32* %29)
%31 = load i32, i32* @SQLITE_ROW
%32 = icmp eq i32 %30, %31
br i1 %32, label %33, label %42
33: ; preds = %24
%34 = load i32*, i32** %2
%35 = call i8* @sqlite3_column_text(i32* %34, i32 0)
%36 = call i32 @strcpy(i8* %12, i8* %35)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%38 = load i32*, i32** %2
%39 = call i32 @sqlite3_finalize(i32* %38)
%40 = load i32*, i32** %1
%41 = call i32 @sqlite3_close(i32* %40)
br label %51
42: ; preds = %24
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.24, i64 0, i64 0))
%44 = load i32*, i32** %2
%45 = call i32 @sqlite3_finalize(i32* %44)
%46 = load i32*, i32** %1
%47 = call i32 @sqlite3_close(i32* %46)
%48 = call i32 @sleep(i32 3)
%49 = add nuw nsw i32 %18, 1
%50 = icmp eq i32 %49, 20
br i1 %50, label %51, label %17
51: ; preds = %42, %33
%52 = call i32 @strlen(i8* %12)
%53 = icmp slt i32 %52, 4
br i1 %53, label %54, label %57
54: ; preds = %51
%55 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.23, i64 0, i64 0))
%56 = call i32 @free(i8* %15)
br label %131
57: ; preds = %51
%58 = call i32 @get_time(i32 1)
%59 = call i32 @get_time(i32 2)
%60 = call i32 @get_time(i32 3)
%61 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* %12, i32 %58, i32 %59, i32 %60)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* %13)
%63 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %15, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i8* %13)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i8* %15)
%65 = load i32, i32* @W_OK
%66 = call i32 @access(i8* %15, i32 %65)
%67 = icmp eq i32 %66, -1
br i1 %67, label %68, label %129
68: ; preds = %57
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %13)
%70 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %16, i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0), i8* %15)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i8* %16)
%72 = call i32 @system(i8* %16)
%73 = call i32 @sleep(i32 1)
br label %74
74: ; preds = %68, %93
%75 = phi i32 [ 0, %68 ], [ %99, %93 ]
%76 = call i32 @sqlite3_open(i8* %15, i32** %1)
%77 = load i32, i32* @SQLITE_OK
%78 = icmp eq i32 %76, %77
br i1 %78, label %84, label %79
79: ; preds = %74
%80 = load i32, i32* @stderr
%81 = load i32*, i32** %1
%82 = call i8* @sqlite3_errmsg(i32* %81)
%83 = call i32 @fprintf(i32 %80, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i8* %82)
br label %84
84: ; preds = %79, %74
%85 = load i32*, i32** %1
%86 = call i32 @sqlite3_exec(i32* %85, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0), i32* null, i32* null, i8** %4)
%87 = load i32, i32* @SQLITE_OK
%88 = icmp eq i32 %87, %86
br i1 %88, label %89, label %93
89: ; preds = %84
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.22, i64 0, i64 0))
%91 = load i32*, i32** %1
%92 = call i32 @sqlite3_close(i32* %91)
br label %101
93: ; preds = %84
%94 = load i8*, i8** %4
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0), i8* %94)
%96 = load i32*, i32** %1
%97 = call i32 @sqlite3_close(i32* %96)
%98 = call i32 @sleep(i32 2)
%99 = add nuw nsw i32 %75, 1
%100 = icmp eq i32 %99, 20
br i1 %100, label %101, label %74
101: ; preds = %93, %89
br label %102
102: ; preds = %101, %121
%103 = phi i32 [ %127, %121 ], [ 0, %101 ]
%104 = call i32 @sqlite3_open(i8* %15, i32** %1)
%105 = load i32, i32* @SQLITE_OK
%106 = icmp eq i32 %104, %105
br i1 %106, label %112, label %107
107: ; preds = %102
%108 = load i32, i32* @stderr
%109 = load i32*, i32** %1
%110 = call i8* @sqlite3_errmsg(i32* %109)
%111 = call i32 @fprintf(i32 %108, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0), i8* %110)
br label %112
112: ; preds = %107, %102
%113 = load i32*, i32** %1
%114 = call i32 @sqlite3_exec(i32* %113, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.18, i64 0, i64 0), i32* null, i32* null, i8** %4)
%115 = load i32, i32* @SQLITE_OK
%116 = icmp eq i32 %115, %114
br i1 %116, label %117, label %121
117: ; preds = %112
%118 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%119 = load i32*, i32** %1
%120 = call i32 @sqlite3_close(i32* %119)
br label %131
121: ; preds = %112
%122 = load i8*, i8** %4
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.20, i64 0, i64 0), i8* %122)
%124 = load i32*, i32** %1
%125 = call i32 @sqlite3_close(i32* %124)
%126 = call i32 @sleep(i32 2)
%127 = add nuw nsw i32 %103, 1
%128 = icmp eq i32 %127, 20
br i1 %128, label %131, label %102
129: ; preds = %57
%130 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.21, i64 0, i64 0), i8* %13)
br label %131
131: ; preds = %121, %129, %117, %54
%132 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), %54 ], [ %15, %117 ], [ %15, %129 ], [ %15, %121 ]
ret i8* %132
}