// File: /workspace/github_c_makefile_star2_O0/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelHandleConfiguration
char *sentinelHandleConfiguration(char **argv, int argc) {
    sentinelRedisInstance *ri;

    if (!strcasecmp(argv[0],"monitor") && argc == 5) {
        /* monitor <name> <host> <port> <quorum> */
        int quorum = atoi(argv[4]);

        if (quorum <= 0) return "Quorum must be 1 or greater.";
        if (createSentinelRedisInstance(argv[1],SRI_MASTER,argv[2],
                                        atoi(argv[3]),quorum,NULL) == NULL)
        {
            switch(errno) {
            case EBUSY: return "Duplicated master name.";
            case ENOENT: return "Can't resolve master instance hostname.";
            case EINVAL: return "Invalid port number";
            }
        }
    } else if (!strcasecmp(argv[0],"down-after-milliseconds") && argc == 3) {
        /* down-after-milliseconds <name> <milliseconds> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        ri->down_after_period = atoi(argv[2]);
        if (ri->down_after_period <= 0)
            return "negative or zero time parameter.";
        sentinelPropagateDownAfterPeriod(ri);
    } else if (!strcasecmp(argv[0],"failover-timeout") && argc == 3) {
        /* failover-timeout <name> <milliseconds> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        ri->failover_timeout = atoi(argv[2]);
        if (ri->failover_timeout <= 0)
            return "negative or zero time parameter.";
   } else if (!strcasecmp(argv[0],"parallel-syncs") && argc == 3) {
        /* parallel-syncs <name> <milliseconds> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        ri->parallel_syncs = atoi(argv[2]);
   } else if (!strcasecmp(argv[0],"notification-script") && argc == 3) {
        /* notification-script <name> <path> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        if (access(argv[2],X_OK) == -1)
            return "Notification script seems non existing or non executable.";
        ri->notification_script = sdsnew(argv[2]);
   } else if (!strcasecmp(argv[0],"client-reconfig-script") && argc == 3) {
        /* client-reconfig-script <name> <path> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        if (access(argv[2],X_OK) == -1)
            return "Client reconfiguration script seems non existing or "
                   "non executable.";
        ri->client_reconfig_script = sdsnew(argv[2]);
   } else if (!strcasecmp(argv[0],"auth-pass") && argc == 3) {
        /* auth-pass <name> <password> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        ri->auth_pass = sdsnew(argv[2]);
    } else if (!strcasecmp(argv[0],"current-epoch") && argc == 2) {
        /* current-epoch <epoch> */
        unsigned long long current_epoch = strtoull(argv[1],NULL,10);
        if (current_epoch > sentinel.current_epoch)
            sentinel.current_epoch = current_epoch;
    } else if (!strcasecmp(argv[0],"myid") && argc == 2) {
        if (strlen(argv[1]) != CONFIG_RUN_ID_SIZE)
            return "Malformed Sentinel id in myid option.";
        memcpy(sentinel.myid,argv[1],CONFIG_RUN_ID_SIZE);
    } else if (!strcasecmp(argv[0],"config-epoch") && argc == 3) {
        /* config-epoch <name> <epoch> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        ri->config_epoch = strtoull(argv[2],NULL,10);
        /* The following update of current_epoch is not really useful as
         * now the current epoch is persisted on the config file, but
         * we leave this check here for redundancy. */
        if (ri->config_epoch > sentinel.current_epoch)
            sentinel.current_epoch = ri->config_epoch;
    } else if (!strcasecmp(argv[0],"leader-epoch") && argc == 3) {
        /* leader-epoch <name> <epoch> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        ri->leader_epoch = strtoull(argv[2],NULL,10);
    } else if (!strcasecmp(argv[0],"known-slave") && argc == 4) {
        sentinelRedisInstance *slave;

        /* known-slave <name> <ip> <port> */
        ri = sentinelGetMasterByName(argv[1]);
        if (!ri) return "No such master with specified name.";
        if ((slave = createSentinelRedisInstance(NULL,SRI_SLAVE,argv[2],
                    atoi(argv[3]), ri->quorum, ri)) == NULL)
        {
            return "Wrong hostname or port for slave.";
        }
    } else if (!strcasecmp(argv[0],"known-sentinel") &&
               (argc == 4 || argc == 5)) {
        sentinelRedisInstance *si;

        if (argc == 5) { /* Ignore the old form without runid. */
            /* known-sentinel <name> <ip> <port> [runid] */
            ri = sentinelGetMasterByName(argv[1]);
            if (!ri) return "No such master with specified name.";
            if ((si = createSentinelRedisInstance(argv[4],SRI_SENTINEL,argv[2],
                        atoi(argv[3]), ri->quorum, ri)) == NULL)
            {
                return "Wrong hostname or port for sentinel.";
            }
            si->runid = sdsnew(argv[4]);
            sentinelTryConnectionSharing(si);
        }
    } else if (!strcasecmp(argv[0],"announce-ip") && argc == 2) {
        /* announce-ip <ip-address> */
        if (strlen(argv[1]))
            sentinel.announce_ip = sdsnew(argv[1]);
    } else if (!strcasecmp(argv[0],"announce-port") && argc == 2) {
        /* announce-port <port> */
        sentinel.announce_port = atoi(argv[1]);
    } else {
        return "Unrecognized sentinel configuration statement.";
    }
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf2ab(%rip), %rsi     # 0x146008
callq 0x26300
cmpl $0x0, %eax
jne 0x96e3f
cmpl $0x5, -0x14(%rbp)
jne 0x96e3f
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x26760
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jg 0x96d9b
leaq 0xaf484(%rip), %rax     # 0x146216
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x26760
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movl %eax, %ecx
movl -0x24(%rbp), %r8d
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %r9d
callq 0x95f90
cmpq $0x0, %rax
jne 0x96e3a
callq 0x26880
movl (%rax), %eax
movl %eax, -0x54(%rbp)
subl $0x2, %eax
je 0x96e18
jmp 0x96df4
movl -0x54(%rbp), %eax
subl $0x10, %eax
je 0x96e08
jmp 0x96dfe
movl -0x54(%rbp), %eax
subl $0x16, %eax
je 0x96e28
jmp 0x96e38
leaq 0xaf424(%rip), %rax     # 0x146233
movq %rax, -0x8(%rbp)
jmp 0x97517
leaq 0xaf42c(%rip), %rax     # 0x14624b
movq %rax, -0x8(%rbp)
jmp 0x97517
leaq 0xaf444(%rip), %rax     # 0x146273
movq %rax, -0x8(%rbp)
jmp 0x97517
jmp 0x96e3a
jmp 0x9750f
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf43a(%rip), %rsi     # 0x146287
callq 0x26300
cmpl $0x0, %eax
jne 0x96ec6
cmpl $0x3, -0x14(%rbp)
jne 0x96ec6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x96e85
leaq 0xaf423(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x26760
movslq %eax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x58(%rax)
jg 0x96eb8
leaq 0xaf414(%rip), %rax     # 0x1462c3
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x20(%rbp), %rdi
callq 0x96c20
jmp 0x9750d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf410(%rip), %rsi     # 0x1462e4
callq 0x26300
cmpl $0x0, %eax
jne 0x96f4a
cmpl $0x3, -0x14(%rbp)
jne 0x96f4a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x96f0c
leaq 0xaf39c(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x26760
movslq %eax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x108(%rax)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x108(%rax)
jg 0x96f45
leaq 0xaf387(%rip), %rax     # 0x1462c3
movq %rax, -0x8(%rbp)
jmp 0x97517
jmp 0x9750b
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf39d(%rip), %rsi     # 0x1462f5
callq 0x26300
cmpl $0x0, %eax
jne 0x96fae
cmpl $0x3, -0x14(%rbp)
jne 0x96fae
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x96f90
leaq 0xaf318(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x26760
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, 0x94(%rax)
jmp 0x97509
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf348(%rip), %rsi     # 0x146304
callq 0x26300
cmpl $0x0, %eax
jne 0x9703b
cmpl $0x3, -0x14(%rbp)
jne 0x9703b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x96ff4
leaq 0xaf2b4(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0x26aa0
cmpl $-0x1, %eax
jne 0x9701b
leaq 0xaf306(%rip), %rax     # 0x146318
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x38510
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x120(%rax)
jmp 0x97507
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf309(%rip), %rsi     # 0x146352
callq 0x26300
cmpl $0x0, %eax
jne 0x970c8
cmpl $0x3, -0x14(%rbp)
jne 0x970c8
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x97081
leaq 0xaf227(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movl $0x1, %esi
callq 0x26aa0
cmpl $-0x1, %eax
jne 0x970a8
leaq 0xaf2ca(%rip), %rax     # 0x146369
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x38510
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x128(%rax)
jmp 0x97505
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf2d7(%rip), %rsi     # 0x1463ad
callq 0x26300
cmpl $0x0, %eax
jne 0x9712e
cmpl $0x3, -0x14(%rbp)
jne 0x9712e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x9710e
leaq 0xaf19a(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x38510
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x98(%rax)
jmp 0x97503
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf27b(%rip), %rsi     # 0x1463b7
callq 0x26300
cmpl $0x0, %eax
jne 0x97183
cmpl $0x2, -0x14(%rbp)
jne 0x97183
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x26a70
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq 0xf5ec7(%rip), %rax     # 0x18d038
jbe 0x9717e
movq -0x30(%rbp), %rax
movq %rax, 0xf5eba(%rip)     # 0x18d038
jmp 0x97501
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xab6a0(%rip), %rsi     # 0x142831
callq 0x26300
cmpl $0x0, %eax
jne 0x971e2
cmpl $0x2, -0x14(%rbp)
jne 0x971e2
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x264f0
cmpq $0x28, %rax
je 0x971c4
leaq 0xaf20a(%rip), %rax     # 0x1463c5
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0xf5e35(%rip), %rdi     # 0x18d008
movl $0x28, %edx
callq 0x26c60
jmp 0x974ff
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xabc6c(%rip), %rsi     # 0x142e5c
callq 0x26300
cmpl $0x0, %eax
jne 0x9726e
cmpl $0x3, -0x14(%rbp)
jne 0x9726e
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x97228
leaq 0xaf080(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x26a70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
cmpq 0xf5de0(%rip), %rax     # 0x18d038
jbe 0x97269
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, 0xf5dcf(%rip)     # 0x18d038
jmp 0x974fd
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf8e2(%rip), %rsi     # 0x146b5e
callq 0x26300
cmpl $0x0, %eax
jne 0x972dd
cmpl $0x3, -0x14(%rbp)
jne 0x972dd
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x972b4
leaq 0xaeff4(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x26a70
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0xe0(%rax)
jmp 0x974fb
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf100(%rip), %rsi     # 0x1463eb
callq 0x26300
cmpl $0x0, %eax
jne 0x97386
cmpl $0x4, -0x14(%rbp)
jne 0x97386
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x9732b
leaq 0xaef7d(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x26760
movq -0x60(%rbp), %rdx
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl 0x90(%rax), %r8d
movq -0x20(%rbp), %r9
xorl %eax, %eax
movl %eax, %edi
movl $0x2, %esi
callq 0x95f90
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x97381
leaq 0xaf07f(%rip), %rax     # 0x1463f7
movq %rax, -0x8(%rbp)
jmp 0x97517
jmp 0x974f9
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xaf085(%rip), %rsi     # 0x146419
callq 0x26300
cmpl $0x0, %eax
jne 0x9746c
cmpl $0x4, -0x14(%rbp)
je 0x973b2
cmpl $0x5, -0x14(%rbp)
jne 0x9746c
cmpl $0x5, -0x14(%rbp)
jne 0x97467
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x973e4
leaq 0xaeec4(%rip), %rax     # 0x14629f
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x26760
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rdx
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl 0x90(%rax), %r8d
movq -0x20(%rbp), %r9
movl $0x4, %esi
callq 0x95f90
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x97446
leaq 0xaefeb(%rip), %rax     # 0x146428
movq %rax, -0x8(%rbp)
jmp 0x97517
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x38510
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x40(%rbp), %rdi
callq 0x95b20
jmp 0x974f7
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xa7819(%rip), %rsi     # 0x13ec93
callq 0x26300
cmpl $0x0, %eax
jne 0x974b3
cmpl $0x2, -0x14(%rbp)
jne 0x974b3
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x264f0
cmpq $0x0, %rax
je 0x974b1
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x38510
movq %rax, 0xf5bb7(%rip)     # 0x18d068
jmp 0x974f5
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq 0xa77e4(%rip), %rsi     # 0x13eca5
callq 0x26300
cmpl $0x0, %eax
jne 0x974e6
cmpl $0x2, -0x14(%rbp)
jne 0x974e6
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x26760
movl %eax, 0xf5b8c(%rip)     # 0x18d070
jmp 0x974f3
leaq 0xaef60(%rip), %rax     # 0x14644d
movq %rax, -0x8(%rbp)
jmp 0x97517
jmp 0x974f5
jmp 0x974f7
jmp 0x974f9
jmp 0x974fb
jmp 0x974fd
jmp 0x974ff
jmp 0x97501
jmp 0x97503
jmp 0x97505
jmp 0x97507
jmp 0x97509
jmp 0x9750b
jmp 0x9750d
jmp 0x9750f
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)