// File: /workspace/github_cpp_makefile_star2_O3/attractivechaos[P]udb2/khashlpp/./khashl.hpp
// Function: klib::KHashSet<klib::KHashMapBucket<unsigned int, int>, klib::KHashMapHash<klib::KHashMapBucket<unsigned int, int>, aux_hash, unsigned int>, klib::KHashMapEq<klib::KHashMapBucket<unsigned int, int>, std::equal_to<unsigned int>>, unsigned int>::resize(unsigned int)
int resize(khint_t new_nb) {
		uint32_t *new_used = 0;
		khint_t j = 0, x = new_nb, nb, new_bits, new_mask;
		while ((x >>= khint_t(1)) != 0) ++j;
		if (new_nb & (new_nb - 1)) ++j;
		new_bits = j > 2? j : 2;
		new_nb = khint_t(1) << new_bits;
		if (count > (new_nb>>1) + (new_nb>>2)) return 0; /* requested size is too small */
		new_used = (uint32_t*)std::malloc(__kh_fsize(new_nb) * sizeof(uint32_t));
		memset(new_used, 0, __kh_fsize(new_nb) * sizeof(uint32_t));
		if (!new_used) return -1; /* not enough memory */
		nb = n_buckets();
		if (nb < new_nb) { /* expand */
			T *new_keys = (T*)std::realloc(keys, new_nb * sizeof(T));
			if (!new_keys) { std::free(new_used); return -1; }
			keys = new_keys;
		} /* otherwise shrink */
		new_mask = new_nb - 1;
		for (j = 0; j != nb; ++j) {
			if (!__kh_used(used, j)) continue;
			T key = keys[j];
			__kh_set_unused(used, j);
			while (1) { /* kick-out process; sort of like in Cuckoo hashing */
				khint_t i;
				i = __kh_h2b(Hash()(key), new_bits);
				while (__kh_used(new_used, i)) i = (i + khint_t(1)) & new_mask;
				__kh_set_used(new_used, i);
				if (i < nb && __kh_used(used, i)) { /* kick out the existing element */
					{ T tmp = keys[i]; keys[i] = key; key = tmp; }
					__kh_set_unused(used, 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 (nb > new_nb) /* shrink the hash table */
			keys = (T*)std::realloc(keys, new_nb * sizeof(T));
		std::free(used); /* free the working space */
		used = new_used, bits = new_bits;
		return 0;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
bsrl %esi, %eax
xorl %ebp, %ebp
cmpl $0x2, %esi
cmovbl %ebp, %eax
leal -0x1(%rsi), %ecx
andl %esi, %ecx
cmpl $0x1, %ecx
sbbl $-0x1, %eax
cmpl $0x3, %eax
movl $0x2, %ebx
cmovael %eax, %ebx
movl $0x1, %r12d
movl %ebx, %ecx
shll %cl, %r12d
movl %r12d, %ecx
shrl %ecx
movl %r12d, %edx
shrl $0x2, %edx
addl %ecx, %edx
cmpl %edx, 0x4(%rdi)
ja 0x1947
movq %rdi, %r14
movl %r12d, %ecx
shrl $0x3, %ecx
andl $-0x4, %ecx
cmpl $0x5, %eax
movl $0x4, %esi
cmovael %ecx, %esi
movl $0x1, %edi
callq 0x1060
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x1947
movq %rax, %r15
movq 0x8(%r14), %rdx
movb (%r14), %cl
movl $0x1, %eax
shll %cl, %eax
xorl %r13d, %r13d
testq %rdx, %rdx
cmovnel %eax, %r13d
cmpl %r12d, %r13d
jae 0x1863
movq %rdx, (%rsp)
movq 0x10(%r14), %rdi
movl %r12d, %esi
shlq $0x3, %rsi
callq 0x10b0
testq %rax, %rax
je 0x1958
movq %rax, 0x10(%r14)
movq (%rsp), %rdx
testq %rdx, %rdx
je 0x191c
leal -0x1(%r12), %edi
movl $0x20, %eax
subl %ebx, %eax
xorl %edx, %edx
movq 0x8(%r14), %r8
movl %edx, %esi
shrl $0x5, %esi
movl (%r8,%rsi,4), %r10d
movl $0x1, %r11d
movl %edx, %ecx
shll %cl, %r11d
btl %edx, %r10d
jae 0x1910
movq 0x10(%r14), %rcx
movq (%rcx,%rdx,8), %r9
notl %r11d
andl %r11d, %r10d
movl %r10d, (%r8,%rsi,4)
imull $0x9e3779b9, %r9d, %esi # imm = 0x9E3779B9
movl %eax, %ecx
shrl %cl, %esi
movl %esi, %r10d
shrl $0x5, %r10d
movl (%r15,%r10,4), %ebp
movl $0x1, %r11d
movl %esi, %ecx
shll %cl, %r11d
btl %esi, %ebp
jae 0x18d6
incl %esi
andl %edi, %esi
jmp 0x18b5
orl %r11d, %ebp
movl %ebp, (%r15,%r10,4)
cmpl %r13d, %esi
jae 0x1906
movq 0x10(%r14), %rcx
testl %r11d, (%r8,%r10,4)
je 0x190a
movl %esi, %esi
movq (%rcx,%rsi,8), %rbp
movq %r9, (%rcx,%rsi,8)
movq 0x8(%r14), %r8
notl %r11d
andl %r11d, (%r8,%r10,4)
movq %rbp, %r9
jmp 0x18aa
movq 0x10(%r14), %rcx
movl %esi, %esi
movq %r9, (%rcx,%rsi,8)
incq %rdx
cmpl %edx, %r13d
jne 0x187a
cmpl %r12d, %r13d
jbe 0x1935
movq 0x10(%r14), %rdi
movl %r12d, %esi
shlq $0x3, %rsi
callq 0x10b0
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rdi
callq 0x1070
movq %r15, 0x8(%r14)
movl %ebx, (%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r15, %rdi
callq 0x1070
jmp 0x1947