// File: /workspace/github_cpp_makefile_star2_O3/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
pushq %rax
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
movl $0x4, %ecx
movl $0x4, %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 0x1a24
movq %rdi, %rbx
andl $-0x4, %r15d
cmpl $0x10, %eax
cmovbl %ecx, %r15d
movq %r15, %rdi
callq 0x1090
testq %rax, %rax
je 0x1a1f
movq %rax, %r14
movq %rax, %rdi
movl $0xaa, %esi
movq %r15, %rdx
callq 0x1050
movl (%rbx), %edi
cmpl %r13d, %edi
jae 0x18f9
movq 0x18(%rbx), %rdi
movl %r13d, %esi
shlq $0x3, %rsi
callq 0x10c0
testq %rax, %rax
je 0x1a17
movq %rax, 0x18(%rbx)
movl (%rbx), %edi
testl %edi, %edi
je 0x19fb
leal -0x1(%r13), %eax
xorl %edx, %edx
movq 0x10(%rbx), %rsi
movl %edx, %r8d
shrl $0x4, %r8d
movl (%rsi,%r8,4), %r9d
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %r9d, %r10d
shrl %cl, %r10d
testb $0x3, %r10b
jne 0x19d8
movq 0x18(%rbx), %rdi
movl %edx, %r10d
movq (%rdi,%r10,8), %rdi
btsl %ecx, %r9d
movl %r9d, (%rsi,%r8,4)
movl %eax, %r9d
andl %edi, %r9d
movl %r9d, %r8d
shrl $0x4, %r8d
movl (%r14,%r8,4), %r10d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl $0x2, %r11d
shll %cl, %r11d
testl %r10d, %r11d
jne 0x198c
movl $0x1, %r15d
addl %r15d, %r9d
andl %eax, %r9d
movl %r9d, %r8d
leal (%r9,%r9), %ecx
andl $0x1e, %ecx
movl $0x2, %r11d
shll %cl, %r11d
shrl $0x4, %r8d
movl (%r14,%r8,4), %r10d
incl %r15d
testl %r10d, %r11d
je 0x1963
notl %r11d
andl %r10d, %r11d
movl %r11d, (%r14,%r8,4)
movl %r9d, %r10d
cmpl (%rbx), %r9d
jae 0x19ce
movl (%rsi,%r8,4), %r9d
shrl %cl, %r9d
movq 0x18(%rbx), %rsi
testb $0x3, %r9b
jne 0x19d2
movq (%rsi,%r10,8), %r9
movq %rdi, (%rsi,%r10,8)
movl $0x1, %edi
shll %cl, %edi
movq 0x10(%rbx), %rsi
orl %edi, (%rsi,%r8,4)
movq %r9, %rdi
jmp 0x1937
movq 0x18(%rbx), %rsi
movq %rdi, (%rsi,%r10,8)
movl (%rbx), %edi
incl %edx
cmpl %edi, %edx
jne 0x18ff
cmpl %r13d, %edi
jbe 0x19fb
movq 0x18(%rbx), %rdi
movl %r13d, %esi
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 %r12d, 0xc(%rbx)
jmp 0x1a24
movq %r14, %rdi
callq 0x1070
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq