// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/hts.c
// Function: update_loff
static void update_loff(hts_idx_t *idx, int i, int free_lidx)
{
	bidx_t *bidx = idx->bidx[i];
	lidx_t *lidx = &idx->lidx[i];
	khint_t k;
	int l;
	uint64_t offset0 = 0;
	if (bidx) {
		k = kh_get(bin, bidx, idx->n_bins + 1);
		if (k != kh_end(bidx))
			offset0 = kh_val(bidx, k).list[0].u;
		for (l = 0; l < lidx->n && lidx->offset[l] == (uint64_t)-1; ++l)
			lidx->offset[l] = offset0;
	} else l = 1;
	for (; l < lidx->n; ++l) // fill missing values
		if (lidx->offset[l] == (uint64_t)-1)
			lidx->offset[l] = lidx->offset[l-1];
	if (bidx == 0) return;
	for (k = kh_begin(bidx); k != kh_end(bidx); ++k) // set loff
		if (kh_exist(bidx, k))
			kh_val(bidx, k).loff = kh_key(bidx, k) < idx->n_bins? lidx->offset[hts_bin_bot(kh_key(bidx, k), idx->n_lvls)] : 0;
	if (free_lidx) {
		free(lidx->offset);
		lidx->m = lidx->n = 0;
		lidx->offset = 0;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x28(%rdi), %rax
movslq %esi, %rbx
movq (%rax,%rbx,8), %rax
shlq $0x4, %rbx
addq 0x30(%rdi), %rbx
testq %rax, %rax
je 0x6797
movl (%rax), %ecx
testl %ecx, %ecx
je 0x67b1
movl 0xc(%rdi), %r9d
incl %r9d
movq %rcx, (%rsp)
leal -0x1(%rcx), %r11d
movl %r11d, %ebp
andl %r9d, %ebp
movl %r9d, %ecx
shrl $0x3, %ecx
leal (,%r9,8), %r14d
xorl %ecx, %r14d
orl $0x1, %r14d
andl %r11d, %r14d
movq 0x10(%rax), %r15
xorl %r8d, %r8d
movl %ebp, %r10d
movl %r10d, %ecx
shrl $0x4, %ecx
movl (%r15,%rcx,4), %r12d
leal (%r10,%r10), %ecx
andl $0x1e, %ecx
movl %r12d, %r13d
shrl %cl, %r13d
testb $0x2, %r13b
jne 0x67a0
testb $0x1, %r13b
jne 0x678a
movq 0x18(%rax), %r13
movl %r10d, %esi
cmpl %r9d, (%r13,%rsi,4)
je 0x67a0
addl %r14d, %r10d
andl %r11d, %r10d
cmpl %ebp, %r10d
jne 0x6759
jmp 0x67d1
movl (%rbx), %ecx
movl $0x1, %esi
jmp 0x67f4
shrl %cl, %r12d
testb $0x3, %r12b
movq (%rsp), %rcx
cmovnel %ecx, %r10d
jmp 0x67b4
xorl %r10d, %r10d
cmpl %ecx, %r10d
jne 0x67be
xorl %r8d, %r8d
jmp 0x67d1
movq 0x20(%rax), %rcx
movl %r10d, %esi
leaq (%rsi,%rsi,2), %rsi
movq 0x10(%rcx,%rsi,8), %rcx
movq (%rcx), %r8
movl (%rbx), %ecx
testl %ecx, %ecx
jle 0x67f2
movq 0x8(%rbx), %r9
xorl %esi, %esi
cmpq $-0x1, (%r9,%rsi,8)
jne 0x67f4
movq %r8, (%r9,%rsi,8)
incq %rsi
cmpq %rsi, %rcx
jne 0x67dd
jmp 0x6815
xorl %esi, %esi
cmpl %ecx, %esi
jge 0x6815
movq 0x8(%rbx), %r8
movl %esi, %esi
cmpq $-0x1, (%r8,%rsi,8)
jne 0x680e
movq -0x8(%r8,%rsi,8), %r9
movq %r9, (%r8,%rsi,8)
incq %rsi
cmpl %esi, %ecx
jg 0x67fe
testq %rax, %rax
je 0x68d9
movl (%rax), %esi
testq %rsi, %rsi
je 0x68c6
movq 0x10(%rax), %r8
xorl %r9d, %r9d
movl $0x92492493, %r10d      # imm = 0x92492493
movl %r9d, %ecx
shrl $0x4, %ecx
movl (%r8,%rcx,4), %r11d
leal (%r9,%r9), %ecx
shrl %cl, %r11d
testb $0x3, %r11b
jne 0x68ba
movq 0x18(%rax), %rcx
movl (%rcx,%r9,4), %r11d
cmpl 0xc(%rdi), %r11d
jae 0x68ab
xorl %r14d, %r14d
testl %r11d, %r11d
je 0x6877
movl %r11d, %ecx
incl %r14d
decl %ecx
movl %ecx, %ebp
sarl $0x3, %ebp
cmpl $0x7, %ecx
movl %ebp, %ecx
ja 0x6866
leal (%r14,%r14,2), %ecx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
shll %cl, %r15d
movl 0x8(%rdi), %ecx
notl %r15d
imulq %r10, %r15
shrq $0x22, %r15
subl %r15d, %r11d
subl %r14d, %ecx
leal (%rcx,%rcx,2), %ecx
shll %cl, %r11d
movq 0x8(%rbx), %rcx
movslq %r11d, %r11
movq (%rcx,%r11,8), %rcx
jmp 0x68ad
xorl %ecx, %ecx
movq 0x20(%rax), %r14
leaq (%r9,%r9,2), %r11
movq %rcx, 0x8(%r14,%r11,8)
incq %r9
cmpq %rsi, %r9
jne 0x6836
testl %edx, %edx
je 0x68d9
movq 0x8(%rbx), %rdi
callq 0x2050
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq