// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./src/main.cpp
// Function: check_ip(mg_connection*, bool)
bool check_ip(mg_connection* conn, bool verbose = false){
    if(!configs.global().get<bool>("security::access_control")) return true;

    time_t rawtime;
    time(&rawtime);
    const char * cip = cc_get_client_ip(conn);
    string sip(cip);
    time_t lasttime = IPAccessList[sip];
    
    if(is_admin(conn)) return true;
    if(!is_assist(conn).empty()) return true;

    if(IPBanList.find(sip) != IPBanList.end()) {
        // views::info::render(conn, STRING_YOUR_IP_IS_BANNED);
        views::info::render(conn, templates.invoke("misc").toggle("ip_is_banned").build_destory().c_str());
        logLog("Banned IP %s trying to access", cip);
        return false; //banned
    }

    if( abs(lasttime - rawtime) < configs.global().get<int>("user::cooldown") && lasttime != 0){
        views::info::render(conn, templates.invoke("misc").toggle("rapid_accessing").var("IP", cip).build_destory().c_str());
        if(verbose) logLog("%s is rapidly accessing", cip);
        return false;
    }
    IPAccessList[sip] = rawtime;
    return true;
}

// Assembly:
subq $0x308, %rsp            # imm = 0x308
movb %sil, %al
movq %rdi, 0x2f8(%rsp)
andb $0x1, %al
movb %al, 0x2f7(%rsp)
leaq 0xd37e6(%rip), %rdi     # 0xeef48
callq 0x146c0
movq %rax, 0xd8(%rsp)
leaq 0x2cf(%rsp), %rdi
movq %rdi, 0xe0(%rsp)
callq 0xdc30
movq 0xe0(%rsp), %rdx
leaq 0xa3f49(%rip), %rsi     # 0xbf6dc
leaq 0x2d0(%rsp), %rdi
callq 0xdad0
jmp 0x1b7a2
movq 0xd8(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
callq 0x23990
movb %al, 0xd7(%rsp)
jmp 0x1b7c0
movb 0xd7(%rsp), %al
xorb $-0x1, %al
movb %al, 0xd6(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0xdf50
leaq 0x2cf(%rsp), %rdi
callq 0xdf30
movb 0xd6(%rsp), %al
testb $0x1, %al
jne 0x1b7f7
jmp 0x1b84d
movb $0x1, 0x307(%rsp)
jmp 0x1c0f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1b83b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0xdf50
leaq 0x2cf(%rsp), %rdi
callq 0xdf30
jmp 0x1c103
leaq 0x2b0(%rsp), %rdi
callq 0xd980
movq 0x2f8(%rsp), %rdi
callq 0x111d0
movq %rax, 0x2a8(%rsp)
movq 0x2a8(%rsp), %rax
movq %rax, 0xc0(%rsp)
leaq 0x287(%rsp), %rdi
movq %rdi, 0xc8(%rsp)
callq 0xdc30
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
leaq 0x288(%rsp), %rdi
callq 0xdad0
jmp 0x1b8b3
leaq 0x287(%rsp), %rdi
callq 0xdf30
leaq 0xd3821(%rip), %rdi     # 0xef0e8
leaq 0x288(%rsp), %rsi
callq 0x23a50
movq %rax, 0xb8(%rsp)
jmp 0x1b8de
movq 0xb8(%rsp), %rax
movslq (%rax), %rax
movq %rax, 0x278(%rsp)
movq 0x2f8(%rsp), %rdi
callq 0x101d0
movb %al, 0xb7(%rsp)
jmp 0x1b907
movb 0xb7(%rsp), %al
testb $0x1, %al
jne 0x1b914
jmp 0x1b96b
movb $0x1, 0x307(%rsp)
movl $0x1, 0x274(%rsp)
jmp 0x1c0d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
leaq 0x287(%rsp), %rdi
callq 0xdf30
jmp 0x1c103
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c0e3
movq 0x2f8(%rsp), %rsi
leaq 0x250(%rsp), %rdi
callq 0x10300
jmp 0x1b982
leaq 0x250(%rsp), %rdi
callq 0xd3f0
xorb $-0x1, %al
movb %al, 0xb6(%rsp)
leaq 0x250(%rsp), %rdi
callq 0xdf50
movb 0xb6(%rsp), %al
testb $0x1, %al
jne 0x1b9b2
jmp 0x1b9ca
movb $0x1, 0x307(%rsp)
movl $0x1, 0x274(%rsp)
jmp 0x1c0d4
leaq 0xd36df(%rip), %rdi     # 0xef0b0
leaq 0x288(%rsp), %rsi
callq 0x23b40
movq %rax, 0xa8(%rsp)
jmp 0x1b9e8
movq 0xa8(%rsp), %rax
movq %rax, 0x248(%rsp)
leaq 0xd36b1(%rip), %rdi     # 0xef0b0
callq 0x14e50
movq %rax, 0x240(%rsp)
leaq 0x248(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x14e30
testb $0x1, %al
jne 0x1ba2a
jmp 0x1bc3e
movq 0x2f8(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x1ff(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0xdc30
movq 0xa0(%rsp), %rdx
leaq 0xa632d(%rip), %rsi     # 0xc1d8b
leaq 0x200(%rsp), %rdi
callq 0xdad0
jmp 0x1ba6d
leaq 0xd36ac(%rip), %rdi     # 0xef120
leaq 0x200(%rsp), %rsi
callq 0x23b70
movq %rax, 0x90(%rsp)
jmp 0x1ba8b
leaq 0x1d7(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0xdc30
movq 0x88(%rsp), %rdx
leaq 0xa3c46(%rip), %rsi     # 0xbf6f5
leaq 0x1d8(%rsp), %rdi
callq 0xdad0
jmp 0x1babe
movq 0x90(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
movl $0x1, %edx
callq 0x23bf0
movq %rax, 0x80(%rsp)
jmp 0x1bae2
movq 0x80(%rsp), %rsi
leaq 0x220(%rsp), %rdi
callq 0x23c40
jmp 0x1baf9
leaq 0x220(%rsp), %rdi
callq 0xd190
movq 0x98(%rsp), %rdi
movq %rax, %rsi
callq 0x3f960
jmp 0x1bb18
leaq 0x220(%rsp), %rdi
callq 0xdf50
leaq 0x1d8(%rsp), %rdi
callq 0xdf50
leaq 0x1d7(%rsp), %rdi
callq 0xdf30
leaq 0x200(%rsp), %rdi
callq 0xdf50
leaq 0x1ff(%rsp), %rdi
callq 0xdf30
movq 0x2a8(%rsp), %rsi
leaq 0xa3b9a(%rip), %rdi     # 0xbf702
xorl %eax, %eax
callq 0x11920
jmp 0x1bb71
movb $0x0, 0x307(%rsp)
movl $0x1, 0x274(%rsp)
jmp 0x1c0d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1bc2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1bc1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1bc12
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1bc05
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
leaq 0x220(%rsp), %rdi
callq 0xdf50
leaq 0x1d8(%rsp), %rdi
callq 0xdf50
leaq 0x1d7(%rsp), %rdi
callq 0xdf30
leaq 0x200(%rsp), %rdi
callq 0xdf50
leaq 0x1ff(%rsp), %rdi
callq 0xdf30
jmp 0x1c0e3
movq 0x278(%rsp), %rdi
movq 0x2b0(%rsp), %rax
subq %rax, %rdi
callq 0x23cd0
movq %rax, 0x78(%rsp)
jmp 0x1bc5d
leaq 0xd32e4(%rip), %rdi     # 0xeef48
callq 0x146c0
movq %rax, 0x70(%rsp)
jmp 0x1bc70
leaq 0x1af(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0xdc30
movq 0x68(%rsp), %rdx
leaq 0xa3a92(%rip), %rsi     # 0xbf720
leaq 0x1b0(%rsp), %rdi
callq 0xdad0
jmp 0x1bc9d
movq 0x70(%rsp), %rdi
leaq 0x1b0(%rsp), %rsi
callq 0x14720
movl %eax, 0x64(%rsp)
jmp 0x1bcb5
movq 0x78(%rsp), %rcx
movl 0x64(%rsp), %eax
movslq %eax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, 0x63(%rsp)
jge 0x1bcdc
cmpq $0x0, 0x278(%rsp)
setne %al
movb %al, 0x63(%rsp)
movb 0x63(%rsp), %al
movb %al, 0x62(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0xdf50
leaq 0x1af(%rsp), %rdi
callq 0xdf30
movb 0x62(%rsp), %al
testb $0x1, %al
jne 0x1bd0b
jmp 0x1c090
movq 0x2f8(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x167(%rsp), %rdi
movq %rdi, 0x58(%rsp)
callq 0xdc30
movq 0x58(%rsp), %rdx
leaq 0xa6055(%rip), %rsi     # 0xc1d8b
leaq 0x168(%rsp), %rdi
callq 0xdad0
jmp 0x1bd45
leaq 0xd33d4(%rip), %rdi     # 0xef120
leaq 0x168(%rsp), %rsi
callq 0x23b70
movq %rax, 0x48(%rsp)
jmp 0x1bd60
leaq 0x13f(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xdc30
movq 0x40(%rsp), %rdx
leaq 0xa39b1(%rip), %rsi     # 0xbf72f
leaq 0x140(%rsp), %rdi
callq 0xdad0
jmp 0x1bd8d
movq 0x48(%rsp), %rdi
leaq 0x140(%rsp), %rsi
movl $0x1, %edx
callq 0x23bf0
movq %rax, 0x38(%rsp)
jmp 0x1bdab
leaq 0x117(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xdc30
movq 0x30(%rsp), %rdx
leaq 0xa90de(%rip), %rsi     # 0xc4ea7
leaq 0x118(%rsp), %rdi
callq 0xdad0
jmp 0x1bdd8
movq 0x2a8(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0xef(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0xdc30
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rdx
leaq 0xf0(%rsp), %rdi
callq 0xdad0
jmp 0x1be10
movq 0x38(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
callq 0x23cf0
movq %rax, 0x18(%rsp)
jmp 0x1be31
movq 0x18(%rsp), %rsi
leaq 0x188(%rsp), %rdi
callq 0x23c40
jmp 0x1be45
leaq 0x188(%rsp), %rdi
callq 0xd190
movq 0x50(%rsp), %rdi
movq %rax, %rsi
callq 0x3f960
jmp 0x1be61
leaq 0x188(%rsp), %rdi
callq 0xdf50
leaq 0xf0(%rsp), %rdi
callq 0xdf50
leaq 0xef(%rsp), %rdi
callq 0xdf30
leaq 0x118(%rsp), %rdi
callq 0xdf50
leaq 0x117(%rsp), %rdi
callq 0xdf30
leaq 0x140(%rsp), %rdi
callq 0xdf50
leaq 0x13f(%rsp), %rdi
callq 0xdf30
leaq 0x168(%rsp), %rdi
callq 0xdf50
leaq 0x167(%rsp), %rdi
callq 0xdf30
testb $0x1, 0x2f7(%rsp)
je 0x1c07b
movq 0x2a8(%rsp), %rsi
leaq 0xa384c(%rip), %rdi     # 0xbf73f
xorl %eax, %eax
callq 0x11920
jmp 0x1befc
jmp 0x1c07b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1bf38
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
leaq 0x1b0(%rsp), %rdi
callq 0xdf50
leaq 0x1af(%rsp), %rdi
callq 0xdf30
jmp 0x1c0e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c06c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c05f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c052
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c045
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c038
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c01e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
jmp 0x1c011
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2c0(%rsp)
movl %eax, 0x2bc(%rsp)
leaq 0x188(%rsp), %rdi
callq 0xdf50
leaq 0xf0(%rsp), %rdi
callq 0xdf50
leaq 0xef(%rsp), %rdi
callq 0xdf30
leaq 0x118(%rsp), %rdi
callq 0xdf50
leaq 0x117(%rsp), %rdi
callq 0xdf30
leaq 0x140(%rsp), %rdi
callq 0xdf50
leaq 0x13f(%rsp), %rdi
callq 0xdf30
leaq 0x168(%rsp), %rdi
callq 0xdf50
leaq 0x167(%rsp), %rdi
callq 0xdf30
jmp 0x1c0e3
movb $0x0, 0x307(%rsp)
movl $0x1, 0x274(%rsp)
jmp 0x1c0d4
movl 0x2b0(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0xd3046(%rip), %rdi     # 0xef0e8
leaq 0x288(%rsp), %rsi
callq 0x23a50
movq %rax, 0x10(%rsp)
jmp 0x1c0b6
movq 0x10(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, (%rax)
movb $0x1, 0x307(%rsp)
movl $0x1, 0x274(%rsp)
leaq 0x288(%rsp), %rdi
callq 0xdf50
jmp 0x1c0f2
leaq 0x288(%rsp), %rdi
callq 0xdf50
jmp 0x1c103
movb 0x307(%rsp), %al
andb $0x1, %al
addq $0x308, %rsp            # imm = 0x308
retq
movq 0x2c0(%rsp), %rdi
callq 0xd8a0