// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/src/sentinel.c
// Function: sentinelCommand
void sentinelCommand(client *c) {
    if (!strcasecmp(c->argv[1]->ptr,"masters")) {
        /* SENTINEL MASTERS */
        if (c->argc != 2) goto numargserr;
        addReplyDictOfRedisInstances(c,sentinel.masters);
    } else if (!strcasecmp(c->argv[1]->ptr,"master")) {
        /* SENTINEL MASTER <name> */
        sentinelRedisInstance *ri;

        if (c->argc != 3) goto numargserr;
        if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
            == NULL) return;
        addReplySentinelRedisInstance(c,ri);
    } else if (!strcasecmp(c->argv[1]->ptr,"slaves")) {
        /* SENTINEL SLAVES <master-name> */
        sentinelRedisInstance *ri;

        if (c->argc != 3) goto numargserr;
        if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2])) == NULL)
            return;
        addReplyDictOfRedisInstances(c,ri->slaves);
    } else if (!strcasecmp(c->argv[1]->ptr,"sentinels")) {
        /* SENTINEL SENTINELS <master-name> */
        sentinelRedisInstance *ri;

        if (c->argc != 3) goto numargserr;
        if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2])) == NULL)
            return;
        addReplyDictOfRedisInstances(c,ri->sentinels);
    } else if (!strcasecmp(c->argv[1]->ptr,"is-master-down-by-addr")) {
        /* SENTINEL IS-MASTER-DOWN-BY-ADDR <ip> <port> <current-epoch> <runid>
         *
         * Arguments:
         *
         * ip and port are the ip and port of the master we want to be
         * checked by Sentinel. Note that the command will not check by
         * name but just by master, in theory different Sentinels may monitor
         * differnet masters with the same name.
         *
         * current-epoch is needed in order to understand if we are allowed
         * to vote for a failover leader or not. Each Sentinel can vote just
         * one time per epoch.
         *
         * runid is "*" if we are not seeking for a vote from the Sentinel
         * in order to elect the failover leader. Otherwise it is set to the
         * runid we want the Sentinel to vote if it did not already voted.
         */
        sentinelRedisInstance *ri;
        long long req_epoch;
        uint64_t leader_epoch = 0;
        char *leader = NULL;
        long port;
        int isdown = 0;

        if (c->argc != 6) goto numargserr;
        if (getLongFromObjectOrReply(c,c->argv[3],&port,NULL) != C_OK ||
            getLongLongFromObjectOrReply(c,c->argv[4],&req_epoch,NULL)
                                                              != C_OK)
            return;
        ri = getSentinelRedisInstanceByAddrAndRunID(sentinel.masters,
            c->argv[2]->ptr,port,NULL);

        /* It exists? Is actually a master? Is subjectively down? It's down.
         * Note: if we are in tilt mode we always reply with "0". */
        if (!sentinel.tilt && ri && (ri->flags & SRI_S_DOWN) &&
                                    (ri->flags & SRI_MASTER))
            isdown = 1;

        /* Vote for the master (or fetch the previous vote) if the request
         * includes a runid, otherwise the sender is not seeking for a vote. */
        if (ri && ri->flags & SRI_MASTER && strcasecmp(c->argv[5]->ptr,"*")) {
            leader = sentinelVoteLeader(ri,(uint64_t)req_epoch,
                                            c->argv[5]->ptr,
                                            &leader_epoch);
        }

        /* Reply with a three-elements multi-bulk reply:
         * down state, leader, vote epoch. */
        addReplyMultiBulkLen(c,3);
        addReply(c, isdown ? shared.cone : shared.czero);
        addReplyBulkCString(c, leader ? leader : "*");
        addReplyLongLong(c, (long long)leader_epoch);
        if (leader) sdsfree(leader);
    } else if (!strcasecmp(c->argv[1]->ptr,"reset")) {
        /* SENTINEL RESET <pattern> */
        if (c->argc != 3) goto numargserr;
        addReplyLongLong(c,sentinelResetMastersByPattern(c->argv[2]->ptr,SENTINEL_GENERATE_EVENT));
    } else if (!strcasecmp(c->argv[1]->ptr,"get-master-addr-by-name")) {
        /* SENTINEL GET-MASTER-ADDR-BY-NAME <master-name> */
        sentinelRedisInstance *ri;

        if (c->argc != 3) goto numargserr;
        ri = sentinelGetMasterByName(c->argv[2]->ptr);
        if (ri == NULL) {
            addReply(c,shared.nullmultibulk);
        } else {
            sentinelAddr *addr = sentinelGetCurrentMasterAddress(ri);

            addReplyMultiBulkLen(c,2);
            addReplyBulkCString(c,addr->ip);
            addReplyBulkLongLong(c,addr->port);
        }
    } else if (!strcasecmp(c->argv[1]->ptr,"failover")) {
        /* SENTINEL FAILOVER <master-name> */
        sentinelRedisInstance *ri;

        if (c->argc != 3) goto numargserr;
        if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2])) == NULL)
            return;
        if (ri->flags & SRI_FAILOVER_IN_PROGRESS) {
            addReplySds(c,sdsnew("-INPROG Failover already in progress\r\n"));
            return;
        }
        if (sentinelSelectSlave(ri) == NULL) {
            addReplySds(c,sdsnew("-NOGOODSLAVE No suitable slave to promote\r\n"));
            return;
        }
        serverLog(LL_WARNING,"Executing user requested FAILOVER of '%s'",
            ri->name);
        sentinelStartFailover(ri);
        ri->flags |= SRI_FORCE_FAILOVER;
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"pending-scripts")) {
        /* SENTINEL PENDING-SCRIPTS */

        if (c->argc != 2) goto numargserr;
        sentinelPendingScriptsCommand(c);
    } else if (!strcasecmp(c->argv[1]->ptr,"monitor")) {
        /* SENTINEL MONITOR <name> <ip> <port> <quorum> */
        sentinelRedisInstance *ri;
        long quorum, port;
        char ip[NET_IP_STR_LEN];

        if (c->argc != 6) goto numargserr;
        if (getLongFromObjectOrReply(c,c->argv[5],&quorum,"Invalid quorum")
            != C_OK) return;
        if (getLongFromObjectOrReply(c,c->argv[4],&port,"Invalid port")
            != C_OK) return;

        if (quorum <= 0) {
            addReplyError(c, "Quorum must be 1 or greater.");
            return;
        }

        /* Make sure the IP field is actually a valid IP before passing it
         * to createSentinelRedisInstance(), otherwise we may trigger a
         * DNS lookup at runtime. */
        if (anetResolveIP(NULL,c->argv[3]->ptr,ip,sizeof(ip)) == ANET_ERR) {
            addReplyError(c,"Invalid IP address specified");
            return;
        }

        /* Parameters are valid. Try to create the master instance. */
        ri = createSentinelRedisInstance(c->argv[2]->ptr,SRI_MASTER,
                c->argv[3]->ptr,port,quorum,NULL);
        if (ri == NULL) {
            switch(errno) {
            case EBUSY:
                addReplyError(c,"Duplicated master name");
                break;
            case EINVAL:
                addReplyError(c,"Invalid port number");
                break;
            default:
                addReplyError(c,"Unspecified error adding the instance");
                break;
            }
        } else {
            sentinelFlushConfig();
            sentinelEvent(LL_WARNING,"+monitor",ri,"%@ quorum %d",ri->quorum);
            addReply(c,shared.ok);
        }
    } else if (!strcasecmp(c->argv[1]->ptr,"flushconfig")) {
        if (c->argc != 2) goto numargserr;
        sentinelFlushConfig();
        addReply(c,shared.ok);
        return;
    } else if (!strcasecmp(c->argv[1]->ptr,"remove")) {
        /* SENTINEL REMOVE <name> */
        sentinelRedisInstance *ri;

        if (c->argc != 3) goto numargserr;
        if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
            == NULL) return;
        sentinelEvent(LL_WARNING,"-monitor",ri,"%@");
        dictDelete(sentinel.masters,c->argv[2]->ptr);
        sentinelFlushConfig();
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"ckquorum")) {
        /* SENTINEL CKQUORUM <name> */
        sentinelRedisInstance *ri;
        int usable;

        if (c->argc != 3) goto numargserr;
        if ((ri = sentinelGetMasterByNameOrReplyError(c,c->argv[2]))
            == NULL) return;
        int result = sentinelIsQuorumReachable(ri,&usable);
        if (result == SENTINEL_ISQR_OK) {
            addReplySds(c, sdscatfmt(sdsempty(),
                "+OK %i usable Sentinels. Quorum and failover authorization "
                "can be reached\r\n",usable));
        } else {
            sds e = sdscatfmt(sdsempty(),
                "-NOQUORUM %i usable Sentinels. ",usable);
            if (result & SENTINEL_ISQR_NOQUORUM)
                e = sdscat(e,"Not enough available Sentinels to reach the"
                             " specified quorum for this master");
            if (result & SENTINEL_ISQR_NOAUTH) {
                if (result & SENTINEL_ISQR_NOQUORUM) e = sdscat(e,". ");
                e = sdscat(e, "Not enough available Sentinels to reach the"
                              " majority and authorize a failover");
            }
            e = sdscat(e,"\r\n");
            addReplySds(c,e);
        }
    } else if (!strcasecmp(c->argv[1]->ptr,"set")) {
        if (c->argc < 3 || c->argc % 2 == 0) goto numargserr;
        sentinelSetCommand(c);
    } else if (!strcasecmp(c->argv[1]->ptr,"info-cache")) {
        /* SENTINEL INFO-CACHE <name> */
        if (c->argc < 2) goto numargserr;
        mstime_t now = mstime();

        /* Create an ad-hoc dictionary type so that we can iterate
         * a dictionary composed of just the master groups the user
         * requested. */
        dictType copy_keeper = instancesDictType;
        copy_keeper.valDestructor = NULL;
        dict *masters_local = sentinel.masters;
        if (c->argc > 2) {
            masters_local = dictCreate(&copy_keeper, NULL);

            for (int i = 2; i < c->argc; i++) {
                sentinelRedisInstance *ri;
                ri = sentinelGetMasterByName(c->argv[i]->ptr);
                if (!ri) continue; /* ignore non-existing names */
                dictAdd(masters_local, ri->name, ri);
            }
        }

        /* Reply format:
         *   1.) master name
         *   2.) 1.) info from master
         *       2.) info from replica
         *       ...
         *   3.) other master name
         *   ...
         */
        addReplyMultiBulkLen(c,dictSize(masters_local) * 2);

        dictIterator  *di;
        dictEntry *de;
        di = dictGetIterator(masters_local);
        while ((de = dictNext(di)) != NULL) {
            sentinelRedisInstance *ri = dictGetVal(de);
            addReplyBulkCBuffer(c,ri->name,strlen(ri->name));
            addReplyMultiBulkLen(c,dictSize(ri->slaves) + 1); /* +1 for self */
            addReplyMultiBulkLen(c,2);
            addReplyLongLong(c, now - ri->info_refresh);
            if (ri->info)
                addReplyBulkCBuffer(c,ri->info,sdslen(ri->info));
            else
                addReply(c,shared.nullbulk);

            dictIterator *sdi;
            dictEntry *sde;
            sdi = dictGetIterator(ri->slaves);
            while ((sde = dictNext(sdi)) != NULL) {
                sentinelRedisInstance *sri = dictGetVal(sde);
                addReplyMultiBulkLen(c,2);
                addReplyLongLong(c, now - sri->info_refresh);
                if (sri->info)
                    addReplyBulkCBuffer(c,sri->info,sdslen(sri->info));
                else
                    addReply(c,shared.nullbulk);
            }
            dictReleaseIterator(sdi);
        }
        dictReleaseIterator(di);
        if (masters_local != sentinel.masters) dictRelease(masters_local);
    } else if (!strcasecmp(c->argv[1]->ptr,"simulate-failure")) {
        /* SENTINEL SIMULATE-FAILURE <flag> <flag> ... <flag> */
        int j;

        sentinel.simfailure_flags = SENTINEL_SIMFAILURE_NONE;
        for (j = 2; j < c->argc; j++) {
            if (!strcasecmp(c->argv[j]->ptr,"crash-after-election")) {
                sentinel.simfailure_flags |=
                    SENTINEL_SIMFAILURE_CRASH_AFTER_ELECTION;
                serverLog(LL_WARNING,"Failure simulation: this Sentinel "
                    "will crash after being successfully elected as failover "
                    "leader");
            } else if (!strcasecmp(c->argv[j]->ptr,"crash-after-promotion")) {
                sentinel.simfailure_flags |=
                    SENTINEL_SIMFAILURE_CRASH_AFTER_PROMOTION;
                serverLog(LL_WARNING,"Failure simulation: this Sentinel "
                    "will crash after promoting the selected slave to master");
            } else if (!strcasecmp(c->argv[j]->ptr,"help")) {
                addReplyMultiBulkLen(c,2);
                addReplyBulkCString(c,"crash-after-election");
                addReplyBulkCString(c,"crash-after-promotion");
            } else {
                addReplyError(c,"Unknown failure simulation specified");
                return;
            }
        }
        addReply(c,shared.ok);
    } else {
        addReplyErrorFormat(c,"Unknown sentinel subcommand '%s'",
                               (char*)c->argv[1]->ptr);
    }
    return;

