// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/serverpool/serverpool.c
// Function: callback_read_len
static int
callback_read_len(void * cookie, ssize_t readlen)
{
	struct serverpool * P = cookie;

	/* We should get -1 (error), 0 (EOF), or a size_t. */
	assert((readlen == -1) || (readlen == 0) ||
	    (readlen == sizeof(size_t)));

	/* Handle failures. */
	if (readlen == -1)
		goto err1;
	if (readlen == 0)
		goto eof;

	/* Sanity-check. */
	if (P->addrlen > SSIZE_MAX)
		goto err1;

	/* An address length of 0 indicates the end of a generation. */
	if (P->addrlen == 0) {
		P->generation++;

		/* Remove expired addresses from the pool. */
		if (pruneaddrs(P))
			goto err0;

		/* Read another address length. */
		if ((P->read_cookie = network_read(P->s,
		    (uint8_t *)&P->addrlen, sizeof(size_t), sizeof(size_t),
		    callback_read_len, P)) == NULL)
			goto err1;
	} else {
		/* Allocate space to hold the address. */
		if ((P->addr = malloc(P->addrlen)) == NULL)
			goto err0;

		/* Read the address. */
		if ((P->read_cookie = network_read(P->s, P->addr, P->addrlen,
		    P->addrlen, callback_read_addr, P)) == NULL)
			goto err1;
	}

	/* Success! */
	return (0);

eof:
	warn0("DNS lookup process died");

	/* Failure! */
	return (-1);

err1:
	warnp("Error reading address via socket");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $-0x1, -0x18(%rbp)
je 0x70dd
cmpq $0x0, -0x18(%rbp)
je 0x70dd
cmpq $0x8, -0x18(%rbp)
jne 0x70df
jmp 0x70fe
leaq 0x3830(%rip), %rdi      # 0xa916
leaq 0x37d3(%rip), %rsi      # 0xa8c0
movl $0x9e, %edx
leaq 0x385e(%rip), %rcx      # 0xa957
callq 0x2180
cmpq $-0x1, -0x18(%rbp)
jne 0x710a
jmp 0x7227
cmpq $0x0, -0x18(%rbp)
jne 0x7116
jmp 0x7203
movq -0x20(%rbp), %rax
movabsq $0x7fffffffffffffff, %rcx # imm = 0x7FFFFFFFFFFFFFFF
cmpq %rcx, 0x10(%rax)
jbe 0x712f
jmp 0x7227
movq -0x20(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jne 0x7199
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rax)
movq -0x20(%rbp), %rdi
callq 0x7390
cmpl $0x0, %eax
je 0x715d
jmp 0x7260
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x20(%rbp), %rsi
addq $0x10, %rsi
movq -0x20(%rbp), %r9
movl $0x8, %ecx
leaq -0xcc(%rip), %r8        # 0x70b0
movq %rcx, %rdx
callq 0x8150
movq -0x20(%rbp), %rcx
movq %rax, 0x20(%rcx)
cmpq $0x0, %rax
jne 0x7197
jmp 0x7227
jmp 0x71fa
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2240
movq -0x20(%rbp), %rcx
movq %rax, 0x18(%rcx)
cmpq $0x0, %rax
jne 0x71b9
jmp 0x7260
movq -0x20(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %r9
leaq 0x3dd(%rip), %r8        # 0x75c0
callq 0x8150
movq -0x20(%rbp), %rcx
movq %rax, 0x20(%rcx)
cmpq $0x0, %rax
jne 0x71f8
jmp 0x7227
jmp 0x71fa
movl $0x0, -0x4(%rbp)
jmp 0x7267
jmp 0x7205
leaq 0x3772(%rip), %rdi      # 0xa97e
movb $0x0, %al
callq 0x6810
callq 0x20a0
movl $0x0, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7267
jmp 0x7229
callq 0x20a0
cmpl $0x0, (%rax)
je 0x724e
leaq 0x3642(%rip), %rdi      # 0xa87c
movb $0x0, %al
callq 0x65c0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x725c
leaq 0x3627(%rip), %rdi      # 0xa87c
movb $0x0, %al
callq 0x6810
jmp 0x725e
jmp 0x7260
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq