// File: /workspace/github_c_makefile_star2_O3/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 0x5b982(%rip), %rsi     # 0x71a29
leaq 0x5b987(%rip), %rdx     # 0x71a35
leaq 0xc8(%rsp), %rdi
callq 0xedf0
movq 0x7dede(%rip), %rax     # 0x93fa0
movq (%rax), %rax
movq %rax, 0x7ebac(%rip)     # 0x94c78
testl %ebp, %ebp
jle 0x16157
xorl %r13d, %r13d
leaq 0xa8(%rsp), %r14
movslq %r13d, %r15
movq (%rbx,%r15,8), %r12
movq %r12, %rdi
leaq 0x5b946(%rip), %rsi     # 0x71a36
callq 0xc950
testl %eax, %eax
je 0x16110
cmpb $0x2d, (%r12)
jne 0x1614f
cmpb $0x6c, 0x1(%r12)
jne 0x1614f
cmpb $0x0, 0x2(%r12)
jne 0x1614f
movq 0x8(%rbx,%r15,8), %rsi
movq %r14, %rdi
leaq 0x8(%rsp), %rdx
callq 0xcae0
leaq 0xc8(%rsp), %rdi
movq %r14, %rsi
callq 0xc5e0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1614c
callq 0xc640
incl %r13d
incl %r13d
cmpl %ebp, %r13d
jl 0x160df
leaq 0x7e9f2(%rip), %rdi     # 0x94b50
callq 0x11bec
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 0x12380
leaq 0x330(%rsp), %rsi
movq %rbx, %rdi
callq 0x18c12
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
je 0x161b4
callq 0xc640
movq 0xc8(%rsp), %rsi
leaq 0x5b87a(%rip), %rdi     # 0x71a3d
xorl %eax, %eax
callq 0xfd7f
leaq 0x7e97f(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x5dddb(%rip), %rsi     # 0x73fc4
leaq 0x5dddc(%rip), %rdx     # 0x73fcc
leaq 0x8(%rsp), %rdi
callq 0xedf0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11edc
leaq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rcx
movq %rcx, (%rdi)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
callq 0x12380
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16238
callq 0xc640
movq 0xa8(%rsp), %rsi
leaq 0x7e9b1(%rip), %rdi     # 0x94bf8
movl $0x104, %edx            # imm = 0x104
callq 0x2dbf7
testl %eax, %eax
je 0x16261
leaq 0x5b7f8(%rip), %rdi     # 0x71a54
callq 0xfe85
movq 0xa8(%rsp), %rsi
leaq 0x5b7f2(%rip), %rdi     # 0x71a62
xorl %eax, %eax
callq 0xfd7f
leaq 0x350(%rsp), %r8
movq $0x4, (%r8)
leaq 0xec(%rsp), %rcx
movl $0x0, (%rcx)
movq 0x7e95d(%rip), %rdi     # 0x94bf8
leaq 0x5ad90(%rip), %rsi     # 0x71032
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x31b4f
testl %eax, %eax
je 0x162bc
movq 0x7e941(%rip), %rdi     # 0x94bf8
callq 0xe01c
leaq 0x8(%rsp), %rdi
movl $0xa, %esi
callq 0xfbdb
leaq 0x7e936(%rip), %rdi     # 0x94c08
leaq 0x8(%rsp), %rbx
movq %rbx, %rsi
callq 0xc5e0
movq (%rbx), %rdi
cmpq %rbp, %rdi
je 0x162ec
callq 0xc640
leaq 0x7e935(%rip), %rdi     # 0x94c28
leaq 0x7e90e(%rip), %rsi     # 0x94c08
callq 0xcc40
leaq 0x7e84a(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x5b757(%rip), %rsi     # 0x71a74
leaq 0x5b767(%rip), %rdx     # 0x71a8b
callq 0xedf0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11edc
leaq 0x7e8cb(%rip), %rsi     # 0x94c08
movq %rax, %rdi
callq 0xcc40
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16354
callq 0xc640
leaq 0x7e7f5(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x5b71a(%rip), %rsi     # 0x71a8c
leaq 0x5b729(%rip), %rdx     # 0x71aa2
callq 0xedf0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11edc
movq %rax, %rbx
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x5b5b1(%rip), %rsi     # 0x7194f
leaq 0x5b5ab(%rip), %rdx     # 0x71950
leaq 0x48(%rsp), %rdi
callq 0xedf0
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
movq %rbx, %rsi
callq 0xf87c
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x163d0
callq 0xc640
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x163df
callq 0xc640
movq 0x28(%rsp), %rbx
movq 0x30(%rsp), %r12
cmpq %r12, %rbx
je 0x16435
leaq 0x8(%rsp), %r14
leaq 0x7e84e(%rip), %r15     # 0x94c48
movq %r14, %rdi
movl $0xa, %esi
callq 0xfbdb
movq %r15, %rdi
movq %rbx, %rsi
callq 0x18044
movq %rax, %rdi
movq %r14, %rsi
callq 0xc5e0
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1642c
callq 0xc640
addq $0x20, %rbx
cmpq %r12, %rbx
jne 0x163fa
leaq 0x28(%rsp), %rdi
callq 0x11c2a
leaq 0x7e70a(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x5b646(%rip), %rsi     # 0x71aa3
leaq 0x5b643(%rip), %rdx     # 0x71aa7
callq 0xedf0
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x11edc
leaq 0x320(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x310(%rsp), %rdi
callq 0x12380
leaq 0x7e8b8(%rip), %rdi     # 0x94d58
leaq 0x310(%rsp), %rsi
callq 0xcc40
movq 0x310(%rsp), %rdi
cmpq %r14, %rdi
je 0x164bf
callq 0xc640
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x164ce
callq 0xc640
leaq 0x7e853(%rip), %rdi     # 0x94d28
callq 0x192d0
leaq 0x5b5c7(%rip), %rdi     # 0x71aa8
movl %eax, %esi
xorl %eax, %eax
callq 0xfd7f
leaq 0x7e65f(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5b87d(%rip), %rsi     # 0x71d85
leaq 0x5b87d(%rip), %rdx     # 0x71d8c
callq 0xedf0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x180f2
leaq 0x5b592(%rip), %rcx     # 0x71aba
leaq 0x6307d(%rip), %rsi     # 0x795ac
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 0xedf0
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1655f
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5b42f(%rip), %rsi     # 0x7199d
leaq 0x5b433(%rip), %rdx     # 0x719a8
callq 0xedf0
leaq 0x7e7a7(%rip), %rdi     # 0x94d28
leaq 0x48(%rsp), %rsi
callq 0x19634
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5b524(%rip), %rsi     # 0x71ac2
leaq 0x5b527(%rip), %rdx     # 0x71acc
leaq 0x28(%rsp), %rdi
callq 0xedf0
leaq 0x7e59a(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %r14
leaq 0x78(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x5b4fe(%rip), %rsi     # 0x71acd
leaq 0x5b4fc(%rip), %rdx     # 0x71ad2
leaq 0x68(%rsp), %rdi
callq 0xedf0
leaq 0x68(%rsp), %rsi
movq %r14, %rdi
callq 0x11edc
movq %rax, %r14
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x18044
movq %rax, %rdi
movq %r14, %rsi
callq 0xcc40
leaq 0x98(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x5b4b1(%rip), %rsi     # 0x71ad3
leaq 0x5b4b2(%rip), %rdx     # 0x71adb
leaq 0x88(%rsp), %rdi
callq 0xedf0
leaq 0x88(%rsp), %rsi
movq %rbx, %rdi
callq 0x18044
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1666d
callq 0xc640
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x1667c
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16690
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1669f
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5b42e(%rip), %rsi     # 0x71adc
leaq 0x5b43b(%rip), %rdx     # 0x71af0
callq 0xedf0
leaq 0x7e667(%rip), %rdi     # 0x94d28
leaq 0x48(%rsp), %rsi
callq 0x19634
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5b3f1(%rip), %rsi     # 0x71ad3
leaq 0x5b3f2(%rip), %rdx     # 0x71adb
callq 0xedf0
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x18044
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16723
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16732
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5b3b0(%rip), %rsi     # 0x71af1
leaq 0x5b3b2(%rip), %rdx     # 0x71afa
callq 0xedf0
leaq 0x7e5d4(%rip), %rdi     # 0x94d28
leaq 0x48(%rsp), %rsi
callq 0x19634
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5b35e(%rip), %rsi     # 0x71ad3
leaq 0x5b35f(%rip), %rdx     # 0x71adb
callq 0xedf0
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x18044
leaq 0x8(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x167b6
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x167c5
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5b249(%rip), %rsi     # 0x71a1d
leaq 0x5b24d(%rip), %rdx     # 0x71a28
callq 0xedf0
leaq 0x7e541(%rip), %rdi     # 0x94d28
leaq 0x48(%rsp), %rsi
callq 0x19634
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5b2f3(%rip), %rsi     # 0x71afb
leaq 0x5b2f6(%rip), %rdx     # 0x71b05
callq 0xedf0
leaq 0x68(%rsp), %rdi
movq %r12, (%rdi)
movl $0xc, %esi
xorl %edx, %edx
callq 0xc6d0
movq 0x68(%rsp), %rdi
movl 0x70(%rsp), %esi
movabsq $0x3a65b03efe, %rdx     # imm = 0x3A65B03EFE
callq 0x2239f
addq $0x198, %rbx            # imm = 0x198
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x18044
leaq 0x68(%rsp), %rsi
movq %rax, %rdi
callq 0xcc40
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16870
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16884
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16893
callq 0xc640
leaq 0x7e2b6(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5b255(%rip), %rsi     # 0x71b06
leaq 0x5b25f(%rip), %rdx     # 0x71b17
callq 0xedf0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x180f2
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x168d9
callq 0xc640
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5b230(%rip), %rsi     # 0x71b18
leaq 0x5b232(%rip), %rdx     # 0x71b21
callq 0xedf0
leaq 0x7e42d(%rip), %rdi     # 0x94d28
leaq 0x48(%rsp), %rsi
callq 0x19634
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5b206(%rip), %rsi     # 0x71b22
leaq 0x5b20a(%rip), %rdx     # 0x71b2d
callq 0xedf0
leaq 0x1c8(%rbx), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1c4c8
movb $0x0, (%rax)
leaq 0x68(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x5b1e3(%rip), %rsi     # 0x71b2e
leaq 0x5b1e0(%rip), %rdx     # 0x71b32
callq 0xedf0
leaq 0x7e1f2(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %r14
leaq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5b123(%rip), %rsi     # 0x71aa3
leaq 0x5b120(%rip), %rdx     # 0x71aa7
callq 0xedf0
leaq 0x88(%rsp), %rsi
movq %r14, %rdi
callq 0x11edc
movq %rax, %r14
addq $0x198, %rbx            # imm = 0x198
leaq 0x68(%rsp), %rsi
movq %rbx, %rdi
callq 0x18044
movq %rax, %rdi
movq %r14, %rsi
callq 0xcc40
leaq 0x300(%rsp), %rbp
movq %rbp, -0x10(%rbp)
leaq 0x5b162(%rip), %rsi     # 0x71b33
leaq 0x5b161(%rip), %rdx     # 0x71b39
leaq 0x2f0(%rsp), %rdi
callq 0xedf0
leaq 0x7e164(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %r14
leaq 0x2e0(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5b133(%rip), %rsi     # 0x71b3a
leaq 0x5b149(%rip), %rdx     # 0x71b57
leaq 0x2d0(%rsp), %rdi
callq 0xedf0
leaq 0x2d0(%rsp), %rsi
movq %r14, %rdi
callq 0x11edc
movq %rax, %r14
leaq 0x2f0(%rsp), %rsi
movq %rbx, %rdi
callq 0x18044
movq %rax, %rdi
movq %r14, %rsi
callq 0xcc40
movq 0x2d0(%rsp), %rdi
cmpq %r15, %rdi
je 0x16a5b
callq 0xc640
movq 0x2f0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x16a6d
callq 0xc640
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r15
je 0x16a8c
callq 0xc640
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x16a9b
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16aaf
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16abe
callq 0xc640
leaq 0x7e08b(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5ae1c(%rip), %rsi     # 0x718f8
leaq 0x5ae28(%rip), %rdx     # 0x7190b
callq 0xedf0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x11edc
leaq 0x7e1bc(%rip), %rsi     # 0x94cb8
movq %rax, %rdi
callq 0x11a44
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16b13
callq 0xc640
leaq 0x7e036(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x5addb(%rip), %rsi     # 0x7190c
leaq 0x5ade7(%rip), %rdx     # 0x7191f
callq 0xedf0
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x11edc
leaq 0x7e12f(%rip), %rsi     # 0x94c80
movq %rax, %rdi
callq 0x11a44
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x16b68
callq 0xc640
movq 0x7e161(%rip), %rsi     # 0x94cd0
movq 0x7e122(%rip), %rdx     # 0x94c98
leaq 0x5afdb(%rip), %rdi     # 0x71b58
xorl %eax, %eax
callq 0xfd7f
leaq 0xab5(%rip), %rsi       # 0x17640
xorl %edi, %edi
callq 0x6c009
movq %rax, %rbx
movq %rax, 0x7e184(%rip)     # 0x94d20
leaq 0x7dfad(%rip), %rdi     # 0x94b50
callq 0x11bec
movq %rax, %r14
leaq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
movq %rax, (%rdi)
leaq 0x5afc8(%rip), %rsi     # 0x71b87
leaq 0x5afc7(%rip), %rdx     # 0x71b8d
callq 0xedf0
addq $0x38, %r14
leaq 0x28(%rsp), %rsi
movq %r14, %rdi
callq 0x12416
movl (%rax), %r14d
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x16c3c
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x16c33
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x16c39
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x16c3c
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x16c00
addl $-0x3, %r15d
jmp 0x16c3c
addl $-0x2, %r15d
jmp 0x16c3c
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 0x12313
movq 0x48(%rsp), %rdx
leaq 0x5af04(%rip), %rsi     # 0x71b78
movq %rbx, %rdi
callq 0x6ba61
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
leaq 0x18(%rsp), %r15
je 0x16c90
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x16ca4
callq 0xc640
movq 0x7e075(%rip), %rdi     # 0x94d20
leaq 0x5aec6(%rip), %rsi     # 0x71b78
callq 0x6bfd3
leaq 0x5aed0(%rip), %rdi     # 0x71b8e
movq %rax, %rsi
xorl %eax, %eax
callq 0xfd7f
movq 0x7dfa9(%rip), %rdi     # 0x94c78
callq 0xc5b0
leaq 0x7df25(%rip), %rdi     # 0x94c00
callq 0xc820
leaq 0x12c9(%rip), %rbx      # 0x17fb0
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)
movq $0x0, 0x50(%rax)
movq %rax, %rdx
addq $0x40, %rdx
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
movq %rdx, 0x30(%rax)
movq %rax, 0x7de01(%rip)     # 0x94b48
leaq 0x2c0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ae4f(%rip), %rsi     # 0x71ba9
leaq 0x5ae53(%rip), %rdx     # 0x71bb4
leaq 0x2b0(%rsp), %rdi
callq 0xedf0
leaq 0x2b0(%rsp), %rdi
movl $0x1, %esi
callq 0x12e9e
movq 0x2b0(%rsp), %rdi
cmpq %r14, %rdi
je 0x16d92
callq 0xc640
leaq 0x2a0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ae10(%rip), %rsi     # 0x71bb5
leaq 0x5ae14(%rip), %rdx     # 0x71bc0
leaq 0x290(%rsp), %rdi
callq 0xedf0
leaq 0x290(%rsp), %rdi
movl $0x2, %esi
callq 0x12e9e
movq 0x290(%rsp), %rdi
cmpq %r14, %rdi
je 0x16ddd
callq 0xc640
leaq 0x280(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5add1(%rip), %rsi     # 0x71bc1
leaq 0x5add5(%rip), %rdx     # 0x71bcc
leaq 0x270(%rsp), %rdi
callq 0xedf0
leaq 0x270(%rsp), %rdi
movl $0x64, %esi
callq 0x12e9e
movq 0x270(%rsp), %rdi
cmpq %r14, %rdi
je 0x16e28
callq 0xc640
leaq 0x260(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ad92(%rip), %rsi     # 0x71bcd
leaq 0x5ad99(%rip), %rdx     # 0x71bdb
leaq 0x250(%rsp), %rdi
callq 0xedf0
leaq 0x250(%rsp), %rdi
movl $0x65, %esi
callq 0x12e9e
movq 0x250(%rsp), %rdi
cmpq %r14, %rdi
je 0x16e73
callq 0xc640
leaq 0x240(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ad56(%rip), %rsi     # 0x71bdc
leaq 0x5ad54(%rip), %rdx     # 0x71be1
leaq 0x230(%rsp), %rdi
callq 0xedf0
leaq 0x230(%rsp), %rdi
movl $0x66, %esi
callq 0x12e9e
movq 0x230(%rsp), %rdi
cmpq %r14, %rdi
je 0x16ebe
callq 0xc640
leaq 0x220(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ad11(%rip), %rsi     # 0x71be2
leaq 0x5ad16(%rip), %rdx     # 0x71bee
leaq 0x210(%rsp), %rdi
callq 0xedf0
leaq 0x210(%rsp), %rdi
movl $0x67, %esi
callq 0x12e9e
movq 0x210(%rsp), %rdi
cmpq %r14, %rdi
je 0x16f09
callq 0xc640
leaq 0x200(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5acd3(%rip), %rsi     # 0x71bef
leaq 0x5acd8(%rip), %rdx     # 0x71bfb
leaq 0x1f0(%rsp), %rdi
callq 0xedf0
leaq 0x1f0(%rsp), %rdi
movl $0x68, %esi
callq 0x12e9e
movq 0x1f0(%rsp), %rdi
cmpq %r14, %rdi
je 0x16f54
callq 0xc640
leaq 0x1e0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ac95(%rip), %rsi     # 0x71bfc
leaq 0x5ac94(%rip), %rdx     # 0x71c02
leaq 0x1d0(%rsp), %rdi
callq 0xedf0
leaq 0x1d0(%rsp), %rdi
movl $0xc8, %esi
callq 0x12e9e
movq 0x1d0(%rsp), %rdi
cmpq %r14, %rdi
je 0x16f9f
callq 0xc640
leaq 0x1c0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ac51(%rip), %rsi     # 0x71c03
leaq 0x5ac52(%rip), %rdx     # 0x71c0b
leaq 0x1b0(%rsp), %rdi
callq 0xedf0
leaq 0x1b0(%rsp), %rdi
movl $0x1f5, %esi            # imm = 0x1F5
callq 0x12e9e
movq 0x1b0(%rsp), %rdi
cmpq %r14, %rdi
je 0x16fea
callq 0xc640
leaq 0x1a0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ac0f(%rip), %rsi     # 0x71c0c
leaq 0x5ac10(%rip), %rdx     # 0x71c14
leaq 0x190(%rsp), %rdi
callq 0xedf0
leaq 0x190(%rsp), %rdi
movl $0x1f6, %esi            # imm = 0x1F6
callq 0x12e9e
movq 0x190(%rsp), %rdi
cmpq %r14, %rdi
je 0x17035
callq 0xc640
leaq 0x180(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5abcd(%rip), %rsi     # 0x71c15
leaq 0x5abd3(%rip), %rdx     # 0x71c22
leaq 0x170(%rsp), %rdi
callq 0xedf0
leaq 0x170(%rsp), %rdi
movl $0x3, %esi
callq 0x12e9e
movq 0x170(%rsp), %rdi
cmpq %r14, %rdi
je 0x17080
callq 0xc640
leaq 0x160(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ab90(%rip), %rsi     # 0x71c23
leaq 0x5aba0(%rip), %rdx     # 0x71c3a
leaq 0x150(%rsp), %rdi
callq 0xedf0
leaq 0x150(%rsp), %rdi
movl $0x4, %esi
callq 0x12e9e
movq 0x150(%rsp), %rdi
cmpq %r14, %rdi
je 0x170cb
callq 0xc640
leaq 0x140(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ab5d(%rip), %rsi     # 0x71c3b
leaq 0x5ab63(%rip), %rdx     # 0x71c48
leaq 0x130(%rsp), %rdi
callq 0xedf0
leaq 0x130(%rsp), %rdi
movl $0x1f7, %esi            # imm = 0x1F7
callq 0x12e9e
movq 0x130(%rsp), %rdi
cmpq %r14, %rdi
je 0x17116
callq 0xc640
leaq 0x120(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5ab20(%rip), %rsi     # 0x71c49
leaq 0x5ab25(%rip), %rdx     # 0x71c55
leaq 0x110(%rsp), %rdi
callq 0xedf0
leaq 0x110(%rsp), %rdi
movl $0x1f8, %esi            # imm = 0x1F8
callq 0x12e9e
movq 0x110(%rsp), %rdi
cmpq %r14, %rdi
je 0x17161
callq 0xc640
leaq 0x100(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x5aae2(%rip), %rsi     # 0x71c56
leaq 0x5aaea(%rip), %rdx     # 0x71c65
leaq 0xf0(%rsp), %rdi
callq 0xedf0
leaq 0xf0(%rsp), %rdi
movl $0x1f9, %esi            # imm = 0x1F9
callq 0x12e9e
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x171ac
callq 0xc640
cmpl $0x0, 0x7dbc5(%rip)     # 0x94d78
jne 0x171c8
movq 0x7db64(%rip), %rdi     # 0x94d20
movl $0x3e8, %esi            # imm = 0x3E8
callq 0x6b473
jmp 0x171ac
leaq 0x7db51(%rip), %rdi     # 0x94d20
callq 0x6b47d
movq 0x7da1d(%rip), %rdi     # 0x94bf8
callq 0x2ea27
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x171ef
callq 0xc640
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x17209
callq 0xc640
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x17223
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 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x110(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x130(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x150(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x170(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x190(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x1b0(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x1d0(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x1f0(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x210(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x230(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x250(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x270(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x290(%rsp), %rdi
jmp 0x17353
jmp 0x175f2
movq %rax, %rbx
movq 0x2b0(%rsp), %rdi
cmpq %r14, %rdi
jne 0x1757d
jmp 0x17582
jmp 0x175f2
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x1747b
callq 0xc640
jmp 0x1747b
jmp 0x173b0
jmp 0x173b0
jmp 0x173b0
movq %rax, %rbx
jmp 0x1751f
jmp 0x17533
movq %rax, %rbx
jmp 0x17550
jmp 0x1739e
movq %rax, %rbx
jmp 0x1755f
jmp 0x17495
jmp 0x17495
movq %rax, %rbx
jmp 0x17582
jmp 0x173df
jmp 0x173e7
jmp 0x174a4
jmp 0x173df
jmp 0x173df
jmp 0x173e7
jmp 0x173df
jmp 0x173df
jmp 0x173e7
jmp 0x173df
jmp 0x173df
jmp 0x173e7
jmp 0x17589
jmp 0x174a4
jmp 0x173df
movq %rax, %rbx
jmp 0x175af
movq %rax, %rbx
jmp 0x175be
jmp 0x173f1
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
jne 0x175ff
jmp 0x17604
jmp 0x175c3
movq %rax, %rbx
movq 0x310(%rsp), %rdi
cmpq %r14, %rdi
jne 0x17437
jmp 0x174d7
jmp 0x175c3
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x174d7
callq 0xc640
jmp 0x174d7
jmp 0x174d4
jmp 0x174d4
jmp 0x175c3
jmp 0x175c3
jmp 0x175c3
jmp 0x175ca
movq %rax, %rbx
movq 0x330(%rsp), %rdi
cmpq %r14, %rdi
jne 0x17619
jmp 0x1761e
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
jne 0x1757d
jmp 0x17582
jmp 0x17495
movq %rax, %rbx
jmp 0x17573
jmp 0x17589
jmp 0x174a4
movq %rax, %rbx
jmp 0x1759b
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x1758c
callq 0xc640
jmp 0x1758c
jmp 0x174d4
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x175ff
jmp 0x17604
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x17619
jmp 0x1761e
jmp 0x175ca
jmp 0x175c3
movq %rax, %rbx
movq 0x2d0(%rsp), %rdi
cmpq %r15, %rdi
je 0x1751f
callq 0xc640
movq 0x2f0(%rsp), %rdi
cmpq %rbp, %rdi
je 0x17536
callq 0xc640
jmp 0x17536
movq %rax, %rbx
movq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x17550
callq 0xc640
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x1755f
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x17573
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x17582
callq 0xc640
leaq 0x18(%rsp), %r15
jmp 0x175f5
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r12, %rdi
je 0x1759b
callq 0xc640
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x175af
callq 0xc640
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x175be
callq 0xc640
movq %rbp, %r15
jmp 0x175f5
movq %rax, %rbx
jmp 0x17604
jmp 0x175f2
movq %rax, %rbx
jmp 0x1761e
movq %rax, %rbx
jmp 0x175e6
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x175e6
callq 0xc640
leaq 0x28(%rsp), %rdi
callq 0x11c2a
jmp 0x17604
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x17604
callq 0xc640
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1761e
callq 0xc640
movq 0xc8(%rsp), %rdi
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdi
je 0x17638
callq 0xc640
movq %rbx, %rdi
callq 0xc760