// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/cram/cram_io.c
// Function: cram_get_ref
char *cram_get_ref(cram_fd *fd, int id, hts_pos_t start, hts_pos_t end) {
    ref_entry *r;
    char *seq;
    int ostart = start;

    if (id == -1 || start < 1)
        return NULL;

    /* FIXME: axiomatic query of r->seq being true?
     * Or shortcut for unsorted data where we load once and never free?
     */

    //fd->shared_ref = 1; // hard code for now to simplify things

    pthread_mutex_lock(&fd->ref_lock);

    RP("%d cram_get_ref on fd %p, id %d, range %d..%d\n", gettid(), fd, id, start, end);

    /*
     * Unsorted data implies we want to fetch an entire reference at a time.
     * We just deal with this at the moment by claiming we're sharing
     * references instead, which has the same requirement.
     */
    if (fd->unsorted)
        fd->shared_ref = 1;


    /* Sanity checking: does this ID exist? */
    if (id >= fd->refs->nref) {
        hts_log_error("No reference found for id %d", id);
        pthread_mutex_unlock(&fd->ref_lock);
        return NULL;
    }

    if (!fd->refs || !fd->refs->ref_id[id]) {
        hts_log_error("No reference found for id %d", id);
        pthread_mutex_unlock(&fd->ref_lock);
        return NULL;
    }

    if (!(r = fd->refs->ref_id[id])) {
        hts_log_error("No reference found for id %d", id);
        pthread_mutex_unlock(&fd->ref_lock);
        return NULL;
    }


    /*
     * It has an entry, but may not have been populated yet.
     * Any manually loaded .fai files have their lengths known.
     * A ref entry computed from @SQ lines (M5 or UR field) will have
     * r->length == 0 unless it's been loaded once and verified that we have
     * an on-disk filename for it.
     *
     * 19 Sep 2013: Moved the lock here as the cram_populate_ref code calls
     * open_path_mfile and libcurl, which isn't multi-thread safe unless I
     * rewrite my code to have one curl handle per thread.
     */
    pthread_mutex_lock(&fd->refs->lock);
    if (r->length == 0) {
        if (fd->ref_fn)
            hts_log_warning("Reference file given, but ref '%s' not present",
                            r->name);
        if (cram_populate_ref(fd, id, r) == -1) {
            hts_log_warning("Failed to populate reference \"%s\"",
                            r->name);
            hts_log_warning("See https://www.htslib.org/doc/reference_seqs.html for further suggestions");
            pthread_mutex_unlock(&fd->refs->lock);
            pthread_mutex_unlock(&fd->ref_lock);
            return NULL;
        }
        r = fd->refs->ref_id[id];
        if (fd->unsorted)
            cram_ref_incr_locked(fd->refs, id);
    }


    /*
     * We now know that we the filename containing the reference, so check
     * for limits. If it's over half the reference we'll load all of it in
     * memory as this will speed up subsequent calls.
     */
    if (end < 1)
        end = r->length;
    if (end >= r->length)
        end  = r->length;

    if (end - start >= 0.5*r->length || fd->shared_ref) {
        start = 1;
        end = r->length;
    }

    /*
     * Maybe we have it cached already? If so use it.
     *
     * Alternatively if we don't have the sequence but we're sharing
     * references and/or are asking for the entire length of it, then
     * load the full reference into the refs structure and return
     * a pointer to that one instead.
     */
    if (fd->shared_ref || r->seq || (start == 1 && end == r->length)) {
        char *cp;

        if (id >= 0) {
            if (r->seq) {
                cram_ref_incr_locked(fd->refs, id);
            } else {
                ref_entry *e;
                if (!(e = cram_ref_load(fd->refs, id, r->is_md5))) {
                    pthread_mutex_unlock(&fd->refs->lock);
                    pthread_mutex_unlock(&fd->ref_lock);
                    return NULL;
                }

                /* unsorted data implies cache ref indefinitely, to avoid
                 * continually loading and unloading.
                 */
                if (fd->unsorted)
                    cram_ref_incr_locked(fd->refs, id);
            }

            fd->ref = NULL; /* We never access it directly */
            fd->ref_start = 1;
            fd->ref_end   = r->length;
            fd->ref_id    = id;

            cp = fd->refs->ref_id[id]->seq + ostart-1;
        } else {
            fd->ref = NULL;
            cp = NULL;
        }

        RP("%d cram_get_ref returning for id %d, count %d\n", gettid(), id, (int)r->count);

        pthread_mutex_unlock(&fd->refs->lock);
        pthread_mutex_unlock(&fd->ref_lock);
        return cp;
    }

    /*
     * Otherwise we're not sharing, we don't have a copy of it already and
     * we're only asking for a small portion of it.
     *
     * In this case load up just that segment ourselves, freeing any old
     * small segments in the process.
     */

    /* Unmapped ref ID */
    if (id < 0 || !fd->refs->fn) {
        if (fd->ref_free) {
            free(fd->ref_free);
            fd->ref_free = NULL;
        }
        fd->ref = NULL;
        fd->ref_id = id;
        pthread_mutex_unlock(&fd->refs->lock);
        pthread_mutex_unlock(&fd->ref_lock);
        return NULL;
    }

    /* Open file if it's not already the current open reference */
    if (strcmp(fd->refs->fn, r->fn) || fd->refs->fp == NULL) {
        if (fd->refs->fp)
            if (bgzf_close(fd->refs->fp) != 0)
                return NULL;
        fd->refs->fn = r->fn;
        if (!(fd->refs->fp = bgzf_open_ref(fd->refs->fn, "r", r->is_md5))) {
            pthread_mutex_unlock(&fd->refs->lock);
            pthread_mutex_unlock(&fd->ref_lock);
            return NULL;
        }
    }

    if (!(fd->ref = load_ref_portion(fd->refs->fp, r, start, end))) {
        pthread_mutex_unlock(&fd->refs->lock);
        pthread_mutex_unlock(&fd->ref_lock);
        return NULL;
    }

    if (fd->ref_free)
        free(fd->ref_free);

    fd->ref_id    = id;
    fd->ref_start = start;
    fd->ref_end   = end;
    fd->ref_free = fd->ref;
    seq = fd->ref;

    pthread_mutex_unlock(&fd->refs->lock);
    pthread_mutex_unlock(&fd->ref_lock);

    return seq ? seq + ostart - start : NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1108, %rsp           # imm = 0x1108
movq %rcx, %r13
cmpl $-0x1, %esi
sete %al
testq %rdx, %rdx
setle %cl
orb %al, %cl
je 0x4ea64
xorl %r15d, %r15d
jmp 0x4ee85
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
leaq 0x88f0(%rdi), %rbx
movq %rbx, %rdi
callq 0x4750
cmpl $0x0, 0x88a4(%r14)
je 0x4ea90
movl $0x1, 0x248(%r14)
movq 0x50(%r14), %rdi
cmpl %ebp, 0x18(%rdi)
jle 0x4eb84
movq 0x10(%rdi), %rax
movslq %ebp, %rcx
movq (%rax,%rcx,8), %r12
testq %r12, %r12
je 0x4eb84
movq %rcx, 0x18(%rsp)
addq $0x38, %rdi
callq 0x4750
cmpq $0x0, 0x10(%r12)
movq %rbx, 0x10(%rsp)
je 0x4eba8
testq %r13, %r13
movq 0x10(%r12), %rax
cmovleq %rax, %r13
cmpq %rax, %r13
cmovgeq %rax, %r13
movq %r13, %rcx
subq %r15, %rcx
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
cvtsi2sd %rax, %xmm1
mulsd 0x44522(%rip), %xmm1    # 0x93020
ucomisd %xmm1, %xmm0
movl $0x1, %ebx
cmovbq %r15, %rbx
cmovaeq %rax, %r13
cmpl $0x0, 0x248(%r14)
jne 0x4eb34
cmpq $0x0, 0x38(%r12)
jne 0x4eb34
movq %rbx, %rcx
xorq $0x1, %rcx
xorq %r13, %rax
orq %rcx, %rax
jne 0x4eeaf
testl %ebp, %ebp
movq 0x10(%rsp), %rbx
js 0x4ee08
cmpq $0x0, 0x38(%r12)
movq 0x50(%r14), %rdi
je 0x4ee19
movq 0x10(%rdi), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rcx
testq %rcx, %rcx
je 0x4ee40
cmpq $0x0, 0x38(%rcx)
je 0x4ee40
cmpl %ebp, 0x68(%rdi)
jne 0x4eb7b
movl $0xffffffff, 0x68(%rdi) # imm = 0xFFFFFFFF
incq 0x30(%rcx)
jmp 0x4ee40
leaq 0x4c505(%rip), %rsi     # 0x9b090
leaq 0x4c50b(%rip), %rdx     # 0x9b09d
xorl %r15d, %r15d
movl $0x1, %edi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x13de5
jmp 0x4ee7d
cmpq $0x0, 0x80(%r14)
je 0x4ebd0
movq (%r12), %rcx
leaq 0x4c4d3(%rip), %rsi     # 0x9b090
leaq 0x4c4f6(%rip), %rdx     # 0x9b0ba
movl $0x3, %edi
xorl %eax, %eax
callq 0x13de5
leaq 0x4ca83(%rip), %rdi     # 0x9b65a
callq 0x4600
movq %rax, (%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x30(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x4ca69(%rip), %rdi     # 0x9b663
callq 0x4600
movq %rax, %rbx
leaq 0x4ca64(%rip), %rsi     # 0x9b66d
leaq 0x4ca6f(%rip), %rdx     # 0x9b67f
movl $0x4, %edi
movq %r14, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x13de5
movq (%r12), %rcx
testq %rcx, %rcx
je 0x4f23c
movq 0x18(%r14), %rax
movq 0x38(%rax), %rdi
leaq 0x4a7c4(%rip), %rsi     # 0x99402
leaq 0x4a7c0(%rip), %rdx     # 0x99405
callq 0x85b55
testq %rax, %rax
je 0x4f23c
movq %rbx, 0x8(%rsp)
leaq 0x4a7a9(%rip), %rsi     # 0x99408
movq %rax, 0x58(%rsp)
movq %rax, %rdi
xorl %edx, %edx
callq 0x872e1
testq %rax, %rax
je 0x4ef97
movq %rax, %rbx
movq 0x8(%rax), %rcx
addq $0x3, %rcx
leaq 0x4c9e4(%rip), %rsi     # 0x9b66d
leaq 0x4ca19(%rip), %rdx     # 0x9b6a9
movl $0x4, %edi
xorl %eax, %eax
callq 0x13de5
cmpq $0x0, 0x8(%rsp)
movq %rbx, 0x20(%rsp)
je 0x4ece7
movq 0x8(%rsp), %rax
cmpb $0x0, (%rax)
je 0x4ece7
movq 0x8(%rbx), %rdx
addq $0x3, %rdx
leaq 0x100(%rsp), %rdi
movq 0x8(%rsp), %rsi
callq 0x54a5d
testl %eax, %eax
jne 0x4ece7
leaq 0x100(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x4420
testl %eax, %eax
je 0x4ed47
movq 0x8(%rbx), %rdi
addq $0x3, %rdi
movq (%rsp), %rsi
callq 0x57bb3
testq %rax, %rax
je 0x4ef4f
leaq 0x497c6(%rip), %rdx     # 0x984ce
leaq 0x100(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rcx
movq %rax, 0x50(%rsp)
xorl %eax, %eax
callq 0x4800
movl %eax, %ebx
movq 0x50(%rsp), %rdi
callq 0x45c0
addl $0xfffff000, %ebx       # imm = 0xFFFFF000
cmpl $0xfffff001, %ebx       # imm = 0xFFFFF001
movq 0x20(%rsp), %rbx
jb 0x4ef4f
leaq 0x100(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x4420
testl %eax, %eax
jne 0x4ef4a
movl $0xf000, %eax           # imm = 0xF000
andl 0x88(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x4ef4a
leaq 0x4984c(%rip), %rsi     # 0x985cb
leaq 0x100(%rsp), %rdi
callq 0xa550
testq %rax, %rax
je 0x4ef4a
movq %rax, %rbx
movq 0xa0(%rsp), %rax
movq %rax, 0x10(%r12)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x20(%r12)
movq 0x50(%r14), %rax
movq (%rax), %rdi
leaq 0x100(%rsp), %rsi
callq 0x57fd5
movq %rax, 0x8(%r12)
movq 0x50(%r14), %rcx
movq 0x28(%rcx), %rdi
testq %rdi, %rdi
je 0x4edec
callq 0xd3cd
testl %eax, %eax
jne 0x4f23c
movq 0x50(%r14), %rcx
movq 0x8(%r12), %rax
movq %rbx, 0x28(%rcx)
movq %rax, 0x20(%rcx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x48(%r12)
jmp 0x4f3e2
movq $0x0, 0x58(%r14)
movq 0x50(%r14), %rdi
xorl %r15d, %r15d
jmp 0x4ee74
movl 0x48(%r12), %edx
movl %ebp, %esi
callq 0x4e5fe
testq %rax, %rax
je 0x4ee9a
cmpl $0x0, 0x88a4(%r14)
movq 0x50(%r14), %rdi
movq 0x10(%rdi), %rax
jne 0x4eb55
movq $0x0, 0x58(%r14)
movq $0x1, 0x70(%r14)
movq 0x10(%r12), %rcx
movq %rcx, 0x78(%r14)
movl %ebp, 0x68(%r14)
movq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq 0x38(%rax), %rax
movslq %r15d, %rcx
leaq (%rax,%rcx), %r15
decq %r15
addq $0x38, %rdi
callq 0x4340
movq %rbx, %rdi
callq 0x4340
movq %r15, %rax
addq $0x1108, %rsp           # imm = 0x1108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x50(%r14), %rdi
addq $0x38, %rdi
callq 0x4340
movq %rbx, %rdi
jmp 0x4ef40
testl %ebp, %ebp
js 0x4ef0c
movq 0x50(%r14), %rax
movq 0x20(%rax), %rdi
testq %rdi, %rdi
je 0x4ef0c
movq 0x8(%r12), %rsi
movq %rsi, (%rsp)
movq %rax, 0x18(%rsp)
callq 0x46c0
movq 0x18(%rsp), %rcx
movq 0x28(%rcx), %rdi
testl %eax, %eax
je 0x4f294
testq %rdi, %rdi
je 0x4f299
callq 0xd3cd
testl %eax, %eax
jne 0x4ea5c
movq 0x8(%r12), %rax
movq %rax, (%rsp)
movq 0x50(%r14), %rcx
jmp 0x4f299
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0x4ef22
callq 0x45c0
movq $0x0, 0x60(%r14)
movq $0x0, 0x58(%r14)
movl %ebp, 0x68(%r14)
movq 0x50(%r14), %rdi
addq $0x38, %rdi
callq 0x4340
movq 0x10(%rsp), %rdi
callq 0x4340
jmp 0x4ea5c
movq 0x20(%rsp), %rbx
leaq 0x2c(%rsp), %rcx
movl $0x0, (%rcx)
movq 0x8(%rbx), %rdi
addq $0x3, %rdi
movq (%rsp), %rsi
xorl %edx, %edx
callq 0x579a8
testq %rax, %rax
je 0x4ef97
movq %rax, %rbx
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0x56fd7
movq %rax, 0x38(%r12)
testq %rax, %rax
je 0x4f0e2
xorl %ebx, %ebx
jmp 0x4f0eb
leaq 0x4c333(%rip), %rsi     # 0x9b2d1
movq 0x58(%rsp), %rdi
xorl %edx, %edx
callq 0x872e1
testq %rax, %rax
je 0x4f23c
movq 0x8(%rax), %rax
movq %rax, (%rsp)
leaq 0x3(%rax), %rbx
leaq 0x46570(%rip), %rsi     # 0x95536
movq %rbx, %rdi
callq 0x40e0
testq %rax, %rax
je 0x4f00a
leaq 0x4c6df(%rip), %rsi     # 0x9b6b9
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4210
testl %eax, %eax
je 0x4f00a
leaq 0x4c67b(%rip), %rsi     # 0x9b66d
leaq 0x4c6c6(%rip), %rdx     # 0x9b6bf
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
jmp 0x4f23c
leaq 0x4c6a8(%rip), %rsi     # 0x9b6b9
movl $0x5, %edx
movq %rbx, %rdi
callq 0x4210
movq (%rsp), %rsi
addq $0x8, %rsi
testl %eax, %eax
cmovneq %rbx, %rsi
movq 0x50(%r14), %rdi
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x4f05b
movq %rsi, %rbx
movq %rax, %rdi
callq 0xd3cd
testl %eax, %eax
jne 0x4f23c
movq 0x50(%r14), %rdi
movq $0x0, 0x28(%rdi)
movq %rbx, %rsi
xorl %edx, %edx
callq 0x4f513
testq %rax, %rax
je 0x4f23c
movq %rax, %rbx
movq %r14, %rdi
callq 0x4f9f4
movq %rbx, 0x50(%r14)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x4f09c
callq 0xd3cd
testl %eax, %eax
jne 0x4f23c
movq 0x50(%r14), %rbx
movq $0x0, 0x28(%rbx)
cmpq $0x0, 0x20(%rbx)
je 0x4f23c
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x4df9d
cmpl $-0x1, %eax
je 0x4f23c
movq 0x50(%r14), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x4f23c
movq 0x18(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
jne 0x4f3e2
jmp 0x4f23c
movq 0x8(%rbx), %rax
movq %rax, 0x38(%r12)
xorl %edi, %edi
movq %rbx, 0x40(%r12)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%r12)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x48(%r12)
movq 0x8(%rsp), %rsi
testq %rsi, %rsi
je 0x4f3dd
cmpl $0x0, 0x2c(%rsp)
jne 0x4f3dd
cmpb $0x0, (%rsi)
je 0x4f28d
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdx
addq $0x3, %rdx
leaq 0x100(%rsp), %rdi
callq 0x54a5d
testl %eax, %eax
js 0x4f3e2
leaq 0x4c517(%rip), %rsi     # 0x9b66d
leaq 0x4c595(%rip), %rdx     # 0x9b6f2
leaq 0x100(%rsp), %rbx
movl $0x4, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x13de5
movq %rbx, %rdi
callq 0x54c2d
leaq 0x47a1c(%rip), %rsi     # 0x96b9f
leaq 0x30(%rsp), %rdx
movq %rbx, %rdi
callq 0x155a0
movq %rax, (%rsp)
testq %rax, %rax
je 0x4f3ce
callq 0x8b777
testq %rax, %rax
je 0x4f21f
movq %rax, %rbx
movq 0x10(%r12), %rdx
movq 0x38(%r12), %rsi
movq %rax, %rdi
callq 0x8ad49
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x8b650
movq %rbx, %rdi
callq 0x8b7a1
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
leaq 0x60(%rsp), %rsi
callq 0x8b7ab
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
movl $0x20, %edx
movq %rbx, %rsi
callq 0x4210
testl %eax, %eax
je 0x4f335
leaq 0x4c461(%rip), %rsi     # 0x9b66d
leaq 0x4c4f7(%rip), %rdx     # 0x9b70a
movl $0x1, %edi
xorl %eax, %eax
callq 0x13de5
movq (%rsp), %rdi
callq 0xf53f
movq 0x40(%rsp), %rdi
callq 0x4200
movq 0x40(%rsp), %rdi
callq 0x45c0
movq (%r12), %rcx
leaq 0x4be49(%rip), %rbx     # 0x9b090
leaq 0x4be9b(%rip), %rdx     # 0x9b0e9
xorl %r15d, %r15d
movl $0x3, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x13de5
leaq 0x4bea4(%rip), %rdx     # 0x9b10b
movl $0x3, %edi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x13de5
movq 0x50(%r14), %rdi
addq $0x38, %rdi
callq 0x4340
movq 0x10(%rsp), %rdi
jmp 0x4ee80
xorl %edi, %edi
jmp 0x4f3dd
testq %rdi, %rdi
jne 0x4f2bb
movq (%rsp), %rdi
movq %rdi, 0x20(%rcx)
movl 0x48(%r12), %esi
callq 0x4e72f
movq %rax, %rdi
movq 0x50(%r14), %rax
movq %rdi, 0x28(%rax)
testq %rdi, %rdi
je 0x4f2ea
movq %r12, %rsi
movq %rbx, %rdx
movq %r13, %rcx
callq 0x4e828
movq %rax, 0x58(%r14)
testq %rax, %rax
je 0x4ef2e
movq 0x60(%r14), %rdi
testq %rdi, %rdi
je 0x4f2f6
callq 0x45c0
movq 0x58(%r14), %r12
jmp 0x4f2f9
addq $0x38, %rax
movq %rax, %rdi
jmp 0x4ef36
movq %rax, %r12
movl %ebp, 0x68(%r14)
movq %rbx, 0x70(%r14)
movq %r13, 0x78(%r14)
movq %r12, 0x60(%r14)
movq 0x50(%r14), %rdi
addq $0x38, %rdi
callq 0x4340
movq 0x10(%rsp), %rdi
callq 0x4340
movslq %r15d, %r15
addq %r12, %r15
subq %rbx, %r15
testq %r12, %r12
cmoveq %r12, %r15
jmp 0x4ee85
movq 0x10(%r12), %rdx
movq 0x38(%r12), %rsi
movq (%rsp), %rbx
movq %rbx, %rdi
callq 0x4b30e
movq %rax, 0x8(%rsp)
movq %rbx, %rdi
callq 0xf4df
testl %eax, %eax
js 0x4f391
movq 0x8(%rsp), %rax
cmpq 0x10(%r12), %rax
jne 0x4f391
movq 0x40(%rsp), %rdi
movl $0x124, %esi            # imm = 0x124
callq 0x4430
testl %eax, %eax
js 0x4f391
movq 0x40(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0x42c0
testl %eax, %eax
jns 0x4f3d8
callq 0x4050
movl (%rax), %edi
callq 0x4150
leaq 0x4c2c9(%rip), %rsi     # 0x9b66d
leaq 0x4c38b(%rip), %rdx     # 0x9b736
leaq 0x100(%rsp), %rcx
movl $0x1, %edi
movq %rax, %r8
xorl %eax, %eax
callq 0x13de5
movq 0x40(%rsp), %rdi
callq 0x4200
jmp 0x4f3d8
movq 0x40(%rsp), %rdi
callq 0x43d0
movq 0x40(%rsp), %rdi
callq 0x45c0
movq 0x50(%r14), %rax
movq 0x10(%rax), %rcx
movq 0x18(%rsp), %rdx
movq (%rcx,%rdx,8), %r12
testl %ebp, %ebp
js 0x4ead0
cmpl $0x0, 0x88a4(%r14)
je 0x4ead0
testq %r12, %r12
je 0x4f430
cmpq $0x0, 0x38(%r12)
je 0x4ead0
cmpl %ebp, 0x68(%rax)
jne 0x4f426
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
incq 0x30(%r12)
jmp 0x4ead0
xorl %r12d, %r12d
jmp 0x4ead0