// File: /workspace/github_c_makefile_star2_O1/nilyang[P]redis-tdd-annotation/src/sentinel.c
// Function: sentinelSetCommand
void sentinelSetCommand(redisClient *c) {
    sentinelRedisInstance *ri;
    int j, changes = 0;
    char *option, *value;

    if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
        == NULL) return;

    /* Process option - value pairs. */
    for (j = 3; j < c->argc; j += 2) {
        option = c->argv[j]->ptr;
        value = c->argv[j+1]->ptr;
        robj *o = c->argv[j+1];
        long long ll;

        if (!strcasecmp(option,"down-after-milliseconds")) {
            /* down-after-millisecodns <milliseconds> */
            if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll <= 0)
                goto badfmt;
            ri->down_after_period = ll;
            sentinelPropagateDownAfterPeriod(ri);
            changes++;
        } else if (!strcasecmp(option,"failover-timeout")) {
            /* failover-timeout <milliseconds> */
            if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll <= 0)
                goto badfmt;
            ri->failover_timeout = ll;
            changes++;
       } else if (!strcasecmp(option,"parallel-syncs")) {
            /* parallel-syncs <milliseconds> */
            if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll <= 0)
                goto badfmt;
            ri->parallel_syncs = ll;
            changes++;
       } else if (!strcasecmp(option,"notification-script")) {
            /* notification-script <path> */
            if (strlen(value) && access(value,X_OK) == -1) {
                addReplyError(c,
                    "Notification script seems non existing or non executable");
                if (changes) sentinelFlushConfig();
                return;
            }
            sdsfree(ri->notification_script);
            ri->notification_script = strlen(value) ? sdsnew(value) : NULL;
            changes++;
       } else if (!strcasecmp(option,"client-reconfig-script")) {
            /* client-reconfig-script <path> */
            if (strlen(value) && access(value,X_OK) == -1) {
                addReplyError(c,
                    "Client reconfiguration script seems non existing or "
                    "non executable");
                if (changes) sentinelFlushConfig();
                return;
            }
            sdsfree(ri->client_reconfig_script);
            ri->client_reconfig_script = strlen(value) ? sdsnew(value) : NULL;
            changes++;
       } else if (!strcasecmp(option,"auth-pass")) {
            /* auth-pass <password> */
            sdsfree(ri->auth_pass);
            ri->auth_pass = strlen(value) ? sdsnew(value) : NULL;
            changes++;
       } else if (!strcasecmp(option,"quorum")) {
            /* quorum <count> */
            if (getLongLongFromObject(o,&ll) == REDIS_ERR || ll <= 0)
                goto badfmt;
            ri->quorum = ll;
            changes++;
        } else {
            addReplyErrorFormat(c,"Unknown option '%s' for SENTINEL SET",
                option);
            if (changes) sentinelFlushConfig();
            return;
        }
        sentinelEvent(REDIS_WARNING,"+set",ri,"%@ %s %s",option,value);
    }

    if (changes) sentinelFlushConfig();
    addReply(c,shared.ok);
    return;

badfmt: /* Bad format errors */
    if (changes) sentinelFlushConfig();
    addReplyErrorFormat(c,"Invalid argument '%s' for SENTINEL SET '%s'",
            value, option);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
