// File: /workspace/github_cpp_makefile_star2_O3/karel-brinda[P]ococo/ext/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 $0x40f8, %rsp           # imm = 0x40F8
cmpl $-0x1, %esi
je 0x3453c
movl %ecx, %r15d
movl %esi, %r13d
movq %rdi, %r14
movl %edx, 0x4(%rsp)
leaq 0x8898(%rdi), %r12
movq %r12, %rdi
callq 0x47a0
cmpl $0x0, 0x8854(%r14)
je 0x33a4e
movl $0x1, 0x220(%r14)
movq 0x48(%r14), %rdi
cmpl %r13d, 0x18(%rdi)
jle 0x33b4a
movq 0x10(%rdi), %rax
movslq %r13d, %rbx
movq (%rax,%rbx,8), %rcx
testq %rcx, %rcx
je 0x33b4a
leaq 0x48(%r14), %rax
movq %rax, 0x8(%rsp)
addq $0x38, %rdi
movq %rcx, 0x20(%rsp)
callq 0x47a0
movq 0x20(%rsp), %rsi
cmpq $0x0, 0x10(%rsi)
je 0x33aa0
movq %r12, %rbp
movl 0x4(%rsp), %r8d
jmp 0x34211
movl %r15d, 0x2c(%rsp)
movq %rbx, 0x38(%rsp)
leaq 0x1f65f(%rip), %rdi     # 0x53110
callq 0x4650
movq %rax, %r15
leaq 0x1f659(%rip), %rdi     # 0x53119
callq 0x4650
cmpl $0x0, 0x1fc(%r14)
jne 0x34156
movb $0x0, 0x20f0(%rsp)
testq %r15, %r15
je 0x33af0
cmpb $0x0, (%r15)
je 0x33af0
movq %rax, 0x30(%rsp)
jmp 0x33c0c
testq %rax, %rax
je 0x33b0b
cmpb $0x0, (%rax)
je 0x33b0b
movq %rax, 0x30(%rsp)
leaq 0x1f640(%rip), %r15     # 0x53146
jmp 0x33c0c
leaq 0x1f79e(%rip), %rdi     # 0x532b0
callq 0x4650
testq %rax, %rax
je 0x33b28
movq %rax, %rbx
cmpb $0x0, (%rax)
jne 0x33ba9
leaq 0x1f78b(%rip), %rdi     # 0x532ba
callq 0x4650
testq %rax, %rax
je 0x33b70
movq %rax, %rbx
cmpb $0x0, (%rax)
je 0x33b70
leaq 0x1f777(%rip), %r15     # 0x532bf
jmp 0x33bb0
movq 0x2e477(%rip), %rax     # 0x61fc8
movq (%rax), %rdi
leaq 0x1f2a2(%rip), %rsi     # 0x52dfd
xorl %r14d, %r14d
movl %r13d, %edx
xorl %eax, %eax
callq 0x4770
movq %r12, %rdi
jmp 0x34304
leaq 0x1f750(%rip), %rdi     # 0x532c7
callq 0x4650
testq %rax, %rax
je 0x33b89
movq %rax, %rbx
cmpb $0x0, (%rax)
jne 0x33ba9
leaq 0x1f73e(%rip), %rdi     # 0x532ce
callq 0x4650
testq %rax, %rax
je 0x33ba2
movq %rax, %rbx
cmpb $0x0, (%rax)
jne 0x33ba9
leaq 0x1f72a(%rip), %rbx     # 0x532d3
leaq 0x1d003(%rip), %r15     # 0x50bb3
leaq 0x1f5b7(%rip), %rdx     # 0x5316e
leaq 0x20f0(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x4890
leaq 0x1f5a3(%rip), %rdx     # 0x5317b
leaq 0x30f0(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rdi, 0x30(%rsp)
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x4890
leaq 0x1f548(%rip), %r15     # 0x53146
cmpl $0x0, 0x1fc(%r14)
jne 0x3445d
movq 0x20(%rsp), %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x3452c
movq 0x18(%r14), %rdi
leaq 0x1f321(%rip), %rsi     # 0x52f49
leaq 0x1f31d(%rip), %rdx     # 0x52f4c
callq 0x3e8dd
testq %rax, %rax
je 0x3452c
movq %rax, %rbx
movq 0x18(%r14), %rdi
leaq 0x1f304(%rip), %rdx     # 0x52f4f
movq %rax, %rsi
xorl %ecx, %ecx
callq 0x3f063
testq %rax, %rax
je 0x33d40
movq %rax, %rbp
cmpl $0x0, 0x1fc(%r14)
jne 0x3417f
movq %r12, 0x18(%rsp)
movq 0x30(%rsp), %rsi
testq %rsi, %rsi
je 0x33c9a
cmpb $0x0, (%rsi)
je 0x33c9a
movq 0x8(%rbp), %rdx
addq $0x3, %rdx
leaq 0xf0(%rsp), %rdi
callq 0x333ef
jmp 0x33ce0
movq 0x8(%rbp), %rdi
addq $0x3, %rdi
movq %r15, %rsi
callq 0x3b213
testq %rax, %rax
je 0x33cfa
movq %rax, %r12
leaq 0xf0(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
movq %rax, %rsi
callq 0x42b0
movq %r12, %rdi
callq 0x4610
leaq 0xf0(%rsp), %rdi
callq 0x3a0f0
testl %eax, %eax
je 0x33cfa
leaq 0xf0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x44a0
testl %eax, %eax
je 0x33e51
movq 0x8(%rbp), %rdi
addq $0x3, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x3b07b
testq %rax, %rax
movq 0x18(%rsp), %r12
je 0x33d40
movq %rax, %r15
leaq 0x60(%rsp), %rsi
movq %rax, %rdi
callq 0x3a7ee
movq 0x20(%rsp), %rcx
movq %rax, 0x30(%rcx)
testq %rax, %rax
je 0x33ee5
xorl %r15d, %r15d
jmp 0x33eed
movq 0x18(%r14), %rdi
leaq 0x1f207(%rip), %rdx     # 0x52f52
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x3f063
testq %rax, %rax
je 0x3452c
movq 0x8(%rax), %rbx
leaq 0x3(%rbx), %r15
leaq 0x1f456(%rip), %rsi     # 0x531c3
movl $0x5, %edx
movq %r15, %rdi
callq 0x4280
addq $0x8, %rbx
testl %eax, %eax
cmovneq %r15, %rbx
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x33db5
movq %rax, %rdi
callq 0x441e8
testl %eax, %eax
jne 0x3452c
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq $0x0, 0x28(%rdi)
movq %rbx, %rsi
xorl %edx, %edx
callq 0x34694
testq %rax, %rax
je 0x3452c
movq %rax, %rbx
movq %r14, %rdi
callq 0x34ad5
movq %rbx, 0x48(%r14)
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x33dfd
callq 0x441e8
testl %eax, %eax
jne 0x3452c
movq 0x8(%rsp), %rax
movq (%rax), %rbx
movq $0x0, 0x28(%rbx)
cmpq $0x0, 0x20(%rbx)
je 0x3452c
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0x32f27
cmpl $-0x1, %eax
je 0x3452c
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x10(%rax), %rax
testq %rax, %rax
je 0x3452c
movq 0x38(%rsp), %rbx
cmpq $0x0, (%rax,%rbx,8)
movl 0x2c(%rsp), %r15d
movl 0x4(%rsp), %r8d
jne 0x341d6
jmp 0x3452c
leaq 0x1dae9(%rip), %rsi     # 0x51941
leaq 0xf0(%rsp), %rdi
callq 0x42768
testq %rax, %rax
je 0x33cfa
movq %rax, %r12
movq 0x90(%rsp), %rax
movq 0x20(%rsp), %r15
movq %rax, 0x10(%r15)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x18(%r15)
movq 0x8(%rsp), %rbx
movq (%rbx), %rax
movq (%rax), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x40f12
movq %rax, 0x8(%r15)
movq (%rbx), %rcx
movq 0x28(%rcx), %rdi
testq %rdi, %rdi
je 0x3418c
callq 0x441e8
testl %eax, %eax
movq 0x38(%rsp), %rbx
movl 0x2c(%rsp), %r15d
jne 0x3458b
movq 0x8(%rsp), %rax
movq (%rax), %rcx
movq 0x20(%rsp), %rdx
movq 0x8(%rdx), %rax
jmp 0x34199
movq 0x8(%r15), %rax
movq %rax, 0x30(%rcx)
movl 0x4(%rsp), %r8d
movq 0x30(%rsp), %rdx
movq %r15, 0x38(%rcx)
movq 0x60(%rsp), %rax
movq %rax, 0x10(%rcx)
movl $0x1, 0x40(%rcx)
testq %rdx, %rdx
je 0x341cc
cmpb $0x0, (%rdx)
je 0x341cc
callq 0x4790
movl %eax, 0x44(%rsp)
callq 0x4480
movq %rax, 0x60(%rsp)
xorl %ecx, %ecx
xorl %eax, %eax
movl %ecx, %ebx
shll $0x5, %ebx
subl %ecx, %ebx
movzbl 0x60(%rsp,%rax), %r15d
leal (%rbx,%r15), %ecx
incq %rax
cmpq $0x8, %rax
jne 0x33f34
cmpb $0x0, 0x20f0(%rsp)
je 0x33f79
leaq 0x20f0(%rsp), %rdi
callq 0x3a0bc
testl %eax, %eax
jne 0x33f79
leaq 0x2e5e0(%rip), %rax     # 0x62550
cmpl $0x0, (%rax)
jg 0x34566
movl %r13d, 0x14(%rsp)
movq %rbp, 0x48(%rsp)
movq 0x8(%rbp), %rdx
addq $0x3, %rdx
leaq 0xf0(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0x333ef
cmpl $0x0, 0x1fc(%r14)
jne 0x344e8
leaq 0xf0(%rsp), %rdi
movl $0x3ff, %esi            # imm = 0x3FF
callq 0x3352a
leal (%rbx,%r15), %ebp
incl %ebp
leaq 0x1f28b(%rip), %r15     # 0x53255
leaq 0x10f0(%rsp), %r12
leaq 0x1f28c(%rip), %r13     # 0x53265
xorl %edi, %edi
callq 0x44d0
movq %rax, %rbx
callq 0x4370
xorl %eax, %ebx
movq %r12, %rdi
movq %r15, %rsi
leaq 0xf0(%rsp), %rdx
movl 0x44(%rsp), %ecx
movl %ebp, %r8d
movl %ebx, %r9d
xorl %eax, %eax
callq 0x4110
movq %r12, %rdi
movq %r13, %rsi
callq 0x477e9
testq %rax, %rax
jne 0x34046
callq 0x4070
incl %ebp
cmpl $0x11, (%rax)
je 0x33fd9
leaq 0x10f0(%rsp), %rdi
callq 0x4440
movq 0x18(%rsp), %r12
movl 0x14(%rsp), %r13d
movl 0x4(%rsp), %r8d
jmp 0x341cc
movq %rax, %rbx
callq 0x48cc3
testq %rax, %rax
movq 0x18(%rsp), %r12
movl 0x14(%rsp), %r13d
je 0x34517
movq %rax, %r15
movq 0x20(%rsp), %rbp
movq 0x10(%rbp), %rdx
movq 0x30(%rbp), %rsi
movq %rax, %rdi
callq 0x48295
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x48b9c
movq %r15, %rdi
callq 0x48ced
leaq 0x60(%rsp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x48cf7
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rdi
addq $0x3, %rdi
movl $0x20, %edx
movq %r15, %rsi
callq 0x4280
testl %eax, %eax
jne 0x3450d
movq 0x10(%rbp), %r12
movq 0x30(%rbp), %r13
movq 0x8(%rbx), %rdi
movq 0x18(%rbx), %rbp
subq %rdi, %rbp
cmpq %r12, %rbp
movq %r12, %r15
cmovbq %rbp, %r15
movq %r13, %rsi
movq %r15, %rdx
callq 0x4420
addq %r15, 0x8(%rbx)
cmpq %r12, %rbp
jae 0x34108
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
callq 0x47309
movq %rax, %r15
movl 0x4(%rsp), %ebp
movq 0x20(%rsp), %rax
cmpq 0x10(%rax), %r15
movq 0x18(%rsp), %r12
movl 0x14(%rsp), %r13d
jne 0x34554
movq %rbx, %rdi
callq 0x4745b
testl %eax, %eax
js 0x34147
leaq 0x10f0(%rsp), %rdi
movl $0x124, %esi            # imm = 0x124
callq 0x44b0
testl %eax, %eax
je 0x341b4
leaq 0x10f0(%rsp), %rdi
callq 0x4270
jmp 0x341c9
movq 0x2de6b(%rip), %rcx     # 0x61fc8
movq (%rcx), %rdi
movq %rax, %rbx
leaq 0x1efb9(%rip), %rsi     # 0x53123
movq %r14, %rdx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x4770
movq %rbx, %rax
jmp 0x33ad3
movq %rbp, %rdi
callq 0x5691
jmp 0x33c6f
movq %r15, %rdx
movq 0x38(%rsp), %rbx
movl 0x2c(%rsp), %r15d
movq %r12, 0x28(%rcx)
movq %rax, 0x20(%rcx)
movl $0x1, 0x40(%rdx)
movq 0x18(%rsp), %r12
movl 0x4(%rsp), %r8d
jmp 0x341d6
leaq 0x10f0(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x4330
movl %ebp, %r8d
movq 0x38(%rsp), %rbx
movl 0x2c(%rsp), %r15d
movq 0x48(%r14), %rax
movq 0x10(%rax), %rcx
movq (%rcx,%rbx,8), %rsi
testl %r13d, %r13d
js 0x3420e
cmpl $0x0, 0x8854(%r14)
je 0x3420e
cmpq $0x0, 0x30(%rsi)
je 0x3420e
movq %r12, %rbp
cmpl %r13d, 0x68(%rax)
jne 0x34208
movl $0xffffffff, 0x68(%rax) # imm = 0xFFFFFFFF
incq 0x28(%rsi)
jmp 0x34211
movq %r12, %rbp
testl %r8d, %r8d
jle 0x34592
movq %rbx, %r12
movq 0x10(%rsi), %rax
testl %r15d, %r15d
cmovlel %eax, %r15d
movslq %r15d, %r15
cmpq %r15, %rax
cmovlel %eax, %r15d
movl %r15d, %ecx
subl %r8d, %ecx
xorps %xmm0, %xmm0
cvtsi2sd %ecx, %xmm0
cvtsi2sd %rax, %xmm1
mulsd 0x1c6ac(%rip), %xmm1    # 0x508f8
ucomisd %xmm1, %xmm0
movl $0x1, %ebx
cmovbl %r8d, %ebx
cmovael %eax, %r15d
cmpl $0x0, 0x220(%r14)
jne 0x34283
cmpq $0x0, 0x30(%rsi)
jne 0x34283
cmpl $0x1, %ebx
jne 0x34364
movslq %r15d, %rcx
cmpq %rcx, %rax
jne 0x34364
testl %r13d, %r13d
js 0x342e9
cmpq $0x0, 0x30(%rsi)
movq 0x8(%rsp), %rax
movq (%rax), %rdi
je 0x3430e
movq 0x10(%rdi), %rax
movl %r13d, %ecx
movq (%rax,%rcx,8), %rcx
cmpq $0x0, 0x30(%rcx)
je 0x342ba
cmpl %r13d, 0x68(%rdi)
jne 0x342b6
movl $0xffffffff, 0x68(%rdi) # imm = 0xFFFFFFFF
incq 0x28(%rcx)
movq $0x0, 0x50(%r14)
movl $0x1, 0x64(%r14)
movl 0x10(%rsi), %ecx
movl %ecx, 0x68(%r14)
movl %r13d, 0x60(%r14)
movq (%rax,%r12,8), %rax
movq 0x30(%rax), %rax
movl %r8d, %ecx
leaq (%rax,%rcx), %r14
decq %r14
jmp 0x342f8
movq $0x0, 0x50(%r14)
movq 0x48(%r14), %rdi
xorl %r14d, %r14d
addq $0x38, %rdi
callq 0x43f0
movq %rbp, %rdi
callq 0x43f0
jmp 0x3453f
movl %r8d, %r15d
movq %rsi, %rbx
movl 0x40(%rsi), %edx
movl %r13d, %esi
callq 0x336a6
testq %rax, %rax
je 0x34357
cmpl $0x0, 0x8854(%r14)
movq 0x48(%r14), %rdi
movq 0x10(%rdi), %rax
je 0x343bd
movl %r13d, %ecx
movq (%rax,%rcx,8), %rcx
cmpq $0x0, 0x30(%rcx)
movq %rbx, %rsi
movl %r15d, %r8d
jne 0x342a9
jmp 0x342ba
movq 0x8(%rsp), %rax
movq (%rax), %rdi
jmp 0x343ee
testl %r13d, %r13d
js 0x343c8
movq %rbp, 0x18(%rsp)
movl %r13d, 0x14(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %r13
movq 0x20(%r13), %rdi
movq %rsi, 0x20(%rsp)
movq 0x8(%rsi), %r12
movq %r12, %rsi
callq 0x4750
movq 0x28(%r13), %rdi
testl %eax, %eax
je 0x34404
testq %rdi, %rdi
je 0x34409
callq 0x441e8
testl %eax, %eax
jne 0x3453c
movq 0x20(%rsp), %rax
movq 0x8(%rax), %r12
movq 0x8(%rsp), %rax
movq (%rax), %r13
jmp 0x34409
movq %rbx, %rsi
movl %r15d, %r8d
jmp 0x342ba
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x343de
callq 0x4610
movq $0x0, 0x58(%r14)
movq $0x0, 0x50(%r14)
movl %r13d, 0x60(%r14)
movq 0x48(%r14), %rdi
addq $0x38, %rdi
callq 0x43f0
movq %rbp, %rdi
callq 0x43f0
jmp 0x3453c
testq %rdi, %rdi
jne 0x34431
movq %r12, 0x20(%r13)
movq 0x20(%rsp), %rax
movl 0x40(%rax), %esi
movq %r12, %rdi
callq 0x337d2
movq %rax, %rdi
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rdi, 0x28(%rax)
testq %rdi, %rdi
je 0x34495
movq 0x20(%rsp), %rsi
movl %ebx, %edx
movl %r15d, %ecx
callq 0x338a7
movq %rax, 0x50(%r14)
testq %rax, %rax
je 0x34487
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x344ab
callq 0x4610
movq 0x50(%r14), %r12
jmp 0x344ae
movq 0x2db64(%rip), %rax     # 0x61fc8
movq (%rax), %rdi
leaq 0x1ed28(%rip), %rsi     # 0x53196
leaq 0x30f0(%rsp), %rdx
movq %rdx, 0x30(%rsp)
xorl %eax, %eax
callq 0x4770
jmp 0x33c0c
movq 0x8(%rsp), %rax
movq (%rax), %rdi
addq $0x38, %rdi
jmp 0x3449c
addq $0x38, %rax
movq %rax, %rdi
callq 0x43f0
movq 0x18(%rsp), %rdi
jmp 0x343fa
movq %rax, %r12
movl 0x14(%rsp), %eax
movl %eax, 0x60(%r14)
movl %ebx, 0x64(%r14)
movl %r15d, 0x68(%r14)
movq %r12, 0x58(%r14)
movq 0x48(%r14), %rdi
addq $0x38, %rdi
callq 0x43f0
movq 0x18(%rsp), %rdi
callq 0x43f0
movl 0x4(%rsp), %r14d
addq %r12, %r14
movl %ebx, %eax
subq %rax, %r14
jmp 0x3453f
movq 0x2dad9(%rip), %rax     # 0x61fc8
movq (%rax), %rdi
leaq 0x1ed43(%rip), %rsi     # 0x5323c
leaq 0xf0(%rsp), %rdx
xorl %eax, %eax
callq 0x4770
jmp 0x33fab
callq 0x56ba
movq 0x18(%rsp), %r12
movq %rbx, %rdi
callq 0x474b5
leaq 0x10f0(%rsp), %rdi
callq 0x4270
movl %r13d, %edi
movq 0x8(%rsp), %rsi
movq %r12, %rdx
callq 0x56df
xorl %r14d, %r14d
movq %r14, %rax
addq $0x40f8, %rsp           # imm = 0x40F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xf0(%rsp), %rdi
callq 0x4440
jmp 0x34125
movq 0x2da5b(%rip), %rax     # 0x61fc8
movq (%rax), %rdi
leaq 0x1ec52(%rip), %rsi     # 0x531c9
leaq 0x20f0(%rsp), %rdx
xorl %eax, %eax
callq 0x4770
jmp 0x33f79
movq 0x18(%rsp), %r12
jmp 0x3452c
leaq 0x1e8aa(%rip), %rdi     # 0x52e43
leaq 0x1e67e(%rip), %rsi     # 0x52c1e
leaq 0x1e8a7(%rip), %rcx     # 0x52e4e
movl $0xa73, %edx            # imm = 0xA73
callq 0x4350