#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;

/* Variables and functions */
int SQLITE_OK;
int /*<<< orphan*/ W_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ sqlite3_close(int /*<<< orphan*/ *);
int sqlite3_exec(int /*<<< orphan*/ *, char *, int /*<<< orphan*/ *,
                 int /*<<< orphan*/ *, char **);
int sqlite3_open(char *, int /*<<< orphan*/ **);
int /*<<< orphan*/ sys_log(char *);
int /*<<< orphan*/ system(char *);
void traffic_total_check() {
  int traffic_total_exist = 0;
  int rc = 0;
  sqlite3 *db = NULL;
  char *errmsg = NULL;
  int sql_cnt = 0;
  if (access("/ailvgo/system/traffic/traffic_total.db", W_OK) == -1) {
    printf("traffic_total.db : not exist!\n");
    sys_log("traffic_total.db : not exist!");
    traffic_total_exist = 0;
  } else {
    printf("traffic_total.db : exist!\n");
    traffic_total_exist = 1;
  }
  if (traffic_total_exist == 0) {
    printf("creat traffic_total.db using traffic.db\n");
    printf("cp -f /ailvgo/system/traffic/traffic.db "
           "/ailvgo/system/traffic/traffic_total.db\n");
    system("cp -f /ailvgo/system/traffic/traffic.db "
           "/ailvgo/system/traffic/traffic_total.db");
    sleep(1);
    sql_cnt = 0;
    while (sql_cnt < 20) {
      rc = sqlite3_open("/ailvgo/system/traffic/traffic_total.db", &db);
      if (rc != SQLITE_OK)
        printf("Cannot open traffic_total.db!\n");
      rc = sqlite3_exec(db, "DROP TABLE traffic_info", NULL, NULL, &errmsg);
      if (SQLITE_OK == rc) {
        printf("drop table in traffic_total.db success!\n");
        sqlite3_close(db);
        break;
      } else {
        printf("drop table in traffic_total.db failure!\n");
        sqlite3_close(db);
        sleep(1);
        sql_cnt++;
      }
    }
    sql_cnt = 0;
    while (sql_cnt < 20) {
      rc = sqlite3_open("/ailvgo/system/traffic/traffic_total.db", &db);
      if (rc != SQLITE_OK)
        printf("Cannot open traffic_total.db!\n");
      rc = sqlite3_exec(
          db, "CREATE TABLE traffic_total (mobile TEXT, time INTEGER)", NULL,
          NULL, &errmsg);
      if (SQLITE_OK == rc) {
        printf("create table in traffic_total.db success!\n");
        sqlite3_close(db);
        break;
      } else {
        printf("create table in traffic_total.db failure!\n");
        sqlite3_close(db);
        sleep(1);
        sql_cnt++;
      }
    }
  } else {
    sql_cnt = 0;
    while (sql_cnt < 20) {
      rc = sqlite3_open("/ailvgo/system/traffic/traffic_total.db", &db);
      if (rc != SQLITE_OK)
        printf("Cannot open traffic_total.db!\n");
      rc = sqlite3_exec(db, "delete from traffic_total", NULL, NULL, &errmsg);
      if (SQLITE_OK == rc) {
        printf("delete traffic_total.db success!\n");
        sqlite3_close(db);
        break;
      } else {
        printf("delete traffic_total.db failure!\n");
        sqlite3_close(db);
        sleep(1);
        sql_cnt++;
      }
    }
    sql_cnt = 0;
    while (sql_cnt < 20) {
      rc = sqlite3_open("/ailvgo/system/traffic/traffic_total.db", &db);
      if (rc != SQLITE_OK)
        printf("Cannot open traffic_total.db!\n");
      rc = sqlite3_exec(db, "vacuum traffic_total", NULL, NULL, &errmsg);
      if (SQLITE_OK == rc) {
        printf("vacuum traffic_total.db success!\n");
        sqlite3_close(db);
        break;
      } else {
        printf("vacuum traffic_total.db failure!\n");
        sqlite3_close(db);
        sleep(1);
        sql_cnt++;
      }
    }
  }
}


