// File: 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
movq %rsp, %rbp
subq $0x1d8f0, %rsp          # imm = 0x1D8F0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x1d8a0(%rbp)
callq 0x3720
movq -0x1d8a0(%rbp), %rdx
leaq 0xa8fd(%rip), %rsi      # 0xe464
leaq -0x30(%rbp), %rdi
callq 0x3ea0
jmp 0x3b72
leaq -0x31(%rbp), %rdi
callq 0x34a0
leaq -0x69(%rbp), %rdi
movq %rdi, -0x1d8a8(%rbp)
callq 0x3720
movq -0x1d8a8(%rbp), %rdx
leaq 0xa46b(%rip), %rsi      # 0xe004
leaq -0x68(%rbp), %rdi
callq 0x3ea0
jmp 0x3ba4
leaq -0x69(%rbp), %rdi
callq 0x34a0
leaq -0x91(%rbp), %rdi
movq %rdi, -0x1d8b0(%rbp)
callq 0x3720
movq -0x1d8b0(%rbp), %rdx
leaq 0xa43d(%rip), %rsi      # 0xe00b
leaq -0x90(%rbp), %rdi
callq 0x3ea0
jmp 0x3bdc
leaq -0x91(%rbp), %rdi
callq 0x34a0
leaq -0xbc(%rbp), %rdi
callq 0xd6d0
jmp 0x3bf6
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0xbc(%rbp), %rdi
callq 0xd730
jmp 0x3c0b
leaq -0x1d838(%rbp), %rdi
callq 0xaee0
jmp 0x3c19
movl -0xbc(%rbp), %eax
movl %eax, -0x1d8b4(%rbp)
leaq -0x1d858(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x31a0
jmp 0x3c37
leaq -0x1d878(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x31a0
jmp 0x3c49
leaq -0x1d898(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x31a0
jmp 0x3c5e
movl -0x1d8b4(%rbp), %esi
movl -0xa8(%rbp), %ecx
movl -0xb8(%rbp), %r9d
movl -0xb4(%rbp), %edx
movl -0xa4(%rbp), %edi
movl -0xa0(%rbp), %r8d
movl -0x9c(%rbp), %r10d
movl -0x98(%rbp), %r11d
movq %rsp, %rax
movl %r11d, 0x28(%rax)
movl %r10d, 0x20(%rax)
movl %r8d, 0x18(%rax)
movl %edi, 0x10(%rax)
movl %edx, 0x8(%rax)
movl %ecx, (%rax)
leaq -0x1d838(%rbp), %rdi
leaq -0x1d858(%rbp), %rdx
leaq -0x1d878(%rbp), %rcx
leaq -0x1d898(%rbp), %r8
callq 0xb2d0
jmp 0x3ccc
leaq -0x1d898(%rbp), %rdi
callq 0x32c0
leaq -0x1d878(%rbp), %rdi
callq 0x32c0
leaq -0x1d858(%rbp), %rdi
callq 0x32c0
leaq -0x1d838(%rbp), %rdi
callq 0xb450
jmp 0x3cfe
leaq -0x1d838(%rbp), %rdi
callq 0xb4e0
jmp 0x3d0c
leaq -0x1d838(%rbp), %rdi
callq 0xb690
jmp 0x3d1a
leaq -0x1d838(%rbp), %rdi
callq 0xb390
jmp 0x3d28
leaq -0x1d838(%rbp), %rdi
callq 0xb710
jmp 0x3d36
leaq -0x1d838(%rbp), %rdi
callq 0xc4e0
jmp 0x3d44
movl $0x0, -0x4(%rbp)
leaq -0x1d838(%rbp), %rdi
callq 0xb170
leaq -0xbc(%rbp), %rdi
callq 0x3f50
leaq -0x90(%rbp), %rdi
callq 0x32c0
leaq -0x68(%rbp), %rdi
callq 0x32c0
leaq -0x30(%rbp), %rdi
callq 0x32c0
movl -0x4(%rbp), %eax
addq $0x1d8f0, %rsp          # imm = 0x1D8F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x34a0
jmp 0x3e8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x34a0
jmp 0x3e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x91(%rbp), %rdi
callq 0x34a0
jmp 0x3e7b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e63
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e4b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x3e3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1d898(%rbp), %rdi
callq 0x32c0
leaq -0x1d878(%rbp), %rdi
callq 0x32c0
leaq -0x1d858(%rbp), %rdi
callq 0x32c0
leaq -0x1d838(%rbp), %rdi
callq 0xb170
leaq -0xbc(%rbp), %rdi
callq 0x3f50
leaq -0x90(%rbp), %rdi
callq 0x32c0
leaq -0x68(%rbp), %rdi
callq 0x32c0
leaq -0x30(%rbp), %rdi
callq 0x32c0
movq -0x40(%rbp), %rdi
callq 0x3710
nopw %cs:(%rax,%rax)