// File: chhylp123[P]hifiasm/Trio.cpp
// Function: ha_triobin_list(hifiasm_opt_t const*)
static void ha_triobin_list(const hifiasm_opt_t *opt)
{
	int64_t i;
	khint_t k;
	cstr_ht_t *h;
	assert(R_INF.total_reads < (uint32_t)-1);
	h = cstr_ht_init();
	for (i = 0; i < (int64_t)R_INF.total_reads; ++i) {
		int absent;
		char *str = (char*)calloc(Get_NAME_LENGTH(R_INF, i) + 1, 1);
		strncpy(str, Get_NAME(R_INF, i), Get_NAME_LENGTH(R_INF, i));
		k = cstr_ht_put(h, str, &absent);
		if (absent) kh_val(h, k) = i;
	}
	fprintf(stderr, "[M::%s::%.3f*%.2f] created the hash table for read names\n", __func__, yak_realtime(), yak_cpu_usage());
	ha_triobin_set_list(h, opt->fn_bin_list[0], FATHER);
	ha_triobin_set_list(h, opt->fn_bin_list[1], MOTHER);
	for (k = 0; k < kh_end(h); ++k)
		if (kh_exist(h, k))
			free((char*)kh_key(h, k));
	cstr_ht_destroy(h);
	fprintf(stderr, "[M::%s::%.3f*%.2f] ==> partitioned reads with external lists\n", __func__, yak_realtime(), yak_cpu_usage());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
leaq 0x25aa48(%rip), %rax    # 0x3c52d0
cmpq %rcx, 0x50(%rax)
jae 0x16a890
jmp 0x16a8af
leaq 0x21f741(%rip), %rdi    # 0x389fd8
leaq 0x21f75b(%rip), %rsi    # 0x389ff9
movl $0x14d, %edx            # imm = 0x14D
leaq 0x21f84b(%rip), %rcx    # 0x38a0f5
callq 0x2130
callq 0x16a750
movq %rax, -0x20(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
leaq 0x25aa05(%rip), %rcx    # 0x3c52d0
cmpq 0x50(%rcx), %rax
jge 0x16a9a3
leaq 0x25a9f4(%rip), %rax    # 0x3c52d0
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdi
leaq 0x25a9e0(%rip), %rax    # 0x3c52d0
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
subq (%rax,%rcx,8), %rdi
addq $0x1, %rdi
movl $0x1, %esi
callq 0x2140
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x25a9b7(%rip), %rax    # 0x3c52d0
movq 0x8(%rax), %rsi
leaq 0x25a9ac(%rip), %rax    # 0x3c52d0
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
addq (%rax,%rcx,8), %rsi
leaq 0x25a999(%rip), %rax    # 0x3c52d0
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rax,%rcx,8), %rdx
leaq 0x25a985(%rip), %rax    # 0x3c52d0
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
subq (%rax,%rcx,8), %rdx
callq 0x20f0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rsi
leaq -0x24(%rbp), %rdx
callq 0x16a760
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x16a990
movq -0x10(%rbp), %rcx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
jmp 0x16a992
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x16a8c0
movq 0x259636(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0x1b7ca0
movsd %xmm0, -0x38(%rbp)
callq 0x1b7d20
movq -0x40(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0x38(%rbp), %xmm0
leaq 0x21f660(%rip), %rsi    # 0x38a033
leaq 0x21f747(%rip), %rdx    # 0x38a121
movb $0x2, %al
callq 0x22a0
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x1, %edx
callq 0x16b9e0
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movl $0x2, %edx
callq 0x16b9e0
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x16aa37
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x48(%rbp)
jmp 0x16aa3e
xorl %eax, %eax
movl %eax, -0x48(%rbp)
jmp 0x16aa3e
movl -0x44(%rbp), %eax
movl -0x48(%rbp), %ecx
cmpl %ecx, %eax
jae 0x16aa92
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movl -0x14(%rbp), %ecx
shrl $0x5, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0x14(%rbp), %ecx
andl $0x1f, %ecx
shrl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x16aa85
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x14(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x2210
jmp 0x16aa87
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x16aa14
movq -0x20(%rbp), %rdi
callq 0x16a7a0
movq 0x25953e(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
callq 0x1b7ca0
movsd %xmm0, -0x50(%rbp)
callq 0x1b7d20
movq -0x58(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
leaq 0x21f5ec(%rip), %rsi    # 0x38a0b7
leaq 0x21f64f(%rip), %rdx    # 0x38a121
movb $0x2, %al
callq 0x22a0
addq $0x60, %rsp
popq %rbp
retq
nop