// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap/index.c
// Function: mm_idx_dump
void mm_idx_dump(FILE *fp, const mm_idx_t *mi)
{
	uint32_t x[6];
	int i;
	x[0] = mi->w, x[1] = mi->k, x[2] = mi->b, x[3] = mi->n, x[4] = mi->name? 1 : 0, x[5] = mi->max_occ;
	fwrite(MM_IDX_MAGIC, 1, 4, fp);
	fwrite(x, 4, 6, fp);
	fwrite(&mi->freq_thres, sizeof(float), 1, fp);
	fwrite(mi->len, 4, mi->n, fp);
	if (mi->name) {
		for (i = 0; i < mi->n; ++i) {
			uint8_t l;
			l = strlen(mi->name[i]);
			fwrite(&l, 1, 1, fp);
			fwrite(mi->name[i], 1, l, fp);
		}
	}
	for (i = 0; i < 1<<mi->b; ++i) {
		mm_idx_bucket_t *b = &mi->B[i];
		khint_t k;
		idxhash_t *h = (idxhash_t*)b->h;
		uint32_t size = h? h->size : 0;
		fwrite(&b->n, 4, 1, fp);
		fwrite(b->p, 8, b->n, fp);
		fwrite(&size, 4, 1, fp);
		if (size == 0) continue;
		for (k = 0; k < kh_end(h); ++k) {
			uint64_t x[2];
			if (!kh_exist(h, k)) continue;
			x[0] = kh_key(h, k), x[1] = kh_val(h, k);
			fwrite(x, 8, 2, fp);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
xorl %eax, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rcx
leaq 0x7342(%rip), %rdi      # 0xc73a
movl $0x1, %esi
movl $0x4, %edx
callq 0x2290
leaq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x4, %esi
movl $0x6, %edx
callq 0x2290
movq -0x10(%rbp), %rdi
addq $0x1c, %rdi
movq -0x8(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x2290
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, %edx
movq -0x8(%rbp), %rcx
movl $0x4, %esi
callq 0x2290
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x54d4
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jae 0x54d2
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x20e0
movb %al, -0x35(%rbp)
movq -0x8(%rbp), %rcx
leaq -0x35(%rbp), %rdi
movl $0x1, %edx
movq %rdx, %rsi
callq 0x2290
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x34(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movzbl -0x35(%rbp), %eax
movl %eax, %edx
movq -0x8(%rbp), %rcx
movl $0x1, %esi
callq 0x2290
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x546a
jmp 0x54d4
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x10(%rbp), %rcx
movl (%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
cmpl %ecx, %eax
jge 0x5624
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x34(%rbp), %rcx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x552b
movq -0x50(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x74(%rbp)
jmp 0x5532
xorl %eax, %eax
movl %eax, -0x74(%rbp)
jmp 0x5532
movl -0x74(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rdi
addq $0x18, %rdi
movq -0x8(%rbp), %rcx
movl $0x4, %esi
movl $0x1, %edx
callq 0x2290
movq -0x40(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x40(%rbp), %rax
movslq 0x18(%rax), %rdx
movq -0x8(%rbp), %rcx
movl $0x8, %esi
callq 0x2290
movq -0x8(%rbp), %rcx
leaq -0x54(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2290
cmpl $0x0, -0x54(%rbp)
jne 0x5593
jmp 0x5616
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x5614
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x44(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x44(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
je 0x55cc
jmp 0x5609
movq -0x50(%rbp), %rax
movq 0x18(%rax), %rax
movl -0x44(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movl -0x44(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
leaq -0x70(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x8, %esi
movl $0x2, %edx
callq 0x2290
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x559a
jmp 0x5616
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x54db
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)