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

    if (id == -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) {
	fprintf(stderr, "No reference found for id %d\n", id);
	pthread_mutex_unlock(&fd->ref_lock);
	return NULL;
    }

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

    if (!(r = fd->refs->ref_id[id])) {
	fprintf(stderr, "No reference found for id %d\n", 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 (cram_populate_ref(fd, id, r) == -1) {
	    fprintf(stderr, "Failed to populate reference for id %d\n", id);
	    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; 
    assert(start >= 1);

    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) {
	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 + ostart - start;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30e8, %rsp           # imm = 0x30E8
cmpl $-0x1, %esi
je 0x588ea
movl %ecx, %r13d
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %r15
leaq 0x8898(%rdi), %r12
movq %r12, %rdi
callq 0x6ae0
cmpl $0x0, 0x8854(%r15)
je 0x58348
movl $0x1, 0x220(%r15)
movq 0x48(%r15), %rdi
cmpl %ebp, 0x18(%rdi)
jle 0x5853d
movq 0x10(%rdi), %rax
movslq %ebp, %rbx
movq (%rax,%rbx,8), %rax
testq %rax, %rax
je 0x5853d
movl %r13d, 0x3c(%rsp)
leaq 0x48(%r15), %r13
addq $0x38, %rdi
movq %rax, 0x18(%rsp)
callq 0x6ae0
movq 0x18(%rsp), %rdx
cmpq $0x0, 0x10(%rdx)
movq %r13, 0x30(%rsp)
movq %r12, 0x40(%rsp)
je 0x58479
movl 0x3c(%rsp), %ecx
testl %r14d, %r14d
jle 0x58c95
movq %rbx, %r12
movq 0x10(%rdx), %rax
testl %ecx, %ecx
cmovlel %eax, %ecx
movslq %ecx, %r13
cmpq %r13, %rax
cmovlel %eax, %r13d
movl %r13d, %ecx
subl %r14d, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
cvtsi2sd %rax, %xmm1
mulsd 0x36a91(%rip), %xmm1    # 0x8ee68
ucomisd %xmm1, %xmm0
movl $0x1, %ebx
cmovbl %r14d, %ebx
cmovael %eax, %r13d
cmpl $0x0, 0x220(%r15)
jne 0x5840e
cmpq $0x0, 0x30(%rdx)
jne 0x5840e
cmpl $0x1, %ebx
jne 0x58578
movslq %r13d, %rcx
cmpq %rcx, %rax
jne 0x58578
testl %ebp, %ebp
js 0x584b6
cmpq $0x0, 0x30(%rdx)
movq 0x30(%rsp), %rbx
movq (%rbx), %rdi
je 0x584dd
movq 0x10(%rdi), %rax
movl %ebp, %ecx
movq (%rax,%rcx,8), %rcx
cmpq $0x0, 0x30(%rcx)
je 0x5844a
cmpl %ebp, 0x68(%rdi)
jne 0x58446
movl $0xffffffff, 0x68(%rdi) # imm = 0xFFFFFFFF
incq 0x28(%rcx)
movq $0x0, 0x50(%r15)
movl $0x1, 0x64(%r15)
movl 0x10(%rdx), %ecx
movl %ecx, 0x68(%r15)
movl %ebp, 0x60(%r15)
movq (%rax,%r12,8), %rax
movq 0x30(%rax), %rax
movl %r14d, %ecx
leaq (%rax,%rcx), %r14
decq %r14
jmp 0x584c5
leaq 0x8cfc(%r15), %rcx
movb $0x0, 0x9cfc(%r15)
cmpl $0x0, 0x1fc(%r15)
jne 0x58666
leaq 0x88fc(%r15), %rsi
cmpb $0x0, (%rcx)
movq %rbx, 0x28(%rsp)
je 0x5851e
movq %rsi, 0x10(%rsp)
movq %rcx, 0x48(%rsp)
jmp 0x58707
movq $0x0, 0x50(%r15)
movq 0x48(%r15), %rdi
xorl %r14d, %r14d
addq $0x38, %rdi
callq 0x64f0
movq 0x40(%rsp), %rdi
callq 0x64f0
jmp 0x588ed
movq %rdx, %r13
movl 0x40(%rdx), %edx
movl %ebp, %esi
callq 0x57fa2
testq %rax, %rax
je 0x58562
cmpl $0x0, 0x8854(%r15)
movq 0x48(%r15), %rdi
movq 0x10(%rdi), %rax
je 0x5861d
movl %ebp, %ecx
movq (%rax,%rcx,8), %rcx
cmpq $0x0, 0x30(%rcx)
movq %r13, %rdx
jne 0x5843a
jmp 0x5844a
leaq 0x40ed1(%rip), %rax     # 0x993f6
movq %rax, 0x48(%rsp)
cmpb $0x0, (%rsi)
je 0x585d9
movq %rsi, 0x10(%rsp)
jmp 0x58707
movq 0x66a94(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x40b67(%rip), %rsi     # 0x990b5
xorl %r14d, %r14d
movl %ebp, %edx
xorl %eax, %eax
callq 0x6a90
movq %r12, %rdi
jmp 0x584d3
movq (%rbx), %rdi
addq $0x38, %rdi
callq 0x64f0
movq 0x40(%rsp), %rdi
jmp 0x5865c
testl %ebp, %ebp
js 0x58625
movl %r14d, 0xc(%rsp)
movq %r15, 0x20(%rsp)
movq 0x30(%rsp), %rax
movq (%rax), %r14
movq 0x20(%r14), %rdi
movq %rdx, %r12
movq 0x8(%rdx), %r15
movq %r15, %rsi
callq 0x6a50
movq 0x28(%r14), %rdi
testl %eax, %eax
je 0x58afe
testq %rdi, %rdi
je 0x58b03
callq 0x68235
testl %eax, %eax
jne 0x588ea
movq 0x8(%r12), %r15
movq 0x30(%rsp), %rax
movq (%rax), %r14
jmp 0x58b03
leaq 0x40ea4(%rip), %rdi     # 0x99484
callq 0x68f0
testq %rax, %rax
je 0x585f3
cmpb $0x0, (%rax)
jne 0x586ca
leaq 0x40e94(%rip), %rdi     # 0x9948e
callq 0x68f0
testq %rax, %rax
je 0x58697
cmpb $0x0, (%rax)
je 0x58697
leaq 0x40e7b(%rip), %r8      # 0x99493
jmp 0x586d1
movq %r13, %rdx
jmp 0x5844a
movq 0x58(%r15), %rdi
testq %rdi, %rdi
movq 0x40(%rsp), %rbx
je 0x58640
callq 0x68a0
movq $0x0, 0x58(%r15)
movq $0x0, 0x50(%r15)
movl %ebp, 0x60(%r15)
movq 0x48(%r15), %rdi
addq $0x38, %rdi
callq 0x64f0
movq %rbx, %rdi
callq 0x64f0
jmp 0x588ea
movq 0x6696b(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
movq %rcx, 0x48(%rsp)
leaq 0x40d57(%rip), %rsi     # 0x993d3
movq %r15, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x6a90
movq 0x48(%rsp), %rcx
movq 0x18(%rsp), %rdx
jmp 0x58496
leaq 0x3ae76(%rip), %rdi     # 0x93514
callq 0x68f0
testq %rax, %rax
je 0x586ad
cmpb $0x0, (%rax)
jne 0x586ca
leaq 0x40de7(%rip), %rdi     # 0x9949b
callq 0x68f0
testq %rax, %rax
je 0x586c3
cmpb $0x0, (%rax)
jne 0x586ca
leaq 0x3ae2f(%rip), %rax     # 0x934f9
leaq 0x3fd83(%rip), %r8      # 0x98454
leaq 0x40d46(%rip), %rdx     # 0x9941e
leaq 0x20e0(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rdi, 0x10(%rsp)
movq %rax, %rcx
xorl %eax, %eax
callq 0x6c20
cmpl $0x0, 0x1fc(%r15)
jne 0x58c6b
movq 0x18(%rsp), %rdx
movq (%rdx), %rcx
testq %rcx, %rcx
je 0x588dd
movq 0x18(%r15), %rdi
leaq 0x40af1(%rip), %rsi     # 0x9920f
leaq 0x40aed(%rip), %rdx     # 0x99212
callq 0x62c06
testq %rax, %rax
je 0x588dd
movq %rax, %rbx
movl %r14d, 0xc(%rsp)
movq 0x18(%r15), %rdi
leaq 0x40acf(%rip), %rdx     # 0x99215
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x63344
movq %r15, %r13
testq %rax, %rax
je 0x587f6
movq %rax, %r15
movq %r13, 0x20(%rsp)
cmpl $0x0, 0x1fc(%r13)
jne 0x58b66
movq 0x10(%rsp), %rsi
cmpb $0x0, (%rsi)
movq 0x30(%rsp), %r13
je 0x587ae
movq 0x8(%r15), %rdx
addq $0x3, %rdx
leaq 0xe0(%rsp), %r14
movq %r14, %rdi
callq 0x57ceb
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x6630
testl %eax, %eax
je 0x58902
movq 0x8(%r15), %rdi
addq $0x3, %rdi
movq 0x48(%rsp), %rsi
xorl %edx, %edx
callq 0x5f47c
testq %rax, %rax
movq 0x20(%rsp), %r13
je 0x587f6
movq %rax, %r14
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0x5ebfa
movq 0x18(%rsp), %rcx
movq %rax, 0x30(%rcx)
testq %rax, %rax
je 0x58995
xorl %r14d, %r14d
jmp 0x5899d
movq 0x18(%r13), %rdi
leaq 0x37b9d(%rip), %rdx     # 0x9039e
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x63344
testq %rax, %rax
movq %r13, %r15
movq 0x30(%rsp), %r13
je 0x588dd
movq 0x8(%rax), %rbx
leaq 0x3(%rbx), %r14
leaq 0x40c3b(%rip), %rsi     # 0x99466
movl $0x5, %edx
movq %r14, %rdi
callq 0x6330
addq $0x8, %rbx
testl %eax, %eax
cmovneq %r14, %rbx
movl 0xc(%rsp), %r14d
movq (%r13), %rdi
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x5886c
movq %rax, %rdi
callq 0x68235
testl %eax, %eax
jne 0x588dd
movq (%r13), %rdi
movq $0x0, 0x28(%rdi)
movq %rbx, %rsi
xorl %edx, %edx
callq 0x58d97
testq %rax, %rax
je 0x588dd
movq %rax, %rbx
movq %r15, %rdi
callq 0x591d8
movq %rbx, 0x48(%r15)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x588a8
callq 0x68235
testl %eax, %eax
jne 0x588dd
movq (%r13), %rbx
movq $0x0, 0x28(%rbx)
cmpq $0x0, 0x20(%rbx)
je 0x588dd
movq 0x18(%r15), %rsi
movq %rbx, %rdi
callq 0x57823
cmpl $-0x1, %eax
je 0x588dd
movq (%r13), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x588dd
movq 0x28(%rsp), %rbx
cmpq $0x0, (%rax,%rbx,8)
jne 0x58b99
movl %ebp, %edi
movq %r13, %rsi
movq %r12, %rdx
callq 0x7886
xorl %r14d, %r14d
movq %r14, %rax
addq $0x30e8, %rsp           # imm = 0x30E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3d600(%rip), %rsi     # 0x95f09
leaq 0xe0(%rsp), %rdi
callq 0x66abc
testq %rax, %rax
je 0x587ae
movq %rax, 0x10(%rsp)
movq 0x80(%rsp), %rax
movq 0x18(%rsp), %rbx
movq %rax, 0x10(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%rbx)
movq (%r13), %rax
movq (%rax), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x651b2
movq %rax, 0x8(%rbx)
movq (%r13), %rcx
movq 0x28(%rcx), %rdi
testq %rdi, %rdi
je 0x58b73
callq 0x68235
testl %eax, %eax
movq 0x20(%rsp), %r15
movl 0xc(%rsp), %r14d
movq 0x28(%rsp), %rbx
jne 0x588dd
movq (%r13), %rcx
movq 0x18(%rsp), %rdx
movq 0x8(%rdx), %rax
jmp 0x58b85
movq 0x8(%r14), %rax
movq %rax, 0x30(%rcx)
movq 0x28(%rsp), %rbx
movq 0x10(%rsp), %rsi
movq %r14, 0x38(%rcx)
movq 0x50(%rsp), %rax
movq %rax, 0x10(%rcx)
movl $0x1, 0x40(%rcx)
cmpb $0x0, (%rsi)
movl 0xc(%rsp), %r14d
je 0x58af4
movl %ebp, 0x10(%rsp)
movq 0x8(%r15), %rdx
addq $0x3, %rdx
leaq 0xe0(%rsp), %rdi
callq 0x57ceb
movq 0x20(%rsp), %rax
cmpl $0x0, 0x1fc(%rax)
jne 0x58c34
leaq 0xe0(%rsp), %rbx
movq %rbx, %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x57e26
leaq 0x40a67(%rip), %r15     # 0x99477
leaq 0x10e0(%rsp), %r13
leaq 0x40a62(%rip), %rbp     # 0x99481
xorl %r12d, %r12d
movq %r13, %rdi
movq %r15, %rsi
movq %rbx, %rdx
movl %r12d, %ecx
xorl %eax, %eax
callq 0x6170
movq %r13, %rdi
movq %rbp, %rsi
callq 0x6880
testq %rax, %rax
jne 0x58a72
incl %r12d
callq 0x6060
cmpl $0x11, (%rax)
je 0x58a22
leaq 0x10e0(%rsp), %rdi
callq 0x6590
movl 0x10(%rsp), %ebp
movl 0xc(%rsp), %r14d
movq 0x28(%rsp), %rbx
jmp 0x58af4
movq %rax, %r14
movq 0x18(%rsp), %rax
movq 0x10(%rax), %rbx
movq 0x30(%rax), %rdi
movl $0x1, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x6e70
cmpq %rax, %rbx
jne 0x58c59
movq %r14, %rdi
callq 0x57698
cmpl $-0x1, %eax
movl 0x10(%rsp), %ebp
movq 0x28(%rsp), %rbx
leaq 0x10e0(%rsp), %rdi
je 0x58adb
movl $0x124, %esi            # imm = 0x124
callq 0x6640
testl %eax, %eax
movl 0xc(%rsp), %r14d
leaq 0x10e0(%rsp), %rdi
je 0x58ae7
callq 0x6320
jmp 0x58af4
callq 0x6320
movl 0xc(%rsp), %r14d
jmp 0x58af4
leaq 0xe0(%rsp), %rsi
callq 0x6430
movq 0x20(%rsp), %r15
jmp 0x58b99
testq %rdi, %rdi
jne 0x58b2c
movq %r15, 0x20(%r14)
movl 0x40(%r12), %esi
movq %r15, %rdi
callq 0x580ce
movq %rax, %rdi
movq 0x30(%rsp), %rax
movq (%rax), %rax
movq %rdi, 0x28(%rax)
testq %rdi, %rdi
je 0x58bec
movq %r12, %rsi
movl %ebx, %edx
movl %r13d, %ecx
callq 0x581a3
movq 0x20(%rsp), %r14
movq %rax, 0x50(%r14)
testq %rax, %rax
je 0x58bdf
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x58bf8
callq 0x68a0
movq 0x50(%r14), %r15
jmp 0x58bfb
movq %r15, %rdi
callq 0x785d
jmp 0x58772
movq %rbx, %rdx
movq 0x20(%rsp), %r15
movl 0xc(%rsp), %r14d
movq 0x28(%rsp), %rbx
movq 0x10(%rsp), %rsi
movq %rsi, 0x28(%rcx)
movq %rax, 0x20(%rcx)
movl $0x1, 0x40(%rdx)
movq 0x48(%r15), %rax
movq 0x10(%rax), %rcx
movq (%rcx,%rbx,8), %rdx
testl %ebp, %ebp
js 0x5839a
cmpl $0x0, 0x8854(%r15)
movl 0x3c(%rsp), %ecx
je 0x5839e
cmpq $0x0, 0x30(%rdx)
je 0x5839e
cmpl %ebp, 0x68(%rax)
jne 0x58bd6
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
incq 0x28(%rdx)
jmp 0x5839e
movq 0x30(%rsp), %rax
movq (%rax), %rdi
jmp 0x58565
addq $0x38, %rax
movq %rax, %rdi
jmp 0x58569
movq %rax, %r15
movl %ebp, 0x60(%r14)
movl %ebx, 0x64(%r14)
movl %r13d, 0x68(%r14)
movq %r15, 0x58(%r14)
movq 0x48(%r14), %rdi
addq $0x38, %rdi
callq 0x64f0
movq 0x40(%rsp), %rdi
callq 0x64f0
movl 0xc(%rsp), %r14d
addq %r15, %r14
movl %ebx, %eax
subq %rax, %r14
jmp 0x588ed
movq 0x6639d(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x40827(%rip), %rsi     # 0x9946c
leaq 0xe0(%rsp), %rdx
xorl %eax, %eax
callq 0x6a90
jmp 0x589f4
leaq 0xe0(%rsp), %rdi
callq 0x6590
jmp 0x58a9b
movq 0x66366(%rip), %rax     # 0xbefd8
movq (%rax), %rdi
leaq 0x407bd(%rip), %rsi     # 0x99439
leaq 0x20e0(%rsp), %rdx
movq %rdx, 0x10(%rsp)
xorl %eax, %eax
callq 0x6a90
jmp 0x58702
leaq 0x4045f(%rip), %rdi     # 0x990fb
leaq 0x40233(%rip), %rsi     # 0x98ed6
leaq 0x4045c(%rip), %rcx     # 0x99106
movl $0xa85, %edx            # imm = 0xA85
callq 0x6460