// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/networking.c
// Function: catClientInfoString
sds catClientInfoString(sds s, client *client) {
    char flags[16], events[3], *p;
    int emask;

    p = flags;
    if (client->flags & CLIENT_SLAVE) {
        if (client->flags & CLIENT_MONITOR)
            *p++ = 'O';
        else
            *p++ = 'S';
    }
    if (client->flags & CLIENT_MASTER) *p++ = 'M';
    if (client->flags & CLIENT_MULTI) *p++ = 'x';
    if (client->flags & CLIENT_BLOCKED) *p++ = 'b';
    if (client->flags & CLIENT_DIRTY_CAS) *p++ = 'd';
    if (client->flags & CLIENT_CLOSE_AFTER_REPLY) *p++ = 'c';
    if (client->flags & CLIENT_UNBLOCKED) *p++ = 'u';
    if (client->flags & CLIENT_CLOSE_ASAP) *p++ = 'A';
    if (client->flags & CLIENT_UNIX_SOCKET) *p++ = 'U';
    if (client->flags & CLIENT_READONLY) *p++ = 'r';
    if (p == flags) *p++ = 'N';
    *p++ = '\0';

    emask = client->fd == -1 ? 0 : aeGetFileEvents(server.el,client->fd);
    p = events;
    if (emask & AE_READABLE) *p++ = 'r';
    if (emask & AE_WRITABLE) *p++ = 'w';
    *p = '\0';
    return sdscatfmt(s,
        "id=%U addr=%s fd=%i name=%s age=%I idle=%I flags=%s db=%i sub=%i psub=%i multi=%i qbuf=%U qbuf-free=%U obl=%U oll=%U omem=%U events=%s cmd=%s",
        (unsigned long long) client->id,
        getClientPeerId(client),
        client->fd,
        client->name ? (char*)client->name->ptr : "",
        (long long)(server.unixtime - client->ctime),
        (long long)(server.unixtime - client->lastinteraction),
        flags,
        client->db->id,
        (int) dictSize(client->pubsub_channels),
        (int) listLength(client->pubsub_patterns),
        (client->flags & CLIENT_MULTI) ? client->mstate.count : -1,
        (unsigned long long) sdslen(client->querybuf),
        (unsigned long long) sdsavail(client->querybuf),
        (unsigned long long) client->bufpos,
        (unsigned long long) listLength(client->reply),
        (unsigned long long) getClientOutputBufferMemoryUsage(client),
        events,
        client->lastcmd ? client->lastcmd->name : "NULL");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r14
movq %rdi, 0x60(%rsp)
movl 0x98(%rsi), %ecx
testb $0x1, %cl
jne 0x383d4
leaq 0x20(%rsp), %rax
jmp 0x383ea
leaq 0x21(%rsp), %rax
testb $0x4, %cl
jne 0x383e5
movb $0x53, 0x20(%rsp)
jmp 0x383ea
movb $0x4f, 0x20(%rsp)
testb $0x2, %cl
je 0x383f5
movb $0x4d, (%rax)
incq %rax
testb $0x8, %cl
je 0x38407
movb $0x78, (%rax)
incq %rax
movl 0x98(%r14), %ecx
testb $0x10, %cl
je 0x38419
movb $0x62, (%rax)
incq %rax
movl 0x98(%r14), %ecx
testb $0x20, %cl
je 0x3842b
movb $0x64, (%rax)
incq %rax
movl 0x98(%r14), %ecx
testb $0x40, %cl
je 0x3843d
movb $0x63, (%rax)
incq %rax
movl 0x98(%r14), %ecx
testb %cl, %cl
jns 0x3844e
movb $0x75, (%rax)
incq %rax
movl 0x98(%r14), %ecx
btl $0xa, %ecx
jae 0x38461
movb $0x41, (%rax)
incq %rax
movl 0x98(%r14), %ecx
btl $0xb, %ecx
jae 0x38474
movb $0x55, (%rax)
incq %rax
movl 0x98(%r14), %ecx
btl $0x11, %ecx
jae 0x38480
movb $0x72, (%rax)
incq %rax
leaq 0x20(%rsp), %rcx
cmpq %rcx, %rax
jne 0x38490
movb $0x4e, (%rax)
incq %rax
movb $0x0, (%rax)
movl 0x8(%r14), %esi
cmpl $-0x1, %esi
je 0x384b7
leaq 0xc1405(%rip), %rax     # 0xf98a8
movq 0x40(%rax), %rdi
callq 0x28c68
testb $0x1, %al
jne 0x384be
leaq 0x5(%rsp), %rcx
jmp 0x384c7
leaq 0x5(%rsp), %rcx
jmp 0x384d1
leaq 0x6(%rsp), %rcx
movb $0x72, -0x1(%rcx)
testb $0x2, %al
je 0x384d1
movb $0x77, (%rcx)
incq %rcx
movb $0x0, (%rcx)
movq (%r14), %rax
movq %rax, 0x58(%rsp)
movq %r14, %rdi
callq 0x38731
movq %rax, 0x50(%rsp)
movq 0x20(%r14), %rax
testq %rax, %rax
je 0x384f8
movq 0x8(%rax), %r13
jmp 0x384ff
leaq 0x79f06(%rip), %r13     # 0xb2405
leaq 0xc13a2(%rip), %rsi     # 0xf98a8
movq 0x10(%r14), %rdx
movq 0x1a8(%r14), %rax
movq 0x1b0(%r14), %rcx
testb $0x8, 0x98(%r14)
movq %r13, 0x18(%rsp)
jne 0x3852c
pushq $-0x1
popq %rdi
jmp 0x38533
movl 0x158(%r14), %edi
movq %rdi, 0x30(%rsp)
movl 0x8(%r14), %ebp
movq 0x978(%rsi), %r15
movq 0x80(%r14), %rsi
movq %rsi, 0x8(%rsp)
movq 0x88(%r14), %rsi
movq %rsi, 0x10(%rsp)
movl 0x30(%rdx), %edx
movq %rdx, 0x48(%rsp)
movq 0x28(%rax), %r13
movq 0x48(%rax), %r12
movq 0x28(%rcx), %rax
movq %rax, 0x40(%rsp)
movq 0x28(%r14), %rbx
movq %rbx, %rdi
callq 0x3670c
movzbl -0x1(%rbx), %edx
andl $0x7, %edx
decl %edx
cmpl $0x3, %edx
movq %rax, 0x38(%rsp)
ja 0x385d0
leaq 0x7932a(%rip), %rcx     # 0xb18c4
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movzbl -0x2(%rbx), %r11d
movzbl -0x3(%rbx), %eax
jmp 0x385cb
movl -0x5(%rbx), %r11d
subl -0x9(%rbx), %r11d
jmp 0x385d3
movq -0x9(%rbx), %r11
subq -0x11(%rbx), %r11
jmp 0x385d3
movzwl -0x3(%rbx), %r11d
movzwl -0x5(%rbx), %eax
subq %rax, %r11
jmp 0x385d3
xorl %r11d, %r11d
movq 0x18(%rsp), %r9
movl %ebp, %r8d
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r13, %rdi
movslq 0x1c0(%r14), %rbx
movq 0x50(%r14), %rcx
movq 0x68(%r14), %rax
movq 0x28(%rax), %r10
movq 0x70(%r14), %rax
testq %rcx, %rcx
je 0x38609
movq (%rcx), %rbp
jmp 0x38610
leaq 0x7c63f(%rip), %rbp     # 0xb4c4f
imulq $0x28, %r10, %r13
addq %rax, %r13
addl %edi, %r12d
movq %r15, %r14
subq %rsi, %r14
subq %rdx, %r15
leaq 0x795d3(%rip), %rsi     # 0xb1bfd
movq 0x60(%rsp), %rdi
movq 0x58(%rsp), %rdx
movq 0x50(%rsp), %rcx
xorl %eax, %eax
pushq %rbp
leaq 0xd(%rsp), %rbp
pushq %rbp
pushq %r13
pushq %r10
pushq %rbx
pushq %r11
pushq 0x68(%rsp)
pushq 0x68(%rsp)
pushq 0x80(%rsp)
pushq %r12
pushq 0x98(%rsp)
leaq 0x78(%rsp), %r10
pushq %r10
pushq %r14
pushq %r15
callq 0x31abc
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq