// File: chhylp123[P]hifiasm/Trio.cpp
// Function: ha_triobin_set_list(cstr_ht_t const*, char const*, int)
static int ha_triobin_set_list(const cstr_ht_t *h, const char *fn, int flag)
{
	gzFile fp;
	kstream_t *ks;
	kstring_t str = {0,0,0};
	int dret;
	int64_t n_tot = 0, n_bin = 0;
	fp = gzopen(fn, "r");
	if (fp == 0) {
		fprintf(stderr, "ERROR: failed to open file '%s'\n", fn);
		return -1;
	}
	ks = ks_init(fp);
	while (ks_getuntil(ks, KS_SEP_LINE, &str, &dret) >= 0) {
		char *p;
		khint_t k;
		++n_tot;
		for (p = str.s; *p; ++p)
			if (*p == '\t' || *p == ' ')
				*p = 0;
		k = cstr_ht_get(h, str.s);
		if (k != kh_end(h)) {
			R_INF.trio_flag[kh_val(h, k)] = flag;
			++n_bin;
		}
	}
	free(str.s);
	ks_destroy(ks);
	gzclose(fp);
	fprintf(stderr, "[M::%s::%.3f*%.2f] flagged %ld reads, out of %ld lines in file '%s'\n",
			__func__, yak_realtime(), yak_cpu_usage(), (long)n_bin, (long)n_tot, fn);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
leaq -0x48(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x2100
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x2249b5(%rip), %rsi    # 0x3903d6
callq 0x22c0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x16ba59
movq 0x2585a8(%rip), %rax    # 0x3c3fe0
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x21e637(%rip), %rsi    # 0x38a07d
movb $0x0, %al
callq 0x22a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x16bbc1
movq -0x28(%rbp), %rdi
callq 0x16a190
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movl $0x2, %esi
leaq -0x48(%rbp), %rdx
leaq -0x4c(%rbp), %rcx
callq 0x16a1e0
cmpl $0x0, %eax
jl 0x16bb4f
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16bad1
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0x16baba
movq -0x68(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x16bac1
movq -0x68(%rbp), %rax
movb $0x0, (%rax)
jmp 0x16bac3
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x16ba99
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x16a7c0
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x16bb04
movq -0x10(%rbp), %rax
movl (%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x74(%rbp)
jmp 0x16bb0b
xorl %eax, %eax
movl %eax, -0x74(%rbp)
jmp 0x16bb0b
movl -0x70(%rbp), %eax
movl -0x74(%rbp), %ecx
cmpl %ecx, %eax
je 0x16bb4a
movl -0x1c(%rbp), %eax
movb %al, %dl
leaq 0x2597af(%rip), %rax    # 0x3c52d0
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
movl -0x6c(%rbp), %esi
shlq $0x4, %rsi
addq %rsi, %rcx
movq 0x8(%rcx), %rcx
movb %dl, (%rax,%rcx)
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x16ba66
movq -0x38(%rbp), %rdi
callq 0x2210
movq -0x30(%rbp), %rdi
callq 0x16a220
movq -0x28(%rbp), %rdi
callq 0x2380
movq 0x25846f(%rip), %rax    # 0x3c3fe0
movq (%rax), %rax
movq %rax, -0x88(%rbp)
callq 0x1b7ca0
movsd %xmm0, -0x80(%rbp)
callq 0x1b7d20
movq -0x88(%rbp), %rdi
movaps %xmm0, %xmm1
movsd -0x80(%rbp), %xmm0
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %r8
movq -0x18(%rbp), %r9
leaq 0x21e585(%rip), %rsi    # 0x38a131
leaq 0x21e5c3(%rip), %rdx    # 0x38a176
movb $0x2, %al
callq 0x22a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)