// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hts.c
// Function: hts_idx_load3
hts_idx_t *hts_idx_load3(const char *fn, const char *fnidx, int fmt, int flags)
{
    const char *local_fn = NULL;
    char *local_fnidx = NULL;
    int local_len;
    if (!fnidx)
        return idx_find_and_load(fn, fmt, flags);

    // Check that the index file is up to date, the main file might have changed
    struct stat stat_idx,stat_main;
    int remote_fn = hisremote(fn), remote_fnidx = hisremote(fnidx);
    if ( !remote_fn && !remote_fnidx
         && !stat(fn, &stat_main) && !stat(fnidx, &stat_idx) )
    {
        if ( stat_idx.st_mtime < stat_main.st_mtime )
            hts_log_warning("The index file is older than the data file: %s", fnidx);
    }

    if (remote_fnidx && (flags & HTS_IDX_SAVE_REMOTE))
    {
        int ret = idx_test_and_fetch(fnidx, &local_fn, &local_len, 1);
        if (ret == 0) {
            local_fnidx = strdup(local_fn);
            if (local_fnidx) {
                local_fnidx[local_len] = '\0';
                fnidx = local_fnidx;
            }
        }
    }

    hts_idx_t *idx = idx_read(fnidx);
    if (!idx && !(flags & HTS_IDX_SILENT_FAIL))
        hts_log_error("Could not load local index file '%s'%s%s", fnidx,
                      errno ? " : " : "", errno ? strerror(errno) : "");


    free(local_fnidx);

    return idx;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x25dc8
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
callq 0x25ae0
movq %rax, -0x8(%rbp)
jmp 0x25f81
movq -0x10(%rbp), %rdi
callq 0x15cf0
movl %eax, -0x15c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x15cf0
movl %eax, -0x160(%rbp)
cmpl $0x0, -0x15c(%rbp)
jne 0x25e4f
cmpl $0x0, -0x160(%rbp)
jne 0x25e4f
movq -0x10(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x4410
cmpl $0x0, %eax
jne 0x25e4f
movq -0x18(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x4410
cmpl $0x0, %eax
jne 0x25e4f
movq -0x70(%rbp), %rax
cmpq -0x100(%rbp), %rax
jge 0x25e4d
movq -0x18(%rbp), %rcx
movl $0x3, %edi
leaq 0xcad80(%rip), %rsi     # 0xf0bbf
leaq 0xcad87(%rip), %rdx     # 0xf0bcd
movb $0x0, %al
callq 0x1b030
jmp 0x25e4f
cmpl $0x0, -0x160(%rbp)
je 0x25eb4
movl -0x20(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x25eb4
movq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x34(%rbp), %rdx
movl $0x1, %ecx
callq 0x25f90
movl %eax, -0x164(%rbp)
cmpl $0x0, -0x164(%rbp)
jne 0x25eb2
movq -0x28(%rbp), %rdi
callq 0x4920
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x25eb0
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x25eb2
jmp 0x25eb4
movq -0x18(%rbp), %rdi
callq 0x26610
movq %rax, -0x170(%rbp)
cmpq $0x0, -0x170(%rbp)
jne 0x25f6d
movl -0x20(%rbp), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x25f6d
movq -0x18(%rbp), %rax
movq %rax, -0x180(%rbp)
callq 0x4050
movl (%rax), %edx
leaq 0xca07b(%rip), %rax     # 0xeff75
leaq 0xca24c(%rip), %rcx     # 0xf014d
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x178(%rbp)
callq 0x4050
cmpl $0x0, (%rax)
je 0x25f2e
callq 0x4050
movl (%rax), %edi
callq 0x4130
movq %rax, -0x188(%rbp)
jmp 0x25f3e
leaq 0xca040(%rip), %rax     # 0xeff75
movq %rax, -0x188(%rbp)
jmp 0x25f3e
movq -0x178(%rbp), %r8
movq -0x180(%rbp), %rcx
movq -0x188(%rbp), %r9
movl $0x1, %edi
leaq 0xcac60(%rip), %rsi     # 0xf0bbf
leaq 0xcac96(%rip), %rdx     # 0xf0bfc
movb $0x0, %al
callq 0x1b030
movq -0x30(%rbp), %rdi
callq 0x45a0
movq -0x170(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nop