// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: mount_volume
static FRESULT mount_volume (	/* FR_OK(0): successful, !=0: an error occurred */
	const TCHAR** path,			/* Pointer to pointer to the path name (drive number) */
	FATFS** rfs,				/* Pointer to pointer to the found filesystem object */
	BYTE mode					/* !=0: Check write protection for write access */
)
{
	int vol;
	DSTATUS stat;
	LBA_t bsect;
	DWORD tsect, sysect, fasize, nclst, szbfat;
	WORD nrsv;
	FATFS *fs;
	UINT fmt;


	/* Get logical drive number */
	*rfs = 0;
	vol = get_ldnumber(path);
	if (vol < 0) return FR_INVALID_DRIVE;

	/* Check if the filesystem object is valid or not */
	fs = FatFs[vol];					/* Get pointer to the filesystem object */
	if (!fs) return FR_NOT_ENABLED;		/* Is the filesystem object available? */
#if FF_FS_REENTRANT
	if (!lock_fs(fs)) return FR_TIMEOUT;	/* Lock the volume */
#endif
	*rfs = fs;							/* Return pointer to the filesystem object */

	mode &= (BYTE)~FA_READ;				/* Desired access mode, write access or not */
	if (fs->fs_type != 0) {				/* If the volume has been mounted */
		stat = disk_status(fs->pdrv);
		if (!(stat & STA_NOINIT)) {		/* and the physical drive is kept initialized */
			if (!FF_FS_READONLY && mode && (stat & STA_PROTECT)) {	/* Check write protection if needed */
				return FR_WRITE_PROTECTED;
			}
			return FR_OK;				/* The filesystem object is already valid */
		}
	}

	/* The filesystem object is not valid. */
	/* Following code attempts to mount the volume. (find a FAT volume, analyze the BPB and initialize the filesystem object) */

	fs->fs_type = 0;					/* Clear the filesystem object */
	fs->pdrv = LD2PD(vol);				/* Volume hosting physical drive */
	stat = disk_initialize(fs->pdrv);	/* Initialize the physical drive */
	if (stat & STA_NOINIT) { 			/* Check if the initialization succeeded */
		return FR_NOT_READY;			/* Failed to initialize due to no medium or hard error */
	}
	if (!FF_FS_READONLY && mode && (stat & STA_PROTECT)) { /* Check disk write protection if needed */
		return FR_WRITE_PROTECTED;
	}
#if FF_MAX_SS != FF_MIN_SS				/* Get sector size (multiple sector size cfg only) */
	if (disk_ioctl(fs->pdrv, GET_SECTOR_SIZE, &SS(fs)) != RES_OK) return FR_DISK_ERR;
	if (SS(fs) > FF_MAX_SS || SS(fs) < FF_MIN_SS || (SS(fs) & (SS(fs) - 1))) return FR_DISK_ERR;
#endif

	/* Find an FAT volume on the drive */
	fmt = find_volume(fs, LD2PT(vol));
	if (fmt == 4) return FR_DISK_ERR;		/* An error occured in the disk I/O layer */
	if (fmt >= 2) return FR_NO_FILESYSTEM;	/* No FAT volume is found */
	bsect = fs->winsect;					/* Volume location */

	/* An FAT volume is found (bsect). Following code initializes the filesystem object */

#if FF_FS_EXFAT
	if (fmt == 1) {
		QWORD maxlba;
		DWORD so, cv, bcl, i;

		for (i = BPB_ZeroedEx; i < BPB_ZeroedEx + 53 && fs->win[i] == 0; i++) ;	/* Check zero filler */
		if (i < BPB_ZeroedEx + 53) return FR_NO_FILESYSTEM;

		if (ld_word(fs->win + BPB_FSVerEx) != 0x100) return FR_NO_FILESYSTEM;	/* Check exFAT version (must be version 1.0) */

		if (1 << fs->win[BPB_BytsPerSecEx] != SS(fs)) {	/* (BPB_BytsPerSecEx must be equal to the physical sector size) */
			return FR_NO_FILESYSTEM;
		}

		maxlba = ld_qword(fs->win + BPB_TotSecEx) + bsect;	/* Last LBA + 1 of the volume */
		if (!FF_LBA64 && maxlba >= 0x100000000) return FR_NO_FILESYSTEM;	/* (It cannot be handled in 32-bit LBA) */

		fs->fsize = ld_dword(fs->win + BPB_FatSzEx);	/* Number of sectors per FAT */

		fs->n_fats = fs->win[BPB_NumFATsEx];			/* Number of FATs */
		if (fs->n_fats != 1) return FR_NO_FILESYSTEM;	/* (Supports only 1 FAT) */

		fs->csize = 1 << fs->win[BPB_SecPerClusEx];		/* Cluster size */
		if (fs->csize == 0)	return FR_NO_FILESYSTEM;	/* (Must be 1..32768) */

		nclst = ld_dword(fs->win + BPB_NumClusEx);		/* Number of clusters */
		if (nclst > MAX_EXFAT) return FR_NO_FILESYSTEM;	/* (Too many clusters) */
		fs->n_fatent = nclst + 2;

		/* Boundaries and Limits */
		fs->volbase = bsect;
		fs->database = bsect + ld_dword(fs->win + BPB_DataOfsEx);
		fs->fatbase = bsect + ld_dword(fs->win + BPB_FatOfsEx);
		if (maxlba < (QWORD)fs->database + nclst * fs->csize) return FR_NO_FILESYSTEM;	/* (Volume size must not be smaller than the size requiered) */
		fs->dirbase = ld_dword(fs->win + BPB_RootClusEx);

		/* Get bitmap location and check if it is contiguous (implementation assumption) */
		so = i = 0;
		for (;;) {	/* Find the bitmap entry in the root directory (in only first cluster) */
			if (i == 0) {
				if (so >= fs->csize) return FR_NO_FILESYSTEM;	/* Not found? */
				if (move_window(fs, clst2sect(fs, (DWORD)fs->dirbase) + so) != FR_OK) return FR_DISK_ERR;
				so++;
			}
			if (fs->win[i] == ET_BITMAP) break;				/* Is it a bitmap entry? */
			i = (i + SZDIRE) % SS(fs);	/* Next entry */
		}
		bcl = ld_dword(fs->win + i + 20);					/* Bitmap cluster */
		if (bcl < 2 || bcl >= fs->n_fatent) return FR_NO_FILESYSTEM;
		fs->bitbase = fs->database + fs->csize * (bcl - 2);	/* Bitmap sector */
		for (;;) {	/* Check if bitmap is contiguous */
			if (move_window(fs, fs->fatbase + bcl / (SS(fs) / 4)) != FR_OK) return FR_DISK_ERR;
			cv = ld_dword(fs->win + bcl % (SS(fs) / 4) * 4);
			if (cv == 0xFFFFFFFF) break;				/* Last link? */
			if (cv != ++bcl) return FR_NO_FILESYSTEM;	/* Fragmented? */
		}

#if !FF_FS_READONLY
		fs->last_clst = fs->free_clst = 0xFFFFFFFF;		/* Initialize cluster allocation information */
#endif
		fmt = FS_EXFAT;			/* FAT sub-type */
	} else
#endif	/* FF_FS_EXFAT */
	{
		if (ld_word(fs->win + BPB_BytsPerSec) != SS(fs)) return FR_NO_FILESYSTEM;	/* (BPB_BytsPerSec must be equal to the physical sector size) */

		fasize = ld_word(fs->win + BPB_FATSz16);		/* Number of sectors per FAT */
		if (fasize == 0) fasize = ld_dword(fs->win + BPB_FATSz32);
		fs->fsize = fasize;

		fs->n_fats = fs->win[BPB_NumFATs];				/* Number of FATs */
		if (fs->n_fats != 1 && fs->n_fats != 2) return FR_NO_FILESYSTEM;	/* (Must be 1 or 2) */
		fasize *= fs->n_fats;							/* Number of sectors for FAT area */

		fs->csize = fs->win[BPB_SecPerClus];			/* Cluster size */
		if (fs->csize == 0 || (fs->csize & (fs->csize - 1))) return FR_NO_FILESYSTEM;	/* (Must be power of 2) */

		fs->n_rootdir = ld_word(fs->win + BPB_RootEntCnt);	/* Number of root directory entries */
		if (fs->n_rootdir % (SS(fs) / SZDIRE)) return FR_NO_FILESYSTEM;	/* (Must be sector aligned) */

		tsect = ld_word(fs->win + BPB_TotSec16);		/* Number of sectors on the volume */
		if (tsect == 0) tsect = ld_dword(fs->win + BPB_TotSec32);

		nrsv = ld_word(fs->win + BPB_RsvdSecCnt);		/* Number of reserved sectors */
		if (nrsv == 0) return FR_NO_FILESYSTEM;			/* (Must not be 0) */

		/* Determine the FAT sub type */
		sysect = nrsv + fasize + fs->n_rootdir / (SS(fs) / SZDIRE);	/* RSV + FAT + DIR */
		if (tsect < sysect) return FR_NO_FILESYSTEM;	/* (Invalid volume size) */
		nclst = (tsect - sysect) / fs->csize;			/* Number of clusters */
		if (nclst == 0) return FR_NO_FILESYSTEM;		/* (Invalid volume size) */
		fmt = 0;
		if (nclst <= MAX_FAT32) fmt = FS_FAT32;
		if (nclst <= MAX_FAT16) fmt = FS_FAT16;
		if (nclst <= MAX_FAT12) fmt = FS_FAT12;
		if (fmt == 0) return FR_NO_FILESYSTEM;

		/* Boundaries and Limits */
		fs->n_fatent = nclst + 2;						/* Number of FAT entries */
		fs->volbase = bsect;							/* Volume start sector */
		fs->fatbase = bsect + nrsv; 					/* FAT start sector */
		fs->database = bsect + sysect;					/* Data start sector */
		if (fmt == FS_FAT32) {
			if (ld_word(fs->win + BPB_FSVer32) != 0) return FR_NO_FILESYSTEM;	/* (Must be FAT32 revision 0.0) */
			if (fs->n_rootdir != 0) return FR_NO_FILESYSTEM;	/* (BPB_RootEntCnt must be 0) */
			fs->dirbase = ld_dword(fs->win + BPB_RootClus32);	/* Root directory start cluster */
			szbfat = fs->n_fatent * 4;					/* (Needed FAT size) */
		} else {
			if (fs->n_rootdir == 0)	return FR_NO_FILESYSTEM;	/* (BPB_RootEntCnt must not be 0) */
			fs->dirbase = fs->fatbase + fasize;			/* Root directory start sector */
			szbfat = (fmt == FS_FAT16) ?				/* (Needed FAT size) */
				fs->n_fatent * 2 : fs->n_fatent * 3 / 2 + (fs->n_fatent & 1);
		}
		if (fs->fsize < (szbfat + (SS(fs) - 1)) / SS(fs)) return FR_NO_FILESYSTEM;	/* (BPB_FATSz must not be less than the size needed) */

#if !FF_FS_READONLY
		/* Get FSInfo if available */
		fs->last_clst = fs->free_clst = 0xFFFFFFFF;		/* Initialize cluster allocation information */
		fs->fsi_flag = 0x80;
#if (FF_FS_NOFSINFO & 3) != 3
		if (fmt == FS_FAT32				/* Allow to update FSInfo only if BPB_FSInfo32 == 1 */
			&& ld_word(fs->win + BPB_FSInfo32) == 1
			&& move_window(fs, bsect + 1) == FR_OK)
		{
			fs->fsi_flag = 0;
			if (ld_word(fs->win + BS_55AA) == 0xAA55	/* Load FSInfo data if available */
				&& ld_dword(fs->win + FSI_LeadSig) == 0x41615252
				&& ld_dword(fs->win + FSI_StrucSig) == 0x61417272)
			{
#if (FF_FS_NOFSINFO & 1) == 0
				fs->free_clst = ld_dword(fs->win + FSI_Free_Count);
#endif
#if (FF_FS_NOFSINFO & 2) == 0
				fs->last_clst = ld_dword(fs->win + FSI_Nxt_Free);
#endif
			}
		}
#endif	/* (FF_FS_NOFSINFO & 3) != 3 */
#endif	/* !FF_FS_READONLY */
	}

	fs->fs_type = (BYTE)fmt;/* FAT sub-type */
	fs->id = ++Fsid;		/* Volume mount ID */
#if FF_USE_LFN == 1
	fs->lfnbuf = LfnBuf;	/* Static LFN working buffer */
#if FF_FS_EXFAT
	fs->dirbuf = DirBuf;	/* Static directory block scratchpad buuffer */
#endif
#endif
#if FF_FS_RPATH != 0
	fs->cdir = 0;			/* Initialize current directory */
#endif
#if FF_FS_LOCK != 0			/* Clear file lock semaphores */
	clear_lock(fs);
#endif
	return FR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x4860
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
jge 0x4981
movl $0xb, -0x4(%rbp)
jmp 0x52ce
movslq -0x20(%rbp), %rcx
leaq 0x11b24(%rip), %rax     # 0x164b0
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
jne 0x49a7
movl $0xc, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movzbl -0x19(%rbp), %eax
andl $0xfe, %eax
movb %al, -0x19(%rbp)
movq -0x50(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
je 0x4a15
movq -0x50(%rbp), %rax
movzbl 0x1(%rax), %edi
callq 0x18a0
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x4a13
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
je 0x4a07
movzbl -0x21(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4a07
movl $0xa, -0x4(%rbp)
jmp 0x52ce
movl $0x0, -0x4(%rbp)
jmp 0x52ce
jmp 0x4a15
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movslq -0x20(%rbp), %rcx
leaq 0x11825(%rip), %rax     # 0x1624c
movb (%rax,%rcx,2), %cl
movq -0x50(%rbp), %rax
movb %cl, 0x1(%rax)
movq -0x50(%rbp), %rax
movzbl 0x1(%rax), %edi
callq 0x18e0
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x4a59
movl $0x3, -0x4(%rbp)
jmp 0x52ce
movzbl -0x19(%rbp), %eax
cmpl $0x0, %eax
je 0x4a7a
movzbl -0x21(%rbp), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x4a7a
movl $0xa, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
movslq -0x20(%rbp), %rcx
leaq 0x117c3(%rip), %rax     # 0x1624c
movzbl 0x1(%rax,%rcx,2), %esi
callq 0xde40
movl %eax, -0x54(%rbp)
cmpl $0x4, -0x54(%rbp)
jne 0x4aa8
movl $0x1, -0x4(%rbp)
jmp 0x52ce
cmpl $0x2, -0x54(%rbp)
jb 0x4aba
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rbp)
cmpl $0x1, -0x54(%rbp)
jne 0x4e7c
movl $0xb, -0x70(%rbp)
xorl %eax, %eax
cmpl $0x40, -0x70(%rbp)
movb %al, -0x71(%rbp)
jae 0x4af7
movq -0x50(%rbp), %rax
movl -0x70(%rbp), %ecx
movzbl 0x60(%rax,%rcx), %eax
cmpl $0x0, %eax
sete %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x4b00
jmp 0x4b0d
jmp 0x4b02
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0x4ad7
cmpl $0x40, -0x70(%rbp)
jae 0x4b1f
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x68, %rdi
callq 0x9390
movzwl %ax, %eax
cmpl $0x100, %eax            # imm = 0x100
je 0x4b46
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movzbl 0xcc(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
cmpl $0x200, %eax            # imm = 0x200
je 0x4b6b
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x48, %rdi
callq 0xd380
addq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x54, %rdi
callq 0x6510
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x50(%rbp), %rax
movb 0xce(%rax), %cl
movq -0x50(%rbp), %rax
movb %cl, 0x2(%rax)
movq -0x50(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x1, %eax
je 0x4bc8
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movzbl 0xcd(%rax), %ecx
movl $0x1, %eax
shll %cl, %eax
movw %ax, %cx
movq -0x50(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x50(%rbp), %rax
movzwl 0xa(%rax), %eax
cmpl $0x0, %eax
jne 0x4bfe
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x5c, %rdi
callq 0x6510
movl %eax, -0x40(%rbp)
cmpl $0x7ffffffd, -0x40(%rbp) # imm = 0x7FFFFFFD
jbe 0x4c27
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movl -0x40(%rbp), %ecx
addl $0x2, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x30(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x58, %rdi
callq 0x6510
movq -0x88(%rbp), %rcx
movl %eax, %eax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x50, %rdi
callq 0x6510
movq -0x80(%rbp), %rcx
movl %eax, %eax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x60(%rbp), %rax
movq -0x50(%rbp), %rcx
movq 0x48(%rcx), %rcx
movl -0x40(%rbp), %edx
movq -0x50(%rbp), %rsi
movzwl 0xa(%rsi), %esi
imull %esi, %edx
movl %edx, %edx
addq %rdx, %rcx
cmpq %rcx, %rax
jae 0x4cca
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x60, %rdi
callq 0x6510
movl %eax, %eax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movq %rcx, 0x40(%rax)
movl $0x0, -0x70(%rbp)
movl $0x0, -0x64(%rbp)
cmpl $0x0, -0x70(%rbp)
jne 0x4d63
movl -0x64(%rbp), %eax
movq -0x50(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
cmpl %ecx, %eax
jb 0x4d16
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x50(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x40(%rax), %rax
movl %eax, %esi
callq 0x6870
movq -0x90(%rbp), %rdi
movq %rax, %rsi
movl -0x64(%rbp), %eax
addq %rax, %rsi
callq 0x6480
cmpl $0x0, %eax
je 0x4d5a
movl $0x1, -0x4(%rbp)
jmp 0x52ce
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x50(%rbp), %rax
movl -0x70(%rbp), %ecx
movzbl 0x60(%rax,%rcx), %eax
cmpl $0x81, %eax
jne 0x4d78
jmp 0x4d8b
movl -0x70(%rbp), %eax
addl $0x20, %eax
andl $0x1ff, %eax            # imm = 0x1FF
movl %eax, -0x70(%rbp)
jmp 0x4cf5
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
movl -0x70(%rbp), %eax
addq %rax, %rdi
addq $0x14, %rdi
callq 0x6510
movl %eax, -0x6c(%rbp)
cmpl $0x2, -0x6c(%rbp)
jb 0x4db7
movl -0x6c(%rbp), %eax
movq -0x50(%rbp), %rcx
cmpl 0x28(%rcx), %eax
jb 0x4dc3
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movq 0x48(%rax), %rcx
movq -0x50(%rbp), %rax
movzwl 0xa(%rax), %eax
movl -0x6c(%rbp), %edx
subl $0x2, %edx
imull %edx, %eax
movl %eax, %eax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x50(%rbp), %rdi
movq -0x50(%rbp), %rax
movq 0x38(%rax), %rsi
movl -0x6c(%rbp), %eax
shrl $0x7, %eax
movl %eax, %eax
addq %rax, %rsi
callq 0x6480
cmpl $0x0, %eax
je 0x4e16
movl $0x1, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
movl -0x6c(%rbp), %eax
andl $0x7f, %eax
shll $0x2, %eax
movl %eax, %eax
addq %rax, %rdi
callq 0x6510
movl %eax, -0x68(%rbp)
cmpl $-0x1, -0x68(%rbp)
jne 0x4e3c
jmp 0x4e5a
movl -0x68(%rbp), %eax
movl -0x6c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x6c(%rbp)
cmpl %ecx, %eax
je 0x4e58
movl $0xd, -0x4(%rbp)
jmp 0x52ce
jmp 0x4de9
movq -0x50(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
movq -0x50(%rbp), %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movl $0x4, -0x54(%rbp)
jmp 0x52a2
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0xb, %rdi
callq 0x9390
movzwl %ax, %eax
cmpl $0x200, %eax            # imm = 0x200
je 0x4ea3
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x16, %rdi
callq 0x9390
movzwl %ax, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0x4ed4
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x24, %rdi
callq 0x6510
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x2c(%rax)
movq -0x50(%rbp), %rax
movb 0x70(%rax), %cl
movq -0x50(%rbp), %rax
movb %cl, 0x2(%rax)
movq -0x50(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x1, %eax
je 0x4f12
movq -0x50(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0x2, %eax
je 0x4f12
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movzbl 0x2(%rax), %eax
imull -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq -0x50(%rbp), %rax
movzbl 0x6d(%rax), %eax
movw %ax, %cx
movq -0x50(%rbp), %rax
movw %cx, 0xa(%rax)
movq -0x50(%rbp), %rax
movzwl 0xa(%rax), %eax
cmpl $0x0, %eax
je 0x4f5b
movq -0x50(%rbp), %rax
movzwl 0xa(%rax), %eax
movq -0x50(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
subl $0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x4f67
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x11, %rdi
callq 0x9390
movw %ax, %cx
movq -0x50(%rbp), %rax
movw %cx, 0x8(%rax)
movq -0x50(%rbp), %rax
movzwl 0x8(%rax), %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x4f9f
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x13, %rdi
callq 0x9390
movzwl %ax, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x4fd0
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x20, %rdi
callq 0x6510
movl %eax, -0x34(%rbp)
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0xe, %rdi
callq 0x9390
movw %ax, -0x46(%rbp)
movzwl -0x46(%rbp), %eax
cmpl $0x0, %eax
jne 0x4ffa
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movzwl -0x46(%rbp), %eax
addl -0x3c(%rbp), %eax
movq -0x50(%rbp), %rcx
movzwl 0x8(%rcx), %ecx
shrl $0x4, %ecx
addl %ecx, %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0x5025
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movl -0x34(%rbp), %eax
subl -0x38(%rbp), %eax
movq -0x50(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
jne 0x504c
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movl $0x0, -0x54(%rbp)
cmpl $0xffffff5, -0x40(%rbp) # imm = 0xFFFFFF5
ja 0x5063
movl $0x3, -0x54(%rbp)
cmpl $0xfff5, -0x40(%rbp)    # imm = 0xFFF5
ja 0x5073
movl $0x2, -0x54(%rbp)
cmpl $0xff5, -0x40(%rbp)     # imm = 0xFF5
ja 0x5083
movl $0x1, -0x54(%rbp)
cmpl $0x0, -0x54(%rbp)
jne 0x5095
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movl -0x40(%rbp), %ecx
addl $0x2, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x28(%rax)
movq -0x30(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x30(%rbp), %rcx
movzwl -0x46(%rbp), %eax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x30(%rbp), %rcx
movl -0x38(%rbp), %eax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x48(%rax)
cmpl $0x3, -0x54(%rbp)
jne 0x5143
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x2a, %rdi
callq 0x9390
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x50fe
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x0, %eax
je 0x5117
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x2c, %rdi
callq 0x6510
movl %eax, %eax
movl %eax, %ecx
movq -0x50(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x50(%rbp), %rax
movl 0x28(%rax), %eax
shll $0x2, %eax
movl %eax, -0x44(%rbp)
jmp 0x51ae
movq -0x50(%rbp), %rax
movzwl 0x8(%rax), %eax
cmpl $0x0, %eax
jne 0x515c
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movq 0x38(%rax), %rcx
movl -0x3c(%rbp), %eax
addq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x40(%rax)
cmpl $0x2, -0x54(%rbp)
jne 0x5189
movq -0x50(%rbp), %rax
movl 0x28(%rax), %eax
shll %eax
movl %eax, -0x94(%rbp)
jmp 0x51a5
movq -0x50(%rbp), %rax
imull $0x3, 0x28(%rax), %eax
shrl %eax
movq -0x50(%rbp), %rcx
movl 0x28(%rcx), %ecx
andl $0x1, %ecx
addl %ecx, %eax
movl %eax, -0x94(%rbp)
movl -0x94(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rax
movl 0x2c(%rax), %eax
movl -0x44(%rbp), %ecx
addl $0x1ff, %ecx            # imm = 0x1FF
shrl $0x9, %ecx
cmpl %ecx, %eax
jae 0x51d1
movl $0xd, -0x4(%rbp)
jmp 0x52ce
movq -0x50(%rbp), %rax
movl $0xffffffff, 0x24(%rax) # imm = 0xFFFFFFFF
movq -0x50(%rbp), %rax
movl $0xffffffff, 0x20(%rax) # imm = 0xFFFFFFFF
movq -0x50(%rbp), %rax
movb $-0x80, 0x4(%rax)
cmpl $0x3, -0x54(%rbp)
jne 0x52a0
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x30, %rdi
callq 0x9390
movzwl %ax, %eax
cmpl $0x1, %eax
jne 0x52a0
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
addq $0x1, %rsi
callq 0x6480
cmpl $0x0, %eax
jne 0x52a0
movq -0x50(%rbp), %rax
movb $0x0, 0x4(%rax)
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x1fe, %rdi            # imm = 0x1FE
callq 0x9390
movzwl %ax, %eax
cmpl $0xaa55, %eax           # imm = 0xAA55
jne 0x529e
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
callq 0x6510
cmpl $0x41615252, %eax       # imm = 0x41615252
jne 0x529e
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x1e4, %rdi            # imm = 0x1E4
callq 0x6510
cmpl $0x61417272, %eax       # imm = 0x61417272
jne 0x529e
movq -0x50(%rbp), %rdi
addq $0x60, %rdi
addq $0x1ec, %rdi            # imm = 0x1EC
callq 0x6510
movl %eax, %ecx
movq -0x50(%rbp), %rax
movl %ecx, 0x20(%rax)
jmp 0x52a0
jmp 0x52a2
movl -0x54(%rbp), %eax
movb %al, %cl
movq -0x50(%rbp), %rax
movb %cl, (%rax)
movw 0x11204(%rip), %cx      # 0x164b8
addw $0x1, %cx
movw %cx, 0x111f9(%rip)      # 0x164b8
movq -0x50(%rbp), %rax
movw %cx, 0x6(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)