// File: /workspace/github_c_makefile_star2_O0/lh3[P]minimap2/index.c
// Function: mm_idx_str
mm_idx_t *mm_idx_str(int w, int k, int is_hpc, int bucket_bits, int n, const char **seq, const char **name)
{
	uint64_t sum_len = 0;
	mm128_v a = {0,0,0};
	mm_idx_t *mi;
	khash_t(str) *h;
	int i, flag = 0;

	if (n <= 0) return 0;
	for (i = 0; i < n; ++i) // get the total length
		sum_len += strlen(seq[i]);
	if (is_hpc) flag |= MM_I_HPC;
	if (name == 0) flag |= MM_I_NO_NAME;
	if (bucket_bits < 0) bucket_bits = 14;
	mi = mm_idx_init(w, k, bucket_bits, flag);
	mi->n_seq = n;
	mi->seq = (mm_idx_seq_t*)kcalloc(mi->km, n, sizeof(mm_idx_seq_t)); // ->seq is allocated from km
	mi->S = (uint32_t*)calloc((sum_len + 7) / 8, 4);
	mi->h = h = kh_init(str);
	for (i = 0, sum_len = 0; i < n; ++i) {
		const char *s = seq[i];
		mm_idx_seq_t *p = &mi->seq[i];
		uint32_t j;
		if (name && name[i]) {
			int absent;
			p->name = (char*)kmalloc(mi->km, strlen(name[i]) + 1);
			strcpy(p->name, name[i]);
			kh_put(str, h, p->name, &absent);
			assert(absent);
		}
		p->offset = sum_len;
		p->len = strlen(s);
		p->is_alt = 0;
		for (j = 0; j < p->len; ++j) {
			int c = seq_nt4_table[(uint8_t)s[j]];
			uint64_t o = sum_len + j;
			mm_seq4_set(mi->S, o, c);
		}
		sum_len += p->len;
		if (p->len > 0) {
			a.n = 0;
			mm_sketch(0, s, p->len, w, k, i, is_hpc, &a);
			mm_idx_add(mi, a.n, a.a);
		}
	}
	free(a.a);
	mm_idx_post(mi, 1);
	return mi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq 0x10(%rbp), %rax
movl %edi, -0xc(%rbp)
movl %esi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq %r9, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x21b0
movl $0x0, -0x60(%rbp)
cmpl $0x0, -0x1c(%rbp)
jg 0x9a15
movq $0x0, -0x8(%rbp)
jmp 0x9d10
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x9a48
movq -0x28(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2130
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x9a1c
cmpl $0x0, -0x14(%rbp)
je 0x9a57
movl -0x60(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x60(%rbp)
cmpq $0x0, 0x10(%rbp)
jne 0x9a67
movl -0x60(%rbp), %eax
orl $0x4, %eax
movl %eax, -0x60(%rbp)
cmpl $0x0, -0x18(%rbp)
jge 0x9a74
movl $0xe, -0x18(%rbp)
movl -0xc(%rbp), %edi
movl -0x10(%rbp), %esi
movl -0x18(%rbp), %edx
movl -0x60(%rbp), %ecx
callq 0x7b90
movq %rax, -0x50(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq 0x50(%rax), %rdi
movslq -0x1c(%rbp), %rsi
movl $0x18, %edx
callq 0x1a790
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x30(%rbp), %rdi
addq $0x7, %rdi
shrq $0x3, %rdi
movl $0x4, %esi
callq 0x2220
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x28(%rax)
callq 0x8570
movq %rax, %rcx
movq %rcx, -0x58(%rbp)
movq -0x50(%rbp), %rax
movq %rcx, 0x58(%rax)
movl $0x0, -0x5c(%rbp)
movq $0x0, -0x30(%rbp)
movl -0x5c(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x9cf1
movq -0x28(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rax
movq 0x20(%rax), %rax
movslq -0x5c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x9bdb
movq 0x10(%rbp), %rax
movslq -0x5c(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x9bdb
movq -0x50(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x90(%rbp)
movq 0x10(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2130
movq -0x90(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x1aae0
movq %rax, %rcx
movq -0x70(%rbp), %rax
movq %rcx, (%rax)
movq -0x70(%rbp), %rax
movq (%rax), %rdi
movq 0x10(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x2090
movq -0x58(%rbp), %rdi
movq -0x70(%rbp), %rax
movq (%rax), %rsi
leaq -0x78(%rbp), %rdx
callq 0x8590
cmpl $0x0, -0x78(%rbp)
je 0x9bba
jmp 0x9bd9
leaq 0x4d2d9(%rip), %rdi     # 0x56e9a
leaq 0x4d2d9(%rip), %rsi     # 0x56ea1
movl $0x1c1, %edx            # imm = 0x1C1
leaq 0x4d2d5(%rip), %rcx     # 0x56ea9
callq 0x21a0
jmp 0x9bdb
movq -0x30(%rbp), %rcx
movq -0x70(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x68(%rbp), %rdi
callq 0x2130
movl %eax, %ecx
movq -0x70(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x70(%rbp), %rax
movl $0x0, 0x14(%rax)
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
movq -0x70(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x9c7d
movq -0x68(%rbp), %rax
movl -0x74(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, %ecx
leaq 0x54bf5(%rip), %rax     # 0x5e820
movzbl (%rax,%rcx), %eax
movl %eax, -0x7c(%rbp)
movq -0x30(%rbp), %rax
movl -0x74(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movl -0x7c(%rbp), %edx
movq -0x88(%rbp), %rax
andq $0x7, %rax
shlq $0x2, %rax
movl %eax, %ecx
shll %cl, %edx
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x88(%rbp), %rcx
shrq $0x3, %rcx
orl (%rax,%rcx,4), %edx
movl %edx, (%rax,%rcx,4)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x9c0b
movq -0x70(%rbp), %rax
movl 0x10(%rax), %eax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x70(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jbe 0x9ce1
movq $0x0, -0x48(%rbp)
movq -0x68(%rbp), %rsi
movq -0x70(%rbp), %rax
movl 0x10(%rax), %edx
movl -0xc(%rbp), %ecx
movl -0x10(%rbp), %r8d
movl -0x5c(%rbp), %r9d
movl -0x14(%rbp), %r10d
xorl %eax, %eax
movl %eax, %edi
leaq -0x48(%rbp), %rax
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1c6c0
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, %esi
movq -0x38(%rbp), %rdx
callq 0x9d20
jmp 0x9ce3
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x9af8
movq -0x38(%rbp), %rdi
callq 0x2040
movq -0x50(%rbp), %rdi
movl $0x1, %esi
callq 0x98f0
movq -0x50(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)