// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/kvlds/btree_cleaning.c
// Function: poke
static int
poke(struct cleaner * C)
{
	struct cleaning_group * CG;

	/*
	 * If we're trying to find a group to clean, we need to wait until
	 * that is done before we can look for another group.
	 */
	if (C->group_pending)
		goto done;

	/*
	 * If we're using more than 1/16 of our memory to hold pages which
	 * are being cleaned, stop there; that's plenty.
	 */
	if (C->pending_cleans > C->T->poolsz / 16)
		goto done;

	/*
	 * If the number of nodes we have waiting to be fetched or dirtied
	 * is more than the cleaning debt, we don't need to look for any more
	 * pages to clean yet.
	 */
	if ((double)C->pending_cleans >= C->cleandebt)
		goto done;

	/* We're going to launch a group of node cleans. */
	if ((CG = malloc(sizeof(struct cleaning_group))) == NULL)
		goto err0;
	CG->C = C;
	CG->head = NULL;
	CG->pending_fetches = 1;
	C->group_pending = 1;

	/* Hook this group into the list of groups. */
	CG->next = C->head;
	CG->prev = NULL;
	C->head = CG;
	if (CG->next != NULL)
		CG->next->prev = CG;

	/* Find the right group to clean. */
	if (btree_node_descend(C->T, C->T->root_shadow, callback_find, CG))
		goto err1;

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

err1:
	C->head = CG->next;
	C->group_pending = 0;
	free(CG);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x98eb
jmp 0x99fc
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq 0x8(%rcx), %rcx
shrq $0x4, %rcx
cmpq %rcx, %rax
jbe 0x990c
jmp 0x99fc
movq -0x10(%rbp), %rax
movq 0x30(%rax), %xmm0
movaps 0x14714(%rip), %xmm1    # 0x1e030
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x14718(%rip), %xmm1    # 0x1e040
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
ucomisd 0x10(%rax), %xmm0
jb 0x9947
jmp 0x99fc
movl $0x28, %edi
callq 0x22a0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x9960
jmp 0x9a29
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x18(%rbp), %rax
movq $0x1, 0x20(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x99d1
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x20(%rax), %rsi
movq -0x18(%rbp), %rcx
leaq 0x52(%rip), %rdx        # 0x9a40
callq 0xcb50
cmpl $0x0, %eax
je 0x99fa
jmp 0x9a05
jmp 0x99fc
movl $0x0, -0x4(%rbp)
jmp 0x9a30
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x28(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x18(%rbp), %rdi
callq 0x2040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)