// File: /workspace/github_cpp_makefile_star2_O1/lega911[P]ijson/src/connect.cpp
// Function: Connect::send_details()
void Connect::send_details() {
    Buffer res(256);

    u64 stat_request = 0;
    u64 stat_call = 0;
    u64 stat_result = 0;
    u64 stat_recv = 0;
    u64 stat_send = 0;
    u64 stat_ioevent = 0;
    for(int i=0; i<server->threads; i++) {
        stat_request += server->loops[i]->stat_request;
        stat_call += server->loops[i]->stat_call;
        stat_result += server->loops[i]->stat_result;
        stat_recv += server->loops[i]->stat_recv;
        stat_send += server->loops[i]->stat_send;
        stat_ioevent += server->loops[i]->stat_ioevent;
    }

    res.add("{\"$info\":{");
    res.add("\"version\":\"");
    res.add(ijson_version);
    res.add("\",\"uptime\":");
    res.add_number(get_time_sec() - server->stat_starttime);
    res.add(",\"connect\":");
    res.add_number(server->stat_connect);
    res.add(",\"request\":");
    res.add_number(stat_request);
    res.add(",\"call\":");
    res.add_number(stat_call);
    res.add(",\"result\":");
    res.add_number(stat_result);
    res.add(",\"recv\":");
    res.add_number(stat_recv);
    res.add(",\"send\":");
    res.add_number(stat_send);
    res.add(",\"io_event\":");
    res.add_number(stat_ioevent);
    res.add("},\n");

    LOCK _l(server->global_lock);
    for(const auto &ql : server->_queue_list) {
        if(ql == NULL) continue;
        res.add("\"");
        res.add(ql->name);
        res.add("\":{\"last_worker\":");
        res.add_number(ql->last_worker);
        res.add(",\"worker_ids\":[");

        int worker_count = 0;
        int client_count = 0;
        bool first = true;
        for(int i=0;i<server->threads;i++) {
            for(const auto &w : ql->queue[i].workers) {
                if(first) {
                    first = false;
                    res.add("\"", 1);
                } else res.add(",\"", 2);
                if(w->connection_id) {
                    int start = res.size();
                    res.add(w->connection_id);
                    json::escape(res, start);
                }
                res.add("\"", 1);
                worker_count++;
            }
            client_count += ql->queue[i].clients.size();
        }
        res.add("],\"workers\":");
        res.add_number(worker_count);
        res.add(",\"clients\":");
        res.add_number(client_count);

        if(!ql->info.empty()) {
            res.add(",\"info\":\"");
            int start = res.size();
            res.add(ql->info);
            json::escape(res, start);
            res.add("\"");
        }
        res.add("},\n");
    };
    res.resize(0, res.size() - 2);
    res.add("}");
    send.status("200 OK")->done(res);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %rdi
movaps %xmm0, (%rdi)
movl $0x100, %esi            # imm = 0x100
callq 0xc5a2
movq %rbx, -0x48(%rbp)
movq 0x48(%rbx), %rcx
movslq 0x28(%rcx), %rax
testq %rax, %rax
jle 0xb345
movq 0x20050(%rcx), %rcx
xorl %edx, %edx
xorl %r14d, %r14d
xorl %ebx, %ebx
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %r15d, %r15d
xorl %edi, %edi
movq (%rcx,%rdx,8), %rsi
addq 0x78(%rsi), %r14
addq 0x80(%rsi), %rbx
addq 0x88(%rsi), %r13
addq 0x90(%rsi), %r12
addq 0x98(%rsi), %r15
addq 0xa0(%rsi), %rdi
incq %rdx
cmpq %rdx, %rax
jne 0xb310
jmp 0xb355
xorl %edi, %edi
xorl %r15d, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
xorl %ebx, %ebx
xorl %r14d, %r14d
movq %rdi, -0x50(%rbp)
leaq 0xc034(%rip), %rsi      # 0x17394
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq 0xc02f(%rip), %rsi      # 0x1739f
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq 0xc6d9(%rip), %rsi      # 0x17a59
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq 0xc01b(%rip), %rsi      # 0x173ab
leaq -0x40(%rbp), %rdi
callq 0xc41e
callq 0x16511
movl %eax, %esi
movq -0x48(%rbp), %rax
movq 0x48(%rax), %rax
subq 0x20180(%rax), %rsi
leaq -0x40(%rbp), %rdi
callq 0xc342
leaq 0xbff8(%rip), %rsi      # 0x173b7
leaq -0x40(%rbp), %rdi
callq 0xc41e
movq -0x48(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x20080(%rax), %rsi
leaq -0x40(%rbp), %rdi
callq 0xc342
leaq 0xbfdc(%rip), %rsi      # 0x173c3
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0xc342
leaq 0xbfcc(%rip), %rsi      # 0x173cf
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq -0x40(%rbp), %rdi
movq %rbx, %rsi
callq 0xc342
leaq 0xbfb9(%rip), %rsi      # 0x173d8
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq -0x40(%rbp), %rdi
movq %r13, %rsi
callq 0xc342
leaq 0xbfa8(%rip), %rsi      # 0x173e3
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0xc342
leaq 0xbf95(%rip), %rsi      # 0x173ec
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0xc342
leaq 0xbf82(%rip), %rsi      # 0x173f5
leaq -0x40(%rbp), %rdi
callq 0xc41e
leaq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rsi
callq 0xc342
leaq 0xbf72(%rip), %rsi      # 0x17402
leaq -0x40(%rbp), %rdi
callq 0xc41e
movl $0x20058, %edi          # imm = 0x20058
movq -0x48(%rbp), %r15
addq 0x48(%r15), %rdi
movq %rdi, -0x60(%rbp)
callq 0x83f0
testl %eax, %eax
jne 0xb7ed
movq 0x48(%r15), %rax
movq 0x20110(%rax), %r12
movq 0x20118(%rax), %rax
movq %rax, -0x70(%rbp)
cmpq %rax, %r12
je 0xb789
cmpq $0x0, (%r12)
leaq -0x40(%rbp), %rbx
je 0xb77b
movq %rbx, %rdi
leaq 0xbeba(%rip), %rsi      # 0x173a9
callq 0xc41e
movq (%r12), %rax
movq (%rax), %rsi
movl 0x8(%rax), %edx
movq %rbx, %rdi
callq 0xc0a8
movq %rbx, %rdi
leaq 0xbef6(%rip), %rsi      # 0x17406
callq 0xc41e
movq (%r12), %rax
movq 0x10(%rax), %rsi
movq %rbx, %rdi
callq 0xc342
movq %rbx, %rdi
leaq 0xbee9(%rip), %rsi      # 0x17418
callq 0xc41e
movq 0x48(%r15), %rax
cmpl $0x0, 0x28(%rax)
jle 0xb6e7
xorl %ecx, %ecx
movb $0x1, %al
movl %eax, -0x50(%rbp)
xorl %edi, %edi
xorl %r13d, %r13d
movq %r12, -0x78(%rbp)
movl %edi, -0x54(%rbp)
movq (%r12), %rax
movq 0x40(%rax), %rax
movq %rcx, -0x88(%rbp)
leaq (%rcx,%rcx,4), %rcx
shlq $0x5, %rcx
movq 0x10(%rax,%rcx), %r12
movq 0x30(%rax,%rcx), %rdx
movq %rdx, -0x90(%rbp)
cmpq %rdx, %r12
movq %rcx, -0x80(%rbp)
je 0xb668
addq %rcx, %rax
movq 0x20(%rax), %r14
movq 0x28(%rax), %rax
movq %rax, -0x68(%rbp)
testb $0x1, -0x50(%rbp)
je 0xb5c6
movl -0x38(%rbp), %esi
incl %esi
movq %rbx, %rdi
callq 0xc5a2
movq -0x40(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb $0x22, (%rax,%rcx)
movl $0x1, %eax
movl $0x0, -0x50(%rbp)
jmp 0xb5e7
movl -0x38(%rbp), %esi
addl $0x2, %esi
movq %rbx, %rdi
callq 0xc5a2
movq -0x40(%rbp), %rax
movslq -0x38(%rbp), %rcx
movw $0x222c, (%rax,%rcx)    # imm = 0x222C
movl $0x2, %eax
addl %eax, -0x38(%rbp)
movq (%r12), %rax
movl 0x108(%rax), %edx
testl %edx, %edx
leaq -0x40(%rbp), %r15
je 0xb618
movl -0x38(%rbp), %ebx
movq 0x100(%rax), %rsi
movq %r15, %rdi
callq 0xc0a8
movq %r15, %rdi
movl %ebx, %esi
callq 0xd56f
movl -0x38(%rbp), %esi
incl %esi
movq %r15, %rdi
callq 0xc5a2
movq %r15, %rbx
movq -0x40(%rbp), %rax
movslq -0x38(%rbp), %rcx
movb $0x22, (%rax,%rcx)
incl -0x38(%rbp)
addq $0x8, %r12
cmpq %r14, %r12
jne 0xb658
movq -0x68(%rbp), %rax
movq 0x8(%rax), %r12
addq $0x8, %rax
movq %rax, -0x68(%rbp)
leaq 0x200(%r12), %r14
incl %r13d
cmpq -0x90(%rbp), %r12
jne 0xb599
movq -0x78(%rbp), %r12
movq (%r12), %rax
movq 0x40(%rax), %rax
movq -0x80(%rbp), %rdi
movq 0x98(%rax,%rdi), %rcx
movl 0x78(%rax,%rdi), %edx
movl %ecx, %esi
subl %edx, %esi
shrl $0x3, %esi
cmpq $0x1, %rcx
adcl $-0x1, %esi
shll $0x6, %esi
movq 0x80(%rax,%rdi), %rcx
subq 0x88(%rax,%rdi), %rcx
movq 0x70(%rax,%rdi), %rdx
shrq $0x3, %rcx
subq 0x60(%rax,%rdi), %rdx
shrq $0x3, %rdx
addl %ecx, %edx
movl -0x54(%rbp), %edi
addl %edx, %edi
addl %esi, %edi
movq -0x88(%rbp), %rcx
incq %rcx
movq -0x48(%rbp), %r15
movq 0x48(%r15), %rax
movslq 0x28(%rax), %rax
cmpq %rax, %rcx
jl 0xb552
movslq %r13d, %r14
movslq %edi, %rbx
jmp 0xb6ec
xorl %r14d, %r14d
xorl %ebx, %ebx
leaq -0x40(%rbp), %r13
movq %r13, %rdi
leaq 0xbd2e(%rip), %rsi      # 0x17428
callq 0xc41e
movq %r13, %rdi
movq %r14, %rsi
callq 0xc342
movq %r13, %rdi
leaq 0xbd21(%rip), %rsi      # 0x17435
callq 0xc41e
movq %r13, %rdi
movq %rbx, %rsi
callq 0xc342
movq (%r12), %rax
cmpl $0x0, 0x50(%rax)
je 0xb76c
movq %r13, %rdi
leaq 0xbd09(%rip), %rsi      # 0x17441
callq 0xc41e
movl -0x38(%rbp), %ebx
movq (%r12), %rax
movq 0x48(%rax), %rsi
movl 0x50(%rax), %edx
movq %r13, %rdi
callq 0xc0a8
movq %r13, %rdi
movl %ebx, %esi
callq 0xd56f
movq %r13, %rdi
leaq 0xbc42(%rip), %rsi      # 0x173a9
callq 0xc41e
movq %r13, %rdi
leaq 0xbc8c(%rip), %rsi      # 0x17402
callq 0xc41e
addq $0x8, %r12
cmpq -0x70(%rbp), %r12
jne 0xb4d6
leaq -0x40(%rbp), %rdi
movl 0x8(%rdi), %ebx
xorl %esi, %esi
callq 0xc5a2
addl $-0x2, %ebx
leaq -0x40(%rbp), %rdi
movl %ebx, 0x8(%rdi)
leaq 0xc1f8(%rip), %rsi      # 0x179a0
callq 0xc41e
addq $0x18, %r15
leaq 0xba81(%rip), %rsi      # 0x17239
movq %r15, %rdi
callq 0x9ee0
leaq -0x40(%rbp), %rsi
movq %r15, %rdi
callq 0xa704
movq -0x60(%rbp), %rdi
callq 0x8240
leaq -0x40(%rbp), %rdi
callq 0xc536
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %edi
callq 0x81d0
jmp 0xb7f8
jmp 0xb805
movq %rax, %rbx
jmp 0xb811
jmp 0xb805
jmp 0xb805
jmp 0xb805
jmp 0xb805
movq %rax, %rbx
movq -0x60(%rbp), %rdi
callq 0x8240
leaq -0x40(%rbp), %rdi
callq 0xc536
movq %rbx, %rdi
callq 0x84a0