// File: /workspace/github_c_makefile_star2_O0/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_update_index
static void
ext4_ext_update_index(struct ext4_ext_cursor *cur, int depth, int force)
{
	int i;
	int rootdepth;

	rootdepth = ext4_ext_cursor_depth(cur);

	for (i = depth + 1; i <= rootdepth; i++) {
		struct ext4_extent_header *hdr =
		    (cur->c_paths[i].p_hdr);
		struct ext4_extent_header *childhdr =
		    cur->c_paths[i - 1].p_hdr;
		ssize_t ptr = cur->c_paths[i].p_ptr;

		if (cur->c_paths[i - 1].p_ptr)
			break;
		if (i > 1) {
			struct ext4_extent_idx *idx =
			    EXT_FIRST_INDEX(hdr) + ptr;
			struct ext4_extent_idx *childidx =
			    EXT_FIRST_INDEX(childhdr);

			if (ext4_idx_lblock(idx) != ext4_idx_lblock(childidx)) {
				ext4_idx_store_lblock(
				    idx, ext4_idx_lblock(childidx));
				if (i < rootdepth)
					fs_mark_buffer_dirty(
					    cur->c_paths[i].p_bcb);
				else
					cur->c_cursor_op.c_root_dirty_func(cur);
			} else if (!force)
				break;
		} else {
			struct ext4_extent_idx *idx =
			    EXT_FIRST_INDEX(hdr) + ptr;
			struct ext4_extent *childext =
			    EXT_FIRST_EXTENT(childhdr);

			if (ext4_idx_lblock(idx) != ext4_ext_lblock(childext)) {
				ext4_idx_store_lblock(
				    idx, ext4_ext_lblock(childext));
				if (i < rootdepth)
					fs_mark_buffer_dirty(
					    cur->c_paths[i].p_bcb);
				else
					cur->c_cursor_op.c_root_dirty_func(cur);
			} else if (!force)
				break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x6720
movl %eax, -0x18(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jg 0x7273
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
je 0x711d
jmp 0x7273
cmpl $0x1, -0x14(%rbp)
jle 0x71c8
movq -0x20(%rbp), %rax
addq $0xc, %rax
imulq $0xc, -0x30(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x40(%rbp)
movq -0x38(%rbp), %rdi
callq 0x89b0
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rdi
callq 0x89b0
movl %eax, %ecx
movl -0x54(%rbp), %eax
cmpl %ecx, %eax
je 0x71b6
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rdi
callq 0x89b0
movq -0x60(%rbp), %rdi
movl %eax, %esi
callq 0x8e40
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x71a6
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x29b0
jmp 0x71b4
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0x71c3
cmpl $0x0, -0x10(%rbp)
jne 0x71c1
jmp 0x7273
jmp 0x71c3
jmp 0x7263
movq -0x20(%rbp), %rax
addq $0xc, %rax
imulq $0xc, -0x30(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
addq $0xc, %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0x89b0
movl %eax, -0x64(%rbp)
movq -0x50(%rbp), %rdi
callq 0x69c0
movl %eax, %ecx
movl -0x64(%rbp), %eax
cmpl %ecx, %eax
je 0x7257
movq -0x48(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x50(%rbp), %rdi
callq 0x69c0
movq -0x70(%rbp), %rdi
movl %eax, %esi
callq 0x8e40
movl -0x14(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x7247
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0x14(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x29b0
jmp 0x7255
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
jmp 0x7261
cmpl $0x0, -0x10(%rbp)
jne 0x725f
jmp 0x7273
jmp 0x7261
jmp 0x7263
jmp 0x7265
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x7097
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)