// File: chhylp123[P]hifiasm/inter.cpp
// Function: clear_count_buf(ug_trans_t*, unsigned int, unsigned int)
void clear_count_buf(ug_trans_t *s, uint32_t tid, uint32_t free_count)
{
	// fprintf(stderr, "[M::%s]\n", __func__);
	ha_ovec_buf_t *b = s->hab[tid];
	destory_fake_cigar(&(b->tmp_region.f_cigar));
	free(b->tmp_region.w_list.a); free(b->tmp_region.w_list.c.a);
	memset(&(b->tmp_region), 0, sizeof(b->tmp_region));
	init_fake_cigar(&(b->tmp_region.f_cigar));
	memset(&(b->tmp_region.w_list), 0, sizeof(b->tmp_region.w_list));
	CALLOC(b->tmp_region.w_list.a, 1); b->tmp_region.w_list.n = b->tmp_region.w_list.m = 1;

	ha_abufl_destroy(b->abl); b->abl = ha_abufl_init();

	kv_destroy(b->sp); memset(&(b->sp), 0, sizeof((b->sp)));
	if(free_count) return;

	destory_Candidates_list(&b->clist); 
	memset((&(b->clist)), 0, sizeof(b->clist));
	init_Candidates_list(&b->clist);

    destory_overlap_region_alloc(&b->olist); 
	memset((&(b->olist)), 0, sizeof(b->olist));
	init_overlap_region_alloc(&b->olist);

	destory_UC_Read(&b->self_read);
	memset((&(b->self_read)), 0, sizeof(b->self_read));
	init_UC_Read(&b->self_read);

    destory_UC_Read(&b->ovlp_read);
	memset((&(b->ovlp_read)), 0, sizeof(b->ovlp_read));
	init_UC_Read(&b->ovlp_read);

	destory_Correct_dumy(&b->correct);
	memset((&(b->correct)), 0, sizeof(b->correct));
	init_Correct_dumy(&b->correct);

	destroy_bit_extz_t(&(b->exz));
	memset((&(b->exz)), 0, sizeof(b->exz));
	init_bit_extz_t(&(b->exz), 31);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movl -0xc(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x121a0, %rdi          # imm = 0x121A0
addq $0x38, %rdi
callq 0x1e2c0
movq -0x18(%rbp), %rax
movq 0x121f8(%rax), %rdi
callq 0x2210
movq -0x18(%rbp), %rax
movq 0x12210(%rax), %rdi
callq 0x2210
movq -0x18(%rbp), %rdi
addq $0x121a0, %rdi          # imm = 0x121A0
xorl %esi, %esi
movl $0xa8, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
addq $0x121a0, %rdi          # imm = 0x121A0
addq $0x38, %rdi
callq 0x1e0c0
movq -0x18(%rbp), %rdi
addq $0x121a0, %rdi          # imm = 0x121A0
addq $0x48, %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2100
movl $0x1, %edi
movl $0x20, %esi
callq 0x2140
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x121f8(%rax)
movq -0x18(%rbp), %rax
movq $0x1, 0x121f0(%rax)
movq -0x18(%rbp), %rax
movq $0x1, 0x121e8(%rax)
movq -0x18(%rbp), %rax
movq 0xe8(%rax), %rdi
callq 0x1a0830
callq 0x1a0740
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0xe8(%rax)
movq -0x18(%rbp), %rax
movq 0x12260(%rax), %rdi
callq 0x2210
movq -0x18(%rbp), %rdi
addq $0x12250, %rdi          # imm = 0x12250
xorl %esi, %esi
movl $0x18, %edx
callq 0x2100
cmpl $0x0, -0x10(%rbp)
je 0x2c0bff
jmp 0x2c0d33
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
callq 0x230c0
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
addq $0x48, %rdi
callq 0x23040
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
callq 0x1e220
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
addq $0xa0, %rdi
callq 0x1e000
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x9670
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0x9850
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x9670
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x9850
movq -0x18(%rbp), %rdi
addq $0x2c0, %rdi            # imm = 0x2C0
callq 0x32090
movq -0x18(%rbp), %rdi
addq $0x2c0, %rdi            # imm = 0x2C0
xorl %esi, %esi
movl $0x8d80, %edx           # imm = 0x8D80
callq 0x2100
movq -0x18(%rbp), %rdi
addq $0x2c0, %rdi            # imm = 0x2C0
callq 0x31df0
movq -0x18(%rbp), %rdi
addq $0x12268, %rdi          # imm = 0x12268
callq 0x1c4e0
movq -0x18(%rbp), %rdi
addq $0x12268, %rdi          # imm = 0x12268
xorl %esi, %esi
movl $0xd8, %edx
callq 0x2100
movq -0x18(%rbp), %rdi
addq $0x12268, %rdi          # imm = 0x12268
movl $0x1f, %esi
callq 0x1bfc0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)