// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelSetCommand
void sentinelSetCommand(client *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) == C_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) == C_ERR || ll <= 0)
                goto badfmt;
            ri->failover_timeout = ll;
            changes++;
       } else if (!strcasecmp(option,"parallel-syncs")) {
            /* parallel-syncs <milliseconds> */
            if (getLongLongFromObject(o,&ll) == C_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) == C_ERR || ll <= 0)
                goto badfmt;
            ri->quorum = ll;
            changes++;
        } else {
            addReplyErrorFormat(c,"Unknown option '%s' for SENTINEL SET",
                option);
            if (changes) sentinelFlushConfig();
            return;
        }
        sentinelEvent(LL_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
pushq %rax
movq %rdi, %rbx
movq 0x40(%rdi), %rax
movq 0x10(%rax), %rsi
callq 0x6e297
testq %rax, %rax
je 0x6e936
movq %rax, %r14
pushq $0x3
popq %r15
movslq 0x38(%rbx), %rax
cmpq %rax, %r15
jge 0x6e8f4
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rcx
movq 0x8(%rax,%r15,8), %r12
movq 0x8(%rcx), %r13
movq 0x8(%r12), %rbp
movq %r13, %rdi
leaq 0x4eaf4(%rip), %rsi     # 0xbd1c7
callq 0x262f0
testl %eax, %eax
je 0x6e797
movq %r13, %rdi
leaq 0x4eb3a(%rip), %rsi     # 0xbd224
callq 0x262f0
testl %eax, %eax
je 0x6e7c9
movq %r13, %rdi
leaq 0x4eb34(%rip), %rsi     # 0xbd235
callq 0x262f0
testl %eax, %eax
je 0x6e7f6
movq %r13, %rdi
leaq 0x4eb2c(%rip), %rsi     # 0xbd244
callq 0x262f0
testl %eax, %eax
je 0x6e823
movq %r13, %rdi
leaq 0x4eb63(%rip), %rsi     # 0xbd292
callq 0x262f0
testl %eax, %eax
je 0x6e859
movq %r13, %rdi
leaq 0x4eba7(%rip), %rsi     # 0xbd2ed
callq 0x262f0
testl %eax, %eax
je 0x6e88f
movq %r13, %rdi
leaq 0x4f438(%rip), %rsi     # 0xbdb95
callq 0x262f0
testl %eax, %eax
jne 0x6e945
movq %r12, %rdi
movq %rsp, %rsi
callq 0x3aa55
cmpl $-0x1, %eax
je 0x6e914
movq (%rsp), %rax
testq %rax, %rax
jle 0x6e914
movl %eax, 0x90(%r14)
jmp 0x6e8ca
movq %r12, %rdi
movq %rsp, %rsi
callq 0x3aa55
cmpl $-0x1, %eax
je 0x6e914
movq (%rsp), %rax
testq %rax, %rax
jle 0x6e914
movq %rax, 0x58(%r14)
movq %r14, %rdi
callq 0x6bce2
jmp 0x6e8ca
movq %r12, %rdi
movq %rsp, %rsi
callq 0x3aa55
cmpl $-0x1, %eax
je 0x6e914
movq (%rsp), %rax
testq %rax, %rax
jle 0x6e914
movq %rax, 0x108(%r14)
jmp 0x6e8ca
movq %r12, %rdi
movq %rsp, %rsi
callq 0x3aa55
cmpl $-0x1, %eax
je 0x6e914
movq (%rsp), %rax
testq %rax, %rax
jle 0x6e914
movl %eax, 0x94(%r14)
jmp 0x6e8ca
cmpb $0x0, (%rbp)
je 0x6e83d
movq %rbp, %rdi
pushq $0x1
popq %rsi
callq 0x26aa0
cmpl $-0x1, %eax
je 0x6e95b
movq 0x120(%r14), %rdi
callq 0x311c8
cmpb $0x0, (%rbp)
je 0x6e8ab
movq %rbp, %rdi
callq 0x3115a
jmp 0x6e8ad
cmpb $0x0, (%rbp)
je 0x6e873
movq %rbp, %rdi
pushq $0x1
popq %rsi
callq 0x26aa0
cmpl $-0x1, %eax
je 0x6e964
movq 0x128(%r14), %rdi
callq 0x311c8
cmpb $0x0, (%rbp)
je 0x6e8b6
movq %rbp, %rdi
callq 0x3115a
jmp 0x6e8b8
movq 0x98(%r14), %rdi
callq 0x311c8
cmpb $0x0, (%rbp)
je 0x6e8c1
movq %rbp, %rdi
callq 0x3115a
jmp 0x6e8c3
xorl %eax, %eax
movq %rax, 0x120(%r14)
jmp 0x6e8ca
xorl %eax, %eax
movq %rax, 0x128(%r14)
jmp 0x6e8ca
xorl %eax, %eax
movq %rax, 0x98(%r14)
pushq $0x3
popq %rdi
leaq 0x4f730(%rip), %rsi     # 0xbe004
movq %r14, %rdx
leaq 0x4f72b(%rip), %rcx     # 0xbe009
movq %r13, %r8
movq %rbp, %r9
xorl %eax, %eax
callq 0x6a7bb
addq $0x2, %r15
jmp 0x6e6a6
cmpl $0x3, %r15d
je 0x6e8ff
callq 0x6a604
leaq 0x8ba0a(%rip), %rax     # 0xfa310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x36987
jmp 0x6e936
cmpl $0x3, %r15d
je 0x6e91f
callq 0x6a604
leaq 0x4f6ec(%rip), %rsi     # 0xbe012
movq %rbx, %rdi
movq %rbp, %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x36b96
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f693(%rip), %rsi     # 0xbdfdf
movq %rbx, %rdi
movq %r13, %rdx
xorl %eax, %eax
callq 0x36b96
jmp 0x6e973
leaq 0x4f601(%rip), %rsi     # 0xbdf63
jmp 0x6e96b
leaq 0x4f631(%rip), %rsi     # 0xbdf9c
movq %rbx, %rdi
callq 0x36b6f
cmpl $0x3, %r15d
je 0x6e936
callq 0x6a604
jmp 0x6e936