// File: /workspace/github_cpp_makefile_star2_O1/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
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, %ecx
cmovael %eax, %ecx
movl $0x1, %r13d
movl %ecx, 0xc(%rsp)
shll %cl, %r13d
movl %r13d, %ecx
shrl %ecx
movl %r13d, %edx
shrl $0x2, %edx
addl %ecx, %edx
cmpl %edx, 0x4(%rdi)
ja 0x19e4
movq %rdi, %r14
movl %r13d, %ecx
shrl $0x3, %ecx
andl $-0x4, %ecx
cmpl $0x5, %eax
movl $0x4, %r12d
cmovael %ecx, %r12d
movq %r12, %rdi
callq 0x1090
movq %rax, %r15
xorl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
movq %r12, %rdx
callq 0x1050
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %r15, %r15
je 0x19e4
movq 0x8(%r14), %rax
movb (%r14), %cl
movl $0x1, %r12d
shll %cl, %r12d
testq %rax, %rax
cmovel %ebx, %r12d
cmpl %r13d, %r12d
jae 0x18c3
movq %rax, %rbx
movq 0x10(%r14), %rdi
movl %r13d, %esi
shlq $0x3, %rsi
callq 0x10c0
testq %rax, %rax
je 0x18a5
movq %rax, 0x10(%r14)
jmp 0x18b7
movq %r15, %rdi
movq %rax, 0x10(%rsp)
callq 0x1070
movq 0x10(%rsp), %rax
testq %rax, %rax
movq %rbx, %rax
je 0x19e4
testq %rax, %rax
je 0x19b5
leal -0x1(%r13), %edx
movl $0x20, %eax
subl 0xc(%rsp), %eax
xorl %esi, %esi
movq 0x8(%r14), %rcx
movl %esi, %r9d
shrl $0x5, %r9d
movl (%rcx,%r9,4), %r10d
movl %esi, %r11d
andl $0x1f, %r11d
btl %r11d, %r10d
jae 0x19a9
movq 0x10(%r14), %rdi
movq (%rdi,%rsi,8), %rdi
movq %rdi, %r8
shrq $0x20, %r8
btrl %r11d, %r10d
movl %r10d, (%rcx,%r9,4)
imull $0x9e3779b9, %edi, %r10d # imm = 0x9E3779B9
movl %eax, %ecx
shrl %cl, %r10d
movl %r10d, %r9d
shrl $0x5, %r9d
movl (%r15,%r9,4), %ebp
movl %r10d, %ecx
andl $0x1f, %ecx
btl %ecx, %ebp
jae 0x193c
incl %r10d
andl %edx, %r10d
jmp 0x191e
movl $0x1, %r11d
shll %cl, %r11d
btsl %ecx, %ebp
movl %ebp, (%r15,%r9,4)
movl %r10d, %ebp
movl %edi, %ebx
cmpl %r12d, %r10d
jae 0x198d
movq 0x8(%r14), %r10
movl (%r10,%r9,4), %r10d
btl %ecx, %r10d
jae 0x198d
movq 0x10(%r14), %rcx
movq (%rcx,%rbp,8), %rdi
shlq $0x20, %r8
orq %r8, %rbx
movq %rbx, (%rcx,%rbp,8)
movq %rdi, %r8
shrq $0x20, %r8
movq 0x8(%r14), %rcx
notl %r11d
andl %r11d, (%rcx,%r9,4)
movb $0x1, %cl
jmp 0x19a1
movq 0x10(%r14), %rcx
movq %r8, %r9
shlq $0x20, %r9
orq %r9, %rbx
movq %rbx, (%rcx,%rbp,8)
xorl %ecx, %ecx
testb %cl, %cl
jne 0x1912
incq %rsi
cmpl %esi, %r12d
jne 0x18db
cmpl %r13d, %r12d
jbe 0x19ce
movq 0x10(%r14), %rdi
movl %r13d, %esi
shlq $0x3, %rsi
callq 0x10c0
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rdi
callq 0x1070
movq %r15, 0x8(%r14)
movl 0xc(%rsp), %eax
movl %eax, (%r14)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq