// File: /workspace/github_cpp_makefile_star2_O1/JianjiaoSQ[P]MyPoorWebServer/main.cpp
// Function: main
int main(int argc, char *argv[])
{
    //需要修改的数据库信息,登录名,密码,库名
    string user = "root";
    string passwd = "123456";
    string databasename = "yourdb";

    //命令行解析
    Config config;
    config.parse_arg(argc, argv);
    // 在实例化时 已运行构造函数
    WebServer server; // WebServer类进行封装，直接调用api接口

    //初始化
    server.init(config.PORT, user, passwd, databasename, config.LOGWrite, 
                config.OPT_LINGER, config.TRIGMode,  config.sql_num,  config.thread_num, 
                config.close_log, config.actor_model);
    //日志
    server.log_write();

    //数据库
    server.sql_pool();

    //线程池
    server.thread_pool();

    //触发模式
    server.trig_mode();

    //监听
    server.eventListen();

    //运行
    server.eventLoop();

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d868, %rsp          # imm = 0x1D868
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x58(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5b02(%rip), %rsi      # 0x9484
leaq 0x5aff(%rip), %rdx      # 0x9488
leaq 0x48(%rsp), %rdi
callq 0x3d6c
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5661(%rip), %rsi      # 0x9004
leaq 0x5660(%rip), %rdx      # 0x900a
leaq 0x28(%rsp), %rdi
callq 0x3d6c
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5647(%rip), %rsi      # 0x900b
leaq 0x5646(%rip), %rdx      # 0x9011
leaq 0x8(%rsp), %rdi
callq 0x3d6c
leaq 0x88(%rsp), %rdi
callq 0x8654
leaq 0x88(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x8672
leaq 0xf0(%rsp), %rdi
callq 0x7158
movl 0x88(%rsp), %ebx
leaq 0x78(%rsp), %rax
movq %rax, -0x10(%rax)
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
addq %rsi, %rdx
leaq 0x68(%rsp), %rdi
callq 0x3cdc
leaq 0xe0(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd0(%rsp), %rdi
callq 0x3cdc
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb0(%rsp), %rdi
callq 0x3cdc
movl 0x9c(%rsp), %eax
movl 0x8c(%rsp), %r9d
movl 0x90(%rsp), %r10d
movl 0xa0(%rsp), %r11d
movl 0xa4(%rsp), %r15d
movl 0xa8(%rsp), %r12d
movl 0xac(%rsp), %r13d
leaq 0xf0(%rsp), %rdi
leaq 0x68(%rsp), %rdx
leaq 0xd0(%rsp), %rcx
leaq 0xb0(%rsp), %r8
movl %ebx, %esi
pushq %r13
pushq %r12
pushq %r15
pushq %r11
pushq %r10
pushq %rax
callq 0x73f6
addq $0x30, %rsp
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3afb
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
leaq 0x78(%rsp), %rbx
je 0x3b1d
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x68(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3b34
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x33a0
leaq 0xf0(%rsp), %rdi
callq 0x74b2
leaq 0xf0(%rsp), %rdi
callq 0x74fa
leaq 0xf0(%rsp), %rdi
callq 0x76be
leaq 0xf0(%rsp), %rdi
callq 0x7484
leaq 0xf0(%rsp), %rdi
callq 0x7716
leaq 0xf0(%rsp), %rdi
callq 0x806a
leaq 0xf0(%rsp), %rdi
callq 0x72da
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3bab
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3bc7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3be3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x33a0
xorl %eax, %eax
addq $0x1d868, %rsp          # imm = 0x1D868
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3c1c
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x3c1c
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x3c3e
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x3c3e
movq %rax, %rbx
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
je 0x3c72
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x33a0
jmp 0x3c72
jmp 0x3c60
jmp 0x3c60
movq %rax, %rbx
jmp 0x3c7f
movq %rax, %rbx
jmp 0x3c9b
movq %rax, %rbx
jmp 0x3cb7
movq %rax, %rbx
leaq 0xf0(%rsp), %rdi
callq 0x72da
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x3c9b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x3cb7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x33a0
movq 0x48(%rsp), %rdi
leaq 0x58(%rsp), %rax
cmpq %rax, %rdi
je 0x3cd3
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x33a0
movq %rbx, %rdi
callq 0x35e0
nop