// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/s3/s3_request_queue.c
// Function: poke
static int
poke(struct s3_request_queue * Q)
{
	struct request * R;

	/* If no requests are queued, do nothing. */
	if (Q->reqs_queued_head == NULL)
		goto done;

	/* If we're at the in-progress limit, do nothing. */
	if (Q->reqsip == Q->reqsip_max)
		goto done;

	/* Sanity-check. */
	assert(Q->reqsip < Q->reqsip_max);

	/* Grab the request at the head of the queue. */
	R = Q->reqs_queued_head;

	/* Grab an S3 endpoint address. */
	if ((R->addrs[0] = s3_serverpool_pick(Q->SP)) == NULL)
		goto err0;
	R->addrs[1] = NULL;

	/* Record when we send this request. */
	if (monoclock_get(&R->t_start))
		goto err0;

	/* Launch the S3 request. */
	if ((R->http_cookie = s3_request(R->addrs, Q->key_id, Q->key_secret,
	    Q->region, R->request, R->maxrlen, callback_reqdone, R)) == NULL)
		goto err0;

	/* The number of in-progress requests has just increased. */
	Q->reqsip += 1;

	/* Remove from the pending queue... */
	if (R->next) {
		R->next->prev = NULL;
	} else {
		Q->reqs_queued_tail = NULL;
	}
	Q->reqs_queued_head = R->next;

	/* ... and place into the in-progress queue. */
	R->prev = Q->reqs_ip_tail;
	R->next = NULL;
	if (R->prev == NULL) {
		Q->reqs_ip_head = R;
	} else {
		R->prev->next = R;
	}
	Q->reqs_ip_tail = R;

done:
	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0xfe6c
jmp 0xfffa
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jne 0xfe83
jmp 0xfffa
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq 0x28(%rcx), %rax
jae 0xfe97
jmp 0xfeb6
leaq 0x101d1(%rip), %rdi     # 0x2006f
leaq 0x101e4(%rip), %rsi     # 0x20089
movl $0xb8, %edx
leaq 0x101f5(%rip), %rcx     # 0x200a6
callq 0x2200
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x106a0
movq -0x18(%rbp), %rcx
movq %rax, 0x38(%rcx)
cmpq $0x0, %rax
jne 0xfee2
jmp 0x10003
movq -0x18(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0xc5c0
cmpl $0x0, %eax
je 0xff05
jmp 0x10003
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x18(%rbp), %rax
movq 0x8(%rax), %r8
movq -0x18(%rbp), %rax
movq 0x10(%rax), %r9
movq -0x18(%rbp), %rax
leaq 0x201(%rip), %r10       # 0x10140
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x14350
movq -0x18(%rbp), %rcx
movq %rax, 0x48(%rcx)
cmpq $0x0, %rax
jne 0xff60
jmp 0x10003
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x30(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0xff8d
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movq $0x0, 0x50(%rax)
jmp 0xff99
movq -0x10(%rbp), %rax
movq $0x0, 0x40(%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x58(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0xffde
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x48(%rax)
jmp 0xffee
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rcx, 0x58(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x1000a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)