// File: /workspace/github_c_makefile_star2_O0/lh3[P]miniprot/index.c
// Function: mp_idx_restore
mp_idx_t *mp_idx_restore(const char *fn)
{
	FILE *fp;
	char magic[4];
	mp_idx_t *mi;

	fp = strcmp(fn, "-") == 0? stdin : fopen(fn, "rb");
	if (fp == 0) return 0;
	fread(magic, 1, 4, fp);
	if (strncmp(magic, MP_IDX_MAGIC, 4) != 0)
		return 0;
	mi = Kcalloc(0, mp_idx_t, 1);
	fread(&mi->opt, sizeof(mi->opt), 1, fp);
	ns_make_tables(mi->opt.trans_code);
	fread(&mi->n_kb, 8, 1, fp);
	mi->nt = mp_ntseq_restore(fp);
	mi->ki = Kmalloc(0, int64_t, mp_n_bucket(&mi->opt));
	mi->kb = Kmalloc(0, uint32_t, mi->n_kb);
	fread(mi->ki, 8, mp_n_bucket(&mi->opt), fp);
	fread(mi->kb, 4, mi->n_kb, fp);
	if (fp != stdin) fclose(fp);
	mi->bo = mp_idx_boff(mi->nt, mi->opt.bbit, &mi->n_block);
	if (mp_verbose >= 3)
		fprintf(stderr, "[M::%s@%.3f*%.2f] loaded the index\n", __func__, mp_realtime(), mp_percent_cpu());
	return mi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1b82e(%rip), %rsi     # 0x21575
callq 0x21d0
cmpl $0x0, %eax
jne 0x5d61
movq 0x20280(%rip), %rax     # 0x25fd8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x5d75
movq -0x10(%rbp), %rdi
leaq 0x1b776(%rip), %rsi     # 0x214e2
callq 0x22d0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x5d91
movq $0x0, -0x8(%rbp)
jmp 0x5f57
leaq -0x1c(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x20b0
leaq -0x1c(%rbp), %rdi
leaq 0x1b72a(%rip), %rsi     # 0x214dd
movl $0x4, %edx
callq 0x2060
cmpl $0x0, %eax
je 0x5dcf
movq $0x0, -0x8(%rbp)
jmp 0x5f57
xorl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
movl $0x40, %edx
callq 0xab60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x14, %esi
movl $0x1, %edx
callq 0x20b0
movq -0x28(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x3bf0
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x20b0
movq -0x18(%rbp), %rdi
callq 0x16de0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rdi
callq 0x5b60
movl %eax, %eax
movl %eax, %esi
shlq $0x3, %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0xaeb0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rsi
shlq $0x2, %rsi
xorl %eax, %eax
movl %eax, %edi
callq 0xaeb0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
callq 0x5b60
movq -0x38(%rbp), %rdi
movl %eax, %eax
movl %eax, %edx
movq -0x18(%rbp), %rcx
movl $0x8, %esi
callq 0x20b0
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x20(%rax), %rdx
movq -0x18(%rbp), %rcx
movl $0x4, %esi
callq 0x20b0
movq -0x18(%rbp), %rax
movq 0x20107(%rip), %rcx     # 0x25fd8
cmpq (%rcx), %rax
je 0x5edf
movq -0x18(%rbp), %rdi
callq 0x2100
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x28(%rbp), %rax
movl (%rax), %esi
movq -0x28(%rbp), %rdx
addq $0x14, %rdx
callq 0x5100
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
leaq 0x207cc(%rip), %rax     # 0x266d8
cmpl $0x3, (%rax)
jl 0x5f4f
movq 0x200e0(%rip), %rax     # 0x25ff8
movq (%rax), %rax
movq %rax, -0x48(%rbp)
callq 0x41a0
movsd %xmm0, -0x40(%rbp)
callq 0x4210
movq -0x48(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0x40(%rbp), %xmm0
leaq 0x1b5a4(%rip), %rsi     # 0x214e5
leaq 0x1b5c1(%rip), %rdx     # 0x21509
movb $0x2, %al
callq 0x21f0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)