// File: /workspace/github_cpp_makefile_star2_O3/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
movl $0x0, 0x4(%rsp)
testl %edx, %edx
je 0x11e19e
movq %rcx, %rbx
movq %rdi, %r14
movb 0x4(%rdi), %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
shll %cl, %ebp
testl %edx, %edx
jle 0x11e19e
movl %esi, %r12d
notl %ebp
movq %rbp, 0x20(%rsp)
andl (%rbx), %ebp
shlq $0x4, %rbp
addq 0x20(%r14), %rbp
movl %edx, %eax
movq %rax, 0x18(%rsp)
xorl %r15d, %r15d
movl $0x0, 0x4(%rsp)
movq %rbx, 0x8(%rsp)
movq (%rbx,%r15,8), %rax
movb 0x4(%r14), %cl
movq %rax, %r13
shrq %cl, %r13
xorl (%rbx), %eax
testl %eax, 0x20(%rsp)
jne 0x11e1b1
testl %r12d, %r12d
je 0x11e0e3
movq 0x8(%rbp), %rdi
testq %rdi, %rdi
je 0x11e113
movq %r13, %rsi
callq 0x1189d1
cmpl 0x8(%r14), %eax
jne 0x11e190
xorl %eax, %eax
cmpq $0x0, 0x8(%rbp)
setne %al
jmp 0x11e115
movq %r14, %rbx
movl %r12d, %r14d
movq (%rbp), %r12
shlq $0xc, %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x11acf5
movq 0x10(%r12), %rdx
testq %rdx, %rdx
je 0x11e157
movb (%r12), %cl
movl $0x1, %esi
shll %cl, %esi
jmp 0x11e159
xorl %eax, %eax
movq (%rbp), %rdi
shlq $0xc, %r13
orq %rax, %r13
movq %r13, %rsi
leaq 0x14(%rsp), %rdx
callq 0x11e1d0
cmpl $0x1, 0x14(%rsp)
sbbl $-0x1, 0x4(%rsp)
movq (%rbp), %rcx
movq 0x10(%rcx), %rcx
movl %eax, %edx
movq (%rcx,%rdx,8), %rax
movl %eax, %esi
notl %esi
testl $0xfff, %esi            # imm = 0xFFF
je 0x11e190
leaq (%rcx,%rdx,8), %rcx
jmp 0x11e18a
xorl %esi, %esi
cmpl %esi, %eax
movl %r14d, %r12d
jne 0x11e165
movq %rbx, %r14
jmp 0x11e17a
movl %eax, %ecx
movq (%rdx,%rcx,8), %rax
movl %eax, %esi
notl %esi
testl $0xfff, %esi            # imm = 0xFFF
movq %rbx, %r14
jne 0x11e181
movq 0x8(%rsp), %rbx
jmp 0x11e190
leaq (%rdx,%rcx,8), %rcx
movq 0x8(%rsp), %rbx
incq %rax
movq %rax, (%rcx)
incq %r15
cmpq %r15, 0x18(%rsp)
jne 0x11e09d
movl 0x4(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x11bbda(%rip), %rdi    # 0x239d92
leaq 0x11bb80(%rip), %rsi    # 0x239d3f
leaq 0x11c3e0(%rip), %rcx    # 0x23a5a6
movl $0xc3, %edx
callq 0x2110