// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/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 $0x58, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x98(%rsi), %ecx
testb $0x1, %cl
jne 0x41d00
leaq 0x10(%rsp), %rax
jmp 0x41d16
leaq 0x11(%rsp), %rax
testb $0x4, %cl
jne 0x41d11
movb $0x53, 0x10(%rsp)
jmp 0x41d16
movb $0x4f, 0x10(%rsp)
testb $0x2, %cl
je 0x41d21
movb $0x4d, (%rax)
incq %rax
testb $0x8, %cl
je 0x41d2c
movb $0x78, (%rax)
incq %rax
testb $0x10, 0x98(%r14)
je 0x41d3c
movb $0x62, (%rax)
incq %rax
testb $0x20, 0x98(%r14)
je 0x41d4c
movb $0x64, (%rax)
incq %rax
testb $0x40, 0x98(%r14)
je 0x41d5c
movb $0x63, (%rax)
incq %rax
testb $-0x80, 0x98(%r14)
je 0x41d6c
movb $0x75, (%rax)
incq %rax
testb $0x4, 0x99(%r14)
je 0x41d7c
movb $0x41, (%rax)
incq %rax
testb $0x8, 0x99(%r14)
je 0x41d8c
movb $0x55, (%rax)
incq %rax
testb $0x2, 0x9a(%r14)
je 0x41d9c
movb $0x72, (%rax)
incq %rax
leaq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x41dac
movb $0x4e, (%rax)
incq %rax
movb $0x0, (%rax)
movl 0x8(%r14), %esi
cmpl $-0x1, %esi
je 0x41dca
leaq 0xc4a99(%rip), %rax     # 0x106858
movq 0x40(%rax), %rdi
callq 0x30078
jmp 0x41dcc
xorl %eax, %eax
testb $0x1, %al
jne 0x41dd7
leaq 0xd(%rsp), %rcx
jmp 0x41de0
leaq 0xe(%rsp), %rcx
movb $0x72, -0x1(%rcx)
testb $0x2, %al
je 0x41dea
movb $0x77, (%rcx)
incq %rcx
movb $0x0, (%rcx)
movq (%r14), %r15
movq %r14, %rdi
callq 0x4210d
movq 0x20(%r14), %rcx
testq %rcx, %rcx
je 0x41e07
movq 0x8(%rcx), %r9
jmp 0x41e0e
leaq 0x81c5f(%rip), %r9      # 0xc3a6d
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
testb $0x8, 0x98(%r14)
je 0x41e24
movl 0x158(%r14), %edi
movq 0x28(%r14), %rcx
movzbl -0x1(%rcx), %r11d
movl %r11d, %r8d
andl $0x7, %r8d
cmpl $0x4, %r8d
movq %rdi, 0x50(%rsp)
movq %rax, 0x48(%rsp)
movq %rbx, 0x40(%rsp)
ja 0x41e79
leaq 0x81024(%rip), %rdx     # 0xc2e74
movslq (%rdx,%r8,4), %rsi
addq %rdx, %rsi
jmpq *%rsi
shrl $0x3, %r11d
jmp 0x41e7c
movq -0x11(%rcx), %r11
jmp 0x41e7c
movzwl -0x5(%rcx), %r11d
jmp 0x41e7c
movl -0x9(%rcx), %r11d
jmp 0x41e7c
movzbl -0x3(%rcx), %r11d
jmp 0x41e7c
xorl %r11d, %r11d
leaq 0xc49d5(%rip), %rbx     # 0x106858
movq 0x10(%r14), %rdi
movq 0x1a8(%r14), %rdx
movq 0x1b0(%r14), %rsi
decl %r8d
cmpl $0x3, %r8d
movq %r11, 0x38(%rsp)
ja 0x41eed
leaq 0x80fde(%rip), %r10     # 0xc2e88
movslq (%r10,%r8,4), %r8
addq %r10, %r8
jmpq *%r8
movq %r15, %rax
movzbl -0x2(%rcx), %r13d
movzbl -0x3(%rcx), %ecx
jmp 0x41ee8
movq %r15, %rax
movl -0x5(%rcx), %r13d
subl -0x9(%rcx), %r13d
jmp 0x41ef3
movq %r15, %rax
movq -0x9(%rcx), %r13
subq -0x11(%rcx), %r13
jmp 0x41ef3
movq %r15, %rax
movzwl -0x3(%rcx), %r13d
movzwl -0x5(%rcx), %ecx
subq %rcx, %r13
jmp 0x41ef3
movq %r15, %rax
xorl %r13d, %r13d
movl 0x8(%r14), %r8d
movq 0x968(%rbx), %rbp
movq 0x80(%r14), %rcx
movq 0x88(%r14), %r15
movl 0x30(%rdi), %edi
movq %rdi, 0x30(%rsp)
movq 0x28(%rdx), %rdi
movq 0x48(%rdx), %r12
movq 0x28(%rsi), %rdx
movq %rdx, 0x28(%rsp)
movslq 0x1c0(%r14), %rdx
movq %rdx, 0x20(%rsp)
movq 0x50(%r14), %rsi
movq 0x68(%r14), %rdx
movq 0x28(%rdx), %rbx
movq 0x70(%r14), %rdx
testq %rsi, %rsi
je 0x41f4b
movq (%rsi), %r11
jmp 0x41f52
leaq 0x84801(%rip), %r11     # 0xc6753
leaq (%rbx,%rbx,4), %rsi
leaq (%rdx,%rsi,8), %r10
addl %edi, %r12d
movq %rbp, %r14
subq %r15, %r14
subq %rcx, %rbp
leaq 0xd(%rsp), %r15
leaq 0x8129f(%rip), %rsi     # 0xc3211
movq 0x40(%rsp), %rdi
movq %rax, %rdx
movq 0x48(%rsp), %rcx
xorl %eax, %eax
pushq %r11
pushq %r15
pushq %r10
pushq %rbx
pushq 0x40(%rsp)
pushq %r13
pushq 0x68(%rsp)
pushq 0x88(%rsp)
pushq 0x68(%rsp)
pushq %r12
pushq 0x80(%rsp)
leaq 0x68(%rsp), %r10
pushq %r10
pushq %r14
pushq %rbp
callq 0x39f3b
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq