// File: /workspace/github_c_makefile_star2_O1/coyove[P]chann/./src/main.cpp
// Function: main
int main(int argc, char *argv[]){
    string conf_path = "./chann.conf";
    log_file = stdout;

    for (int i = 0; i < argc; ++i){
        if((strcmp(argv[i], "--load") == 0 || strcmp(argv[i], "-l") == 0)){
            conf_path = string(argv[++i]);
            continue;
        }      
    }

    configs.global().load(conf_path);
    logLog("Load configuration: %s", conf_path.c_str());

    string db_path = configs.global().get("database"); 

    int rc = unqlite_open(&pDb, db_path.c_str(), UNQLITE_OPEN_CREATE + UNQLITE_OPEN_MMAP);
    if (rc != UNQLITE_OK) database_fatal("Out of memory");
    logLog("Load database: %s", db_path.c_str());

    unqlite_int64 nBytes = 4;
    int dummy = 0;

    if (unqlite_kv_fetch(pDb, "global_counter", -1, &dummy, &nBytes) != UNQLITE_OK) unq_reset(pDb);

    //generate a random admin password
    admin_password  = cc_random_chars(10);
    admin_cookie    = admin_password;
    configs.global().set("security::admin::cookie", admin_password);

    for(auto &x : cc_split(configs.global().get("security::assist::list"), ","))
        assist_cookie[x] = cc_random_chars(10);

    templates.use_lang(configs.global().get("lang"));
    logLog("Load %d templates", templates.load_templates());

    string homepage = configs.global().get<bool>("welcome") ? "/page/1" : "/";
    templates.add_template("site_header").var("SITE_TITLE", configs.global().get("title")).var("HOMEPAGE", homepage);
    templates.add_template("single_thread_header").var("HOMEPAGE", homepage);
    templates.add_template("info_page").var("HOMEPAGE", homepage);
    templates.add_template("site_footer").var("BUILD_DATE", to_string(BUILD_DATE));


    bool use_captcha = configs.global().get<bool>("security::captcha");
    #ifndef GOOGLE_RECAPTCHA
    use_captcha = false;
    #endif

    templates.add_template("post_form").toggle("use_captcha", use_captcha) \
        .var("LANG", configs.global().get("lang")).var("PUBLIC", configs.global().get("security::captcha::public_key"));

    cc_load_file_to_set(configs.global().get("file::ban::ip_based"), IPBanList);
    cc_load_file_to_set(configs.global().get("file::ban::id_based"), IDBanList);
    logLog("Load banlist with %d/%d records", IPBanList.size(), IDBanList.size());    

    server = mg_create_server(NULL, event_handle);
    mg_set_option(server, "listening_port", to_string(configs.global().get<int>("listen")).c_str());
    logLog("Start listening on port %s", mg_get_option(server, "listening_port"));

    fflush(log_file);

    time(&gStartupTime);

    signal(SIGTERM, signal_handle);
    signal(SIGINT, signal_handle);

    route::init();
    route::add("/thread/:no",               route::THREAD);
    route::add("/daerht/:no",               route::DAERHT);
    route::add("/page/:page",               route::TIMELINE);
    route::add("/gallery/:page",            route::GALLERY);
    route::add("/list",                     route::LINEAR);
    route::add("/list/ip/:ip",              route::LINEAR_IP);
    route::add("/list/id/:id",              route::LINEAR_ID);
    route::add("/admin",                    route::ADMIN_PANEL);
    route::add("/del/:no",                  route::SELF_DELETE);
    route::add("/api/:no",                  route::API_THREAD);
    route::add("/images/:path",             route::IMAGE);
    route::add("/success/:cookie/to/:no",   route::SUCCESS);
    route::add("/admin_action",             route::ADMIN_ACTION);
    route::add("/post_thread",              route::POST_THREAD);
    route::add("/post_reply/:no",           route::POST_REPLY);

    #ifdef GOOGLE_RECAPTCHA
    curl_global_init(CURL_GLOBAL_ALL);
    #endif

    while (s_signal_received == 0) {
        mg_poll_server(server, 1000);
    }

    #ifdef GOOGLE_RECAPTCHA
    curl_global_cleanup();
    #endif

    mg_destroy_server(&server);
    unqlite_close(pDb);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x358, %rsp            # imm = 0x358
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xd8(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5d683(%rip), %rsi     # 0x73a29
leaq 0x5d688(%rip), %rdx     # 0x73a35
leaq 0xc8(%rsp), %rdi
callq 0xedfa
movq 0x7fbdf(%rip), %rax     # 0x95fa0
movq (%rax), %rax
movq %rax, 0x808ad(%rip)     # 0x96c78
testl %ebp, %ebp
jle 0x1644e
xorl %r12d, %r12d
leaq 0xa8(%rsp), %r15
movslq %r12d, %r14
movq (%rbx,%r14,8), %r13
movq %r13, %rdi
leaq 0x5d64b(%rip), %rsi     # 0x73a36
callq 0xc950
testl %eax, %eax
je 0x16407
movq %r13, %rdi
leaq 0x5d63f(%rip), %rsi     # 0x73a3d
callq 0xc950
testl %eax, %eax
jne 0x16446
movq 0x8(%rbx,%r14,8), %rsi
movq %r15, %rdi
leaq 0x8(%rsp), %rdx
callq 0xcae0
leaq 0xc8(%rsp), %rdi
movq %r15, %rsi
callq 0xc5e0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x16443
callq 0xc640
incl %r12d
incl %r12d
cmpl %ebp, %r12d
jl 0x163da
leaq 0x806fb(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x340(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0xc8(%rsp), %rsi
movq 0xd0(%rsp), %rdx
addq %rsi, %rdx
leaq 0x330(%rsp), %rdi
callq 0x12396
leaq 0x330(%rsp), %rsi
movq %rbx, %rdi
callq 0x18f86
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
je 0x164ab
callq 0xc640
movq 0xc8(%rsp), %rsi
leaq 0x5d586(%rip), %rdi     # 0x73a40
xorl %eax, %eax
callq 0xfd95
leaq 0x80688(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x5fadc(%rip), %rsi     # 0x75fbc
leaq 0x5fadd(%rip), %rdx     # 0x75fc4
leaq 0x8(%rsp), %rdi
callq 0xedfa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11ee8
leaq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rcx
movq %rcx, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x12396
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1652f
callq 0xc640
movq 0xa8(%rsp), %rsi
leaq 0x806ba(%rip), %rdi     # 0x96bf8
movl $0x104, %edx            # imm = 0x104
callq 0x2e0cc
testl %eax, %eax
je 0x16558
leaq 0x5d504(%rip), %rdi     # 0x73a57
callq 0xfe9b
movq 0xa8(%rsp), %rsi
leaq 0x5d4fe(%rip), %rdi     # 0x73a65
xorl %eax, %eax
callq 0xfd95
leaq 0x350(%rsp), %r8
movq $0x4, (%r8)
leaq 0xec(%rsp), %rcx
movl $0x0, (%rcx)
movq 0x80666(%rip), %rdi     # 0x96bf8
leaq 0x5ca99(%rip), %rsi     # 0x73032
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x32133
testl %eax, %eax
je 0x165b3
movq 0x8064a(%rip), %rdi     # 0x96bf8
callq 0xe01c
leaq 0x8(%rsp), %rdi
movl $0xa, %esi
callq 0xfbf1
leaq 0x8063f(%rip), %rdi     # 0x96c08
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0xc5e0
movq (%rbx), %rdi
cmpq %rbp, %rdi
je 0x165e3
callq 0xc640
leaq 0x8063e(%rip), %rdi     # 0x96c28
leaq 0x80617(%rip), %rsi     # 0x96c08
callq 0xcc40
leaq 0x80553(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x5d463(%rip), %rsi     # 0x73a77
leaq 0x5d473(%rip), %rdx     # 0x73a8e
callq 0xedfa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11ee8
leaq 0x805d4(%rip), %rsi     # 0x96c08
movq %rax, %rdi
callq 0xcc40
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1664b
callq 0xc640
leaq 0x804fe(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x5d426(%rip), %rsi     # 0x73a8f
leaq 0x5d435(%rip), %rdx     # 0x73aa5
callq 0xedfa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11ee8
movq %rax, %rbx
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x5d2ba(%rip), %rsi     # 0x7394f
leaq 0x5d2b4(%rip), %rdx     # 0x73950
leaq 0x48(%rsp), %rdi
callq 0xedfa
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %rbx, %rsi
callq 0xf87f
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x166c7
callq 0xc640
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x166d6
callq 0xc640
movq 0x28(%rsp), %rbx
movq 0x30(%rsp), %r12
cmpq %r12, %rbx
je 0x1672c
leaq 0x8(%rsp), %r14
leaq 0x80557(%rip), %r15     # 0x96c48
movq %r14, %rdi
movl $0xa, %esi
callq 0xfbf1
movq %r15, %rdi
movq %rbx, %rsi
callq 0x183b2
movq %rax, %rdi
movq %r14, %rsi
callq 0xc5e0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16723
callq 0xc640
addq $0x20, %rbx
cmpq %r12, %rbx
jne 0x166f1
leaq 0x28(%rsp), %rdi
callq 0x11c3c
leaq 0x80413(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x5d352(%rip), %rsi     # 0x73aa6
leaq 0x5d34f(%rip), %rdx     # 0x73aaa
callq 0xedfa
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11ee8
leaq 0x320(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x310(%rsp), %rdi
callq 0x12396
leaq 0x805c1(%rip), %rdi     # 0x96d58
leaq 0x310(%rsp), %rsi
callq 0xcc40
movq 0x310(%rsp), %rdi
cmpq %r14, %rdi
je 0x167b6
callq 0xc640
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x167c5
callq 0xc640
leaq 0x8055c(%rip), %rdi     # 0x96d28
callq 0x1964a
leaq 0x5d2d3(%rip), %rdi     # 0x73aab
movl %eax, %esi
xorl %eax, %eax
callq 0xfd95
leaq 0x80368(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5d58c(%rip), %rsi     # 0x73d8b
leaq 0x5d58c(%rip), %rdx     # 0x73d92
callq 0xedfa
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x18460
leaq 0x5d29e(%rip), %rcx     # 0x73abd
leaq 0x64d86(%rip), %rsi     # 0x7b5ac
testb %al, %al
cmovneq %rcx, %rsi
leaq 0x1(%rsi), %rdx
leaq 0x7(%rsi), %rcx
testb %al, %al
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
cmovneq %rcx, %rdx
callq 0xedfa
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16856
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5d138(%rip), %rsi     # 0x7399d
leaq 0x5d13c(%rip), %rdx     # 0x739a8
callq 0xedfa
leaq 0x804b0(%rip), %rdi     # 0x96d28
leaq 0x48(%rsp), %rsi
callq 0x199ca
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5d230(%rip), %rsi     # 0x73ac5
leaq 0x5d233(%rip), %rdx     # 0x73acf
leaq 0x28(%rsp), %rdi
callq 0xedfa
leaq 0x802a3(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %r14
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x5d20a(%rip), %rsi     # 0x73ad0
leaq 0x5d208(%rip), %rdx     # 0x73ad5
leaq 0x68(%rsp), %rdi
callq 0xedfa
leaq 0x68(%rsp), %rsi
movq %r14, %rdi
callq 0x11ee8
movq %rax, %r14
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x183b2
movq %rax, %rdi
movq %r14, %rsi
callq 0xcc40
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5d1bd(%rip), %rsi     # 0x73ad6
leaq 0x5d1be(%rip), %rdx     # 0x73ade
leaq 0x88(%rsp), %rdi
callq 0xedfa
leaq 0x88(%rsp), %rsi
movq %rbx, %rdi
callq 0x183b2
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x16964
callq 0xc640
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16973
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16987
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16996
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5d13a(%rip), %rsi     # 0x73adf
leaq 0x5d147(%rip), %rdx     # 0x73af3
callq 0xedfa
leaq 0x80370(%rip), %rdi     # 0x96d28
leaq 0x48(%rsp), %rsi
callq 0x199ca
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5d0fd(%rip), %rsi     # 0x73ad6
leaq 0x5d0fe(%rip), %rdx     # 0x73ade
callq 0xedfa
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x183b2
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16a1a
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16a29
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5d0bc(%rip), %rsi     # 0x73af4
leaq 0x5d0be(%rip), %rdx     # 0x73afd
callq 0xedfa
leaq 0x802dd(%rip), %rdi     # 0x96d28
leaq 0x48(%rsp), %rsi
callq 0x199ca
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5d06a(%rip), %rsi     # 0x73ad6
leaq 0x5d06b(%rip), %rdx     # 0x73ade
callq 0xedfa
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x183b2
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16aad
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16abc
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5cf52(%rip), %rsi     # 0x73a1d
leaq 0x5cf56(%rip), %rdx     # 0x73a28
callq 0xedfa
leaq 0x8024a(%rip), %rdi     # 0x96d28
leaq 0x48(%rsp), %rsi
callq 0x199ca
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5cfff(%rip), %rsi     # 0x73afe
leaq 0x5d002(%rip), %rdx     # 0x73b08
callq 0xedfa
leaq 0x68(%rsp), %rdi
movq %r12, (%rdi)
movl $0xc, %esi
xorl %edx, %edx
callq 0xc6d0
movq 0x68(%rsp), %rdi
movl 0x70(%rsp), %esi
movabsq $0x3a659eb893, %rdx     # imm = 0x3A659EB893
callq 0x226e3
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x183b2
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16b67
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16b7b
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16b8a
callq 0xc640
leaq 0x7ffbf(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5cf61(%rip), %rsi     # 0x73b09
leaq 0x5cf6b(%rip), %rdx     # 0x73b1a
callq 0xedfa
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x18460
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16bd0
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5cf3c(%rip), %rsi     # 0x73b1b
leaq 0x5cf3e(%rip), %rdx     # 0x73b24
callq 0xedfa
leaq 0x80136(%rip), %rdi     # 0x96d28
leaq 0x48(%rsp), %rsi
callq 0x199ca
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5cf12(%rip), %rsi     # 0x73b25
leaq 0x5cf16(%rip), %rdx     # 0x73b30
callq 0xedfa
leaq 0x1c8(%rbx), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1c82a
movb $0x0, (%rax)
leaq 0x68(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x5ceef(%rip), %rsi     # 0x73b31
leaq 0x5ceec(%rip), %rdx     # 0x73b35
callq 0xedfa
leaq 0x7fefb(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %r14
leaq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5ce2f(%rip), %rsi     # 0x73aa6
leaq 0x5ce2c(%rip), %rdx     # 0x73aaa
callq 0xedfa
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x11ee8
movq %rax, %r14
addq $0x198, %rbx            # imm = 0x198
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x183b2
movq %rax, %rdi
movq %r14, %rsi
callq 0xcc40
leaq 0x300(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x5ce6e(%rip), %rsi     # 0x73b36
leaq 0x5ce6d(%rip), %rdx     # 0x73b3c
leaq 0x2f0(%rsp), %rdi
callq 0xedfa
leaq 0x7fe6d(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %r14
leaq 0x2e0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5ce3f(%rip), %rsi     # 0x73b3d
leaq 0x5ce55(%rip), %rdx     # 0x73b5a
leaq 0x2d0(%rsp), %rdi
callq 0xedfa
leaq 0x2d0(%rsp), %rsi
movq %r14, %rdi
callq 0x11ee8
movq %rax, %r14
leaq 0x2f0(%rsp), %rsi
movq %rbx, %rdi
callq 0x183b2
movq %rax, %rdi
movq %r14, %rsi
callq 0xcc40
movq 0x2d0(%rsp), %rdi
cmpq %r15, %rdi
je 0x16d52
callq 0xc640
movq 0x2f0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16d64
callq 0xc640
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r15
je 0x16d83
callq 0xc640
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16d92
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16da6
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16db5
callq 0xc640
leaq 0x7fd94(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5cb25(%rip), %rsi     # 0x738f8
leaq 0x5cb31(%rip), %rdx     # 0x7390b
callq 0xedfa
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x11ee8
leaq 0x7fec5(%rip), %rsi     # 0x96cb8
movq %rax, %rdi
callq 0x11a56
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16e0a
callq 0xc640
leaq 0x7fd3f(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5cae4(%rip), %rsi     # 0x7390c
leaq 0x5caf0(%rip), %rdx     # 0x7391f
callq 0xedfa
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x11ee8
leaq 0x7fe38(%rip), %rsi     # 0x96c80
movq %rax, %rdi
callq 0x11a56
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16e5f
callq 0xc640
movq 0x7fe6a(%rip), %rsi     # 0x96cd0
movq 0x7fe2b(%rip), %rdx     # 0x96c98
leaq 0x5cce7(%rip), %rdi     # 0x73b5b
xorl %eax, %eax
callq 0xfd95
leaq 0xabf(%rip), %rsi       # 0x17941
xorl %edi, %edi
callq 0x6db98
movq %rax, %rbx
movq %rax, 0x7fe8d(%rip)     # 0x96d20
leaq 0x7fcb6(%rip), %rdi     # 0x96b50
callq 0x11bfe
movq %rax, %r14
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5ccd4(%rip), %rsi     # 0x73b8a
leaq 0x5ccd3(%rip), %rdx     # 0x73b90
callq 0xedfa
addq $0x38, %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x12426
movl (%rax), %r14d
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x16f33
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x16f2a
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x16f30
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x16f33
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x16ef7
addl $-0x3, %r15d
jmp 0x16f33
addl $-0x2, %r15d
jmp 0x16f33
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
movl $0x2d, %edx
callq 0xc6d0
addq 0x48(%rsp), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x12329
movq 0x48(%rsp), %rdx
leaq 0x5cc10(%rip), %rsi     # 0x73b7b
movq %rbx, %rdi
callq 0x6d5e9
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
leaq 0x18(%rsp), %r15
je 0x16f87
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16f9b
callq 0xc640
movq 0x7fd7e(%rip), %rdi     # 0x96d20
leaq 0x5cbd2(%rip), %rsi     # 0x73b7b
callq 0x6db62
leaq 0x5cbdc(%rip), %rdi     # 0x73b91
movq %rax, %rsi
xorl %eax, %eax
callq 0xfd95
movq 0x7fcb2(%rip), %rdi     # 0x96c78
callq 0xc5b0
leaq 0x7fc2e(%rip), %rdi     # 0x96c00
callq 0xc820
leaq 0x1341(%rip), %rbx      # 0x1831f
movl $0xf, %edi
movq %rbx, %rsi
callq 0xc3f0
movl $0x2, %edi
movq %rbx, %rsi
callq 0xc3f0
movl $0x58, %edi
callq 0xc1d0
leaq 0x8(%rax), %rcx
xorps %xmm0, %xmm0
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, (%rax)
xorl %edx, %edx
movq %rdx, 0x50(%rax)
movq %rax, %rsi
addq $0x40, %rsi
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rdx, 0x28(%rax)
movq %rsi, 0x30(%rax)
movq %rdx, 0x38(%rax)
movb $0x0, 0x40(%rax)
movq %rax, 0x7fb00(%rip)     # 0x96b48
leaq 0x2c0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5cb51(%rip), %rsi     # 0x73bac
leaq 0x5cb55(%rip), %rdx     # 0x73bb7
leaq 0x2b0(%rsp), %rdi
callq 0xedfa
leaq 0x2b0(%rsp), %rdi
movl $0x1, %esi
callq 0x12ec0
movq 0x2b0(%rsp), %rdi
cmpq %r14, %rdi
je 0x17093
callq 0xc640
leaq 0x2a0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5cb12(%rip), %rsi     # 0x73bb8
leaq 0x5cb16(%rip), %rdx     # 0x73bc3
leaq 0x290(%rsp), %rdi
callq 0xedfa
leaq 0x290(%rsp), %rdi
movl $0x2, %esi
callq 0x12ec0
movq 0x290(%rsp), %rdi
cmpq %r14, %rdi
je 0x170de
callq 0xc640
leaq 0x280(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5cad3(%rip), %rsi     # 0x73bc4
leaq 0x5cad7(%rip), %rdx     # 0x73bcf
leaq 0x270(%rsp), %rdi
callq 0xedfa
leaq 0x270(%rsp), %rdi
movl $0x64, %esi
callq 0x12ec0
movq 0x270(%rsp), %rdi
cmpq %r14, %rdi
je 0x17129
callq 0xc640
leaq 0x260(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ca94(%rip), %rsi     # 0x73bd0
leaq 0x5ca9b(%rip), %rdx     # 0x73bde
leaq 0x250(%rsp), %rdi
callq 0xedfa
leaq 0x250(%rsp), %rdi
movl $0x65, %esi
callq 0x12ec0
movq 0x250(%rsp), %rdi
cmpq %r14, %rdi
je 0x17174
callq 0xc640
leaq 0x240(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ca58(%rip), %rsi     # 0x73bdf
leaq 0x5ca56(%rip), %rdx     # 0x73be4
leaq 0x230(%rsp), %rdi
callq 0xedfa
leaq 0x230(%rsp), %rdi
movl $0x66, %esi
callq 0x12ec0
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x171bf
callq 0xc640
leaq 0x220(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ca13(%rip), %rsi     # 0x73be5
leaq 0x5ca18(%rip), %rdx     # 0x73bf1
leaq 0x210(%rsp), %rdi
callq 0xedfa
leaq 0x210(%rsp), %rdi
movl $0x67, %esi
callq 0x12ec0
movq 0x210(%rsp), %rdi
cmpq %r14, %rdi
je 0x1720a
callq 0xc640
leaq 0x200(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c9d5(%rip), %rsi     # 0x73bf2
leaq 0x5c9da(%rip), %rdx     # 0x73bfe
leaq 0x1f0(%rsp), %rdi
callq 0xedfa
leaq 0x1f0(%rsp), %rdi
movl $0x68, %esi
callq 0x12ec0
movq 0x1f0(%rsp), %rdi
cmpq %r14, %rdi
je 0x17255
callq 0xc640
leaq 0x1e0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c997(%rip), %rsi     # 0x73bff
leaq 0x5c996(%rip), %rdx     # 0x73c05
leaq 0x1d0(%rsp), %rdi
callq 0xedfa
leaq 0x1d0(%rsp), %rdi
movl $0xc8, %esi
callq 0x12ec0
movq 0x1d0(%rsp), %rdi
cmpq %r14, %rdi
je 0x172a0
callq 0xc640
leaq 0x1c0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c953(%rip), %rsi     # 0x73c06
leaq 0x5c954(%rip), %rdx     # 0x73c0e
leaq 0x1b0(%rsp), %rdi
callq 0xedfa
leaq 0x1b0(%rsp), %rdi
movl $0x1f5, %esi            # imm = 0x1F5
callq 0x12ec0
movq 0x1b0(%rsp), %rdi
cmpq %r14, %rdi
je 0x172eb
callq 0xc640
leaq 0x1a0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c911(%rip), %rsi     # 0x73c0f
leaq 0x5c912(%rip), %rdx     # 0x73c17
leaq 0x190(%rsp), %rdi
callq 0xedfa
leaq 0x190(%rsp), %rdi
movl $0x1f6, %esi            # imm = 0x1F6
callq 0x12ec0
movq 0x190(%rsp), %rdi
cmpq %r14, %rdi
je 0x17336
callq 0xc640
leaq 0x180(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c8cf(%rip), %rsi     # 0x73c18
leaq 0x5c8d5(%rip), %rdx     # 0x73c25
leaq 0x170(%rsp), %rdi
callq 0xedfa
leaq 0x170(%rsp), %rdi
movl $0x3, %esi
callq 0x12ec0
movq 0x170(%rsp), %rdi
cmpq %r14, %rdi
je 0x17381
callq 0xc640
leaq 0x160(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c892(%rip), %rsi     # 0x73c26
leaq 0x5c8a2(%rip), %rdx     # 0x73c3d
leaq 0x150(%rsp), %rdi
callq 0xedfa
leaq 0x150(%rsp), %rdi
movl $0x4, %esi
callq 0x12ec0
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0x173cc
callq 0xc640
leaq 0x140(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c85f(%rip), %rsi     # 0x73c3e
leaq 0x5c865(%rip), %rdx     # 0x73c4b
leaq 0x130(%rsp), %rdi
callq 0xedfa
leaq 0x130(%rsp), %rdi
movl $0x1f7, %esi            # imm = 0x1F7
callq 0x12ec0
movq 0x130(%rsp), %rdi
cmpq %r14, %rdi
je 0x17417
callq 0xc640
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c822(%rip), %rsi     # 0x73c4c
leaq 0x5c827(%rip), %rdx     # 0x73c58
leaq 0x110(%rsp), %rdi
callq 0xedfa
leaq 0x110(%rsp), %rdi
movl $0x1f8, %esi            # imm = 0x1F8
callq 0x12ec0
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x17462
callq 0xc640
leaq 0x100(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5c7e4(%rip), %rsi     # 0x73c59
leaq 0x5c7ec(%rip), %rdx     # 0x73c68
leaq 0xf0(%rsp), %rdi
callq 0xedfa
leaq 0xf0(%rsp), %rdi
movl $0x1f9, %esi            # imm = 0x1F9
callq 0x12ec0
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x174ad
callq 0xc640
cmpl $0x0, 0x7f8c4(%rip)     # 0x96d78
jne 0x174c9
movq 0x7f863(%rip), %rdi     # 0x96d20
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x6cfff
jmp 0x174ad
leaq 0x7f850(%rip), %rdi     # 0x96d20
callq 0x6d009
movq 0x7f71c(%rip), %rdi     # 0x96bf8
callq 0x2eef7
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x174f0
callq 0xc640
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1750a
callq 0xc640
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x17524
callq 0xc640
xorl %eax, %eax
addq $0x358, %rsp            # imm = 0x358
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x110(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x130(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x150(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x170(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x190(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x1d0(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x1f0(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x210(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x230(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x250(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x270(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x290(%rsp), %rdi
jmp 0x17654
jmp 0x178f3
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
cmpq %r14, %rdi
jne 0x1787e
jmp 0x17883
jmp 0x178f3
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1777c
callq 0xc640
jmp 0x1777c
jmp 0x176b1
jmp 0x176b1
jmp 0x176b1
movq %rax, %rbx
jmp 0x17820
jmp 0x17834
movq %rax, %rbx
jmp 0x17851
jmp 0x1769f
movq %rax, %rbx
jmp 0x17860
jmp 0x17796
jmp 0x17796
movq %rax, %rbx
jmp 0x17883
jmp 0x176e0
jmp 0x176e8
jmp 0x177a5
jmp 0x176e0
jmp 0x176e0
jmp 0x176e8
jmp 0x176e0
jmp 0x176e0
jmp 0x176e8
jmp 0x176e0
jmp 0x176e0
jmp 0x176e8
jmp 0x1788a
jmp 0x177a5
jmp 0x176e0
movq %rax, %rbx
jmp 0x178b0
movq %rax, %rbx
jmp 0x178bf
jmp 0x176f2
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
jne 0x17900
jmp 0x17905
jmp 0x178c4
movq %rax, %rbx
movq 0x310(%rsp), %rdi
cmpq %r14, %rdi
jne 0x17738
jmp 0x177d8
jmp 0x178c4
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x177d8
callq 0xc640
jmp 0x177d8
jmp 0x177d5
jmp 0x177d5
jmp 0x178c4
jmp 0x178c4
jmp 0x178c4
jmp 0x178cb
movq %rax, %rbx
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
jne 0x1791a
jmp 0x1791f
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
jne 0x1787e
jmp 0x17883
jmp 0x17796
movq %rax, %rbx
jmp 0x17874
jmp 0x1788a
jmp 0x177a5
movq %rax, %rbx
jmp 0x1789c
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1788d
callq 0xc640
jmp 0x1788d
jmp 0x177d5
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x17900
jmp 0x17905
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x1791a
jmp 0x1791f
jmp 0x178cb
jmp 0x178c4
movq %rax, %rbx
movq 0x2d0(%rsp), %rdi
cmpq %r15, %rdi
je 0x17820
callq 0xc640
movq 0x2f0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x17837
callq 0xc640
jmp 0x17837
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x17851
callq 0xc640
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x17860
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x17874
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x17883
callq 0xc640
leaq 0x18(%rsp), %r15
jmp 0x178f6
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x1789c
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x178b0
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x178bf
callq 0xc640
movq %rbp, %r15
jmp 0x178f6
movq %rax, %rbx
jmp 0x17905
jmp 0x178f3
movq %rax, %rbx
jmp 0x1791f
movq %rax, %rbx
jmp 0x178e7
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x178e7
callq 0xc640
leaq 0x28(%rsp), %rdi
callq 0x11c3c
jmp 0x17905
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x17905
callq 0xc640
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1791f
callq 0xc640
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x17939
callq 0xc640
movq %rbx, %rdi
callq 0xc760