// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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:
movl 0x38(%rdi), %eax
cmpl $0x3, %eax
jl 0x7618d
leaq 0x8c18f(%rip), %rax     # 0x102310
movq 0x80(%rax), %rsi
jmp 0x3c854
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %eax
movq %rdi, (%rsp)
jne 0x7622a
movq 0x40(%rdi), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %r15
testq %r15, %r15
je 0x7622a
leaq 0x5ba8e(%rip), %rsi     # 0xd1c4b
movq %r15, %rdi
callq 0x262f0
movl %eax, %ebp
leaq 0x47805(%rip), %rsi     # 0xbd9d3
movq %r15, %rdi
callq 0x262f0
movl %eax, %r12d
callq 0x3628d
movq %rax, %r14
movb $0x1, %r13b
testl %r12d, %r12d
je 0x76238
testl %ebp, %ebp
je 0x76238
leaq 0x56218(%rip), %rsi     # 0xcc40c
movq %r15, %rdi
callq 0x262f0
xorl %ebp, %ebp
testl %eax, %eax
je 0x7661b
leaq 0x4e900(%rip), %rsi     # 0xc4b0d
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
jne 0x76379
movl $0x1, %ebp
xorl %r13d, %r13d
jmp 0x7630a
movb $0x1, %r13b
xorl %r15d, %r15d
callq 0x3628d
movq %rax, %r14
leaq 0x561cd(%rip), %rdi     # 0xcc40c
callq 0x342b9
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x76288
leaq 0x55e54(%rip), %rcx     # 0xcc0b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x7628a
movq -0x11(%r12), %rdx
jmp 0x7628a
movzwl -0x5(%r12), %edx
jmp 0x7628a
movl -0x9(%r12), %edx
jmp 0x7628a
movzbl -0x3(%r12), %edx
jmp 0x7628a
xorl %edx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x36ad1
movq %rax, %r14
movq %r12, %rdi
callq 0x36330
testb %r13b, %r13b
jne 0x762f3
leaq 0x4e861(%rip), %rsi     # 0xc4b0d
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
je 0x762f3
leaq 0x48140(%rip), %rsi     # 0xbe3ff
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
je 0x7639d
leaq 0x4819c(%rip), %rsi     # 0xbe472
movq %r15, %rdi
callq 0x262f0
movl $0x1, %ebp
testl %eax, %eax
jne 0x764c9
xorl %r13d, %r13d
jmp 0x76445
leaq 0x4dae2(%rip), %rsi     # 0xc3ddc
movq %r14, %rdi
callq 0x36b9c
movq %rax, %r14
movl $0x2, %ebp
leaq 0x4e7fc(%rip), %rdi     # 0xc4b0d
callq 0x342b9
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x7635a
leaq 0x55d96(%rip), %rcx     # 0xcc0c4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x7635c
movq -0x11(%r12), %rdx
jmp 0x7635c
movzwl -0x5(%r12), %edx
jmp 0x7635c
movl -0x9(%r12), %edx
jmp 0x7635c
movzbl -0x3(%r12), %edx
jmp 0x7635c
xorl %edx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x36ad1
movq %rax, %r14
movq %r12, %rdi
callq 0x36330
movb $0x1, %bl
testb %r13b, %r13b
jne 0x763a4
leaq 0x4807f(%rip), %rsi     # 0xbe3ff
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
jne 0x76427
xorl %ebx, %ebx
testl %ebp, %ebp
jne 0x763a4
movl $0x1, %ebp
jmp 0x763b8
movl $0x1, %ebp
xorl %ebx, %ebx
incl %ebp
leaq 0x4da2f(%rip), %rsi     # 0xc3ddc
movq %r14, %rdi
callq 0x36b9c
movq %rax, %r14
leaq 0x48040(%rip), %rdi     # 0xbe3ff
callq 0x342b9
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x76408
leaq 0x55cfc(%rip), %rcx     # 0xcc0d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x7640a
movq -0x11(%r12), %rdx
jmp 0x7640a
movzwl -0x5(%r12), %edx
jmp 0x7640a
movl -0x9(%r12), %edx
jmp 0x7640a
movzbl -0x3(%r12), %edx
jmp 0x7640a
xorl %edx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x36ad1
movq %rax, %r14
movq %r12, %rdi
callq 0x36330
movb $0x1, %r13b
testb %bl, %bl
jne 0x76445
leaq 0x48044(%rip), %rsi     # 0xbe472
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
jne 0x764c9
xorl %r13d, %r13d
testl %ebp, %ebp
je 0x76457
leaq 0x4d990(%rip), %rsi     # 0xc3ddc
movq %r14, %rdi
callq 0x36b9c
movq %rax, %r14
leaq 0x48014(%rip), %rdi     # 0xbe472
callq 0x342b9
movq %rax, %r12
movzbl -0x1(%rax), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x764a7
leaq 0x55c71(%rip), %rcx     # 0xcc0ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x764a9
movq -0x11(%r12), %rdx
jmp 0x764a9
movzwl -0x5(%r12), %edx
jmp 0x764a9
movl -0x9(%r12), %edx
jmp 0x764a9
movzbl -0x3(%r12), %edx
jmp 0x764a9
xorl %edx, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x36ad1
movq %rax, %r14
movq %r12, %rdi
callq 0x36330
movl $0x1, %ebp
testb %r13b, %r13b
jne 0x764e4
leaq 0x566f6(%rip), %rsi     # 0xccbc6
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
jne 0x76601
testl %ebp, %ebp
je 0x764f6
leaq 0x4d8f1(%rip), %rsi     # 0xc3ddc
movq %r14, %rdi
callq 0x36b9c
movq %rax, %r14
movq 0xa0213(%rip), %rax     # 0x116710
movq 0x48(%rax), %rdx
addq 0x28(%rax), %rdx
movl 0xa020d(%rip), %ecx     # 0x116718
movl 0xa020a(%rip), %r8d     # 0x11671c
movq 0xa0217(%rip), %rax     # 0x116730
movq 0x28(%rax), %r9
subq $0x8, %rsp
leaq 0x56d11(%rip), %rsi     # 0xcd239
movq %r14, %rdi
xorl %eax, %eax
pushq 0xa0215(%rip)           # 0x116748
callq 0x36f2d
addq $0x10, %rsp
movq %rax, %r14
movq 0xa01ca(%rip), %rdi     # 0x116710
callq 0x2efbb
movq %rax, %r15
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x765f9
leaq 0x56ed3(%rip), %rbp     # 0xcd439
leaq 0x56d66(%rip), %r12     # 0xcd2d3
xorl %edx, %edx
movq 0x8(%rax), %rax
movl (%rax), %ecx
testb $0x8, %cl
leaq 0x56eac(%rip), %r8      # 0xcd42b
leaq 0x5ac51(%rip), %rsi     # 0xd11d7
cmoveq %rsi, %r8
testb $0x10, %cl
cmovneq %rbp, %r8
leal 0x1(%rdx), %ebx
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), %r13
incq %r13
subq $0x8, %rsp
movq %r14, %rdi
movq %r12, %rsi
xorl %eax, %eax
pushq %r13
pushq %r11
pushq %r10
callq 0x36f2d
addq $0x20, %rsp
movq %rax, %r14
movq %r15, %rdi
callq 0x2f015
movl %ebx, %edx
testq %rax, %rax
jne 0x7656f
movq %r15, %rdi
callq 0x2f0dd
movq (%rsp), %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d386
xorl %r13d, %r13d
jmp 0x76238