// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: addReplySentinelRedisInstance
void addReplySentinelRedisInstance(client *c, sentinelRedisInstance *ri) {
    char *flags = sdsempty();
    void *mbl;
    int fields = 0;

    mbl = addDeferredMultiBulkLength(c);

    addReplyBulkCString(c,"name");
    addReplyBulkCString(c,ri->name);
    fields++;

    addReplyBulkCString(c,"ip");
    addReplyBulkCString(c,ri->addr->ip);
    fields++;

    addReplyBulkCString(c,"port");
    addReplyBulkLongLong(c,ri->addr->port);
    fields++;

    addReplyBulkCString(c,"runid");
    addReplyBulkCString(c,ri->runid ? ri->runid : "");
    fields++;

    addReplyBulkCString(c,"flags");
    if (ri->flags & SRI_S_DOWN) flags = sdscat(flags,"s_down,");
    if (ri->flags & SRI_O_DOWN) flags = sdscat(flags,"o_down,");
    if (ri->flags & SRI_MASTER) flags = sdscat(flags,"master,");
    if (ri->flags & SRI_SLAVE) flags = sdscat(flags,"slave,");
    if (ri->flags & SRI_SENTINEL) flags = sdscat(flags,"sentinel,");
    if (ri->link->disconnected) flags = sdscat(flags,"disconnected,");
    if (ri->flags & SRI_MASTER_DOWN) flags = sdscat(flags,"master_down,");
    if (ri->flags & SRI_FAILOVER_IN_PROGRESS)
        flags = sdscat(flags,"failover_in_progress,");
    if (ri->flags & SRI_PROMOTED) flags = sdscat(flags,"promoted,");
    if (ri->flags & SRI_RECONF_SENT) flags = sdscat(flags,"reconf_sent,");
    if (ri->flags & SRI_RECONF_INPROG) flags = sdscat(flags,"reconf_inprog,");
    if (ri->flags & SRI_RECONF_DONE) flags = sdscat(flags,"reconf_done,");

    if (sdslen(flags) != 0) sdsrange(flags,0,-2); /* remove last "," */
    addReplyBulkCString(c,flags);
    sdsfree(flags);
    fields++;

    addReplyBulkCString(c,"link-pending-commands");
    addReplyBulkLongLong(c,ri->link->pending_commands);
    fields++;

    addReplyBulkCString(c,"link-refcount");
    addReplyBulkLongLong(c,ri->link->refcount);
    fields++;

    if (ri->flags & SRI_FAILOVER_IN_PROGRESS) {
        addReplyBulkCString(c,"failover-state");
        addReplyBulkCString(c,(char*)sentinelFailoverStateStr(ri->failover_state));
        fields++;
    }

    addReplyBulkCString(c,"last-ping-sent");
    addReplyBulkLongLong(c,
        ri->link->act_ping_time ? (mstime() - ri->link->act_ping_time) : 0);
    fields++;

    addReplyBulkCString(c,"last-ok-ping-reply");
    addReplyBulkLongLong(c,mstime() - ri->link->last_avail_time);
    fields++;

    addReplyBulkCString(c,"last-ping-reply");
    addReplyBulkLongLong(c,mstime() - ri->link->last_pong_time);
    fields++;

    if (ri->flags & SRI_S_DOWN) {
        addReplyBulkCString(c,"s-down-time");
        addReplyBulkLongLong(c,mstime()-ri->s_down_since_time);
        fields++;
    }

    if (ri->flags & SRI_O_DOWN) {
        addReplyBulkCString(c,"o-down-time");
        addReplyBulkLongLong(c,mstime()-ri->o_down_since_time);
        fields++;
    }

    addReplyBulkCString(c,"down-after-milliseconds");
    addReplyBulkLongLong(c,ri->down_after_period);
    fields++;

    /* Masters and Slaves */
    if (ri->flags & (SRI_MASTER|SRI_SLAVE)) {
        addReplyBulkCString(c,"info-refresh");
        addReplyBulkLongLong(c,mstime() - ri->info_refresh);
        fields++;

        addReplyBulkCString(c,"role-reported");
        addReplyBulkCString(c, (ri->role_reported == SRI_MASTER) ? "master" :
                                                                   "slave");
        fields++;

        addReplyBulkCString(c,"role-reported-time");
        addReplyBulkLongLong(c,mstime() - ri->role_reported_time);
        fields++;
    }

    /* Only masters */
    if (ri->flags & SRI_MASTER) {
        addReplyBulkCString(c,"config-epoch");
        addReplyBulkLongLong(c,ri->config_epoch);
        fields++;

        addReplyBulkCString(c,"num-slaves");
        addReplyBulkLongLong(c,dictSize(ri->slaves));
        fields++;

        addReplyBulkCString(c,"num-other-sentinels");
        addReplyBulkLongLong(c,dictSize(ri->sentinels));
        fields++;

        addReplyBulkCString(c,"quorum");
        addReplyBulkLongLong(c,ri->quorum);
        fields++;

        addReplyBulkCString(c,"failover-timeout");
        addReplyBulkLongLong(c,ri->failover_timeout);
        fields++;

        addReplyBulkCString(c,"parallel-syncs");
        addReplyBulkLongLong(c,ri->parallel_syncs);
        fields++;

        if (ri->notification_script) {
            addReplyBulkCString(c,"notification-script");
            addReplyBulkCString(c,ri->notification_script);
            fields++;
        }

        if (ri->client_reconfig_script) {
            addReplyBulkCString(c,"client-reconfig-script");
            addReplyBulkCString(c,ri->client_reconfig_script);
            fields++;
        }
    }

    /* Only slaves */
    if (ri->flags & SRI_SLAVE) {
        addReplyBulkCString(c,"master-link-down-time");
        addReplyBulkLongLong(c,ri->master_link_down_time);
        fields++;

        addReplyBulkCString(c,"master-link-status");
        addReplyBulkCString(c,
            (ri->slave_master_link_status == SENTINEL_MASTER_LINK_STATUS_UP) ?
            "ok" : "err");
        fields++;

        addReplyBulkCString(c,"master-host");
        addReplyBulkCString(c,
            ri->slave_master_host ? ri->slave_master_host : "?");
        fields++;

        addReplyBulkCString(c,"master-port");
        addReplyBulkLongLong(c,ri->slave_master_port);
        fields++;

        addReplyBulkCString(c,"slave-priority");
        addReplyBulkLongLong(c,ri->slave_priority);
        fields++;

        addReplyBulkCString(c,"slave-repl-offset");
        addReplyBulkLongLong(c,ri->slave_repl_offset);
        fields++;
    }

    /* Only sentinels */
    if (ri->flags & SRI_SENTINEL) {
        addReplyBulkCString(c,"last-hello-message");
        addReplyBulkLongLong(c,mstime() - ri->last_hello_time);
        fields++;

        addReplyBulkCString(c,"voted-leader");
        addReplyBulkCString(c,ri->leader ? ri->leader : "?");
        fields++;

        addReplyBulkCString(c,"voted-leader-epoch");
        addReplyBulkLongLong(c,ri->leader_epoch);
        fields++;
    }

    setDeferredMultiBulkLength(c,mbl,fields*2);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3628d
movq %rax, %r12
movq %rbx, %rdi
callq 0x3cee9
movq %rax, %r14
leaq 0x52b22(%rip), %rsi     # 0xccf7f
movq %rbx, %rdi
callq 0x3d0f2
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x4a378(%rip), %rsi     # 0xc47f0
movq %rbx, %rdi
callq 0x3d0f2
movq 0x20(%r15), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x499e7(%rip), %rsi     # 0xc3e7d
movq %rbx, %rdi
callq 0x3d0f2
movq 0x20(%r15), %rax
movslq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x52037(%rip), %rsi     # 0xcc4ec
movq %rbx, %rdi
callq 0x3d0f2
movq 0x10(%r15), %rax
testq %rax, %rax
leaq 0x465ea(%rip), %rsi     # 0xc0ab5
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x4d255(%rip), %rsi     # 0xc7733
movq %rbx, %rdi
callq 0x3d0f2
movl (%r15), %eax
testb $0x8, %al
je 0x7a502
leaq 0x5279d(%rip), %rsi     # 0xccc91
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
testb $0x10, %al
je 0x7a51b
leaq 0x5278c(%rip), %rsi     # 0xccc99
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
testb $0x1, %al
je 0x7a534
leaq 0x4eeaf(%rip), %rsi     # 0xc93d5
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
testb $0x2, %al
je 0x7a54d
leaq 0x4ee9e(%rip), %rsi     # 0xc93dd
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
testb $0x4, %al
je 0x7a563
leaq 0x52749(%rip), %rsi     # 0xccca1
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movq 0x28(%r15), %rax
cmpl $0x0, 0x4(%rax)
je 0x7a57f
leaq 0x52737(%rip), %rsi     # 0xcccab
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
testb $0x20, %al
je 0x7a59b
leaq 0x5272c(%rip), %rsi     # 0xcccb9
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
testb $0x40, %al
je 0x7a5b4
leaq 0x52720(%rip), %rsi     # 0xcccc6
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
testb %al, %al
jns 0x7a5cd
leaq 0x5271d(%rip), %rsi     # 0xcccdc
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
btl $0x8, %eax
jae 0x7a5e8
leaq 0x5270c(%rip), %rsi     # 0xccce6
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
btl $0x9, %eax
jae 0x7a603
leaq 0x526fe(%rip), %rsi     # 0xcccf3
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movl (%r15), %eax
btl $0xa, %eax
jae 0x7a61b
leaq 0x526f2(%rip), %rsi     # 0xccd02
movq %r12, %rdi
callq 0x36b9c
movq %rax, %r12
movzbl -0x1(%r12), %eax
movl %eax, %ecx
andl $0x7, %ecx
cmpl $0x4, %ecx
ja 0x7a670
leaq 0x51b8e(%rip), %rdx     # 0xcc1c0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
shrl $0x3, %eax
jmp 0x7a65c
movq -0x11(%r12), %rax
jmp 0x7a65c
movzwl -0x5(%r12), %eax
jmp 0x7a65c
movl -0x9(%r12), %eax
jmp 0x7a65c
movzbl -0x3(%r12), %eax
testq %rax, %rax
je 0x7a670
movq %r12, %rdi
xorl %esi, %esi
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
callq 0x377b2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d0f2
movq %r12, %rdi
callq 0x36330
leaq 0x52685(%rip), %rsi     # 0xccd0f
movq %rbx, %rdi
callq 0x3d0f2
movq 0x28(%r15), %rax
movslq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x5267c(%rip), %rsi     # 0xccd25
movq %rbx, %rdi
callq 0x3d0f2
movq 0x28(%r15), %rax
movslq (%rax), %rsi
movq %rbx, %rdi
callq 0x3d415
movl $0xa, %r12d
testb $0x40, (%r15)
je 0x7a70a
leaq 0x52660(%rip), %rsi     # 0xccd33
movq %rbx, %rdi
callq 0x3d0f2
movl 0xf0(%r15), %eax
cmpq $0x6, %rax
ja 0x7a6f5
leaq 0x7f7c9(%rip), %rcx     # 0xf9eb8
movq (%rcx,%rax,8), %rsi
jmp 0x7a6fc
leaq 0x466e7(%rip), %rsi     # 0xc0de3
movq %rbx, %rdi
callq 0x3d0f2
movl $0xb, %r12d
leaq 0x52631(%rip), %rsi     # 0xccd42
movq %rbx, %rdi
callq 0x3d0f2
movq 0x28(%r15), %rax
cmpq $0x0, 0x40(%rax)
je 0x7a736
callq 0x2ffce
movq %rax, %rsi
movq 0x28(%r15), %rax
subq 0x40(%rax), %rsi
jmp 0x7a738
xorl %esi, %esi
movq %rbx, %rdi
callq 0x3d415
leaq 0x5260a(%rip), %rsi     # 0xccd51
movq %rbx, %rdi
callq 0x3d0f2
callq 0x2ffce
movq 0x28(%r15), %rcx
subq 0x38(%rcx), %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d415
leaq 0x525f6(%rip), %rsi     # 0xccd64
movq %rbx, %rdi
callq 0x3d0f2
callq 0x2ffce
movq 0x28(%r15), %rcx
subq 0x50(%rcx), %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d415
movl (%r15), %eax
testb $0x8, %al
je 0x7a7be
leaq 0x525d8(%rip), %rsi     # 0xccd74
movq %rbx, %rdi
callq 0x3d0f2
callq 0x2ffce
subq 0x48(%r15), %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d415
incl %r12d
movl (%r15), %eax
testb $0x10, %al
je 0x7a7e8
leaq 0x525b7(%rip), %rsi     # 0xccd80
movq %rbx, %rdi
callq 0x3d0f2
callq 0x2ffce
subq 0x50(%r15), %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d415
incl %r12d
leaq 0x51d8c(%rip), %rsi     # 0xcc57b
movq %rbx, %rdi
callq 0x3d0f2
movq 0x58(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
movl (%r15), %eax
testb $0x3, %al
je 0x7a887
leaq 0x5257b(%rip), %rsi     # 0xccd8c
movq %rbx, %rdi
callq 0x3d0f2
callq 0x2ffce
subq 0x60(%r15), %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d415
leaq 0x52565(%rip), %rsi     # 0xccd99
movq %rbx, %rdi
callq 0x3d0f2
cmpl $0x1, 0x68(%r15)
leaq 0x4e45b(%rip), %rax     # 0xc8ca3
leaq 0x4e4a6(%rip), %rsi     # 0xc8cf5
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x52545(%rip), %rsi     # 0xccda7
movq %rbx, %rdi
callq 0x3d0f2
callq 0x2ffce
subq 0x70(%r15), %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d415
addl $0x4, %r12d
movl (%r15), %eax
jmp 0x7a88a
incl %r12d
testb $0x1, %al
je 0x7a9b0
leaq 0x4e542(%rip), %rsi     # 0xc8ddb
movq %rbx, %rdi
callq 0x3d0f2
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x52506(%rip), %rsi     # 0xccdba
movq %rbx, %rdi
callq 0x3d0f2
movq 0x88(%r15), %rax
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x524eb(%rip), %rsi     # 0xccdc5
movq %rbx, %rdi
callq 0x3d0f2
movq 0x80(%r15), %rax
movq 0x48(%rax), %rsi
addq 0x28(%rax), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x52649(%rip), %rsi     # 0xccf49
movq %rbx, %rdi
callq 0x3d0f2
movl 0x90(%r15), %esi
movq %rbx, %rdi
callq 0x3d415
leaq 0x51cba(%rip), %rsi     # 0xcc5d8
movq %rbx, %rdi
callq 0x3d0f2
movq 0x108(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x51cad(%rip), %rsi     # 0xcc5e9
movq %rbx, %rdi
callq 0x3d0f2
movslq 0x94(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
cmpq $0x0, 0x120(%r15)
je 0x7a981
leaq 0x51c94(%rip), %rsi     # 0xcc5f8
movq %rbx, %rdi
callq 0x3d0f2
movq 0x120(%r15), %rsi
movq %rbx, %rdi
callq 0x3d0f2
addl $0x7, %r12d
jmp 0x7a985
addl $0x6, %r12d
cmpq $0x0, 0x128(%r15)
je 0x7a9b0
leaq 0x51cb0(%rip), %rsi     # 0xcc646
movq %rbx, %rdi
callq 0x3d0f2
movq 0x128(%r15), %rsi
movq %rbx, %rdi
callq 0x3d0f2
incl %r12d
movl (%r15), %eax
testb $0x2, %al
je 0x7aa97
leaq 0x52417(%rip), %rsi     # 0xccdd9
movq %rbx, %rdi
callq 0x3d0f2
movq 0xa0(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x5240f(%rip), %rsi     # 0xccdef
movq %rbx, %rdi
callq 0x3d0f2
cmpl $0x0, 0xcc(%r15)
leaq 0x567e0(%rip), %rax     # 0xd11d7
leaq 0x4349a(%rip), %rsi     # 0xbde98
cmoveq %rax, %rsi
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x523f1(%rip), %rsi     # 0xcce02
movq %rbx, %rdi
callq 0x3d0f2
movq 0xc0(%r15), %rax
testq %rax, %rax
leaq 0x5688c(%rip), %rsi     # 0xd12b6
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x523d1(%rip), %rsi     # 0xcce0e
movq %rbx, %rdi
callq 0x3d0f2
movslq 0xc8(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x49d77(%rip), %rsi     # 0xc47d2
movq %rbx, %rdi
callq 0x3d0f2
movslq 0xa8(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
leaq 0x523a1(%rip), %rsi     # 0xcce1a
movq %rbx, %rdi
callq 0x3d0f2
movq 0xd0(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
addl $0x6, %r12d
movl (%r15), %eax
testb $0x4, %al
je 0x7ab0c
leaq 0x5238a(%rip), %rsi     # 0xcce2c
movq %rbx, %rdi
callq 0x3d0f2
callq 0x2ffce
subq 0x38(%r15), %rax
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3d415
leaq 0x5237a(%rip), %rsi     # 0xcce3f
movq %rbx, %rdi
callq 0x3d0f2
movq 0xd8(%r15), %rax
testq %rax, %rax
leaq 0x567d8(%rip), %rsi     # 0xd12b6
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x3d0f2
leaq 0x5235b(%rip), %rsi     # 0xcce4c
movq %rbx, %rdi
callq 0x3d0f2
movq 0xe0(%r15), %rsi
movq %rbx, %rdi
callq 0x3d415
addl $0x3, %r12d
addl %r12d, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3cf25