#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 /*<<< orphan*/ ap_socket();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sys_log(char *);
int /*<<< orphan*/ traffic_check();
int /*<<< orphan*/ traffic_saved_check();
int /*<<< orphan*/ traffic_total_check();
int main() {
  int rc = 0;
  sqlite3 *db = NULL;
  char *errmsg;
  int cnt = 0;
  printf("----------traffic.db : check------------------\n");
  traffic_check();
  printf("--------traffic_total.db : check------------\n");
  traffic_total_check();
  printf("--------traffic_saved.db : check------------\n");
  traffic_saved_check();
  ap_socket();
  printf("udp_get over!\n");
  sys_log("udp_get error");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <traffic_check@plt>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <traffic_total_check@plt>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <traffic_saved_check@plt>
mov    $0x0,%al
call   1050 <ap_socket@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1080 <sys_log@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <traffic_check@plt>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <traffic_total_check@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <traffic_saved_check@plt>
xor    %eax,%eax
call   1050 <ap_socket@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4c(%rip),%rdi
call   1080 <sys_log@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"----------traffic.db : check------------------\0A\00"
@.str.1 = [46 x i8] c"--------traffic_total.db : check------------\0A\00"
@.str.2 = [46 x i8] c"--------traffic_saved.db : check------------\0A\00"
@.str.3 = [15 x i8] c"udp_get over!\0A\00"
@.str.4 = [14 x i8] c"udp_get error\00"
define i32 @main() {
%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 i32 0, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @traffic_check()
%8 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @traffic_total_check()
%10 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (...) @traffic_saved_check()
%12 = call i32 (...) @ap_socket()
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @sys_log(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [14 x i8] c"udp_get error\00"
@str = [47 x i8] c"----------traffic.db : check------------------\00"
@str.5 = [45 x i8] c"--------traffic_total.db : check------------\00"
@str.6 = [45 x i8] c"--------traffic_saved.db : check------------\00"
@str.7 = [14 x i8] c"udp_get over!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @traffic_check()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 (...) @traffic_total_check()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.6, i64 0, i64 0))
%6 = tail call i32 (...) @traffic_saved_check()
%7 = tail call i32 (...) @ap_socket()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.7, i64 0, i64 0))
%9 = tail call i32 @sys_log(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}