LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: fill_last_frag
static FRESULT fill_last_frag (
	FFOBJID* obj,	/* Pointer to the corresponding object */
	DWORD lcl,		/* Last cluster of the fragment */
	DWORD term		/* Value to set the last FAT entry */
)
{
	FRESULT res;


	while (obj->n_frag > 0) {	/* Create the chain of last fragment */
		res = put_fat(obj->fs, lcl - obj->n_frag + 1, (obj->n_frag > 1) ? lcl - obj->n_frag + 2 : term);
		if (res != FR_OK) return res;
		obj->n_frag--;
	}
	return FR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
jbe 0x7938
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
subl 0x1c(%rcx), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x1c(%rax)
jbe 0x7903
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
subl 0x1c(%rcx), %eax
addl $0x2, %eax
movl %eax, -0x2c(%rbp)
jmp 0x7909
movl -0x18(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x20(%rbp), %esi
movq -0x28(%rbp), %rdi
movl -0x2c(%rbp), %edx
callq 0xf180
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x7929
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x793f
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x1c(%rax)
jmp 0x78c2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: load_obj_xdir
static FRESULT load_obj_xdir (
	DIR* dp,			/* Blank directory object to be used to access containing direcotry */
	const FFOBJID* obj	/* Object with its containing directory information */
)
{
	FRESULT res;

	/* Open object containing directory */
	dp->obj.fs = obj->fs;
	dp->obj.sclust = obj->c_scl;
	dp->obj.stat = (BYTE)obj->c_size;
	dp->obj.objsize = obj->c_size & 0xFFFFFF00;
	dp->obj.n_frag = 0;
	dp->blk_ofs = obj->c_ofs;

	res = dir_sdi(dp, dp->blk_ofs);	/* Goto object's entry block */
	if (res == FR_OK) {
		res = load_xdir(dp);		/* Load the object's entry block */
	}
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0xc(%rax)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x10(%rbp), %rax
movl 0x24(%rax), %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
movl %eax, %eax
movl %eax, %ecx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1c(%rax)
movq -0x10(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x54(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x82b0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x79e2
movq -0x8(%rbp), %rdi
callq 0xf760
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: st_qword
static void st_qword (BYTE* ptr, QWORD val)	/* Store an 8-byte word in little-endian */
{
	*ptr++ = (BYTE)val; val >>= 8;
	*ptr++ = (BYTE)val; val >>= 8;
	*ptr++ = (BYTE)val; val >>= 8;
	*ptr++ = (BYTE)val; val >>= 8;
	*ptr++ = (BYTE)val; val >>= 8;
	*ptr++ = (BYTE)val; val >>= 8;
	*ptr++ = (BYTE)val; val >>= 8;
	*ptr++ = (BYTE)val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movb %al, %cl
movq -0x8(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movb %cl, (%rax)
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: sync_fs
static FRESULT sync_fs (	/* Returns FR_OK or FR_DISK_ERR */
	FATFS* fs		/* Filesystem object */
)
{
	FRESULT res;


	res = sync_window(fs);
	if (res == FR_OK) {
		if (fs->fs_type == FS_FAT32 && fs->fsi_flag == 1) {	/* FAT32: Update FSInfo sector if needed */
			/* Create FSInfo structure */
			mem_set(fs->win, 0, sizeof fs->win);
			st_word(fs->win + BS_55AA, 0xAA55);					/* Boot signature */
			st_dword(fs->win + FSI_LeadSig, 0x41615252);		/* Leading signature */
			st_dword(fs->win + FSI_StrucSig, 0x61417272);		/* Structure signature */
			st_dword(fs->win + FSI_Free_Count, fs->free_clst);	/* Number of free clusters */
			st_dword(fs->win + FSI_Nxt_Free, fs->last_clst);	/* Last allocated culuster */
			fs->winsect = fs->volbase + 1;						/* Write it into the FSInfo sector (Next to VBR) */
			disk_write(fs->pdrv, fs->win, fs->winsect, 1);
			fs->fsi_flag = 0;
		}
		/* Make sure that no pending write process in the lower layer */
		if (disk_ioctl(fs->pdrv, CTRL_SYNC, 0) != RES_OK) res = FR_DISK_ERR;
	}

	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xf540
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x7c42
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x3, %eax
jne 0x7c21
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x7c21
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x5f80
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
addq $0x1fe, %rdi            # imm = 0x1FE
movl $0xaa55, %esi           # imm = 0xAA55
callq 0x7c50
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
movl $0x41615252, %esi       # imm = 0x41615252
callq 0x5fc0
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
addq $0x1e4, %rdi            # imm = 0x1E4
movl $0x61417272, %esi       # imm = 0x61417272
callq 0x5fc0
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
addq $0x1e8, %rdi            # imm = 0x1E8
movq -0x8(%rbp), %rax
movl 0x24(%rax), %esi
callq 0x5fc0
movq -0x8(%rbp), %rdi
addq $0x60, %rdi
addq $0x1ec, %rdi            # imm = 0x1EC
movq -0x8(%rbp), %rax
movl 0x20(%rax), %esi
callq 0x5fc0
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rcx
addq $0x1, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
movb 0x1(%rax), %al
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rdx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
movq -0x8(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x8(%rbp), %rax
xorl %esi, %esi
xorl %ecx, %ecx
movl %ecx, %edx
movzbl 0x1(%rax), %edi
callq 0x1b20
cmpl $0x0, %eax
je 0x7c40
movl $0x1, -0xc(%rbp)
jmp 0x7c42
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: f_findnext
FRESULT f_findnext (
	DIR* dp,		/* Pointer to the open directory object */
	FILINFO* fno	/* Pointer to the file information structure */
)
{
	FRESULT res;


	for (;;) {
		res = f_readdir(dp, fno);		/* Get a directory item */
		if (res != FR_OK || !fno || !fno->fname[0]) break;	/* Terminate if any error or end of directory */
		if (pattern_match(dp->pat, fno->fname, 0, FIND_RECURS)) break;		/* Test for the file name */
#if FF_USE_LFN && FF_USE_FIND == 2
		if (pattern_match(dp->pat, fno->altname, 0, FIND_RECURS)) break;	/* Test for alternative name if exist */
#endif
	}
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8490
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x8dd7
cmpq $0x0, -0x10(%rbp)
je 0x8dd7
movq -0x10(%rbp), %rax
cmpb $0x0, 0x1a(%rax)
jne 0x8dd9
jmp 0x8dfe
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rdi
movq -0x10(%rbp), %rsi
addq $0x1a, %rsi
xorl %edx, %edx
movl $0x4, %ecx
callq 0x8e10
cmpl $0x0, %eax
je 0x8dfc
jmp 0x8dfe
jmp 0x8db0
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: f_findfirst
FRESULT f_findfirst (
	DIR* dp,				/* Pointer to the blank directory object */
	FILINFO* fno,			/* Pointer to the file information structure */
	const TCHAR* path,		/* Pointer to the directory to open */
	const TCHAR* pattern	/* Pointer to the matching pattern */
)
{
	FRESULT res;


	dp->pat = pattern;		/* Save pointer to pattern string */
	res = f_opendir(dp, path);		/* Open the target directory */
	if (res == FR_OK) {
		res = f_findnext(dp, fno);	/* Find the first item */
	}
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x8130
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x900a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x8da0
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: f_stat
FRESULT f_stat (
	const TCHAR* path,	/* Pointer to the file path */
	FILINFO* fno		/* Pointer to file information to return */
)
{
	FRESULT res;
	DIR dj;
	DEF_NAMBUF


	/* Get logical drive */
	res = mount_volume(&path, &dj.obj.fs, 0);
	if (res == FR_OK) {
		INIT_NAMBUF(dj.obj.fs);
		res = follow_path(&dj, path);	/* Follow the file path */
		if (res == FR_OK) {				/* Follow completed */
			if (dj.fn[NSFLAG] & NS_NONAME) {	/* It is origin directory */
				res = FR_INVALID_NAME;
			} else {							/* Found an object */
				if (fno) get_fileinfo(&dj, fno);
			}
		}
		FREE_NAMBUF();
	}

	LEAVE_FF(dj.obj.fs, res);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x78(%rbp), %rsi
leaq -0x8(%rbp), %rdi
xorl %edx, %edx
callq 0x4940
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x90b0
leaq -0x280(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x10(%rax)
leaq -0x4e0(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x5910
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x90ae
movzbl -0x25(%rbp), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x9096
movl $0x6, -0x14(%rbp)
jmp 0x90ac
cmpq $0x0, -0x10(%rbp)
je 0x90aa
movq -0x10(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x87a0
jmp 0x90ac
jmp 0x90ae
jmp 0x90b0
movl -0x14(%rbp), %eax
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: dir_remove
static FRESULT dir_remove (	/* FR_OK:Succeeded, FR_DISK_ERR:A disk error */
	DIR* dp					/* Directory object pointing the entry to be removed */
)
{
	FRESULT res;
	FATFS *fs = dp->obj.fs;
#if FF_USE_LFN		/* LFN configuration */
	DWORD last = dp->dptr;

	res = (dp->blk_ofs == 0xFFFFFFFF) ? FR_OK : dir_sdi(dp, dp->blk_ofs);	/* Goto top of the entry block if LFN is exist */
	if (res == FR_OK) {
		do {
			res = move_window(fs, dp->sect);
			if (res != FR_OK) break;
			if (FF_FS_EXFAT && fs->fs_type == FS_EXFAT) {	/* On the exFAT volume */
				dp->dir[XDIR_Type] &= 0x7F;	/* Clear the entry InUse flag. */
			} else {									/* On the FAT/FAT32 volume */
				dp->dir[DIR_Name] = DDEM;	/* Mark the entry 'deleted'. */
			}
			fs->wflag = 1;
			if (dp->dptr >= last) break;	/* If reached last entry then all entries of the object has been deleted. */
			res = dir_next(dp, 0);	/* Next entry */
		} while (res == FR_OK);
		if (res == FR_NO_FILE) res = FR_INT_ERR;
	}
#else			/* Non LFN configuration */

	res = move_window(fs, dp->sect);
	if (res == FR_OK) {
		dp->dir[DIR_Name] = DDEM;	/* Mark the entry 'deleted'.*/
		fs->wflag = 1;
	}
#endif

	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpl $-0x1, 0x54(%rax)
jne 0x97a2
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0x97b5
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x54(%rax), %esi
callq 0x82b0
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x9845
jmp 0x97c7
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x6480
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x97e3
jmp 0x9836
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x4, %eax
jne 0x9801
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movzbl (%rax), %ecx
andl $0x7f, %ecx
movb %cl, (%rax)
jmp 0x980c
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rax
movb $-0x1b, (%rax)
movq -0x18(%rbp), %rax
movb $0x1, 0x3(%rax)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
cmpl -0x1c(%rbp), %eax
jb 0x9822
jmp 0x9836
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x8b90
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x97c7
cmpl $0x4, -0xc(%rbp)
jne 0x9843
movl $0x2, -0xc(%rbp)
jmp 0x9845
movl -0xc(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: f_chmod
FRESULT f_chmod (
	const TCHAR* path,	/* Pointer to the file path */
	BYTE attr,			/* Attribute bits */
	BYTE mask			/* Attribute mask to change */
)
{
	FRESULT res;
	DIR dj;
	FATFS *fs;
	DEF_NAMBUF


	res = mount_volume(&path, &fs, FA_WRITE);	/* Get logical drive */
	if (res == FR_OK) {
		dj.obj.fs = fs;
		INIT_NAMBUF(fs);
		res = follow_path(&dj, path);	/* Follow the file path */
		if (res == FR_OK && (dj.fn[NSFLAG] & (NS_DOT | NS_NONAME))) res = FR_INVALID_NAME;	/* Check object validity */
		if (res == FR_OK) {
			mask &= AM_RDO|AM_HID|AM_SYS|AM_ARC;	/* Valid attribute mask */
#if FF_FS_EXFAT
			if (fs->fs_type == FS_EXFAT) {
				fs->dirbuf[XDIR_Attr] = (attr & mask) | (fs->dirbuf[XDIR_Attr] & (BYTE)~mask);	/* Apply attribute change */
				res = store_xdir(&dj);
			} else
#endif
			{
				dj.dir[DIR_Attr] = (attr & mask) | (dj.dir[DIR_Attr] & (BYTE)~mask);	/* Apply attribute change */
				fs->wflag = 1;
			}
			if (res == FR_OK) {
				res = sync_fs(fs);
			}
		}
		FREE_NAMBUF();
	}

	LEAVE_FF(fs, res);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
movb %dl, %al
movb %sil, %cl
movq %rdi, -0x8(%rbp)
movb %cl, -0x9(%rbp)
movb %al, -0xa(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x78(%rbp), %rsi
movl $0x2, %edx
callq 0x4940
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0xa220
movq -0x78(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq -0x280(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x10(%rax)
leaq -0x4e0(%rbp), %rcx
movq -0x78(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rsi
leaq -0x70(%rbp), %rdi
callq 0x5910
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0xa17a
movzbl -0x1d(%rbp), %eax
andl $0xa0, %eax
cmpl $0x0, %eax
je 0xa17a
movl $0x6, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0xa21e
movzbl -0xa(%rbp), %eax
andl $0x27, %eax
movb %al, -0xa(%rbp)
movq -0x78(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x4, %eax
jne 0xa1d9
movzbl -0x9(%rbp), %eax
movzbl -0xa(%rbp), %ecx
andl %ecx, %eax
movq -0x78(%rbp), %rcx
movq 0x18(%rcx), %rcx
movzbl 0x4(%rcx), %ecx
movzbl -0xa(%rbp), %edx
xorl $-0x1, %edx
movzbl %dl, %edx
andl %edx, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movb %cl, 0x4(%rax)
leaq -0x70(%rbp), %rdi
callq 0x6040
movl %eax, -0x10(%rbp)
jmp 0xa20a
movzbl -0x9(%rbp), %eax
movzbl -0xa(%rbp), %ecx
andl %ecx, %eax
movq -0x30(%rbp), %rcx
movzbl 0xb(%rcx), %ecx
movzbl -0xa(%rbp), %edx
xorl $-0x1, %edx
movzbl %dl, %edx
andl %edx, %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x30(%rbp), %rax
movb %cl, 0xb(%rax)
movq -0x78(%rbp), %rax
movb $0x1, 0x3(%rax)
cmpl $0x0, -0x10(%rbp)
jne 0xa21c
movq -0x78(%rbp), %rdi
callq 0x7b10
movl %eax, -0x10(%rbp)
jmp 0xa21e
jmp 0xa220
movl -0x10(%rbp), %eax
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: f_utime
FRESULT f_utime (
	const TCHAR* path,	/* Pointer to the file/directory name */
	const FILINFO* fno	/* Pointer to the timestamp to be set */
)
{
	FRESULT res;
	DIR dj;
	FATFS *fs;
	DEF_NAMBUF


	res = mount_volume(&path, &fs, FA_WRITE);	/* Get logical drive */
	if (res == FR_OK) {
		dj.obj.fs = fs;
		INIT_NAMBUF(fs);
		res = follow_path(&dj, path);	/* Follow the file path */
		if (res == FR_OK && (dj.fn[NSFLAG] & (NS_DOT | NS_NONAME))) res = FR_INVALID_NAME;	/* Check object validity */
		if (res == FR_OK) {
#if FF_FS_EXFAT
			if (fs->fs_type == FS_EXFAT) {
				st_dword(fs->dirbuf + XDIR_ModTime, (DWORD)fno->fdate << 16 | fno->ftime);
				res = store_xdir(&dj);
			} else
#endif
			{
				st_dword(dj.dir + DIR_ModTime, (DWORD)fno->fdate << 16 | fno->ftime);
				fs->wflag = 1;
			}
			if (res == FR_OK) {
				res = sync_fs(fs);
			}
		}
		FREE_NAMBUF();
	}

	LEAVE_FF(fs, res);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl $0x2, %edx
callq 0x4940
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xa339
movq -0x80(%rbp), %rax
movq %rax, -0x78(%rbp)
leaq -0x280(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x10(%rax)
leaq -0x4e0(%rbp), %rcx
movq -0x80(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rsi
leaq -0x78(%rbp), %rdi
callq 0x5910
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xa2b3
movzbl -0x25(%rbp), %eax
andl $0xa0, %eax
cmpl $0x0, %eax
je 0xa2b3
movl $0x6, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0xa337
movq -0x80(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x4, %eax
jne 0xa2f9
movq -0x80(%rbp), %rax
movq 0x18(%rax), %rdi
addq $0xc, %rdi
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %esi
shll $0x10, %esi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %eax
orl %eax, %esi
callq 0x5fc0
leaq -0x78(%rbp), %rdi
callq 0x6040
movl %eax, -0x14(%rbp)
jmp 0xa323
movq -0x38(%rbp), %rdi
addq $0x16, %rdi
movq -0x10(%rbp), %rax
movzwl 0x8(%rax), %esi
shll $0x10, %esi
movq -0x10(%rbp), %rax
movzwl 0xa(%rax), %eax
orl %eax, %esi
callq 0x5fc0
movq -0x80(%rbp), %rax
movb $0x1, 0x3(%rax)
cmpl $0x0, -0x14(%rbp)
jne 0xa335
movq -0x80(%rbp), %rdi
callq 0x7b10
movl %eax, -0x14(%rbp)
jmp 0xa337
jmp 0xa339
movl -0x14(%rbp), %eax
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: test_gpt_header
static int test_gpt_header (	/* 0:Invalid, 1:Valid */
	const BYTE* gpth			/* Pointer to the GPT header */
)
{
	UINT i;
	DWORD bcc;


	if (mem_cmp(gpth + GPTH_Sign, "EFI PART" "\0\0\1\0" "\x5C\0\0", 16)) return 0;	/* Check sign, version (1.0) and length (92) */
	for (i = 0, bcc = 0xFFFFFFFF; i < 92; i++) {		/* Check header BCC */
		bcc = crc32(bcc, i - GPTH_Bcc < 4 ? 0 : gpth[i]);
	}
	if (~bcc != ld_dword(gpth + GPTH_Bcc)) return 0;
	if (ld_dword(gpth + GPTH_PteSize) != SZ_GPTE) return 0;	/* Table entry size (must be SZ_GPTE bytes) */
	if (ld_dword(gpth + GPTH_PtNum) > 128) return 0;	/* Table size (must be 128 entries or less) */

	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x52b9(%rip), %rsi      # 0x12550
movl $0x10, %edx
callq 0xd440
cmpl $0x0, %eax
je 0xd2b2
movl $0x0, -0x4(%rbp)
jmp 0xd371
movl $0x0, -0x14(%rbp)
movl $0xffffffff, -0x18(%rbp) # imm = 0xFFFFFFFF
cmpl $0x5c, -0x14(%rbp)
jae 0xd308
movl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x14(%rbp), %eax
subl $0x10, %eax
cmpl $0x4, %eax
jae 0xd2de
xorl %eax, %eax
movl %eax, -0x20(%rbp)
jmp 0xd2ec
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movzbl (%rax,%rcx), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %edi
movl -0x20(%rbp), %eax
movzbl %al, %esi
callq 0xfd30
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xd2c0
movl -0x18(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
callq 0x6510
movl %eax, %ecx
movl -0x24(%rbp), %eax
cmpl %ecx, %eax
je 0xd330
movl $0x0, -0x4(%rbp)
jmp 0xd371
movq -0x10(%rbp), %rdi
addq $0x54, %rdi
callq 0x6510
cmpl $0x80, %eax
je 0xd34d
movl $0x0, -0x4(%rbp)
jmp 0xd371
movq -0x10(%rbp), %rdi
addq $0x50, %rdi
callq 0x6510
cmpl $0x80, %eax
jbe 0xd36a
movl $0x0, -0x4(%rbp)
jmp 0xd371
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: ld_qword
static QWORD ld_qword (const BYTE* ptr)	/* Load an 8-byte little-endian word */
{
	QWORD rv;

	rv = ptr[7];
	rv = rv << 8 | ptr[6];
	rv = rv << 8 | ptr[5];
	rv = rv << 8 | ptr[4];
	rv = rv << 8 | ptr[3];
	rv = rv << 8 | ptr[2];
	rv = rv << 8 | ptr[1];
	rv = rv << 8 | ptr[0];
	return rv;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movzbl 0x5(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movzbl 0x4(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movzbl 0x3(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movzbl 0x2(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shlq $0x8, %rax
movq -0x8(%rbp), %rcx
movzbl (%rcx), %ecx
orq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: f_fdisk
FRESULT f_fdisk (
	BYTE pdrv,			/* Physical drive number */
	const LBA_t ptbl[],	/* Pointer to the size table for each partitions */
	void* work			/* Pointer to the working buffer (null: use heap memory) */
)
{
	BYTE *buf = (BYTE*)work;
	DSTATUS stat;


	stat = disk_initialize(pdrv);
	if (stat & STA_NOINIT) return FR_NOT_READY;
	if (stat & STA_PROTECT) return FR_WRITE_PROTECTED;
#if FF_USE_LFN == 3
	if (!buf) buf = ff_memalloc(FF_MAX_SS);	/* Use heap memory for working buffer */
#endif
	if (!buf) return FR_NOT_ENOUGH_CORE;

	LEAVE_MKFS(create_partition(pdrv, ptbl, 0x07, buf));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dil, %al
movb %al, -0x5(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movzbl -0x5(%rbp), %edi
callq 0x18e0
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xddef
movl $0x3, -0x4(%rbp)
jmp 0xde2f
movzbl -0x21(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0xde04
movl $0xa, -0x4(%rbp)
jmp 0xde2f
cmpq $0x0, -0x20(%rbp)
jne 0xde14
movl $0x11, -0x4(%rbp)
jmp 0xde2f
movb -0x5(%rbp), %al
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
movl $0x7, %edx
movzbl %al, %edi
callq 0xd500
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: xname_sum
static WORD xname_sum (	/* Get check sum (to be used as hash) of the file name */
	const WCHAR* name	/* File name to be calculated */
)
{
	WCHAR chr;
	WORD sum = 0;


	while ((chr = *name++) != 0) {
		chr = (WCHAR)ff_wtoupper(chr);		/* File name needs to be up-case converted */
		sum = ((sum & 1) ? 0x8000 : 0) + (sum >> 1) + (chr & 0xFF);
		sum = ((sum & 1) ? 0x8000 : 0) + (sum >> 1) + (chr >> 8);
	}
	return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movw $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x2, %rcx
movq %rcx, -0x8(%rbp)
movw (%rax), %ax
movw %ax, -0xa(%rbp)
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xeb77
movzwl -0xa(%rbp), %edi
callq 0xff60
movw %ax, -0xa(%rbp)
movzwl -0xc(%rbp), %edx
andl $0x1, %edx
xorl %eax, %eax
movl $0x8000, %ecx           # imm = 0x8000
cmpl $0x0, %edx
cmovnel %ecx, %eax
movzwl -0xc(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movzwl -0xa(%rbp), %ecx
andl $0xff, %ecx
addl %ecx, %eax
movw %ax, -0xc(%rbp)
movzwl -0xc(%rbp), %edx
andl $0x1, %edx
xorl %eax, %eax
movl $0x8000, %ecx           # imm = 0x8000
cmpl $0x0, %edx
cmovnel %ecx, %eax
movzwl -0xc(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movzwl -0xa(%rbp), %ecx
sarl $0x8, %ecx
addl %ecx, %eax
movw %ax, -0xc(%rbp)
jmp 0xeaf2
movw -0xc(%rbp), %ax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: cmp_lfn
static int cmp_lfn (		/* 1:matched, 0:not matched */
	const WCHAR* lfnbuf,	/* Pointer to the LFN working buffer to be compared */
	BYTE* dir				/* Pointer to the directory entry containing the part of LFN */
)
{
	UINT i, s;
	WCHAR wc, uc;


	if (ld_word(dir + LDIR_FstClusLO) != 0) return 0;	/* Check LDIR_FstClusLO */

	i = ((dir[LDIR_Ord] & 0x3F) - 1) * 13;	/* Offset in the LFN buffer */

	for (wc = 1, s = 0; s < 13; s++) {		/* Process all characters in the entry */
		uc = ld_word(dir + LfnOfs[s]);		/* Pick an LFN character */
		if (wc != 0) {
			if (i >= FF_MAX_LFN + 1 || ff_wtoupper(uc) != ff_wtoupper(lfnbuf[i++])) {	/* Compare it */
				return 0;					/* Not matched */
			}
			wc = uc;
		} else {
			if (uc != 0xFFFF) return 0;		/* Check filler */
		}
	}

	if ((dir[LDIR_Ord] & LLEF) && wc && lfnbuf[i]) return 0;	/* Last segment matched but different length */

	return 1;		/* The part of LFN matched */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1a, %rdi
callq 0x9390
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xebc1
movl $0x0, -0x4(%rbp)
jmp 0xecbf
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
andl $0x3f, %eax
subl $0x1, %eax
imull $0xd, %eax, %eax
movl %eax, -0x1c(%rbp)
movw $0x1, -0x22(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0xd, -0x20(%rbp)
jae 0xec87
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, %ecx
leaq 0x38e5(%rip), %rax      # 0x124e0
movzbl (%rax,%rcx), %eax
cltq
addq %rax, %rdi
callq 0x9390
movw %ax, -0x24(%rbp)
movzwl -0x22(%rbp), %eax
cmpl $0x0, %eax
je 0xec61
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jae 0xec4e
movzwl -0x24(%rbp), %edi
callq 0xff60
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x1c(%rbp)
movl %ecx, %ecx
movzwl (%rax,%rcx,2), %edi
callq 0xff60
movl %eax, %ecx
movl -0x28(%rbp), %eax
cmpl %ecx, %eax
je 0xec57
movl $0x0, -0x4(%rbp)
jmp 0xecbf
movw -0x24(%rbp), %ax
movw %ax, -0x22(%rbp)
jmp 0xec77
movzwl -0x24(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xec75
movl $0x0, -0x4(%rbp)
jmp 0xecbf
jmp 0xec77
jmp 0xec79
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xebe1
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xecb8
movzwl -0x22(%rbp), %eax
cmpl $0x0, %eax
je 0xecb8
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movzwl (%rax,%rcx,2), %eax
cmpl $0x0, %eax
je 0xecb8
movl $0x0, -0x4(%rbp)
jmp 0xecbf
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: sum_sfn
static BYTE sum_sfn (
	const BYTE* dir		/* Pointer to the SFN entry */
)
{
	BYTE sum = 0;
	UINT n = 11;

	do {
		sum = (sum >> 1) + (sum << 7) + *dir++;
	} while (--n);
	return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movb $0x0, -0x9(%rbp)
movl $0xb, -0x10(%rbp)
movzbl -0x9(%rbp), %eax
sarl %eax
movzbl -0x9(%rbp), %ecx
shll $0x7, %ecx
addl %ecx, %eax
movq -0x8(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x8(%rbp)
movzbl (%rcx), %ecx
addl %ecx, %eax
movb %al, -0x9(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, %eax
jne 0xece3
movb -0x9(%rbp), %al
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: create_xdir
static void create_xdir (
	BYTE* dirb,			/* Pointer to the direcotry entry block buffer */
	const WCHAR* lfn	/* Pointer to the object name */
)
{
	UINT i;
	BYTE nc1, nlen;
	WCHAR wc;


	/* Create file-directory and stream-extension entry */
	mem_set(dirb, 0, 2 * SZDIRE);
	dirb[0 * SZDIRE + XDIR_Type] = ET_FILEDIR;
	dirb[1 * SZDIRE + XDIR_Type] = ET_STREAM;

	/* Create file-name entries */
	i = SZDIRE * 2;	/* Top of file_name entries */
	nlen = nc1 = 0; wc = 1;
	do {
		dirb[i++] = ET_FILENAME; dirb[i++] = 0;
		do {	/* Fill name field */
			if (wc != 0 && (wc = lfn[nlen]) != 0) nlen++;	/* Get a character if exist */
			st_word(dirb + i, wc); 		/* Store it */
			i += 2;
		} while (i % SZDIRE != 0);
		nc1++;
	} while (lfn[nlen]);	/* Fill next entry if any char follows */

	dirb[XDIR_NumName] = nlen;		/* Set name length */
	dirb[XDIR_NumSec] = 1 + nc1;	/* Set secondary count (C0 + C1s) */
	st_word(dirb + XDIR_NameHash, xname_sum(lfn));	/* Set name hash */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0x40, %edx
callq 0x5f80
movq -0x8(%rbp), %rax
movb $-0x7b, (%rax)
movq -0x8(%rbp), %rax
movb $-0x40, 0x20(%rax)
movl $0x40, -0x14(%rbp)
movb $0x0, -0x15(%rbp)
movb $0x0, -0x16(%rbp)
movw $0x1, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x14(%rbp)
movl %ecx, %ecx
movb $-0x3f, (%rax,%rcx)
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x14(%rbp)
movl %ecx, %ecx
movb $0x0, (%rax,%rcx)
movzwl -0x18(%rbp), %eax
cmpl $0x0, %eax
je 0xedb7
movq -0x10(%rbp), %rax
movzbl -0x16(%rbp), %ecx
movw (%rax,%rcx,2), %ax
movw %ax, -0x18(%rbp)
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xedb7
movb -0x16(%rbp), %al
addb $0x1, %al
movb %al, -0x16(%rbp)
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %eax
addq %rax, %rdi
movzwl -0x18(%rbp), %esi
callq 0x7c50
movl -0x14(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
andl $0x1f, %eax
cmpl $0x0, %eax
jne 0xed8e
movb -0x15(%rbp), %al
addb $0x1, %al
movb %al, -0x15(%rbp)
movq -0x10(%rbp), %rax
movzbl -0x16(%rbp), %ecx
cmpw $0x0, (%rax,%rcx,2)
jne 0xed64
movb -0x16(%rbp), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x23(%rax)
movzbl -0x15(%rbp), %eax
addl $0x1, %eax
movb %al, %cl
movq -0x8(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x8(%rbp), %rax
addq $0x24, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xeae0
movq -0x20(%rbp), %rdi
movzwl %ax, %esi
callq 0x7c50
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: put_lfn
static void put_lfn (
	const WCHAR* lfn,	/* Pointer to the LFN */
	BYTE* dir,			/* Pointer to the LFN entry to be created */
	BYTE ord,			/* LFN order (1-20) */
	BYTE sum			/* Checksum of the corresponding SFN */
)
{
	UINT i, s;
	WCHAR wc;


	dir[LDIR_Chksum] = sum;			/* Set checksum */
	dir[LDIR_Attr] = AM_LFN;		/* Set attribute. LFN entry */
	dir[LDIR_Type] = 0;
	st_word(dir + LDIR_FstClusLO, 0);

	i = (ord - 1) * 13;				/* Get offset in the LFN working buffer */
	s = wc = 0;
	do {
		if (wc != 0xFFFF) wc = lfn[i++];	/* Get an effective character */
		st_word(dir + LfnOfs[s], wc);		/* Put it */
		if (wc == 0) wc = 0xFFFF;		/* Padding characters for following items */
	} while (++s < 13);
	if (wc == 0xFFFF || !lfn[i]) ord |= LLEF;	/* Last LFN part is the start of LFN sequence */
	dir[LDIR_Ord] = ord;			/* Set the LFN order */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %cl, %al
movb %dl, %cl
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %cl, -0x11(%rbp)
movb %al, -0x12(%rbp)
movb -0x12(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0xd(%rax)
movq -0x10(%rbp), %rax
movb $0xf, 0xb(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0xc(%rax)
movq -0x10(%rbp), %rdi
addq $0x1a, %rdi
xorl %esi, %esi
callq 0x7c50
movzbl -0x11(%rbp), %eax
subl $0x1, %eax
imull $0xd, %eax, %eax
movl %eax, -0x18(%rbp)
movw $0x0, -0x1e(%rbp)
movl $0x0, -0x1c(%rbp)
movzwl -0x1e(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xf081
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movl %ecx, %ecx
movw (%rax,%rcx,2), %ax
movw %ax, -0x1e(%rbp)
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x344f(%rip), %rax      # 0x124e0
movzbl (%rax,%rcx), %eax
cltq
addq %rax, %rdi
movzwl -0x1e(%rbp), %esi
callq 0x7c50
movzwl -0x1e(%rbp), %eax
cmpl $0x0, %eax
jne 0xf0b2
movw $0xffff, -0x1e(%rbp)    # imm = 0xFFFF
jmp 0xf0b4
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0xd, %eax
jb 0xf05d
movzwl -0x1e(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xf0db
movq -0x8(%rbp), %rax
movl -0x18(%rbp), %ecx
cmpw $0x0, (%rax,%rcx,2)
jne 0xf0e5
movzbl -0x11(%rbp), %eax
orl $0x40, %eax
movb %al, -0x11(%rbp)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, (%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: xdir_sum
static WORD xdir_sum (	/* Get checksum of the directoly entry block */
	const BYTE* dir		/* Directory entry block to be calculated */
)
{
	UINT i, szblk;
	WORD sum;


	szblk = (dir[XDIR_NumSec] + 1) * SZDIRE;	/* Number of bytes of the entry block */
	for (i = sum = 0; i < szblk; i++) {
		if (i == XDIR_SetSum) {	/* Skip 2-byte sum field */
			i++;
		} else {
			sum = ((sum & 1) ? 0x8000 : 0) + (sum >> 1) + dir[i];
		}
	}
	return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x1(%rax), %eax
addl $0x1, %eax
shll $0x5, %eax
movl %eax, -0x10(%rbp)
movw $0x0, -0x12(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jae 0xf179
cmpl $0x2, -0xc(%rbp)
jne 0xf13f
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xf16c
movzwl -0x12(%rbp), %edx
andl $0x1, %edx
xorl %eax, %eax
movl $0x8000, %ecx           # imm = 0x8000
cmpl $0x0, %edx
cmovnel %ecx, %eax
movzwl -0x12(%rbp), %ecx
sarl %ecx
addl %ecx, %eax
movq -0x8(%rbp), %rcx
movl -0xc(%rbp), %edx
movzbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movw %ax, -0x12(%rbp)
jmp 0xf16e
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xf126
movw -0x12(%rbp), %ax
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: change_bitmap
static FRESULT change_bitmap (
	FATFS* fs,	/* Filesystem object */
	DWORD clst,	/* Cluster number to change from */
	DWORD ncl,	/* Number of clusters to be changed */
	int bv		/* bit value to be set (0 or 1) */
)
{
	BYTE bm;
	UINT i;
	LBA_t sect;


	clst -= 2;	/* The first bit corresponds to cluster #2 */
	sect = fs->bitbase + clst / 8 / SS(fs);	/* Sector address */
	i = clst / 8 % SS(fs);					/* Byte offset in the sector */
	bm = 1 << (clst % 8);					/* Bit mask in the byte */
	for (;;) {
		if (move_window(fs, sect++) != FR_OK) return FR_DISK_ERR;
		do {
			do {
				if (bv == (int)((fs->win[i] & bm) != 0)) return FR_INT_ERR;	/* Is the bit expected value? */
				fs->win[i] ^= bm;	/* Flip the bit */
				fs->wflag = 1;
				if (--ncl == 0) return FR_OK;	/* All bits processed? */
			} while (bm <<= 1);		/* Next bit */
			bm = 1;
		} while (++i < SS(fs));		/* Next byte */
		i = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0x14(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl -0x14(%rbp), %ecx
shrl $0x3, %ecx
shrl $0x9, %ecx
movl %ecx, %ecx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %eax
shrl $0x3, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x24(%rbp)
movl -0x14(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %eax
shll %cl, %eax
movb %al, -0x1d(%rbp)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
callq 0x6480
cmpl $0x0, %eax
je 0xf48f
movl $0x1, -0x4(%rbp)
jmp 0xf529
jmp 0xf491
jmp 0xf493
movl -0x1c(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x24(%rbp), %edx
movzbl 0x60(%rcx,%rdx), %ecx
movzbl -0x1d(%rbp), %edx
andl %edx, %ecx
cmpl $0x0, %ecx
setne %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0xf4c1
movl $0x2, -0x4(%rbp)
jmp 0xf529
movzbl -0x1d(%rbp), %esi
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
movzbl 0x60(%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, 0x60(%rax,%rcx)
movq -0x10(%rbp), %rax
movb $0x1, 0x3(%rax)
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x0, %eax
jne 0xf4f6
movl $0x0, -0x4(%rbp)
jmp 0xf529
jmp 0xf4f8
movzbl -0x1d(%rbp), %eax
shll %eax
movb %al, -0x1d(%rbp)
cmpb $0x0, %al
jne 0xf493
movb $0x1, -0x1d(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
cmpl $0x200, %eax            # imm = 0x200
jb 0xf491
movl $0x0, -0x24(%rbp)
jmp 0xf466
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: sync_window
static FRESULT sync_window (	/* Returns FR_OK or FR_DISK_ERR */
	FATFS* fs			/* Filesystem object */
)
{
	FRESULT res = FR_OK;


	if (fs->wflag) {	/* Is the disk access window dirty? */
		if (disk_write(fs->pdrv, fs->win, fs->winsect, 1) == RES_OK) {	/* Write it back into the volume */
			fs->wflag = 0;	/* Clear window dirty flag */
			if (fs->winsect - fs->fatbase < fs->fsize) {	/* Is it in the 1st FAT? */
				if (fs->n_fats == 2) disk_write(fs->pdrv, fs->win, fs->winsect + fs->fsize, 1);	/* Reflect it to 2nd FAT if needed */
			}
		} else {
			res = FR_DISK_ERR;
		}
	}
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x3(%rax)
je 0xf5f6
movq -0x8(%rbp), %rax
movb 0x1(%rax), %al
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rdx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
cmpl $0x0, %eax
jne 0xf5ed
movq -0x8(%rbp), %rax
movb $0x0, 0x3(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq -0x8(%rbp), %rcx
subq 0x38(%rcx), %rax
movq -0x8(%rbp), %rcx
movl 0x2c(%rcx), %ecx
cmpq %rcx, %rax
jae 0xf5eb
movq -0x8(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x2, %eax
jne 0xf5e9
movq -0x8(%rbp), %rax
movb 0x1(%rax), %al
movq -0x8(%rbp), %rsi
addq $0x60, %rsi
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rdx
movq -0x8(%rbp), %rcx
movl 0x2c(%rcx), %ecx
addq %rcx, %rdx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
jmp 0xf5eb
jmp 0xf5f4
movl $0x1, -0xc(%rbp)
jmp 0xf5f6
movl -0xc(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: find_bitmap
static DWORD find_bitmap (	/* 0:Not found, 2..:Cluster block found, 0xFFFFFFFF:Disk error */
	FATFS* fs,	/* Filesystem object */
	DWORD clst,	/* Cluster number to scan from */
	DWORD ncl	/* Number of contiguous clusters to find (1..) */
)
{
	BYTE bm, bv;
	UINT i;
	DWORD val, scl, ctr;


	clst -= 2;	/* The first bit in the bitmap corresponds to cluster #2 */
	if (clst >= fs->n_fatent - 2) clst = 0;
	scl = val = clst; ctr = 0;
	for (;;) {
		if (move_window(fs, fs->bitbase + val / 8 / SS(fs)) != FR_OK) return 0xFFFFFFFF;
		i = val / 8 % SS(fs); bm = 1 << (val % 8);
		do {
			do {
				bv = fs->win[i] & bm; bm <<= 1;		/* Get bit value */
				if (++val >= fs->n_fatent - 2) {	/* Next cluster (with wrap-around) */
					val = 0; bm = 0; i = SS(fs);
				}
				if (bv == 0) {	/* Is it a free cluster? */
					if (++ctr == ncl) return scl + 2;	/* Check if run length is sufficient for required */
				} else {
					scl = val; ctr = 0;		/* Encountered a cluster in-use, restart to scan */
				}
				if (val == clst) return 0;	/* All cluster scanned? */
			} while (bm != 0);
			bm = 1;
		} while (++i < SS(fs));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl -0x14(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jb 0xf633
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rsi
movl -0x24(%rbp), %eax
shrl $0x3, %eax
shrl $0x9, %eax
movl %eax, %eax
addq %rax, %rsi
callq 0x6480
cmpl $0x0, %eax
je 0xf673
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf748
movl -0x24(%rbp), %eax
shrl $0x3, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %ecx
andl $0x7, %ecx
movl $0x1, %eax
shll %cl, %eax
movb %al, -0x19(%rbp)
jmp 0xf693
movq -0x10(%rbp), %rax
movl -0x20(%rbp), %ecx
movzbl 0x60(%rax,%rcx), %eax
movzbl -0x19(%rbp), %ecx
andl %ecx, %eax
movb %al, -0x1a(%rbp)
movzbl -0x19(%rbp), %eax
shll %eax
movb %al, -0x19(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rcx
movl 0x28(%rcx), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jb 0xf6da
movl $0x0, -0x24(%rbp)
movb $0x0, -0x19(%rbp)
movl $0x200, -0x20(%rbp)     # imm = 0x200
movzbl -0x1a(%rbp), %eax
cmpl $0x0, %eax
jne 0xf6fe
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl -0x18(%rbp), %eax
jne 0xf6fc
movl -0x28(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x4(%rbp)
jmp 0xf748
jmp 0xf70b
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jne 0xf71c
movl $0x0, -0x4(%rbp)
jmp 0xf748
jmp 0xf71e
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
jne 0xf693
movb $0x1, -0x19(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
cmpl $0x200, %eax            # imm = 0x200
jb 0xf691
jmp 0xf643
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: pick_lfn
static int pick_lfn (	/* 1:succeeded, 0:buffer overflow or invalid LFN entry */
	WCHAR* lfnbuf,		/* Pointer to the LFN working buffer */
	BYTE* dir			/* Pointer to the LFN entry */
)
{
	UINT i, s;
	WCHAR wc, uc;


	if (ld_word(dir + LDIR_FstClusLO) != 0) return 0;	/* Check LDIR_FstClusLO is 0 */

	i = ((dir[LDIR_Ord] & ~LLEF) - 1) * 13;	/* Offset in the LFN buffer */

	for (wc = 1, s = 0; s < 13; s++) {		/* Process all characters in the entry */
		uc = ld_word(dir + LfnOfs[s]);		/* Pick an LFN character */
		if (wc != 0) {
			if (i >= FF_MAX_LFN + 1) return 0;	/* Buffer overflow? */
			lfnbuf[i++] = wc = uc;			/* Store it */
		} else {
			if (uc != 0xFFFF) return 0;		/* Check filler */
		}
	}

	if (dir[LDIR_Ord] & LLEF && wc != 0) {	/* Put terminator if it is the last LFN part and not terminated */
		if (i >= FF_MAX_LFN + 1) return 0;	/* Buffer overflow? */
		lfnbuf[i] = 0;
	}

	return 1;		/* The part of LFN is valid */
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x1a, %rdi
callq 0x9390
movzwl %ax, %eax
cmpl $0x0, %eax
je 0xf9f1
movl $0x0, -0x4(%rbp)
jmp 0xfade
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
andl $-0x41, %eax
subl $0x1, %eax
imull $0xd, %eax, %eax
movl %eax, -0x1c(%rbp)
movw $0x1, -0x22(%rbp)
movl $0x0, -0x20(%rbp)
cmpl $0xd, -0x20(%rbp)
jae 0xfaa0
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %eax
movl %eax, %ecx
leaq 0x2ab5(%rip), %rax      # 0x124e0
movzbl (%rax,%rcx), %eax
cltq
addq %rax, %rdi
callq 0x9390
movw %ax, -0x24(%rbp)
movzwl -0x22(%rbp), %eax
cmpl $0x0, %eax
je 0xfa7a
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jb 0xfa5b
movl $0x0, -0x4(%rbp)
jmp 0xfade
movw -0x24(%rbp), %dx
movw %dx, -0x22(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x1c(%rbp)
movl %ecx, %ecx
movw %dx, (%rax,%rcx,2)
jmp 0xfa90
movzwl -0x24(%rbp), %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xfa8e
movl $0x0, -0x4(%rbp)
jmp 0xfade
jmp 0xfa90
jmp 0xfa92
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0xfa11
movq -0x18(%rbp), %rax
movzbl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xfad7
movzwl -0x22(%rbp), %eax
cmpl $0x0, %eax
je 0xfad7
cmpl $0x100, -0x1c(%rbp)     # imm = 0x100
jb 0xfaca
movl $0x0, -0x4(%rbp)
jmp 0xfade
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
movw $0x0, (%rax,%rcx,2)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: crc32
static DWORD crc32 (	/* Returns next CRC value */
	DWORD crc,			/* Current CRC value */
	BYTE d				/* A byte to be processed */
)
{
	BYTE b;


	for (b = 1; b; b <<= 1) {
		crc ^= (d & b) ? 1 : 0;
		crc = (crc & 1) ? crc >> 1 ^ 0xEDB88320 : crc >> 1;
	}
	return crc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movl %edi, -0x4(%rbp)
movb %al, -0x5(%rbp)
movb $0x1, -0x6(%rbp)
cmpb $0x0, -0x6(%rbp)
je 0xfd97
movzbl -0x5(%rbp), %edx
movzbl -0x6(%rbp), %eax
andl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
xorl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xfd7e
movl -0x4(%rbp), %eax
shrl %eax
xorl $0xedb88320, %eax       # imm = 0xEDB88320
movl %eax, -0xc(%rbp)
jmp 0xfd86
movl -0x4(%rbp), %eax
shrl %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x4(%rbp)
movzbl -0x6(%rbp), %eax
shll %eax
movb %al, -0x6(%rbp)
jmp 0xfd41
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: make_rand
static DWORD make_rand (
	DWORD seed,		/* Seed value */
	BYTE* buff,		/* Output buffer */
	UINT n			/* Data length */
)
{
	UINT r;


	if (seed == 0) seed = 1;
	do {
		for (r = 0; r < 8; r++) seed = seed & 1 ? seed >> 1 ^ 0xA3000000 : seed >> 1;	/* Shift 8 bits the 32-bit LFSR */
		*buff++ = (BYTE)seed;
	} while (--n);
	return seed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0xfdbb
movl $0x1, -0x4(%rbp)
jmp 0xfdbd
movl $0x0, -0x18(%rbp)
cmpl $0x8, -0x18(%rbp)
jae 0xfdfd
movl -0x4(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xfde4
movl -0x4(%rbp), %eax
shrl %eax
xorl $0xa3000000, %eax       # imm = 0xA3000000
movl %eax, -0x1c(%rbp)
jmp 0xfdec
movl -0x4(%rbp), %eax
shrl %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0xfdc4
movl -0x4(%rbp), %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movl -0x14(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jne 0xfdbd
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)