// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/khashpp/./khash.hpp
// Function: klib::KHash<aux_t, aux_hash, aux_eq, unsigned int>::resize(unsigned int)
int resize(khint_t new_n_buckets) {
		uint32_t *new_flags = 0;
		khint_t j = 1;
		{
			kroundup32(new_n_buckets);
			if (new_n_buckets < 4) new_n_buckets = 4;
			if (count >= (new_n_buckets>>1) + (new_n_buckets>>2)) j = 0;	/* requested count is too small */
			else { /* hash table count to be changed (shrink or expand); rehash */
				new_flags = (uint32_t*)std::malloc(__ac_fsize(new_n_buckets) * sizeof(uint32_t));
				if (!new_flags) return -1;
				::memset(new_flags, 0xaa, __ac_fsize(new_n_buckets) * sizeof(uint32_t));
				if (n_buckets < new_n_buckets) {	/* expand */
					T *new_keys = (T*)std::realloc((void *)keys, new_n_buckets * sizeof(T));
					if (!new_keys) { std::free(new_flags); return -1; }
					keys = new_keys;
				} /* otherwise shrink */
			}
		}
		if (j) { /* rehashing is needed */
			for (j = 0; j != n_buckets; ++j) {
				if (__ac_iseither(flags, j) == 0) {
					T key = keys[j];
					khint_t new_mask;
					new_mask = new_n_buckets - 1;
					__ac_set_isdel_true(flags, j);
					while (1) { /* kick-out process; sort of like in Cuckoo hashing */
						khint_t k, i, step = 0;
						k = Hash()(key);
						i = k & new_mask;
						while (!__ac_isempty(new_flags, i)) i = (i + (++step)) & new_mask;
						__ac_set_isempty_false(new_flags, i);
						if (i < n_buckets && __ac_iseither(flags, i) == 0) { /* kick out the existing element */
							{ T tmp = keys[i]; keys[i] = key; key = tmp; }
							__ac_set_isdel_true(flags, i); /* mark it as deleted in the old hash table */
						} else { /* write the element and jump out of the loop */
							keys[i] = key;
							break;
						}
					}
				}
			}
			if (n_buckets > new_n_buckets) /* shrink the hash table */
				keys = (T*)std::realloc((void *)keys, new_n_buckets * sizeof(T));
			std::free(flags); /* free the working space */
			flags = new_flags;
			n_buckets = new_n_buckets;
			n_occupied = count;
			upper_bound = (n_buckets>>1) + (n_buckets>>2);
		}
		return 0;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
decl %esi
movl %esi, %eax
shrl %eax
orl %esi, %eax
movl %eax, %ecx
shrl $0x2, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x4, %eax
orl %ecx, %eax
movl %eax, %ecx
shrl $0x8, %ecx
orl %eax, %ecx
movl %ecx, %eax
shrl $0x10, %eax
orl %ecx, %eax
incl %eax
cmpl $0x5, %eax
pushq $0x4
popq %rcx
movl %ecx, %r13d
cmovael %eax, %r13d
movl %r13d, %r12d
shrl %r12d
movl %r13d, %r15d
shrl $0x2, %r15d
addl %r15d, %r12d
xorl %ebp, %ebp
cmpl %r12d, 0x4(%rdi)
jae 0x18d8
movq %rdi, %rbx
andl $-0x4, %r15d
cmpl $0x10, %eax
cmovbl %ecx, %r15d
movq %r15, %rdi
callq 0x1090
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x18d8
movq %rax, %r14
movq %rax, %rdi
movl $0xaa, %esi
movq %r15, %rdx
callq 0x1050
movl %r13d, %eax
movq %rax, 0x10(%rsp)
cmpl %r13d, (%rbx)
jae 0x17d0
movq 0x18(%rbx), %rdi
movq 0x10(%rsp), %rax
leaq (,%rax,8), %rsi
callq 0x10c0
testq %rax, %rax
je 0x18e9
movq %rax, 0x18(%rbx)
movl %r12d, 0xc(%rsp)
leal -0x1(%r13), %edx
xorl %eax, %eax
pushq $0x2
popq %r12
pushq $0x1
popq %rdi
cmpl (%rbx), %eax
je 0x189e
movq 0x10(%rbx), %r8
movl %eax, %r10d
shrl $0x4, %r10d
movl (%r8,%r10,4), %r11d
leal (%rax,%rax), %ecx
andl $0x1e, %ecx
movl %r11d, %esi
shrl %cl, %esi
testb $0x3, %sil
jne 0x1897
movq 0x18(%rbx), %rsi
movl %eax, %r9d
movq (%rsi,%r9,8), %r9
btsl %ecx, %r11d
movl %r11d, (%r8,%r10,4)
xorl %ebp, %ebp
movl %r9d, %r11d
andl %edx, %r11d
movl %r11d, %r10d
shrl $0x4, %r10d
movl (%r14,%r10,4), %r15d
leal (%r11,%r11), %ecx
andl $0x1e, %ecx
movl %r12d, %esi
shll %cl, %esi
testl %r15d, %esi
jne 0x1853
addl %ebp, %r11d
incl %r11d
movl %ebp, %ecx
incl %ecx
movl %ecx, %ebp
jmp 0x1826
notl %esi
andl %esi, %r15d
movl %r15d, (%r14,%r10,4)
movl %r11d, %ebp
cmpl (%rbx), %r11d
jae 0x188f
movl (%r8,%r10,4), %esi
shrl %cl, %esi
movq 0x18(%rbx), %r8
testb $0x3, %sil
jne 0x1893
movq (%r8,%rbp,8), %rsi
movq %r9, (%r8,%rbp,8)
movl %edi, %r9d
shll %cl, %r9d
movq 0x10(%rbx), %r8
orl %r9d, (%r8,%r10,4)
movq %rsi, %r9
jmp 0x1821
movq 0x18(%rbx), %r8
movq %r9, (%r8,%rbp,8)
incl %eax
jmp 0x17e2
cmpl %r13d, %eax
jbe 0x18b9
movq 0x18(%rbx), %rdi
movq 0x10(%rsp), %rsi
shlq $0x3, %rsi
callq 0x10c0
movq %rax, 0x18(%rbx)
movq 0x10(%rbx), %rdi
callq 0x1070
movq %r14, 0x10(%rbx)
movl %r13d, (%rbx)
movl 0x4(%rbx), %eax
movl %eax, 0x8(%rbx)
movl 0xc(%rsp), %eax
movl %eax, 0xc(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1070
jmp 0x18d8