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

    p = flags;
    if (client->flags & REDIS_SLAVE) {
        if (client->flags & REDIS_MONITOR)
            *p++ = 'O';
        else
            *p++ = 'S';
    }
    if (client->flags & REDIS_MASTER) *p++ = 'M';
    if (client->flags & REDIS_MULTI) *p++ = 'x';
    if (client->flags & REDIS_BLOCKED) *p++ = 'b';
    if (client->flags & REDIS_DIRTY_CAS) *p++ = 'd';
    if (client->flags & REDIS_CLOSE_AFTER_REPLY) *p++ = 'c';
    if (client->flags & REDIS_UNBLOCKED) *p++ = 'u';
    if (client->flags & REDIS_CLOSE_ASAP) *p++ = 'A';
    if (client->flags & REDIS_UNIX_SOCKET) *p++ = 'U';
    if (client->flags & REDIS_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,
        "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",
        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 & REDIS_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 $0x48, %rsp
movq %rsi, %r14
movq %rdi, 0x40(%rsp)
movl 0x90(%rsi), %ecx
testb $0x1, %cl
jne 0x2f102
leaq 0x10(%rsp), %rax
jmp 0x2f118
leaq 0x11(%rsp), %rax
testb $0x4, %cl
jne 0x2f113
movb $0x53, 0x10(%rsp)
jmp 0x2f118
movb $0x4f, 0x10(%rsp)
testb $0x2, %cl
je 0x2f123
movb $0x4d, (%rax)
incq %rax
testb $0x8, %cl
je 0x2f135
movb $0x78, (%rax)
incq %rax
movl 0x90(%r14), %ecx
testb $0x10, %cl
je 0x2f147
movb $0x62, (%rax)
incq %rax
movl 0x90(%r14), %ecx
testb $0x20, %cl
je 0x2f159
movb $0x64, (%rax)
incq %rax
movl 0x90(%r14), %ecx
testb $0x40, %cl
je 0x2f16b
movb $0x63, (%rax)
incq %rax
movl 0x90(%r14), %ecx
testb %cl, %cl
jns 0x2f17c
movb $0x75, (%rax)
incq %rax
movl 0x90(%r14), %ecx
btl $0xa, %ecx
jae 0x2f18f
movb $0x41, (%rax)
incq %rax
movl 0x90(%r14), %ecx
btl $0xb, %ecx
jae 0x2f1a2
movb $0x55, (%rax)
incq %rax
movl 0x90(%r14), %ecx
btl $0x11, %ecx
jae 0x2f1ae
movb $0x72, (%rax)
incq %rax
leaq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x2f1be
movb $0x4e, (%rax)
incq %rax
movb $0x0, (%rax)
movl (%r14), %esi
cmpl $-0x1, %esi
je 0x2f1e4
leaq 0x9add8(%rip), %rax     # 0xc9fa8
movq 0x28(%rax), %rdi
callq 0x20dac
testb $0x1, %al
jne 0x2f1eb
leaq 0xd(%rsp), %rcx
jmp 0x2f1f4
leaq 0xd(%rsp), %rcx
jmp 0x2f1fe
leaq 0xe(%rsp), %rcx
movb $0x72, -0x1(%rcx)
testb $0x2, %al
je 0x2f1fe
movb $0x77, (%rcx)
incq %rcx
movb $0x0, (%rcx)
movq %r14, %rdi
callq 0x2f4c0
movq 0x18(%r14), %rcx
testq %rcx, %rcx
je 0x2f218
movq 0x8(%rcx), %r8
jmp 0x2f21f
leaq 0x68122(%rip), %r8      # 0x97341
leaq 0x9ad82(%rip), %rdx     # 0xc9fa8
movq 0x8(%r14), %rdi
movq 0x158(%r14), %r11
movq 0x160(%r14), %rbx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testb $0x8, 0x90(%r14)
je 0x2f24e
movl 0x108(%r14), %ecx
movq %rcx, 0x38(%rsp)
movl (%r14), %ecx
movq 0x798(%rdx), %r9
movq 0x78(%r14), %rdx
movq 0x80(%r14), %rsi
movl 0x30(%rdi), %edi
movq %rdi, 0x30(%rsp)
movq 0x28(%r11), %rdi
movq 0x48(%r11), %r12
movq 0x28(%rbx), %r10
movq %r10, 0x28(%rsp)
movq 0x20(%r14), %r11
movq 0x48(%r14), %r13
movslq -0x8(%r11), %r10
movq %r10, 0x20(%rsp)
movslq -0x4(%r11), %rbx
movslq 0x170(%r14), %r15
movq 0x60(%r14), %r11
movq 0x28(%r11), %r11
movq 0x68(%r14), %r14
testq %r13, %r13
je 0x2f2b4
movq (%r13), %r13
jmp 0x2f2bb
leaq 0x6a041(%rip), %r13     # 0x992fc
leaq (%r11,%r11,4), %r10
leaq (%r14,%r10,8), %r10
addl %edi, %r12d
movq %r9, %r14
subq %rsi, %r14
subq %rdx, %r9
subq $0x8, %rsp
leaq 0x15(%rsp), %rbp
leaq 0x67dbc(%rip), %rsi     # 0x9709b
movq 0x48(%rsp), %rdi
movq %rax, %rdx
xorl %eax, %eax
pushq %r13
pushq %rbp
pushq %r10
pushq %r11
pushq %r15
pushq %rbx
pushq 0x58(%rsp)
pushq 0x78(%rsp)
pushq 0x70(%rsp)
pushq %r12
pushq 0x88(%rsp)
leaq 0x70(%rsp), %r10
pushq %r10
pushq %r14
callq 0x28ae2
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq