// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./src/views/list/gallery.cpp
// Function: views::gallery::showGallery(mg_connection*, int, int)
void showGallery(mg_connection* conn, cclong startID, cclong endID){
            struct Thread *r = unq_read_thread(pDb, 0); // get the root thread
            cclong c = 0;

            bool admin_view = is_admin(conn);

            cclong totalThreads = r->childCount;
            // cclong totalPages = 100;

            templates.invoke("site_slogan").pipe_to(conn).destory();

            for(cclong i = totalThreads; i > 0; --i){
                delete r;
                r = unq_read_thread(pDb, i);
                if(strlen(r->imgSrc) == 15 && r->state & NORMAL_DISPLAY) {
                    c++;
                    if (c >= startID && c <= endID){
                        mg_printf_data(conn, "<hr>");
                        views::each_thread(conn, r, SEND_SHOW_REPLY_LINK + SEND_CUT_LONG_COMMENT, admin_view);
                    }
                }
                
                if (c == endID + 1) break;
            }
            if(r) delete r;
        }

// Assembly:
subq $0x88, %rsp
movq %rdi, 0x80(%rsp)
movl %esi, 0x7c(%rsp)
movl %edx, 0x78(%rsp)
leaq 0xaa132(%rip), %rax     # 0xeeff0
movq (%rax), %rdi
xorl %esi, %esi
callq 0xea50
movq %rax, 0x70(%rsp)
movl $0x0, 0x6c(%rsp)
movq 0x80(%rsp), %rdi
callq 0x101d0
movb %al, 0x6b(%rsp)
movq 0x70(%rsp), %rax
movl 0xcc(%rax), %eax
movl %eax, 0x64(%rsp)
leaq 0x3f(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xdc30
movq 0x20(%rsp), %rdx
leaq 0x7b187(%rip), %rsi     # 0xc0097
leaq 0x40(%rsp), %rdi
callq 0xdad0
jmp 0x44f1c
leaq 0xaa1fd(%rip), %rdi     # 0xef120
leaq 0x40(%rsp), %rsi
callq 0x23b70
movq %rax, 0x18(%rsp)
jmp 0x44f34
movq 0x18(%rsp), %rdi
movq 0x80(%rsp), %rsi
callq 0x24010
movq %rax, 0x10(%rsp)
jmp 0x44f4d
movq 0x10(%rsp), %rdi
callq 0x240c0
jmp 0x44f59
leaq 0x40(%rsp), %rdi
callq 0xdf50
leaq 0x3f(%rsp), %rdi
callq 0xdf30
movl 0x64(%rsp), %eax
movl %eax, 0x28(%rsp)
cmpl $0x0, 0x28(%rsp)
jle 0x4509f
movq 0x70(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x44f9a
movq 0x8(%rsp), %rdi
callq 0xd760
leaq 0xaa04f(%rip), %rax     # 0xeeff0
movq (%rax), %rdi
movl 0x28(%rsp), %esi
callq 0xea50
movq %rax, 0x70(%rsp)
movq 0x70(%rsp), %rdi
addq $0xa8, %rdi
callq 0xd550
cmpq $0xf, %rax
jne 0x4507c
movq 0x70(%rsp), %rax
movsbl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4507c
movl 0x6c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jl 0x4507a
movl 0x6c(%rsp), %eax
cmpl 0x78(%rsp), %eax
jg 0x4507a
movq 0x80(%rsp), %rdi
leaq 0x7b059(%rip), %rsi     # 0xc006c
movb $0x0, %al
callq 0xb1bf0
movq 0x80(%rsp), %rdi
movq 0x70(%rsp), %rsi
movb 0x6b(%rsp), %al
movl $0x6, %edx
leaq 0x80b14(%rip), %r9      # 0xc5b4b
andb $0x1, %al
movzbl %al, %ecx
movq %r9, %r8
callq 0x3fe90
jmp 0x4507a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
jmp 0x4506e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x30(%rsp)
movl %eax, 0x2c(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xdf50
leaq 0x3f(%rsp), %rdi
callq 0xdf30
jmp 0x450c9
jmp 0x4507c
movl 0x6c(%rsp), %eax
movl 0x78(%rsp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jne 0x4508d
jmp 0x4509f
jmp 0x4508f
movl 0x28(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x44f75
cmpq $0x0, 0x70(%rsp)
je 0x450c1
movq 0x70(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x450bf
movq (%rsp), %rdi
callq 0xd760
jmp 0x450c1
addq $0x88, %rsp
retq
movq 0x30(%rsp), %rdi
callq 0xd8a0
nopw %cs:(%rax,%rax)