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

/* Variables and functions */
int /*<<< orphan*/ count_threads_of_board(char *);
int /*<<< orphan*/ delete_user();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ import_board();
int /*<<< orphan*/ import_thread();
int /*<<< orphan*/ import_user();
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc > 1) {
    if (strcmp(argv[1], "test_board") == 0) {
      count_threads_of_board(argv[2]);
    } else if (strcmp(argv[1], "import_board") == 0) {
      import_board();
    } else if (strcmp(argv[1], "import_user") == 0) {
      import_user();
    } else if (strcmp(argv[1], "import_thread") == 0) {
      import_thread();
    } else if (strcmp(argv[1], "delete_user") == 0) {
      delete_user();
    }
  } else {
    fprintf(stderr, "[usage] <program_name> <option>\noption:\n");
    fprintf(stderr, "\ttest_board <boardname>: 测试版面主题计数\n");
    fprintf(stderr,
            "\timport_board: 导入版面信息到 t_boards 表，并创建版面视图\n");
    fprintf(stderr, "\timport_user: 导入用户信息到 t_users "
                    "表，并初始化订阅元信息，构建对应视图\n");
    fprintf(stderr, "\timport_thread: "
                    "读取各个版面的主题贴，统计讨论数，并最终合并为一个按时间排"
                    "列的列表导入到 t_threads 表中\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    127c <main+0x10c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe61(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11c0 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <count_threads_of_board@plt>
jmp    1277 <main+0x107>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ea <main+0x7a>
mov    $0x0,%al
call   1090 <import_board@plt>
jmp    1272 <main+0x102>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1214 <main+0xa4>
mov    $0x0,%al
call   1030 <import_user@plt>
jmp    126d <main+0xfd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe01(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    123e <main+0xce>
mov    $0x0,%al
call   1050 <import_thread@plt>
jmp    1268 <main+0xf8>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xde5(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1263 <main+0xf3>
mov    $0x0,%al
call   1040 <delete_user@plt>
jmp    1268 <main+0xf8>
jmp    126d <main+0xfd>
jmp    1272 <main+0x102>
jmp    1277 <main+0x107>
jmp    12e5 <main+0x175>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
lea    0xdb2(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xdc6(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d33(%rip),%rax
mov    (%rax),%edi
lea    0xde4(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d1e(%rip),%rax
mov    (%rax),%edi
lea    0xe1a(%rip),%rsi
call   1070 <fprintf@plt>
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
lea    0xe69(%rip),%rsi
call   1070 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     11ff <main+0x8f>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
lea    0xe78(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     124e <main+0xde>
mov    0x8(%rbx),%rdi
lea    0xe6a(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1259 <main+0xe9>
mov    0x8(%rbx),%rdi
lea    0xe5e(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1262 <main+0xf2>
mov    0x8(%rbx),%rdi
lea    0xe51(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     126b <main+0xfb>
mov    0x8(%rbx),%rdi
lea    0xe46(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1272 <main+0x102>
xor    %eax,%eax
call   1040 <delete_user@plt>
jmp    1272 <main+0x102>
mov    0x2dda(%rip),%rbx
mov    (%rbx),%edi
lea    0xe2f(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe4a(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe6f(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeac(%rip),%rsi
call   1070 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf02(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1272 <main+0x102>
mov    0x10(%rbx),%rdi
call   1080 <count_threads_of_board@plt>
jmp    1272 <main+0x102>
xor    %eax,%eax
call   1090 <import_board@plt>
jmp    1272 <main+0x102>
xor    %eax,%eax
call   1030 <import_user@plt>
jmp    1272 <main+0x102>
xor    %eax,%eax
call   1050 <import_thread@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"test_board\00"
@.str.1 = [13 x i8] c"import_board\00"
@.str.2 = [12 x i8] c"import_user\00"
@.str.3 = [14 x i8] c"import_thread\00"
@.str.4 = [12 x i8] c"delete_user\00"
@stderr = global i32 0
@.str.5 = [41 x i8] c"[usage] <program_name> <option>\0Aoption:\0A\00"
@.str.6 = [51 x i8] c"\09test_board <boardname>: \E6\B5\8B\E8\AF\95\E7\89\88\E9\9D\A2\E4\B8\BB\E9\A2\98\E8\AE\A1\E6\95\B0\0A\00"
@.str.7 = [75 x i8] c"\09import_board: \E5\AF\BC\E5\85\A5\E7\89\88\E9\9D\A2\E4\BF\A1\E6\81\AF\E5\88\B0 t_boards \E8\A1\A8\EF\BC\8C\E5\B9\B6\E5\88\9B\E5\BB\BA\E7\89\88\E9\9D\A2\E8\A7\86\E5\9B\BE\0A\00"
@.str.8 = [100 x i8] c"\09import_user: \E5\AF\BC\E5\85\A5\E7\94\A8\E6\88\B7\E4\BF\A1\E6\81\AF\E5\88\B0 t_users \E8\A1\A8\EF\BC\8C\E5\B9\B6\E5\88\9D\E5\A7\8B\E5\8C\96\E8\AE\A2\E9\98\85\E5\85\83\E4\BF\A1\E6\81\AF\EF\BC\8C\E6\9E\84\E5\BB\BA\E5\AF\B9\E5\BA\94\E8\A7\86\E5\9B\BE\0A\00"
@.str.9 = [143 x i8] c"\09import_thread: \E8\AF\BB\E5\8F\96\E5\90\84\E4\B8\AA\E7\89\88\E9\9D\A2\E7\9A\84\E4\B8\BB\E9\A2\98\E8\B4\B4\EF\BC\8C\E7\BB\9F\E8\AE\A1\E8\AE\A8\E8\AE\BA\E6\95\B0\EF\BC\8C\E5\B9\B6\E6\9C\80\E7\BB\88\E5\90\88\E5\B9\B6\E4\B8\BA\E4\B8\80\E4\B8\AA\E6\8C\89\E6\97\B6\E9\97\B4\E6\8E\92\E5\88\97\E7\9A\84\E5\88\97\E8\A1\A8\E5\AF\BC\E5\85\A5\E5\88\B0 t_threads \E8\A1\A8\E4\B8\AD\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %56
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @count_threads_of_board(i8* %17)
br label %55
19: ; preds = %8
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %19
%26 = call i32 (...) @import_board()
br label %54
27: ; preds = %19
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = call i32 (...) @import_user()
br label %53
35: ; preds = %27
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 1
%38 = load i8*, i8** %37
%39 = call i64 @strcmp(i8* %38, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %35
%42 = call i32 (...) @import_thread()
br label %52
43: ; preds = %35
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call i64 @strcmp(i8* %46, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %51
49: ; preds = %43
%50 = call i32 (...) @delete_user()
br label %51
51: ; preds = %49, %43
br label %52
52: ; preds = %51, %41
br label %53
53: ; preds = %52, %33
br label %54
54: ; preds = %53, %25
br label %55
55: ; preds = %54, %14
br label %67
56: ; preds = %2
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%59 = load i32, i32* @stderr
%60 = call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%61 = load i32, i32* @stderr
%62 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.7, i64 0, i64 0))
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.8, i64 0, i64 0))
%65 = load i32, i32* @stderr
%66 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.9, i64 0, i64 0))
br label %67
67: ; preds = %56, %55
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"test_board\00"
@.str.1 = [13 x i8] c"import_board\00"
@.str.2 = [12 x i8] c"import_user\00"
@.str.3 = [14 x i8] c"import_thread\00"
@.str.4 = [12 x i8] c"delete_user\00"
@stderr = global i32 0
@.str.5 = [41 x i8] c"[usage] <program_name> <option>\0Aoption:\0A\00"
@.str.6 = [51 x i8] c"\09test_board <boardname>: \E6\B5\8B\E8\AF\95\E7\89\88\E9\9D\A2\E4\B8\BB\E9\A2\98\E8\AE\A1\E6\95\B0\0A\00"
@.str.7 = [75 x i8] c"\09import_board: \E5\AF\BC\E5\85\A5\E7\89\88\E9\9D\A2\E4\BF\A1\E6\81\AF\E5\88\B0 t_boards \E8\A1\A8\EF\BC\8C\E5\B9\B6\E5\88\9B\E5\BB\BA\E7\89\88\E9\9D\A2\E8\A7\86\E5\9B\BE\0A\00"
@.str.8 = [100 x i8] c"\09import_user: \E5\AF\BC\E5\85\A5\E7\94\A8\E6\88\B7\E4\BF\A1\E6\81\AF\E5\88\B0 t_users \E8\A1\A8\EF\BC\8C\E5\B9\B6\E5\88\9D\E5\A7\8B\E5\8C\96\E8\AE\A2\E9\98\85\E5\85\83\E4\BF\A1\E6\81\AF\EF\BC\8C\E6\9E\84\E5\BB\BA\E5\AF\B9\E5\BA\94\E8\A7\86\E5\9B\BE\0A\00"
@.str.9 = [143 x i8] c"\09import_thread: \E8\AF\BB\E5\8F\96\E5\90\84\E4\B8\AA\E7\89\88\E9\9D\A2\E7\9A\84\E4\B8\BB\E9\A2\98\E8\B4\B4\EF\BC\8C\E7\BB\9F\E8\AE\A1\E8\AE\A8\E8\AE\BA\E6\95\B0\EF\BC\8C\E5\B9\B6\E6\9C\80\E7\BB\88\E5\90\88\E5\B9\B6\E4\B8\BA\E4\B8\80\E4\B8\AA\E6\8C\89\E6\97\B6\E9\97\B4\E6\8E\92\E5\88\97\E7\9A\84\E5\88\97\E8\A1\A8\E5\AF\BC\E5\85\A5\E5\88\B0 t_threads \E8\A1\A8\E4\B8\AD\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %37
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @count_threads_of_board(i8* %11)
br label %48
13: ; preds = %4
%14 = load i8*, i8** %5
%15 = tail call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = tail call i32 (...) @import_board()
br label %48
19: ; preds = %13
%20 = load i8*, i8** %5
%21 = tail call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = tail call i32 (...) @import_user()
br label %48
25: ; preds = %19
%26 = load i8*, i8** %5
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = tail call i32 (...) @import_thread()
br label %48
31: ; preds = %25
%32 = load i8*, i8** %5
%33 = tail call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %48
35: ; preds = %31
%36 = tail call i32 (...) @delete_user()
br label %48
37: ; preds = %2
%38 = load i32, i32* @stderr
%39 = tail call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%40 = load i32, i32* @stderr
%41 = tail call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%42 = load i32, i32* @stderr
%43 = tail call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.7, i64 0, i64 0))
%44 = load i32, i32* @stderr
%45 = tail call i32 @fprintf(i32 %44, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @.str.8, i64 0, i64 0))
%46 = load i32, i32* @stderr
%47 = tail call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.9, i64 0, i64 0))
br label %48
48: ; preds = %9, %23, %31, %35, %29, %17, %37
ret i32 0
}