x86 assembly (clang, -O0):
<traffic_total_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0x2e2c(%rip),%rax
mov    (%rax),%esi
lea    0xf3d(%rip),%rdi
call   1080 <access@plt>
cmp    $0xffffffff,%eax
jne    11ef <traffic_total_check+0x6f>
lea    0xe2e(%rip),%rdi
call   1060 <printf@plt>
lea    0xe41(%rip),%rdi
call   1090 <sys_log@plt>
movl   $0x0,-0x4(%rbp)
jmp    1202 <traffic_total_check+0x82>
lea    0xe47(%rip),%rdi
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    13b1 <traffic_total_check+0x231>
lea    0xe45(%rip),%rdi
call   1060 <printf@plt>
lea    0xe62(%rip),%rdi
call   1060 <printf@plt>
lea    0xea7(%rip),%rdi
call   1050 <system@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jge    12f3 <traffic_total_check+0x173>
lea    0xea8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <sqlite3_open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2d80(%rip),%rcx
cmp    (%rcx),%eax
je     127c <traffic_total_check+0xfc>
lea    0xeab(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xeba(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1030 <sqlite3_exec@plt>
mov    %eax,-0x8(%rbp)
mov    0x2d47(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    12c6 <traffic_total_check+0x146>
lea    0xea6(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
jmp    12f3 <traffic_total_check+0x173>
lea    0xeb5(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1241 <traffic_total_check+0xc1>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jge    13ac <traffic_total_check+0x22c>
lea    0xdef(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <sqlite3_open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2cc7(%rip),%rcx
cmp    (%rcx),%eax
je     1335 <traffic_total_check+0x1b5>
lea    0xdf2(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe6b(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1030 <sqlite3_exec@plt>
mov    %eax,-0x8(%rbp)
mov    0x2c8e(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    137f <traffic_total_check+0x1ff>
lea    0xe76(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
jmp    13ac <traffic_total_check+0x22c>
lea    0xe87(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12fa <traffic_total_check+0x17a>
jmp    1528 <traffic_total_check+0x3a8>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jge    146a <traffic_total_check+0x2ea>
lea    0xd31(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <sqlite3_open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2c09(%rip),%rcx
cmp    (%rcx),%eax
je     13f3 <traffic_total_check+0x273>
lea    0xd34(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe3a(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1030 <sqlite3_exec@plt>
mov    %eax,-0x8(%rbp)
mov    0x2bd0(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    143d <traffic_total_check+0x2bd>
lea    0xe28(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
jmp    146a <traffic_total_check+0x2ea>
lea    0xe30(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13b8 <traffic_total_check+0x238>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x14,-0x1c(%rbp)
jge    1523 <traffic_total_check+0x3a3>
lea    0xc78(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <sqlite3_open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2b50(%rip),%rcx
cmp    (%rcx),%eax
je     14ac <traffic_total_check+0x32c>
lea    0xc7b(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
lea    0xddf(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1030 <sqlite3_exec@plt>
mov    %eax,-0x8(%rbp)
mov    0x2b17(%rip),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    14f6 <traffic_total_check+0x376>
lea    0xdc8(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
jmp    1523 <traffic_total_check+0x3a3>
lea    0xdd0(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1471 <traffic_total_check+0x2f1>
jmp    1528 <traffic_total_check+0x3a8>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traffic_total_check>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2e3a(%rip),%rax
mov    (%rax),%esi
lea    0xfbd(%rip),%rdi
call   1080 <access@plt>
cmp    $0xffffffff,%eax
je     1251 <traffic_total_check+0xd1>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
mov    $0x14,%ebp
mov    %rsp,%r15
mov    0x2e10(%rip),%r14
lea    0xe70(%rip),%r12
lea    0x8(%rsp),%rbx
lea    0xeef(%rip),%r13
nopl   0x0(%rax,%rax,1)
lea    0xf75(%rip),%rdi
mov    %r15,%rsi
call   1050 <sqlite3_open@plt>
cmp    (%r14),%eax
je     1210 <traffic_total_check+0x90>
lea    0x102d(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1040 <sqlite3_exec@plt>
cmp    %eax,(%r14)
je     1322 <traffic_total_check+0x1a2>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
add    $0xffffffff,%ebp
jne    11f0 <traffic_total_check+0x70>
jmp    1337 <traffic_total_check+0x1b7>
lea    0xffe(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1090 <sys_log@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1060 <system@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    $0x14,%r13d
mov    %rsp,%r15
mov    0x2d43(%rip),%r14
lea    0xd54(%rip),%r12
lea    0x8(%rsp),%rbx
lea    0xf30(%rip),%rbp
nopl   0x0(%rax,%rax,1)
lea    0xea5(%rip),%rdi
mov    %r15,%rsi
call   1050 <sqlite3_open@plt>
cmp    (%r14),%eax
je     12e0 <traffic_total_check+0x160>
lea    0xf5d(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1040 <sqlite3_exec@plt>
cmp    %eax,(%r14)
je     13c2 <traffic_total_check+0x242>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
add    $0xffffffff,%r13d
jne    12c0 <traffic_total_check+0x140>
jmp    13d7 <traffic_total_check+0x257>
lea    0xdd2(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x14,%r15d
mov    %rsp,%r12
lea    0xd22(%rip),%r13
lea    0x8(%rsp),%rbx
lea    0xd66(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xd39(%rip),%rbp
nop
lea    0xe05(%rip),%rdi
mov    %r12,%rsi
call   1050 <sqlite3_open@plt>
cmp    (%r14),%eax
je     1380 <traffic_total_check+0x200>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1040 <sqlite3_exec@plt>
cmp    %eax,(%r14)
je     145b <traffic_total_check+0x2db>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
add    $0xffffffff,%r15d
jne    1360 <traffic_total_check+0x1e0>
jmp    146e <traffic_total_check+0x2ee>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x14,%r15d
mov    %rsp,%r12
lea    0xc31(%rip),%r13
lea    0x8(%rsp),%rbx
lea    0xdcb(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xd95(%rip),%rbp
nop
lea    0xd65(%rip),%rdi
mov    %r12,%rsi
call   1050 <sqlite3_open@plt>
cmp    (%r14),%eax
je     1420 <traffic_total_check+0x2a0>
lea    0xe1d(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbx,%r8
call   1040 <sqlite3_exec@plt>
cmp    %eax,(%r14)
je     145b <traffic_total_check+0x2db>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
add    $0xffffffff,%r15d
jne    1400 <traffic_total_check+0x280>
jmp    146e <traffic_total_check+0x2ee>
mov    0x10(%rsp),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rdi
call   1070 <sqlite3_close@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"/ailvgo/system/traffic/traffic_total.db\00"
@W_OK = global i32 0
@.str.1 = [31 x i8] c"traffic_total.db : not exist!\0A\00"
@.str.2 = [30 x i8] c"traffic_total.db : not exist!\00"
@.str.3 = [27 x i8] c"traffic_total.db : exist!\0A\00"
@.str.4 = [41 x i8] c"creat traffic_total.db using traffic.db\0A\00"
@.str.5 = [81 x i8] c"cp -f /ailvgo/system/traffic/traffic.db /ailvgo/system/traffic/traffic_total.db\0A\00"
@.str.6 = [80 x i8] c"cp -f /ailvgo/system/traffic/traffic.db /ailvgo/system/traffic/traffic_total.db\00"
@SQLITE_OK = global i32 0
@.str.7 = [31 x i8] c"Cannot open traffic_total.db!\0A\00"
@.str.8 = [24 x i8] c"DROP TABLE traffic_info\00"
@.str.9 = [41 x i8] c"drop table in traffic_total.db success!\0A\00"
@.str.10 = [41 x i8] c"drop table in traffic_total.db failure!\0A\00"
@.str.11 = [55 x i8] c"CREATE TABLE traffic_total (mobile TEXT, time INTEGER)\00"
@.str.12 = [43 x i8] c"create table in traffic_total.db success!\0A\00"
@.str.13 = [43 x i8] c"create table in traffic_total.db failure!\0A\00"
@.str.14 = [26 x i8] c"delete from traffic_total\00"
@.str.15 = [34 x i8] c"delete traffic_total.db success!\0A\00"
@.str.16 = [34 x i8] c"delete traffic_total.db failure!\0A\00"
@.str.17 = [21 x i8] c"vacuum traffic_total\00"
@.str.18 = [34 x i8] c"vacuum traffic_total.db success!\0A\00"
@.str.19 = [34 x i8] c"vacuum traffic_total.db failure!\0A\00"
define void @traffic_total_check() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32* null, i32** %3
store i8* null, i8** %4
store i32 0, i32* %5
%6 = load i32, i32* @W_OK
%7 = call i32 @access(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @sys_log(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %80
17: ; preds = %14
%18 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @printf(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 @system(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 @sleep(i32 1)
store i32 0, i32* %5
br label %22
22: ; preds = %49, %17
%23 = load i32, i32* %5
%24 = icmp slt i32 %23, 20
br i1 %24, label %25, label %50
25: ; preds = %22
%26 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %3)
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = load i32, i32* @SQLITE_OK
%29 = icmp ne i32 %27, %28
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %32
32: ; preds = %30, %25
%33 = load i32*, i32** %3
%34 = call i32 @sqlite3_exec(i32* %33, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32* null, i32* null, i8** %4)
store i32 %34, i32* %2
%35 = load i32, i32* @SQLITE_OK
%36 = load i32, i32* %2
%37 = icmp eq i32 %35, %36
br i1 %37, label %38, label %42
38: ; preds = %32
%39 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.9, i64 0, i64 0))
%40 = load i32*, i32** %3
%41 = call i32 @sqlite3_close(i32* %40)
br label %50
42: ; preds = %32
%43 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.10, i64 0, i64 0))
%44 = load i32*, i32** %3
%45 = call i32 @sqlite3_close(i32* %44)
%46 = call i32 @sleep(i32 1)
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %49
49: ; preds = %42
br label %22
50: ; preds = %38, %22
store i32 0, i32* %5
br label %51
51: ; preds = %78, %50
%52 = load i32, i32* %5
%53 = icmp slt i32 %52, 20
br i1 %53, label %54, label %79
54: ; preds = %51
%55 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %3)
store i32 %55, i32* %2
%56 = load i32, i32* %2
%57 = load i32, i32* @SQLITE_OK
%58 = icmp ne i32 %56, %57
br i1 %58, label %59, label %61
59: ; preds = %54
%60 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %61
61: ; preds = %59, %54
%62 = load i32*, i32** %3
%63 = call i32 @sqlite3_exec(i32* %62, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0), i32* null, i32* null, i8** %4)
store i32 %63, i32* %2
%64 = load i32, i32* @SQLITE_OK
%65 = load i32, i32* %2
%66 = icmp eq i32 %64, %65
br i1 %66, label %67, label %71
67: ; preds = %61
%68 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.12, i64 0, i64 0))
%69 = load i32*, i32** %3
%70 = call i32 @sqlite3_close(i32* %69)
br label %79
71: ; preds = %61
%72 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.13, i64 0, i64 0))
%73 = load i32*, i32** %3
%74 = call i32 @sqlite3_close(i32* %73)
%75 = call i32 @sleep(i32 1)
%76 = load i32, i32* %5
%77 = add nsw i32 %76, 1
store i32 %77, i32* %5
br label %78
78: ; preds = %71
br label %51
79: ; preds = %67, %51
br label %139
80: ; preds = %14
store i32 0, i32* %5
br label %81
81: ; preds = %108, %80
%82 = load i32, i32* %5
%83 = icmp slt i32 %82, 20
br i1 %83, label %84, label %109
84: ; preds = %81
%85 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %3)
store i32 %85, i32* %2
%86 = load i32, i32* %2
%87 = load i32, i32* @SQLITE_OK
%88 = icmp ne i32 %86, %87
br i1 %88, label %89, label %91
89: ; preds = %84
%90 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %91
91: ; preds = %89, %84
%92 = load i32*, i32** %3
%93 = call i32 @sqlite3_exec(i32* %92, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32* null, i32* null, i8** %4)
store i32 %93, i32* %2
%94 = load i32, i32* @SQLITE_OK
%95 = load i32, i32* %2
%96 = icmp eq i32 %94, %95
br i1 %96, label %97, label %101
97: ; preds = %91
%98 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.15, i64 0, i64 0))
%99 = load i32*, i32** %3
%100 = call i32 @sqlite3_close(i32* %99)
br label %109
101: ; preds = %91
%102 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.16, i64 0, i64 0))
%103 = load i32*, i32** %3
%104 = call i32 @sqlite3_close(i32* %103)
%105 = call i32 @sleep(i32 1)
%106 = load i32, i32* %5
%107 = add nsw i32 %106, 1
store i32 %107, i32* %5
br label %108
108: ; preds = %101
br label %81
109: ; preds = %97, %81
store i32 0, i32* %5
br label %110
110: ; preds = %137, %109
%111 = load i32, i32* %5
%112 = icmp slt i32 %111, 20
br i1 %112, label %113, label %138
113: ; preds = %110
%114 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %3)
store i32 %114, i32* %2
%115 = load i32, i32* %2
%116 = load i32, i32* @SQLITE_OK
%117 = icmp ne i32 %115, %116
br i1 %117, label %118, label %120
118: ; preds = %113
%119 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.7, i64 0, i64 0))
br label %120
120: ; preds = %118, %113
%121 = load i32*, i32** %3
%122 = call i32 @sqlite3_exec(i32* %121, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i32* null, i32* null, i8** %4)
store i32 %122, i32* %2
%123 = load i32, i32* @SQLITE_OK
%124 = load i32, i32* %2
%125 = icmp eq i32 %123, %124
br i1 %125, label %126, label %130
126: ; preds = %120
%127 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.18, i64 0, i64 0))
%128 = load i32*, i32** %3
%129 = call i32 @sqlite3_close(i32* %128)
br label %138
130: ; preds = %120
%131 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.19, i64 0, i64 0))
%132 = load i32*, i32** %3
%133 = call i32 @sqlite3_close(i32* %132)
%134 = call i32 @sleep(i32 1)
%135 = load i32, i32* %5
%136 = add nsw i32 %135, 1
store i32 %136, i32* %5
br label %137
137: ; preds = %130
br label %110
138: ; preds = %126, %110
br label %139
139: ; preds = %138, %79
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"/ailvgo/system/traffic/traffic_total.db\00"
@W_OK = global i32 0
@SQLITE_OK = global i32 0
@.str.8 = [24 x i8] c"DROP TABLE traffic_info\00"
@.str.11 = [55 x i8] c"CREATE TABLE traffic_total (mobile TEXT, time INTEGER)\00"
@.str.14 = [26 x i8] c"delete from traffic_total\00"
@.str.17 = [21 x i8] c"vacuum traffic_total\00"
@str = [26 x i8] c"traffic_total.db : exist!\00"
@str.20 = [33 x i8] c"vacuum traffic_total.db failure!\00"
@str.21 = [33 x i8] c"vacuum traffic_total.db success!\00"
@str.23 = [33 x i8] c"delete traffic_total.db failure!\00"
@str.24 = [33 x i8] c"delete traffic_total.db success!\00"
@str.26 = [40 x i8] c"creat traffic_total.db using traffic.db\00"
@str.27 = [80 x i8] c"cp -f /ailvgo/system/traffic/traffic.db /ailvgo/system/traffic/traffic_total.db\00"
@str.28 = [42 x i8] c"create table in traffic_total.db failure!\00"
@str.29 = [42 x i8] c"create table in traffic_total.db success!\00"
@str.31 = [40 x i8] c"drop table in traffic_total.db failure!\00"
@str.32 = [40 x i8] c"drop table in traffic_total.db success!\00"
@str.33 = [30 x i8] c"Cannot open traffic_total.db!\00"
@str.34 = [30 x i8] c"traffic_total.db : not exist!\00"
define void @traffic_total_check() {
%1 = alloca i32*
%2 = alloca i8*
%3 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%4 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%5 = load i32, i32* @W_OK
%6 = tail call i32 @access(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %60
10: ; preds = %0
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.34, i64 0, i64 0))
%12 = tail call i32 @sys_log(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @str.34, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.26, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @str.27, i64 0, i64 0))
%15 = tail call i32 @system(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @str.27, i64 0, i64 0))
%16 = tail call i32 @sleep(i32 1)
br label %17
17: ; preds = %10, %33
%18 = phi i32 [ 0, %10 ], [ %38, %33 ]
%19 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %1)
%20 = load i32, i32* @SQLITE_OK
%21 = icmp eq i32 %19, %20
br i1 %21, label %24, label %22
22: ; preds = %17
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.33, i64 0, i64 0))
br label %24
24: ; preds = %22, %17
%25 = load i32*, i32** %1
%26 = call i32 @sqlite3_exec(i32* %25, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32* null, i32* null, i8** %2)
%27 = load i32, i32* @SQLITE_OK
%28 = icmp eq i32 %27, %26
br i1 %28, label %29, label %33
29: ; preds = %24
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.32, i64 0, i64 0))
%31 = load i32*, i32** %1
%32 = call i32 @sqlite3_close(i32* %31)
br label %40
33: ; preds = %24
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.31, i64 0, i64 0))
%35 = load i32*, i32** %1
%36 = call i32 @sqlite3_close(i32* %35)
%37 = call i32 @sleep(i32 1)
%38 = add nuw nsw i32 %18, 1
%39 = icmp eq i32 %38, 20
br i1 %39, label %40, label %17
40: ; preds = %33, %29
br label %41
41: ; preds = %40, %53
%42 = phi i32 [ %58, %53 ], [ 0, %40 ]
%43 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %1)
%44 = load i32, i32* @SQLITE_OK
%45 = icmp eq i32 %43, %44
br i1 %45, label %48, label %46
46: ; preds = %41
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.33, i64 0, i64 0))
br label %48
48: ; preds = %46, %41
%49 = load i32*, i32** %1
%50 = call i32 @sqlite3_exec(i32* %49, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.11, i64 0, i64 0), i32* null, i32* null, i8** %2)
%51 = load i32, i32* @SQLITE_OK
%52 = icmp eq i32 %51, %50
br i1 %52, label %103, label %53
53: ; preds = %48
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.28, i64 0, i64 0))
%55 = load i32*, i32** %1
%56 = call i32 @sqlite3_close(i32* %55)
%57 = call i32 @sleep(i32 1)
%58 = add nuw nsw i32 %42, 1
%59 = icmp eq i32 %58, 20
br i1 %59, label %108, label %41
60: ; preds = %8, %76
%61 = phi i32 [ 0, %8 ], [ %81, %76 ]
%62 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %1)
%63 = load i32, i32* @SQLITE_OK
%64 = icmp eq i32 %62, %63
br i1 %64, label %67, label %65
65: ; preds = %60
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.33, i64 0, i64 0))
br label %67
67: ; preds = %65, %60
%68 = load i32*, i32** %1
%69 = call i32 @sqlite3_exec(i32* %68, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0), i32* null, i32* null, i8** %2)
%70 = load i32, i32* @SQLITE_OK
%71 = icmp eq i32 %70, %69
br i1 %71, label %72, label %76
72: ; preds = %67
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.24, i64 0, i64 0))
%74 = load i32*, i32** %1
%75 = call i32 @sqlite3_close(i32* %74)
br label %83
76: ; preds = %67
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.23, i64 0, i64 0))
%78 = load i32*, i32** %1
%79 = call i32 @sqlite3_close(i32* %78)
%80 = call i32 @sleep(i32 1)
%81 = add nuw nsw i32 %61, 1
%82 = icmp eq i32 %81, 20
br i1 %82, label %83, label %60
83: ; preds = %76, %72
br label %84
84: ; preds = %83, %96
%85 = phi i32 [ %101, %96 ], [ 0, %83 ]
%86 = call i32 @sqlite3_open(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32** %1)
%87 = load i32, i32* @SQLITE_OK
%88 = icmp eq i32 %86, %87
br i1 %88, label %91, label %89
89: ; preds = %84
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.33, i64 0, i64 0))
br label %91
91: ; preds = %89, %84
%92 = load i32*, i32** %1
%93 = call i32 @sqlite3_exec(i32* %92, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i32* null, i32* null, i8** %2)
%94 = load i32, i32* @SQLITE_OK
%95 = icmp eq i32 %94, %93
br i1 %95, label %103, label %96
96: ; preds = %91
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.20, i64 0, i64 0))
%98 = load i32*, i32** %1
%99 = call i32 @sqlite3_close(i32* %98)
%100 = call i32 @sleep(i32 1)
%101 = add nuw nsw i32 %85, 1
%102 = icmp eq i32 %101, 20
br i1 %102, label %108, label %84
103: ; preds = %91, %48
%104 = phi i8* [ getelementptr inbounds ([42 x i8], [42 x i8]* @str.29, i64 0, i64 0), %48 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @str.21, i64 0, i64 0), %91 ]
%105 = call i32 @puts(i8* dereferenceable(1) %104)
%106 = load i32*, i32** %1
%107 = call i32 @sqlite3_close(i32* %106)
br label %108
108: ; preds = %96, %53, %103
ret void
}