LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/afi-lambda[P]a_little_smalltalk/src/parser.c
// Function: optimizeBlock
static int optimizeBlock(int instruction, boolean dopop)
{
    int location;
    enum blockstatus savebstat;

    savebstat = blockstat;
    genInstruction(DoSpecial, instruction);
    location = codeTop;
    genCode(0);
    if (dopop)
        genInstruction(DoSpecial, PopTop);
    nextToken();
    if (streq(tokenString, "["))
    {
        nextToken();
        if (blockstat == NotInBlock)
            blockstat = OptimizedBlock;
        body();
        if (!streq(tokenString, "]"))
            compilError(selector, "missing close", "after block");
        nextToken();
    }
    else
    {
        binaryContinuation(term());
        genMessage(false, 0, newSymbol("value"));
    }
    codeArray[location] = codeTop + 1;
    blockstat = savebstat;
    return (location);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %esi
movl 0x21ab5(%rip), %r14d    # 0x28d44
pushq $0xf
popq %rdi
callq 0x699a
movslq 0x21aaa(%rip), %rbx     # 0x28d48
xorl %edi, %edi
callq 0x7361
testl %ebp, %ebp
je 0x72b3
movl $0xf5, %edi
callq 0x7361
callq 0x5d93
leaq 0x21201(%rip), %r15     # 0x284c0
cmpb $0x5b, (%r15)
jne 0x72cc
cmpb $0x0, 0x1(%r15)
je 0x7316
callq 0x749e
movl %eax, %edi
callq 0x7213
leaq 0x1f45(%rip), %rdi      # 0x9224
callq 0x3368
movswl %ax, %edx
xorl %edi, %edi
xorl %esi, %esi
callq 0x6abe
movb 0x21a52(%rip), %al      # 0x28d48
incb %al
leaq 0x21a61(%rip), %rcx     # 0x28d60
movb %al, (%rbx,%rcx)
movl %r14d, 0x21a3b(%rip)    # 0x28d44
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x5d93
cmpl $0x0, 0x21a22(%rip)     # 0x28d44
jne 0x732e
movl $0x2, 0x21a16(%rip)     # 0x28d44
callq 0x69ba
cmpb $0x5d, (%r15)
jne 0x7340
cmpb $0x0, 0x1(%r15)
je 0x735a
leaq 0x21b19(%rip), %rdi     # 0x28e60
leaq 0x2746(%rip), %rsi      # 0x9a94
leaq 0x274d(%rip), %rdx      # 0x9aa2
callq 0x499b
callq 0x5d93
jmp 0x72f0
// File: /workspace/github_c_makefile_star2_O2/afi-lambda[P]a_little_smalltalk/src/parser.c
// Function: unaryContinuation
static boolean unaryContinuation(boolean superReceiver)
{
    int i;
    boolean sent;

    while (parseok && (token == nameconst))
    {
        /* first check to see if it could be a temp by mistake */
        for (i = 1; i < temporaryTop; i++)
            if (streq(tokenString, temporaryName[i]))
                compilWarn(selector, "message same as temporary:", tokenString);
        for (i = 1; i < argumentTop; i++)
            if (streq(tokenString, argumentName[i]))
                compilWarn(selector, "message same as argument:", tokenString);
        /* the next generates too many spurious messages */
        /* for (i=1; i < instanceTop; i++)
         if (streq(tokenString, instanceName[i]))
         compilWarn(selector,"message same as instance",
         tokenString); */

        sent = false;

        if (!sent)
        {
            genMessage(superReceiver, 0, newSymbol(tokenString));
        }
        /* once a message is sent to super, reciever is not super */
        superReceiver = false;
        nextToken();
    }
    return (superReceiver);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x224ff(%rip), %r13     # 0x298b0
leaq 0x21108(%rip), %rbx     # 0x284c0
leaq 0x21aa1(%rip), %r14     # 0x28e60
leaq 0x21cea(%rip), %rbp     # 0x290b0
cmpl $0x0, 0x21973(%rip)     # 0x28d40
je 0x748d
leaq 0x21136(%rip), %rax     # 0x28510
cmpl $0x1, (%rax)
jne 0x748d
movl %edi, 0x4(%rsp)
movl 0x21962(%rip), %r12d    # 0x28d50
pushq $0x1
popq %r15
movslq %r12d, %rax
cmpq %rax, %r15
jge 0x7429
movq (%r13,%r15,8), %rsi
movq %rbx, %rdi
callq 0x2150
testl %eax, %eax
jne 0x7424
movq %r14, %rdi
leaq 0x264a(%rip), %rsi      # 0x9a5f
movq %rbx, %rdx
callq 0x497a
movl 0x2192c(%rip), %r12d    # 0x28d50
incq %r15
jmp 0x73f2
movl 0x2191c(%rip), %r12d    # 0x28d4c
pushq $0x1
popq %r15
movslq %r12d, %rax
cmpq %rax, %r15
jge 0x746b
movq (%rbp,%r15,8), %rsi
movq %rbx, %rdi
callq 0x2150
testl %eax, %eax
jne 0x7466
movq %r14, %rdi
leaq 0x2623(%rip), %rsi      # 0x9a7a
movq %rbx, %rdx
callq 0x497a
movl 0x218e6(%rip), %r12d    # 0x28d4c
incq %r15
jmp 0x7434
movq %rbx, %rdi
callq 0x3368
movswl %ax, %edx
movl 0x4(%rsp), %edi
xorl %esi, %esi
callq 0x6abe
callq 0x5d93
xorl %edi, %edi
jmp 0x73c6
movl %edi, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/afi-lambda[P]a_little_smalltalk/src/parser.c
// Function: genInteger
static void genInteger(int val)
{
    if (val == -1)
        genInstruction(PushConstant, minusOne);
    else if ((val >= 0) && (val <= 2))
        genInstruction(PushConstant, val);
    else
        genInstruction(PushLiteral, genLiteral(newInteger(val)));
}

// Assembly:
cmpl $-0x1, %edi
je 0x7981
movl %edi, %esi
cmpl $0x2, %edi
ja 0x7989
pushq $0x5
popq %rdi
jmp 0x699a
pushq $0x53
popq %rdi
jmp 0x7361
pushq %rax
movl %esi, %edi
callq 0x2d9b
movswl %ax, %edi
callq 0x6fb3
pushq $0x4
popq %rdi
movl %eax, %esi
popq %rax
jmp 0x699a
// File: /workspace/github_c_makefile_star2_O2/afi-lambda[P]a_little_smalltalk/src/unixio.c
// Function: imageRead
void imageRead(FILE *fp)
{
    short i, size;
    //object *mBlockAlloc();

    fr(fp, (char *) &symbols, sizeof(object));
    i = 0;

    while (fr(fp, (char *) &dummyObject, sizeof(dummyObject)))
    {
        i = dummyObject.di;

        if ((i < 0) || (i > ObjectTableMax))
            sysError("reading index out of range", "");
        objectTable[i].STclass = dummyObject.cl;
        if ((objectTable[i].STclass < 0) || ((objectTable[i].STclass >> 1)
                                             > ObjectTableMax))
        {
            fprintf(stderr, "index %d\n", dummyObject.cl);
            sysError("class out of range", "imageRead");
        }
        objectTable[i].size = size = dummyObject.ds;
        if (size < 0)
            size = ((-size) + 1) / 2;
        if (size != 0)
        {
            objectTable[i].memory = mBlockAlloc((int) size);
            fr(fp, (char *) objectTable[i].memory, sizeof(object)
               * (int) size);
        }
        else
            objectTable[i].memory = (object *) 0;
    }

    /* now restore ref counts, getting rid of unneeded junk */
    visit(symbols);
    /* toss out the old free lists, build new ones */
    setFreeLists();

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1fc93(%rip), %rsi     # 0x27884
pushq $0x2
popq %rdx
callq 0x7d08
pushq $0x8
popq %rbp
leaq 0x662d(%rip), %r14      # 0xe230
pushq $0x1
popq %r12
movq %rbx, %rdi
leaq 0x2249f(%rip), %rsi     # 0x2a0b0
movl %ebp, %edx
callq 0x7d08
testl %eax, %eax
je 0x7ce4
movl 0x22489(%rip), %r15d    # 0x2a0b0
cmpw $0x1965, %r15w          # imm = 0x1965
jb 0x7c42
leaq 0x1ff2(%rip), %rdi      # 0x9c28
leaq 0x1a7c(%rip), %rsi      # 0x96b9
callq 0x4938
movswl 0x2246b(%rip), %edx     # 0x2a0b4
movswq %r15w, %r13
shlq $0x4, %r13
movw %dx, (%r14,%r13)
cmpl $0x32ca, %edx           # imm = 0x32CA
jae 0x7cb4
addq %r14, %r13
movzwl 0x2244e(%rip), %eax     # 0x2a0b6
movw %ax, 0x4(%r13)
movl %r12d, %ecx
subl %eax, %ecx
movzwl %cx, %r15d
shrl %r15d
testw %ax, %ax
cmovnsl %eax, %r15d
testw %r15w, %r15w
je 0x7caa
movzwl %r15w, %edi
callq 0x28ff
movq %rax, 0x8(%r13)
leal (%r15,%r15), %ecx
movzwl %cx, %edx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x7d08
jmp 0x7c07
andq $0x0, 0x8(%r13)
jmp 0x7c07
movq 0x5335(%rip), %rax      # 0xcff0
movq (%rax), %rdi
leaq 0x1f7e(%rip), %rsi      # 0x9c43
xorl %eax, %eax
callq 0x2170
leaq 0x1f7a(%rip), %rdi      # 0x9c4d
leaq 0x1f86(%rip), %rsi      # 0x9c60
callq 0x4938
jmp 0x7c5e
leaq 0x1fb99(%rip), %rax     # 0x27884
movswl (%rax), %edi
callq 0x2cf7
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x288d
// File: /workspace/github_c_makefile_star2_O2/afi-lambda[P]a_little_smalltalk/src/unixio.c
// Function: fr
static int fr(FILE *fp, char *p, int s)
{
    int r;

    r = fread(p, s, 1, fp);
    if (r && (r != 1))
        sysError("imageRead count error", "");
    return r;
}

// Assembly:
pushq %rbx
movq %rsi, %rax
movq %rdi, %rcx
movslq %edx, %rsi
pushq $0x1
popq %rdx
movq %rax, %rdi
callq 0x2070
movq %rax, %rbx
cmpl $0x2, %ebx
jb 0x7d38
leaq 0x1f83(%rip), %rdi      # 0x9caf
leaq 0x1986(%rip), %rsi      # 0x96b9
callq 0x4938
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/afi-lambda[P]a_little_smalltalk/src/unixio.c
// Function: imageWrite
void imageWrite(FILE *fp)
{
    short i, size;

    fw(fp, (char *) &symbols, sizeof(object));

    for (i = 0; i < ObjectTableMax; i++)
    {
        if (objectTable[i].referenceCount > 0)
        {
            dummyObject.di = i;
            dummyObject.cl = objectTable[i].STclass;
            dummyObject.ds = size = objectTable[i].size;
            fw(fp, (char *) &dummyObject, sizeof(dummyObject));
            if (size < 0)
                size = ((-size) + 1) / 2;
            if (size != 0)
                fw(fp, (char *) objectTable[i].memory, sizeof(object) * size);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1fb33(%rip), %rsi     # 0x27884
pushq $0x2
popq %rdx
callq 0x7def
leaq 0x64d0(%rip), %r15      # 0xe230
addq $0x8, %r15
xorl %r12d, %r12d
pushq $0x8
popq %rbp
pushq $0x1
popq %r13
cmpq $0x1964, %r12           # imm = 0x1964
je 0x7de0
cmpw $0x0, -0x6(%r15)
jle 0x7dd7
movl %r12d, 0x2232a(%rip)    # 0x2a0b0
movzwl -0x8(%r15), %eax
movw %ax, 0x22322(%rip)      # 0x2a0b4
movl -0x4(%r15), %r14d
movw %r14w, 0x22318(%rip)    # 0x2a0b6
movq %rbx, %rdi
leaq 0x22308(%rip), %rsi     # 0x2a0b0
movl %ebp, %edx
callq 0x7def
movl %r13d, %eax
subl %r14d, %eax
movzwl %ax, %eax
shrl %eax
testw %r14w, %r14w
cmovnsl %r14d, %eax
testw %ax, %ax
je 0x7dd7
movq (%r15), %rsi
addl %eax, %eax
movzwl %ax, %edx
movq %rbx, %rdi
callq 0x7def
incq %r12
addq $0x10, %r15
jmp 0x7d6e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/mkdb.c
// Function: main
int main(int argc, char **argv)
{
	int index = -1;
	int opt;
	struct arg_table argtbl;

	while ((opt = getopt(argc, argv, "n:f:")) != -1) {
		switch (opt) {
		case 'n':
			argtbl.size = atoll(optarg);
			break;
		case 'f':
			/* FIXME: Beware of overflowing!!!. */
			strcpy(argtbl.path, optarg);
			break;
		default:
			usage(argc, argv);
			exit(EXIT_FAILURE);
		}
		index++;
	}
	if (index < 0) {
		usage(argc, argv);
		exit(EXIT_FAILURE);
	}
	if (mkdb(&argtbl))
		exit(EXIT_FAILURE);

	exit(EXIT_SUCCESS);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %rbx
movl %edi, %r14d
pushq $-0x1
popq %r13
leaq 0x3a90(%rip), %r15      # 0x608a
movq 0x79d7(%rip), %r12      # 0x9fd8
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2240
cmpl $0x66, %eax
je 0x2628
cmpl $0x6e, %eax
jne 0x263d
movq (%r12), %rdi
callq 0x2150
movq %rax, -0x30(%rbp)
jmp 0x2638
movq (%r12), %rsi
leaq -0x1030(%rbp), %rdi
callq 0x2050
incl %r13d
jmp 0x2601
cmpl $-0x1, %eax
jne 0x2647
testl %r13d, %r13d
jns 0x2657
movq %rbx, %rsi
callq 0x23cc
pushq $0x1
popq %rdi
callq 0x2260
leaq -0x1030(%rbp), %rdi
callq 0x23e2
testl %eax, %eax
jne 0x264f
xorl %edi, %edi
callq 0x2260
nop
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/extents_bh.c
// Function: fs_bread
struct buffer_head *fs_bread(struct super_block *sb, ext4_fsblk_t block, int *ret)
{
	int err = 0;
	struct buffer_head *bh;
	bh = sb_getblk(sb, block);
	if (!bh)
		return NULL;

	err = bh_submit_read(bh);
	wait_on_buffer(bh);
	if (ret)
		*ret = err;

	fs_bh_alloc++;

	return bh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
callq 0x26c5
movq %rax, %r14
testq %rax, %rax
je 0x26b7
movq %r14, %rdi
callq 0x2e1c
movl %eax, %r15d
movq %r14, %rdi
callq 0x29f7
testq %rbx, %rbx
je 0x26b1
movl %r15d, (%rbx)
incl 0x7add(%rip)            # 0xa194
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/extents_bh.c
// Function: fs_bwrite
struct buffer_head *fs_bwrite(struct super_block *sb, ext4_fsblk_t block, int *ret)
{
	int err = 0;
	struct buffer_head *bh;
	bh = sb_getblk(sb, block);
	if (ret)
		*ret = err;

	if (bh)
		fs_bh_alloc++;

	return bh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
callq 0x26c5
testq %rbx, %rbx
je 0x26ee
andl $0x0, (%rbx)
testq %rax, %rax
je 0x26f9
incl 0x7a9b(%rip)            # 0xa194
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: bdev_alloc
struct block_device *bdev_alloc(int fd, int blocksize_bits)
{
	struct block_device *bdev;
	struct super_block *super;

	bdev = xmalloc(sizeof(struct block_device) + sizeof(struct super_block));
	memset(bdev, 0,
	       sizeof(struct block_device) + sizeof(struct super_block));
	super = (struct super_block *)(bdev + 1);

	bdev->bd_fd = fd;
	bdev->bd_flags = 0;
	bdev->bd_super = super;

	INIT_LIST_HEAD(&bdev->bd_bh_free);
	INIT_LIST_HEAD(&bdev->bd_bh_dirty);
#ifndef USE_AIO
	INIT_LIST_HEAD(&bdev->bd_bh_ioqueue);
#endif
	pthread_mutex_init(&bdev->bd_bh_free_lock, NULL);
	pthread_mutex_init(&bdev->bd_bh_dirty_lock, NULL);
#ifndef USE_AIO
	pthread_mutex_init(&bdev->bd_bh_ioqueue_lock, NULL);
#endif
	pthread_mutex_init(&bdev->bd_bh_root_lock, NULL);

	super->s_blocksize_bits = blocksize_bits;
	super->s_blocksize = 1 << super->s_blocksize_bits;
	super->s_bdev = bdev;

	pipe(bdev->bd_bh_writeback_wakeup_fd);
	pthread_create(&bdev->bd_bh_writeback_thread, NULL,
			buffer_writeback_thread, bdev);

#ifndef USE_AIO
	pipe(bdev->bd_bh_io_wakeup_fd);
	pthread_create(&bdev->bd_bh_io_thread, NULL,
			buffer_io_thread, bdev);
#endif

	return bdev;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %r14d
movl %edi, %r15d
pushq $0x1
popq %rdi
movl $0x148, %esi            # imm = 0x148
callq 0x2140
movq %rax, %rbx
addq $0x128, %rax            # imm = 0x128
movl %r15d, (%rbx)
movq %rax, 0x10(%rbx)
leaq 0x48(%rbx), %rax
movq %rax, 0x50(%rbx)
movq %rax, 0x48(%rbx)
leaq 0x80(%rbx), %rax
movq %rax, 0x88(%rbx)
movq %rax, 0x80(%rbx)
leaq 0x20(%rbx), %rdi
xorl %esi, %esi
callq 0x22a0
leaq 0x58(%rbx), %rdi
xorl %esi, %esi
callq 0x22a0
leaq 0xc8(%rbx), %rdi
xorl %esi, %esi
callq 0x22a0
movl %r14d, 0x130(%rbx)
pushq $0x1
popq %rax
movl %r14d, %ecx
shll %cl, %eax
cltq
movq %rax, 0x128(%rbx)
movq %rbx, 0x138(%rbx)
leaq 0x120(%rbx), %rdi
callq 0x20f0
leaq 0x110(%rbx), %rdi
leaq 0x18(%rip), %rdx        # 0x2840
xorl %esi, %esi
movq %rbx, %rcx
callq 0x21f0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: buffer_writeback_thread
static void *buffer_writeback_thread(void *arg)
{
	struct epoll_event epev = {0};
	struct block_device *bdev = arg;
	int epfd = epoll_create(1);
	if (epfd < 0)
		return NULL;

	epev.events = EPOLLIN;
	epoll_ctl(epfd, EPOLL_CTL_ADD, bdev->bd_bh_writeback_wakeup_fd[0], &epev);

	while (1) {
		int ret;
		ret = epoll_wait(epfd, &epev, 1, buffer_writeback_ms);
		if (ret > 0) {
			/* We got an nofication. */
			signed char command;
			command = bdev_writeback_thread_read_notify(bdev);
			try_to_sync_buffers(bdev);
			if (bdev_is_notify_exiting(command))
				break;
			
			continue;
		}
		if (ret == 0) {
			/* just flush out the dirty data. */
			try_to_sync_buffers(bdev);
		}
		if (ret < 0 && errno != EINTR)
			break;

	}
	close(epfd);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
andq $0x0, -0x34(%rbp)
pushq $0x1
popq %rdi
callq 0x2250
testl %eax, %eax
js 0x28ee
movl %eax, %r14d
leaq -0x38(%rbp), %r15
movl $0x1, (%r15)
movl 0x120(%rbx), %edx
pushq $0x1
popq %r12
movl %eax, %edi
movl %r12d, %esi
movq %r15, %rcx
callq 0x2110
movl %r14d, %edi
movq %r15, %rsi
movl %r12d, %edx
movl $0x2710, %ecx           # imm = 0x2710
callq 0x21e0
testl %eax, %eax
jle 0x28ce
movb $0x0, -0x29(%rbp)
movl 0x120(%rbx), %edi
leaq -0x29(%rbp), %rsi
pushq $0x1
popq %rdx
callq 0x2130
movb -0x29(%rbp), %r13b
movq %rbx, %rdi
callq 0x3285
testb %r13b, %r13b
jns 0x288e
jmp 0x28e6
je 0x28dc
callq 0x2040
cmpl $0x4, (%rax)
je 0x288e
jmp 0x28e6
movq %rbx, %rdi
callq 0x3285
jmp 0x288e
movl %r14d, %edi
callq 0x20e0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: bdev_free
void bdev_free(struct block_device *bdev)
{
	struct rb_node *node;

	bdev_writeback_thread_notify_exit(bdev);
	pthread_join(bdev->bd_bh_writeback_thread, NULL);

#ifndef USE_AIO
	bdev_io_thread_notify_exit(bdev);
	pthread_join(bdev->bd_bh_io_thread, NULL);
#endif
	
	pthread_mutex_lock(&bdev->bd_bh_root_lock);
	while ((node = rb_first(&bdev->bd_bh_root))) {
		struct buffer_head *bh = rb_entry(
		    node, struct buffer_head, b_rb_node);
		wait_on_buffer(bh);
		detach_bh_from_freelist(bh);
		__buffer_remove(bdev, bh);
		buffer_free(bh);
	}
	pthread_mutex_unlock(&bdev->bd_bh_root_lock);

	if (bdev->bd_nr_free != 0)
		fprintf(stderr, "bdev->bd_nr_free == %d", bdev->bd_nr_free);

#ifndef USE_AIO
	close(bdev->bd_bh_io_wakeup_fd[0]);
	close(bdev->bd_bh_io_wakeup_fd[1]);
#endif

	close(bdev->bd_bh_writeback_wakeup_fd[0]);
	close(bdev->bd_bh_writeback_wakeup_fd[1]);

	pthread_mutex_destroy(&bdev->bd_bh_free_lock);
	pthread_mutex_destroy(&bdev->bd_bh_dirty_lock);
#ifndef USE_AIO
	pthread_mutex_destroy(&bdev->bd_bh_ioqueue_lock);
#endif
	pthread_mutex_destroy(&bdev->bd_bh_root_lock);

	xfree(bdev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq -0x29(%rbp), %rsi
movb $-0x1, (%rsi)
movl 0x124(%rdi), %edi
pushq $0x1
popq %rdx
callq 0x2080
movq 0x110(%rbx), %rdi
xorl %esi, %esi
callq 0x2290
leaq 0xc8(%rbx), %r14
movq %r14, %rdi
callq 0x22c0
leaq 0xf0(%rbx), %r15
movq %r15, %rdi
callq 0x3892
testq %rax, %rax
je 0x2988
movq %rax, %r12
movq %rax, %r13
addq $-0x168, %r13           # imm = 0xFE98
movq %r13, %rdi
callq 0x29f7
movq %r13, %rdi
callq 0x2a1d
movq %r12, %rdi
movq %r15, %rsi
callq 0x3964
movq %r13, %rdi
callq 0x2a97
jmp 0x2949
movq %r14, %rdi
callq 0x21b0
movl 0x18(%rbx), %edx
testl %edx, %edx
jne 0x29dd
movl 0x120(%rbx), %edi
callq 0x20e0
movl 0x124(%rbx), %edi
callq 0x20e0
leaq 0x20(%rbx), %rdi
callq 0x20b0
leaq 0x58(%rbx), %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x20b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
movq 0x7614(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x36f5(%rip), %rsi      # 0x60e3
xorl %eax, %eax
callq 0x2170
jmp 0x2997
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: buffer_free
static void buffer_free(struct buffer_head *bh)
{
	sem_destroy(&bh->b_event);
	pthread_mutex_destroy(&bh->b_lock);

	if (bh->b_count != 0)
		fprintf(stderr, "bh: %p b_count != 0, my pid: %d", bh, getpid());

	xfree(bh);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
addq $0xd0, %rdi
callq 0x22b0
leaq 0x110(%rbx), %rdi
callq 0x20b0
cmpl $0x0, 0x108(%rbx)
jne 0x2ace
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2030
movq 0x7523(%rip), %rax      # 0x9ff8
movq (%rax), %r14
callq 0x2090
leaq 0x369a(%rip), %rsi      # 0x617e
movq %r14, %rdi
movq %rbx, %rdx
movl %eax, %ecx
xorl %eax, %eax
callq 0x2170
jmp 0x2ac2
// File: /workspace/github_c_makefile_star2_O2/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: buffer_alloc
struct buffer_head *buffer_alloc(struct block_device *bdev, uint64_t block,
				 int page_size)
{
	struct buffer_head *bh;
	bh = xmalloc(sizeof(struct buffer_head) + page_size);
	if (!bh)
		return NULL;

	memset(bh, 0, sizeof(struct buffer_head));
	bh->b_bdev = bdev;
	bh->b_data = bh + 1;
	bh->b_size = page_size;
	bh->b_blocknr = block;
	bh->b_count = 0;
	bh->b_page = NULL;

	sem_init(&bh->b_event, 0, 1);

	pthread_mutex_init(&bh->b_lock, NULL);
	INIT_LIST_HEAD(&bh->b_freelist);
	INIT_LIST_HEAD(&bh->b_dirty_list);

#ifndef USE_AIO
	INIT_LIST_HEAD(&bh->b_io_list);
#endif

	sync_writeback_buffers(bdev);

	return bh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movq %rdi, %r14
movslq %edx, %r12
leaq 0x180(%r12), %rdi
callq 0x21c0
movq %rax, %rbx
testq %rax, %rax
je 0x2bbe
movl $0x180, %edx            # imm = 0x180
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20d0
movq %r14, 0xf0(%rbx)
leaq 0x180(%rbx), %rax
movq %rax, 0x18(%rbx)
movq %r12, 0x10(%rbx)
movq %r15, 0x8(%rbx)
andq $0x0, 0x20(%rbx)
leaq 0xd0(%rbx), %rdi
pushq $0x1
popq %rdx
xorl %esi, %esi
callq 0x21d0
leaq 0x110(%rbx), %rdi
xorl %esi, %esi
callq 0x22a0
leaq 0x158(%rbx), %rax
movq %rax, 0x160(%rbx)
movq %rax, 0x158(%rbx)
movq %rbx, %rax
addq $0x148, %rax            # imm = 0x148
movq %rax, 0x150(%rbx)
movq %rax, 0x148(%rbx)
cmpl $0xa, 0x75f6(%rip)      # 0xa19c
jl 0x2bbe
leaq -0x21(%rbp), %rsi
movb $0x1, (%rsi)
movl 0x124(%r14), %edi
pushq $0x1
popq %rdx
callq 0x2080
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x2c93
orb $0x1, (%rbx)
lock
decl 0x108(%rbx)
movq %rbx, %rdi
callq 0x2cce
andb $-0x3, (%rbx)
movq %rbx, %rdi
callq 0x2d2c
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_O2/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 0x2d20
movq 0x148(%r14), %rdx
movq %rdx, (%rcx)
movq %rcx, 0x8(%rdx)
movq %rax, 0x150(%r14)
movq %rax, 0x148(%r14)
decl 0x747c(%rip)            # 0xa19c
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O2/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 0x2db1
orb $0x1, (%rbx)
lock
decl 0x108(%rbx)
movq %rbx, %rdi
callq 0x2cce
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_O2/ngkaho1234[P]ext4-extents-tree/buffer.c
// Function: after_submit_read
void after_submit_read(struct buffer_head *bh, int uptodate)
{
	if (uptodate)
		set_buffer_uptodate(bh);

	put_bh(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 0x2df4
orb $0x1, (%rbx)
lock
decl 0x108(%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_O2/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 %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2edc
testl %eax, %eax
jne 0x2e3a
leaq 0x110(%rbx), %rdi
callq 0x22c0
testq $0x1, (%rbx)
jne 0x2e6f
lock
incl 0x108(%rbx)
andb $-0x3, (%rbx)
movq %rbx, %rdi
callq 0x2cce
leaq -0x78(%rip), %rax       # 0x2de4
movq %rax, 0xf8(%rbx)
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2bff
jmp 0x2e7e
addq $0x110, %rbx            # imm = 0x110
movq %rbx, %rdi
callq 0x21b0
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2edc
testl %eax, %eax
je 0x2ed3
testq $0x2, (%rbx)
jne 0x2eb3
addq $0x110, %rbx            # imm = 0x110
movq %rbx, %rdi
callq 0x21b0
jmp 0x2ed3
lock
incl 0x108(%rbx)
leaq -0x120(%rip), %rax      # 0x2da1
movq %rax, 0xf8(%rbx)
pushq $0x1
popq %rdi
movq %rbx, %rsi
callq 0x2bff
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, -0x2c(%rbp)
movq %rsi, %r13
movq %rdi, %r12
leaq 0xf0(%rdi), %r15
leaq 0xc8(%rdi), %r14
movq %r14, %rdi
callq 0x22c0
xorl %ebx, %ebx
pushq $0x10
popq %rcx
pushq $0x8
popq %rdx
movq %r15, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x2f56
cmpq -0x160(%rax), %r13
movq %rcx, %rsi
js 0x2f48
movq %rdx, %rsi
je 0x2f4d
addq %rsi, %rax
jmp 0x2f2f
addq $-0x168, %rax           # imm = 0xFE98
movq %rax, %rbx
movq %r14, %rdi
callq 0x21b0
testq %rbx, %rbx
je 0x2f75
movq %rbx, %rdi
callq 0x2a1d
movq %rbx, %rdi
callq 0x2cce
jmp 0x2fb4
movq %r12, %rdi
movq %r13, %rsi
movl -0x2c(%rbp), %edx
callq 0x2af5
testq %rax, %rax
je 0x2fcd
movq %rax, %rbx
movq %r14, %rdi
callq 0x22c0
movq %rbx, %rsi
addq $0x168, %rsi            # imm = 0x168
leaq 0x2c0(%rip), %rdx       # 0x3264
movq %r15, %rdi
callq 0x39a4
movq %r14, %rdi
callq 0x21b0
lock
incl 0x108(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
jmp 0x2fbb
// File: /workspace/github_c_makefile_star2_O2/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 0x2ffb
movq %rdi, %rbx
pushq $-0x1
popq %rax
lock
xaddl %eax, 0x108(%rdi)
decl %eax
testl %eax, %eax
jle 0x300a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jne 0x3147
testq $0x2, (%rbx)
movq 0xf0(%rbx), %r14
jne 0x30ca
movq %rbx, -0x30(%rbp)
leaq 0x20(%r14), %r15
leaq 0x48(%r14), %rax
movq %rax, -0x40(%rbp)
leaq 0xc8(%r14), %r12
leaq 0xf0(%r14), %rax
movq %rax, -0x38(%rbp)
cmpl $0x15f91, 0x18(%r14)    # imm = 0x15F91
jl 0x3130
movq %r15, %rdi
callq 0x22c0
movq 0x50(%r14), %r13
cmpq -0x40(%rbp), %r13
je 0x30bd
leaq -0x158(%r13), %rbx
movq (%r13), %rax
movq 0x8(%r13), %rcx
movq %rax, (%rcx)
movq %rcx, 0x8(%rax)
movq %r13, 0x8(%r13)
movq %r13, (%r13)
movq -0x68(%r13), %rax
decl 0x18(%rax)
movq %r15, %rdi
callq 0x21b0
movq %r12, %rdi
callq 0x22c0
addq $0x10, %r13
movq %r13, %rdi
movq -0x38(%rbp), %rsi
callq 0x3964
movq %r12, %rdi
callq 0x21b0
movq %rbx, %rdi
callq 0x2a97
jmp 0x3046
movq %r15, %rdi
callq 0x21b0
jmp 0x3046
addq $0x58, %r14
movq %r14, %rdi
callq 0x22c0
leaq 0x148(%rbx), %rax
cmpq %rax, 0x150(%rbx)
jne 0x311a
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 0x7082(%rip)            # 0xa19c
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x21b0
movq -0x30(%rbp), %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2d2c
leaq 0x2fac(%rip), %rdi      # 0x60fa
leaq 0x2fb3(%rip), %rsi      # 0x6108
leaq 0x2fb5(%rip), %rcx      # 0x6111
movl $0x323, %edx            # imm = 0x323
callq 0x20c0
// File: /workspace/github_c_makefile_star2_O2/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 0x31cb
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 0x31ee
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 0x2f61(%rip), %rdi      # 0x6133
callq 0x2230
movq -0x78(%rbp), %rsi
leaq 0x2f59(%rip), %rdi      # 0x613b
xorl %r14d, %r14d
xorl %eax, %eax
callq 0x20a0
jmp 0x31ba
leaq 0x2f56(%rip), %rdi      # 0x614b
callq 0x2230
leaq 0x2f56(%rip), %rdi      # 0x6157
xorl %r14d, %r14d
movq %r15, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x20a0
jmp 0x31ba
// File: /workspace/github_c_makefile_star2_O2/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
pushq %rbx
subq $0x98, %rsp
movl (%rdi), %edi
leaq -0x98(%rbp), %rsi
callq 0x2280
testl %eax, %eax
jne 0x3242
movq -0x68(%rbp), %rbx
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
leaq 0x2eea(%rip), %rdi      # 0x6133
callq 0x2230
movq -0x68(%rbp), %rsi
leaq 0x2ee2(%rip), %rdi      # 0x613b
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x20a0
jmp 0x3235
// File: /workspace/github_c_makefile_star2_O2/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, %rbx
leaq 0x58(%rdi), %r14
leaq 0x80(%rdi), %r13
pushq $0x1
popq %r15
movq %r14, %rdi
callq 0x22c0
movq 0x88(%rbx), %rax
cmpq %r13, %rax
je 0x32dd
leaq -0x148(%rax), %r12
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq %rcx, (%rdx)
movq %rdx, 0x8(%rcx)
movq %rax, 0x8(%rax)
movq %rax, (%rax)
decl 0x6ec1(%rip)            # 0xa19c
jmp 0x32e0
xorl %r12d, %r12d
movq %r14, %rdi
callq 0x21b0
testq %r12, %r12
je 0x334a
movq %r12, %rdi
callq 0x2edc
testl %eax, %eax
je 0x331b
cmpl $0x0, 0x108(%r12)
jg 0x330e
testq $0x2, (%r12)
jne 0x3325
leaq 0x110(%r12), %rdi
callq 0x21b0
movq %r12, %rdi
callq 0x29f7
jmp 0x32a5
lock
incl 0x108(%r12)
leaq -0x6b2(%rip), %rax      # 0x2c83
movq %rax, 0xf8(%r12)
movl %r15d, %edi
movq %r12, %rsi
callq 0x2bff
jmp 0x331b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 (%r14), %rdi
andq $-0x4, %rdi
je 0x3430
movq (%rdi), %rax
testb $0x1, %al
jne 0x3430
movq %rax, %r15
andq $-0x4, %r15
movq 0x10(%r15), %rcx
cmpq %rdi, %rcx
je 0x33d4
testq %rcx, %rcx
je 0x33a2
movq (%rcx), %rdx
testb $0x1, %dl
je 0x33e5
cmpq %r14, 0x10(%rdi)
jne 0x33bc
movq %rdi, %r12
movq %rbx, %rsi
callq 0x349f
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 0x3440
jmp 0x336d
movq 0x8(%r15), %rcx
testq %rcx, %rcx
je 0x33fb
movq (%rcx), %rdx
testb $0x1, %dl
jne 0x33fb
orq $0x1, %rdx
movq %rdx, (%rcx)
orb $0x1, (%rdi)
andb $-0x2, (%r15)
movq %r15, %r14
jmp 0x336d
cmpq %r14, 0x8(%rdi)
jne 0x3415
movq %rdi, %r12
movq %rbx, %rsi
callq 0x3440
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 0x349f
jmp 0x336d
movq (%rbx), %rax
orq $0x1, (%rax)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r15
movq %r15, %rdi
movq %rbx, %rsi
callq *%r14
movq (%r15), %r12
andq $-0x4, %r12
je 0x37e5
movq 0x10(%r12), %rax
cmpq %rax, %r15
je 0x37d0
movq %r12, %r15
movq %rax, %rdi
testq %rax, %rax
jne 0x37da
jmp 0x37a7
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x37c3
movq %rbx, %rsi
callq *%r14
movq %r12, %r15
jmp 0x37a7
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3830
testq %rax, %rax
movq %rcx, %rax
je 0x383c
movq %rbx, %rdi
callq 0x3843
movq %rax, %rcx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x383c
movq (%rcx), %rax
andq $-0x4, %rax
cmpq %rbx, %rax
cmoveq %rcx, %rax
jmp 0x383c
testq %rax, %rax
jne 0x383c
movq (%rbx), %rax
andq $-0x4, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3907
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rcx
testq %rcx, %rcx
je 0x38fc
movq %rcx, %rax
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x38e5
jmp 0x3905
cmpq 0x10(%rax), %rdi
movq %rax, %rdi
jne 0x3905
movq (%rdi), %rax
andq $-0x4, %rax
jne 0x38f3
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3927
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 0x393f
movq (%rax), %rcx
andl $0x3, %ecx
orq %rsi, %rcx
movq %rcx, (%rax)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x3954
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_O2/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 0x3983
movq %r14, %rdi
callq 0x3843
movq %rax, 0x8(%rbx)
cmpq %r14, 0x10(%rbx)
jne 0x3995
movq %r14, %rdi
callq 0x38cc
movq %rax, 0x10(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x34fe
// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %r15
movq %rsi, %r14
pushq $0x1
popq %r12
xorl %ecx, %ecx
movl %r12d, %ebx
movq %rdi, -0x30(%rbp)
movq %rdi, %r13
movq (%r13), %rsi
testq %rsi, %rsi
je 0x39f3
movq %r14, %rdi
callq *%r15
movq (%r13), %rcx
testl %eax, %eax
js 0x39e8
je 0x3a2d
xorl %r12d, %r12d
pushq $0x8
jmp 0x39ec
xorl %ebx, %ebx
pushq $0x10
popq %r13
addq %rcx, %r13
jmp 0x39c8
testl %ebx, %ebx
movq -0x30(%rbp), %rsi
je 0x39ff
movq %r14, 0x10(%rsi)
testl %r12d, %r12d
je 0x3a08
movq %r14, 0x8(%rsi)
movq %rcx, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %r14, (%r13)
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x335c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
xorl %ecx, %ecx
leaq 0x2b55(%rip), %rdi      # 0x65a0
cmpq %rcx, %rdx
je 0x3a67
movb (%rsi,%rcx), %r8b
xorb %al, %r8b
movzbl %r8b, %r8d
shrl $0x8, %eax
xorl (%rdi,%r8,4), %eax
incq %rcx
jmp 0x3a4b
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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, -0x48(%rbp)
movq %rdi, %r15
andl $0x0, -0x2c(%rbp)
callq 0x3a84
movl %eax, %r14d
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x2140
testq %rax, %rax
je 0x3b9e
movq %rax, %rbx
movb 0x8(%r15), %cl
movl %r14d, %eax
shll %cl, %eax
movslq %eax, %rsi
pushq $0x1
popq %rdi
callq 0x2140
testq %rax, %rax
je 0x3b79
movq %rax, %r13
movq %rbx, -0x40(%rbp)
movslq %r14d, %rsi
shlq $0x2, %rsi
pushq $0x1
popq %rdi
callq 0x2140
movq %rax, -0x38(%rbp)
xorl %r12d, %r12d
testl %r14d, %r14d
movl %r14d, -0x30(%rbp)
cmovlel %r12d, %r14d
cmpq %r12, %r14
je 0x3b7e
movq -0x48(%rbp), %rax
leaq (%rax,%r12), %rsi
movq %r15, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x267c
cmpl $0x0, -0x2c(%rbp)
jne 0x3b84
movq %rax, %rbx
movb 0x8(%r15), %cl
movl %r12d, %eax
shll %cl, %eax
movslq %eax, %rdi
addq %r13, %rdi
movq 0x18(%rbx), %rsi
movq (%r15), %rdx
callq 0x2180
movq %rbx, %rdi
callq 0x2700
incq %r12
jmp 0x3b2f
movq %rbx, %rdi
jmp 0x3b99
cmpl $0x0, -0x2c(%rbp)
je 0x3baf
movq -0x40(%rbp), %rdi
callq 0x2030
movq %r13, %rdi
callq 0x2030
movq -0x38(%rbp), %rdi
callq 0x2030
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x40(%rbp), %rax
movq %r15, (%rax)
movl -0x30(%rbp), %ecx
movl %ecx, 0x18(%rax)
movq %r13, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq %rcx, 0x10(%rax)
movq -0x48(%rbp), %rcx
movq %rcx, 0x20(%rax)
jmp 0x3ba0
// File: /workspace/github_c_makefile_star2_O2/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
movq %rsi, %rbx
leaq -0x2c(%rbp), %rax
andl $0x0, (%rax)
movq %rdi, %r15
movl 0x18(%rsi), %r13d
movq 0x8(%rsi), %rax
movq %rax, -0x38(%rbp)
movq 0x20(%rsi), %rax
movq %rax, -0x40(%rbp)
xorl %r14d, %r14d
testl %r13d, %r13d
cmovlel %r14d, %r13d
cmpq %r14, %r13
je 0x3ceb
movq 0x10(%rbx), %rax
testb $0x1, (%rax,%r14,4)
je 0x3ce6
movq -0x40(%rbp), %rax
leaq (%rax,%r14), %rsi
movq %r15, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x26d8
cmpl $0x0, -0x2c(%rbp)
jne 0x3ceb
movq %rax, %r12
movb 0x8(%r15), %cl
movl %r14d, %eax
shll %cl, %eax
movq 0x18(%r12), %rdi
movslq %eax, %rsi
addq -0x38(%rbp), %rsi
movq (%r15), %rdx
callq 0x2180
movq %r12, %rdi
callq 0x2710
movq %r12, %rdi
callq 0x2700
movq 0x10(%rbx), %rax
andb $-0x2, (%rax,%r14,4)
incq %r14
jmp 0x3c83
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq