// File: /workspace/github_cpp_makefile_star2_O2/chhylp123[P]hifiasm/htab.cpp
// Function: ha_ct_insert_list(ha_ct_t*, int, int, unsigned long const*)
static int ha_ct_insert_list(ha_ct_t *h, int create_new, int n, const uint64_t *a)
{
	int j, mask = (1<<h->pre) - 1, n_ins = 0;
	ha_ct1_t *g;
	if (n == 0) return 0;
	///corresponding small hash index
	g = &h->h[a[0]&mask];
	for (j = 0; j < n; ++j) {
		int ins = 1, absent;
		///x is a 64-bit word, h->pre=12
		///all elements at a have the same low 12 bits
		///so low 12 bits are not useful
		uint64_t x = a[j] >> h->pre;
		khint_t k;
		assert((a[j]&mask) == (a[0]&mask));
		if (create_new) {
			if (g->b)
				ins = (yak_bf_insert(g->b, x) == h->n_hash);
			///x = the high 52 bits of a[j] + low 12 bits 0
			///the low 12 bits are used for counting
			if (ins) {
				k = yak_ct_put(g->h, x << YAK_COUNTER_BITS | (g->b? 1 : 0), &absent);
				if (absent) ++n_ins;
				if ((kh_key(g->h, k)&YAK_MAX_COUNT) < YAK_MAX_COUNT)
					++kh_key(g->h, k);
			}
		} else {
			k = yak_ct_get(g->h, x<<YAK_COUNTER_BITS);
			if (k != kh_end(g->h) && (kh_key(g->h, k)&YAK_MAX_COUNT) < YAK_MAX_COUNT)
				++kh_key(g->h, k);
		}
	}
	return n_ins;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
testl %edx, %edx
je 0xda508
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r15d
movb 0x4(%rdi), %cl
pushq $-0x1
popq %rax
shll %cl, %eax
notl %eax
movq %rax, 0x20(%rsp)
movl %eax, %r8d
andl (%rbx), %r8d
shlq $0x4, %r8
addq 0x20(%rdi), %r8
xorl %r14d, %r14d
testl %edx, %edx
cmovlel %r14d, %ebp
movl $0x0, 0x4(%rsp)
movq %r8, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
cmpq %r14, %rbp
je 0xda502
movq (%rbx,%r14,8), %rax
movb 0x4(%rdi), %cl
movq %rax, %r13
shrq %cl, %r13
xorl (%rbx), %eax
testl %eax, 0x20(%rsp)
jne 0xda519
movq %rdi, %r12
testl %r15d, %r15d
je 0xda437
movq 0x8(%r8), %rdi
testq %rdi, %rdi
je 0xda462
movq %r13, %rsi
callq 0xd43e6
cmpl 0x8(%r12), %eax
jne 0xda4b0
xorl %eax, %eax
movq 0x8(%rsp), %r8
cmpq $0x0, 0x8(%r8)
setne %al
jmp 0xda464
movl %r15d, %ebx
movq %rbp, %r15
movq (%r8), %rbp
shlq $0xc, %r13
movq %rbp, %rdi
movq %r13, %rsi
callq 0xd6dee
movq 0x10(%rbp), %rdx
testq %rdx, %rdx
je 0xda4ba
movb (%rbp), %cl
pushq $0x1
popq %rsi
shll %cl, %esi
jmp 0xda4bc
xorl %eax, %eax
movq (%r8), %rdi
shlq $0xc, %r13
orq %rax, %r13
movq %r13, %rsi
leaq 0x1c(%rsp), %rdx
callq 0xda538
movq 0x8(%rsp), %r8
cmpl $0x1, 0x1c(%rsp)
sbbl $-0x1, 0x4(%rsp)
movq (%r8), %rcx
movq 0x10(%rcx), %rcx
movl %eax, %edx
movq (%rcx,%rdx,8), %rax
movl %eax, %esi
notl %esi
testw $0xfff, %si             # imm = 0xFFF
jne 0xda4a7
movq %r12, %rdi
jmp 0xda4fa
leaq (%rcx,%rdx,8), %rcx
movq %r12, %rdi
jmp 0xda4f4
movq %r12, %rdi
movq 0x8(%rsp), %r8
jmp 0xda4fa
xorl %esi, %esi
cmpl %esi, %eax
movq %r15, %rbp
movq %r12, %rdi
movq 0x8(%rsp), %r8
jne 0xda4d0
movl %ebx, %r15d
jmp 0xda4e4
movl %eax, %ecx
movq (%rdx,%rcx,8), %rax
movl %eax, %esi
notl %esi
testw $0xfff, %si             # imm = 0xFFF
movl %ebx, %r15d
jne 0xda4eb
movq 0x10(%rsp), %rbx
jmp 0xda4fa
leaq (%rdx,%rcx,8), %rcx
movq 0x10(%rsp), %rbx
incq %rax
movq %rax, (%rcx)
incq %r14
jmp 0xda3e0
movl 0x4(%rsp), %eax
jmp 0xda50a
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x111752(%rip), %rdi    # 0x1ebc72
leaq 0x1116f8(%rip), %rsi    # 0x1ebc1f
leaq 0x111f58(%rip), %rcx    # 0x1ec486
movl $0xc3, %edx
callq 0x2110