// File: /workspace/github_c_makefile_star2_O0/dlbeer[P]dhara/dhara/map.c
// Function: try_delete
static int try_delete(struct dhara_map *m, dhara_sector_t s,
		      dhara_error_t *err)
{
	dhara_error_t my_err;
	uint8_t meta[DHARA_META_SIZE];
	dhara_page_t alt_page;
	uint8_t alt_meta[DHARA_META_SIZE];
	int level = DHARA_RADIX_DEPTH - 1;
	int i;

	if (trace_path(m, s, NULL, meta, &my_err) < 0) {
		if (my_err == DHARA_E_NOT_FOUND)
			return 0;

		dhara_set_error(err, my_err);
		return -1;
	}

	/* Select any of the closest cousins of this node which are
	 * subtrees of at least the requested order.
	 */
	while (level >= 0) {
		alt_page = meta_get_alt(meta, level);
		if (alt_page != DHARA_PAGE_NONE)
			break;
		level--;
	}

	/* Special case: deletion of last sector */
	if (level < 0) {
		m->count = 0;
		dhara_journal_clear(&m->journal);
		return 0;
	}

	/* Rewrite the cousin with an up-to-date path which doesn't
	 * point to the original node.
	 */
	if (dhara_journal_read_meta(&m->journal, alt_page, alt_meta, err) < 0)
		return -1;

	meta_set_id(meta, meta_get_id(alt_meta));

	meta_set_alt(meta, level, DHARA_PAGE_NONE);
	for (i = level + 1; i < DHARA_RADIX_DEPTH; i++)
		meta_set_alt(meta, i, meta_get_alt(alt_meta, i));

	meta_set_alt(meta, level, DHARA_PAGE_NONE);

	ck_set_count(dhara_journal_cookie(&m->journal), m->count - 1);
	if (dhara_journal_copy(&m->journal, alt_page, meta, err) < 0)
		return -1;

	m->count--;
	return 0;
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x148(%rsp)
movl %esi, 0x144(%rsp)
movq %rdx, 0x138(%rsp)
movl $0x1f, 0x1c(%rsp)
movq 0x148(%rsp), %rdi
movl 0x144(%rsp), %esi
leaq 0xb0(%rsp), %rcx
xorl %eax, %eax
movl %eax, %edx
leaq 0x134(%rsp), %r8
callq 0x13a0
cmpl $0x0, %eax
jge 0x1cf1
cmpl $0x6, 0x134(%rsp)
jne 0x1ccd
movl $0x0, 0x154(%rsp)
jmp 0x1eac
movq 0x138(%rsp), %rdi
movl 0x134(%rsp), %esi
callq 0x16c0
movl $0xffffffff, 0x154(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eac
jmp 0x1cf3
cmpl $0x0, 0x1c(%rsp)
jl 0x1d2b
leaq 0xb0(%rsp), %rdi
movl 0x1c(%rsp), %esi
callq 0x2370
movl %eax, 0xac(%rsp)
cmpl $-0x1, 0xac(%rsp)
je 0x1d1e
jmp 0x1d2b
movl 0x1c(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x1cf3
cmpl $0x0, 0x1c(%rsp)
jge 0x1d5e
movq 0x148(%rsp), %rax
movl $0x0, 0x3c(%rax)
movq 0x148(%rsp), %rdi
callq 0x3470
movl $0x0, 0x154(%rsp)
jmp 0x1eac
movq 0x148(%rsp), %rdi
movl 0xac(%rsp), %esi
leaq 0x20(%rsp), %rdx
movq 0x138(%rsp), %rcx
callq 0x2fe0
cmpl $0x0, %eax
jge 0x1d94
movl $0xffffffff, 0x154(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eac
leaq 0xb0(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x2300
movq 0x10(%rsp), %rdi
movl %eax, %esi
callq 0x22e0
leaq 0xb0(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2330
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
movslq 0x18(%rsp), %rax
cmpq $0x20, %rax
jae 0x1e21
leaq 0xb0(%rsp), %rax
movq %rax, (%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0x20(%rsp), %rdi
movl 0x18(%rsp), %esi
callq 0x2370
movq (%rsp), %rdi
movl 0xc(%rsp), %esi
movl %eax, %edx
callq 0x2330
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x1dd8
leaq 0xb0(%rsp), %rdi
movl 0x1c(%rsp), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2330
movq 0x148(%rsp), %rdi
callq 0x1290
movq %rax, %rdi
movq 0x148(%rsp), %rax
movl 0x3c(%rax), %esi
subl $0x1, %esi
callq 0x23f0
movq 0x148(%rsp), %rdi
movl 0xac(%rsp), %esi
leaq 0xb0(%rsp), %rdx
movq 0x138(%rsp), %rcx
callq 0x3b00
cmpl $0x0, %eax
jge 0x1e90
movl $0xffffffff, 0x154(%rsp) # imm = 0xFFFFFFFF
jmp 0x1eac
movq 0x148(%rsp), %rax
movl 0x3c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x3c(%rax)
movl $0x0, 0x154(%rsp)
movl 0x154(%rsp), %eax
addq $0x158, %rsp            # imm = 0x158
retq
nopl (%rax,%rax)