// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../libcperciva/events/events_network.c
// Function: growpollfd
static int
growpollfd(size_t fd)
{
	size_t new_fds_alloc;
	struct pollfd * new_fds;

	/* We should not be called if the descriptor is already listed. */
	assert(socketlist_get(S, fd)->pollpos == (size_t)(-1));

	/* Expand the pollfd allocation if needed. */
	if (fds_alloc == nfds) {
		new_fds_alloc = fds_alloc == 0 ? 16 : fds_alloc * 2;
		if (new_fds_alloc > SIZE_MAX / sizeof(struct pollfd)) {
			errno = ENOMEM;
			goto err0;
		}
		if ((new_fds = realloc(fds,
		    new_fds_alloc * sizeof(struct pollfd))) == NULL)
			goto err0;
		fds = new_fds;
		fds_alloc = new_fds_alloc;
	}

	/* Sanity-check. */
	assert(nfds < fds_alloc);
	assert(fd < INT_MAX);

	/* Initialize pollfd structure. */
	fds[nfds].fd = (int)fd;
	fds[nfds].events = 0;
	fds[nfds].revents = 0;

	/* Point at pollfd structure. */
	socketlist_get(S, fd)->pollpos = nfds;

	/* We now have one more pollfd structure. */
	nfds++;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq 0x1addd(%rip), %rdi     # 0x1e4d0
movq -0x10(%rbp), %rsi
callq 0x36b0
cmpq $-0x1, 0x10(%rax)
jne 0x3705
jmp 0x3724
leaq 0x6b65(%rip), %rdi      # 0xa271
leaq 0x6b0d(%rip), %rsi      # 0xa220
movl $0x8d, %edx
leaq 0x6b81(%rip), %rcx      # 0xa2a0
callq 0x2180
movq 0x1adc5(%rip), %rax     # 0x1e4f0
cmpq 0x1ada6(%rip), %rax     # 0x1e4d8
jne 0x37bc
cmpq $0x0, 0x1adb0(%rip)     # 0x1e4f0
jne 0x374d
movl $0x10, %eax
movq %rax, -0x28(%rbp)
jmp 0x375b
movq 0x1ad9c(%rip), %rax     # 0x1e4f0
shlq %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movabsq $0x1fffffffffffffff, %rax # imm = 0x1FFFFFFFFFFFFFFF
cmpq %rax, -0x18(%rbp)
jbe 0x3783
callq 0x20a0
movl $0xc, (%rax)
jmp 0x3897
movq 0x1ad56(%rip), %rdi     # 0x1e4e0
movq -0x18(%rbp), %rsi
shlq $0x3, %rsi
callq 0x2280
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x37a6
jmp 0x3897
movq -0x20(%rbp), %rax
movq %rax, 0x1ad2f(%rip)     # 0x1e4e0
movq -0x18(%rbp), %rax
movq %rax, 0x1ad34(%rip)     # 0x1e4f0
movq 0x1ad15(%rip), %rax     # 0x1e4d8
cmpq 0x1ad26(%rip), %rax     # 0x1e4f0
jae 0x37ce
jmp 0x37ed
leaq 0x6ae2(%rip), %rdi      # 0xa2b7
leaq 0x6a44(%rip), %rsi      # 0xa220
movl $0x9e, %edx
leaq 0x6ab8(%rip), %rcx      # 0xa2a0
callq 0x2180
cmpq $0x7fffffff, -0x10(%rbp) # imm = 0x7FFFFFFF
jae 0x37f9
jmp 0x3818
leaq 0x6ac8(%rip), %rdi      # 0xa2c8
leaq 0x6a19(%rip), %rsi      # 0xa220
movl $0x9f, %edx
leaq 0x6a8d(%rip), %rcx      # 0xa2a0
callq 0x2180
movq -0x10(%rbp), %rax
movl %eax, %edx
movq 0x1acbb(%rip), %rax     # 0x1e4e0
movq 0x1acac(%rip), %rcx     # 0x1e4d8
movl %edx, (%rax,%rcx,8)
movq 0x1acaa(%rip), %rax     # 0x1e4e0
movq 0x1ac9b(%rip), %rcx     # 0x1e4d8
movw $0x0, 0x4(%rax,%rcx,8)
movq 0x1ac95(%rip), %rax     # 0x1e4e0
movq 0x1ac86(%rip), %rcx     # 0x1e4d8
movw $0x0, 0x6(%rax,%rcx,8)
movq 0x1ac78(%rip), %rax     # 0x1e4d8
movq %rax, -0x30(%rbp)
movq 0x1ac65(%rip), %rdi     # 0x1e4d0
movq -0x10(%rbp), %rsi
callq 0x36b0
movq -0x30(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq 0x1ac55(%rip), %rax     # 0x1e4d8
addq $0x1, %rax
movq %rax, 0x1ac4a(%rip)     # 0x1e4d8
movl $0x0, -0x4(%rbp)
jmp 0x389e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)