// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap/index.c
// Function: mm_idx_load
mm_idx_t *mm_idx_load(FILE *fp)
{
	int i;
	char magic[4];
	uint32_t x[6];
	mm_idx_t *mi;
	if (fread(magic, 1, 4, fp) != 4) return 0;
	if (strncmp(magic, MM_IDX_MAGIC, 4) != 0) return 0;
	if (fread(x, 4, 6, fp) != 6) return 0;
	mi = mm_idx_init(x[0], x[1], x[2]);
	mi->n = x[3], mi->max_occ = x[5];
	fread(&mi->freq_thres, sizeof(float), 1, fp);
	mi->len = (int32_t*)malloc(mi->n * 4);
	fread(mi->len, 4, mi->n, fp);
	if (x[4]) { // has names
		mi->name = (char**)calloc(mi->n, sizeof(char*));
		for (i = 0; i < mi->n; ++i) {
			uint8_t l;
			fread(&l, 1, 1, fp);
			mi->name[i] = (char*)malloc(l + 1);
			fread(mi->name[i], 1, l, fp);
			mi->name[i][l] = 0;
		}
	}
	for (i = 0; i < 1<<mi->b; ++i) {
		mm_idx_bucket_t *b = &mi->B[i];
		uint32_t j, size;
		khint_t k;
		idxhash_t *h;
		fread(&b->n, 4, 1, fp);
		b->p = (uint64_t*)malloc(b->n * 8);
		fread(b->p, 8, b->n, fp);
		fread(&size, 4, 1, fp);
		if (size == 0) continue;
		b->h = h = kh_init(idx);
		kh_resize(idx, h, size);
		for (j = 0; j < size; ++j) {
			uint64_t x[2];
			int absent;
			fread(x, 8, 2, fp);
			k = kh_put(idx, h, x[0], &absent);
			assert(absent);
			kh_val(h, k) = x[1];
		}
	}
	return mi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
leaq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x1, %esi
movl $0x4, %edx
callq 0x2080
cmpq $0x4, %rax
je 0x5669
movq $0x0, -0x8(%rbp)
jmp 0x5961
leaq -0x18(%rbp), %rdi
leaq 0x70c6(%rip), %rsi      # 0xc73a
movl $0x4, %edx
callq 0x2050
cmpl $0x0, %eax
je 0x5690
movq $0x0, -0x8(%rbp)
jmp 0x5961
leaq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
movl $0x6, %edx
callq 0x2080
cmpq $0x6, %rax
je 0x56ba
movq $0x0, -0x8(%rbp)
jmp 0x5961
movl -0x30(%rbp), %edi
movl -0x2c(%rbp), %esi
movl -0x28(%rbp), %edx
callq 0x45c0
movq %rax, -0x38(%rbp)
movl -0x24(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0xc(%rax)
movl -0x1c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x38(%rbp), %rdi
addq $0x1c, %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x2080
movq -0x38(%rbp), %rax
movl 0xc(%rax), %eax
shll $0x2, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x21e0
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x38(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edx
movq -0x10(%rbp), %rcx
movl $0x4, %esi
callq 0x2080
cmpl $0x0, -0x20(%rbp)
je 0x57fa
movq -0x38(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edi
movl $0x8, %esi
callq 0x2150
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x38(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x57f8
movq -0x10(%rbp), %rcx
leaq -0x39(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2080
movzbl -0x39(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x21e0
movq %rax, %rdx
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movzbl -0x39(%rbp), %eax
movl %eax, %edx
movq -0x10(%rbp), %rcx
movl $0x1, %esi
callq 0x2080
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movzbl -0x39(%rbp), %ecx
movb $0x0, (%rax,%rcx)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5767
jmp 0x57fa
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x38(%rbp), %rcx
movl (%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jge 0x5959
movq -0x38(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
addq $0x18, %rdi
movq -0x10(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x2080
movq -0x48(%rbp), %rax
movl 0x18(%rax), %eax
shll $0x3, %eax
movslq %eax, %rdi
callq 0x21e0
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x48(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x48(%rbp), %rax
movslq 0x18(%rax), %rdx
movq -0x10(%rbp), %rcx
movl $0x8, %esi
callq 0x2080
movq -0x10(%rbp), %rcx
leaq -0x50(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2080
cmpl $0x0, -0x50(%rbp)
jne 0x58aa
jmp 0x594b
callq 0x5970
movq %rax, %rcx
movq %rcx, -0x60(%rbp)
movq -0x48(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x60(%rbp), %rdi
movl -0x50(%rbp), %esi
callq 0x5990
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x50(%rbp), %eax
jae 0x5949
leaq -0x70(%rbp), %rdi
movq -0x10(%rbp), %rcx
movl $0x8, %esi
movl $0x2, %edx
callq 0x2080
movq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rsi
leaq -0x74(%rbp), %rdx
callq 0x5e50
movl %eax, -0x54(%rbp)
cmpl $0x0, -0x74(%rbp)
je 0x590c
jmp 0x592b
leaq 0x6e2c(%rip), %rdi      # 0xc73f
leaq 0x6e2c(%rip), %rsi      # 0xc746
movl $0x15b, %edx            # imm = 0x15B
leaq 0x6e28(%rip), %rcx      # 0xc74e
callq 0x2120
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x54(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0x58d1
jmp 0x594b
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x5801
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nop