// File: /workspace/github_c_makefile_star2_O0/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_right_sibling
static int
ext4_ext_right_sibling(struct ext4_ext_cursor *cur, int depth,
		       struct ext4_ext_cursor **ncurp, bool *nosibp)
{
	int ret = 0;
	int i;
	ext4_lblk_t lblock;
	bool nosib = true;
	struct ext4_ext_cursor *ncur = NULL;
	int rootdepth;
	struct ext4_extent_header *hdr;
	union ext4_extent_item *itemp;

	rootdepth = ext4_ext_cursor_depth(cur);
	hdr = cur->c_paths[depth].p_hdr;
	itemp = EXT_FIRST_ITEM(hdr);

	ext4_assert(ncurp);

	if (!depth)
		lblock = ext4_ext_lblock(&itemp->e);
	else
		lblock = ext4_idx_lblock(&itemp->i);

	for (i = depth + 1; i <= rootdepth; i++) {
		ssize_t ptr = cur->c_paths[i].p_ptr;

		hdr = cur->c_paths[i].p_hdr;
		if (ptr++ < ext4_ext_header_entries(hdr) - 1) {
			struct ext4_extent_idx *idx =
			    EXT_FIRST_INDEX(hdr) + ptr;
			nosib = false;
			lblock = ext4_idx_lblock(idx);
			break;
		}
	}
	ncur = ext4_ext_cursor_alloc(cur->c_superblock, cur->c_root,
				     cur->c_fsinfo, cur->c_blocksz);
	if (!ncur) {
		ret = ENOMEM;
		goto out;
	}

	ret = ext4_ext_lookup_extent(ncur, lblock, NULL);
	if (ret)
		goto out;

out:
	*nosibp = nosib;
	*ncurp = ncur;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movb $0x1, -0x2d(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6720
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x94b6
jmp 0x94d5
leaq 0x192c(%rip), %rdi      # 0xade9
leaq 0x1517(%rip), %rsi      # 0xa9db
movl $0x54b, %edx            # imm = 0x54B
leaq 0x197c(%rip), %rcx      # 0xae4c
callq 0x20c0
cmpl $0x0, -0xc(%rbp)
jne 0x94e9
movq -0x50(%rbp), %rdi
callq 0x69c0
movl %eax, -0x2c(%rbp)
jmp 0x94f5
movq -0x50(%rbp), %rdi
callq 0x89b0
movl %eax, -0x2c(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jg 0x95a4
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x28(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
addq $0x1, %rax
movq %rax, -0x58(%rbp)
movq -0x48(%rbp), %rdi
callq 0x69a0
movw %ax, %cx
movq -0x68(%rbp), %rax
movzwl %cx, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x9594
movq -0x48(%rbp), %rax
addq $0xc, %rax
imulq $0xc, -0x58(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x60(%rbp)
movb $0x0, -0x2d(%rbp)
movq -0x60(%rbp), %rdi
callq 0x89b0
movl %eax, -0x2c(%rbp)
jmp 0x95a4
jmp 0x9596
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x94fe
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rcx
callq 0x6120
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x95dc
movl $0xc, -0x24(%rbp)
jmp 0x95f9
movq -0x38(%rbp), %rdi
movl -0x2c(%rbp), %esi
xorl %eax, %eax
movl %eax, %edx
callq 0x64b0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x95f7
jmp 0x95f9
jmp 0x95f9
movb -0x2d(%rbp), %cl
movq -0x20(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x24(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)