// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq 0x18(%rdi), %rax
movl %esi, %ecx
movq (%rax,%rcx,8), %r12
leaq 0x121a0(%r12), %r14
leaq 0x121d8(%r12), %r15
movq %r15, %rdi
callq 0x3dc09
movq 0x121f8(%r12), %rdi
callq 0x2220
movq 0x12210(%r12), %rdi
callq 0x2220
movl $0xa8, %edx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20e0
movq %r15, %rdi
callq 0x3db21
xorps %xmm0, %xmm0
movups %xmm0, 0x12208(%r12)
movups %xmm0, 0x121f8(%r12)
movups %xmm0, 0x121e8(%r12)
movl $0x1, %r14d
movl $0x1, %edi
movl $0x20, %esi
callq 0x2120
movq %rax, 0x121f8(%r12)
movq %r14, 0x121f0(%r12)
movq %r14, 0x121e8(%r12)
movq 0xe8(%r12), %rdi
callq 0x122b23
callq 0x122a80
movq %rax, 0xe8(%r12)
movq 0x12260(%r12), %rdi
callq 0x2220
xorps %xmm0, %xmm0
movaps %xmm0, 0x12250(%r12)
movq $0x0, 0x12260(%r12)
testl %ebx, %ebx
jne 0x1bc72a
leaq 0x48(%r12), %rbx
movq %rbx, %rdi
callq 0x3fd27
xorps %xmm0, %xmm0
movups %xmm0, 0x88(%r12)
movups %xmm0, 0x78(%r12)
movups %xmm0, 0x68(%r12)
movups %xmm0, 0x58(%r12)
movups %xmm0, 0x48(%r12)
movq $0x0, 0x98(%r12)
movq %rbx, %rdi
callq 0x3fcfd
leaq 0xa0(%r12), %rbx
movq %rbx, %rdi
callq 0x3db85
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%r12)
movaps %xmm0, 0xa0(%r12)
movq %rbx, %rdi
callq 0x3dab1
leaq 0x8(%r12), %rbx
movq %rbx, %rdi
callq 0x33667
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r12)
movups %xmm0, 0x8(%r12)
movq %rbx, %rdi
callq 0x3372c
leaq 0x28(%r12), %rbx
movq %rbx, %rdi
callq 0x33667
xorps %xmm0, %xmm0
movups %xmm0, 0x38(%r12)
movups %xmm0, 0x28(%r12)
movq %rbx, %rdi
callq 0x3372c
leaq 0x2c0(%r12), %rbx
movq %rbx, %rdi
callq 0x481db
movl $0x8d80, %edx           # imm = 0x8D80
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20e0
movq %rbx, %rdi
callq 0x4808b
leaq 0x12268(%r12), %rbx
movq 0x122a8(%r12), %rdi
callq 0x2220
movq 0x12338(%r12), %rdi
callq 0x2220
movq 0x12320(%r12), %rdi
callq 0x2220
movl $0xd8, %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20e0
cmpl $0x7e, 0x122a4(%r12)
jg 0x1bc72a
movl $0x30, 0x122a4(%r12)
cmpl $0x2f, 0x122a0(%r12)
ja 0x1bc71e
movq 0x122a8(%r12), %rdi
movl $0x180, %esi            # imm = 0x180
callq 0x2370
movq %rax, 0x122a8(%r12)
movl 0x122a4(%r12), %edx
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rdx, %rcx
movq %rcx, %rdx
shrq $0x20, %rdx
shrq $0x23, %rcx
movl %ecx, 0x122a4(%r12)
movq %rax, 0x122b0(%r12)
andl $-0x8, %edx
leaq (%rax,%rdx), %rsi
movq %rsi, 0x122b8(%r12)
leal (%rcx,%rcx), %esi
leaq (%rax,%rsi,8), %rdi
movq %rdi, 0x122c0(%r12)
leal (%rcx,%rcx,2), %edi
leaq (%rax,%rdi,8), %rdi
movq %rdi, 0x122c8(%r12)
leal (,%rcx,4), %edi
leaq (%rax,%rdi,8), %r8
movq %r8, 0x122d0(%r12)
leal (%rcx,%rcx,4), %r8d
leaq (%rax,%r8,8), %r9
movq %r9, 0x122d8(%r12)
leal (%rsi,%rsi,2), %r9d
leaq (%rax,%r9,8), %r9
movq %r9, 0x122e0(%r12)
leal (,%rcx,8), %r9d
subl %ecx, %r9d
leaq (%rax,%r9,8), %r9
movq %r9, 0x122e8(%r12)
leaq (%rax,%rdx,8), %rdx
movq %rdx, 0x122f0(%r12)
leal (%rcx,%rcx,8), %edx
leaq (%rax,%rdx,8), %rdx
movq %rdx, 0x122f8(%r12)
leal (%rsi,%rsi,4), %edx
leaq (%rax,%rdx,8), %rdx
movq %rdx, 0x12300(%r12)
leal (%rcx,%r8,2), %edx
leaq (%rax,%rdx,8), %rax
movq %rax, 0x12308(%r12)
leal (%rdi,%rdi,2), %eax
movl %eax, 0x122a0(%r12)
movl %ecx, 0x1229c(%r12)
movl $0x7f, 0x122a4(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq