// File: /workspace/github_c_makefile_star2_O1/zhou-yuxin[P]redis-aof-no-cow/src/sentinel.c
// Function: sentinelInfoCommand
void sentinelInfoCommand(client *c) {
    if (c->argc > 2) {
        addReply(c,shared.syntaxerr);
        return;
    }

    int defsections = 0, allsections = 0;
    char *section = c->argc == 2 ? c->argv[1]->ptr : NULL;
    if (section) {
        allsections = !strcasecmp(section,"all");
        defsections = !strcasecmp(section,"default");
    } else {
        defsections = 1;
    }

    int sections = 0;
    sds info = sdsempty();

    info_section_from_redis("server");
    info_section_from_redis("clients");
    info_section_from_redis("cpu");
    info_section_from_redis("stats");

    if (defsections || allsections || !strcasecmp(section,"sentinel")) {
        dictIterator *di;
        dictEntry *de;
        int master_id = 0;

        if (sections++) info = sdscat(info,"\r\n");
        info = sdscatprintf(info,
            "# Sentinel\r\n"
            "sentinel_masters:%lu\r\n"
            "sentinel_tilt:%d\r\n"
            "sentinel_running_scripts:%d\r\n"
            "sentinel_scripts_queue_length:%ld\r\n"
            "sentinel_simulate_failure_flags:%lu\r\n",
            dictSize(sentinel.masters),
            sentinel.tilt,
            sentinel.running_scripts,
            listLength(sentinel.scripts_queue),
            sentinel.simfailure_flags);

        di = dictGetIterator(sentinel.masters);
        while((de = dictNext(di)) != NULL) {
            sentinelRedisInstance *ri = dictGetVal(de);
            char *status = "ok";

            if (ri->flags & SRI_O_DOWN) status = "odown";
            else if (ri->flags & SRI_S_DOWN) status = "sdown";
            info = sdscatprintf(info,
                "master%d:name=%s,status=%s,address=%s:%d,"
                "slaves=%lu,sentinels=%lu\r\n",
                master_id++, ri->name, status,
                ri->addr->ip, ri->addr->port,
                dictSize(ri->slaves),
                dictSize(ri->sentinels)+1);
        }
        dictReleaseIterator(di);
    }

    addReplyBulkSds(c, info);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r13
movl 0x38(%rdi), %eax
cmpl $0x3, %eax
jl 0x79cd7
leaq 0x8d5f6(%rip), %rax     # 0x1072b0
movq 0x80(%rax), %rsi
movq %r13, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3fc19
cmpl $0x2, %eax
jne 0x79cea
movq 0x40(%r13), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r15
jmp 0x79ced
xorl %r15d, %r15d
testq %r15, %r15
je 0x79d20
leaq 0x5adf2(%rip), %rsi     # 0xd4aeb
movq %r15, %rdi
callq 0x26300
testl %eax, %eax
sete %bl
leaq 0x46c54(%rip), %rsi     # 0xc0961
movq %r15, %rdi
callq 0x26300
testl %eax, %eax
sete %bpl
orb %bl, %bpl
jmp 0x79d23
movb $0x1, %bpl
callq 0x39222
movq %rax, %r14
testb %bpl, %bpl
movq %r13, (%rsp)
jne 0x79d4e
leaq 0x555d1(%rip), %rsi     # 0xcf30c
movq %r15, %rdi
callq 0x26300
testl %eax, %eax
je 0x79d4e
xorl %r13d, %r13d
movb $0x1, %bl
jmp 0x79dbe
leaq 0x555b7(%rip), %rdi     # 0xcf30c
callq 0x372d4
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x79d9e
leaq 0x5523e(%rip), %rcx     # 0xcefb0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x79da0
movq -0x11(%r12), %rdx
jmp 0x79da0
movzwl -0x5(%r12), %edx
jmp 0x79da0
movl -0x9(%r12), %edx
jmp 0x79da0
movzbl -0x3(%r12), %edx
jmp 0x79da0
xorl %edx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x39a56
movq %rax, %r14
movq %r12, %rdi
callq 0x392b6
movl $0x1, %r13d
xorl %ebx, %ebx
testb %bpl, %bpl
jne 0x79dda
leaq 0x4dcd7(%rip), %rsi     # 0xc7aa1
movq %r15, %rdi
callq 0x26300
testl %eax, %eax
jne 0x79e5b
testb %bl, %bl
jne 0x79df0
leaq 0x4cf8b(%rip), %rsi     # 0xc6d70
movq %r14, %rdi
callq 0x39b26
movq %rax, %r14
leaq 0x4dcaa(%rip), %rdi     # 0xc7aa1
callq 0x372d4
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x79e40
leaq 0x551b0(%rip), %rcx     # 0xcefc4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x79e42
movq -0x11(%r12), %rdx
jmp 0x79e42
movzwl -0x5(%r12), %edx
jmp 0x79e42
movl -0x9(%r12), %edx
jmp 0x79e42
movzbl -0x3(%r12), %edx
jmp 0x79e42
xorl %edx, %edx
incl %r13d
movq %r14, %rdi
movq %r12, %rsi
callq 0x39a56
movq %rax, %r14
movq %r12, %rdi
callq 0x392b6
testb %bpl, %bpl
jne 0x79e77
leaq 0x47526(%rip), %rsi     # 0xc138d
movq %r15, %rdi
callq 0x26300
testl %eax, %eax
jne 0x79ef9
testl %r13d, %r13d
je 0x79e8e
leaq 0x4ceed(%rip), %rsi     # 0xc6d70
movq %r14, %rdi
callq 0x39b26
movq %rax, %r14
leaq 0x474f8(%rip), %rdi     # 0xc138d
callq 0x372d4
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x79ede
leaq 0x55126(%rip), %rcx     # 0xcefd8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x79ee0
movq -0x11(%r12), %rdx
jmp 0x79ee0
movzwl -0x5(%r12), %edx
jmp 0x79ee0
movl -0x9(%r12), %edx
jmp 0x79ee0
movzbl -0x3(%r12), %edx
jmp 0x79ee0
xorl %edx, %edx
incl %r13d
movq %r14, %rdi
movq %r12, %rsi
callq 0x39a56
movq %rax, %r14
movq %r12, %rdi
callq 0x392b6
testb %bpl, %bpl
jne 0x79f15
leaq 0x5d611(%rip), %rsi     # 0xd7516
movq %r15, %rdi
callq 0x26300
testl %eax, %eax
jne 0x79f9a
testl %r13d, %r13d
je 0x79f2c
leaq 0x4ce4f(%rip), %rsi     # 0xc6d70
movq %r14, %rdi
callq 0x39b26
movq %rax, %r14
leaq 0x5d5e3(%rip), %rdi     # 0xd7516
callq 0x372d4
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x79f7c
leaq 0x5509c(%rip), %rcx     # 0xcefec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x79f7e
movq -0x11(%r12), %rdx
jmp 0x79f7e
movzwl -0x5(%r12), %edx
jmp 0x79f7e
movl -0x9(%r12), %edx
jmp 0x79f7e
movzbl -0x3(%r12), %edx
jmp 0x79f7e
xorl %edx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x39a56
movq %rax, %r14
movq %r12, %rdi
callq 0x392b6
movl $0x1, %r13d
testb %bpl, %bpl
jne 0x79fb6
leaq 0x55b20(%rip), %rsi     # 0xcfac6
movq %r15, %rdi
callq 0x26300
testl %eax, %eax
jne 0x7a0d9
testl %r13d, %r13d
je 0x79fcd
leaq 0x4cdae(%rip), %rsi     # 0xc6d70
movq %r14, %rdi
callq 0x39b26
movq %rax, %r14
movq 0xa16dc(%rip), %rax     # 0x11b6b0
movq 0x48(%rax), %rdx
addq 0x28(%rax), %rdx
movl 0xa16d6(%rip), %ecx     # 0x11b6b8
movl 0xa16d3(%rip), %r8d     # 0x11b6bc
movq 0xa16e0(%rip), %rax     # 0x11b6d0
movq 0x28(%rax), %r9
subq $0x8, %rsp
leaq 0x5613a(%rip), %rsi     # 0xd0139
movq %r14, %rdi
xorl %eax, %eax
pushq 0xa16de(%rip)           # 0x11b6e8
callq 0x39eb7
addq $0x10, %rsp
movq %rax, %r14
movq 0xa1693(%rip), %rdi     # 0x11b6b0
callq 0x320bb
movq %rax, %r15
movq %rax, %rdi
callq 0x32116
testq %rax, %rax
je 0x7a0d1
leaq 0x562fc(%rip), %rbx     # 0xd0339
leaq 0x5618f(%rip), %r12     # 0xd01d3
xorl %edx, %edx
movq 0x8(%rax), %rax
movl (%rax), %ecx
testb $0x8, %cl
leaq 0x562d5(%rip), %r8      # 0xd032b
leaq 0x5a04a(%rip), %rsi     # 0xd40a7
cmoveq %rsi, %r8
testb $0x10, %cl
cmovneq %rbx, %r8
leal 0x1(%rdx), %r13d
movq 0x8(%rax), %rcx
movq 0x20(%rax), %rsi
movq (%rsi), %r9
movl 0x8(%rsi), %r10d
movq 0x88(%rax), %rsi
movq 0x48(%rsi), %r11
addq 0x28(%rsi), %r11
movq 0x80(%rax), %rax
movq 0x28(%rax), %rsi
movq 0x48(%rax), %rax
leaq (%rsi,%rax), %rbp
incq %rbp
subq $0x8, %rsp
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
pushq %rbp
pushq %r11
pushq %r10
callq 0x39eb7
addq $0x20, %rsp
movq %rax, %r14
movq %r15, %rdi
callq 0x32116
movl %r13d, %edx
testq %rax, %rax
jne 0x7a046
movq %r15, %rdi
callq 0x321d3
movq (%rsp), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4074f