// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: hts_idx_init
hts_idx_t *hts_idx_init(int n, int fmt, uint64_t offset0, int min_shift, int n_lvls)
{
    hts_idx_t *idx;
    idx = (hts_idx_t*)calloc(1, sizeof(hts_idx_t));
    if (idx == NULL) return NULL;
    idx->fmt = fmt;
    idx->min_shift = min_shift;
    idx->n_lvls = n_lvls;
    idx->n_bins = ((1<<(3 * n_lvls + 3)) - 1) / 7;
    idx->z.save_tid = idx->z.last_tid = -1;
    idx->z.save_bin = idx->z.last_bin = 0xffffffffu;
    idx->z.save_off = idx->z.last_off = idx->z.off_beg = idx->z.off_end = offset0;
    idx->z.last_coor = 0xffffffffu;
    if (n) {
        idx->n = idx->m = n;
        idx->bidx = (bidx_t**)calloc(n, sizeof(bidx_t*));
        if (idx->bidx == NULL) { free(idx); return NULL; }
        idx->lidx = (lidx_t*) calloc(n, sizeof(lidx_t));
        if (idx->lidx == NULL) { free(idx->bidx); free(idx); return NULL; }
    }
    idx->tbi_n = -1;
    idx->last_tbi_tid = -1;
    idx->otf_fp = NULL;
    return idx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl $0x1, %edi
movl $0xa0, %esi
callq 0x42f0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1ecf0
movq $0x0, -0x8(%rbp)
jmp 0x1ee54
movl -0x10(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movl -0x1c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x4(%rax)
movl -0x20(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
imull $0x3, -0x20(%rbp), %ecx
addl $0x3, %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x58(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x5c(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x48(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x4c(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x80(%rax)
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x28(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x28(%rbp), %rax
movq %rcx, 0x70(%rax)
movq -0x28(%rbp), %rax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rcx, 0x50(%rax)
cmpl $0x0, -0xc(%rbp)
je 0x1ee27
movl -0xc(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x28(%rbp), %rax
movl %ecx, 0x14(%rax)
movslq -0xc(%rbp), %rdi
movl $0x8, %esi
callq 0x42f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x1ede1
movq -0x28(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
jmp 0x1ee54
movslq -0xc(%rbp), %rdi
movl $0x18, %esi
callq 0x42f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0x1ee25
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x45a0
movq -0x28(%rbp), %rdi
callq 0x45a0
movq $0x0, -0x8(%rbp)
jmp 0x1ee54
jmp 0x1ee27
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x40(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movl $0xffffffff, 0x44(%rax) # imm = 0xFFFFFFFF
movq -0x28(%rbp), %rax
movq $0x0, 0x98(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop