// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %rdi, %r12
movq 0x40(%rdi), %rax
movq 0x10(%rax), %rsi
callq 0x7ab76
testq %rax, %rax
je 0x7b298
movq %rax, %r14
movl 0x38(%r12), %eax
cmpl $0x4, %eax
jl 0x7b260
movl %eax, 0x14(%rsp)
movl $0x3, %ebx
xorl %r15d, %r15d
movq %r12, 0x8(%rsp)
movq 0x40(%r12), %rax
movq (%rax,%rbx,8), %rcx
movq 0x8(%rax,%rbx,8), %rbp
movq 0x8(%rcx), %r12
movq 0x8(%rbp), %r13
movq %r12, %rdi
leaq 0x51561(%rip), %rsi     # 0xcc57b
callq 0x262f0
testl %eax, %eax
je 0x7b0de
movq %r12, %rdi
leaq 0x515a7(%rip), %rsi     # 0xcc5d8
callq 0x262f0
testl %eax, %eax
je 0x7b110
movq %r12, %rdi
leaq 0x515a1(%rip), %rsi     # 0xcc5e9
callq 0x262f0
testl %eax, %eax
je 0x7b13d
movq %r12, %rdi
leaq 0x51599(%rip), %rsi     # 0xcc5f8
callq 0x262f0
testl %eax, %eax
je 0x7b16a
movq %r12, %rdi
leaq 0x515d0(%rip), %rsi     # 0xcc646
callq 0x262f0
testl %eax, %eax
je 0x7b1a4
movq %r12, %rdi
leaq 0x51614(%rip), %rsi     # 0xcc6a1
callq 0x262f0
testl %eax, %eax
je 0x7b1de
movq %r12, %rdi
leaq 0x51ea5(%rip), %rsi     # 0xccf49
callq 0x262f0
testl %eax, %eax
jne 0x7b2a7
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x415ca
cmpl $-0x1, %eax
je 0x7b275
movq (%rsp), %rax
testq %rax, %rax
jle 0x7b275
movl %eax, 0x90(%r14)
jmp 0x7b21a
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x415ca
cmpl $-0x1, %eax
je 0x7b275
movq (%rsp), %rax
testq %rax, %rax
jle 0x7b275
movq %rax, 0x58(%r14)
movq %r14, %rdi
callq 0x781a2
jmp 0x7b21a
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x415ca
cmpl $-0x1, %eax
je 0x7b275
movq (%rsp), %rax
testq %rax, %rax
jle 0x7b275
movq %rax, 0x108(%r14)
jmp 0x7b21a
movq %rbp, %rdi
movq %rsp, %rsi
callq 0x415ca
cmpl $-0x1, %eax
je 0x7b275
movq (%rsp), %rax
testq %rax, %rax
jle 0x7b275
movl %eax, 0x94(%r14)
jmp 0x7b21a
cmpb $0x0, (%r13)
je 0x7b187
movq %r13, %rdi
movl $0x1, %esi
callq 0x26aa0
cmpl $-0x1, %eax
je 0x7b2bf
movq 0x120(%r14), %rdi
callq 0x36330
cmpb $0x0, (%r13)
je 0x7b1fb
movq %r13, %rdi
callq 0x362b0
jmp 0x7b1fd
cmpb $0x0, (%r13)
je 0x7b1c1
movq %r13, %rdi
movl $0x1, %esi
callq 0x26aa0
cmpl $-0x1, %eax
je 0x7b2c8
movq 0x128(%r14), %rdi
callq 0x36330
cmpb $0x0, (%r13)
je 0x7b206
movq %r13, %rdi
callq 0x362b0
jmp 0x7b208
movq 0x98(%r14), %rdi
callq 0x36330
cmpb $0x0, (%r13)
je 0x7b211
movq %r13, %rdi
callq 0x362b0
jmp 0x7b213
xorl %eax, %eax
movq %rax, 0x120(%r14)
jmp 0x7b21a
xorl %eax, %eax
movq %rax, 0x128(%r14)
jmp 0x7b21a
xorl %eax, %eax
movq %rax, 0x98(%r14)
movl $0x3, %edi
leaq 0x52192(%rip), %rsi     # 0xcd3b8
movq %r14, %rdx
leaq 0x5218d(%rip), %rcx     # 0xcd3bd
movq %r12, %r8
movq %r13, %r9
xorl %eax, %eax
callq 0x76a24
addq $0x2, %rbx
decl %r15d
movq 0x8(%rsp), %r12
cmpl %ebx, 0x38(%r12)
jg 0x7affa
cmpl $0x4, 0x14(%rsp)
jl 0x7b260
callq 0x76861
leaq 0x870a9(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
movq %r12, %rdi
callq 0x3c854
jmp 0x7b298
testl %r15d, %r15d
je 0x7b27f
callq 0x76861
leaq 0x52140(%rip), %rsi     # 0xcd3c6
movq 0x8(%rsp), %rdi
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x3cc2d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x520e5(%rip), %rsi     # 0xcd393
movq 0x8(%rsp), %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x3cc2d
jmp 0x7b2d9
leaq 0x52051(%rip), %rsi     # 0xcd317
jmp 0x7b2cf
leaq 0x52081(%rip), %rsi     # 0xcd350
movq 0x8(%rsp), %rdi
callq 0x3cc06
testl %r15d, %r15d
je 0x7b298
callq 0x76861
jmp 0x7b298