// File: chhylp123[P]hifiasm/htab.cpp
// Function: ha_pt_gen_dp(hifiasm_opt_t const*, ha_ct_t*, int, int, void const*, All_reads*, int, int)
ha_pt_t *ha_pt_gen_dp(const hifiasm_opt_t *asm_opt, ha_ct_t *ct, int flag, int n_thread, const void *flt_tab, All_reads *rs, int peak_hom, int peak_het)
{
	int low_freq = mz_low_b(peak_hom, peak_het);
	ha_pt_t *pt = ha_pt_gen_count(ct, n_thread); ///key = cnt, val = 0
	ha_count(asm_opt, HAF_COUNT_EXACT|HAF_COUNT_REFINE|flag, !(asm_opt->flag&HA_F_NO_HPC), asm_opt->k_mer_length, asm_opt->mz_win, pt, flt_tab, rs, NULL, 1, &low_freq, 0);
	uint64_t occ = ha_pt_shrink(pt, n_thread);
	if(flag&HAF_RS_WRITE_LEN) flag -= HAF_RS_WRITE_LEN;
	if(flag&HAF_RS_WRITE_SEQ) flag -= HAF_RS_WRITE_SEQ;
	flag |= HAF_RS_READ; pt->tot_pos = 0;
	ha_count(asm_opt, HAF_COUNT_EXACT|flag, !(asm_opt->flag&HA_F_NO_HPC), asm_opt->k_mer_length, asm_opt->mz_win, pt, flt_tab, rs, NULL, 1, NULL, 0);
	// fprintf(stderr, "[M::%s::] counted %lu distinct minimizer k-mers\n", __func__, pt->tot);
	// fprintf(stderr, "[M::%s::] collected %lu minimizers\n\n\n", __func__, pt->tot_pos);
	assert(occ == pt->tot_pos);
	return pt;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x78, %rsp
movl 0x18(%rbp), %eax
movl 0x10(%rbp), %eax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movl 0x10(%rbp), %edi
movl 0x18(%rbp), %esi
callq 0x192010
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x186ef0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
orl $0x101, %esi            # imm = 0x101
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
movq -0x10(%rbp), %rax
movl 0x80(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x94(%rax), %r8d
movq -0x40(%rbp), %r9
movq -0x28(%rbp), %r11
movq -0x30(%rbp), %r10
xorl %eax, %eax
leaq -0x34(%rbp), %rax
xorl %ebx, %ebx
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
movq %rax, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
callq 0x1886f0
movq -0x40(%rbp), %rdi
movl -0x20(%rbp), %esi
callq 0x18a0c0
movq %rax, -0x48(%rbp)
movl -0x1c(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x189fdf
movl -0x1c(%rbp), %eax
subl $0x4, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x189ff3
movl -0x1c(%rbp), %eax
subl $0x8, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
orl $0x10, %eax
movl %eax, -0x1c(%rbp)
movq -0x40(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
orl $0x1, %esi
movq -0x10(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edx
movq -0x10(%rbp), %rax
movl 0x80(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x94(%rax), %r8d
movq -0x40(%rbp), %r9
movq -0x28(%rbp), %r10
movq -0x30(%rbp), %rax
xorl %r11d, %r11d
xorl %r11d, %r11d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movl $0x1, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
callq 0x1886f0
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0x18a08f
jmp 0x18a0ae
leaq 0x200bdb(%rip), %rdi    # 0x38ac71
leaq 0x200862(%rip), %rsi    # 0x38a8ff
movl $0x4cc, %edx            # imm = 0x4CC
leaq 0x200bdb(%rip), %rcx    # 0x38ac84
callq 0x2130
movq -0x40(%rbp), %rax
addq $0x78, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)