// File: /workspace/github_c_makefile_star2_O0/zhou-yuxin[P]redis-aof-no-cow/src/cluster.c
// Function: migrateCommand
void migrateCommand(client *c) {
    migrateCachedSocket *cs;
    int copy, replace, j;
    long timeout;
    long dbid;
    robj **ov = NULL; /* Objects to migrate. */
    robj **kv = NULL; /* Key names. */
    robj **newargv = NULL; /* Used to rewrite the command as DEL ... keys ... */
    rio cmd, payload;
    int may_retry = 1;
    int write_error = 0;

    /* To support the KEYS option we need the following additional state. */
    int first_key = 3; /* Argument index of the first key. */
    int num_keys = 1;  /* By default only migrate the 'key' argument. */

    /* Initialization */
    copy = 0;
    replace = 0;

    /* Parse additional options */
    for (j = 6; j < c->argc; j++) {
        if (!strcasecmp(c->argv[j]->ptr,"copy")) {
            copy = 1;
        } else if (!strcasecmp(c->argv[j]->ptr,"replace")) {
            replace = 1;
        } else if (!strcasecmp(c->argv[j]->ptr,"keys")) {
            if (sdslen(c->argv[3]->ptr) != 0) {
                addReplyError(c,
                    "When using MIGRATE KEYS option, the key argument"
                    " must be set to the empty string");
                return;
            }
            first_key = j+1;
            num_keys = c->argc - j - 1;
            break; /* All the remaining args are keys. */
        } else {
            addReply(c,shared.syntaxerr);
            return;
        }
    }

    /* Sanity check */
    if (getLongFromObjectOrReply(c,c->argv[5],&timeout,NULL) != C_OK ||
        getLongFromObjectOrReply(c,c->argv[4],&dbid,NULL) != C_OK)
    {
        return;
    }
    if (timeout <= 0) timeout = 1000;

    /* Check if the keys are here. If at least one key is to migrate, do it
     * otherwise if all the keys are missing reply with "NOKEY" to signal
     * the caller there was nothing to migrate. We don't return an error in
     * this case, since often this is due to a normal condition like the key
     * expiring in the meantime. */
    ov = zrealloc(ov,sizeof(robj*)*num_keys);
    kv = zrealloc(kv,sizeof(robj*)*num_keys);
    int oi = 0;

    for (j = 0; j < num_keys; j++) {
        if ((ov[oi] = lookupKeyRead(c->db,c->argv[first_key+j])) != NULL) {
            kv[oi] = c->argv[first_key+j];
            oi++;
        }
    }
    num_keys = oi;
    if (num_keys == 0) {
        zfree(ov); zfree(kv);
        addReplySds(c,sdsnew("+NOKEY\r\n"));
        return;
    }

try_again:
    write_error = 0;

    /* Connect */
    cs = migrateGetSocket(c,c->argv[1],c->argv[2],timeout);
    if (cs == NULL) {
        zfree(ov); zfree(kv);
        return; /* error sent to the client by migrateGetSocket() */
    }

    rioInitWithBuffer(&cmd,sdsempty());

    /* Send the SELECT command if the current DB is not already selected. */
    int select = cs->last_dbid != dbid; /* Should we emit SELECT? */
    if (select) {
        serverAssertWithInfo(c,NULL,rioWriteBulkCount(&cmd,'*',2));
        serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,"SELECT",6));
        serverAssertWithInfo(c,NULL,rioWriteBulkLongLong(&cmd,dbid));
    }

    /* Create RESTORE payload and generate the protocol to call the command. */
    for (j = 0; j < num_keys; j++) {
        long long ttl = 0;
        long long expireat = getExpire(c->db,kv[j]);

        if (expireat != -1) {
            ttl = expireat-mstime();
            if (ttl < 1) ttl = 1;
        }
        serverAssertWithInfo(c,NULL,rioWriteBulkCount(&cmd,'*',replace ? 5 : 4));
        if (server.cluster_enabled)
            serverAssertWithInfo(c,NULL,
                rioWriteBulkString(&cmd,"RESTORE-ASKING",14));
        else
            serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,"RESTORE",7));
        serverAssertWithInfo(c,NULL,sdsEncodedObject(kv[j]));
        serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,kv[j]->ptr,
                sdslen(kv[j]->ptr)));
        serverAssertWithInfo(c,NULL,rioWriteBulkLongLong(&cmd,ttl));

        /* Emit the payload argument, that is the serialized object using
         * the DUMP format. */
        createDumpPayload(&payload,ov[j]);
        serverAssertWithInfo(c,NULL,
            rioWriteBulkString(&cmd,payload.io.buffer.ptr,
                               sdslen(payload.io.buffer.ptr)));
        sdsfree(payload.io.buffer.ptr);

        /* Add the REPLACE option to the RESTORE command if it was specified
         * as a MIGRATE option. */
        if (replace)
            serverAssertWithInfo(c,NULL,rioWriteBulkString(&cmd,"REPLACE",7));
    }

    /* Transfer the query to the other node in 64K chunks. */
    errno = 0;
    {
        sds buf = cmd.io.buffer.ptr;
        size_t pos = 0, towrite;
        int nwritten = 0;

        while ((towrite = sdslen(buf)-pos) > 0) {
            towrite = (towrite > (64*1024) ? (64*1024) : towrite);
            nwritten = syncWrite(cs->fd,buf+pos,towrite,timeout);
            if (nwritten != (signed)towrite) {
                write_error = 1;
                goto socket_err;
            }
            pos += nwritten;
        }
    }

    char buf1[1024]; /* Select reply. */
    char buf2[1024]; /* Restore reply. */

    /* Read the SELECT reply if needed. */
    if (select && syncReadLine(cs->fd, buf1, sizeof(buf1), timeout) <= 0)
        goto socket_err;

    /* Read the RESTORE replies. */
    int error_from_target = 0;
    int socket_error = 0;
    int del_idx = 1; /* Index of the key argument for the replicated DEL op. */

    if (!copy) newargv = zmalloc(sizeof(robj*)*(num_keys+1));

    for (j = 0; j < num_keys; j++) {
        if (syncReadLine(cs->fd, buf2, sizeof(buf2), timeout) <= 0) {
            socket_error = 1;
            break;
        }
        if ((select && buf1[0] == '-') || buf2[0] == '-') {
            /* On error assume that last_dbid is no longer valid. */
            if (!error_from_target) {
                cs->last_dbid = -1;
                addReplyErrorFormat(c,"Target instance replied with error: %s",
                    (select && buf1[0] == '-') ? buf1+1 : buf2+1);
                error_from_target = 1;
            }
        } else {
            if (!copy) {
                /* No COPY option: remove the local key, signal the change. */
                dbDelete(c->db,kv[j]);
                signalModifiedKey(c->db,kv[j]);
                server.dirty++;

                /* Populate the argument vector to replace the old one. */
                newargv[del_idx++] = kv[j];
                incrRefCount(kv[j]);
            }
        }
    }

    /* On socket error, if we want to retry, do it now before rewriting the
     * command vector. We only retry if we are sure nothing was processed
     * and we failed to read the first reply (j == 0 test). */
    if (!error_from_target && socket_error && j == 0 && may_retry &&
        errno != ETIMEDOUT)
    {
        goto socket_err; /* A retry is guaranteed because of tested conditions.*/
    }

    if (!copy) {
        /* Translate MIGRATE as DEL for replication/AOF. */
        if (del_idx > 1) {
            newargv[0] = createStringObject("DEL",3);
            /* Note that the following call takes ownership of newargv. */
            replaceClientCommandVector(c,del_idx,newargv);
        } else {
            /* No key transfer acknowledged, no need to rewrite as DEL. */
            zfree(newargv);
        }
        newargv = NULL; /* Make it safe to call zfree() on it in the future. */
    }

    /* If we are here and a socket error happened, we don't want to retry.
     * Just signal the problem to the client, but only do it if we don't
     * already queued a different error reported by the destination server. */
    if (!error_from_target && socket_error) {
        may_retry = 0;
        goto socket_err;
    }

    if (!error_from_target) {
        /* Success! Update the last_dbid in migrateCachedSocket, so that we can
         * avoid SELECT the next time if the target DB is the same. Reply +OK. */
        cs->last_dbid = dbid;
        addReply(c,shared.ok);
    } else {
        /* On error we already sent it in the for loop above, and set
         * the curretly selected socket to -1 to force SELECT the next time. */
    }

    sdsfree(cmd.io.buffer.ptr);
    zfree(ov); zfree(kv); zfree(newargv);
    if (socket_error) migrateCloseSocket(c->argv[1],c->argv[2]);
    return;

/* On socket errors we try to close the cached socket and try again.
 * It is very common for the cached socket to get closed, if just reopening
 * it works it's a shame to notify the error to the caller. */
socket_err:
    /* Cleanup we want to perform in both the retry and no retry case.
     * Note: Closing the migrate socket will also force SELECT next time. */
    sdsfree(cmd.io.buffer.ptr);
    migrateCloseSocket(c->argv[1],c->argv[2]);
    zfree(newargv);
    newargv = NULL; /* This will get reallocated on retry. */

    /* Retry only if it's not a timeout and we never attempted a retry
     * (or the code jumping here did not set may_retry to zero). */
    if (errno != ETIMEDOUT && may_retry) {
        may_retry = 0;
        goto try_again;
    }

    /* Cleanup we want to do if no retry is attempted. */
    zfree(ov); zfree(kv);
    addReplySds(c,
        sdscatprintf(sdsempty(),
            "-IOERR error or timeout %s to target instance\r\n",
            write_error ? "writing" : "reading"));
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x9b0, %rsp            # imm = 0x9B0
movq %rdi, -0x8(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x1, -0x11c(%rbp)
movl $0x0, -0x120(%rbp)
movl $0x3, -0x124(%rbp)
movl $0x1, -0x128(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x6, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jge 0x85e6a
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xd02db(%rip), %rsi     # 0x15605a
callq 0x26310
cmpl $0x0, %eax
jne 0x85d95
movl $0x1, -0x14(%rbp)
jmp 0x85e5a
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xd01f3(%rip), %rsi     # 0x155fa3
callq 0x26310
cmpl $0x0, %eax
jne 0x85dc6
movl $0x1, -0x18(%rbp)
jmp 0x85e58
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
leaq 0xcfdf9(%rip), %rsi     # 0x155bda
callq 0x26310
cmpl $0x0, %eax
jne 0x85e3c
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x7cc30
cmpq $0x0, %rax
je 0x85e1b
movq -0x8(%rbp), %rdi
leaq 0xd024e(%rip), %rsi     # 0x15605f
callq 0x42f20
jmp 0x86997
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
subl -0x1c(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x128(%rbp)
jmp 0x85e6a
movq -0x8(%rbp), %rdi
leaq 0x108da9(%rip), %rax    # 0x18ebf0
movq 0x80(%rax), %rsi
callq 0x42c50
jmp 0x86997
jmp 0x85e5a
jmp 0x85e5c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x85d54
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x28(%rax), %rsi
leaq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x49eb0
cmpl $0x0, %eax
jne 0x85eae
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 0x49eb0
cmpl $0x0, %eax
je 0x85eb3
jmp 0x86997
cmpq $0x0, -0x28(%rbp)
jg 0x85ec2
movq $0x3e8, -0x28(%rbp)     # imm = 0x3E8
movq -0x38(%rbp), %rdi
movslq -0x128(%rbp), %rsi
shlq $0x3, %rsi
callq 0x3add0
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rdi
movslq -0x128(%rbp), %rsi
shlq $0x3, %rsi
callq 0x3add0
movq %rax, -0x40(%rbp)
movl $0x0, -0x12c(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x128(%rbp), %eax
jge 0x85f92
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x124(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x4a650
movq -0x38(%rbp), %rcx
movslq -0x12c(%rbp), %rdx
movq %rax, (%rcx,%rdx,8)
cmpq $0x0, %rax
je 0x85f82
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movl -0x124(%rbp), %ecx
addl -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x40(%rbp), %rax
movslq -0x12c(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x12c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x12c(%rbp)
jmp 0x85f84
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x85f03
movl -0x12c(%rbp), %eax
movl %eax, -0x128(%rbp)
cmpl $0x0, -0x128(%rbp)
jne 0x85fe4
movq -0x38(%rbp), %rdi
callq 0x3af30
movq -0x40(%rbp), %rdi
callq 0x3af30
movq -0x8(%rbp), %rax
movq %rax, -0x978(%rbp)
leaq 0xd00e5(%rip), %rdi     # 0x1560b0
callq 0x384a0
movq -0x978(%rbp), %rdi
movq %rax, %rsi
callq 0x42de0
jmp 0x86997
jmp 0x85fe6
movl $0x0, -0x120(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rdx
movq -0x28(%rbp), %rcx
callq 0x85870
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x86037
movq -0x38(%rbp), %rdi
callq 0x3af30
movq -0x40(%rbp), %rdi
callq 0x3af30
jmp 0x86997
callq 0x38480
movq %rax, %rsi
leaq -0xb0(%rbp), %rdi
callq 0x8e270
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x30(%rbp), %rax
setne %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x130(%rbp)
cmpl $0x0, -0x130(%rbp)
je 0x8614b
leaq -0xb0(%rbp), %rdi
movl $0x2a, %esi
movl $0x2, %edx
callq 0x8e4c0
cmpq $0x0, %rax
je 0x86090
jmp 0x860bb
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xd001a(%rip), %rdx     # 0x1560b9
leaq 0xce6a0(%rip), %rcx     # 0x154746
movl $0x1281, %r8d           # imm = 0x1281
callq 0x78030
movl $0x1, %edi
callq 0x263d0
leaq -0xb0(%rbp), %rdi
leaq 0xd000e(%rip), %rsi     # 0x1560d7
movl $0x6, %edx
callq 0x8e660
cmpq $0x0, %rax
je 0x860db
jmp 0x86106
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfff4(%rip), %rdx     # 0x1560de
leaq 0xce655(%rip), %rcx     # 0x154746
movl $0x1282, %r8d           # imm = 0x1282
callq 0x78030
movl $0x1, %edi
callq 0x263d0
movq -0x30(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x8e710
cmpq $0x0, %rax
je 0x8611e
jmp 0x86149
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcffd5(%rip), %rdx     # 0x156102
leaq 0xce612(%rip), %rcx     # 0x154746
movl $0x1283, %r8d           # imm = 0x1283
callq 0x78030
movl $0x1, %edi
callq 0x263d0
jmp 0x8614b
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x128(%rbp), %eax
jge 0x864d9
movq $0x0, -0x138(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x4c3c0
movq %rax, -0x140(%rbp)
cmpq $-0x1, -0x140(%rbp)
je 0x861d4
movq -0x140(%rbp), %rax
movq %rax, -0x980(%rbp)
callq 0x2ff70
movq %rax, %rcx
movq -0x980(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x138(%rbp)
cmpq $0x1, -0x138(%rbp)
jge 0x861d2
movq $0x1, -0x138(%rbp)
jmp 0x861d4
movl -0x18(%rbp), %ecx
movl $0x4, %edx
movl $0x5, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edx
leaq -0xb0(%rbp), %rdi
movl $0x2a, %esi
callq 0x8e4c0
cmpq $0x0, %rax
je 0x86200
jmp 0x8622b
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcff13(%rip), %rdx     # 0x156122
leaq 0xce530(%rip), %rcx     # 0x154746
movl $0x128f, %r8d           # imm = 0x128F
callq 0x78030
movl $0x1, %edi
callq 0x263d0
leaq 0x107f66(%rip), %rax    # 0x18e198
cmpl $0x0, 0x98c(%rax)
je 0x86288
leaq -0xb0(%rbp), %rdi
leaq 0xcff05(%rip), %rsi     # 0x15614e
movl $0xe, %edx
callq 0x8e660
cmpq $0x0, %rax
je 0x8625b
jmp 0x86286
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfef3(%rip), %rdx     # 0x15615d
leaq 0xce4d5(%rip), %rcx     # 0x154746
movl $0x1292, %r8d           # imm = 0x1292
callq 0x78030
movl $0x1, %edi
callq 0x263d0
jmp 0x862d5
leaq -0xb0(%rbp), %rdi
leaq 0xcfef4(%rip), %rsi     # 0x15618a
movl $0x7, %edx
callq 0x8e660
cmpq $0x0, %rax
je 0x862a8
jmp 0x862d3
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfedb(%rip), %rdx     # 0x156192
leaq 0xce488(%rip), %rcx     # 0x154746
movl $0x1294, %r8d           # imm = 0x1294
callq 0x78030
movl $0x1, %edi
callq 0x263d0
jmp 0x862d5
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x86307
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl (%rax), %eax
shrl $0x4, %eax
andl $0xf, %eax
cmpl $0x8, %eax
jne 0x86309
jmp 0x86334
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfe9f(%rip), %rdx     # 0x1561b7
leaq 0xce427(%rip), %rcx     # 0x154746
movl $0x1295, %r8d           # imm = 0x1295
callq 0x78030
movl $0x1, %edi
callq 0x263d0
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rax
movq %rax, -0x988(%rbp)
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x8(%rax), %rdi
callq 0x7cc30
movq -0x988(%rbp), %rsi
movq %rax, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x8e660
cmpq $0x0, %rax
je 0x8637e
jmp 0x863a9
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfe42(%rip), %rdx     # 0x1561cf
leaq 0xce3b2(%rip), %rcx     # 0x154746
movl $0x1297, %r8d           # imm = 0x1297
callq 0x78030
movl $0x1, %edi
callq 0x263d0
movq -0x138(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
callq 0x8e710
cmpq $0x0, %rax
je 0x863c4
jmp 0x863ef
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfe34(%rip), %rdx     # 0x156207
leaq 0xce36c(%rip), %rcx     # 0x154746
movl $0x1298, %r8d           # imm = 0x1298
callq 0x78030
movl $0x1, %edi
callq 0x263d0
movq -0x38(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x118(%rbp), %rdi
callq 0x85370
movq -0xd8(%rbp), %rax
movq %rax, -0x990(%rbp)
movq -0xd8(%rbp), %rdi
callq 0x7cc30
movq -0x990(%rbp), %rsi
movq %rax, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x8e660
cmpq $0x0, %rax
je 0x8643f
jmp 0x8646a
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfdd8(%rip), %rdx     # 0x156226
leaq 0xce2f1(%rip), %rcx     # 0x154746
movl $0x129f, %r8d           # imm = 0x129F
callq 0x78030
movl $0x1, %edi
callq 0x263d0
movq -0xd8(%rbp), %rdi
callq 0x385b0
cmpl $0x0, -0x18(%rbp)
je 0x864c9
leaq -0xb0(%rbp), %rdi
leaq 0xcfdea(%rip), %rsi     # 0x156274
movl $0x7, %edx
callq 0x8e660
cmpq $0x0, %rax
je 0x8649c
jmp 0x864c7
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0xcfdd1(%rip), %rdx     # 0x15627c
leaq 0xce294(%rip), %rcx     # 0x154746
movl $0x12a5, %r8d           # imm = 0x12A5
callq 0x78030
movl $0x1, %edi
callq 0x263d0
jmp 0x864c9
jmp 0x864cb
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x86152
callq 0x26890
movl $0x0, (%rax)
movq -0x70(%rbp), %rax
movq %rax, -0x148(%rbp)
movq $0x0, -0x150(%rbp)
movl $0x0, -0x15c(%rbp)
movq -0x148(%rbp), %rdi
callq 0x7cc30
subq -0x150(%rbp), %rax
movq %rax, -0x158(%rbp)
cmpq $0x0, %rax
jbe 0x865c3
cmpq $0x10000, -0x158(%rbp) # imm = 0x10000
jbe 0x86543
movl $0x10000, %eax          # imm = 0x10000
movq %rax, -0x998(%rbp)
jmp 0x86551
movq -0x158(%rbp), %rax
movq %rax, -0x998(%rbp)
movq -0x998(%rbp), %rax
movq %rax, -0x158(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x148(%rbp), %rsi
addq -0x150(%rbp), %rsi
movq -0x158(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x7b7b0
movl %eax, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
movq -0x158(%rbp), %rcx
cmpl %ecx, %eax
je 0x865a9
movl $0x1, -0x120(%rbp)
jmp 0x868e1
movslq -0x15c(%rbp), %rax
addq -0x150(%rbp), %rax
movq %rax, -0x150(%rbp)
jmp 0x86504
cmpl $0x0, -0x130(%rbp)
je 0x865f2
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x560(%rbp), %rsi
movq -0x28(%rbp), %rcx
movl $0x400, %edx            # imm = 0x400
callq 0x7ba10
cmpq $0x0, %rax
jg 0x865f2
jmp 0x868e1
movl $0x0, -0x964(%rbp)
movl $0x0, -0x968(%rbp)
movl $0x1, -0x96c(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x8662f
movl -0x128(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x3ac60
movq %rax, -0x48(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x128(%rbp), %eax
jge 0x867c7
movq -0x10(%rbp), %rax
movl (%rax), %edi
leaq -0x960(%rbp), %rsi
movq -0x28(%rbp), %rcx
movl $0x400, %edx            # imm = 0x400
callq 0x7ba10
cmpq $0x0, %rax
jg 0x86675
movl $0x1, -0x968(%rbp)
jmp 0x867c7
cmpl $0x0, -0x130(%rbp)
je 0x8668a
movsbl -0x560(%rbp), %eax
cmpl $0x2d, %eax
je 0x8669a
movsbl -0x960(%rbp), %eax
cmpl $0x2d, %eax
jne 0x86720
cmpl $0x0, -0x964(%rbp)
jne 0x8671b
movq -0x10(%rbp), %rax
movq $-0x1, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rax, -0x9a0(%rbp)
cmpl $0x0, -0x130(%rbp)
je 0x866e3
movsbl -0x560(%rbp), %eax
cmpl $0x2d, %eax
jne 0x866e3
leaq -0x560(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x9a8(%rbp)
jmp 0x866f5
leaq -0x960(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x9a8(%rbp)
movq -0x9a0(%rbp), %rdi
movq -0x9a8(%rbp), %rdx
leaq 0xcfb97(%rip), %rsi     # 0x1562a1
movb $0x0, %al
callq 0x42f60
movl $0x1, -0x964(%rbp)
jmp 0x867b7
cmpl $0x0, -0x14(%rbp)
jne 0x867b5
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x4aba0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x4a9f0
leaq 0x107a35(%rip), %rax    # 0x18e198
movq 0x710(%rax), %rcx
addq $0x1, %rcx
leaq 0x107a23(%rip), %rax    # 0x18e198
movq %rcx, 0x710(%rax)
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x48(%rbp), %rax
movl -0x96c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x96c(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x48740
jmp 0x867b7
jmp 0x867b9
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x86636
cmpl $0x0, -0x964(%rbp)
jne 0x867f7
cmpl $0x0, -0x968(%rbp)
je 0x867f7
cmpl $0x0, -0x1c(%rbp)
jne 0x867f7
cmpl $0x0, -0x11c(%rbp)
je 0x867f7
callq 0x26890
cmpl $0x6e, (%rax)
je 0x867f7
jmp 0x868e1
cmpl $0x0, -0x14(%rbp)
jne 0x86847
cmpl $0x1, -0x96c(%rbp)
jle 0x86836
leaq 0xc47d5(%rip), %rdi     # 0x14afe2
movl $0x3, %esi
callq 0x48630
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movl -0x96c(%rbp), %esi
movq -0x48(%rbp), %rdx
callq 0x469c0
jmp 0x8683f
movq -0x48(%rbp), %rdi
callq 0x3af30
movq $0x0, -0x48(%rbp)
cmpl $0x0, -0x964(%rbp)
jne 0x86865
cmpl $0x0, -0x968(%rbp)
je 0x86865
movl $0x0, -0x11c(%rbp)
jmp 0x868e1
cmpl $0x0, -0x964(%rbp)
jne 0x86890
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rdi
leaq 0x10836b(%rip), %rax    # 0x18ebf0
movq 0x8(%rax), %rsi
callq 0x42c50
jmp 0x86892
jmp 0x86892
movq -0x70(%rbp), %rdi
callq 0x385b0
movq -0x38(%rbp), %rdi
callq 0x3af30
movq -0x40(%rbp), %rdi
callq 0x3af30
movq -0x48(%rbp), %rdi
callq 0x3af30
cmpl $0x0, -0x968(%rbp)
je 0x868dc
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x85b40
jmp 0x86997
movq -0x70(%rbp), %rdi
callq 0x385b0
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x10(%rax), %rsi
callq 0x85b40
movq -0x48(%rbp), %rdi
callq 0x3af30
movq $0x0, -0x48(%rbp)
callq 0x26890
cmpl $0x6e, (%rax)
je 0x8693a
cmpl $0x0, -0x11c(%rbp)
je 0x8693a
movl $0x0, -0x11c(%rbp)
jmp 0x85fe6
movq -0x38(%rbp), %rdi
callq 0x3af30
movq -0x40(%rbp), %rdi
callq 0x3af30
movq -0x8(%rbp), %rax
movq %rax, -0x9b0(%rbp)
callq 0x38480
movq %rax, %rdi
movl -0x120(%rbp), %ecx
leaq 0xcf994(%rip), %rdx     # 0x156300
leaq 0xcf985(%rip), %rax     # 0x1562f8
cmpl $0x0, %ecx
cmovneq %rax, %rdx
leaq 0xcf947(%rip), %rsi     # 0x1562c8
movb $0x0, %al
callq 0x39540
movq -0x9b0(%rbp), %rdi
movq %rax, %rsi
callq 0x42de0
addq $0x9b0, %rsp            # imm = 0x9B0
popq %rbp
retq