// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/spiped/dispatch.c
// Function: callback_gotconn
static int
callback_gotconn(void * cookie, int s)
{
	struct accept_state * A = cookie;
	struct sock_addr ** sas;
	struct conn_list_node * node_new;

	/* This accept is no longer in progress. */
	A->accept_cookie = NULL;

	/* If we got a -1 descriptor, something went seriously wrong. */
	if (s == -1) {
		warnp("network_accept failed");
		goto err0;
	}

	/* We have gained a connection. */
	A->nconn += 1;

	/* Duplicate the target address list. */
	if ((sas = sock_addr_duplist(A->sas)) == NULL)
		goto err1;

	/* Create new conn_list_node. */
	if ((node_new = malloc(sizeof(struct conn_list_node))) == NULL)
		goto err2;
	node_new->A = A;

	/* Create a new connection. */
	if ((node_new->conn_cookie = proto_conn_create(s, sas, A->sa_b,
	    A->decr, A->nopfs, A->requirepfs, A->nokeepalive, A->K,
	    A->timeo, callback_conndied, node_new)) == NULL) {
		warnp("Failure setting up new connection");
		goto err3;
	}

	/* Insert node_new to the beginning of the conn_cookies list. */
	LIST_INSERT_HEAD(&A->conn_cookies, node_new, entries);

	/* Accept another connection if we can. */
	if (doaccept(A))
		goto err0;

	/* Success! */
	return (0);

err3:
	free(node_new);
err2:
	sock_addr_freelist(sas);
err1:
	A->nconn -= 1;
	if (close(s))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x58, %rsp
movq %rdi, -0x18(%rbp)
movl %esi, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, 0x68(%rax)
cmpl $-0x1, -0x1c(%rbp)
jne 0x5886
jmp 0x584c
callq 0x3470
cmpl $0x0, (%rax)
je 0x5871
leaq 0x19ee7(%rip), %rdi     # 0x1f744
movb $0x0, %al
callq 0xbb00
callq 0x3470
movl $0x0, (%rax)
jmp 0x587f
leaq 0x19ecc(%rip), %rdi     # 0x1f744
movb $0x0, %al
callq 0xbd50
jmp 0x5881
jmp 0x5a48
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x50(%rax)
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xb390
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x58b2
jmp 0x59f0
movl $0x20, %edi
callq 0x31b0
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
jne 0x58cb
jmp 0x59e7
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x1c(%rbp), %edi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rax
movq 0x18(%rax), %rdx
movq -0x28(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x28(%rbp), %rax
movl 0x2c(%rax), %r8d
movq -0x28(%rbp), %rax
movl 0x30(%rax), %r9d
movq -0x28(%rbp), %rax
movl 0x34(%rax), %ebx
movq -0x28(%rbp), %rax
movq 0x48(%rax), %r11
movq -0x28(%rbp), %rax
movsd 0x60(%rax), %xmm0
movq -0x38(%rbp), %rax
leaq 0x140(%rip), %r10       # 0x5a60
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
callq 0xcd20
movq -0x38(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x597d
jmp 0x5946
callq 0x3470
cmpl $0x0, (%rax)
je 0x596b
leaq 0x19e03(%rip), %rdi     # 0x1f75a
movb $0x0, %al
callq 0xbb00
callq 0x3470
movl $0x0, (%rax)
jmp 0x5979
leaq 0x19de8(%rip), %rdi     # 0x1f75a
movb $0x0, %al
callq 0xbd50
jmp 0x597b
jmp 0x59de
jmp 0x597f
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rax
movq -0x38(%rbp), %rcx
movq %rax, 0x8(%rcx)
cmpq $0x0, %rax
je 0x59a9
movq -0x38(%rbp), %rcx
addq $0x8, %rcx
movq -0x28(%rbp), %rax
movq 0x78(%rax), %rax
movq %rcx, 0x10(%rax)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x78(%rax)
movq -0x28(%rbp), %rcx
addq $0x78, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rdi
callq 0x5560
cmpl $0x0, %eax
je 0x59d5
jmp 0x5a48
movl $0x0, -0xc(%rbp)
jmp 0x5a4f
movq -0x38(%rbp), %rdi
callq 0x32b0
movq -0x30(%rbp), %rdi
callq 0xaad0
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rcx
subq $0x1, %rcx
movq %rcx, 0x50(%rax)
movl -0x1c(%rbp), %edi
callq 0x30d0
cmpl $0x0, %eax
je 0x5a46
jmp 0x5a0f
callq 0x3470
cmpl $0x0, (%rax)
je 0x5a34
leaq 0x19ffd(%rip), %rdi     # 0x1fa1d
movb $0x0, %al
callq 0xbb00
callq 0x3470
movl $0x0, (%rax)
jmp 0x5a42
leaq 0x19fe2(%rip), %rdi     # 0x1fa1d
movb $0x0, %al
callq 0xbd50
jmp 0x5a44
jmp 0x5a46
jmp 0x5a48
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movl -0xc(%rbp), %eax
addq $0x58, %rsp
popq %rbx
popq %rbp
retq
nopl (%rax)