// File: /workspace/github_c_makefile_star2_O2/coyove[P]chann/./src/views/list/timeline.cpp
// Function: views::timeline::render(mg_connection*, bool)
void render(mg_connection* conn, bool indexPage){
            ConfigManager configs;
            int num = indexPage ? 1 : cc_extract_uri_num(conn);

            templates.invoke("site_header").var("CURRENT_PAGE", num).toggle("is_admin", is_admin(conn)) \
                .toggle("timeline_page").pipe_to(conn).destory();

            if(!configs.global().get<bool>("archive")) 
                templates.invoke("post_form").toggle("is_admin", is_admin(conn) || !is_assist(conn).empty()) \
                .toggle("post_new_thread").pipe_to(conn).destory();

            clock_t startc = clock();
            int max_page_viewable = configs.global().get<int>("user::viewable_pages");
            int threads_per_page = configs.global().get<int>("user::threads_per_page");

            bool admin_view = is_admin(conn);
            int start_no = 1, end_no = threads_per_page;

            if(indexPage)
                showThreads(conn, start_no, end_no);
            else{
                cclong cp = cc_extract_uri_num(conn);
                if(cp <= max_page_viewable || max_page_viewable == 0 || admin_view){
                    end_no = cp * threads_per_page;
                    start_no = end_no- threads_per_page + 1;
                    showThreads(conn, start_no, end_no);
                }
            }

            cclong current_page = end_no / threads_per_page;
            queue<string> before, after;
            for (cclong i = 1; i <= (max_page_viewable == 0 || admin_view ? 10000 : max_page_viewable); ++i){
                if (current_page - i < 4 && current_page - i > 0) before.push(to_string(i));
                else if (i - current_page < 4 && i - current_page > 0) after.push(to_string(i));
                else if (i - current_page > 4) break;
            }
            
            templates.invoke("pager").toggle("timeline_page") \
                .var("CURRENT_PAGE", current_page) \
                .var("PREVIOUS_PAGE", current_page > 1 ? (current_page - 1) : 1) \
                .var("NEXT_PAGE", current_page + 1) \
                .loop("before_pages", before).loop("after_pages", after).pipe_to(conn).destory();

            clock_t endc = clock();
            templates.invoke("site_footer").var("TIME", (int)((endc-startc) * 1000 / CLOCKS_PER_SEC)).pipe_to(conn).destory();
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x290(%rsp), %rax
movq %rax, -0x30(%rax)
pushq $0x1
popq %rcx
movq %rcx, -0x28(%rax)
xorps %xmm0, %xmm0
movups %xmm0, -0x20(%rax)
movl $0x3f800000, %edx       # imm = 0x3F800000
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
leaq 0x2c8(%rsp), %rax
movq %rax, -0x30(%rax)
movq %rcx, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
leaq 0x300(%rsp), %rax
movq %rax, -0x30(%rax)
movq %rcx, -0x28(%rax)
movups %xmm0, -0x20(%rax)
movl %edx, -0x10(%rax)
movups %xmm0, -0x8(%rax)
testl %esi, %esi
je 0x23ac1
pushq $0x1
popq %r14
jmp 0x23acc
movq %rbx, %rdi
callq 0xf80a
movl %eax, %r14d
leaq 0x3de9a(%rip), %rsi     # 0x6196d
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0xcb10
leaq 0x6425f(%rip), %rdi     # 0x87d48
leaq 0x48(%rsp), %rsi
callq 0x14fb0
movq %rax, %r15
leaq 0x3e5d6(%rip), %rsi     # 0x620d3
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
callq 0xcb10
leaq 0x110(%rsp), %rsi
movq %r15, %rdi
movl %r14d, %edx
callq 0x15236
movq %rax, %r14
leaq 0x3e375(%rip), %rsi     # 0x61ea4
leaq 0xb0(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0xcb10
movq %rbx, %rdi
callq 0xe080
movzbl %al, %edx
leaq 0xb0(%rsp), %rsi
movq %r14, %rdi
callq 0x14ffa
movq %rax, %r14
leaq 0x3e644(%rip), %rsi     # 0x621ad
leaq 0x8(%rsp), %rdi
leaq 0x160(%rsp), %rdx
callq 0xcb10
leaq 0x1c8(%r14), %rdi
leaq 0x8(%rsp), %rsi
callq 0x189cc
movb $0x1, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x151b6
movq %rax, %rdi
callq 0x15224
leaq 0x8(%rsp), %rdi
callq 0xcd88
leaq 0xb0(%rsp), %rdi
callq 0xcd88
leaq 0x110(%rsp), %rdi
callq 0xcd88
leaq 0x48(%rsp), %rdi
callq 0xcd88
leaq 0x260(%rsp), %rdi
callq 0x1008c
movq %rax, %r14
leaq 0x43a81(%rip), %rsi     # 0x67668
leaq 0x48(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0xcb10
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x14efa
movl %eax, %r14d
leaq 0x48(%rsp), %rdi
callq 0xcd88
testb %r14b, %r14b
jne 0x23d19
leaq 0x3dec5(%rip), %rsi     # 0x61ae8
leaq 0x48(%rsp), %rdi
leaq 0x28(%rsp), %rdx
callq 0xcb10
leaq 0x6410f(%rip), %rdi     # 0x87d48
leaq 0x48(%rsp), %rsi
callq 0x14fb0
movq %rax, %r15
leaq 0x3e257(%rip), %rsi     # 0x61ea4
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
callq 0xcb10
movq %rbx, %rdi
callq 0xe080
movl %eax, %r14d
movb $0x1, %al
testb %r14b, %r14b
jne 0x23c90
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0xe111
cmpq $0x0, 0xb8(%rsp)
setne %al
movzbl %al, %edx
leaq 0x110(%rsp), %rsi
movq %r15, %rdi
callq 0x14ffa
movq %rax, %r15
leaq 0x3e440(%rip), %rsi     # 0x620ed
leaq 0x8(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0xcb10
leaq 0x1c8(%r15), %rdi
leaq 0x8(%rsp), %rsi
callq 0x189cc
movb $0x1, (%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x151b6
movq %rax, %rdi
callq 0x15224
leaq 0x8(%rsp), %rdi
callq 0xcd88
testb %r14b, %r14b
jne 0x23d02
leaq 0xb0(%rsp), %rdi
callq 0xcd88
leaq 0x110(%rsp), %rdi
callq 0xcd88
leaq 0x48(%rsp), %rdi
callq 0xcd88
callq 0xc060
movq %rax, %r15
leaq 0x260(%rsp), %rdi
callq 0x1008c
movq %rax, %r14
leaq 0x3e3c5(%rip), %rsi     # 0x620fd
leaq 0x48(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0xcb10
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x100e4
movl %eax, %r12d
leaq 0x48(%rsp), %rdi
callq 0xcd88
leaq 0x260(%rsp), %rdi
callq 0x1008c
movq %rax, %r14
leaq 0x3e397(%rip), %rsi     # 0x62112
leaq 0x48(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0xcb10
leaq 0x48(%rsp), %rsi
movq %r14, %rdi
callq 0x100e4
movl %eax, %r14d
leaq 0x48(%rsp), %rdi
callq 0xcd88
movq %rbx, %rdi
callq 0xe080
movl %eax, %r13d
testb %bpl, %bpl
je 0x23dca
pushq $0x1
popq %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x2353c
movl %r14d, %eax
jmp 0x23e04
movq %rbx, %rdi
callq 0xf80a
movl %eax, %ebp
cmpl %r12d, %eax
setle %al
testl %r12d, %r12d
sete %cl
orb %al, %cl
orb %r13b, %cl
movl %r14d, %eax
cmpb $0x1, %cl
jne 0x23e04
imull %r14d, %ebp
movl %ebp, %esi
subl %r14d, %esi
incl %esi
movq %rbx, %rdi
movl %ebp, %edx
callq 0x2353c
movl %ebp, %eax
cltd
idivl %r14d
movl %eax, %r14d
leaq 0x48(%rsp), %rdi
callq 0x19f2a
movq %r15, 0x98(%rsp)
movq %rbx, 0xa8(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x19f2a
xorl %ebx, %ebx
testl %r12d, %r12d
cmovgl %r12d, %ebx
incl %ebx
testb %r13b, %r13b
movl $0x2711, %eax           # imm = 0x2711
cmovnel %eax, %ebx
testl %r12d, %r12d
cmovel %eax, %ebx
decl %ebx
movq %r14, 0xa0(%rsp)
movl %r14d, %eax
negl %eax
pushq $0x1
popq %rbp
leaq 0x8(%rsp), %r12
leaq 0x48(%rsp), %r13
leaq 0x110(%rsp), %r14
subl $0x1, %ebx
jb 0x23ec9
leal 0x1(%rax), %r15d
cmpl $-0x3, %r15d
jb 0x23e98
movq %r12, %rdi
movl %ebp, %esi
callq 0x10273
movq %r13, %rdi
movq %r12, %rsi
callq 0x22e70
jmp 0x23eb2
cmpl $0x2, %eax
ja 0x23ebc
movq %r12, %rdi
movl %ebp, %esi
callq 0x10273
movq %r14, %rdi
movq %r12, %rsi
callq 0x22e70
movq %r12, %rdi
callq 0xcd88
jmp 0x23ec2
cmpl $0x4, %r15d
jg 0x23ec9
incl %ebp
movl %r15d, %eax
jmp 0x23e72
leaq 0x3e259(%rip), %rsi     # 0x62129
leaq 0x8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xcb10
leaq 0x63e62(%rip), %rdi     # 0x87d48
leaq 0x8(%rsp), %rsi
callq 0x14fb0
movq 0xa8(%rsp), %rbx
movq 0xa0(%rsp), %r15
movq %rax, %r14
leaq 0x3e2a3(%rip), %rsi     # 0x621ad
leaq 0x28(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0xcb10
leaq 0x1c8(%r14), %rdi
leaq 0x28(%rsp), %rsi
callq 0x189cc
movb $0x1, (%rax)
leaq 0x3e19f(%rip), %rsi     # 0x620d3
leaq 0xf0(%rsp), %rdi
leaq 0x5(%rsp), %rdx
callq 0xcb10
leaq 0xf0(%rsp), %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x15236
movq %rax, %r14
leaq 0x3e1cc(%rip), %rsi     # 0x6212f
leaq 0xd0(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0xcb10
leal -0x1(%r15), %eax
cmpl $0x2, %r15d
pushq $0x1
popq %rdx
cmovgel %eax, %edx
leaq 0xd0(%rsp), %rsi
movq %r14, %rdi
callq 0x15236
movq %rax, %r14
leaq 0x3e1a0(%rip), %rsi     # 0x6213d
leaq 0x160(%rsp), %rdi
leaq 0x3(%rsp), %rdx
callq 0xcb10
incl %r15d
leaq 0x160(%rsp), %rsi
movq %r14, %rdi
movl %r15d, %edx
callq 0x15236
movq %rax, %r14
leaq 0x3e178(%rip), %rsi     # 0x62147
leaq 0x1a0(%rsp), %rdi
leaq 0x2(%rsp), %rdx
callq 0xcb10
leaq 0x210(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x184e2
leaq 0x1a0(%rsp), %rsi
leaq 0x210(%rsp), %rdx
movq %r14, %rdi
callq 0x21318
movq %rax, %r14
leaq 0x3e13f(%rip), %rsi     # 0x62154
leaq 0x180(%rsp), %rdi
leaq 0x1(%rsp), %rdx
callq 0xcb10
leaq 0x1c0(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x184e2
leaq 0x180(%rsp), %rsi
leaq 0x1c0(%rsp), %rdx
movq %r14, %rdi
callq 0x21318
movq %rax, %rdi
movq %rbx, %rsi
callq 0x151b6
movq %rax, %rdi
callq 0x15224
leaq 0x1c0(%rsp), %rdi
callq 0x1642a
leaq 0x180(%rsp), %rdi
callq 0xcd88
leaq 0x210(%rsp), %rdi
callq 0x1642a
leaq 0x1a0(%rsp), %rdi
callq 0xcd88
leaq 0x160(%rsp), %rdi
callq 0xcd88
leaq 0xd0(%rsp), %rdi
callq 0xcd88
leaq 0xf0(%rsp), %rdi
callq 0xcd88
leaq 0x28(%rsp), %rdi
callq 0xcd88
leaq 0x8(%rsp), %rdi
callq 0xcd88
callq 0xc060
movq %rax, %r14
leaq 0x3d908(%rip), %rsi     # 0x619ed
leaq 0x8(%rsp), %rdi
leaq 0xf0(%rsp), %rdx
callq 0xcb10
leaq 0x63c4a(%rip), %rdi     # 0x87d48
leaq 0x8(%rsp), %rsi
callq 0x14fb0
movq %rax, %r15
leaq 0x3d8a2(%rip), %rsi     # 0x619b4
leaq 0x28(%rsp), %rdi
leaq 0xd0(%rsp), %rdx
callq 0xcb10
subq 0x98(%rsp), %r14
movl $0x3e8, %ecx            # imm = 0x3E8
movq %r14, %rax
cqto
idivq %rcx
leaq 0x28(%rsp), %rsi
movq %r15, %rdi
movl %eax, %edx
callq 0x15236
movq %rax, %rdi
movq %rbx, %rsi
callq 0x151b6
movq %rax, %rdi
callq 0x15224
leaq 0x28(%rsp), %rdi
callq 0xcd88
leaq 0x8(%rsp), %rdi
callq 0xcd88
leaq 0x110(%rsp), %rdi
callq 0x1642a
leaq 0x48(%rsp), %rdi
callq 0x1642a
leaq 0x260(%rsp), %rdi
callq 0x10136
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2426b
jmp 0x2427d
jmp 0x241b1
movq %rax, %rbx
jmp 0x2424c
jmp 0x2426b
jmp 0x24275
jmp 0x24275
jmp 0x2427d
jmp 0x2427d
jmp 0x2427d
jmp 0x24335
jmp 0x24335
jmp 0x24330
movq %rax, %rbx
jmp 0x2429a
jmp 0x241f0
movq %rax, %rbx
jmp 0x242a7
movq %rax, %rbx
jmp 0x242b4
jmp 0x24202
movq %rax, %rbx
jmp 0x242c1
jmp 0x2420c
movq %rax, %rbx
jmp 0x242ce
jmp 0x24216
movq %rax, %rbx
jmp 0x242db
jmp 0x24285
jmp 0x24285
jmp 0x24335
jmp 0x24335
jmp 0x24330
movq %rax, %rbx
jmp 0x2434f
jmp 0x2427d
jmp 0x2427d
jmp 0x24275
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcd88
testb %r14b, %r14b
je 0x24306
jmp 0x24313
jmp 0x2427d
jmp 0x24275
jmp 0x2427d
jmp 0x24275
jmp 0x2427d
jmp 0x24303
jmp 0x2426b
movq %rax, %rbx
jmp 0x24313
jmp 0x24275
movq %rax, %rbx
jmp 0x24320
movq %rax, %rbx
jmp 0x24359
movq %rax, %rbx
jmp 0x242e8
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x1642a
leaq 0x180(%rsp), %rdi
callq 0xcd88
leaq 0x210(%rsp), %rdi
callq 0x1642a
leaq 0x1a0(%rsp), %rdi
callq 0xcd88
leaq 0x160(%rsp), %rdi
callq 0xcd88
leaq 0xd0(%rsp), %rdi
callq 0xcd88
leaq 0xf0(%rsp), %rdi
callq 0xcd88
leaq 0x28(%rsp), %rdi
callq 0xcd88
jmp 0x24338
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcd88
jmp 0x24306
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xcd88
leaq 0x110(%rsp), %rdi
callq 0xcd88
leaq 0x48(%rsp), %rdi
callq 0xcd88
jmp 0x24359
jmp 0x24335
jmp 0x24330
movq %rax, %rbx
jmp 0x24342
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xcd88
leaq 0x110(%rsp), %rdi
callq 0x1642a
leaq 0x48(%rsp), %rdi
callq 0x1642a
leaq 0x260(%rsp), %rdi
callq 0x10136
movq %rbx, %rdi
callq 0xc790