LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: after_buffer_sync
void after_buffer_sync(struct buffer_head *bh, int uptodate)
{
	if (uptodate)
		set_buffer_uptodate(bh);

	put_bh(bh);
	remove_buffer_from_writeback(bh);
	clear_buffer_dirty(bh);
	attach_bh_to_freelist(bh);
	unlock_buffer(bh);
	sem_post(&bh->b_event);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x2d63
orb $0x1, (%rbx)
lock
decl 0x108(%rbx)
movq %rbx, %rdi
callq 0x2d9e
andb $-0x3, (%rbx)
movq %rbx, %rdi
callq 0x2dfc
leaq 0x110(%rbx), %rdi
callq 0x21b0
addq $0xd0, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2100
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: remove_buffer_from_writeback
static void remove_buffer_from_writeback(struct buffer_head *bh)
{
	struct block_device *bdev = bh->b_bdev;
	pthread_mutex_lock(&bdev->bd_bh_dirty_lock);
	if (!list_empty(&bh->b_dirty_list)) {
		list_del_init(&bh->b_dirty_list);
		buffer_dirty_count--;
	}
	pthread_mutex_unlock(&bdev->bd_bh_dirty_lock);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0xf0(%rdi), %rbx
addq $0x58, %rbx
movq %rbx, %rdi
callq 0x22c0
leaq 0x148(%r14), %rax
movq 0x150(%r14), %rcx
cmpq %rax, %rcx
je 0x2df0
movq 0x148(%r14), %rdx
movq %rdx, (%rcx)
movq %rcx, 0x8(%rdx)
movq %rax, 0x150(%r14)
movq %rax, 0x148(%r14)
decl 0x63ac(%rip)            # 0x919c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: after_buffer_write
void after_buffer_write(struct buffer_head *bh, int uptodate)
{
	if (uptodate)
		set_buffer_uptodate(bh);

	put_bh(bh);
	remove_buffer_from_writeback(bh);
	clear_buffer_dirty(bh);
	unlock_buffer(bh);
	sem_post(&bh->b_event);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
testl %esi, %esi
je 0x2e81
orb $0x1, (%rbx)
lock
decl 0x108(%rbx)
movq %rbx, %rdi
callq 0x2d9e
andb $-0x3, (%rbx)
leaq 0x110(%rbx), %rdi
callq 0x21b0
addq $0xd0, %rbx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2100
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: bh_submit_read
int bh_submit_read(struct buffer_head *bh)
{
	int ret;

	lock_buffer(bh);
	if (buffer_uptodate(bh)) {
		unlock_buffer(bh);
		return 0;
	}

	get_bh(bh);
	clear_buffer_dirty(bh);
	remove_buffer_from_writeback(bh);
	bh->b_end_io = after_submit_read;
	ret = submit_bh(READ, bh);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x110(%rdi), %r14
movq %r14, %rdi
callq 0x2120
testl %eax, %eax
je 0x2f11
movq %r14, %rdi
callq 0x22c0
testq $0x1, (%rbx)
jne 0x2f46
lock
incl 0x108(%rbx)
andb $-0x3, (%rbx)
movq %rbx, %rdi
callq 0x2d9e
leaq -0x7f(%rip), %rax       # 0x2eb4
movq %rax, 0xf8(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2ccc
jmp 0x2f4e
movq %r14, %rdi
callq 0x21b0
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: write_dirty_buffer
int write_dirty_buffer(struct buffer_head *bh)
{
	int ret = 0;

	if (!trylock_buffer(bh))
		return ret;

	if (buffer_dirty(bh)) {
		get_bh(bh);
		bh->b_end_io = after_buffer_write;
		ret = submit_bh(WRITE, bh);
	} else {
		unlock_buffer(bh);
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x110(%rdi), %r14
movq %r14, %rdi
callq 0x2120
testl %eax, %eax
jne 0x2fa7
testq $0x2, (%rbx)
jne 0x2f85
movq %r14, %rdi
callq 0x21b0
jmp 0x2fa7
lock
incl 0x108(%rbx)
leaq -0x122(%rip), %rax      # 0x2e71
movq %rax, 0xf8(%rbx)
movl $0x1, %edi
movq %rbx, %rsi
callq 0x2ccc
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: _getblk
struct buffer_head *__getblk(struct block_device *bdev, uint64_t block,
			     int bsize)
{
	struct buffer_head *bh;

	bh = buffer_search(bdev, block);
	if (bh) {
		detach_bh_from_freelist(bh);
		remove_buffer_from_writeback(bh);
		get_bh(bh);
		return bh;
	}
	bh = buffer_alloc(bdev, block, bsize);
	if (bh == NULL)
		return NULL;

	buffer_insert(bdev, bh);

	get_bh(bh);
	return bh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r14
leaq 0xc8(%rdi), %rbx
movq %rbx, %rdi
callq 0x22c0
movq 0xf0(%r14), %r13
testq %r13, %r13
je 0x2ffe
cmpq -0x160(%r13), %r12
js 0x2ff2
movl $0x8, %eax
jne 0x2ff7
jmp 0x305a
movl $0x10, %eax
movq (%r13,%rax), %r13
jmp 0x2fdb
movq %rbx, %rdi
callq 0x21b0
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x2bbb
testq %rax, %rax
je 0x3055
movq %rax, %r15
addq $0xf0, %r14
movq %rbx, %rdi
callq 0x22c0
leaq 0x168(%r15), %rsi
leaq 0x2ca(%rip), %rdx       # 0x3303
movq %r14, %rdi
callq 0x3a49
movq %rbx, %rdi
callq 0x21b0
movq %r15, %r13
addq $0x108, %r13            # imm = 0x108
jmp 0x307d
xorl %r15d, %r15d
jmp 0x3082
leaq -0x168(%r13), %r15
movq %rbx, %rdi
callq 0x21b0
movq %r15, %rdi
callq 0x2aff
movq %r15, %rdi
callq 0x2d9e
addq $-0x60, %r13
lock
incl (%r13)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: brelse
void brelse(struct buffer_head *bh)
{
	int refcount;
	if (bh == NULL)
		return;
	refcount = put_bh_and_read(bh);
	if (refcount >= 1)
		goto out;
	assert(refcount == 0);

	if (!buffer_dirty(bh))
		reclaim_buffer(bh);
	else
		move_buffer_to_writeback(bh);
out:
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x30c0
movq %rdi, %rbx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
lock
xaddl %eax, 0x108(%rdi)
decl %eax
testl %eax, %eax
jle 0x30cf
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jne 0x320f
testq $0x2, (%rbx)
movq 0xf0(%rbx), %r14
jne 0x31a9
movq %rbx, -0x30(%rbp)
cmpl $0x15f91, 0x18(%r14)    # imm = 0x15F91
jl 0x3192
leaq 0x20(%r14), %r15
leaq 0x48(%r14), %rax
movq %rax, -0x40(%rbp)
leaq 0xc8(%r14), %r12
leaq 0xf0(%r14), %rax
movq %rax, -0x38(%rbp)
movq %r15, %rdi
callq 0x22c0
movq 0x50(%r14), %rbx
cmpq -0x40(%rbp), %rbx
je 0x3180
leaq -0x158(%rbx), %r13
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %rbx, 0x8(%rbx)
movq %rbx, (%rbx)
movq -0x68(%rbx), %rax
decl 0x18(%rax)
movq %r15, %rdi
callq 0x21b0
movq %r12, %rdi
callq 0x22c0
addq $0x10, %rbx
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x3a09
movq %r12, %rdi
callq 0x21b0
movq %r13, %rdi
callq 0x2b79
jmp 0x3188
movq %r15, %rdi
callq 0x21b0
cmpl $0x15f90, 0x18(%r14)    # imm = 0x15F90
jg 0x3119
movq -0x30(%rbp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2dfc
addq $0x58, %r14
movq %r14, %rdi
callq 0x22c0
leaq 0x148(%rbx), %rax
cmpq %rax, 0x150(%rbx)
jne 0x31f9
movq 0xf0(%rbx), %rcx
leaq 0x80(%rcx), %rdx
movq 0x80(%rcx), %rsi
movq %rax, 0x80(%rcx)
movq %rdx, 0x150(%rbx)
movq %rsi, 0x148(%rbx)
movq %rax, 0x8(%rsi)
incl 0x5fa3(%rip)            # 0x919c
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
leaq 0x2ee4(%rip), %rdi      # 0x60fa
leaq 0x2eeb(%rip), %rsi      # 0x6108
leaq 0x2eed(%rip), %rcx      # 0x6111
movl $0x323, %edx            # imm = 0x323
callq 0x20c0
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: simple_balloc
uint64_t simple_balloc(struct super_block *device, unsigned long blockcnt)
{
	struct stat64 buf;
	if(fstat64(device->s_bdev->bd_fd, &buf)) {
		perror("fstat64");
		printf("file size: %" PRIu64 "\n", buf.st_size);
		return 0;
	}
	if (posix_fallocate(device->s_bdev->bd_fd, buf.st_size, (uint64_t)blockcnt * device->s_blocksize)) {
		perror("fallocate64");
		printf("file size: %" PRIu64 ", request blockcnt: %lu\n", buf.st_size, blockcnt);
		return 0;
	}

	return buf.st_size / device->s_blocksize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rax
movl (%rax), %edi
leaq -0xa8(%rbp), %rsi
callq 0x2280
testl %eax, %eax
jne 0x3293
movq 0x10(%r14), %rax
movl (%rax), %edi
movq -0x78(%rbp), %r15
movq (%r14), %rdx
imulq %rbx, %rdx
movq %r15, %rsi
callq 0x2190
testl %eax, %eax
jne 0x32a4
movq %r15, %rax
xorl %edx, %edx
divq (%r14)
movq %rax, %r14
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0xa8(%rbp), %rdi
callq 0x2339
xorl %r14d, %r14d
jmp 0x3282
leaq 0x2ea0(%rip), %rdi      # 0x614b
callq 0x2230
leaq 0x2ea0(%rip), %rdi      # 0x6157
xorl %r14d, %r14d
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x20a0
jmp 0x3282
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: device_size
uint64_t device_size(struct block_device *bdev)
{
	struct stat64 buf;
	if(fstat64(bdev->bd_fd, &buf)) {
		perror("fstat64");
		printf("file size: %" PRIu64 "\n", buf.st_size);
		return 0;
	}

	return buf.st_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl (%rdi), %edi
leaq -0x90(%rbp), %rsi
callq 0x2280
testl %eax, %eax
jne 0x32f3
movq -0x60(%rbp), %rax
addq $0x90, %rsp
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x2366
xorl %eax, %eax
jmp 0x32ea
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: try_to_sync_buffers
static void try_to_sync_buffers(struct block_device *bdev)
{
	while (1) {
		struct buffer_head *cur;
		cur = remove_first_buffer_from_writeback(bdev);
		if (cur) {
			sync_dirty_buffer(cur);
			wait_on_buffer(cur);
		} else
			break;

	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x58(%rdi), %rbx
movq %rbx, %rdi
callq 0x22c0
leaq 0x80(%r14), %r13
movq 0x88(%r14), %r15
cmpq %r13, %r15
je 0x33e4
movq (%r15), %rax
movq 0x8(%r15), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r15, 0x8(%r15)
movq %r15, (%r15)
decl 0x5e29(%rip)            # 0x919c
movq %rbx, %rdi
callq 0x21b0
leaq -0x38(%r15), %r12
movq %r12, %rdi
callq 0x2120
testl %eax, %eax
jne 0x33aa
cmpl $0x0, -0x40(%r15)
jg 0x33a2
leaq -0x148(%r15), %rsi
testq $0x2, (%rsi)
jne 0x33c8
movq %r12, %rdi
callq 0x21b0
addq $-0x78, %r15
movq %r15, %rdi
callq 0x2060
movq %r15, %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x22c0
jmp 0x3348
lock
incl -0x40(%r15)
leaq -0x681(%rip), %rax      # 0x2d53
movq %rax, -0x50(%r15)
movl $0x1, %edi
callq 0x2ccc
jmp 0x33aa
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
nop
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: rb_insert_color
void rb_insert_color(struct rb_node *node, struct rb_root *root)
{
	struct rb_node *parent, *gparent;

	while ((parent = rb_parent(node)) && rb_is_red(parent)) {
		gparent = rb_parent(parent);

		if (parent == gparent->rb_left) {
			{
				register struct rb_node *uncle =
				    gparent->rb_right;
				if (uncle && rb_is_red(uncle)) {
					rb_set_black(uncle);
					rb_set_black(parent);
					rb_set_red(gparent);
					node = gparent;
					continue;
				}
			}

			if (parent->rb_right == node) {
				register struct rb_node *tmp;
				__rb_rotate_left(parent, root);
				tmp = parent;
				parent = node;
				node = tmp;
			}

			rb_set_black(parent);
			rb_set_red(gparent);
			__rb_rotate_right(gparent, root);
		} else {
			{
				register struct rb_node *uncle =
				    gparent->rb_left;
				if (uncle && rb_is_red(uncle)) {
					rb_set_black(uncle);
					rb_set_black(parent);
					rb_set_red(gparent);
					node = gparent;
					continue;
				}
			}

			if (parent->rb_left == node) {
				register struct rb_node *tmp;
				__rb_rotate_right(parent, root);
				tmp = parent;
				parent = node;
				node = tmp;
			}

			rb_set_black(parent);
			rb_set_red(gparent);
			__rb_rotate_left(gparent, root);
		}
	}

	rb_set_black(root->rb_node);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
andq $-0x4, %rdi
je 0x34d0
movq (%rdi), %rax
testb $0x1, %al
jne 0x34d0
movq %rax, %r15
andq $-0x4, %r15
movq 0x10(%r15), %rcx
cmpq %rdi, %rcx
je 0x3474
testq %rcx, %rcx
je 0x3442
movq (%rcx), %rdx
testb $0x1, %dl
je 0x3485
cmpq %r14, 0x10(%rdi)
jne 0x345c
movq %rdi, %r12
movq %rbx, %rsi
callq 0x353f
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %r14
orq $0x1, %rax
movq %rax, (%rdi)
andb $-0x2, (%r15)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x34e0
jmp 0x34c8
movq 0x8(%r15), %rcx
testq %rcx, %rcx
je 0x3498
movq (%rcx), %rdx
testb $0x1, %dl
jne 0x3498
orq $0x1, %rdx
movq %rdx, (%rcx)
orb $0x1, (%rdi)
andb $-0x2, (%r15)
movq %r15, %r14
jmp 0x34c8
cmpq %r14, 0x8(%rdi)
jne 0x34b2
movq %rdi, %r12
movq %rbx, %rsi
callq 0x34e0
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %r14
orq $0x1, %rax
movq %rax, (%rdi)
andb $-0x2, (%r15)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x353f
movq (%r14), %rdi
jmp 0x3410
movq (%rbx), %rax
orq $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: _rb_rotate_left
static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)
{
	struct rb_node *right = node->rb_right;
	struct rb_node *parent = rb_parent(node);

	if ((node->rb_right = right->rb_left))
		rb_set_parent(right->rb_left, node);
	right->rb_left = node;

	rb_set_parent(right, parent);

	if (parent) {
		if (node == parent->rb_left)
			parent->rb_left = right;
		else
			parent->rb_right = right;
	} else
		root->rb_node = right;
	rb_set_parent(node, right);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rcx
movq 0x8(%rdi), %rax
andq $-0x4, %rcx
movq 0x10(%rax), %rdx
movq %rdx, 0x8(%rdi)
testq %rdx, %rdx
je 0x3509
movq (%rdx), %r8
andl $0x3, %r8d
orq %rdi, %r8
movq %r8, (%rdx)
movq %rdi, 0x10(%rax)
movq (%rax), %rdx
andl $0x3, %edx
orq %rcx, %rdx
movq %rdx, (%rax)
testq %rcx, %rcx
je 0x352e
leaq 0x10(%rcx), %rdx
leaq 0x8(%rcx), %rsi
cmpq %rdi, 0x10(%rcx)
cmoveq %rdx, %rsi
movq %rax, (%rsi)
movq (%rdi), %rcx
andl $0x3, %ecx
orq %rax, %rcx
movq %rcx, (%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: rb_augment_path
static void rb_augment_path(struct rb_node *node, rb_augment_f func,
			      void *data)
{
	struct rb_node *parent;

up:
	func(node, data);
	parent = rb_parent(node);
	if (!parent)
		return;

	if (node == parent->rb_left && parent->rb_right)
		func(parent->rb_right, data);
	else if (parent->rb_left)
		func(parent->rb_left, data);

	node = parent;
	goto up;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rdx, %rsi
callq *%r14
movq (%r12), %r15
andq $-0x4, %r15
je 0x388a
movq 0x10(%r15), %rax
cmpq %rax, %r12
je 0x386a
movq %rax, %rdi
testq %rax, %rax
jne 0x3873
jmp 0x3879
movq 0x8(%r15), %rdi
testq %rdi, %rdi
je 0x3860
movq %rbx, %rsi
callq *%r14
movq %r15, %r12
movq %r15, %rdi
movq %rbx, %rsi
callq *%r14
movq (%r15), %r15
jmp 0x3851
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: rb_augment_erase_begin
struct rb_node *rb_augment_erase_begin(struct rb_node *node)
{
	struct rb_node *deepest;

	if (!node->rb_right && !node->rb_left)
		deepest = rb_parent(node);
	else if (!node->rb_right)
		deepest = node->rb_left;
	else if (!node->rb_left)
		deepest = node->rb_right;
	else {
		deepest = rb_next(node);
		if (deepest->rb_right)
			deepest = deepest->rb_right;
		else if (rb_parent(deepest) != node)
			deepest = rb_parent(deepest);
	}

	return deepest;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rax
testq %rcx, %rcx
je 0x38d5
testq %rax, %rax
movq %rcx, %rax
je 0x38e1
movq %rbx, %rdi
callq 0x38e8
movq %rax, %rcx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x38e1
movq (%rcx), %rax
andq $-0x4, %rax
cmpq %rbx, %rax
cmoveq %rcx, %rax
jmp 0x38e1
testq %rax, %rax
jne 0x38e1
movq (%rbx), %rax
andq $-0x4, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: rb_prev
struct rb_node *rb_prev(const struct rb_node *node)
{
	struct rb_node *parent;

	if (rb_parent(node) == node)
		return NULL;

	/* If we have a left-hand child, go down and then right as far
	   as we can. */
	if (node->rb_left) {
		node = node->rb_left;
		while (node->rb_right)
			node = node->rb_right;
		return (struct rb_node *)node;
	}

	/* No left-hand children. Go up till we find an ancestor which
	   is a right-hand child of its parent */
	while ((parent = rb_parent(node)) && node == parent->rb_left)
		node = parent;

	return parent;
}

// Assembly:
movq (%rdi), %rax
andq $-0x4, %rax
cmpq %rdi, %rax
je 0x39ac
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x39a1
movq %rcx, %rax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x398a
jmp 0x39aa
cmpq 0x10(%rax), %rdi
movq %rax, %rdi
jne 0x39aa
movq (%rdi), %rax
andq $-0x4, %rax
jne 0x3998
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: rb_replace_node
void rb_replace_node(struct rb_node *victim, struct rb_node *new,
		       struct rb_root *root)
{
	struct rb_node *parent = rb_parent(victim);

	/* Set the surrounding nodes to point to the replacement */
	if (parent) {
		if (victim == parent->rb_left)
			parent->rb_left = new;
		else
			parent->rb_right = new;
	} else {
		root->rb_node = new;
	}
	if (victim->rb_left)
		rb_set_parent(victim->rb_left, new);
	if (victim->rb_right)
		rb_set_parent(victim->rb_right, new);

	/* Copy the pointers/colour from the victim to the replacement */
	*new = *victim;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rdi), %rax
andq $-0x4, %rax
je 0x39cc
leaq 0x10(%rax), %rcx
leaq 0x8(%rax), %rdx
cmpq %rdi, 0x10(%rax)
cmoveq %rcx, %rdx
movq %rsi, (%rdx)
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x39e4
movq (%rax), %rcx
andl $0x3, %ecx
orq %rsi, %rcx
movq %rcx, (%rax)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x39f9
movq (%rax), %rcx
andl $0x3, %ecx
orq %rsi, %rcx
movq %rcx, (%rax)
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rsi)
movups (%rdi), %xmm0
movups %xmm0, (%rsi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: rb_erase
void rb_erase(struct rb_node *node, struct rb_root *root)
{
	if (node == root->rb_leftmost)
		root->rb_leftmost = rb_next(node);
	if (node == root->rb_rightmost)
		root->rb_rightmost = rb_prev(node);

	__rb_erase(node, root);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
cmpq %rdi, 0x8(%rsi)
jne 0x3a28
movq %r14, %rdi
callq 0x38e8
movq %rax, 0x8(%rbx)
cmpq %r14, 0x10(%rbx)
jne 0x3a3a
movq %r14, %rdi
callq 0x3971
movq %rax, 0x10(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x359e
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/rbtree.c
// Function: rb_insert
void rb_insert(struct rb_root *root, struct rb_node *node,
		 int (*cmp)(struct rb_node *, struct rb_node *))
{
	struct rb_node **new = &(root->rb_node), *parent = NULL;
	int leftmost = 1, rightmost = 1;

	/* Figure out where to put new node */
	while (*new) {
		int result = cmp(node, *new);

		parent = *new;
		if (result < 0) {
			rightmost = 0;
			new = &((*new)->rb_left);
		} else if (result > 0) {
			leftmost = 0;
			new = &((*new)->rb_right);
		} else
			return;
	}

	/* Add new node and rebalance tree. */
	if (rightmost)
		root->rb_rightmost = node;
	if (leftmost)
		root->rb_leftmost = node;
	rb_link_node(node, parent, new);
	rb_insert_color(node, root);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rsi
testq %rsi, %rsi
je 0x3ac6
movq %rdx, %r15
movl $0x1, -0x2c(%rbp)
xorl %r13d, %r13d
movq %rbx, %r12
movq %r14, %rdi
callq *%r15
movq (%r12), %rcx
testl %eax, %eax
js 0x3aa9
testl %eax, %eax
je 0x3ad6
leaq 0x8(%rcx), %r12
movq 0x8(%rcx), %rsi
testq %rsi, %rsi
je 0x3ae5
movq %r14, %rdi
callq *%r15
movq (%r12), %rcx
testl %eax, %eax
jns 0x3a83
movl $0x0, -0x2c(%rbp)
leaq 0x10(%rcx), %r12
movq 0x10(%rcx), %rsi
movb $0x1, %r13b
testq %rsi, %rsi
jne 0x3a75
movl $0x8, %eax
cmpl $0x0, -0x2c(%rbp)
jne 0x3af0
jmp 0x3af4
movq %r14, 0x10(%rbx)
movl $0x8, %eax
xorl %ecx, %ecx
movq %rbx, %r12
jmp 0x3af0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %eax
testb $0x1, %r13b
jne 0x3af4
movq %r14, (%rbx,%rax)
movq %rcx, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %r14, (%r12)
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x33fc
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/ext4_crc32.c
// Function: ext4_crc32c
uint32_t
ext4_crc32c(uint32_t crc, const void *buf, size_t size)
{
	const uint8_t *p = buf;


	while (size--)
		crc = crc32Table[(crc ^ *p++) & 0xff] ^ (crc >> 8);

	return crc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, %eax
testq %rdx, %rdx
je 0x3b4a
xorl %ecx, %ecx
leaq 0x2a70(%rip), %rdi      # 0x65a0
movb (%rsi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdi,%r8,4), %eax
incq %rcx
cmpq %rcx, %rdx
jne 0x3b30
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/db_bitmap.c
// Function: load_all_bitmap
struct db_bitmap *load_all_bitmap(struct super_block *sb, ext4_fsblk_t nrblocks, ext4_fsblk_t bitmap_block)
{
	int i, err = 0;
	int bitmap_nrblocks = blocks_of_bitmap(sb, nrblocks);
	uint8_t *bitmap = NULL;
	struct db_bitmap_desc *desc = NULL;
	struct db_bitmap *db_bitmap = xzalloc(sizeof(struct db_bitmap));
	if (!db_bitmap)
		return NULL;

	bitmap = xzalloc(bitmap_nrblocks << sb->s_blocksize_bits);
	if (!bitmap) {
		xfree(db_bitmap);
		return NULL;
	}

	desc = xzalloc(sizeof(struct db_bitmap_desc) * bitmap_nrblocks);

	for (i = 0;i < bitmap_nrblocks;i++) {
		struct buffer_head *bh;
		bh = fs_bread(sb, bitmap_block + i, &err);
		if (err)
			goto out;

		memcpy(bitmap + (i << sb->s_blocksize_bits), bh->b_data,
			sb->s_blocksize);
		fs_brelse(bh);
	}
out:
	if (err) {
		if (db_bitmap)
			xfree(db_bitmap);
		if (bitmap)
			xfree(bitmap);
		if (desc)
			xfree(desc);

		db_bitmap = NULL;
	} else {
		db_bitmap->sb = sb;
		db_bitmap->bitmap_count = bitmap_nrblocks;
		db_bitmap->bitmap = bitmap;
		db_bitmap->bitmap_desc = desc;
		db_bitmap->bitmap_block = bitmap_block;
	}
	return db_bitmap;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, -0x50(%rbp)
movq %rdi, %r14
movq %rsi, %rax
shrq $0x3, %rax
andl $0x7, %esi
cmpq $0x1, %rsi
sbbq $-0x1, %rax
movl $0x0, -0x2c(%rbp)
movl 0x8(%rdi), %ebx
movq %rax, %r15
movl %ebx, %ecx
shrq %cl, %r15
xorl %r12d, %r12d
xorl %edx, %edx
divq (%rdi)
cmpq $0x1, %rdx
sbbq $-0x1, %r15
movl $0x1, %edi
movl $0x28, %esi
callq 0x2140
testq %rax, %rax
je 0x3ce9
movq %rax, %r13
movl %r15d, %eax
movl %ebx, %ecx
shll %cl, %eax
movslq %eax, %rsi
movl $0x1, %edi
callq 0x2140
testq %rax, %rax
je 0x3cb7
movq %rax, %r12
movq %r13, -0x40(%rbp)
movslq %r15d, %rsi
shlq $0x2, %rsi
movl $0x1, %edi
callq 0x2140
movq %rax, -0x38(%rbp)
movq %r15, -0x48(%rbp)
testl %r15d, %r15d
jle 0x3cc4
movq -0x48(%rbp), %rbx
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
xorl %r13d, %r13d
movq -0x50(%rbp), %rax
leaq (%rax,%r13), %rsi
movq %r14, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x2728
cmpl $0x0, -0x2c(%rbp)
jne 0x3c9b
movq %rax, %r15
movb 0x8(%r14), %cl
movl %r13d, %eax
shll %cl, %eax
movslq %eax, %rdi
addq %r12, %rdi
movq 0x18(%r15), %rsi
movq (%r14), %rdx
callq 0x2180
movq %r15, %rdi
callq 0x27a8
incq %r13
cmpq %r13, %rbx
jne 0x3c4d
cmpl $0x0, -0x2c(%rbp)
je 0x3cc4
movq -0x40(%rbp), %rdi
callq 0x2030
movq %r12, %rdi
callq 0x2030
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
jne 0x3cba
jmp 0x3cbf
movq %r13, %rdi
callq 0x2030
xorl %r12d, %r12d
jmp 0x3ce9
movq -0x40(%rbp), %rcx
movq %r14, (%rcx)
movq -0x48(%rbp), %rax
movl %eax, 0x18(%rcx)
movq %r12, 0x8(%rcx)
movq -0x38(%rbp), %rax
movq %rax, 0x10(%rcx)
movq -0x50(%rbp), %rax
movq %rax, 0x20(%rcx)
movq %rcx, %r12
movq %r12, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/db_bitmap.c
// Function: save_all_bitmap
void save_all_bitmap(struct super_block *sb, struct db_bitmap *db_bitmap)
{
	int i, err = 0;
	int bitmap_nrblocks = db_bitmap->bitmap_count;
	uint8_t *bitmap = db_bitmap->bitmap;
	ext4_fsblk_t bitmap_block = db_bitmap->bitmap_block;

	for (i = 0;i < bitmap_nrblocks;i++) {
		struct buffer_head *bh;
		if (db_bitmap->bitmap_desc[i].dirty) {
			bh = fs_bwrite(sb, bitmap_block + i, &err);
			if (err)
				goto out;

			memcpy(bh->b_data, bitmap + (i << sb->s_blocksize_bits),
				sb->s_blocksize);
			fs_mark_buffer_dirty(bh);
			fs_brelse(bh);
			db_bitmap->bitmap_desc[i].dirty = 0;
		}
	}
out:
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x0, -0x2c(%rbp)
movslq 0x18(%rsi), %r13
testq %r13, %r13
jle 0x3e1e
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rax
movq %rax, -0x38(%rbp)
movq 0x20(%rsi), %rax
movq %rax, -0x40(%rbp)
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
testb $0x1, (%rax,%r15,4)
je 0x3e16
movq -0x40(%rbp), %rax
leaq (%rax,%r15), %rsi
movq %r14, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x2777
cmpl $0x0, -0x2c(%rbp)
jne 0x3e1e
movq %rax, %r12
movb 0x8(%r14), %cl
movl %r15d, %eax
shll %cl, %eax
movq 0x18(%r12), %rdi
movslq %eax, %rsi
addq -0x38(%rbp), %rsi
movq (%r14), %rdx
callq 0x2180
movq %r12, %rdi
callq 0x27b8
movq %r12, %rdi
callq 0x27a8
movq 0x10(%rbx), %rax
andb $-0x2, (%rax,%r15,4)
incq %r15
cmpq %r15, %r13
jne 0x3db8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/db_bitmap.c
// Function: bitmap_bits_free
void bitmap_bits_free(struct db_bitmap *db_bitmap, ext4_fsblk_t bit, uint32_t bcnt)
{
    ext4_fsblk_t i = bit;
    uint8_t *bitmap = db_bitmap->bitmap;

    while(i & 7){

        if(!bcnt)
            return;

        __bitmap_bits_clr(db_bitmap, bitmap, i);

        bcnt--;
        i++;
    }
    bit  = i;
    bitmap += (bit >> 3);

    while(bcnt >= 32){
        *(uint32_t *)bitmap = 0;
        bitmap += 4;
        bcnt -= 32;
        bit += 32;
    }

    while(bcnt >= 16){
        *(uint16_t *)bitmap = 0;
        bitmap += 2;
        bcnt -= 16;
        bit += 16;
    }

    while(bcnt >= 8){
        *bitmap = 0;
        bitmap += 1;
        bcnt -= 8;
        bit += 8;
    }

    for (i = 0; i < bcnt; ++i) {
        __bitmap_bits_clr(db_bitmap, bitmap, i);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %r15d
movq %rdi, %rbx
movq 0x8(%rdi), %r14
testb $0x7, %sil
je 0x3f03
movl %esi, %eax
andb $0x7, %al
subl $0x1, %r15d
jb 0x3fd4
movq %r14, %rdx
subq 0x8(%rbx), %rdx
movq (%rbx), %rcx
movl 0x8(%rcx), %ecx
sarq %cl, %rdx
shll $0x3, %ecx
movq %rsi, %rdi
shrq %cl, %rdi
movb $-0x2, %r8b
movl %eax, %ecx
rolb %cl, %r8b
addl %edx, %edi
movq %rsi, %rcx
shrq $0x3, %rcx
andb %r8b, (%r14,%rcx)
movq 0x10(%rbx), %rcx
movslq %edi, %rdx
orb $0x1, (%rcx,%rdx,4)
incq %rsi
incb %al
testb $0x7, %sil
jne 0x3eb5
shrq $0x3, %rsi
addq %rsi, %r14
cmpl $0x20, %r15d
jb 0x3f36
leal -0x20(%r15), %r12d
shrl $0x5, %r12d
leaq 0x4(,%r12,4), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20d0
leaq (%r14,%r12,4), %r14
addq $0x4, %r14
andl $0x1f, %r15d
cmpl $0x10, %r15d
jb 0x3f62
leal -0x10(%r15), %r12d
shrl $0x4, %r12d
leaq 0x2(,%r12,2), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20d0
leaq (%r14,%r12,2), %r14
addq $0x2, %r14
andl $0xf, %r15d
cmpl $0x8, %r15d
jb 0x3f89
leal -0x8(%r15), %r12d
shrl $0x3, %r12d
leaq 0x1(%r12), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20d0
addq %r12, %r14
incq %r14
andl $0x7, %r15d
testl %r15d, %r15d
je 0x3fd4
movl %r15d, %edx
xorl %eax, %eax
movq %r14, %rsi
subq 0x8(%rbx), %rsi
movq (%rbx), %rcx
movl 0x8(%rcx), %ecx
sarq %cl, %rsi
shll $0x3, %ecx
movq %rax, %rdi
shrq %cl, %rdi
movb $-0x2, %r8b
movl %eax, %ecx
rolb %cl, %r8b
addl %esi, %edi
movq %rax, %rcx
shrq $0x3, %rcx
andb %r8b, (%r14,%rcx)
movq 0x10(%rbx), %rcx
movslq %edi, %rsi
orb $0x1, (%rcx,%rsi,4)
incq %rax
cmpq %rax, %rdx
jne 0x3f93
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/db_bitmap.c
// Function: bitmap_find_bits_clr
int bitmap_find_bits_clr(struct db_bitmap *db_bitmap, ext4_fsblk_t bit, ext4_fsblk_t ebit,
    ext4_fsblk_t *bit_id)
{
    ext4_fsblk_t i;
    uint64_t bcnt = ebit - bit + 1;
    uint8_t *bitmap = db_bitmap->bitmap;

    i = bit;

    while(i & 7){

        if(!bcnt)
            return -ENOSPC;

        if(bitmap_is_bit_clr(bitmap, i)){
            *bit_id = bit;
            return 0;
        }

        i++;
        bcnt--;
    }

    bit  = i;
    bitmap += (bit >> 3);


    while(bcnt >= 32){
        if(*(uint32_t *)bitmap != 0xFFFFFFFF)
            goto finish_it;

        bitmap += 4;
        bcnt -= 32;
        bit += 32;
    }

    while(bcnt >= 16){
        if(*(uint16_t *)bitmap != 0xFFFF)
            goto finish_it;

        bitmap += 2;
        bcnt -= 16;
        bit += 16;
    }

    finish_it:
    while(bcnt >= 8){
        if(*bitmap != 0xFF){
            for (i = 0; i < 8; ++i) {
                if(bitmap_is_bit_clr(bitmap, i)){
                    *bit_id = bit + i;
                    return 0;
                }
            }
        }

        bitmap += 1;
        bcnt -= 8;
        bit += 8;
    }

    for (i = 0; i < bcnt; ++i) {
        if(bitmap_is_bit_clr(bitmap, i)){
            *bit_id = bit + i;
            return 0;
        }
    }

    return -ENOSPC;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq 0x8(%rdi), %rdi
testb $0x7, %sil
je 0x402a
leaq 0x1(%rdx), %r8
movq %rsi, %rax
cmpq %rax, %r8
je 0x4103
movq %rax, %r9
shrq $0x3, %r9
movzbl (%rdi,%r9), %r9d
movl %eax, %r10d
andl $0x7, %r10d
btl %r10d, %r9d
jae 0x40fc
incq %rax
testb $0x7, %al
jne 0x3ff2
subq %rax, %rdx
incq %rdx
movq %rax, %rsi
jmp 0x4030
subq %rsi, %rdx
incq %rdx
movq %rsi, %rax
shrq $0x3, %rax
addq %rax, %rdi
cmpq $0x20, %rdx
jb 0x4057
cmpl $-0x1, (%rdi)
jne 0x407b
addq $0x4, %rdi
addq $-0x20, %rdx
addq $0x20, %rsi
cmpq $0x1f, %rdx
ja 0x4040
cmpq $0x10, %rdx
jb 0x4075
cmpw $-0x1, (%rdi)
jne 0x4075
addq $0x2, %rdi
addq $-0x10, %rdx
addq $0x10, %rsi
cmpq $0xf, %rdx
ja 0x405d
cmpq $0x8, %rdx
jb 0x40c6
movq %rdi, %rax
leaq -0x8(%rdx), %rdi
shrq $0x3, %rdi
addq %rax, %rdi
incq %rdi
movq %rsi, %r8
negq %r8
movzbl (%rax), %r9d
cmpl $0xff, %r9d
je 0x40b1
xorl %r10d, %r10d
btl %r10d, %r9d
jae 0x40f6
incq %r10
cmpq $0x8, %r10
jne 0x40a2
incq %rax
addq $-0x8, %rdx
addq $0x8, %rsi
addq $-0x8, %r8
cmpq $0x7, %rdx
ja 0x4092
movl $0xffffffe4, %eax       # imm = 0xFFFFFFE4
testq %rdx, %rdx
je 0x4108
xorl %r8d, %r8d
movq %r8, %r9
shrq $0x3, %r9
movzbl (%rdi,%r9), %r9d
movl %r8d, %r10d
andl $0x7, %r10d
btl %r10d, %r9d
jae 0x410a
incq %r8
cmpq %r8, %rdx
jne 0x40d3
jmp 0x4108
subq %r8, %r10
movq %r10, %rsi
movq %rsi, (%rcx)
xorl %eax, %eax
jmp 0x4108
movl $0xffffffe4, %eax       # imm = 0xFFFFFFE4
popq %rbp
retq
addq %r8, %rsi
jmp 0x40fc
nop
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/db.c
// Function: db_open
struct db_handle *db_open(struct super_block *sb)
{
	struct buffer_head *bh;
	struct db_header *bhdr;
	struct db_handle *db_handle;
	struct db_bitmap *db_bitmap;
	int err = 0;
	db_handle = xzalloc(sizeof(struct db_handle));
	if (!db_handle)
		return NULL;

	bh = fs_bread(sb, 0, &err);
	if (!bh) {
		err = -ENOMEM;
		goto out;
	}
	bhdr = (struct db_header *)bh->b_data;
	db_handle->sb = sb;
	db_handle->db_header = (struct db_header *)bhdr;
	db_bitmap = load_all_bitmap(sb, bhdr->db_nrblocks, bhdr->db_bitmap_block);
	if (!db_handle) {
		err = -ENOMEM;
		goto out;
	}
	db_handle->db_bitmap = db_bitmap;
	db_handle->sb_bh = bh;
out:
	if (err) {
		if (db_bitmap)
			free_all_bitmap(db_bitmap);
		if (db_handle)
			xfree(db_handle);

		db_handle = NULL;
	}
	return db_handle;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movl $0x0, -0x24(%rbp)
movl $0x1, %edi
movl $0x28, %esi
callq 0x2140
testq %rax, %rax
je 0x4192
movq %rax, %rbx
leaq -0x24(%rbp), %r15
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x2728
movq %rax, %r12
movq 0x18(%rax), %rax
movq %r14, (%rbx)
movq %rax, 0x10(%rbx)
movq 0x4(%rax), %rsi
movq 0xc(%rax), %rdx
movq %r14, %rdi
callq 0x3b93
movq %rax, 0x18(%rbx)
movq %r12, 0x20(%rbx)
cmpl $0x0, (%r15)
je 0x4194
testq %rax, %rax
je 0x418a
movq %rax, %rdi
callq 0x3cfb
movq %rbx, %rdi
callq 0x2030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/db.c
// Function: db_close
void db_close(struct db_handle *db_handle)
{
	save_all_bitmap(db_handle->sb, db_handle->db_bitmap);
	free_all_bitmap(db_handle->db_bitmap);
	fs_brelse(db_handle->sb_bh);
	xfree(db_handle);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
movq 0x18(%rbx), %rsi
callq 0x3d7e
movq 0x18(%rbx), %rdi
callq 0x3cfb
movq 0x20(%rbx), %rdi
callq 0x27a8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2030
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: extcursor_alloc_block
static int
extcursor_alloc_block(struct ext4_ext_cursor *cur, ext4_fsblk_t *nblockp)
{
	int ret;
	ext4_lblk_t count = 1;
	*nblockp = ext4_new_meta_blocks((struct inode *)cur->c_fsinfo, 0, 0,
					&count, &ret);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq 0x8(%rdi), %r15
leaq -0x20(%rbp), %rcx
movq $0x0, (%rcx)
movq 0x18(%r15), %rax
movq 0x10(%rax), %rdx
movq 0x18(%rax), %rdi
movq 0x4(%rdx), %rdx
decq %rdx
xorl %esi, %esi
callq 0x3fdd
movl %eax, %r14d
testl %eax, %eax
jne 0x4238
movq 0x18(%r15), %rax
movq 0x18(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x3e2d
movq -0x20(%rbp), %rax
movq %rax, (%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_cursor_alloc
struct ext4_ext_cursor *
ext4_ext_cursor_alloc(struct super_block *sb, void *root, void *fsinfo,
		      size_t blocksz)
{
	struct ext4_ext_path *paths;
	struct ext4_extent_header *hdr;
	int i;
	int rootdepth;
	struct ext4_ext_cursor *cur;

	hdr = root;
	rootdepth = ext4_ext_header_depth(hdr);

	cur = (struct ext4_ext_cursor *)ext4_malloc(
	    sizeof(struct ext4_ext_cursor));
	if (!cur)
		return NULL;

	paths = (struct ext4_ext_path *)ext4_zalloc(
	    sizeof(struct ext4_ext_path) * (rootdepth + 1));
	if (!paths) {
		ext4_free(cur);
		return NULL;
	}
	for (i = 0; i <= rootdepth; i++)
		paths[i].p_ptr = -1;
	cur->c_superblock = sb;
	cur->c_root = root;
	cur->c_fsinfo = fsinfo;
	cur->c_cursor_op = ext4_test_cursor_op;
	cur->c_paths = paths;
	cur->c_maxdepth = rootdepth;
	cur->c_blocksz = blocksz;

	cur->c_paths[rootdepth].p_bcb = NULL;
	cur->c_paths[rootdepth].p_hdr = cur->c_root;
	cur->c_paths[rootdepth].p_ptr = -1;
	return cur;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, -0x38(%rbp)
movq %rsi, %r15
movq %rdi, %r13
movzwl 0x6(%rsi), %r14d
movl $0x48, %edi
callq 0x21c0
testq %rax, %rax
je 0x4347
movq %rax, %rbx
movq %r12, -0x30(%rbp)
leaq (%r14,%r14,2), %r12
leaq 0x18(,%r12,8), %rsi
movl $0x1, %edi
callq 0x2140
testq %rax, %rax
je 0x433f
movl %r14d, %ecx
leaq (%rcx,%rcx,2), %rcx
leaq 0x18(,%rcx,8), %rcx
xorl %edx, %edx
movq $-0x1, 0x10(%rax,%rdx)
addq $0x18, %rdx
cmpq %rdx, %rcx
jne 0x42e8
movq %r13, 0x10(%rbx)
movq %r15, (%rbx)
movq -0x38(%rbp), %rcx
movq %rcx, 0x8(%rbx)
leaq 0x4e68(%rip), %rcx      # 0x9178
movups (%rcx), %xmm0
movups %xmm0, 0x18(%rbx)
movq 0x10(%rcx), %rcx
movq %rcx, 0x28(%rbx)
movq %rax, 0x30(%rbx)
movl %r14d, 0x40(%rbx)
movq -0x30(%rbp), %rcx
movq %rcx, 0x38(%rbx)
movq %r15, 0x8(%rax,%r12,8)
movq $-0x1, 0x10(%rax,%r12,8)
jmp 0x4349
movq %rbx, %rdi
callq 0x2030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_cursor_unpin
void
ext4_ext_cursor_unpin(struct ext4_ext_cursor *cur, int depth, int nrlevel)
{
	int i;
	int maxdepth;

	maxdepth = cur->c_maxdepth;

	if (depth < 0) {
		for (i = 0; i <= maxdepth; i++)
			ext4_ext_path_unpin(cur->c_paths + i);

	} else {
		for (i = depth; i <= maxdepth && i < depth + nrlevel; i++)
			ext4_ext_path_unpin(cur->c_paths + i);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x40(%rdi), %r14d
testl %esi, %esi
js 0x43e9
movl %esi, %r15d
cmpl %esi, %r14d
setl %al
testl %edx, %edx
setle %cl
orb %al, %cl
jne 0x443a
addl %r15d, %edx
movl %r15d, %eax
leaq (%rax,%rax,2), %rax
leaq 0x8(,%rax,8), %r13
movq %rbx, -0x30(%rbp)
movq 0x30(%rbx), %r12
cmpq $0x0, (%r12,%r13)
je 0x43d6
addq %r13, %r12
movq -0x8(%r12), %rdi
testq %rdi, %rdi
je 0x43ce
movl %edx, %ebx
callq 0x27a8
movl %ebx, %edx
movq -0x30(%rbp), %rbx
movq $0x0, -0x8(%r12)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
cmpl %r15d, %r14d
jle 0x443a
incl %r15d
addq $0x18, %r13
cmpl %r15d, %edx
jg 0x43a0
jmp 0x443a
testl %r14d, %r14d
js 0x443a
leaq (%r14,%r14,2), %rax
leaq 0x18(,%rax,8), %r14
xorl %r15d, %r15d
movq 0x30(%rbx), %rax
cmpq $0x0, 0x8(%rax,%r15)
je 0x4431
leaq (%rax,%r15), %r12
addq $0x8, %r12
movq -0x8(%r12), %rdi
testq %rdi, %rdi
je 0x4429
callq 0x27a8
movq $0x0, -0x8(%r12)
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
addq $0x18, %r15
cmpq %r15, %r14
jne 0x43fd
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_insert_item
static void
ext4_ext_insert_item(struct ext4_ext_cursor *cur, int depth,
		     union ext4_extent_item *nitems, bool updptr)
{
	struct ext4_extent_header *hdr;
	uint16_t nritems;
	ssize_t ptr;
	union ext4_extent_item *item;

	hdr = cur->c_paths[depth].p_hdr;
	nritems = ext4_ext_header_entries(hdr);
	ptr = (nritems) ? cur->c_paths[depth].p_ptr : 0;
	item = EXT_FIRST_ITEM(hdr) + ptr;

	ext4_assert(EXT_HAS_FREE_INDEX(hdr));

	if (nritems) {
		ssize_t shiftnritems;

		if (depth) {
			if (ext4_idx_lblock(&item->i) <
			    ext4_idx_lblock(&nitems->i)) {
				ptr++;
				item++;
			}
		} else {
			if (ext4_ext_lblock(&item->e) + ext4_ext_len(&item->e) -
				1 <
			    ext4_ext_lblock(&nitems->e)) {
				ptr++;
				item++;
			}
		}
		shiftnritems = EXT_LAST_ITEM(hdr) - item + 1;
		if (shiftnritems)
			memmove(item + 1, item,
				shiftnritems * EXT4_EXT_ITEM_SIZE);
		memcpy(item, nitems, EXT4_EXT_ITEM_SIZE);
	} else {
		memcpy(item, nitems, EXT4_EXT_ITEM_SIZE);
	}
	if (updptr)
		cur->c_paths[depth].p_ptr = ptr;
	ext4_ext_header_set_entries(hdr, ext4_ext_header_entries(hdr) + 1);
	if (depth == ext4_ext_cursor_depth(cur))
		cur->c_cursor_op.c_root_dirty_func(cur);
	else
		fs_mark_buffer_dirty(cur->c_paths[depth].p_bcb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r8
movq 0x30(%rdi), %rdx
movl %esi, %eax
leaq (%rax,%rax,2), %r13
movq 0x8(%rdx,%r13,8), %r14
movzwl 0x2(%r14), %eax
testq %rax, %rax
je 0x4c9a
cmpw 0x4(%r14), %ax
jae 0x4d33
movq 0x10(%rdx,%r13,8), %r10
leaq 0xc(%r14), %r9
leaq (%r10,%r10,2), %rdx
leaq (%r14,%rdx,4), %r12
addq $0xc, %r12
movl (%r12), %edx
testl %ebx, %ebx
je 0x4d0a
cmpl (%r15), %edx
jae 0x4c5c
incq %r10
addq $0xc, %r12
leaq (%rax,%rax,2), %rax
leaq (%r9,%rax,4), %rdx
subq %r12, %rdx
addq $-0xc, %rdx
cmpq $-0xc, %rdx
je 0x4cad
leaq 0xc(%r12), %rdi
addq $0xc, %rdx
movq %r12, %rsi
movq %r8, -0x40(%rbp)
movl %ecx, -0x2c(%rbp)
movq %r10, -0x38(%rbp)
callq 0x2210
movq -0x38(%rbp), %r10
movl -0x2c(%rbp), %ecx
movq -0x40(%rbp), %r8
jmp 0x4cad
cmpw $0x0, 0x4(%r14)
je 0x4d33
leaq 0xc(%r14), %r12
xorl %r10d, %r10d
movl 0x8(%r15), %eax
movl %eax, 0x8(%r12)
movq (%r15), %rax
movq %rax, (%r12)
testb %cl, %cl
je 0x4cca
movq 0x30(%r8), %rax
movq %r10, 0x10(%rax,%r13,8)
incw 0x2(%r14)
movq (%r8), %rax
movzwl 0x6(%rax), %eax
cmpl %ebx, %eax
jne 0x4cef
movq %r8, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x18(%r8)
movq 0x30(%r8), %rax
movq (%rax,%r13,8), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x27b8
movzwl 0x4(%r12), %esi
movl %esi, %edi
andl $0x7fff, %edi           # imm = 0x7FFF
cmpl $0x8001, %esi           # imm = 0x8001
cmovbl %esi, %edi
addl %edi, %edx
decl %edx
cmpl (%r15), %edx
jb 0x4c55
jmp 0x4c5c
leaq 0x1edb(%rip), %rdi      # 0x6c15
leaq 0x1caa(%rip), %rsi      # 0x69eb
leaq 0x1ee5(%rip), %rcx      # 0x6c2d
movl $0x407, %edx            # imm = 0x407
callq 0x20c0
// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, -0x2c(%rbp)
movq (%rdi), %rax
movzwl 0x6(%rax), %eax
movq %rax, -0x38(%rbp)
cmpl %esi, %eax
jle 0x4e3f
movq %rdi, %r14
movslq %esi, %r15
movq 0x30(%rdi), %rax
leaq (%r15,%r15,2), %rcx
cmpq $0x0, 0x10(%rax,%rcx,8)
jne 0x4e3f
leaq (%rax,%rcx,8), %rcx
leaq 0x1(%r15), %r13
leaq (,%r15,8), %rdx
leaq (%rdx,%rdx,2), %rsi
addq %rsi, %rax
addq $0x18, %rax
leaq (%rdx,%rdx,2), %rbx
addq $0x28, %rbx
movq -0x38(%rbp), %rdx
leaq -0x1(%rdx), %r8
movq %r8, -0x40(%rbp)
movq %r15, %r12
incq %r15
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rsi
movq 0x8(%rcx), %rdi
leaq (%rsi,%rsi,2), %rcx
leaq (%rdx,%rcx,4), %rcx
addq $0xc, %rcx
movl (%rcx), %esi
movl 0xc(%rdi), %edx
testq %r12, %r12
cmpl %edx, %esi
jne 0x4df4
cmpl $0x0, -0x2c(%rbp)
jne 0x4e11
jmp 0x4e3f
movl %edx, (%rcx)
cmpq -0x38(%rbp), %r15
jge 0x4e06
movq (%rax), %rdi
callq 0x27b8
jmp 0x4e0d
movq %r14, %rdi
callq *0x18(%r14)
movq -0x40(%rbp), %r8
cmpq %r12, %r8
je 0x4e3f
movq 0x30(%r14), %rdx
leaq (,%r13,2), %rcx
addq %r13, %rcx
incq %r13
leaq (%rdx,%rcx,8), %rax
addq $0x18, %rax
leaq (%rdx,%rcx,8), %rcx
cmpq $0x0, (%rdx,%rbx)
leaq 0x18(%rbx), %rbx
je 0x4dc2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_decrement
int
ext4_ext_decrement(struct ext4_ext_cursor *cur, bool *noprevp)
{
	int ret = 0;
	int i;
	int depth;
	ssize_t ptr;
	bool noprev = true;
	int rootdepth;

	rootdepth = ext4_ext_cursor_depth(cur);
	for (i = 0; i <= rootdepth; i++) {
		struct ext4_extent_header *hdr;

		hdr = cur->c_paths[i].p_hdr;
		ptr = cur->c_paths[i].p_ptr;
		if (hdr && ptr && ptr != -1)
			break;
	}
	depth = i;
	if (depth > rootdepth)
		goto out;

	cur->c_paths[depth].p_ptr--;
	ret = ext4_ext_reload_paths(cur, depth, true);
	if (ret)
		goto out;

	noprev = false;
out:
	if (noprevp)
		*noprevp = noprev;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %rcx
movq 0x30(%rdi), %rax
movzwl 0x6(%rcx), %ecx
addq $0x10, %rax
incq %rcx
xorl %esi, %esi
cmpq $0x0, -0x8(%rax)
je 0x5036
movq (%rax), %rdx
decq %rdx
cmpq $-0x2, %rdx
jb 0x5048
incq %rsi
addq $0x18, %rax
cmpq %rsi, %rcx
jne 0x5023
xorl %eax, %eax
movb $0x1, %cl
jmp 0x505a
decq (%rax)
movl $0x1, %edx
callq 0x4e4e
testl %eax, %eax
setne %cl
testq %rbx, %rbx
je 0x5061
movb %cl, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_increment
int
ext4_ext_increment(struct ext4_ext_cursor *cur, bool *nonextp)
{
	int ret = 0;
	int i;
	int depth;
	ssize_t ptr;
	bool nonext = true;
	int rootdepth;

	rootdepth = ext4_ext_cursor_depth(cur);
	for (i = 0; i <= rootdepth; i++) {
		struct ext4_extent_header *hdr;

		hdr = cur->c_paths[i].p_hdr;
		ptr = cur->c_paths[i].p_ptr;
		if (hdr && ptr != -1 && ptr < ext4_ext_header_entries(hdr) - 1)
			break;
	}
	depth = i;
	if (depth > rootdepth)
		goto out;

	cur->c_paths[depth].p_ptr++;
	ret = ext4_ext_reload_paths(cur, depth, false);
	if (ret)
		goto out;

	nonext = false;
out:
	if (nonextp)
		*nonextp = nonext;
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq (%rdi), %rcx
movq 0x30(%rdi), %rax
movzwl 0x6(%rcx), %ecx
addq $0x10, %rax
incq %rcx
xorl %esi, %esi
movq -0x8(%rax), %r8
movq (%rax), %rdx
testq %r8, %r8
setne %r9b
cmpq $-0x1, %rdx
setne %r10b
andb %r9b, %r10b
cmpb $0x1, %r10b
jne 0x50b1
movzwl 0x2(%r8), %r8d
decq %r8
cmpq %r8, %rdx
jl 0x50c3
incq %rsi
addq $0x18, %rax
cmpq %rsi, %rcx
jne 0x5085
xorl %eax, %eax
movb $0x1, %cl
jmp 0x50d2
incq (%rax)
xorl %edx, %edx
callq 0x4e4e
testl %eax, %eax
setne %cl
testq %rbx, %rbx
je 0x50d9
movb %cl, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ngkaho1234[P]ext4-extents-tree/extents.c
// Function: ext4_ext_cursor_reset_rootpath
static int
ext4_ext_cursor_reset_rootpath(struct ext4_ext_cursor *cur)
{
	struct ext4_ext_path *paths;
	int rootdepth;

	rootdepth = ext4_ext_cursor_depth(cur);

	if (rootdepth > cur->c_maxdepth) {
		int nrlevel = cur->c_maxdepth;

		paths = (struct ext4_ext_path *)ext4_malloc(
		    sizeof(struct ext4_ext_path) * (rootdepth + 1));
		if (!paths)
			return ENOMEM;

		memcpy(paths, cur->c_paths,
		       nrlevel * sizeof(struct ext4_ext_path));
		ext4_free(cur->c_paths);
		cur->c_paths = paths;
		cur->c_maxdepth = rootdepth;
	}

	cur->c_paths[rootdepth].p_bcb = NULL;
	cur->c_paths[rootdepth].p_hdr = cur->c_root;
	cur->c_paths[rootdepth].p_ptr = -1;
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rax
movzwl 0x6(%rax), %r12d
movslq 0x40(%rdi), %r13
cmpl %r12d, %r13d
jge 0x55c9
leaq (%r12,%r12,2), %rax
leaq 0x18(,%rax,8), %rdi
callq 0x21c0
testq %rax, %rax
je 0x55fb
movq %rax, %r14
movq 0x30(%rbx), %r15
shlq $0x3, %r13
leaq (,%r13,2), %rdx
addq %r13, %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
movq %r15, %rdi
callq 0x2030
movq %r14, 0x30(%rbx)
movl %r12d, 0x40(%rbx)
movq (%rbx), %rax
jmp 0x55cd
movq 0x30(%rbx), %r14
movl %r12d, %ecx
leaq (%rcx,%rcx,2), %rcx
movq $0x0, (%r14,%rcx,8)
movq %rax, 0x8(%r14,%rcx,8)
movq $-0x1, 0x10(%r14,%rcx,8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xc, %eax
jmp 0x55ec