callq 0x5eeeb
testq %rax, %rax
je 0x5f5d0
cmpl $0x4, 0x30(%rbx)
jl 0x5f592
movq %rax, %r14
movl $0x3, %r15d
movl $0x0, 0xc(%rsp)
movq 0x38(%rbx), %rax
movq (%rax,%r15,8), %rcx
movq 0x8(%rax,%r15,8), %r12
movq 0x8(%rcx), %rbp
movq 0x8(%r12), %r13
movq %rbp, %rdi
leaq 0x3fda4(%rip), %rsi     # 0x9f079
callq 0x1f2e0
testl %eax, %eax
je 0x5f385
movq %rbp, %rdi
leaq 0x3fdea(%rip), %rsi     # 0x9f0d6
callq 0x1f2e0
testl %eax, %eax
je 0x5f3c5
movq %rbp, %rdi
leaq 0x3fde4(%rip), %rsi     # 0x9f0e7
callq 0x1f2e0
testl %eax, %eax
je 0x5f3fd
movq %rbp, %rdi
leaq 0x3fddc(%rip), %rsi     # 0x9f0f6
callq 0x1f2e0
testl %eax, %eax
je 0x5f435
movq %rbp, %rdi
leaq 0x3fe13(%rip), %rsi     # 0x9f144
callq 0x1f2e0
testl %eax, %eax
je 0x5f46f
movq %rbp, %rdi
leaq 0x3fe57(%rip), %rsi     # 0x9f19f
callq 0x1f2e0
testl %eax, %eax
je 0x5f4a9
movq %rbp, %rdi
leaq 0x40679(%rip), %rsi     # 0x9f9d8
callq 0x1f2e0
testl %eax, %eax
je 0x5f4d5
movq %rbx, %rdi
leaq 0x40855(%rip), %rsi     # 0x9fbcb
movq %rbp, %rdx
xorl %eax, %eax
callq 0x2d9fe
jmp 0x5f52c
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30f9e
cmpl $-0x1, %eax
sete %cl
movq 0x10(%rsp), %rax
testq %rax, %rax
setle %dl
orb %cl, %dl
movl $0x5, %r12d
jne 0x5f573
movq %rax, 0x98(%r14)
movq %r14, %rdi
callq 0x5cbb9
jmp 0x5f549
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30f9e
cmpl $-0x1, %eax
sete %cl
movq 0x10(%rsp), %rax
testq %rax, %rax
setle %dl
orb %cl, %dl
movl $0x5, %r12d
jne 0x5f573
movq %rax, 0x148(%r14)
jmp 0x5f549
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30f9e
cmpl $-0x1, %eax
sete %cl
movq 0x10(%rsp), %rax
testq %rax, %rax
setle %dl
orb %cl, %dl
movl $0x5, %r12d
jne 0x5f573
movl %eax, 0xd4(%r14)
jmp 0x5f549
cmpb $0x0, (%r13)
je 0x5f452
movq %r13, %rdi
movl $0x1, %esi
callq 0x1fa20
cmpl $-0x1, %eax
je 0x5f506
movq 0x160(%r14), %rdi
callq 0x28204
cmpb $0x0, (%r13)
je 0x5f4ca
movq %r13, %rdi
callq 0x281da
jmp 0x5f4cc
cmpb $0x0, (%r13)
je 0x5f48c
movq %r13, %rdi
movl $0x1, %esi
callq 0x1fa20
cmpl $-0x1, %eax
je 0x5f51d
movq 0x168(%r14), %rdi
callq 0x28204
cmpb $0x0, (%r13)
je 0x5f512
movq %r13, %rdi
callq 0x281da
jmp 0x5f514
movq 0xd8(%r14), %rdi
callq 0x28204
cmpb $0x0, (%r13)
je 0x5f540
movq %r13, %rdi
callq 0x281da
jmp 0x5f542
xorl %eax, %eax
movq %rax, 0x160(%r14)
jmp 0x5f549
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x30f9e
cmpl $-0x1, %eax
sete %cl
movq 0x10(%rsp), %rax
testq %rax, %rax
setle %dl
orb %cl, %dl
movl $0x5, %r12d
jne 0x5f573
movl %eax, 0xd0(%r14)
jmp 0x5f549
movq %rbx, %rdi
leaq 0x4063f(%rip), %rsi     # 0x9fb4f
jmp 0x5f527
xorl %eax, %eax
movq %rax, 0x168(%r14)
jmp 0x5f549
movq %rbx, %rdi
leaq 0x40661(%rip), %rsi     # 0x9fb88
callq 0x2d9d7
movl $0x1, %r12d
cmpl $0x0, 0xc(%rsp)
je 0x5f573
callq 0x5cac1
jmp 0x5f573
xorl %eax, %eax
movq %rax, 0xd8(%r14)
incl 0xc(%rsp)
xorl %r12d, %r12d
movl $0x3, %edi
leaq 0x40694(%rip), %rsi     # 0x9fbf0
movq %r14, %rdx
leaq 0x4068f(%rip), %rcx     # 0x9fbf5
movq %rbp, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x5b66f
testl %r12d, %r12d
jne 0x5f5a7
addq $0x2, %r15
cmpl %r15d, 0x30(%rbx)
jg 0x5f2b5
cmpl $0x0, 0xc(%rsp)
je 0x5f592
callq 0x5cac1
leaq 0x6b267(%rip), %rax     # 0xca800
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x2d6f0
jmp 0x5f5d0
cmpl $0x5, %r12d
jne 0x5f5d0
cmpl $0x0, 0xc(%rsp)
je 0x5f5b9
callq 0x5cac1
leaq 0x4063e(%rip), %rsi     # 0x9fbfe
movq %rbx, %rdi
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2d9fe
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq