// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x978, %rsp            # imm = 0x978
movslq 0x38(%rdi), %rcx
movq 0x40(%rdi), %rax
movq %rax, 0x28(%rsp)
movl $0x3, %ebx
cmpq $0x7, %rcx
movq %rdi, 0x10(%rsp)
jl 0x6ef63
movq %rcx, 0x30(%rsp)
leaq -0x6(%rcx), %rbp
xorl %r13d, %r13d
movl $0x0, 0x24(%rsp)
xorl %r14d, %r14d
movl $0x1, %r15d
movq 0x28(%rsp), %rax
movq 0x30(%rax,%r13,8), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
leaq 0x5d09d(%rip), %rsi     # 0xcbfc1
callq 0x26300
testl %eax, %eax
je 0x6ef4c
movq %r12, %rdi
leaq 0x5cfd3(%rip), %rsi     # 0xcbf0a
callq 0x26300
testl %eax, %eax
jne 0x6f6e5
movl $0x1, %r14d
jmp 0x6ef54
movl $0x1, 0x24(%rsp)
incq %r13
cmpq %r13, %rbp
jne 0x6ef0c
movq 0x10(%rsp), %rbp
jmp 0x6ef77
movq %rdi, %rbp
xorl %r14d, %r14d
movl $0x1, %r15d
movl $0x0, 0x24(%rsp)
movq 0x28(%rsp), %rax
movq 0x28(%rax), %rsi
leaq 0x38(%rsp), %rdx
movq %rbp, %rdi
xorl %ecx, %ecx
callq 0x44918
testl %eax, %eax
jne 0x6f783
movq 0x40(%rbp), %rax
movq 0x20(%rax), %rsi
leaq 0x60(%rsp), %rdx
movq %rbp, %rdi
xorl %ecx, %ecx
callq 0x44918
testl %eax, %eax
jne 0x6f783
movl %r14d, 0x54(%rsp)
cmpq $0x0, 0x38(%rsp)
jg 0x6efcc
movq $0x3e8, 0x38(%rsp)      # imm = 0x3E8
movslq %r15d, %r12
leaq (,%r12,8), %r14
xorl %r13d, %r13d
xorl %edi, %edi
movq %r14, %rsi
callq 0x3b595
movq %rax, 0x28(%rsp)
xorl %edi, %edi
movq %r14, %rsi
callq 0x3b595
movq %rax, %r14
testl %r12d, %r12d
movq 0x10(%rsp), %r12
jle 0x6f75a
movl %r15d, %r15d
movq 0x10(%r12), %rdi
movq 0x40(%r12), %rax
movq (%rax,%rbx,8), %rsi
callq 0x44ccf
movslq %r13d, %rcx
movq 0x28(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
testq %rax, %rax
je 0x6f03d
movq 0x40(%r12), %rax
movq (%rax,%rbx,8), %rax
movq %rax, (%r14,%rcx,8)
incl %ecx
movl %ecx, %r13d
incq %rbx
decq %r15
jne 0x6f007
testl %r13d, %r13d
je 0x6f75a
cmpl $0x1, 0x54(%rsp)
movl $0x5, %eax
sbbl $0x0, %eax
movl %eax, 0x6c(%rsp)
movslq %r13d, %rax
movq %rax, 0x70(%rsp)
leaq 0x8(,%rax,8), %rax
movq %rax, 0x90(%rsp)
movq %r13, 0x58(%rsp)
movl %r13d, %eax
movq %rax, 0x98(%rsp)
decq %rax
movq %rax, 0x78(%rsp)
movl $0x1, %ecx
movb $0x1, %al
leaq 0xa0(%rsp), %r13
movl %ecx, 0x18(%rsp)
movl %eax, 0x68(%rsp)
movq 0x10(%rsp), %rbx
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq 0x38(%rsp), %rcx
movq %rbx, %rdi
callq 0x6eb07
testq %rax, %rax
je 0x6f795
movq %rax, %r15
callq 0x394a5
movq %r13, %rdi
movq %rax, %rsi
callq 0x75624
movq 0x8(%r15), %rax
movq 0x60(%rsp), %rcx
movq %rax, 0x48(%rsp)
movq %rcx, 0x88(%rsp)
cmpq %rcx, %rax
je 0x6f149
movq %r13, %rdi
movl $0x2a, %esi
movl $0x2, %edx
callq 0x75758
testq %rax, %rax
je 0x6f977
movl $0x6, %edx
movq %r13, %rdi
leaq 0x5cf19(%rip), %rsi     # 0xcc03e
callq 0x757f8
testq %rax, %rax
je 0x6f9ad
movq 0x60(%rsp), %rsi
movq %r13, %rdi
callq 0x758ef
testq %rax, %rax
je 0x6f992
movq %r15, 0x30(%rsp)
cmpl $0x0, 0x58(%rsp)
movl 0x54(%rsp), %r12d
jle 0x6f317
xorl %r15d, %r15d
movq 0x10(%rbx), %rdi
movq (%r14,%r15,8), %rsi
callq 0x4622f
cmpq $-0x1, %rax
je 0x6f18e
movq %rax, %rbp
callq 0x33226
subq %rax, %rbp
cmpq $0x2, %rbp
movl $0x1, %eax
cmovlq %rax, %rbp
jmp 0x6f190
xorl %ebp, %ebp
movq %r13, %rdi
movl $0x2a, %esi
movl 0x6c(%rsp), %edx
callq 0x75758
testq %rax, %rax
je 0x6f889
leaq 0x976a7(%rip), %rax     # 0x106858
cmpl $0x0, 0x98c(%rax)
je 0x6f1d8
movl $0xe, %edx
movq %r13, %rdi
leaq 0x5ceec(%rip), %rsi     # 0xcc0b5
callq 0x757f8
testq %rax, %rax
jne 0x6f1f5
jmp 0x6f8fe
movl $0x7, %edx
movq %r13, %rdi
leaq 0x5cf0a(%rip), %rsi     # 0xcc0f1
callq 0x757f8
testq %rax, %rax
je 0x6f94f
movq (%r14,%r15,8), %rax
movl (%rax), %ecx
shrl $0x4, %ecx
testb $0x7, %cl
jne 0x6f934
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6f245
leaq 0x5b330(%rip), %rcx     # 0xca550
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x6f247
movq -0x11(%rsi), %rdx
jmp 0x6f247
movzwl -0x5(%rsi), %edx
jmp 0x6f247
movl -0x9(%rsi), %edx
jmp 0x6f247
movzbl -0x3(%rsi), %edx
jmp 0x6f247
xorl %edx, %edx
movq %r13, %rdi
callq 0x757f8
testq %rax, %rax
je 0x6f8a7
movq %r13, %rdi
movq %rbp, %rsi
callq 0x758ef
testq %rax, %rax
je 0x6f8e3
movq 0x28(%rsp), %rax
movq (%rax,%r15,8), %rsi
leaq 0x108(%rsp), %rdi
callq 0x6e741
movq 0x148(%rsp), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6f2c4
leaq 0x5b2c5(%rip), %rcx     # 0xca564
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x6f2c6
movq -0x11(%rsi), %rdx
jmp 0x6f2c6
movzwl -0x5(%rsi), %edx
jmp 0x6f2c6
movl -0x9(%rsi), %edx
jmp 0x6f2c6
movzbl -0x3(%rsi), %edx
jmp 0x6f2c6
xorl %edx, %edx
movq %r13, %rdi
callq 0x757f8
testq %rax, %rax
je 0x6f8c5
movq 0x148(%rsp), %rdi
callq 0x39548
testl %r12d, %r12d
je 0x6f306
movl $0x7, %edx
movq %r13, %rdi
leaq 0x5cee3(%rip), %rsi     # 0xcc1db
callq 0x757f8
testq %rax, %rax
je 0x6f919
incq %r15
cmpq %r15, 0x98(%rsp)
jne 0x6f161
callq 0x26890
movq %rax, 0x80(%rsp)
movl $0x0, (%rax)
movq 0xe0(%rsp), %rbx
xorl %r15d, %r15d
movzbl -0x1(%rbx), %r12d
movl %r12d, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6f375
leaq 0x5b22c(%rip), %rcx     # 0xca578
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %r12d
jmp 0x6f378
movq -0x11(%rbx), %r12
jmp 0x6f378
movzwl -0x5(%rbx), %r12d
jmp 0x6f378
movl -0x9(%rbx), %r12d
jmp 0x6f378
movzbl -0x3(%rbx), %r12d
jmp 0x6f378
xorl %r12d, %r12d
movq %r12, %rbp
subq %r15, %rbp
je 0x6f3af
movl $0x10000, %eax          # imm = 0x10000
cmpq %rax, %rbp
cmovaeq %rax, %rbp
movq 0x30(%rsp), %rax
movl (%rax), %edi
leaq (%rbx,%r15), %rsi
movq 0x38(%rsp), %rcx
movq %rbp, %rdx
callq 0x67e64
cmpl %ebp, %eax
jne 0x6f3f6
cltq
addq %rax, %r15
jmp 0x6f335
movq 0x88(%rsp), %rax
cmpq %rax, 0x48(%rsp)
je 0x6f3e1
movq 0x30(%rsp), %rax
movl (%rax), %edi
movq 0x38(%rsp), %rcx
movl $0x400, %edx            # imm = 0x400
leaq 0x570(%rsp), %rsi
callq 0x67fc3
testq %rax, %rax
jle 0x6f3f6
cmpl $0x0, 0x24(%rsp)
je 0x6f3fd
xorl %ebp, %ebp
cmpl $0x0, 0x58(%rsp)
jg 0x6f418
jmp 0x6f80b
xorl %ebp, %ebp
jmp 0x6f654
movq 0x90(%rsp), %rdi
callq 0x3b4e9
movq %rax, %rbp
cmpl $0x0, 0x58(%rsp)
jle 0x6f810
movq %rbp, 0x40(%rsp)
movq 0x30(%rsp), %rax
movl (%rax), %edi
movq 0x38(%rsp), %rcx
movl $0x400, %edx            # imm = 0x400
leaq 0x170(%rsp), %rsi
callq 0x67fc3
testq %rax, %rax
movq 0x78(%rsp), %rbx
jle 0x6f574
movl $0x1, 0xc(%rsp)
movq $0x0, 0x18(%rsp)
xorl %ebp, %ebp
movq 0x88(%rsp), %rax
cmpq %rax, 0x48(%rsp)
setne %cl
cmpb $0x2d, 0x570(%rsp)
sete %al
andb %cl, %al
jne 0x6f4e3
cmpb $0x2d, 0x170(%rsp)
je 0x6f4e3
cmpl $0x0, 0x24(%rsp)
jne 0x6f52d
movq 0x10(%rsp), %rbx
movq 0x10(%rbx), %rdi
movq (%r14,%rbp,8), %rsi
callq 0x4505f
movq 0x10(%rbx), %rdi
movq 0x78(%rsp), %rbx
movq (%r14,%rbp,8), %rsi
callq 0x44f90
leaq 0x9739d(%rip), %rax     # 0x106858
incq 0x710(%rax)
movq (%r14,%rbp,8), %rdi
movl 0xc(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, 0xc(%rsp)
movq 0x40(%rsp), %rcx
movq %rdi, (%rcx,%rax,8)
callq 0x439a8
jmp 0x6f52d
cmpl $0x0, 0x18(%rsp)
jne 0x6f523
movq 0x30(%rsp), %rcx
movq $-0x1, 0x8(%rcx)
testb %al, %al
leaq 0x170(%rsp), %rdx
leaq 0x570(%rsp), %rax
cmovneq %rax, %rdx
incq %rdx
movq 0x10(%rsp), %rdi
leaq 0x5ccec(%rip), %rsi     # 0xcc208
xorl %eax, %eax
callq 0x3fe45
movl $0x1, %eax
movq %rax, 0x18(%rsp)
cmpq %rbp, %rbx
je 0x6f5c3
movq 0x30(%rsp), %rax
movl (%rax), %edi
movq 0x38(%rsp), %rcx
movl $0x400, %edx            # imm = 0x400
leaq 0x170(%rsp), %rsi
callq 0x67fc3
incq %rbp
testq %rax, %rax
jg 0x6f45c
cmpq 0x70(%rsp), %rbp
setl %bl
movl $0x1, %eax
movq 0x18(%rsp), %rcx
jmp 0x6f582
movl $0x1, 0xc(%rsp)
movb $0x1, %bl
xorl %eax, %eax
xorl %ecx, %ecx
testl %ecx, %ecx
sete %bpl
orl %ecx, %eax
setne %al
movl 0x68(%rsp), %ecx
notb %cl
orb %al, %cl
testb $0x1, %cl
jne 0x6f5bf
movb $0x1, %cl
movq 0x80(%rsp), %rax
cmpl $0x6e, (%rax)
movl 0xc(%rsp), %eax
je 0x6f5dc
movl $0x1, 0x18(%rsp)
movq 0x40(%rsp), %rbp
jmp 0x6f654
movl %ebp, %ecx
jmp 0x6f5d8
incq %rbp
cmpq 0x70(%rsp), %rbp
setl %bl
cmpl $0x0, 0x18(%rsp)
sete %cl
xorl %ebp, %ebp
movl 0xc(%rsp), %eax
cmpl $0x0, 0x24(%rsp)
je 0x6f5fa
movl $0x0, 0x18(%rsp)
testb %bpl, %bpl
movq 0x40(%rsp), %rbp
jne 0x6f654
jmp 0x6f7fd
movb %cl, 0x48(%rsp)
cmpl $0x2, %eax
jl 0x6f630
movl $0x3, %esi
leaq 0x50a63(%rip), %rdi     # 0xc0072
movl %eax, 0xc(%rsp)
callq 0x43944
movq 0x40(%rsp), %rdx
movq %rax, (%rdx)
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %esi
callq 0x4297c
jmp 0x6f63a
movq 0x40(%rsp), %rdi
callq 0x3b62b
movl $0x0, 0x18(%rsp)
testb %bpl, %bpl
movl $0x0, %ebp
movb 0x48(%rsp), %cl
je 0x6f7fd
movq 0xe0(%rsp), %rdi
callq 0x39548
movq 0x10(%rsp), %rax
movq 0x40(%rax), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x6ed39
movq %rbp, %rdi
callq 0x3b62b
cmpl $0x0, 0x18(%rsp)
je 0x6f69e
xorl %eax, %eax
movq 0x80(%rsp), %rcx
cmpl $0x6e, (%rcx)
movl $0x0, %ecx
jne 0x6f09e
movq 0x28(%rsp), %rdi
callq 0x3b62b
movq %r14, %rdi
callq 0x3b62b
callq 0x394a5
cmpq %r15, %r12
leaq 0x5cba8(%rip), %rcx     # 0xcc267
leaq 0x5cb99(%rip), %rdx     # 0xcc25f
cmoveq %rcx, %rdx
leaq 0x5cb5e(%rip), %rsi     # 0xcc22f
movq %rax, %rdi
xorl %eax, %eax
callq 0x3a145
movq 0x10(%rsp), %rdi
jmp 0x6f77b
leaq 0x5c455(%rip), %rsi     # 0xcbb41
movq %r12, %rdi
callq 0x26300
testl %eax, %eax
je 0x6f721
leaq 0x97bb1(%rip), %rax     # 0x1072b0
movq 0x80(%rax), %rsi
movq 0x10(%rsp), %rdi
addq $0x978, %rsp            # imm = 0x978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3fa6c
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rcx
movzbl -0x1(%rcx), %eax
movl %eax, %edx
andl $0x7, %edx
cmpl $0x4, %edx
movq 0x10(%rsp), %rbp
ja 0x6f7e3
leaq 0x5adf0(%rip), %rsi     # 0xca53c
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x6f7be
movq 0x28(%rsp), %rdi
callq 0x3b62b
movq %r14, %rdi
callq 0x3b62b
leaq 0x5c8a4(%rip), %rdi     # 0xcc017
callq 0x394c8
movq %r12, %rdi
movq %rax, %rsi
callq 0x3fc9e
addq $0x978, %rsp            # imm = 0x978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x28(%rsp), %rdi
callq 0x3b62b
movq %r14, %rdi
callq 0x3b62b
jmp 0x6f783
movq -0x11(%rcx), %rax
jmp 0x6f7be
movzwl -0x5(%rcx), %eax
jmp 0x6f7be
movl -0x9(%rcx), %eax
jmp 0x6f7be
movzbl -0x3(%rcx), %eax
testq %rax, %rax
je 0x6f7e3
leaq 0x5c7fc(%rip), %rsi     # 0xcbfc6
movq %rbp, %rdi
addq $0x978, %rsp            # imm = 0x978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3fe1e
movq 0x30(%rsp), %rax
subl %r13d, %eax
addl $-0x7, %eax
addq $0x7, %r13
movq %r13, %rbx
movl %eax, %r15d
jmp 0x6ef77
movq %rbx, %r15
testb %cl, %cl
movq 0x10(%rsp), %rbx
jne 0x6f822
jmp 0x6f843
xorl %r15d, %r15d
jmp 0x6f81d
movq %rbp, %rdi
callq 0x3b62b
xorl %r15d, %r15d
xorl %ebp, %ebp
movq 0x10(%rsp), %rbx
movq 0x60(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rax, 0x8(%rcx)
leaq 0x97a79(%rip), %rax     # 0x1072b0
movq 0x8(%rax), %rsi
movq %rbx, %rdi
callq 0x3fa6c
movq 0xe0(%rsp), %rdi
callq 0x39548
movq 0x28(%rsp), %rdi
callq 0x3b62b
movq %r14, %rdi
callq 0x3b62b
movq %rbp, %rdi
callq 0x3b62b
testb %r15b, %r15b
je 0x6f783
movq 0x40(%rbx), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x6ed39
jmp 0x6f783
leaq 0x5c7f9(%rip), %rdx     # 0xcc089
leaq 0x5ae16(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x128f, %r8d           # imm = 0x128F
jmp 0x6f968
leaq 0x5c888(%rip), %rdx     # 0xcc136
leaq 0x5adf8(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1297, %r8d           # imm = 0x1297
jmp 0x6f968
leaq 0x5c8c1(%rip), %rdx     # 0xcc18d
leaq 0x5adda(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x129f, %r8d           # imm = 0x129F
jmp 0x6f968
leaq 0x5c884(%rip), %rdx     # 0xcc16e
leaq 0x5adbc(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1298, %r8d           # imm = 0x1298
jmp 0x6f968
leaq 0x5c7bf(%rip), %rdx     # 0xcc0c4
leaq 0x5ada1(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1292, %r8d           # imm = 0x1292
jmp 0x6f968
leaq 0x5c8c3(%rip), %rdx     # 0xcc1e3
leaq 0x5ad86(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x12a5, %r8d           # imm = 0x12A5
jmp 0x6f968
leaq 0x5c7e3(%rip), %rdx     # 0xcc11e
leaq 0x5ad6b(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1295, %r8d           # imm = 0x1295
jmp 0x6f968
leaq 0x5c7a3(%rip), %rdx     # 0xcc0f9
leaq 0x5ad50(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1294, %r8d           # imm = 0x1294
callq 0x657bb
movl $0x1, %edi
callq 0x263d0
leaq 0x5c6a2(%rip), %rdx     # 0xcc020
leaq 0x5ad28(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1281, %r8d           # imm = 0x1281
jmp 0x6f968
leaq 0x5c6d0(%rip), %rdx     # 0xcc069
leaq 0x5ad0d(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1283, %r8d           # imm = 0x1283
jmp 0x6f968
leaq 0x5c691(%rip), %rdx     # 0xcc045
leaq 0x5acf2(%rip), %rcx     # 0xca6ad
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1282, %r8d           # imm = 0x1282
jmp 0x6f968