// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/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, META_BIN(idx));
        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))
        {
            if ( kh_key(bidx, k) < idx->n_bins )
            {
                int bot_bin = hts_bin_bot(kh_key(bidx, k), idx->n_lvls);
                // disable linear index if bot_bin out of bounds
                kh_val(bidx, k).loff = bot_bin < lidx->n ? lidx->offset[bot_bin] : 0;
            }
            else
                kh_val(bidx, k).loff = 0;
        }
    if (free_lidx) {
        free(lidx->offset);
        lidx->m = lidx->n = 0;
        lidx->offset = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0xc(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x746c6
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0xc(%rax), %esi
addl $0x1, %esi
callq 0x760a0
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0x7466e
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rdx
xorl %eax, %eax
cmpl (%rdx), %ecx
movb %al, -0x35(%rbp)
jge 0x7469c
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
cmpq $-0x1, (%rax,%rcx,8)
sete %al
movb %al, -0x35(%rbp)
movb -0x35(%rbp), %al
testb $0x1, %al
jne 0x746a5
jmp 0x746c4
movq -0x30(%rbp), %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x74675
jmp 0x746cd
movl $0x1, -0x28(%rbp)
jmp 0x746cf
movl -0x28(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x7471f
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
cmpq $-0x1, (%rax,%rcx,8)
jne 0x74712
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x28(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x28(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
jmp 0x74714
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x746cf
cmpq $0x0, -0x18(%rbp)
jne 0x7472b
jmp 0x74843
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
je 0x7480f
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x24(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x747ff
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movq -0x8(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x747e3
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x24(%rbp), %ecx
movl (%rax,%rcx,4), %edi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x78520
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x747bf
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
jmp 0x747c7
xorl %eax, %eax
movq %rax, -0x40(%rbp)
jmp 0x747c7
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x24(%rbp), %edx
imulq $0x18, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
jmp 0x747fd
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
jmp 0x747ff
jmp 0x74801
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x74732
cmpl $0x0, -0x10(%rbp)
je 0x74843
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x6880
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, 0x4(%rax)
movq -0x20(%rbp), %rax
movq $0x0, 0x8(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)