// File: /workspace/github_c_makefile_star2_O0/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_try_merge_left
static int
ext4_ext_try_merge_left(struct ext4_ext_cursor *cur, int depth,
			struct ext4_ext_cursor **ncurp, int *mergedp)
{
	int ret;
	bool nosib;
	int merged = 0;
	uint16_t nritems;
	uint16_t snritems;
	struct ext4_ext_cursor *ncur = NULL;
	struct ext4_extent_header *hdr;
	struct ext4_extent_header *shdr;

	*ncurp = NULL;
	*mergedp = 0;

	ret = ext4_ext_left_sibling(cur, depth, &ncur, &nosib);
	if (ret || nosib)
		goto out;

	hdr = cur->c_paths[depth].p_hdr;
	shdr = ncur->c_paths[depth].p_hdr;
	nritems = ext4_ext_header_entries(hdr);
	snritems = ext4_ext_header_entries(shdr);
	if (ext4_ext_may_merge(cur, depth) &&
	    nritems + snritems <= ext4_ext_header_max_entries(shdr)) {
		union ext4_extent_item *itemp = EXT_LAST_ITEM(shdr) + 1;

		memcpy(itemp, EXT_FIRST_ITEM(hdr),
		       nritems * EXT4_EXT_ITEM_SIZE);
		ext4_ext_header_set_entries(shdr, snritems + nritems);
		fs_mark_buffer_dirty(ncur->c_paths[depth].p_bcb);
		merged = 1;
	}
out:
	if (!merged && ncur) {
		ext4_ext_cursor_free(ncur);
		ncur = NULL;
	}
	*mergedp = merged;
	*ncurp = ncur;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x0, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x38(%rbp), %rdx
leaq -0x25(%rbp), %rcx
callq 0x9260
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x8f6e
testb $0x1, -0x25(%rbp)
je 0x8f73
jmp 0x9074
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, -0x40(%rbp)
movq -0x38(%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 -0x40(%rbp), %rdi
callq 0x69a0
movw %ax, -0x2e(%rbp)
movq -0x48(%rbp), %rdi
callq 0x69a0
movw %ax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x93c0
testb $0x1, %al
jne 0x8fd8
jmp 0x9072
movzwl -0x2e(%rbp), %eax
movzwl -0x30(%rbp), %ecx
addl %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rdi
callq 0x9430
movw %ax, %cx
movl -0x54(%rbp), %eax
movzwl %cx, %ecx
cmpl %ecx, %eax
jg 0x9072
movq -0x48(%rbp), %rax
addq $0xc, %rax
movq -0x48(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
movslq %ecx, %rcx
imulq $0xc, %rcx, %rcx
addq %rcx, %rax
addq $-0xc, %rax
addq $0xc, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0xc, %rsi
movzwl -0x2e(%rbp), %eax
imulq $0xc, %rax, %rdx
callq 0x2180
movq -0x48(%rbp), %rdi
movzwl -0x30(%rbp), %eax
movzwl -0x2e(%rbp), %ecx
addl %ecx, %eax
movzwl %ax, %esi
callq 0x87e0
movq -0x38(%rbp), %rax
movq 0x30(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0x29b0
movl $0x1, -0x2c(%rbp)
jmp 0x9074
cmpl $0x0, -0x2c(%rbp)
jne 0x9092
cmpq $0x0, -0x38(%rbp)
je 0x9092
movq -0x38(%rbp), %rdi
callq 0x6470
movq $0x0, -0x38(%rbp)
movl -0x2c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movl -0x24(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nop