// File: /workspace/github_c_makefile_star2_O2/erikdubbelboer[P]discnt/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_MONITOR) *p++ = 'O';
    if (client->flags & CLIENT_BLOCKED) *p++ = 'b';
    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 (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 sub=%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->sub_counters ? (int) dictSize(client->sub_counters) : 0,
        (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 $0x58, %rsp
movq %rsi, %r14
movq %rdi, 0x50(%rsp)
movl 0x88(%rsi), %ecx
testb $0x4, %cl
jne 0x1e139
leaq 0x20(%rsp), %rax
jmp 0x1e142
leaq 0x21(%rsp), %rax
movb $0x4f, -0x1(%rax)
testb $0x10, %cl
je 0x1e14d
movb $0x62, (%rax)
incq %rax
testb $0x40, %cl
je 0x1e15f
movb $0x63, (%rax)
incq %rax
movl 0x88(%r14), %ecx
testb %cl, %cl
jns 0x1e170
movb $0x75, (%rax)
incq %rax
movl 0x88(%r14), %ecx
btl $0xa, %ecx
jae 0x1e183
movb $0x41, (%rax)
incq %rax
movl 0x88(%r14), %ecx
btl $0xb, %ecx
jae 0x1e18f
movb $0x55, (%rax)
incq %rax
leaq 0x20(%rsp), %rcx
cmpq %rcx, %rax
jne 0x1e1a2
leaq 0x21(%rsp), %rax
movb $0x4e, -0x1(%rax)
movb $0x0, (%rax)
movl 0x8(%r14), %esi
cmpl $-0x1, %esi
je 0x1e1c9
leaq 0x4bed3(%rip), %rax     # 0x6a088
movq 0x38(%rax), %rdi
callq 0x131f8
testb $0x1, %al
jne 0x1e1d0
leaq 0xd(%rsp), %rcx
jmp 0x1e1d9
leaq 0xd(%rsp), %rcx
jmp 0x1e1e3
leaq 0xe(%rsp), %rcx
movb $0x72, -0x1(%rcx)
testb $0x2, %al
je 0x1e1e3
movb $0x77, (%rcx)
incq %rcx
movb $0x0, (%rcx)
movq (%r14), %rax
movq %rax, 0x48(%rsp)
movq %r14, %rdi
callq 0x1e448
movq %rax, 0x40(%rsp)
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x1e20a
movq 0x8(%rax), %r15
jmp 0x1e211
leaq 0x3093c(%rip), %r15     # 0x4eb4d
leaq 0x4be70(%rip), %rax     # 0x6a088
movq 0xa8(%r14), %rcx
testq %rcx, %rcx
movq %r15, 0x10(%rsp)
je 0x1e236
movl 0x48(%rcx), %edx
addl 0x28(%rcx), %edx
movq %rdx, 0x18(%rsp)
jmp 0x1e23f
movq $0x0, 0x18(%rsp)
movl 0x8(%r14), %ebp
movq 0x648(%rax), %r12
movq 0x70(%r14), %r13
movq 0x78(%r14), %r15
movq 0x18(%r14), %rbx
movq %rbx, %rdi
callq 0x1c6dd
movzbl -0x1(%rbx), %edx
andl $0x7, %edx
decl %edx
cmpl $0x3, %edx
movq %rax, 0x38(%rsp)
ja 0x1e2ae
leaq 0x3030c(%rip), %rcx     # 0x4e584
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movzbl -0x2(%rbx), %r11d
movzbl -0x3(%rbx), %eax
jmp 0x1e2a9
movl -0x5(%rbx), %r11d
subl -0x9(%rbx), %r11d
jmp 0x1e2b1
movq -0x9(%rbx), %r11
subq -0x11(%rbx), %r11
jmp 0x1e2b1
movzwl -0x3(%rbx), %r11d
movzwl -0x5(%rbx), %eax
subq %rax, %r11
jmp 0x1e2b1
xorl %r11d, %r11d
movq 0x10(%rsp), %r9
movl %ebp, %r8d
movq %r13, %rdx
movslq 0xb8(%r14), %rbx
movq 0x40(%r14), %rcx
movq 0x58(%r14), %rax
movq 0x28(%rax), %r10
movq 0x60(%r14), %rax
testq %rcx, %rcx
je 0x1e2dd
movq (%rcx), %r13
jmp 0x1e2e4
leaq 0x341b8(%rip), %r13     # 0x5249c
imulq $0x1d, %r10, %rbp
addq %rax, %rbp
movq %r12, %r14
subq %r15, %r14
subq %rdx, %r12
subq $0x8, %rsp
leaq 0x15(%rsp), %r15
leaq 0x30567(%rip), %rsi     # 0x4e86b
movq 0x58(%rsp), %rdi
movq 0x50(%rsp), %rdx
movq 0x48(%rsp), %rcx
xorl %eax, %eax
pushq %r13
pushq %r15
pushq %rbp
pushq %r10
pushq %rbx
pushq %r11
pushq 0x70(%rsp)
pushq 0x58(%rsp)
leaq 0x68(%rsp), %r10
pushq %r10
pushq %r14
pushq %r12
callq 0x19e3c
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq