// File: /workspace/github_c_makefile_star2_O2/gplessis[P]dotdeb-redis/src/debug.c
// Function: debugCommand
void debugCommand(client *c) {
    if (c->argc == 1) {
        addReplyError(c,"You must specify a subcommand for DEBUG. Try DEBUG HELP for info.");
        return;
    }

    if (!strcasecmp(c->argv[1]->ptr,"help")) {
        void *blenp = addDeferredMultiBulkLength(c);
        int blen = 0;
        blen++; addReplyStatus(c,
        "DEBUG <subcommand> arg arg ... arg. Subcommands:");
        blen++; addReplyStatus(c,
        "segfault -- Crash the server with sigsegv.");
        blen++; addReplyStatus(c,
        "restart  -- Graceful restart: save config, db, restart.");
        blen++; addReplyStatus(c,
        "crash-and-recovery <milliseconds> -- Hard crash and restart after <milliseconds> delay.");
        blen++; addReplyStatus(c,
        "assert   -- Crash by assertion failed.");
        blen++; addReplyStatus(c,
        "reload   -- Save the RDB on disk and reload it back in memory.");
        blen++; addReplyStatus(c,
        "loadaof  -- Flush the AOF buffers on disk and reload the AOF in memory.");
        blen++; addReplyStatus(c,
        "object <key> -- Show low level info about key and associated value.");
        blen++; addReplyStatus(c,
        "sdslen <key> -- Show low level SDS string info representing key and value.");
        blen++; addReplyStatus(c,
        "populate <count> [prefix] -- Create <count> string keys named key:<num>. If a prefix is specified is used instead of the 'key' prefix.");
        blen++; addReplyStatus(c,
        "digest   -- Outputs an hex signature representing the current DB content.");
        blen++; addReplyStatus(c,
        "sleep <seconds> -- Stop the server for <seconds>. Decimals allowed.");
        blen++; addReplyStatus(c,
        "set-active-expire (0|1) -- Setting it to 0 disables expiring keys in background when they are not accessed (otherwise the Redis behavior). Setting it to 1 reenables back the default.");
        blen++; addReplyStatus(c,
        "lua-always-replicate-commands (0|1) -- Setting it to 1 makes Lua replication defaulting to replicating single commands, without the script having to enable effects replication.");
        blen++; addReplyStatus(c,
        "error <string> -- Return a Redis protocol error with <string> as message. Useful for clients unit tests to simulate Redis errors.");
        blen++; addReplyStatus(c,
        "structsize -- Return the size of different Redis core C structures.");
        blen++; addReplyStatus(c,
        "htstats <dbid> -- Return hash table statistics of the specified Redis database.");
        blen++; addReplyStatus(c,
        "jemalloc info  -- Show internal jemalloc statistics.");
        blen++; addReplyStatus(c,
        "jemalloc purge -- Force jemalloc to release unused memory.");
        setDeferredMultiBulkLength(c,blenp,blen);
    } else if (!strcasecmp(c->argv[1]->ptr,"segfault")) {
        *((char*)-1) = 'x';
    } else if (!strcasecmp(c->argv[1]->ptr,"restart") ||
               !strcasecmp(c->argv[1]->ptr,"crash-and-recover"))
    {
        long long delay = 0;
        if (c->argc >= 3) {
            if (getLongLongFromObjectOrReply(c, c->argv[2], &delay, NULL)
                != C_OK) return;
            if (delay < 0) delay = 0;
        }
        int flags = !strcasecmp(c->argv[1]->ptr,"restart") ?
            (RESTART_SERVER_GRACEFULLY|RESTART_SERVER_CONFIG_REWRITE) :
             RESTART_SERVER_NONE;
        restartServer(flags,delay);
        addReplyError(c,"failed to restart the server. Check server logs.");
    } else if (!strcasecmp(c->argv[1]->ptr,"oom")) {
        void *ptr = zmalloc(ULONG_MAX); /* Should trigger an out of memory. */
        zfree(ptr);
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"assert")) {
        if (c->argc >= 3) c->argv[2] = tryObjectEncoding(c->argv[2]);
        serverAssertWithInfo(c,c->argv[0],1 == 2);
    } else if (!strcasecmp(c->argv[1]->ptr,"reload")) {
        if (rdbSave(server.rdb_filename) != C_OK) {
            addReply(c,shared.err);
            return;
        }
        emptyDb(NULL);
        if (rdbLoad(server.rdb_filename) != C_OK) {
            addReplyError(c,"Error trying to load the RDB dump");
            return;
        }
        serverLog(LL_WARNING,"DB reloaded by DEBUG RELOAD");
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"loadaof")) {
        if (server.aof_state == AOF_ON) flushAppendOnlyFile(1);
        emptyDb(NULL);
        if (loadAppendOnlyFile(server.aof_filename) != C_OK) {
            addReply(c,shared.err);
            return;
        }
        server.dirty = 0; /* Prevent AOF / replication */
        serverLog(LL_WARNING,"Append Only File loaded by DEBUG LOADAOF");
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"object") && c->argc == 3) {
        dictEntry *de;
        robj *val;
        char *strenc;

        if ((de = dictFind(c->db->dict,c->argv[2]->ptr)) == NULL) {
            addReply(c,shared.nokeyerr);
            return;
        }
        val = dictGetVal(de);
        strenc = strEncoding(val->encoding);

        char extra[128] = {0};
        if (val->encoding == OBJ_ENCODING_QUICKLIST) {
            char *nextra = extra;
            int remaining = sizeof(extra);
            quicklist *ql = val->ptr;
            /* Add number of quicklist nodes */
            int used = snprintf(nextra, remaining, " ql_nodes:%u", ql->len);
            nextra += used;
            remaining -= used;
            /* Add average quicklist fill factor */
            double avg = (double)ql->count/ql->len;
            used = snprintf(nextra, remaining, " ql_avg_node:%.2f", avg);
            nextra += used;
            remaining -= used;
            /* Add quicklist fill level / max ziplist size */
            used = snprintf(nextra, remaining, " ql_ziplist_max:%d", ql->fill);
            nextra += used;
            remaining -= used;
            /* Add isCompressed? */
            int compressed = ql->compress != 0;
            used = snprintf(nextra, remaining, " ql_compressed:%d", compressed);
            nextra += used;
            remaining -= used;
            /* Add total uncompressed size */
            unsigned long sz = 0;
            for (quicklistNode *node = ql->head; node; node = node->next) {
                sz += node->sz;
            }
            used = snprintf(nextra, remaining, " ql_uncompressed_size:%lu", sz);
            nextra += used;
            remaining -= used;
        }

        addReplyStatusFormat(c,
            "Value at:%p refcount:%d "
            "encoding:%s serializedlength:%zu "
            "lru:%d lru_seconds_idle:%llu%s",
            (void*)val, val->refcount,
            strenc, rdbSavedObjectLen(val),
            val->lru, estimateObjectIdleTime(val)/1000, extra);
    } else if (!strcasecmp(c->argv[1]->ptr,"sdslen") && c->argc == 3) {
        dictEntry *de;
        robj *val;
        sds key;

        if ((de = dictFind(c->db->dict,c->argv[2]->ptr)) == NULL) {
            addReply(c,shared.nokeyerr);
            return;
        }
        val = dictGetVal(de);
        key = dictGetKey(de);

        if (val->type != OBJ_STRING || !sdsEncodedObject(val)) {
            addReplyError(c,"Not an sds encoded string.");
        } else {
            addReplyStatusFormat(c,
                "key_sds_len:%lld, key_sds_avail:%lld, "
                "val_sds_len:%lld, val_sds_avail:%lld",
                (long long) sdslen(key),
                (long long) sdsavail(key),
                (long long) sdslen(val->ptr),
                (long long) sdsavail(val->ptr));
        }
    } else if (!strcasecmp(c->argv[1]->ptr,"populate") &&
               (c->argc == 3 || c->argc == 4)) {
        long keys, j;
        robj *key, *val;
        char buf[128];

        if (getLongFromObjectOrReply(c, c->argv[2], &keys, NULL) != C_OK)
            return;
        dictExpand(c->db->dict,keys);
        for (j = 0; j < keys; j++) {
            snprintf(buf,sizeof(buf),"%s:%lu",
                (c->argc == 3) ? "key" : (char*)c->argv[3]->ptr, j);
            key = createStringObject(buf,strlen(buf));
            if (lookupKeyWrite(c->db,key) != NULL) {
                decrRefCount(key);
                continue;
            }
            snprintf(buf,sizeof(buf),"value:%lu",j);
            val = createStringObject(buf,strlen(buf));
            dbAdd(c->db,key,val);
            signalModifiedKey(c->db,key);
            decrRefCount(key);
        }
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"digest") && c->argc == 2) {
        unsigned char digest[20];
        sds d = sdsempty();
        int j;

        computeDatasetDigest(digest);
        for (j = 0; j < 20; j++)
            d = sdscatprintf(d, "%02x",digest[j]);
        addReplyStatus(c,d);
        sdsfree(d);
    } else if (!strcasecmp(c->argv[1]->ptr,"sleep") && c->argc == 3) {
        double dtime = strtod(c->argv[2]->ptr,NULL);
        long long utime = dtime*1000000;
        struct timespec tv;

        tv.tv_sec = utime / 1000000;
        tv.tv_nsec = (utime % 1000000) * 1000;
        nanosleep(&tv, NULL);
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"set-active-expire") &&
               c->argc == 3)
    {
        server.active_expire_enabled = atoi(c->argv[2]->ptr);
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"lua-always-replicate-commands") &&
               c->argc == 3)
    {
        server.lua_always_replicate_commands = atoi(c->argv[2]->ptr);
        addReply(c,shared.ok);
    } else if (!strcasecmp(c->argv[1]->ptr,"error") && c->argc == 3) {
        sds errstr = sdsnewlen("-",1);

        errstr = sdscatsds(errstr,c->argv[2]->ptr);
        errstr = sdsmapchars(errstr,"\n\r","  ",2); /* no newlines in errors. */
        errstr = sdscatlen(errstr,"\r\n",2);
        addReplySds(c,errstr);
    } else if (!strcasecmp(c->argv[1]->ptr,"structsize") && c->argc == 2) {
        sds sizes = sdsempty();
        sizes = sdscatprintf(sizes,"bits:%d ",(sizeof(void*) == 8)?64:32);
        sizes = sdscatprintf(sizes,"robj:%d ",(int)sizeof(robj));
        sizes = sdscatprintf(sizes,"dictentry:%d ",(int)sizeof(dictEntry));
        sizes = sdscatprintf(sizes,"sdshdr5:%d ",(int)sizeof(struct sdshdr5));
        sizes = sdscatprintf(sizes,"sdshdr8:%d ",(int)sizeof(struct sdshdr8));
        sizes = sdscatprintf(sizes,"sdshdr16:%d ",(int)sizeof(struct sdshdr16));
        sizes = sdscatprintf(sizes,"sdshdr32:%d ",(int)sizeof(struct sdshdr32));
        sizes = sdscatprintf(sizes,"sdshdr64:%d ",(int)sizeof(struct sdshdr64));
        addReplyBulkSds(c,sizes);
    } else if (!strcasecmp(c->argv[1]->ptr,"htstats") && c->argc == 3) {
        long dbid;
        sds stats = sdsempty();
        char buf[4096];

        if (getLongFromObjectOrReply(c, c->argv[2], &dbid, NULL) != C_OK)
            return;
        if (dbid < 0 || dbid >= server.dbnum) {
            addReplyError(c,"Out of range database");
            return;
        }

        stats = sdscatprintf(stats,"[Dictionary HT]\n");
        dictGetStats(buf,sizeof(buf),server.db[dbid].dict);
        stats = sdscat(stats,buf);

        stats = sdscatprintf(stats,"[Expires HT]\n");
        dictGetStats(buf,sizeof(buf),server.db[dbid].expires);
        stats = sdscat(stats,buf);

        addReplyBulkSds(c,stats);
    } else if (!strcasecmp(c->argv[1]->ptr,"jemalloc") && c->argc == 3) {
#if defined(USE_JEMALLOC)
        if (!strcasecmp(c->argv[2]->ptr, "info")) {
            sds info = sdsempty();
            je_malloc_stats_print(inputCatSds, &info, NULL);
            addReplyBulkSds(c, info);
        } else if (!strcasecmp(c->argv[2]->ptr, "purge")) {
            char tmp[32];
            unsigned narenas = 0;
            size_t sz = sizeof(unsigned);
            if (!je_mallctl("arenas.narenas", &narenas, &sz, NULL, 0)) {
                sprintf(tmp, "arena.%d.purge", narenas);
                if (!je_mallctl(tmp, NULL, 0, NULL, 0)) {
                    addReply(c, shared.ok);
                    return;
                }
            }
            addReplyError(c, "Error purging dirty pages");
        } else {
            addReplyErrorFormat(c, "Valid jemalloc debug fields: info, purge");
        }
#else
        addReplyErrorFormat(c, "jemalloc support not available");
#endif
    } else {
        addReplyErrorFormat(c, "Unknown DEBUG subcommand or wrong number of arguments for '%s'",
            (char*)c->argv[1]->ptr);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rdi, %rbx
movl 0x38(%rdi), %r12d
cmpl $0x1, %r12d
jne 0x57c16
leaq 0x5f5ce(%rip), %rsi     # 0xb71cb
movq %rbx, %rdi
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36b6f
movq 0x40(%rbx), %r15
movq 0x8(%r15), %rax
movq 0x8(%rax), %r14
leaq 0x5942e(%rip), %rsi     # 0xb1057
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x57e62
leaq 0x5fbf9(%rip), %rsi     # 0xb7839
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x5801a
leaq 0x5fbeb(%rip), %rsi     # 0xb7842
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x57fa9
leaq 0x5fbdc(%rip), %rsi     # 0xb784a
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x57fa9
leaq 0x57b4e(%rip), %rsi     # 0xaf7d3
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x58034
leaq 0x5fbf1(%rip), %rsi     # 0xb788d
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x58862
leaq 0x5fbe8(%rip), %rsi     # 0xb789b
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x58054
leaq 0x5fc16(%rip), %rsi     # 0xb78e0
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x58092
leaq 0x69e00(%rip), %rsi     # 0xc1ae1
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x580d3
testl %eax, %eax
jne 0x580d3
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
callq 0x2a5f9
testq %rax, %rax
je 0x58122
movq 0x8(%rax), %r14
movl (%r14), %edi
shrl $0x4, %edi
andl $0xf, %edi
callq 0x3ab89
movq %rax, %r13
xorpd %xmm0, %xmm0
movapd %xmm0, 0x90(%rsp)
movapd %xmm0, 0x80(%rsp)
movapd %xmm0, 0x70(%rsp)
movapd %xmm0, 0x60(%rsp)
movapd %xmm0, 0x50(%rsp)
movapd %xmm0, 0x40(%rsp)
movapd %xmm0, 0x30(%rsp)
movapd %xmm0, 0x20(%rsp)
movl $0xf0, %eax
andl (%r14), %eax
cmpl $0x90, %eax
jne 0x5828f
movq %r13, 0x18(%rsp)
movq 0x8(%r14), %r15
movl 0x18(%r15), %ecx
leaq 0x5fb83(%rip), %rdx     # 0xb7911
xorl %r12d, %r12d
leaq 0x20(%rsp), %rdi
movl $0x80, %esi
xorl %eax, %eax
callq 0x26120
cltq
leaq (%rsp,%rax), %r13
addq $0x20, %r13
movl $0x80, %ecx
subl %eax, %ecx
movsd 0x10(%r15), %xmm1
unpcklps 0x5c260(%rip), %xmm1    # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x5c268(%rip), %xmm1    # 0xb4030
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
movl 0x18(%r15), %eax
cvtsi2sd %rax, %xmm1
divsd %xmm1, %xmm0
movslq %ecx, %rbp
leaq 0x5fb33(%rip), %rdx     # 0xb791e
movq %r13, %rdi
movq %rbp, %rsi
movb $0x1, %al
callq 0x26120
cltq
addq %rax, %r13
subl %eax, %ebp
movslq %ebp, %rbp
movswl 0x1c(%r15), %ecx
leaq 0x5fb22(%rip), %rdx     # 0xb7930
movq %r13, %rdi
movq %rbp, %rsi
xorl %eax, %eax
callq 0x26120
cltq
addq %rax, %r13
subl %eax, %ebp
xorl %ecx, %ecx
cmpl $0x10000, 0x1c(%r15)    # imm = 0x10000
setae %cl
movslq %ebp, %rsi
leaq 0x5fb0a(%rip), %rdx     # 0xb7943
movq %r13, %rdi
xorl %eax, %eax
callq 0x26120
movslq %eax, %rdi
addq %r13, %rdi
movq (%r15), %r15
testq %r15, %r15
je 0x58274
movl 0x18(%r15), %ecx
addq %rcx, %r12
addq $0x8, %r15
jmp 0x57e49
movq %rbx, %rdi
callq 0x36dad
movq %rax, %r14
leaq 0x5f399(%rip), %rsi     # 0xb720d
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f3bb(%rip), %rsi     # 0xb723e
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f3d7(%rip), %rsi     # 0xb7269
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f400(%rip), %rsi     # 0xb72a1
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f449(%rip), %rsi     # 0xb72f9
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f461(%rip), %rsi     # 0xb7320
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f491(%rip), %rsi     # 0xb735f
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f4ca(%rip), %rsi     # 0xb73a7
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f4ff(%rip), %rsi     # 0xb73eb
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f53b(%rip), %rsi     # 0xb7436
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f5b3(%rip), %rsi     # 0xb74bd
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f5ee(%rip), %rsi     # 0xb7507
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f623(%rip), %rsi     # 0xb754b
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f6cb(%rip), %rsi     # 0xb7602
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f76d(%rip), %rsi     # 0xb76b3
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f7e0(%rip), %rsi     # 0xb7735
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f815(%rip), %rsi     # 0xb7779
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f856(%rip), %rsi     # 0xb77c9
movq %rbx, %rdi
callq 0x36cc3
leaq 0x5f87c(%rip), %rsi     # 0xb77fe
movq %rbx, %rdi
callq 0x36cc3
pushq $0x13
popq %rdx
movq %rbx, %rdi
movq %r14, %rsi
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36de9
andq $0x0, 0x20(%rsp)
cmpl $0x3, %r12d
jl 0x57fdc
movq 0x10(%r15), %rsi
leaq 0x20(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x3ab03
testl %eax, %eax
jne 0x58022
movq 0x20(%rsp), %r14
testq %r14, %r14
jns 0x57fdf
andq $0x0, 0x20(%rsp)
xorl %r14d, %r14d
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rdi
leaq 0x5f850(%rip), %rsi     # 0xb7842
callq 0x262f0
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
leal (%rcx,%rcx,2), %edi
movq %r14, %rsi
callq 0x2d575
leaq 0x5f84c(%rip), %rsi     # 0xb785c
movq %rbx, %rdi
callq 0x36b6f
jmp 0x58022
movb $0x78, -0x1
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $-0x1
popq %rdi
callq 0x327b9
movq %rax, %rdi
callq 0x328f9
leaq 0xa22c5(%rip), %rax     # 0xfa310
movq 0x8(%rax), %rsi
jmp 0x5812d
leaq 0xa184d(%rip), %r14     # 0xf98a8
movq 0x748(%r14), %rdi
callq 0x41971
testl %eax, %eax
jne 0x580c6
xorl %edi, %edi
callq 0x3b308
movq 0x748(%r14), %rdi
callq 0x425c7
testl %eax, %eax
je 0x582ee
leaq 0x5f815(%rip), %rsi     # 0xb78a2
jmp 0x57bfd
leaq 0xa180f(%rip), %r14     # 0xf98a8
cmpl $0x1, 0x668(%r14)
jne 0x580ab
pushq $0x1
popq %rdi
callq 0x53b99
xorl %edi, %edi
callq 0x3b308
movq 0x670(%r14), %rdi
callq 0x54983
testl %eax, %eax
je 0x58260
leaq 0xa2243(%rip), %rax     # 0xfa310
movq 0x10(%rax), %rsi
jmp 0x5812d
leaq 0x5f8ed(%rip), %rsi     # 0xb79c7
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x58146
testl %eax, %eax
jne 0x58146
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movq 0x10(%r15), %rax
movq 0x8(%rax), %rsi
callq 0x2a5f9
testq %rax, %rax
je 0x58122
movq 0x8(%rax), %r12
movl (%r12), %ecx
testb $0xf, %cl
je 0x583ef
leaq 0x5f8b1(%rip), %rsi     # 0xb79ce
jmp 0x57bfd
leaq 0xa21e7(%rip), %rax     # 0xfa310
movq 0x78(%rax), %rsi
movq %rbx, %rdi
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36987
leaq 0x5f8e7(%rip), %rsi     # 0xb7a34
movq %r14, %rdi
callq 0x262f0
leal -0x3(%r12), %ecx
cmpl $0x1, %ecx
ja 0x58304
testl %eax, %eax
jne 0x58304
movq 0x10(%r15), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x3ab5e
testl %eax, %eax
jne 0x58022
movq 0x10(%rbx), %rax
movq (%rax), %rdi
movq 0x8(%rsp), %rsi
callq 0x2a1b7
leaq 0x67d41(%rip), %r12     # 0xbfedf
leaq 0x5f898(%rip), %r14     # 0xb7a3d
leaq 0x20(%rsp), %r15
xorl %r13d, %r13d
cmpq 0x8(%rsp), %r13
jge 0x583bf
cmpl $0x3, 0x38(%rbx)
movq %r12, %rcx
je 0x581cd
movq 0x40(%rbx), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rcx
movl $0x80, %esi
movq %r15, %rdi
movq %r14, %rdx
movq %r13, %r8
xorl %eax, %eax
callq 0x26120
movq %r15, %rdi
callq 0x26500
movq %r15, %rdi
movq %rax, %rsi
callq 0x39e29
movq %rax, %rbp
movq 0x10(%rbx), %rdi
movq %rax, %rsi
callq 0x3aec2
testq %rax, %rax
jne 0x58250
movl $0x80, %esi
movq %r15, %rdi
leaq 0x5f82c(%rip), %rdx     # 0xb7a44
movq %r13, %rcx
xorl %eax, %eax
callq 0x26120
movq %r15, %rdi
callq 0x26500
movq %r15, %rdi
movq %rax, %rsi
callq 0x39e29
movq 0x10(%rbx), %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x3af45
movq 0x10(%rbx), %rdi
movq %rbp, %rsi
callq 0x3b125
movq %rbp, %rdi
callq 0x3a265
incq %r13
jmp 0x581ad
andq $0x0, 0x720(%r14)
leaq 0x5f679(%rip), %rsi     # 0xb78e8
jmp 0x582f5
subl %eax, %ebp
movslq %ebp, %rsi
leaq 0x5f6d5(%rip), %rdx     # 0xb7955
movq %r12, %rcx
xorl %eax, %eax
callq 0x26120
movq 0x18(%rsp), %r13
movl 0x4(%r14), %ebp
movq %r14, %rdi
callq 0x41365
movq %rax, %r12
movl (%r14), %r15d
shrl $0x8, %r15d
movq %r14, %rdi
callq 0x3aba7
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divq %rcx
movq %rax, %r10
subq $0x8, %rsp
leaq 0x28(%rsp), %r11
leaq 0x5f6a5(%rip), %rsi     # 0xb796f
movq %rbx, %rdi
movq %r14, %rdx
movl %ebp, %ecx
movq %r13, %r8
movq %r12, %r9
xorl %eax, %eax
pushq %r11
pushq %r10
pushq %r15
callq 0x36cea
addq $0x20, %rsp
jmp 0x58022
leaq 0x5f5cf(%rip), %rsi     # 0xb78c4
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x2b699
jmp 0x58044
leaq 0x5f743(%rip), %rsi     # 0xb7a4e
movq %r14, %rdi
callq 0x262f0
cmpl $0x2, %r12d
jne 0x5835e
testl %eax, %eax
jne 0x5835e
callq 0x3114c
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x5758a
leaq 0x5936c(%rip), %r15     # 0xb16a2
xorl %r12d, %r12d
cmpq $0x14, %r12
je 0x583d7
movzbl 0x20(%rsp,%r12), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x31a38
movq %rax, %r14
incq %r12
jmp 0x58339
leaq 0x5f6f0(%rip), %rsi     # 0xb7a55
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x5845a
testl %eax, %eax
jne 0x5845a
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdi
xorl %esi, %esi
callq 0x26cc0
mulsd 0x5bcaa(%rip), %xmm0    # 0xb4040
cvttsd2si %xmm0, %rax
movl $0xf4240, %ecx          # imm = 0xF4240
cqto
idivq %rcx
leaq 0x20(%rsp), %rdi
movq %rax, (%rdi)
imulq $0x3e8, %rdx, %rax      # imm = 0x3E8
movq %rax, 0x8(%rdi)
xorl %esi, %esi
callq 0x26950
leaq 0xa1f4a(%rip), %rax     # 0xfa310
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x36987
jmp 0x58022
movq %rbx, %rdi
movq %r14, %rsi
callq 0x36cc3
movq %r14, %rdi
callq 0x311c8
jmp 0x58022
shrl $0x4, %ecx
testb $0x7, %cl
jne 0x58116
movq (%rax), %r14
movq %r14, %rdi
callq 0x574db
movq %rax, %r15
movq %r14, %rdi
callq 0x588e7
movq %rax, %r14
movq 0x8(%r12), %r12
movq %r12, %rdi
callq 0x574db
movq %rax, %r13
movq %r12, %rdi
callq 0x588e7
leaq 0x5f5b6(%rip), %rsi     # 0xb79e9
movq %rbx, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %r13, %r8
movq %rax, %r9
xorl %eax, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36cea
leaq 0x5f5fa(%rip), %rsi     # 0xb7a5b
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x58492
testl %eax, %eax
jne 0x58492
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdi
callq 0x26760
leaq 0xa1421(%rip), %rcx     # 0xf98a8
movl %eax, 0x604(%rcx)
jmp 0x58044
leaq 0x5f5d4(%rip), %rsi     # 0xb7a6d
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x584ca
testl %eax, %eax
jne 0x584ca
movq 0x10(%r15), %rax
movq 0x8(%rax), %rdi
callq 0x26760
leaq 0xa13e9(%rip), %rcx     # 0xf98a8
movl %eax, 0xa14(%rcx)
jmp 0x58044
leaq 0x5bfea(%rip), %rsi     # 0xb44bb
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x58551
testl %eax, %eax
jne 0x58551
leaq 0x69b14(%rip), %rdi     # 0xc1ffe
pushq $0x1
popq %rsi
callq 0x31018
movq 0x40(%rbx), %rcx
movq 0x10(%rcx), %rcx
movq 0x8(%rcx), %rsi
movq %rax, %rdi
callq 0x317de
leaq 0x5f57e(%rip), %rsi     # 0xb7a8b
leaq 0x63077(%rip), %rdx     # 0xbb58b
pushq $0x2
popq %r14
movq %rax, %rdi
movq %r14, %rcx
callq 0x3269b
leaq 0x5cc66(%rip), %rsi     # 0xb5190
movq %rax, %rdi
movq %r14, %rdx
callq 0x31758
movq %rbx, %rdi
movq %rax, %rsi
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36a9d
leaq 0x5f536(%rip), %rsi     # 0xb7a8e
movq %r14, %rdi
callq 0x262f0
cmpl $0x2, %r12d
jne 0x58633
testl %eax, %eax
jne 0x58633
callq 0x3114c
leaq 0x5f51b(%rip), %rsi     # 0xb7a99
pushq $0x40
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
leaq 0x5f510(%rip), %rsi     # 0xb7aa2
pushq $0x10
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
leaq 0x5f505(%rip), %rsi     # 0xb7aab
pushq $0x18
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
leaq 0x5f4ff(%rip), %rsi     # 0xb7ab9
pushq $0x1
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
leaq 0x5f4f7(%rip), %rsi     # 0xb7ac5
pushq $0x3
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
leaq 0x5f4ef(%rip), %rsi     # 0xb7ad1
pushq $0x5
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
leaq 0x5f4e8(%rip), %rsi     # 0xb7ade
pushq $0x9
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
leaq 0x5f4e1(%rip), %rsi     # 0xb7aeb
pushq $0x11
popq %rdx
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
movq %rbx, %rdi
movq %rax, %rsi
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x371aa
leaq 0x5f4be(%rip), %rsi     # 0xb7af8
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x5872e
testl %eax, %eax
jne 0x5872e
callq 0x3114c
movq %rax, %r14
movq 0x40(%rbx), %rax
movq 0x10(%rax), %rsi
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x3ab5e
testl %eax, %eax
jne 0x58022
movq 0x8(%rsp), %rax
testq %rax, %rax
js 0x587c0
leaq 0xa1218(%rip), %r12     # 0xf98a8
movslq 0x610(%r12), %rcx
cmpq %rcx, %rax
jge 0x587c0
leaq 0x5f46e(%rip), %rsi     # 0xb7b16
movq %r14, %rdi
xorl %eax, %eax
callq 0x31a38
movq %rax, %r15
movq 0x28(%r12), %rax
movq 0x8(%rsp), %rcx
shlq $0x6, %rcx
movq (%rax,%rcx), %rdx
leaq 0x20(%rsp), %r14
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
callq 0x2b10b
movq %r15, %rdi
movq %r14, %rsi
callq 0x317b7
leaq 0x5f43c(%rip), %rsi     # 0xb7b27
movq %rax, %rdi
xorl %eax, %eax
callq 0x31a38
movq %rax, %r15
movq 0x28(%r12), %rax
movq 0x8(%rsp), %rcx
shlq $0x6, %rcx
movq 0x8(%rax,%rcx), %rdx
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
callq 0x2b10b
movq %r15, %rdi
movq %r14, %rsi
callq 0x317b7
movq %rbx, %rdi
movq %rax, %rsi
jmp 0x587f0
leaq 0x5f400(%rip), %rsi     # 0xb7b35
movq %r14, %rdi
callq 0x262f0
cmpl $0x3, %r12d
jne 0x5879b
testl %eax, %eax
jne 0x5879b
movq 0x10(%r15), %rax
movq 0x8(%rax), %r14
leaq 0x691de(%rip), %rsi     # 0xc1934
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x587cc
leaq 0x5f430(%rip), %rsi     # 0xb7b99
movq %r14, %rdi
callq 0x262f0
testl %eax, %eax
je 0x587fa
leaq 0x5f3f6(%rip), %rsi     # 0xb7b76
movq %rbx, %rdi
xorl %eax, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36b96
leaq 0x5f3fd(%rip), %rsi     # 0xb7b9f
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x36b96
leaq 0x5f339(%rip), %rsi     # 0xb7b00
jmp 0x58010
callq 0x3114c
leaq 0x20(%rsp), %r14
movq %rax, (%r14)
leaq -0xc19(%rip), %rdi      # 0x57bc7
movq %r14, %rsi
xorl %edx, %edx
callq 0x937a5
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x371aa
jmp 0x58022
leaq 0x14(%rsp), %rsi
andl $0x0, (%rsi)
leaq 0x8(%rsp), %rdx
movq $0x4, (%rdx)
leaq 0x5f329(%rip), %rdi     # 0xb7b3e
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x934fa
testl %eax, %eax
jne 0x58856
movl 0x14(%rsp), %edx
leaq 0x5f31f(%rip), %rsi     # 0xb7b4d
leaq 0x20(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x26580
movq %r14, %rdi
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x934fa
testl %eax, %eax
je 0x583bf
leaq 0x5f2ff(%rip), %rsi     # 0xb7b5c
jmp 0x58010
cmpl $0x3, %r12d
jl 0x5887d
movq 0x10(%r15), %rdi
callq 0x3a3ad
movq 0x40(%rbx), %rcx
movq %rax, 0x10(%rcx)
movq 0x40(%rbx), %r15
movq (%r15), %rsi
leaq 0x5f00d(%rip), %rdx     # 0xb7894
leaq 0x5e92a(%rip), %rcx     # 0xb71b8
movq %rbx, %rdi
movl $0x14f, %r8d            # imm = 0x14F
callq 0x588a4
pushq $0x1
popq %rdi
callq 0x263c0