// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x1d0, %rsp            # imm = 0x1D0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3d83(%rip), %rsi     # 0x146b89
callq 0x26300
cmpl $0x0, %eax
jne 0x92e34
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
je 0x92e1f
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq 0xfa216(%rip), %rsi     # 0x18d040
callq 0x9a680
jmp 0x93df4
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xafed9(%rip), %rsi     # 0x142d24
callq 0x26300
cmpl $0x0, %eax
jne 0x92e9a
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x92e64
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x9a700
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x92e88
jmp 0x93e18
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x99c50
jmp 0x93df2
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb395c(%rip), %rsi     # 0x14680d
callq 0x26300
cmpl $0x0, %eax
jne 0x92f07
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x92eca
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x9a700
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x92eee
jmp 0x93e18
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x88(%rax), %rsi
callq 0x9a680
jmp 0x93df0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3bbd(%rip), %rsi     # 0x146adb
callq 0x26300
cmpl $0x0, %eax
jne 0x92f74
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x92f37
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x9a700
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x92f5b
jmp 0x93e18
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x80(%rax), %rsi
callq 0x9a680
jmp 0x93dee
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3c06(%rip), %rsi     # 0x146b91
callq 0x26300
cmpl $0x0, %eax
jne 0x9317c
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x6, 0x38(%rax)
je 0x92fbf
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rsi
leaq -0x48(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49f20
cmpl $0x0, %eax
jne 0x93003
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x20(%rax), %rsi
leaq -0x30(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49ea0
cmpl $0x0, %eax
je 0x93008
jmp 0x93e18
movq 0xfa031(%rip), %rdi     # 0x18d040
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x48(%rbp), %rax
movl %eax, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x95c60
movq %rax, -0x28(%rbp)
cmpl $0x0, 0xfa00f(%rip)     # 0x18d048
jne 0x93065
cmpq $0x0, -0x28(%rbp)
je 0x93065
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x93065
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x93065
movl $0x1, -0x4c(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x930c0
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x930c0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xa4ada(%rip), %rsi     # 0x137b6b
callq 0x26300
cmpl $0x0, %eax
je 0x930c0
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdx
leaq -0x38(%rbp), %rcx
callq 0x9a860
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x437f0
movq -0x8(%rbp), %rax
movq %rax, -0x160(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x930f3
leaq 0xe5b5a(%rip), %rax     # 0x178c40
movq 0x28(%rax), %rax
movq %rax, -0x168(%rbp)
jmp 0x93105
leaq 0xe5b46(%rip), %rax     # 0x178c40
movq 0x20(%rax), %rax
movq %rax, -0x168(%rbp)
movq -0x160(%rbp), %rdi
movq -0x168(%rbp), %rsi
callq 0x42cc0
movq -0x8(%rbp), %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x93137
movq -0x40(%rbp), %rax
movq %rax, -0x178(%rbp)
jmp 0x93147
leaq 0xa4a2d(%rip), %rax     # 0x137b6b
movq %rax, -0x178(%rbp)
jmp 0x93147
movq -0x170(%rbp), %rdi
movq -0x178(%rbp), %rsi
callq 0x43580
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x43780
cmpq $0x0, -0x40(%rbp)
je 0x93177
movq -0x40(%rbp), %rdi
callq 0x38620
jmp 0x93dec
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xafdaa(%rip), %rsi     # 0x142f3d
callq 0x26300
cmpl $0x0, %eax
jne 0x931e5
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x931ac
jmp 0x93df6
movq -0x8(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
movl $0x10000, %esi          # imm = 0x10000
callq 0x96860
movq -0x180(%rbp), %rdi
movslq %eax, %rsi
callq 0x43780
jmp 0x93dea
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb39ac(%rip), %rsi     # 0x146ba8
callq 0x26300
cmpl $0x0, %eax
jne 0x93290
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x93219
jmp 0x93df6
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x9324f
movq -0x8(%rbp), %rdi
leaq 0xe59fc(%rip), %rax     # 0x178c40
movq 0x58(%rax), %rsi
callq 0x42cc0
jmp 0x9328b
movq -0x58(%rbp), %rdi
callq 0x96bc0
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x437f0
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rax
movq (%rax), %rsi
callq 0x43580
movq -0x8(%rbp), %rdi
movq -0x60(%rbp), %rax
movslq 0x8(%rax), %rsi
callq 0x439f0
jmp 0x93de8
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3b32(%rip), %rsi     # 0x146dd9
callq 0x26300
cmpl $0x0, %eax
jne 0x933a6
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x932c4
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x9a700
movq %rax, -0x68(%rbp)
cmpq $0x0, %rax
jne 0x932e8
jmp 0x93e18
movq -0x68(%rbp), %rax
movl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x93321
movq -0x8(%rbp), %rax
movq %rax, -0x188(%rbp)
leaq 0xb38b8(%rip), %rdi     # 0x146bc0
callq 0x38510
movq -0x188(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x93e18
movq -0x68(%rbp), %rdi
callq 0x9a9f0
cmpq $0x0, %rax
jne 0x9335b
movq -0x8(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq 0xb38a5(%rip), %rdi     # 0x146be7
callq 0x38510
movq -0x190(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x93e18
movq -0x68(%rbp), %rax
movq 0x8(%rax), %rdx
movl $0x3, %edi
leaq 0xb38a4(%rip), %rsi     # 0x146c13
movb $0x0, %al
callq 0x2fc60
movq -0x68(%rbp), %rdi
callq 0x9abb0
movq -0x68(%rbp), %rax
movl (%rax), %ecx
orl $0x800, %ecx            # imm = 0x800
movl %ecx, (%rax)
movq -0x8(%rbp), %rdi
leaq 0xe58a8(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x93de6
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3880(%rip), %rsi     # 0x146c3d
callq 0x26300
cmpl $0x0, %eax
jne 0x933e4
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
je 0x933d6
jmp 0x93df6
movq -0x8(%rbp), %rdi
callq 0x95590
jmp 0x93de4
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb2c0d(%rip), %rsi     # 0x146008
callq 0x26300
cmpl $0x0, %eax
jne 0x935ac
movq -0x8(%rbp), %rax
cmpl $0x6, 0x38(%rax)
je 0x93418
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rax), %rsi
leaq -0x78(%rbp), %rdx
leaq 0xb381a(%rip), %rcx     # 0x146c4d
callq 0x49f20
cmpl $0x0, %eax
je 0x93442
jmp 0x93e18
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x20(%rax), %rsi
leaq -0x80(%rbp), %rdx
leaq 0xaaec4(%rip), %rcx     # 0x13e321
callq 0x49f20
cmpl $0x0, %eax
je 0x9346c
jmp 0x93e18
cmpq $0x0, -0x78(%rbp)
jg 0x93488
movq -0x8(%rbp), %rdi
leaq 0xb2d98(%rip), %rsi     # 0x146216
callq 0x42f90
jmp 0x93e18
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rsi
leaq -0xb0(%rbp), %rdx
xorl %eax, %eax
movl %eax, %edi
movl $0x2e, %ecx
callq 0x2be50
cmpl $-0x1, %eax
jne 0x934c7
movq -0x8(%rbp), %rdi
leaq 0xb379f(%rip), %rsi     # 0x146c5c
callq 0x42f90
jmp 0x93e18
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x80(%rbp), %rax
movl %eax, %ecx
movq -0x78(%rbp), %rax
movl %eax, %r8d
movl $0x1, %esi
xorl %eax, %eax
movl %eax, %r9d
callq 0x95f90
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x70(%rbp)
jne 0x93565
callq 0x26880
movl (%rax), %eax
movl %eax, -0x194(%rbp)
subl $0x10, %eax
je 0x9352f
jmp 0x93522
movl -0x194(%rbp), %eax
subl $0x16, %eax
je 0x93541
jmp 0x93553
movq -0x8(%rbp), %rdi
leaq 0xb373f(%rip), %rsi     # 0x146c79
callq 0x42f90
jmp 0x93563
movq -0x8(%rbp), %rdi
leaq 0xb2d27(%rip), %rsi     # 0x146273
callq 0x42f90
jmp 0x93563
movq -0x8(%rbp), %rdi
leaq 0xb3732(%rip), %rsi     # 0x146c90
callq 0x42f90
jmp 0x935a7
callq 0x946c0
movq -0x70(%rbp), %rdx
movq -0x70(%rbp), %rax
movl 0x90(%rax), %r8d
movl $0x3, %edi
leaq 0xb2a82(%rip), %rsi     # 0x146007
leaq 0xb2a84(%rip), %rcx     # 0x146010
movb $0x0, %al
callq 0x94990
movq -0x8(%rbp), %rdi
leaq 0xe56a2(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x93de2
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb36f3(%rip), %rsi     # 0x146cb6
callq 0x26300
cmpl $0x0, %eax
jne 0x935fa
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
je 0x935dc
jmp 0x93df6
callq 0x946c0
movq -0x8(%rbp), %rdi
leaq 0xe5654(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x93e18
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb36b1(%rip), %rsi     # 0x146cc2
callq 0x26300
cmpl $0x0, %eax
jne 0x936b0
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x9362e
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x9a700
movq %rax, -0xb8(%rbp)
cmpq $0x0, %rax
jne 0x93655
jmp 0x93e18
movq -0xb8(%rbp), %rdx
movl $0x3, %edi
leaq 0xb3661(%rip), %rsi     # 0x146cc9
leaq 0xb2b9d(%rip), %rcx     # 0x14620c
movb $0x0, %al
callq 0x94990
movq 0xf99c3(%rip), %rdi     # 0x18d040
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x2de50
callq 0x946c0
movq -0x8(%rbp), %rdi
leaq 0xe559e(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x93dde
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb360b(%rip), %rsi     # 0x146cd2
callq 0x26300
cmpl $0x0, %eax
jne 0x93832
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
je 0x936e4
jmp 0x93df6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x9a700
movq %rax, -0xc0(%rbp)
cmpq $0x0, %rax
jne 0x9370b
jmp 0x93e18
movq -0xc0(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
callq 0x9a760
movl %eax, -0xc8(%rbp)
cmpl $0x0, -0xc8(%rbp)
jne 0x93768
movq -0x8(%rbp), %rax
movq %rax, -0x1a0(%rbp)
callq 0x384f0
movq %rax, %rdi
movl -0xc4(%rbp), %edx
leaq 0xb358e(%rip), %rsi     # 0x146cdb
movb $0x0, %al
callq 0x39660
movq -0x1a0(%rbp), %rdi
movq %rax, %rsi
callq 0x42e50
jmp 0x9382d
callq 0x384f0
movq %rax, %rdi
movl -0xc4(%rbp), %edx
leaq 0xb35aa(%rip), %rsi     # 0x146d27
movb $0x0, %al
callq 0x39660
movq %rax, -0xd0(%rbp)
movl -0xc8(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x937b3
movq -0xd0(%rbp), %rdi
leaq 0xb35a0(%rip), %rsi     # 0x146d47
callq 0x390d0
movq %rax, -0xd0(%rbp)
movl -0xc8(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x93803
movl -0xc8(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x937e9
movq -0xd0(%rbp), %rdi
leaq 0xb5d56(%rip), %rsi     # 0x149533
callq 0x390d0
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
leaq 0xb359d(%rip), %rsi     # 0x146d94
callq 0x390d0
movq %rax, -0xd0(%rbp)
movq -0xd0(%rbp), %rdi
leaq 0xaaa77(%rip), %rsi     # 0x13e288
callq 0x390d0
movq %rax, -0xd0(%rbp)
movq -0x8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x42e50
jmp 0x93ddc
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xa4fec(%rip), %rsi     # 0x138835
callq 0x26300
cmpl $0x0, %eax
jne 0x93884
movq -0x8(%rbp), %rax
cmpl $0x3, 0x38(%rax)
jl 0x93871
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
jne 0x93876
jmp 0x93df6
movq -0x8(%rbp), %rdi
callq 0x9acb0
jmp 0x93dda
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3547(%rip), %rsi     # 0x146de2
callq 0x26300
cmpl $0x0, %eax
jne 0x93c29
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jge 0x938b8
jmp 0x93df6
callq 0x2ff70
movq %rax, -0xd8(%rbp)
leaq -0x108(%rbp), %rdi
leaq 0xe3a6e(%rip), %rsi     # 0x177340
movl $0x30, %edx
callq 0x26c60
movq $0x0, -0xe0(%rbp)
movq 0xf9752(%rip), %rax     # 0x18d040
movq %rax, -0x110(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x2, 0x38(%rax)
jle 0x93993
leaq -0x108(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2d330
movq %rax, -0x110(%rbp)
movl $0x2, -0x114(%rbp)
movl -0x114(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x93991
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x114(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
callq 0x96540
movq %rax, -0x120(%rbp)
cmpq $0x0, -0x120(%rbp)
jne 0x93962
jmp 0x93980
movq -0x110(%rbp), %rdi
movq -0x120(%rbp), %rax
movq 0x8(%rax), %rsi
movq -0x120(%rbp), %rdx
callq 0x2d8c0
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x93924
jmp 0x93993
movq -0x8(%rbp), %rdi
movq -0x110(%rbp), %rax
movq 0x28(%rax), %rsi
movq -0x110(%rbp), %rax
addq 0x48(%rax), %rsi
shlq %rsi
callq 0x437f0
movq -0x110(%rbp), %rdi
callq 0x2e400
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x130(%rbp)
cmpq $0x0, %rax
je 0x93bfc
movq -0x130(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x138(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x138(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1a8(%rbp)
movq -0x138(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x264f0
movq -0x1b0(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
movq %rax, %rdx
callq 0x43920
movq -0x8(%rbp), %rdi
movq -0x138(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x28(%rax), %rsi
movq -0x138(%rbp), %rax
movq 0x88(%rax), %rax
addq 0x48(%rax), %rsi
addq $0x1, %rsi
callq 0x437f0
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x437f0
movq -0x8(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq -0x138(%rbp), %rax
subq 0x60(%rax), %rsi
callq 0x43780
movq -0x138(%rbp), %rax
cmpq $0x0, 0x130(%rax)
je 0x93af0
movq -0x8(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x138(%rbp), %rax
movq 0x130(%rax), %rax
movq %rax, -0x1b8(%rbp)
movq -0x138(%rbp), %rax
movq 0x130(%rax), %rdi
callq 0x97af0
movq -0x1c0(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
movq %rax, %rdx
callq 0x43920
jmp 0x93b04
movq -0x8(%rbp), %rdi
leaq 0xe5145(%rip), %rax     # 0x178c40
movq 0x50(%rax), %rsi
callq 0x42cc0
movq -0x138(%rbp), %rax
movq 0x88(%rax), %rdi
callq 0x2e400
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rdi
callq 0x2e4a0
movq %rax, -0x148(%rbp)
cmpq $0x0, %rax
je 0x93beb
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x150(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x437f0
movq -0x8(%rbp), %rdi
movq -0xd8(%rbp), %rsi
movq -0x150(%rbp), %rax
subq 0x60(%rax), %rsi
callq 0x43780
movq -0x150(%rbp), %rax
cmpq $0x0, 0x130(%rax)
je 0x93bd2
movq -0x8(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x150(%rbp), %rax
movq 0x130(%rax), %rax
movq %rax, -0x1c8(%rbp)
movq -0x150(%rbp), %rax
movq 0x130(%rax), %rdi
callq 0x97af0
movq -0x1d0(%rbp), %rdi
movq -0x1c8(%rbp), %rsi
movq %rax, %rdx
callq 0x43920
jmp 0x93be6
movq -0x8(%rbp), %rdi
leaq 0xe5063(%rip), %rax     # 0x178c40
movq 0x50(%rax), %rsi
callq 0x42cc0
jmp 0x93b1e
movq -0x140(%rbp), %rdi
callq 0x2e600
jmp 0x939c8
movq -0x128(%rbp), %rdi
callq 0x2e600
movq -0x110(%rbp), %rax
cmpq 0xf942a(%rip), %rax     # 0x18d040
je 0x93c24
movq -0x110(%rbp), %rdi
callq 0x2e230
jmp 0x93dd8
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0xb3589(%rip), %rsi     # 0x1471c9
callq 0x26300
cmpl $0x0, %eax
jne 0x93db4
movq $0x0, 0xf941f(%rip) # 0x18d078
movl $0x2, -0x154(%rbp)
movl -0x154(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x93d9e
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x154(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xb3159(%rip), %rsi     # 0x146ded
callq 0x26300
cmpl $0x0, %eax
jne 0x93cc8
movq 0xf93d3(%rip), %rax     # 0x18d078
orq $0x1, %rax
movq %rax, 0xf93c8(%rip)     # 0x18d078
movl $0x3, %edi
leaq 0xb3146(%rip), %rsi     # 0x146e02
movb $0x0, %al
callq 0x2fc60
jmp 0x93d88
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x154(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xb317d(%rip), %rsi     # 0x146e63
callq 0x26300
cmpl $0x0, %eax
jne 0x93d17
movq 0xf9381(%rip), %rax     # 0x18d078
orq $0x2, %rax
movq %rax, 0xf9376(%rip)     # 0x18d078
movl $0x3, %edi
leaq 0xb316b(%rip), %rsi     # 0x146e79
movb $0x0, %al
callq 0x2fc60
jmp 0x93d86
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x154(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xa63a8(%rip), %rsi     # 0x13a0dd
callq 0x26300
cmpl $0x0, %eax
jne 0x93d6f
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x437f0
movq -0x8(%rbp), %rdi
leaq 0xb3095(%rip), %rsi     # 0x146ded
callq 0x43580
movq -0x8(%rbp), %rdi
leaq 0xb30fb(%rip), %rsi     # 0x146e63
callq 0x43580
jmp 0x93d84
movq -0x8(%rbp), %rdi
leaq 0xb3159(%rip), %rsi     # 0x146ed3
callq 0x42f90
jmp 0x93e18
jmp 0x93d86
jmp 0x93d88
jmp 0x93d8a
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x93c63
movq -0x8(%rbp), %rdi
leaq 0xe4e97(%rip), %rax     # 0x178c40
movq 0x8(%rax), %rsi
callq 0x42cc0
jmp 0x93dd6
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0xb3129(%rip), %rsi     # 0x146ef8
movb $0x0, %al
callq 0x42fd0
jmp 0x93dd8
jmp 0x93dda
jmp 0x93ddc
jmp 0x93dde
jmp 0x93de0
jmp 0x93de2
jmp 0x93de4
jmp 0x93de6
jmp 0x93de8
jmp 0x93dea
jmp 0x93dec
jmp 0x93dee
jmp 0x93df0
jmp 0x93df2
jmp 0x93df4
jmp 0x93e18
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdx
leaq 0xb3108(%rip), %rsi     # 0x146f19
movb $0x0, %al
callq 0x42fd0
addq $0x1d0, %rsp            # imm = 0x1D0
popq %rbp
retq
nopw %cs:(%rax,%rax)