// File: /workspace/github_cpp_makefile_star2_O2/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
subq $0x18, %rsp
movq %rdi, %rbx
xorl %eax, %eax
movl %esi, %ecx
cmpl $0x2, %ecx
jb 0x16ac
shrl %ecx
incl %eax
jmp 0x16a1
leal -0x1(%rsi), %ecx
andl %esi, %ecx
cmpl $0x1, %ecx
sbbl $-0x1, %eax
cmpl $0x3, %eax
pushq $0x2
popq %rbp
cmovael %eax, %ebp
pushq $0x1
popq %r13
movl %r13d, %edi
movl %ebp, %ecx
shll %cl, %edi
movl %edi, %ecx
shrl %ecx
movl %edi, %edx
shrl $0x2, %edx
addl %ecx, %edx
xorl %r12d, %r12d
cmpl %edx, 0x4(%rbx)
ja 0x1839
movl %edi, %ecx
shrl $0x3, %ecx
andl $-0x4, %ecx
cmpl $0x5, %eax
pushq $0x4
popq %rsi
cmovael %ecx, %esi
movq %rdi, %r15
pushq $0x1
popq %rdi
callq 0x1060
pushq $-0x1
popq %r12
testq %rax, %rax
je 0x1839
movq %rax, %r14
movl %ebp, 0x4(%rsp)
movb (%rbx), %cl
movl %r13d, %eax
shll %cl, %eax
xorl %ebp, %ebp
cmpq $0x0, 0x8(%rbx)
cmovnel %eax, %ebp
movl %r15d, %eax
movq %rax, 0x8(%rsp)
cmpl %r15d, %ebp
jae 0x1753
movq 0x10(%rbx), %rdi
movq 0x8(%rsp), %rax
leaq (,%rax,8), %rsi
callq 0x10b0
testq %rax, %rax
je 0x184b
movq %rax, 0x10(%rbx)
movq %r15, 0x10(%rsp)
leal -0x1(%r15), %edi
pushq $0x20
popq %rax
subl 0x4(%rsp), %eax
movl %ebp, %r8d
xorl %edx, %edx
cmpq %r8, %rdx
je 0x1807
movq 0x8(%rbx), %r9
movl %edx, %esi
shrl $0x5, %esi
movl (%r9,%rsi,4), %r11d
movl %r13d, %r12d
movl %edx, %ecx
shll %cl, %r12d
btl %edx, %r11d
jae 0x17ff
movq 0x10(%rbx), %rcx
movq (%rcx,%rdx,8), %r10
notl %r12d
andl %r12d, %r11d
movl %r11d, (%r9,%rsi,4)
imull $0x9e3779b9, %r10d, %esi # imm = 0x9E3779B9
movl %eax, %ecx
shrl %cl, %esi
movl %esi, %r11d
shrl $0x5, %r11d
movl (%r14,%r11,4), %r15d
movl %r13d, %r12d
movl %esi, %ecx
shll %cl, %r12d
btl %esi, %r15d
jae 0x17c8
incl %esi
andl %edi, %esi
jmp 0x17a9
orl %r12d, %r15d
movl %r15d, (%r14,%r11,4)
movl %esi, %ecx
cmpl %ebp, %esi
jae 0x17f7
movq 0x10(%rbx), %rsi
testl %r12d, (%r9,%r11,4)
je 0x17fb
movq (%rsi,%rcx,8), %r15
movq %r10, (%rsi,%rcx,8)
movq 0x8(%rbx), %r9
notl %r12d
andl %r12d, (%r9,%r11,4)
movq %r15, %r10
jmp 0x179e
movq 0x10(%rbx), %rsi
movq %r10, (%rsi,%rcx,8)
incq %rdx
jmp 0x1768
cmpl 0x10(%rsp), %ebp
jbe 0x1823
movq 0x10(%rbx), %rdi
movq 0x8(%rsp), %rsi
shlq $0x3, %rsi
callq 0x10b0
movq %rax, 0x10(%rbx)
movq 0x8(%rbx), %rdi
callq 0x1070
movq %r14, 0x8(%rbx)
movl 0x4(%rsp), %eax
movl %eax, (%rbx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1070
jmp 0x1839