// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rdx, 0x18(%rsp)
movl %esi, 0x8(%rsp)
movl %edi, 0x4(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
andq $0x0, 0x30(%rsp)
testl %r8d, %r8d
jle 0x6bd8
movq %r9, %r13
movl %r8d, %ebp
movl %ecx, %r14d
movl %r8d, %r12d
xorl %ebx, %ebx
xorl %r15d, %r15d
cmpq %rbx, %r12
je 0x6a04
movq (%r13,%rbx,8), %rdi
callq 0x2130
addq %rax, %r15
incq %rbx
jmp 0x69ed
xorl %eax, %eax
cmpl $0x0, 0x18(%rsp)
setne %al
leal 0x4(%rax), %ecx
cmpq $0x0, 0xa0(%rsp)
cmovnel %eax, %ecx
testl %r14d, %r14d
pushq $0xe
popq %rdx
cmovnsl %r14d, %edx
movl 0x4(%rsp), %edi
movl 0x8(%rsp), %esi
callq 0x58d0
movq %rax, %rbx
movl %ebp, 0x10(%rax)
movq 0x50(%rax), %rdi
pushq $0x18
popq %rdx
movq %rdi, 0x48(%rsp)
movq %r12, %rsi
callq 0x10980
movq %rax, 0x60(%rsp)
movq %rax, 0x20(%rbx)
addq $0x7, %r15
shrq $0x3, %r15
pushq $0x4
popq %rsi
movq %r15, %rdi
callq 0x2230
movq %rax, %rbp
movq %rax, 0x28(%rbx)
callq 0x5e55
movq %rbx, 0x10(%rsp)
movq %rax, 0x40(%rsp)
movq %rax, 0x58(%rbx)
xorl %r15d, %r15d
leaq 0x2bd82(%rip), %r14     # 0x32810
xorl %ebx, %ebx
movq %r13, 0x58(%rsp)
movq %r12, 0x50(%rsp)
cmpq %r12, %r15
je 0x6bbc
imulq $0x18, %r15, %r12
addq 0x60(%rsp), %r12
movq (%r13,%r15,8), %r13
cmpq $0x0, 0xa0(%rsp)
je 0x6b16
movq 0xa0(%rsp), %rax
movq (%rax,%r15,8), %rdi
testq %rdi, %rdi
je 0x6b16
callq 0x2130
leaq 0x1(%rax), %rsi
movq 0x48(%rsp), %rdi
callq 0x10afc
movq %rax, (%r12)
movq 0xa0(%rsp), %rcx
movq (%rcx,%r15,8), %rsi
movq %rax, %rdi
callq 0x2090
movq (%r12), %rsi
movq 0x40(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x5e62
cmpl $0x0, 0xc(%rsp)
je 0x6bec
movq %rbx, 0x8(%r12)
movq %r13, %rdi
callq 0x2130
movl %eax, 0x10(%r12)
andl $0x0, 0x14(%r12)
movl %eax, %r12d
leal (,%rbx,4), %edx
xorl %esi, %esi
cmpq %r12, %rsi
jae 0x6b66
movzbl (%r13,%rsi), %ecx
movzbl (%r14,%rcx), %edi
leaq (%rbx,%rsi), %r8
movl %edx, %ecx
andb $0x1c, %cl
shll %cl, %edi
shrq $0x3, %r8
orl %edi, (%rbp,%r8,4)
incq %rsi
addl $0x4, %edx
jmp 0x6b3a
testl %eax, %eax
je 0x6ba7
andq $0x0, 0x20(%rsp)
xorl %edi, %edi
movq %r13, %rsi
movl %eax, %edx
movl 0x4(%rsp), %ecx
movl 0x8(%rsp), %r8d
movl %r15d, %r9d
leaq 0x20(%rsp), %rax
pushq %rax
pushq 0x20(%rsp)
callq 0x119f8
popq %rax
popq %rcx
movl 0x20(%rsp), %esi
movq 0x30(%rsp), %rdx
movq 0x10(%rsp), %rdi
callq 0x6c0b
addq %r12, %rbx
incq %r15
movq 0x58(%rsp), %r13
movq 0x50(%rsp), %r12
jmp 0x6a9a
movq 0x30(%rsp), %rdi
callq 0x2040
pushq $0x1
popq %rsi
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x6935
jmp 0x6bda
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x216bf(%rip), %rdi     # 0x282b2
leaq 0x216bf(%rip), %rsi     # 0x282b9
leaq 0x216c0(%rip), %rcx     # 0x282c1
movl $0x1c1, %edx            # imm = 0x1C1
callq 0x21a0