numargserr:
    addReplyErrorFormat(c,"Wrong number of arguments for 'sentinel %s'",
                          (char*)c->argv[1]->ptr);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq 0x40(%rdi), %r15
movq 0x8(%r15), %rax
movq 0x8(%rax), %r14
leaq 0x578fa(%rip), %rsi     # 0xcce7d
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x756f8
leaq 0x53709(%rip), %rsi     # 0xc8ca3
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x7571f
leaq 0x57550(%rip), %rsi     # 0xccb01
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75757
leaq 0x57807(%rip), %rsi     # 0xccdcf
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x7577f
leaq 0x578a6(%rip), %rsi     # 0xcce85
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x757aa
leaq 0x538c6(%rip), %rsi     # 0xc8ebc
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75840
leaq 0x5788f(%rip), %rsi     # 0xcce9c
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75875
leaq 0x57aa9(%rip), %rsi     # 0xcd0cd
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x758e8
leaq 0x578f6(%rip), %rsi     # 0xccf31
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x7594d
leaq 0x56caa(%rip), %rsi     # 0xcc2fc
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x7596d
leaq 0x57941(%rip), %rsi     # 0xccfaa
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75a6d
leaq 0x57936(%rip), %rsi     # 0xccfb6
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75a84
leaq 0x5792f(%rip), %rsi     # 0xccfc6
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75b9f
leaq 0x48217(%rip), %rsi     # 0xbd8c5
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75c09
leaq 0x57a11(%rip), %rsi     # 0xcd0d6
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75cc0
leaq 0x57de1(%rip), %rsi     # 0xcd4bd
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75cec
leaq 0x57af9(%rip), %rsi     # 0xcd1ec
jmp 0x75cd1
cmpl $0x2, 0x38(%rbx)
jne 0x75cca
movq 0xa1007(%rip), %rsi     # 0x116710
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7ab28
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x7ab76
testq %rax, %rax
je 0x75cb1
movq %rbx, %rdi
movq %rax, %rsi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7a435
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x7ab76
testq %rax, %rax
je 0x75cb1
movq 0x88(%rax), %rsi
jmp 0x75709
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x7ab76
testq %rax, %rax
je 0x75cb1
movq 0x80(%rax), %rsi
jmp 0x75709
movq $0x0, (%rsp)
cmpl $0x6, 0x38(%rbx)
jne 0x75cca
movq 0x18(%r15), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x41718
testl %eax, %eax
jne 0x75cb1
movq 0x40(%rbx), %rax
movq 0x20(%rax), %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x416bb
testl %eax, %eax
jne 0x75cb1
movq 0xa0f13(%rip), %rdi     # 0x116710
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movl 0x8(%rsp), %edx
xorl %ecx, %ecx
callq 0x7771c
movq %rax, %r14
cmpl $0x0, 0xa0efa(%rip)     # 0x116718
jne 0x75afe
testq %r14, %r14
je 0x75afe
movl (%r14), %eax
movl %eax, %ecx
notl %ecx
testb $0x9, %cl
setne %bpl
jmp 0x75b0d
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0x77f00
movslq %eax, %rsi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d23f
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdi
callq 0x77d01
testq %rax, %rax
je 0x75a60
testb $0x40, (%rax)
je 0x758af
movq 0x118(%rax), %rcx
testq %rcx, %rcx
je 0x758af
cmpl $0x4, 0xf0(%rax)
jg 0x758b2
movq %rax, %rcx
movq 0x20(%rcx), %r14
movl $0x2, %esi
movq %rbx, %rdi
callq 0x3d274
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x3d0f2
movslq 0x8(%r14), %rsi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3d415
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x7ab76
testq %rax, %rax
je 0x75cb1
movq %rax, %r14
testb $0x40, (%rax)
jne 0x75a78
movq %r14, %rdi
callq 0x7ad94
testq %rax, %rax
je 0x75c35
movq 0x8(%r14), %rdx
leaq 0x575d8(%rip), %rsi     # 0xccf07
movl $0x3, %edi
xorl %eax, %eax
callq 0x2fdad
movq %r14, %rdi
callq 0x7aed2
orb $0x8, 0x1(%r14)
jmp 0x75add
cmpl $0x2, 0x38(%rbx)
jne 0x75cca
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x772b8
cmpl $0x6, 0x38(%rbx)
jne 0x75cca
movq 0x28(%r15), %rsi
leaq 0x575bf(%rip), %rcx     # 0xccf41
movq %rsp, %rdx
movq %rbx, %rdi
callq 0x41718
testl %eax, %eax
jne 0x75cb1
movq 0x40(%rbx), %rax
movq 0x20(%rax), %rsi
leaq 0x4e4d1(%rip), %rcx     # 0xc3e75
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
callq 0x41718
testl %eax, %eax
jne 0x75cb1
cmpq $0x0, (%rsp)
jle 0x75e66
movq 0x40(%rbx), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
leaq 0x20(%rsp), %rdx
movl $0x2e, %ecx
xorl %edi, %edi
callq 0x2da4b
cmpl $-0x1, %eax
je 0x7607f
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rax), %rax
movq 0x8(%rcx), %rdi
movq 0x8(%rax), %rdx
movl 0x8(%rsp), %ecx
movl (%rsp), %r8d
movl $0x1, %esi
xorl %r9d, %r9d
callq 0x7798b
testq %rax, %rax
je 0x76093
movq %rax, %r14
callq 0x76861
movl 0x90(%r14), %r8d
leaq 0x568c9(%rip), %rsi     # 0xcc2fb
leaq 0x568cb(%rip), %rcx     # 0xcc304
movl $0x3, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x76a24
leaq 0x8c8c1(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
jmp 0x75cb1
leaq 0x8c8a9(%rip), %rax     # 0x102310
movq 0x58(%rax), %rsi
jmp 0x75ae8
cmpl $0x2, 0x38(%rbx)
je 0x75ad8
jmp 0x75cca
leaq 0x57435(%rip), %rdi     # 0xcceb4
jmp 0x75c3c
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x7ab76
testq %rax, %rax
je 0x75cb1
leaq 0x57513(%rip), %rsi     # 0xccfbd
leaq 0x56a4f(%rip), %rcx     # 0xcc500
movl $0x3, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x76a24
movq 0xa0c49(%rip), %rdi     # 0x116710
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x2ecb5
callq 0x76861
leaq 0x8c82c(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3c854
testq %r14, %r14
je 0x75c5a
movl (%r14), %eax
movb $0x1, %bpl
testb $0x1, %al
je 0x75b73
movq 0x40(%rbx), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %r15
leaq 0x470d7(%rip), %rsi     # 0xbcbfb
movq %r15, %rdi
callq 0x262f0
testl %eax, %eax
je 0x75b73
movq 0x20(%rsp), %rsi
movq %rsp, %r12
movq %r14, %rdi
movq %r15, %rdx
movq %r12, %rcx
callq 0x7ac49
movq %rax, %r14
movq (%r12), %r15
movl $0x3, %esi
movq %rbx, %rdi
callq 0x3d274
testb %bpl, %bpl
jne 0x75c6d
leaq 0x8c7a6(%rip), %rax     # 0x102310
addq $0x28, %rax
jmp 0x75c78
movl $0x3, %esi
movq %rbx, %rdi
callq 0x3d274
xorl %r14d, %r14d
testb %bpl, %bpl
jne 0x75c6a
leaq 0x8c77d(%rip), %rax     # 0x102310
addq $0x28, %rax
xorl %r15d, %r15d
jmp 0x75c78
cmpl $0x3, 0x38(%rbx)
jne 0x75cca
movq 0x10(%r15), %rsi
movq %rbx, %rdi
callq 0x7ab76
testq %rax, %rax
je 0x75cb1
leaq 0x20(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x7abaf
movl %eax, %ebp
callq 0x3628d
movl (%r14), %edx
testl %ebp, %ebp
je 0x75e53
leaq 0x57434(%rip), %rsi     # 0xcd01b
movq %rax, %rdi
xorl %eax, %eax
callq 0x36fb1
testb $0x1, %bpl
jne 0x75e72
cmpl $0x1, %ebp
jne 0x75e95
jmp 0x75ea4
movl 0x38(%rbx), %eax
cmpl $0x3, %eax
setl %cl
testb $0x1, %al
sete %al
orb %cl, %al
jne 0x75cca
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7afb1
leaq 0x5729f(%rip), %rdi     # 0xccedb
callq 0x362b0
movq %rbx, %rdi
movq %rax, %rsi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ca86
movl $0x3, %esi
movq %rbx, %rdi
callq 0x3d274
xorl %r14d, %r14d
xorl %r15d, %r15d
leaq 0x8c69c(%rip), %rax     # 0x102310
addq $0x20, %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x3c854
testq %r14, %r14
leaq 0x46f6e(%rip), %rsi     # 0xbcbfb
cmovneq %r14, %rsi
movq %rbx, %rdi
callq 0x3d0f2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3d23f
testq %r14, %r14
je 0x75cb1
movq %r14, %rdi
callq 0x36330
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, 0x38(%rbx)
jge 0x75dc2
leaq 0x5753c(%rip), %rsi     # 0xcd20d
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3cc2d
movq $0x0, 0xa0a51(%rip) # 0x116748
cmpl $0x3, 0x38(%rbx)
jl 0x75add
movl $0x2, %r15d
leaq 0x573d3(%rip), %r14     # 0xcd0e1
leaq 0x57442(%rip), %r12     # 0xcd157
leaq 0x4944b(%rip), %rbp     # 0xbf167
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x262f0
testl %eax, %eax
je 0x75d7e
movq %r13, %rdi
movq %r12, %rsi
callq 0x262f0
testl %eax, %eax
je 0x75d93
movq %r13, %rdi
movq %rbp, %rsi
callq 0x262f0
testl %eax, %eax
jne 0x760ad
movl $0x2, %esi
movq %rbx, %rdi
callq 0x3d274
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d0f2
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3d0f2
jmp 0x75dad
orb $0x1, 0xa09c3(%rip)     # 0x116748
movl $0x3, %edi
leaq 0x57365(%rip), %rsi     # 0xcd0f6
jmp 0x75da6
orb $0x2, 0xa09ae(%rip)     # 0x116748
movl $0x3, %edi
leaq 0x573c7(%rip), %rsi     # 0xcd16d
xorl %eax, %eax
callq 0x2fdad
incq %r15
movslq 0x38(%rbx), %rax
cmpq %rax, %r15
jl 0x75d1c
jmp 0x75add
callq 0x2ffce
movq %rax, %r14
movq 0x8b4ff(%rip), %rax     # 0x1012d0
movq %rax, 0x40(%rsp)
movups 0x8b4e3(%rip), %xmm0    # 0x1012c0
movaps %xmm0, 0x30(%rsp)
movups 0x8b4c7(%rip), %xmm0    # 0x1012b0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x48(%rsp)
cmpl $0x3, 0x38(%rbx)
jl 0x75ec3
leaq 0x20(%rsp), %rdi
xorl %esi, %esi
callq 0x2e68c
movq %rax, %r12
cmpl $0x3, 0x38(%rbx)
jl 0x75eca
movl $0x2, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %rdi
callq 0x77d01
testq %rax, %rax
je 0x75e45
movq 0x8(%rax), %rsi
movq %r12, %rdi
movq %rax, %rdx
callq 0x2e9b8
incq %r15
movslq 0x38(%rbx), %rax
cmpq %rax, %r15
jl 0x75e20
jmp 0x75eca
leaq 0x57175(%rip), %rsi     # 0xccfcf
movq %rax, %rdi
xorl %eax, %eax
callq 0x36fb1
jmp 0x75eb3
leaq 0x5669d(%rip), %rsi     # 0xcc50a
jmp 0x76086
leaq 0x571c2(%rip), %rsi     # 0xcd03b
movq %rax, %rdi
callq 0x36b9c
cmpl $0x1, %ebp
je 0x75ea4
leaq 0x59844(%rip), %rsi     # 0xcf6d1
movq %rax, %rdi
callq 0x36b9c
leaq 0x571ec(%rip), %rsi     # 0xcd088
movq %rax, %rdi
callq 0x36b9c
leaq 0x4df31(%rip), %rsi     # 0xc3ddc
movq %rax, %rdi
callq 0x36b9c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x3ca86
jmp 0x75cb1
movq 0xa0846(%rip), %r12     # 0x116710
movq 0x48(%r12), %rsi
addq 0x28(%r12), %rsi
addq %rsi, %rsi
movq %rbx, %rdi
callq 0x3d274
movq %r12, 0x18(%rsp)
movq %r12, %rdi
callq 0x2efbb
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x76059
leaq 0x8c407(%rip), %rbp     # 0x102310
leaq 0x56178(%rip), %r15     # 0xcc088
movq 0x8(%rax), %r12
movq 0x8(%r12), %r13
movq %r13, %rdi
callq 0x26500
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x3d346
movq 0x88(%r12), %rax
movq 0x28(%rax), %rcx
movq 0x48(%rax), %rax
leaq (%rcx,%rax), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x3d274
movl $0x2, %esi
movq %rbx, %rdi
callq 0x3d274
movq %r14, %rsi
subq 0x60(%r12), %rsi
movq %rbx, %rdi
callq 0x3d23f
movq 0x130(%r12), %r13
testq %r13, %r13
je 0x75f90
movq %r13, %rdi
callq 0x78c48
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x3d346
jmp 0x75f9c
movq 0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x3c854
movq 0x88(%r12), %rdi
callq 0x2efbb
movq %rax, %r13
movq %rax, %rdi
callq 0x2f015
testq %rax, %rax
je 0x7603e
movq 0x8(%rax), %r12
movl $0x2, %esi
movq %rbx, %rdi
callq 0x3d274
movq %r14, %rsi
subq 0x60(%r12), %rsi
movq %rbx, %rdi
callq 0x3d23f
movq 0x130(%r12), %rsi
testq %rsi, %rsi
je 0x76007
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x7602c
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x7602e
movq 0x50(%rbp), %rsi
movq %rbx, %rdi
callq 0x3c854
jmp 0x76036
movq -0x11(%rsi), %rdx
jmp 0x7602e
movzwl -0x5(%rsi), %edx
jmp 0x7602e
movl -0x9(%rsi), %edx
jmp 0x7602e
movzbl -0x3(%rsi), %edx
jmp 0x7602e
xorl %edx, %edx
movq %rbx, %rdi
callq 0x3d346
movq %r13, %rdi
jmp 0x75faf
movq %r13, %rdi
callq 0x2f0dd
movq 0x10(%rsp), %rdi
callq 0x2f015
testq %rax, %rax
jne 0x75f10
movq 0x10(%rsp), %rdi
callq 0x2f0dd
movq 0x18(%rsp), %rdi
cmpq 0xa06a1(%rip), %rdi     # 0x116710
je 0x75cb1
callq 0x2eef3
jmp 0x75cb1
leaq 0x56eca(%rip), %rsi     # 0xccf50
movq %rbx, %rdi
callq 0x3cc06
jmp 0x75cb1
callq 0x26880
movl (%rax), %eax
cmpl $0x16, %eax
je 0x760ca
cmpl $0x10, %eax
jne 0x760d3
leaq 0x56ec2(%rip), %rsi     # 0xccf6d
jmp 0x76086
leaq 0x57113(%rip), %rsi     # 0xcd1c7
movq %rbx, %rdi
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3cc06
leaq 0x56496(%rip), %rsi     # 0xcc567
jmp 0x76086
leaq 0x56eaa(%rip), %rsi     # 0xccf84
jmp 0x76086