// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x88(%rsi), %ecx
testb $0x4, %cl
jne 0x23e43
leaq 0x10(%rsp), %rax
jmp 0x23e4c
leaq 0x11(%rsp), %rax
movb $0x4f, -0x1(%rax)
testb $0x10, %cl
je 0x23e57
movb $0x62, (%rax)
incq %rax
testb $0x40, %cl
je 0x23e62
movb $0x63, (%rax)
incq %rax
testb $-0x80, 0x88(%r14)
je 0x23e72
movb $0x75, (%rax)
incq %rax
testb $0x4, 0x89(%r14)
je 0x23e82
movb $0x41, (%rax)
incq %rax
testb $0x8, 0x89(%r14)
je 0x23e92
movb $0x55, (%rax)
incq %rax
leaq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x23ea2
movb $0x4e, (%rax)
incq %rax
movb $0x0, (%rax)
movl 0x8(%r14), %esi
cmpl $-0x1, %esi
je 0x23ec0
leaq 0x4b1d3(%rip), %rax     # 0x6f088
movq 0x38(%rax), %rdi
callq 0x171f9
jmp 0x23ec2
xorl %eax, %eax
testb $0x1, %al
jne 0x23ecd
leaq 0xd(%rsp), %rcx
jmp 0x23ed6
leaq 0xe(%rsp), %rcx
movb $0x72, -0x1(%rcx)
testb $0x2, %al
je 0x23ee0
movb $0x77, (%rcx)
incq %rcx
movb $0x0, (%rcx)
movq (%r14), %r15
movq %r14, %rdi
callq 0x2422b
movq 0x10(%r14), %rcx
testq %rcx, %rcx
je 0x23efd
movq 0x8(%rcx), %r9
jmp 0x23f04
leaq 0x31301(%rip), %r9      # 0x55205
movq 0xa8(%r14), %rcx
testq %rcx, %rcx
je 0x23f1a
movl 0x48(%rcx), %r8d
addl 0x28(%rcx), %r8d
jmp 0x23f1d
xorl %r8d, %r8d
movq 0x18(%r14), %rcx
movzbl -0x1(%rcx), %r10d
movl %r10d, %edx
andl $0x7, %edx
cmpl $0x4, %edx
ja 0x23f61
leaq 0x30c50(%rip), %rsi     # 0x54b88
movslq (%rsi,%rdx,4), %rdi
addq %rsi, %rdi
jmpq *%rdi
shrl $0x3, %r10d
jmp 0x23f64
movq -0x11(%rcx), %r10
jmp 0x23f64
movzwl -0x5(%rcx), %r10d
jmp 0x23f64
movl -0x9(%rcx), %r10d
jmp 0x23f64
movzbl -0x3(%rcx), %r10d
jmp 0x23f64
xorl %r10d, %r10d
leaq 0x4b11d(%rip), %rsi     # 0x6f088
decl %edx
cmpl $0x3, %edx
movq %r8, 0x40(%rsp)
movq %rax, 0x38(%rsp)
movq %r9, 0x30(%rsp)
movq %r10, 0x28(%rsp)
ja 0x23fdb
leaq 0x30c0f(%rip), %rdi     # 0x54b9c
movslq (%rdi,%rdx,4), %rdx
addq %rdi, %rdx
jmpq *%rdx
movq %r15, %r9
movq %rbx, %rax
movzbl -0x2(%rcx), %r13d
movzbl -0x3(%rcx), %ecx
jmp 0x23fd6
movq %r15, %r9
movq %rbx, %rax
movl -0x5(%rcx), %r13d
subl -0x9(%rcx), %r13d
jmp 0x23fe4
movq %r15, %r9
movq %rbx, %rax
movq -0x9(%rcx), %r13
subq -0x11(%rcx), %r13
jmp 0x23fe4
movq %r15, %r9
movq %rbx, %rax
movzwl -0x3(%rcx), %r13d
movzwl -0x5(%rcx), %ecx
subq %rcx, %r13
jmp 0x23fe4
movq %r15, %r9
movq %rbx, %rax
xorl %r13d, %r13d
movl 0x8(%r14), %r8d
movq 0x648(%rsi), %r15
movq 0x70(%r14), %rcx
movq 0x78(%r14), %rdx
movslq 0xb8(%r14), %r12
movq 0x40(%r14), %rsi
movq 0x58(%r14), %rdi
movq 0x28(%rdi), %rbx
movq 0x60(%r14), %r14
testq %rsi, %rsi
je 0x24018
movq (%rsi), %r10
jmp 0x2401f
leaq 0x34e29(%rip), %r10     # 0x58e48
leaq (%rbx,%rbx,8), %rsi
leaq (%rsi,%rsi,2), %rsi
addq %rbx, %r14
addq %rbx, %r14
addq %rsi, %r14
movq %r15, %rbp
subq %rdx, %rbp
subq %rcx, %r15
subq $0x8, %rsp
leaq 0x15(%rsp), %r11
leaq 0x30e8a(%rip), %rsi     # 0x54ed3
movq %rax, %rdi
movq %r9, %rdx
movq 0x40(%rsp), %rcx
movq 0x38(%rsp), %r9
xorl %eax, %eax
pushq %r10
pushq %r11
pushq %r14
pushq %rbx
pushq %r12
pushq %r13
pushq 0x60(%rsp)
pushq 0x80(%rsp)
leaq 0x58(%rsp), %r10
pushq %r10
pushq %rbp
pushq %r15
callq 0x1eb52
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq