// File: /workspace/github_c_makefile_star2_O3/gplessis[P]dotdeb-redis/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;
    int argv_rewritten = 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.*/
    }

    /* On socket errors, close the migration socket now that we still have
     * the original host/port in the ARGV. Later the original command may be
     * rewritten to DEL and will be too later. */
    if (socket_error) migrateCloseSocket(c->argv[1],c->argv[2]);

    if (!copy) {
        /* Translate MIGRATE as DEL for replication/AOF. Note that we do
         * this only for the keys for which we received an acknowledgement
         * from the receiving Redis server, by using the del_idx index. */
        if (del_idx > 1) {
            newargv[0] = createStringObject("DEL",3);
            /* Note that the following call takes ownership of newargv. */
            replaceClientCommandVector(c,del_idx,newargv);
            argv_rewritten = 1;
        } 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 did not
     * already queue 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.
         *
         * Note: If we reached this point, even if socket_error is true
         * still the SELECT command succeeded (otherwise the code jumps to
         * socket_err label. */
        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);
    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);

    /* If the command was rewritten as DEL and there was a socket error,
     * we already closed the socket earlier. While migrateCloseSocket()
     * is idempotent, the host/port arguments are now gone, so don't do it
     * again. */
    if (!argv_rewritten) 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, 0x40(%rsp)
movl $0x3, %ebp
cmpq $0x7, %rcx
movq %rdi, 0x10(%rsp)
jl 0x6bff8
movq %rcx, 0x28(%rsp)
leaq -0x6(%rcx), %r13
xorl %ebx, %ebx
leaq 0x5d09c(%rip), %r14     # 0xc9029
movl $0x0, 0xc(%rsp)
movl $0x0, 0x1c(%rsp)
movl $0x1, %r15d
movq 0x40(%rsp), %rax
movq 0x30(%rax,%rbx,8), %rax
movq 0x8(%rax), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x262f0
testl %eax, %eax
je 0x6bfe1
movq %r12, %rdi
leaq 0x5cfa8(%rip), %rsi     # 0xc8f72
callq 0x262f0
testl %eax, %eax
jne 0x6c799
movl $0x1, 0x1c(%rsp)
jmp 0x6bfe9
movl $0x1, 0xc(%rsp)
incq %rbx
cmpq %rbx, %r13
jne 0x6bfa3
movq 0x10(%rsp), %r12
jmp 0x6c011
movq %rdi, %r12
movl $0x0, 0x1c(%rsp)
movl $0x1, %r15d
movl $0x0, 0xc(%rsp)
movq 0x40(%rsp), %rax
movq 0x28(%rax), %rsi
leaq 0x48(%rsp), %rdx
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x41718
testl %eax, %eax
jne 0x6c916
movq 0x40(%r12), %rax
movq 0x20(%rax), %rsi
leaq 0x78(%rsp), %rdx
movq %r12, %rdi
xorl %ecx, %ecx
callq 0x41718
testl %eax, %eax
jne 0x6c916
cmpq $0x0, 0x48(%rsp)
jg 0x6c062
movq $0x3e8, 0x48(%rsp)      # imm = 0x3E8
movslq %r15d, %rbx
leaq (,%rbx,8), %r14
xorl %r13d, %r13d
xorl %edi, %edi
movq %r14, %rsi
callq 0x3837d
movq %rax, 0x28(%rsp)
xorl %edi, %edi
movq %r14, %rsi
callq 0x3837d
movq %rax, 0x30(%rsp)
testl %ebx, %ebx
jle 0x6c80e
movl %r15d, %ebx
movq 0x30(%rsp), %r14
movq 0x10(%r12), %rdi
movq 0x40(%r12), %rax
movq (%rax,%rbp,8), %rsi
callq 0x41acf
movslq %r13d, %rcx
movq 0x28(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
testq %rax, %rax
je 0x6c0d4
movq 0x40(%r12), %rax
movq (%rax,%rbp,8), %rax
movq %rax, (%r14,%rcx,8)
incl %ecx
movl %ecx, %r13d
incq %rbp
decq %rbx
jne 0x6c09e
testl %r13d, %r13d
je 0x6c80e
cmpl $0x1, 0x1c(%rsp)
movl $0x5, %eax
sbbl $0x0, %eax
movl %eax, 0x84(%rsp)
movslq %r13d, %rax
leaq 0x8(,%rax,8), %rax
movq %rax, 0x98(%rsp)
movq %r13, 0x70(%rsp)
movl %r13d, %eax
movq %rax, 0x40(%rsp)
movq $0x0, 0x68(%rsp)
movl $0x1, %r14d
movb $0x1, %bpl
leaq 0xa0(%rsp), %r13
movl $0x0, 0x38(%rsp)
movq 0x40(%r12), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq 0x48(%rsp), %rcx
movq %r12, %rdi
callq 0x6bb93
testq %rax, %rax
je 0x6c83e
movq %rax, %rbx
callq 0x3628d
movq %r13, %rdi
movq %rax, %rsi
callq 0x726a0
movq %rbx, 0x60(%rsp)
movq 0x8(%rbx), %rax
movq 0x78(%rsp), %rcx
movq %rax, 0x58(%rsp)
movq %rcx, 0x90(%rsp)
cmpq %rcx, %rax
movq 0x30(%rsp), %r15
je 0x6c1e4
movq %r13, %rdi
movl $0x2a, %esi
movl $0x2, %edx
callq 0x727d4
testq %rax, %rax
je 0x6ca16
movl $0x6, %edx
movq %r13, %rdi
leaq 0x5cee6(%rip), %rsi     # 0xc90a6
callq 0x72874
testq %rax, %rax
je 0x6ca4c
movq 0x78(%rsp), %rsi
movq %r13, %rdi
callq 0x7296b
testq %rax, %rax
je 0x6ca31
movq %r14, 0x20(%rsp)
movl %ebp, 0x80(%rsp)
cmpl $0x0, 0x70(%rsp)
movl 0x1c(%rsp), %r14d
jle 0x6c3b9
xorl %ebx, %ebx
movq 0x10(%r12), %rdi
movq (%r15,%rbx,8), %rsi
callq 0x4302f
cmpq $-0x1, %rax
je 0x6c230
movq %rax, %rbp
callq 0x2ffce
subq %rax, %rbp
cmpq $0x2, %rbp
movl $0x1, %eax
cmovlq %rax, %rbp
jmp 0x6c232
xorl %ebp, %ebp
movq %r13, %rdi
movl $0x2a, %esi
movl 0x84(%rsp), %edx
callq 0x727d4
testq %rax, %rax
je 0x6c928
leaq 0x95652(%rip), %rax     # 0x1018a8
cmpl $0x0, 0x99c(%rax)
je 0x6c27d
movl $0xe, %edx
movq %r13, %rdi
leaq 0x5ceaf(%rip), %rsi     # 0xc911d
callq 0x72874
testq %rax, %rax
jne 0x6c29a
jmp 0x6c99d
movl $0x7, %edx
movq %r13, %rdi
leaq 0x5cecd(%rip), %rsi     # 0xc9159
callq 0x72874
testq %rax, %rax
je 0x6c9ee
movq (%r15,%rbx,8), %rax
movl (%rax), %ecx
shrl $0x4, %ecx
testb $0x7, %cl
jne 0x6c9d3
movq 0x8(%rax), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6c2ea
leaq 0x5b2f3(%rip), %rcx     # 0xc75b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x6c2ec
movq -0x11(%rsi), %rdx
jmp 0x6c2ec
movzwl -0x5(%rsi), %edx
jmp 0x6c2ec
movl -0x9(%rsi), %edx
jmp 0x6c2ec
movzbl -0x3(%rsi), %edx
jmp 0x6c2ec
xorl %edx, %edx
movq %r13, %rdi
callq 0x72874
testq %rax, %rax
je 0x6c946
movq %r13, %rdi
movq %rbp, %rsi
callq 0x7296b
testq %rax, %rax
je 0x6c982
movq 0x28(%rsp), %rax
movq (%rax,%rbx,8), %rsi
leaq 0x108(%rsp), %rdi
callq 0x6b7cd
movq 0x148(%rsp), %rsi
movzbl -0x1(%rsi), %edx
movl %edx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6c369
leaq 0x5b288(%rip), %rcx     # 0xc75cc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %edx
jmp 0x6c36b
movq -0x11(%rsi), %rdx
jmp 0x6c36b
movzwl -0x5(%rsi), %edx
jmp 0x6c36b
movl -0x9(%rsi), %edx
jmp 0x6c36b
movzbl -0x3(%rsi), %edx
jmp 0x6c36b
xorl %edx, %edx
movq %r13, %rdi
callq 0x72874
testq %rax, %rax
je 0x6c964
movq 0x148(%rsp), %rdi
callq 0x36330
testl %r14d, %r14d
je 0x6c3ab
movl $0x7, %edx
movq %r13, %rdi
leaq 0x5cea6(%rip), %rsi     # 0xc9243
callq 0x72874
testq %rax, %rax
je 0x6c9b8
incq %rbx
cmpq %rbx, 0x40(%rsp)
jne 0x6c202
callq 0x26880
movq %rax, 0x88(%rsp)
movl $0x0, (%rax)
movq 0xe0(%rsp), %r12
xorl %r15d, %r15d
movl $0x10000, %r14d         # imm = 0x10000
movzbl -0x1(%r12), %ebx
movl %ebx, %eax
andl $0x7, %eax
cmpl $0x4, %eax
ja 0x6c420
leaq 0x5b1ec(%rip), %rcx     # 0xc75e0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
shrl $0x3, %ebx
jmp 0x6c422
movq -0x11(%r12), %rbx
jmp 0x6c422
movzwl -0x5(%r12), %ebx
jmp 0x6c422
movl -0x9(%r12), %ebx
jmp 0x6c422
movzbl -0x3(%r12), %ebx
jmp 0x6c422
xorl %ebx, %ebx
movq %rbx, %rbp
subq %r15, %rbp
je 0x6c454
cmpq %r14, %rbp
cmovaeq %r14, %rbp
movq 0x60(%rsp), %rax
movl (%rax), %edi
leaq (%r12,%r15), %rsi
movq 0x48(%rsp), %rcx
movq %rbp, %rdx
callq 0x64e6c
cmpl %ebp, %eax
jne 0x6c4ac
cltq
addq %rax, %r15
jmp 0x6c3dd
movq 0x90(%rsp), %rax
cmpq %rax, 0x58(%rsp)
movq 0x10(%rsp), %r12
movq 0x20(%rsp), %r14
je 0x6c494
movq 0x60(%rsp), %rax
movl (%rax), %edi
movq 0x48(%rsp), %rcx
movl $0x400, %edx            # imm = 0x400
leaq 0x570(%rsp), %rsi
callq 0x64fcb
testq %rax, %rax
jle 0x6c6d0
cmpl $0x0, 0xc(%rsp)
je 0x6c4bd
movl $0x0, %eax
cmpl $0x0, 0x70(%rsp)
jg 0x6c4d5
jmp 0x6c8c7
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
movq 0x20(%rsp), %r14
jmp 0x6c701
movq 0x98(%rsp), %rdi
callq 0x382d1
cmpl $0x0, 0x70(%rsp)
jle 0x6c8a5
movq %rax, 0x50(%rsp)
xorl %ebp, %ebp
movl $0x1, 0x3c(%rsp)
movl $0x0, 0x20(%rsp)
leaq 0x170(%rsp), %r14
movq 0x60(%rsp), %r12
movl (%r12), %edi
movq 0x48(%rsp), %rcx
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
callq 0x64fcb
testq %rax, %rax
jle 0x6c60a
movq 0x90(%rsp), %rax
cmpq %rax, 0x58(%rsp)
setne %cl
cmpb $0x2d, 0x570(%rsp)
sete %al
andb %cl, %al
jne 0x6c5ac
cmpb $0x2d, 0x170(%rsp)
je 0x6c5ac
cmpl $0x0, 0xc(%rsp)
jne 0x6c5eb
movq 0x10(%rsp), %r14
movq 0x10(%r14), %rdi
movq 0x30(%rsp), %r12
movq (%r12,%rbp,8), %rsi
callq 0x41e5f
movq 0x10(%r14), %rdi
movq (%r12,%rbp,8), %rsi
callq 0x41d90
leaq 0x95331(%rip), %rax     # 0x1018a8
incq 0x720(%rax)
movq (%r12,%rbp,8), %rdi
movq 0x60(%rsp), %r12
leaq 0x170(%rsp), %r14
movl 0x3c(%rsp), %ecx
movslq %ecx, %rax
incl %ecx
movl %ecx, 0x3c(%rsp)
movq 0x50(%rsp), %rcx
movq %rdi, (%rcx,%rax,8)
callq 0x407a8
jmp 0x6c5eb
cmpl $0x0, 0x20(%rsp)
jne 0x6c5e3
movq $-0x1, 0x8(%r12)
testb %al, %al
movq %r14, %rdx
leaq 0x570(%rsp), %rax
cmovneq %rax, %rdx
incq %rdx
movq 0x10(%rsp), %rdi
leaq 0x5cc94(%rip), %rsi     # 0xc9270
xorl %eax, %eax
callq 0x3cc2d
movl $0x1, 0x20(%rsp)
incq %rbp
cmpq %rbp, 0x40(%rsp)
jne 0x6c4f9
cmpl $0x0, 0x20(%rsp)
sete %al
xorl %ebp, %ebp
movq 0x10(%rsp), %r12
jmp 0x6c65b
movl 0x20(%rsp), %eax
testl %eax, %eax
sete %dl
orl %eax, %ebp
setne %al
movl 0x80(%rsp), %ecx
notb %cl
orb %al, %cl
testb $0x1, %cl
jne 0x6c63f
movl $0x1, %r14d
movq 0x88(%rsp), %rax
cmpl $0x6e, (%rax)
jne 0x6c6f7
movq 0x10(%rsp), %r12
movq 0x40(%r12), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
movb %dl, %bpl
callq 0x6bdc5
movl %ebp, %eax
cmpl $0x0, 0xc(%rsp)
movl 0x3c(%rsp), %r14d
je 0x6c67d
xorl %r14d, %r14d
testb %bpl, %bpl
movq 0x50(%rsp), %rbp
jne 0x6c701
jmp 0x6c8be
movb %al, 0x58(%rsp)
cmpl $0x2, %r14d
jl 0x6c6d4
movl $0x3, %esi
leaq 0x50a01(%rip), %rdi     # 0xbd094
callq 0x40744
movq 0x50(%rsp), %rdx
movq %rax, (%rdx)
movq %r12, %rdi
movl %r14d, %esi
callq 0x3f779
testb %bpl, %bpl
je 0x6c8b8
movq 0xe0(%rsp), %rdi
callq 0x36330
xorl %r14d, %r14d
movl $0x1, 0x38(%rsp)
xorl %ebp, %ebp
jmp 0x6c72f
xorl %ebp, %ebp
jmp 0x6c701
movq 0x50(%rsp), %rdi
callq 0x38413
movl $0x0, %r14d
testb %bpl, %bpl
movl $0x0, %ebp
movb 0x58(%rsp), %al
jne 0x6c701
jmp 0x6c8be
movq 0x10(%rsp), %r12
movq 0x50(%rsp), %rbp
movq 0xe0(%rsp), %rdi
callq 0x36330
cmpl $0x0, 0x38(%rsp)
jne 0x6c72f
movq 0x40(%r12), %rax
movq 0x8(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x6bdc5
movl $0x0, 0x38(%rsp)
movq %rbp, %rdi
callq 0x38413
testl %r14d, %r14d
je 0x6c755
xorl %ebp, %ebp
movq 0x88(%rsp), %rax
cmpl $0x6e, (%rax)
movl $0x0, %r14d
jne 0x6c13b
movq 0x28(%rsp), %rdi
callq 0x38413
movq 0x30(%rsp), %rdi
callq 0x38413
callq 0x3628d
cmpq %r15, %rbx
leaq 0x5cb57(%rip), %rcx     # 0xc92cf
leaq 0x5cb48(%rip), %rdx     # 0xc92c7
cmoveq %rcx, %rdx
leaq 0x5cb0d(%rip), %rsi     # 0xc9297
movq %rax, %rdi
xorl %eax, %eax
callq 0x36f2d
jmp 0x6c82e
leaq 0x5c409(%rip), %rsi     # 0xc8ba9
movq %r12, %rdi
callq 0x262f0
testl %eax, %eax
je 0x6c7d5
leaq 0x95b5d(%rip), %rax     # 0x102310
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 0x3c854
movq 0x40(%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), %r12
ja 0x6c88c
leaq 0x5ada4(%rip), %rsi     # 0xc75a4
movslq (%rsi,%rdx,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
shrl $0x3, %eax
jmp 0x6c867
movq 0x28(%rsp), %rdi
callq 0x38413
movq 0x30(%rsp), %rdi
callq 0x38413
leaq 0x5c856(%rip), %rdi     # 0xc907f
callq 0x362b0
movq %r12, %rdi
movq %rax, %rsi
callq 0x3ca86
jmp 0x6c916
movq 0x28(%rsp), %rdi
callq 0x38413
movq 0x30(%rsp), %rdi
jmp 0x6c911
movq -0x11(%rcx), %rax
jmp 0x6c867
movzwl -0x5(%rcx), %eax
jmp 0x6c867
movl -0x9(%rcx), %eax
jmp 0x6c867
movzbl -0x3(%rcx), %eax
testq %rax, %rax
je 0x6c88c
leaq 0x5c7bb(%rip), %rsi     # 0xc902e
movq %r12, %rdi
addq $0x978, %rsp            # imm = 0x978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3cc06
movq 0x28(%rsp), %rax
subl %ebx, %eax
addl $-0x7, %eax
addq $0x7, %rbx
movq %rbx, %rbp
movl %eax, %r15d
jmp 0x6c011
movq %rax, %rdi
callq 0x38413
movq $0x0, 0x68(%rsp)
jmp 0x6c8c7
xorl %ebp, %ebp
movb 0x58(%rsp), %al
movq %rbp, 0x68(%rsp)
testb %al, %al
je 0x6c8ed
movq 0x78(%rsp), %rax
movq 0x60(%rsp), %rcx
movq %rax, 0x8(%rcx)
leaq 0x95a34(%rip), %rax     # 0x102310
movq 0x8(%rax), %rsi
movq %r12, %rdi
callq 0x3c854
movq 0x68(%rsp), %rbp
movq 0xe0(%rsp), %rdi
callq 0x36330
movq 0x28(%rsp), %rdi
callq 0x38413
movq 0x30(%rsp), %rdi
callq 0x38413
movq %rbp, %rdi
callq 0x38413
addq $0x978, %rsp            # imm = 0x978
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5c7c2(%rip), %rdx     # 0xc90f1
leaq 0x5addf(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x1292, %r8d           # imm = 0x1292
jmp 0x6ca07
leaq 0x5c851(%rip), %rdx     # 0xc919e
leaq 0x5adc1(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x129a, %r8d           # imm = 0x129A
jmp 0x6ca07
leaq 0x5c88a(%rip), %rdx     # 0xc91f5
leaq 0x5ada3(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x12a2, %r8d           # imm = 0x12A2
jmp 0x6ca07
leaq 0x5c84d(%rip), %rdx     # 0xc91d6
leaq 0x5ad85(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x129b, %r8d           # imm = 0x129B
jmp 0x6ca07
leaq 0x5c788(%rip), %rdx     # 0xc912c
leaq 0x5ad6a(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x1295, %r8d           # imm = 0x1295
jmp 0x6ca07
leaq 0x5c88c(%rip), %rdx     # 0xc924b
leaq 0x5ad4f(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x12a8, %r8d           # imm = 0x12A8
jmp 0x6ca07
leaq 0x5c7ac(%rip), %rdx     # 0xc9186
leaq 0x5ad34(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x1298, %r8d           # imm = 0x1298
jmp 0x6ca07
leaq 0x5c76c(%rip), %rdx     # 0xc9161
leaq 0x5ad19(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x1297, %r8d           # imm = 0x1297
callq 0x627c3
movl $0x1, %edi
callq 0x263c0
leaq 0x5c66b(%rip), %rdx     # 0xc9088
leaq 0x5acf1(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x1284, %r8d           # imm = 0x1284
jmp 0x6ca07
leaq 0x5c699(%rip), %rdx     # 0xc90d1
leaq 0x5acd6(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x1286, %r8d           # imm = 0x1286
jmp 0x6ca07
leaq 0x5c65a(%rip), %rdx     # 0xc90ad
leaq 0x5acbb(%rip), %rcx     # 0xc7715
movq %r12, %rdi
xorl %esi, %esi
movl $0x1285, %r8d           # imm = 0x1285
jmp 0x6ca07