LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat.c
// Function: ufat_alloc_chain
int ufat_alloc_chain(struct ufat *uf, unsigned int count, ufat_cluster_t *out)
{
	ufat_cluster_t chain = UFAT_CLUSTER_EOC;

	while (count) {
		int err = alloc_cluster(uf, &chain, chain);

		if (err < 0) {
			ufat_free_chain(uf, chain);
			return err;
		}

		count--;
	}

	*out = chain;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, 0x10(%rsp)
movl %esi, %r12d
movq %rdi, %r14
movl $0xffffff8, %ebp        # imm = 0xFFFFFF8
leaq 0xc(%rsp), %r13
subl $0x1, %r12d
jb 0x1d47
movl %ebp, 0x8(%rsp)
movl 0x50(%r14), %r15d
addl $-0x2, %r15d
movl %r15d, %ebx
subl $0x1, %ebx
jb 0x1d23
movl 0x78(%r14), %eax
leal 0x2(%rax), %ebp
incl %eax
xorl %edx, %edx
divl %r15d
movl %edx, 0x78(%r14)
cmpl $0xff0, %ebp            # imm = 0xFF0
jne 0x1cf6
cmpl $0xc, 0x28(%r14)
je 0x1cd0
movq %r14, %rdi
movl %ebp, %esi
movq %r13, %rdx
callq 0x18c8
orl 0xc(%rsp), %eax
jne 0x1cd0
movq %r14, %rdi
movl %ebp, %esi
movl 0x8(%rsp), %r15d
movl %r15d, %edx
callq 0x1aac
testl %eax, %eax
jns 0x1cb7
movl %eax, %ebx
jmp 0x1d2b
pushq $-0xf
popq %rbx
movl 0x8(%rsp), %r15d
movq %r14, %rdi
movl %r15d, %esi
callq 0x1c39
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x10(%rsp), %rax
movl %ebp, (%rax)
xorl %ebx, %ebx
jmp 0x1d36
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat.c
// Function: read_fat_byte
static int read_fat_byte(struct ufat *uf, unsigned int offset, uint8_t *out)
{
	ufat_block_t b = offset >> uf->dev->log2_block_size;
	unsigned int r = offset & ((1 << uf->dev->log2_block_size) - 1);
	int idx;

	idx = ufat_cache_open(uf, uf->bpb.fat_start + b, 0);
	if (idx < 0)
		return idx;

	*out = ufat_cache_data(uf, idx)[r];
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movl (%rax), %r12d
movl %r12d, %ecx
shrl %cl, %esi
movq %rdx, %r15
addq 0x30(%rdi), %rsi
xorl %r14d, %r14d
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x1dc0
pushq $-0x1
popq %rdx
movl %r12d, %ecx
shll %cl, %edx
notl %edx
movq (%rbx), %rcx
movb (%rcx), %cl
shll %cl, %eax
andl %ebp, %edx
addq %rbx, %rax
movb 0x180(%rdx,%rax), %al
movb %al, (%r15)
jmp 0x1dc3
movl %eax, %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat.c
// Function: write_fat_byte
static int write_fat_byte(struct ufat *uf, unsigned int offset,
			  uint8_t byte, uint8_t mask)
{
	ufat_block_t b = offset >> uf->dev->log2_block_size;
	unsigned int r = offset & ((1 << uf->dev->log2_block_size) - 1);
	int idx;
	uint8_t *data;

	idx = ufat_cache_open(uf, uf->bpb.fat_start + b, 0);
	if (idx < 0)
		return idx;

	data = ufat_cache_data(uf, idx);
	ufat_cache_write(uf, idx);

	data[r] = (data[r] & ~mask) | (byte & mask);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebx
movl %esi, %r12d
movq %rdi, %r14
movq (%rdi), %rax
movl (%rax), %r13d
movl %r13d, %ecx
shrl %cl, %esi
movl %edx, %r15d
addq 0x30(%rdi), %rsi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x1e45
pushq $-0x1
popq %rdx
movl %r13d, %ecx
shll %cl, %edx
notl %edx
andl %r12d, %edx
movq (%r14), %rcx
movb (%rcx), %cl
movl %eax, %esi
shll %cl, %eax
addq %r14, %rax
incl 0x20(%r14)
shlq $0x4, %rsi
orb $0x1, 0x80(%r14,%rsi)
movb 0x180(%rdx,%rax), %cl
xorb %cl, %r15b
andb %bl, %r15b
xorb %cl, %r15b
movb %r15b, 0x180(%rdx,%rax)
jmp 0x1e47
movl %eax, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_open_root
void ufat_open_root(struct ufat *uf, struct ufat_directory *dir)
{
	if (uf->bpb.root_cluster)
		dir->start = cluster_to_block(&uf->bpb, uf->bpb.root_cluster);
	else
		dir->start = uf->bpb.root_start;

	dir->uf = uf;
	dir->cur_block = dir->start;
	dir->cur_pos = 0;
}

// Assembly:
movl 0x68(%rdi), %eax
testl %eax, %eax
je 0x1e6d
addl $-0x2, %eax
movb 0x2c(%rdi), %cl
shll %cl, %eax
addq 0x48(%rdi), %rax
jmp 0x1e71
movq 0x58(%rdi), %rax
movq %rax, 0x18(%rsi)
movq %rdi, (%rsi)
movq %rax, 0x10(%rsi)
andl $0x0, 0x8(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_open_subdir
int ufat_open_subdir(struct ufat *uf, struct ufat_directory *dir,
		     const struct ufat_dirent *ent)
{
	if (!(ent->attributes & UFAT_ATTR_DIRECTORY))
		return -UFAT_ERR_NOT_DIRECTORY;

	if (ent->dirent_block == UFAT_BLOCK_NONE || !ent->first_cluster) {
		ufat_open_root(uf, dir);
		return 0;
	}

	dir->uf = uf;
	dir->start = cluster_to_block(&uf->bpb, ent->first_cluster);
	dir->cur_block = dir->start;
	dir->cur_pos = 0;

	return 0;
}

// Assembly:
testb $0x10, 0x2c(%rdx)
jne 0x1e8b
pushq $-0x7
popq %rax
retq
cmpq $-0x1, (%rdx)
je 0x1eb6
movl 0x3c(%rdx), %eax
testl %eax, %eax
je 0x1eb6
movq %rdi, (%rsi)
addl $-0x2, %eax
movb 0x2c(%rdi), %cl
shll %cl, %eax
addq 0x48(%rdi), %rax
movq %rax, 0x18(%rsi)
movq %rax, 0x10(%rsi)
andl $0x0, 0x8(%rsi)
xorl %eax, %eax
retq
pushq %rax
callq 0x1e58
xorl %eax, %eax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_dir_read
int ufat_dir_read(struct ufat_directory *dir, struct ufat_dirent *inf,
		  char *lfn_buf, int max_len)
{
	struct ufat_lfn_parser lfn;

	ufat_lfn_reset(&lfn);

	for (;;) {
		uint8_t data[UFAT_DIRENT_SIZE];
		int err;

		inf->dirent_block = dir->cur_block;
		inf->dirent_pos = dir->cur_pos;

		err = ufat_read_raw_dirent(dir, data);
		if (err)
			return err;

		err = ufat_advance_raw_dirent(dir, 0);
		if (err)
			return err;

		if (data[0x0b] == 0x0f && data[0] != 0xe5) {
			ufat_lfn_parse(&lfn, data,
				       inf->dirent_block, inf->dirent_pos);
		} else if (data[0] && data[0] != 0xe5) {
			ufat_parse_dirent(dir->uf->bpb.type, data, inf);

			if (ufat_short_checksum(inf->short_name,
						inf->short_ext) !=
			    lfn.short_checksum)
				ufat_lfn_reset(&lfn);

			if (inf->attributes & 0x08) {
				ufat_lfn_reset(&lfn);
				continue;
			}

			if (ufat_lfn_ok(&lfn)) {
				inf->lfn_block = lfn.start_block;
				inf->lfn_pos = lfn.start_pos;
			} else {
				inf->lfn_block = UFAT_BLOCK_NONE;
				inf->lfn_pos = 0;
			}

			if (lfn_buf)
				return format_name(&lfn, inf, lfn_buf, max_len);

			return 0;
		} else {
			ufat_lfn_reset(&lfn);
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movl %ecx, 0x4(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, %r15
leaq 0x30(%rsp), %r12
orl $-0x1, 0x14(%r12)
movq %rdi, %r13
leaq 0x1c(%rsi), %rbp
leaq 0x25(%rsi), %rbx
leaq 0x10(%rsp), %r14
movq 0x10(%r13), %rax
movq %rax, (%r15)
movl 0x8(%r13), %eax
movl %eax, 0x8(%r15)
movq %r13, %rdi
movq %r14, %rsi
callq 0x3012
testl %eax, %eax
jne 0x1ff6
movq %r13, %rdi
xorl %esi, %esi
callq 0x2eed
testl %eax, %eax
jne 0x1ff6
movb 0x10(%rsp), %al
cmpb $0xf, 0x1b(%rsp)
sete %cl
cmpb $-0x1b, %al
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1f68
movq (%r15), %rdx
movl 0x8(%r15), %ecx
movq %r12, %rdi
movq %r14, %rsi
callq 0x3617
jmp 0x1f08
movzbl %al, %eax
testl %eax, %eax
je 0x1fa5
cmpl $0xe5, %eax
je 0x1fa5
movq (%r13), %rax
movl 0x28(%rax), %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x31b5
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x37ab
cmpb 0x3c(%rsp), %al
je 0x1f9e
orl $-0x1, 0x44(%rsp)
testb $0x8, 0x2c(%r15)
je 0x1faf
orl $-0x1, 0x44(%rsp)
jmp 0x1f08
movl 0x44(%rsp), %esi
xorl %eax, %eax
movl %esi, %ecx
negl %ecx
movl $0x0, %ecx
sbbq %rcx, %rcx
orq 0x30(%rsp), %rcx
movl $0x0, %edx
testl %esi, %esi
jne 0x1fd3
movl 0x38(%rsp), %edx
movq %rcx, 0x10(%r15)
movl %edx, 0x18(%r15)
movq 0x8(%rsp), %rdx
testq %rdx, %rdx
je 0x1ff6
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
movl 0x4(%rsp), %ecx
callq 0x2008
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_dir_delete
int ufat_dir_delete(struct ufat *uf, struct ufat_dirent *ent)
{
	int err;

	if (ent->dirent_block == UFAT_BLOCK_NONE || ent->short_name[0] == '.')
		return -UFAT_ERR_IMMUTABLE;

	if (ent->attributes & UFAT_ATTR_DIRECTORY) {
		err = verify_empty_dir(uf, ent);
		if (err < 0)
			return err;
	}

	err = delete_entry(uf, ent);
	if (err < 0)
		return err;

	return ufat_free_chain(uf, ent->first_cluster);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
pushq $-0x9
popq %rbx
cmpq $-0x1, (%rsi)
je 0x20ae
movq %rsi, %r15
cmpb $0x2e, 0x1c(%rsi)
je 0x20ae
movq %rdi, %r14
testb $0x10, 0x2c(%r15)
jne 0x206d
movq %r14, %rdi
movq %r15, %rsi
callq 0x20be
testl %eax, %eax
js 0x20ac
movl 0x3c(%r15), %esi
movq %r14, %rdi
callq 0x1c39
jmp 0x20ac
leaq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x1e81
testl %eax, %eax
js 0x20ac
leaq 0x8(%rsp), %r12
leaq 0x28(%rsp), %r13
pushq $-0xa
popq %rbx
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x1ed0
testl %eax, %eax
js 0x20ac
jne 0x2050
cmpb $0x2e, 0x44(%rsp)
je 0x208e
jmp 0x20ae
movl %eax, %ebx
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: delete_entry
static int delete_entry(struct ufat *uf, struct ufat_dirent *ent)
{
	static const uint8_t del_marker = 0xe5;
	struct ufat_directory dir;

	dir.uf = uf;

	if (ent->lfn_block == UFAT_BLOCK_NONE) {
		dir.cur_block = ent->dirent_block;
		dir.cur_pos = ent->dirent_pos;
	} else {
		dir.cur_block = ent->lfn_block;
		dir.cur_pos = ent->lfn_pos;
	}

	for (;;) {
		int err;

		err = ufat_write_raw_dirent(&dir, &del_marker, 1);
		if (err < 0)
			return err;

		if (dir.cur_block == ent->dirent_block &&
		    dir.cur_pos == ent->dirent_pos)
			break;

		err = ufat_advance_raw_dirent(&dir, 0);
		if (err < 0)
			return err;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, 0x8(%rsp)
movq 0x10(%rsi), %rax
cmpq $-0x1, %rax
je 0x20de
pushq $0x18
jmp 0x20e3
movq (%rbx), %rax
pushq $0x8
popq %rcx
movl (%rbx,%rcx), %ecx
leaq 0x8(%rsp), %r14
movq %rax, 0x10(%r14)
movl %ecx, 0x8(%r14)
leaq 0x4086(%rip), %r15      # 0x6181
pushq $0x1
popq %rbp
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x2e74
testl %eax, %eax
js 0x2134
movq 0x18(%rsp), %rax
cmpq (%rbx), %rax
jne 0x2122
movl 0x10(%rsp), %eax
cmpl 0x8(%rbx), %eax
je 0x2132
movq %r14, %rdi
xorl %esi, %esi
callq 0x2eed
testl %eax, %eax
jns 0x20fe
jmp 0x2134
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_dir_create
int ufat_dir_create(struct ufat_directory *dir, struct ufat_dirent *ent,
		    const char *name)
{
	struct ufat_dirent check;
	int err;

	if (!ufat_lfn_is_legal(name))
		return -UFAT_ERR_ILLEGAL_NAME;

	if (!ufat_dir_find(dir, name, &check))
		return -UFAT_ERR_FILE_EXISTS;

	err = create_empty_dir(dir, &ent->first_cluster, ent);
	if (err < 0)
		return err;

	ent->file_size = 0;
	ent->attributes = (ent->attributes & UFAT_ATTR_USER) |
		UFAT_ATTR_DIRECTORY;

	err = insert_dirent(dir, ent, name);
	if (err < 0) {
		ufat_free_chain(dir->uf, ent->first_cluster);
		return err;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x3317
testl %eax, %eax
je 0x22ba
leaq 0x50(%rsp), %rdx
movq %r14, %rdi
movq %r15, %rsi
callq 0x22ef
testl %eax, %eax
je 0x22be
movq (%r14), %rdi
pushq $0x1
popq %rsi
leaq 0x4(%rsp), %rdx
callq 0x1c94
testl %eax, %eax
js 0x22d7
movq (%r14), %rdi
movl 0x4(%rsp), %esi
callq 0x3119
movq (%r14), %rdi
movl 0x4(%rsp), %esi
testl %eax, %eax
js 0x22dc
addl $-0x2, %esi
movb 0x2c(%rdi), %cl
shll %cl, %esi
addq 0x48(%rdi), %rsi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x1492
movl %eax, %r12d
movq (%r14), %rax
testl %r12d, %r12d
js 0x22e1
incl 0x20(%rax)
movl %r12d, %ecx
shlq $0x4, %rcx
orb $0x1, 0x80(%rax,%rcx)
pushq $0x9
popq %rcx
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movw $0x2e, %cx
movw %cx, 0x1c(%r13)
movb $0x0, 0x25(%r13)
movl $0x10, 0x2c(%r13)
movl 0x4(%rsp), %ecx
movl %ecx, 0x3c(%r13)
andl $0x0, 0x40(%r13)
movq (%rax), %rcx
movb (%rcx), %cl
movl %r12d, %edx
shll %cl, %edx
leaq (%rax,%rdx), %rsi
addq $0x180, %rsi            # imm = 0x180
movq %r13, %rdi
callq 0x325f
movw $0x2e, %ax
movw %ax, 0x1d(%r13)
movq (%r14), %rax
movq 0x18(%r14), %rdx
subq 0x48(%rax), %rdx
jb 0x225c
movb 0x2c(%rax), %cl
shrq %cl, %rdx
addl $0x2, %edx
movl %edx, %ebp
leaq 0x8(%rsp), %rdi
movl %ebp, 0x3c(%rdi)
movq (%rax), %rcx
movb (%rcx), %cl
shll %cl, %r12d
leaq (%rax,%r12), %rsi
addq $0x1a0, %rsi            # imm = 0x1A0
callq 0x325f
movl 0x4(%rsp), %eax
movl %eax, 0x3c(%rbx)
andl $0x0, 0x40(%rbx)
movl 0x2c(%rbx), %eax
andl $0x27, %eax
orl $0x10, %eax
movl %eax, 0x2c(%rbx)
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2352
xorl %r12d, %r12d
testl %eax, %eax
jns 0x22c2
movl %eax, %ebp
movq (%r14), %rdi
movl 0x3c(%rbx), %esi
callq 0x1c39
movl %ebp, %r12d
jmp 0x22c2
pushq $-0xb
jmp 0x22c0
pushq $-0xc
popq %r12
movl %r12d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %eax, %r12d
jmp 0x22c2
movl %eax, %r12d
jmp 0x22e8
movl 0x4(%rsp), %esi
movq %rax, %rdi
callq 0x1c39
jmp 0x22c2
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_dir_find
int ufat_dir_find(struct ufat_directory *dir,
		  const char *target, struct ufat_dirent *inf)
{
	ufat_dir_rewind(dir);

	for (;;) {
		char name[UFAT_LFN_MAX_UTF8];
		int err = ufat_dir_read(dir, inf, name, sizeof(name));

		if (err)
			return err;

		if (ufat_compare_name(target, name, 0) >= 0)
			break;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x300, %rsp            # imm = 0x300
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x18(%rdi), %rax
movq %rax, 0x10(%rdi)
andl $0x0, 0x8(%rdi)
movq %rsp, %r12
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movl $0x300, %ecx            # imm = 0x300
callq 0x1ed0
movl %eax, %ebp
testl %eax, %eax
jne 0x2340
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x35b5
testl %eax, %eax
js 0x2316
movl %ebp, %eax
addq $0x300, %rsp            # imm = 0x300
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_dir_mkfile
int ufat_dir_mkfile(struct ufat_directory *dir, struct ufat_dirent *ent,
		    const char *name)
{
	struct ufat_dirent check;
	int err;

	if (!ufat_lfn_is_legal(name))
		return -UFAT_ERR_ILLEGAL_NAME;

	if (!ufat_dir_find(dir, name, &check))
		return -UFAT_ERR_FILE_EXISTS;

	ent->file_size = 0;
	ent->first_cluster = 0;
	ent->attributes &= UFAT_ATTR_USER;

	err = insert_dirent(dir, ent, name);
	if (err < 0)
		return err;

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x3317
testl %eax, %eax
je 0x24fb
leaq 0x8(%rsp), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22ef
testl %eax, %eax
je 0x24ff
andq $0x0, 0x3c(%r14)
andl $0x27, 0x2c(%r14)
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2352
movl %eax, %ecx
sarl $0x1f, %eax
andl %ecx, %eax
jmp 0x2502
pushq $-0xb
jmp 0x2501
pushq $-0xc
popq %rax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_dir_find_path
int ufat_dir_find_path(struct ufat_directory *dir,
		       const char *path, struct ufat_dirent *ent,
		       const char **path_out)
{
	int at_root = 1;

	ufat_dir_rewind(dir);

	while (*path) {
		int len = 0;

		/* Ignore blank components */
		if (*path == '/' || *path == '\\') {
			path++;
			continue;
		}

		/* Descend if necessary */
		if (!at_root) {
			int err = ufat_open_subdir(dir->uf, dir, ent);

			if (err < 0)
				return err;
		}

		/* Search for this component */
		for (;;) {
			char name[UFAT_LFN_MAX_UTF8];
			int err = ufat_dir_read(dir, ent,
						name, sizeof(name));

			if (err < 0)
				return err;

			if (err) {
				if (path_out)
					*path_out = path;
				return 1;
			}

			len = ufat_compare_name(path, name, 1);
			if (len >= 0)
				break;
		}

		/* Skip over this component */
		path += len;
		if (*path)
			path++;
		at_root = 0;
	}

	if (at_root) {
		/* Pseudo-dirent for root directory */
		memset(ent, 0, sizeof(*ent));
		ent->dirent_block = UFAT_BLOCK_NONE;
		ent->attributes = UFAT_ATTR_DIRECTORY;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %r13
movq 0x18(%rdi), %rax
movq %rax, 0x10(%rdi)
andl $0x0, 0x8(%rdi)
movq %rsi, %r12
xorl %eax, %eax
movq %rsp, %rbp
pushq $0x1
popq %rbx
movzbl (%r12), %ecx
cmpl $0x2f, %ecx
je 0x254c
cmpl $0x5c, %ecx
jne 0x2551
incq %r12
jmp 0x253d
testl %ecx, %ecx
je 0x25a8
testb $0x1, %al
je 0x256c
movq (%r13), %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x1e81
testl %eax, %eax
js 0x25d3
movq %r13, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movl $0x300, %ecx            # imm = 0x300
callq 0x1ed0
testl %eax, %eax
js 0x25d3
jne 0x25d7
movq %r12, %rdi
movq %rbp, %rsi
movl %ebx, %edx
callq 0x35b5
testl %eax, %eax
js 0x256c
movl %eax, %eax
cmpb $0x1, (%r12,%rax)
sbbq $-0x1, %rax
addq %rax, %r12
movb $0x1, %al
jmp 0x253d
xorl %ebx, %ebx
testb $0x1, %al
jne 0x25df
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%r14)
movups %xmm0, 0x38(%r14)
movups %xmm0, 0x18(%r14)
movups %xmm0, 0x8(%r14)
orq $-0x1, (%r14)
movl $0x10, 0x2c(%r14)
jmp 0x25df
movl %eax, %ebx
jmp 0x25df
testq %r15, %r15
je 0x25df
movq %r12, (%r15)
movl %ebx, %eax
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_get_filename
int ufat_get_filename(struct ufat *uf,
		      const struct ufat_dirent *ent,
		      char *name_buf, int max_len)
{
	struct ufat_lfn_parser lfn;

	ufat_lfn_reset(&lfn);

	if (ent->lfn_block != UFAT_BLOCK_NONE) {
		struct ufat_directory dir;

		dir.uf = uf;
		dir.cur_block = ent->lfn_block;
		dir.cur_pos = ent->lfn_pos;

		while (!(dir.cur_block == ent->dirent_block &&
			 dir.cur_pos == ent->dirent_pos) &&
		       dir.cur_block != UFAT_BLOCK_NONE) {
			uint8_t data[UFAT_DIRENT_SIZE];
			int err;

			err = ufat_read_raw_dirent(&dir, data);
			if (err < 0)
				return err;

			err = ufat_advance_raw_dirent(&dir, 0);
			if (err < 0)
				return err;

			ufat_lfn_parse(&lfn, data,
				       dir.cur_block, dir.cur_pos);
		}
	}

	return format_name(&lfn, ent, name_buf, max_len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
movl %ecx, %ebx
movq %rdx, %r14
orl $-0x1, 0x54(%rsp)
movq %rsi, %r15
movq 0x10(%rsi), %rax
cmpq $-0x1, %rax
je 0x268f
movq %rsp, %r12
movq %rdi, (%r12)
movq %rax, 0x10(%r12)
movl 0x18(%r15), %ecx
movl %ecx, 0x8(%r12)
leaq 0x20(%rsp), %r13
leaq 0x40(%rsp), %rbp
cmpq (%r15), %rax
jne 0x2651
cmpq $-0x1, %rax
je 0x268f
movl 0x8(%r15), %eax
cmpl %eax, 0x8(%rsp)
jne 0x2657
jmp 0x268f
cmpq $-0x1, %rax
je 0x268f
movq %r12, %rdi
movq %r13, %rsi
callq 0x3012
testl %eax, %eax
js 0x26a1
movq %r12, %rdi
xorl %esi, %esi
callq 0x2eed
testl %eax, %eax
js 0x26a1
movq 0x10(%rsp), %rdx
movl 0x8(%rsp), %ecx
movq %rbp, %rdi
movq %r13, %rsi
callq 0x3617
movq 0x10(%rsp), %rax
jmp 0x263a
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
movl %ebx, %ecx
callq 0x2008
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_dir.c
// Function: ufat_move
int ufat_move(struct ufat_dirent *ent, struct ufat_directory *dst,
	      const char *new_name)
{
	struct ufat_dirent new_ent;
	int err;

	if (!ufat_lfn_is_legal(new_name))
		return -UFAT_ERR_ILLEGAL_NAME;

	if (!ufat_dir_find(dst, new_name, &new_ent))
		return -UFAT_ERR_FILE_EXISTS;

	if (ent->short_name[0] == '.' || ent->dirent_block == UFAT_BLOCK_NONE)
		return -UFAT_ERR_IMMUTABLE;

	memcpy(&new_ent, ent, sizeof(new_ent));
	err = insert_dirent(dst, &new_ent, new_name);
	if (err < 0)
		return err;

	err = delete_entry(dst->uf, ent);
	if (err < 0) {
		delete_entry(dst->uf, &new_ent);
		return err;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
callq 0x3317
testl %eax, %eax
je 0x2737
movq %rsp, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x22ef
testl %eax, %eax
je 0x273b
pushq $-0x9
popq %rax
cmpb $0x2e, 0x1c(%r14)
je 0x273e
cmpq $-0x1, (%r14)
je 0x273e
pushq $0x9
popq %rcx
movq %rsp, %rax
movq %rax, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq %rbx, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x2352
testl %eax, %eax
js 0x273e
movq (%rbx), %rdi
movq %r14, %rsi
callq 0x20be
movl %eax, %ebp
xorl %eax, %eax
testl %ebp, %ebp
jns 0x273e
movq (%rbx), %rdi
movq %rsp, %rsi
callq 0x20be
movl %ebp, %eax
jmp 0x273e
pushq $-0xb
jmp 0x273d
pushq $-0xc
popq %rax
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: ufat_open_file
int ufat_open_file(struct ufat *uf, struct ufat_file *f,
		   const struct ufat_dirent *ent)
{
	if (ent->attributes & UFAT_ATTR_DIRECTORY)
		return -UFAT_ERR_NOT_FILE;

	f->uf = uf;
	f->dirent_block = ent->dirent_block;
	f->dirent_pos = ent->dirent_pos;
	f->start = ent->first_cluster;
	f->file_size = ent->file_size;
	f->prev_cluster = 0;
	f->cur_cluster = f->start;
	f->cur_pos = 0;

	return 0;
}

// Assembly:
testb $0x10, 0x2c(%rdx)
jne 0x277c
movq %rdi, (%rsi)
movq (%rdx), %rax
movq %rax, 0x8(%rsi)
movl 0x8(%rdx), %eax
movl %eax, 0x10(%rsi)
movl 0x3c(%rdx), %eax
movl %eax, 0x14(%rsi)
movl 0x40(%rdx), %ecx
movl %ecx, 0x18(%rsi)
andl $0x0, 0x1c(%rsi)
movl %eax, 0x20(%rsi)
andl $0x0, 0x24(%rsi)
xorl %eax, %eax
retq
pushq $-0x8
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: advance_ptr
static int advance_ptr(struct ufat_file *f, ufat_size_t nbytes)
{
	const unsigned int log2_cluster_size =
		f->uf->dev->log2_block_size +
		f->uf->bpb.log2_blocks_per_cluster;
	ufat_size_t end_pos;
	unsigned int nclusters;
	ufat_cluster_t c = f->cur_cluster;
	ufat_cluster_t prev = f->prev_cluster;

	end_pos = f->cur_pos + nbytes;

	nclusters = (end_pos >> log2_cluster_size) -
		(f->cur_pos >> log2_cluster_size);

	while (nclusters) {
		ufat_cluster_t next;
		int i;

		i = ufat_read_fat(f->uf, c, &next);
		if (i < 0)
			return i;

		prev = c;
		c = next;
		nclusters--;
	}

	f->prev_cluster = prev;
	f->cur_cluster = c;
	f->cur_pos += nbytes;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rax
movq (%rax), %rdx
movl 0x2c(%rax), %ecx
addl (%rdx), %ecx
movl 0x24(%rdi), %r12d
leal (%r12,%rbx), %edx
shrl %cl, %edx
shrl %cl, %r12d
movl 0x20(%rdi), %eax
movl 0x1c(%rdi), %ecx
subl %edx, %r12d
leaq 0xc(%rsp), %r15
movl %eax, %ebp
testl %r12d, %r12d
je 0x27f6
movq (%r14), %rdi
movl %ebp, %esi
movq %r15, %rdx
callq 0x18c8
testl %eax, %eax
js 0x2804
movl 0xc(%rsp), %eax
incl %r12d
movl %ebp, %ecx
jmp 0x27d3
movl %ecx, 0x1c(%r14)
movl %ebp, 0x20(%r14)
addl %ebx, 0x24(%r14)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: ufat_file_read
int ufat_file_read(struct ufat_file *f, void *buf, ufat_size_t size)
{
	ufat_size_t total;
	int len;

	if (size > f->file_size - f->cur_pos)
		size = f->file_size - f->cur_pos;
	total = size;

	/* Read partial block ends */
	len = read_block_fragment(f, buf, size);
	if (len < 0)
		return len;

	buf = (char*)buf + len;
	size -= len;

	/* Read contiguous blocks within a cluster */
	for (;;) {
		len = read_blocks(f, buf, size);

		if (len < 0)
			return len;

		if (!len)
			break;

		buf = (char*)buf + len;
		size -= len;
	}

	/* Read remaining block fragment */
	len = read_block_fragment(f, buf, size);
	if (len < 0)
		return len;

	return total;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movl 0x18(%rdi), %ebx
subl 0x24(%rdi), %ebx
movq %rsi, %r15
cmpl %edx, %ebx
cmovael %edx, %ebx
movl %ebx, %edx
callq 0x2954
movl %eax, %ecx
testl %eax, %eax
js 0x2943
movl %ecx, %eax
addq %rax, %r15
movl %ebx, 0xc(%rsp)
subl %ecx, %ebx
movq (%r14), %rbp
movl 0x2c(%rbp), %eax
pushq $0x1
popq %rcx
movl %ecx, %esi
movl %eax, %ecx
shll %cl, %esi
movq (%rbp), %rcx
movl (%rcx), %ecx
movl 0x24(%r14), %edi
shrl %cl, %edi
leal -0x1(%rsi), %edx
andl %edi, %edx
subl %edx, %esi
movl %ebx, %r13d
shrl %cl, %r13d
cmpl %esi, %r13d
jb 0x287c
movl %esi, %r13d
testl %r13d, %r13d
je 0x291b
movl 0x20(%r14), %esi
addl $-0x2, %esi
cmpl $0xfffffed, %esi        # imm = 0xFFFFFED
ja 0x2933
movl %ecx, 0x14(%rsp)
movl %ebx, 0x10(%rsp)
movq %r14, %rbx
movq %r15, %r14
movl %eax, %ecx
shll %cl, %esi
movl %edx, %r15d
addq %rsi, %r15
addq 0x48(%rbp), %r15
movl %r13d, %r12d
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x130c
testl %eax, %eax
js 0x2937
movq (%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %r14, %r15
movq %r14, %rcx
callq *0x8(%rdi)
testl %eax, %eax
js 0x293b
incl 0x8(%rbp)
addl %r13d, 0x10(%rbp)
movl 0x14(%rsp), %ecx
shll %cl, %r13d
movq %rbx, %r14
movq %rbx, %rdi
movl %r13d, %esi
callq 0x279c
testl %eax, %eax
cmovsl %eax, %r13d
testl %r13d, %r13d
js 0x2940
movl 0x10(%rsp), %ebx
je 0x291b
movl %r13d, %eax
addq %rax, %r15
subl %r13d, %ebx
jmp 0x284c
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x2954
testl %eax, %eax
movl 0xc(%rsp), %ecx
cmovsl %eax, %ecx
jmp 0x2943
pushq $-0x5
jmp 0x293d
movl %eax, %ecx
jmp 0x2943
pushq $-0x1
popq %rcx
jmp 0x2943
movl %r13d, %ecx
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: read_block_fragment
static int read_block_fragment(struct ufat_file *f, char *buf, ufat_size_t size)
{
	const struct ufat_bpb *bpb = &f->uf->bpb;
	const unsigned int log2_block_size = f->uf->dev->log2_block_size;
	const unsigned int block_size = 1 << log2_block_size;
	const unsigned int offset = f->cur_pos & (block_size - 1);
	const unsigned int remainder = block_size - offset;
	const ufat_block_t cur_block =
		cluster_to_block(bpb, f->cur_cluster) +
		((f->cur_pos >> log2_block_size) &
		 ((1 << bpb->log2_blocks_per_cluster) - 1));
	int i;

	if (size > remainder)
		size = remainder;
	size &= (block_size - 1);
	if (!size)
		return 0;

	if (!UFAT_CLUSTER_IS_PTR(f->cur_cluster))
		return -UFAT_ERR_INVALID_CLUSTER;

	i = ufat_cache_open(f->uf, cur_block, 0);
	if (i < 0)
		return i;

	memcpy(buf, ufat_cache_data(f->uf, i) + offset, size);
	i = advance_ptr(f, size);
	if (i < 0)
		return i;

	return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movq (%rdi), %rdi
movq (%rdi), %rax
movb (%rax), %al
pushq $0x1
popq %rbx
movl %eax, %ecx
shll %cl, %ebx
movq %rsi, %r15
movl 0x24(%r14), %esi
leal -0x1(%rbx), %r11d
movl %r11d, %ebp
andl %esi, %ebp
subl %ebp, %ebx
movl 0x20(%r14), %r10d
addl $-0x2, %r10d
movb 0x2c(%rdi), %r8b
movl %r10d, %r9d
movl %r8d, %ecx
shll %cl, %r9d
movl %eax, %ecx
shrl %cl, %esi
pushq $-0x1
popq %rax
movl %r8d, %ecx
shll %cl, %eax
cmpl %edx, %ebx
cmovael %edx, %ebx
andl %r11d, %ebx
je 0x2a00
cmpl $0xfffffed, %r10d       # imm = 0xFFFFFED
ja 0x2a04
addq 0x48(%rdi), %r9
notl %eax
andl %eax, %esi
addq %r9, %rsi
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x2a07
movq (%r14), %rdx
movq (%rdx), %rcx
movb (%rcx), %cl
shll %cl, %eax
addq %rdx, %rax
movl %ebp, %ecx
leaq (%rcx,%rax), %rsi
addq $0x180, %rsi            # imm = 0x180
movl %ebx, %edx
movq %r15, %rdi
callq 0x1160
movq %r14, %rdi
movl %ebx, %esi
callq 0x279c
testl %eax, %eax
cmovsl %eax, %ebx
movl %ebx, %eax
jmp 0x2a07
xorl %eax, %eax
jmp 0x2a07
pushq $-0x5
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: ufat_file_write
int ufat_file_write(struct ufat_file *f, const void *buf, ufat_size_t len)
{
	const ufat_size_t max_write = ~f->cur_pos;
	ufat_size_t total;
	int i;

	if (len > max_write)
		len = max_write;
	total = len;

	/* Write a partial block fragment */
	i = write_block_fragment(f, buf, len);
	if (i < 0)
		return i;

	buf = (const char*)buf + i;
	len -= i;

	/* Write complete blocks */
	for (;;) {
		i = write_blocks(f, buf, len);

		if (i < 0)
			return i;

		if (!i)
			break;

		buf = (const char*)buf + i;
		len -= i;
	}

	/* Write a partial block fragment */
	i = write_block_fragment(f, buf, len);
	if (i < 0)
		return i;

	if (f->cur_pos > f->file_size) {
		i = set_size(f, f->cur_pos);
		if (i < 0)
			return i;
	}

	return total;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r15
movq %rdi, %r14
movl 0x24(%rdi), %ebx
notl %ebx
cmpl %edx, %ebx
cmovael %edx, %ebx
movl %ebx, %edx
callq 0x2b56
testl %eax, %eax
js 0x2b47
movl %eax, %ecx
addq %rcx, %r15
movl %ebx, 0x8(%rsp)
movl %ebx, %edx
subl %eax, %edx
movq (%r14), %r13
movq (%r13), %rax
movl (%rax), %ebx
movb 0x2c(%r13), %cl
pushq $0x1
popq %rax
shll %cl, %eax
movl 0x24(%r14), %esi
movl %ebx, %ecx
shrl %cl, %esi
leal -0x1(%rax), %ebp
andl %esi, %ebp
subl %ebp, %eax
movl %edx, %r12d
shrl %cl, %r12d
cmpl %eax, %r12d
cmovael %eax, %r12d
testl %r12d, %r12d
je 0x2b14
movl %edx, 0xc(%rsp)
movq %r14, %rdi
callq 0x2dfa
testl %eax, %eax
js 0x2b47
movl 0x20(%r14), %eax
addl $-0x2, %eax
movb 0x2c(%r13), %cl
shll %cl, %eax
movq %r15, 0x10(%rsp)
movl %ebp, %r15d
addq 0x48(%r13), %r15
addq %rax, %r15
movl %r12d, %ebp
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x1458
movq (%r13), %rdi
movq %r15, %rsi
movq 0x10(%rsp), %r15
movq %rbp, %rdx
movq %r15, %rcx
callq *0x10(%rdi)
testl %eax, %eax
js 0x2b3f
incl 0xc(%r13)
addl %r12d, 0x14(%r13)
movl %ebx, %ecx
shll %cl, %r12d
movq %r14, %rdi
movl %r12d, %esi
callq 0x279c
testl %eax, %eax
cmovsl %eax, %r12d
testl %r12d, %r12d
js 0x2b44
movl 0xc(%rsp), %edx
je 0x2b14
movl %r12d, %eax
addq %rax, %r15
subl %r12d, %edx
jmp 0x2a4c
movq %r14, %rdi
movq %r15, %rsi
callq 0x2b56
testl %eax, %eax
js 0x2b47
movl 0x24(%r14), %esi
cmpl 0x18(%r14), %esi
jbe 0x2b39
movq %r14, %rdi
callq 0x2c2f
testl %eax, %eax
js 0x2b47
movl 0x8(%rsp), %eax
jmp 0x2b47
pushq $-0x1
popq %rax
jmp 0x2b47
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: write_block_fragment
static int write_block_fragment(struct ufat_file *f, const char *buf,
				ufat_size_t size)
{
	const struct ufat_bpb *bpb = &f->uf->bpb;
	const unsigned int log2_block_size = f->uf->dev->log2_block_size;
	const unsigned int block_size = 1 << log2_block_size;
	const unsigned int offset = f->cur_pos & (block_size - 1);
	const unsigned int remainder = block_size - offset;
	ufat_block_t cur_block;
	int i;

	if (size > remainder)
		size = remainder;
	size &= (block_size - 1);
	if (!size)
		return 0;

	i = ensure_room(f);
	if (i < 0)
		return i;

	cur_block =
		cluster_to_block(bpb, f->cur_cluster) +
		((f->cur_pos >> log2_block_size) &
		 ((1 << bpb->log2_blocks_per_cluster) - 1));

	i = ufat_cache_open(f->uf, cur_block, 0);
	if (i < 0)
		return i;

	ufat_cache_write(f->uf, i);
	memcpy(ufat_cache_data(f->uf, i) + offset, buf, size);

	i = advance_ptr(f, size);
	if (i < 0)
		return i;

	return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq (%rdi), %r13
movq (%r13), %rax
movl (%rax), %ebp
pushq $0x1
popq %rbx
movl %ebp, %ecx
shll %cl, %ebx
leal -0x1(%rbx), %eax
movl 0x24(%rdi), %r12d
andl %eax, %r12d
subl %r12d, %ebx
cmpl %edx, %ebx
cmovael %edx, %ebx
andl %eax, %ebx
je 0x2c1e
movq %rsi, %r15
movq %rdi, %r14
callq 0x2dfa
testl %eax, %eax
js 0x2c20
movl 0x20(%r14), %edx
addl $-0x2, %edx
movb 0x2c(%r13), %al
movl %eax, %ecx
shll %cl, %edx
addq 0x48(%r13), %rdx
movl 0x24(%r14), %edi
movl %ebp, %ecx
shrl %cl, %edi
pushq $-0x1
popq %rsi
movl %eax, %ecx
shll %cl, %esi
notl %esi
andl %edi, %esi
addq %rdx, %rsi
movq (%r14), %rdi
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x2c20
movq (%r14), %rdx
incl 0x20(%rdx)
movl %eax, %ecx
shlq $0x4, %rcx
orb $0x1, 0x80(%rdx,%rcx)
movq (%rdx), %rcx
movb (%rcx), %cl
shll %cl, %eax
addq %rdx, %rax
movl %r12d, %ecx
leaq (%rcx,%rax), %rdi
addq $0x180, %rdi            # imm = 0x180
movl %ebx, %edx
movq %r15, %rsi
callq 0x1160
movq %r14, %rdi
movl %ebx, %esi
callq 0x279c
testl %eax, %eax
cmovsl %eax, %ebx
movl %ebx, %eax
jmp 0x2c20
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: set_size
static int set_size(struct ufat_file *f, ufat_size_t s)
{
	int idx = ufat_cache_open(f->uf, f->dirent_block, 0);

	if (idx < 0)
		return idx;

	ufat_cache_write(f->uf, idx);
	w32(ufat_cache_data(f->uf, idx) +
	    f->dirent_pos * UFAT_DIRENT_SIZE + 0x1c, s);

	f->file_size = s;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %rsi
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x2c7e
movq (%r14), %rdx
incl 0x20(%rdx)
movl %eax, %ecx
shlq $0x4, %rcx
orb $0x1, 0x80(%rdx,%rcx)
movq (%rdx), %rcx
movb (%rcx), %cl
shll %cl, %eax
addq %rdx, %rax
movl 0x10(%r14), %ecx
shll $0x5, %ecx
movl %ebp, 0x19c(%rcx,%rax)
movl %ebp, 0x18(%r14)
jmp 0x2c80
movl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: ufat_file_truncate
int ufat_file_truncate(struct ufat_file *f)
{
	const unsigned int
		cluster_size = 1 << (f->uf->bpb.log2_blocks_per_cluster +
				     f->uf->dev->log2_block_size);
	int err;

	err = set_size(f, f->cur_pos);
	if (err < 0)
		return err;

	if (!f->file_size) {
		ufat_cluster_t old_start = f->start;

		err = set_start(f, 0);
		if (err < 0)
			return err;

		if (UFAT_CLUSTER_IS_PTR(old_start)) {
			err = ufat_free_chain(f->uf, old_start);
			if (err < 0)
				return err;
		}

		f->cur_cluster = 0;
		return 0;
	}

	if (f->file_size & (cluster_size - 1)) {
		ufat_cluster_t tail;

		err = ufat_read_fat(f->uf, f->cur_cluster, &tail);
		if (err < 0)
			return err;

		err = ufat_write_fat(f->uf, f->cur_cluster, UFAT_CLUSTER_EOC);
		if (err < 0)
			return err;

		if (UFAT_CLUSTER_IS_PTR(tail))
			return ufat_free_chain(f->uf, tail);

		return 0;
	}

	if (UFAT_CLUSTER_IS_PTR(f->cur_cluster)) {
		err = ufat_write_fat(f->uf, f->prev_cluster, UFAT_CLUSTER_EOC);
		if (err < 0)
			return err;

		ufat_free_chain(f->uf, f->cur_cluster);
		f->cur_cluster = 0;
		return 0;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %rcx
movl (%rcx), %r14d
addl 0x2c(%rax), %r14d
movl 0x24(%rdi), %esi
callq 0x2c2f
testl %eax, %eax
js 0x2d76
movl 0x18(%rbx), %eax
testl %eax, %eax
je 0x2d0e
pushq $-0x1
popq %rdx
movl %r14d, %ecx
shll %cl, %edx
notl %edx
testl %edx, %eax
je 0x2d42
movq (%rbx), %rdi
movl 0x20(%rbx), %esi
leaq 0xc(%rsp), %rdx
callq 0x18c8
testl %eax, %eax
js 0x2d76
movq (%rbx), %rdi
movl 0x20(%rbx), %esi
movl $0xffffff8, %edx        # imm = 0xFFFFFF8
callq 0x1aac
testl %eax, %eax
js 0x2d76
movl 0xc(%rsp), %esi
leal -0x2(%rsi), %eax
xorl %ebp, %ebp
cmpl $0xfffffed, %eax        # imm = 0xFFFFFED
ja 0x2d78
movq (%rbx), %rdi
callq 0x1c39
jmp 0x2d76
movl 0x14(%rbx), %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2d83
testl %eax, %eax
js 0x2d76
leal -0x2(%r14), %eax
cmpl $0xfffffed, %eax        # imm = 0xFFFFFED
ja 0x2d3a
movq (%rbx), %rdi
movl %r14d, %esi
callq 0x1c39
testl %eax, %eax
js 0x2d76
andl $0x0, 0x20(%rbx)
xorl %ebp, %ebp
jmp 0x2d78
movl 0x20(%rbx), %eax
addl $-0x2, %eax
xorl %ebp, %ebp
cmpl $0xfffffed, %eax        # imm = 0xFFFFFED
ja 0x2d78
movq (%rbx), %rdi
movl 0x1c(%rbx), %esi
movl $0xffffff8, %edx        # imm = 0xFFFFFF8
callq 0x1aac
testl %eax, %eax
js 0x2d76
movq (%rbx), %rdi
movl 0x20(%rbx), %esi
callq 0x1c39
andl $0x0, 0x20(%rbx)
jmp 0x2d78
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: set_start
static int set_start(struct ufat_file *f, ufat_cluster_t s)
{
	int idx = ufat_cache_open(f->uf, f->dirent_block, 0);
	uint8_t *data;

	if (idx < 0)
		return idx;

	ufat_cache_write(f->uf, idx);
	data = ufat_cache_data(f->uf, idx) + f->dirent_pos * UFAT_DIRENT_SIZE;
	w16(data + 0x14, s >> 16);
	w16(data + 0x1a, s & 0xffff);

	f->start = s;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq (%rdi), %rdi
movq 0x8(%r14), %rsi
xorl %ebp, %ebp
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x2df1
movq (%r14), %rdx
incl 0x20(%rdx)
movl %eax, %ecx
shlq $0x4, %rcx
orb $0x1, 0x80(%rdx,%rcx)
movq (%rdx), %rcx
movb (%rcx), %cl
shll %cl, %eax
addq %rdx, %rax
movl 0x10(%r14), %ecx
shll $0x5, %ecx
movl %ebx, %edx
shrl $0x10, %edx
movb %dl, 0x194(%rcx,%rax)
movl %ebx, %edx
shrl $0x18, %edx
movb %dl, 0x195(%rcx,%rax)
movb %bl, 0x19a(%rcx,%rax)
movb %bh, 0x19b(%rcx,%rax)
movl %ebx, 0x14(%r14)
jmp 0x2df3
movl %eax, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_file.c
// Function: ensure_room
static int ensure_room(struct ufat_file *f)
{
	ufat_cluster_t c;
	int err;

	if (UFAT_CLUSTER_IS_PTR(f->cur_cluster))
		return 0;

	err = ufat_alloc_chain(f->uf, 1, &c);
	if (err < 0)
		return err;

	if (UFAT_CLUSTER_IS_PTR(f->prev_cluster))
		err = ufat_write_fat(f->uf, f->prev_cluster, c);
	else
		err = set_start(f, c);

	if (err < 0) {
		ufat_free_chain(f->uf, c);
		return err;
	}

	f->cur_cluster = c;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x20(%rdi), %eax
addl $-0x2, %eax
xorl %ebp, %ebp
cmpl $0xfffffee, %eax        # imm = 0xFFFFFEE
jb 0x2e6b
movq %rdi, %rbx
movq (%rdi), %rdi
pushq $0x1
popq %rsi
leaq 0x4(%rsp), %rdx
callq 0x1c94
testl %eax, %eax
js 0x2e3e
movl 0x1c(%rbx), %esi
leal -0x2(%rsi), %eax
cmpl $0xfffffed, %eax        # imm = 0xFFFFFED
ja 0x2e42
movq (%rbx), %rdi
movl 0x4(%rsp), %edx
callq 0x1aac
jmp 0x2e4e
movl %eax, %ebp
jmp 0x2e6b
movl 0x4(%rsp), %esi
movq %rbx, %rdi
callq 0x2d83
movl %eax, %ebp
testl %eax, %eax
js 0x2e5f
movl 0x4(%rsp), %eax
movl %eax, 0x20(%rbx)
xorl %ebp, %ebp
jmp 0x2e6b
movq (%rbx), %rdi
movl 0x4(%rsp), %esi
callq 0x1c39
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_ent.c
// Function: ufat_write_raw_dirent
int ufat_write_raw_dirent(struct ufat_directory *dir,
			  const uint8_t *data, unsigned int len)
{
	int idx;

	if (dir->cur_block == UFAT_BLOCK_NONE)
		return -UFAT_ERR_IO;

	idx = ufat_cache_open(dir->uf, dir->cur_block, 0);
	if (idx < 0)
		return idx;

	ufat_cache_write(dir->uf, idx);
	memcpy(ufat_cache_data(dir->uf, idx) +
	       dir->cur_pos * UFAT_DIRENT_SIZE,
	       data, len);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x10(%rdi), %rsi
cmpq $-0x1, %rsi
je 0x2ed9
movl %edx, %ebp
movq %rdi, %r15
movq (%rdi), %rdi
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x2ede
movq (%r15), %rdx
incl 0x20(%rdx)
movl %eax, %ecx
shlq $0x4, %rcx
orb $0x1, 0x80(%rdx,%rcx)
movq (%rdx), %rcx
movb (%rcx), %cl
shll %cl, %eax
addq %rdx, %rax
movl 0x8(%r15), %ecx
shll $0x5, %ecx
leaq (%rcx,%rax), %rdi
addq $0x180, %rdi            # imm = 0x180
movl %ebp, %edx
movq %r14, %rsi
callq 0x1160
jmp 0x2ee0
pushq $-0x1
popq %rbx
jmp 0x2ee0
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_ent.c
// Function: ufat_advance_raw_dirent
int ufat_advance_raw_dirent(struct ufat_directory *dir, int can_alloc)
{
	/* Advance the dirent pointer and check for a block overrun */
	dir->cur_pos++;
	if (dir->cur_pos * UFAT_DIRENT_SIZE >=
	    (1u << dir->uf->dev->log2_block_size)) {
		dir->cur_pos = 0;

		if (dir->cur_block < dir->uf->bpb.cluster_start) {
			/* FAT12/16 root directory */
			dir->cur_block++;
			if (dir->cur_block >= dir->uf->bpb.cluster_start)
				dir->cur_block = UFAT_BLOCK_NONE;

			return 0;
		}

		return advance_block_in_chain(dir, can_alloc);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl 0x8(%rdi), %eax
incl %eax
movl %eax, 0x8(%rdi)
shll $0x5, %eax
movq (%rdi), %r14
movq (%r14), %rcx
movb (%rcx), %cl
shrl %cl, %eax
xorl %ebp, %ebp
testl %eax, %eax
je 0x2fe6
movq %rdi, %rbx
andl $0x0, 0x8(%rdi)
movq 0x10(%rdi), %rax
movq 0x48(%r14), %rdx
movq %rax, %r15
subq %rdx, %r15
jae 0x2f45
incq %rax
cmpq %rdx, %rax
pushq $-0x1
popq %rcx
cmovbq %rax, %rcx
movq %rcx, 0x10(%rbx)
jmp 0x2fe6
movl %esi, %r12d
movb 0x2c(%r14), %cl
shrq %cl, %r15
incq %rax
movq %rax, %rsi
subq %rdx, %rsi
shrq %cl, %rsi
leal 0x2(%rsi), %ecx
movl %ecx, 0xc(%rsp)
cmpl %esi, %r15d
je 0x2f97
addl $0x2, %r15d
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
movl %r15d, %esi
callq 0x18c8
testl %eax, %eax
js 0x2fe4
movl 0xc(%rsp), %eax
addl $-0x2, %eax
cmpl $0xfffffed, %eax        # imm = 0xFFFFFED
ja 0x2f9f
movb 0x2c(%r14), %cl
shll %cl, %eax
addq 0x48(%r14), %rax
movq %rax, 0x10(%rbx)
xorl %ebp, %ebp
jmp 0x2fe6
testl %r12d, %r12d
je 0x2ff5
movq (%rbx), %rdi
pushq $0x1
popq %rsi
leaq 0xc(%rsp), %rdx
callq 0x1c94
testl %eax, %eax
js 0x2fe4
movq (%rbx), %rdi
movl 0xc(%rsp), %esi
callq 0x3119
movq (%rbx), %rdi
movl 0xc(%rsp), %edx
testl %eax, %eax
js 0x2ffc
movl %r15d, %esi
callq 0x1aac
testl %eax, %eax
js 0x3002
movl 0xc(%rsp), %eax
addl $-0x2, %eax
jmp 0x2f8d
movl %eax, %ebp
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
orq $-0x1, 0x10(%rbx)
jmp 0x2f9b
movl %eax, %ebp
movl %edx, %esi
jmp 0x300b
movl %eax, %ebp
movq (%rbx), %rdi
movl 0xc(%rsp), %esi
callq 0x1c39
jmp 0x2fe6
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_ent.c
// Function: ufat_read_raw_dirent
int ufat_read_raw_dirent(struct ufat_directory *dir, uint8_t *data)
{
	int idx;

	if (dir->cur_block == UFAT_BLOCK_NONE)
		return 1;

	idx = ufat_cache_open(dir->uf, dir->cur_block, 0);
	if (idx < 0)
		return idx;

	memcpy(data, ufat_cache_data(dir->uf, idx) +
	       dir->cur_pos * UFAT_DIRENT_SIZE,
	       UFAT_DIRENT_SIZE);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r14
movq 0x10(%rdi), %rsi
cmpq $-0x1, %rsi
je 0x3066
movq %rdi, %r15
movq (%rdi), %rdi
xorl %ebx, %ebx
xorl %edx, %edx
callq 0x1492
testl %eax, %eax
js 0x306b
movq (%r15), %rdx
movq (%rdx), %rcx
movb (%rcx), %cl
shll %cl, %eax
addq %rdx, %rax
movl 0x8(%r15), %ecx
shll $0x5, %ecx
movups 0x180(%rcx,%rax), %xmm0
movups 0x190(%rcx,%rax), %xmm1
movups %xmm1, 0x10(%r14)
movups %xmm0, (%r14)
jmp 0x306d
pushq $0x1
popq %rbx
jmp 0x306d
movl %eax, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_ent.c
// Function: ufat_allocate_raw_dirent
int ufat_allocate_raw_dirent(struct ufat_directory *dir, unsigned int count)
{
	ufat_block_t empty_start = UFAT_BLOCK_NONE;
	unsigned int empty_pos = 0;
	unsigned int empty_count = 0;

	ufat_dir_rewind(dir);

	for (;;) {
		uint8_t data[UFAT_DIRENT_SIZE];
		int err;

		err = ufat_read_raw_dirent(dir, data);
		if (err < 0)
			return err;

		/* Check to see if this raw dirent is empty. Keep track
		 * of contiguous chains of empty dirents.
		 */
		if (!data[0] || data[0] == 0xe5) {
			if (!empty_count) {
				empty_start = dir->cur_block;
				empty_pos = dir->cur_pos;
			}

			empty_count++;
		} else {
			empty_count = 0;
		}

		/* Is this chain long enough? */
		if (empty_count >= count)
			break;

		err = ufat_advance_raw_dirent(dir, 1);
		if (err < 0)
			return err;

		if (dir->cur_block == UFAT_BLOCK_NONE)
			return -UFAT_ERR_DIRECTORY_FULL;
	}

	/* Reposition at the start of the empty chain */
	dir->cur_block = empty_start;
	dir->cur_pos = empty_pos;

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
movq %rdi, %r14
callq 0x1ec3
movl $0x0, 0xc(%rsp)
pushq $-0x1
popq %rbx
leaq 0x10(%rsp), %r15
pushq $0x1
popq %r12
xorl %r13d, %r13d
movq %r14, %rdi
movq %r15, %rsi
callq 0x3012
testl %eax, %eax
js 0x310a
movzbl 0x10(%rsp), %eax
cmpl $0xe5, %eax
je 0x30c3
testl %eax, %eax
jne 0x30d9
testl %r13d, %r13d
jne 0x30d4
movq 0x10(%r14), %rbx
movl 0x8(%r14), %eax
movl %eax, 0xc(%rsp)
incl %r13d
jmp 0x30dc
xorl %r13d, %r13d
cmpl %ebp, %r13d
jae 0x30fc
movq %r14, %rdi
movl %r12d, %esi
callq 0x2eed
testl %eax, %eax
js 0x310a
cmpq $-0x1, 0x10(%r14)
jne 0x30a4
pushq $-0xe
popq %rax
jmp 0x310a
movq %rbx, 0x10(%r14)
movl 0xc(%rsp), %eax
movl %eax, 0x8(%r14)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_ent.c
// Function: ufat_init_dirent_cluster
int ufat_init_dirent_cluster(struct ufat *uf, ufat_cluster_t c)
{
	const struct ufat_bpb *bpb = &uf->bpb;
	const ufat_block_t start = cluster_to_block(bpb, c);
	const unsigned int count =
		1 << bpb->log2_blocks_per_cluster;
	const unsigned int block_size = 1 << uf->dev->log2_block_size;
	int i;

	for (i = count - 1; i >= 0; i--) {
		int idx = ufat_cache_open(uf, start + i, 1);

		if (idx < 0)
			return idx;

		ufat_cache_write(uf, idx);
		memset(ufat_cache_data(uf, idx), 0, block_size);
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
addl $-0x2, %ebx
movb 0x2c(%rdi), %al
movl %eax, %ecx
shll %cl, %ebx
movq (%rdi), %rcx
movb (%rcx), %cl
pushq $0x1
popq %r15
shlq %cl, %r15
addq 0x48(%rdi), %rbx
pushq $-0x1
popq %r13
movl %eax, %ecx
shll %cl, %r13d
notl %r13d
leaq 0x80(%rdi), %rbp
leaq 0x180(%rdi), %r12
testl %r13d, %r13d
js 0x31a2
movl %r13d, %esi
addq %rbx, %rsi
movq %r14, %rdi
pushq $0x1
popq %rdx
callq 0x1492
testl %eax, %eax
js 0x31a6
incl 0x20(%r14)
movl %eax, %ecx
shlq $0x4, %rcx
orb $0x1, (%rbp,%rcx)
movq (%r14), %rcx
movb (%rcx), %cl
shll %cl, %eax
addq %r12, %rax
movq %rax, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1110
decl %r13d
jmp 0x315d
xorl %eax, %eax
jmp 0x31a6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/dlbeer[P]ufat/ufat_ent.c
// Function: ufat_parse_dirent
void ufat_parse_dirent(ufat_fat_type_t type,
		       const uint8_t *data, struct ufat_dirent *inf)
{
	sn_copy(data, inf->short_name, 8);
	sn_copy(data + 0x08, inf->short_ext, 3);

	inf->attributes = data[0x0b];
	inf->create_time = r16(data + 0x0e);
	inf->create_date = r16(data + 0x10);
	inf->access_date = r16(data + 0x12);
	inf->modify_time = r16(data + 0x16);
	inf->modify_date = r16(data + 0x18);
	inf->file_size = r32(data + 0x1c);
	inf->first_cluster = r16(data + 0x1a);

	if (type == UFAT_TYPE_FAT32) {
		uint32_t high = r16(data + 0x14);

		inf->first_cluster |= high << 16;
	}
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
leaq 0x1c(%rdx), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x323b
leaq 0x8(%r14), %rdi
leaq 0x25(%rbx), %rsi
pushq $0x3
popq %rdx
callq 0x323b
movzbl 0xb(%r14), %eax
movl %eax, 0x2c(%rbx)
movzwl 0xe(%r14), %eax
movw %ax, 0x32(%rbx)
movzwl 0x10(%r14), %eax
movw %ax, 0x30(%rbx)
movzwl 0x12(%r14), %eax
movw %ax, 0x38(%rbx)
movzwl 0x16(%r14), %eax
movw %ax, 0x36(%rbx)
movzwl 0x18(%r14), %eax
movw %ax, 0x34(%rbx)
movl 0x1c(%r14), %eax
movl %eax, 0x40(%rbx)
movzwl 0x1a(%r14), %eax
movl %eax, 0x3c(%rbx)
cmpl $0x20, %ebp
jne 0x3236
movzwl 0x14(%r14), %ecx
shll $0x10, %ecx
orl %eax, %ecx
movl %ecx, 0x3c(%rbx)
popq %rbx
popq %r14
popq %rbp
retq