// File: /workspace/github_c_makefile_star2_O1/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 0x2ee49
leaq 0x10(%rsp), %rax
jmp 0x2ee5f
leaq 0x11(%rsp), %rax
testb $0x4, %cl
jne 0x2ee5a
movb $0x53, 0x10(%rsp)
jmp 0x2ee5f
movb $0x4f, 0x10(%rsp)
testb $0x2, %cl
je 0x2ee6a
movb $0x4d, (%rax)
incq %rax
testb $0x8, %cl
je 0x2ee75
movb $0x78, (%rax)
incq %rax
testb $0x10, 0x90(%r14)
je 0x2ee85
movb $0x62, (%rax)
incq %rax
testb $0x20, 0x90(%r14)
je 0x2ee95
movb $0x64, (%rax)
incq %rax
testb $0x40, 0x90(%r14)
je 0x2eea5
movb $0x63, (%rax)
incq %rax
testb $-0x80, 0x90(%r14)
je 0x2eeb5
movb $0x75, (%rax)
incq %rax
testb $0x4, 0x91(%r14)
je 0x2eec5
movb $0x41, (%rax)
incq %rax
testb $0x8, 0x91(%r14)
je 0x2eed5
movb $0x55, (%rax)
incq %rax
testb $0x2, 0x92(%r14)
je 0x2eee5
movb $0x72, (%rax)
incq %rax
leaq 0x10(%rsp), %rcx
cmpq %rcx, %rax
jne 0x2eef5
movb $0x4e, (%rax)
incq %rax
movb $0x0, (%rax)
movl (%r14), %esi
cmpl $-0x1, %esi
je 0x2ef12
leaq 0x9b0a1(%rip), %rax     # 0xc9fa8
movq 0x28(%rax), %rdi
callq 0x20b4d
jmp 0x2ef14
xorl %eax, %eax
testb $0x1, %al
jne 0x2ef1f
leaq 0xd(%rsp), %rcx
jmp 0x2ef28
leaq 0xe(%rsp), %rcx
movb $0x72, -0x1(%rcx)
testb $0x2, %al
je 0x2ef32
movb $0x77, (%rcx)
incq %rcx
movb $0x0, (%rcx)
movq %r14, %rdi
callq 0x2f1cd
movq 0x18(%r14), %rcx
testq %rcx, %rcx
je 0x2ef4c
movq 0x8(%rcx), %r8
jmp 0x2ef53
leaq 0x6838e(%rip), %r8      # 0x972e1
leaq 0x9b04e(%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 0x2ef82
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 0x2efe8
movq (%r13), %r13
jmp 0x2efef
leaq 0x6a2c4(%rip), %r13     # 0x992b3
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 0x68028(%rip), %rsi     # 0x9703b
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 0x287e4
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq