// File: /workspace/github_c_makefile_star2_O0/lb3361[P]dosfs/ff.c
// Function: create_partition
static FRESULT create_partition (
	BYTE drv,			/* Physical drive number */
	const LBA_t plst[],	/* Partition list */
	BYTE sys,			/* System ID (for only MBR, temp setting) */
	BYTE* buf			/* Working buffer for a sector */
)
{
	UINT i, cy;
	LBA_t sz_drv;
	DWORD sz_drv32, s_lba32, n_lba32;
	BYTE *pte, hd, n_hd, sc, n_sc;

	/* Get drive size */
	if (disk_ioctl(drv, GET_SECTOR_COUNT, &sz_drv) != RES_OK) return FR_DISK_ERR;

#if FF_LBA64
	if (sz_drv >= FF_MIN_GPT) {	/* Create partitions in GPT */
		WORD ss;
		UINT sz_pt, pi, si, ofs;
		DWORD bcc, rnd, align;
		QWORD s_lba64, n_lba64, sz_pool, s_bpt;
		static const BYTE gpt_mbr[16] = {0x00, 0x00, 0x02, 0x00, 0xEE, 0xFE, 0xFF, 0x00, 0x01, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF};

#if FF_MAX_SS != FF_MIN_SS
		if (disk_ioctl(drv, GET_SECTOR_SIZE, &ss) != RES_OK) return FR_DISK_ERR;	/* Get sector size */
		if (ss > FF_MAX_SS || ss < FF_MIN_SS || (ss & (ss - 1))) return FR_DISK_ERR;
#else
		ss = FF_MAX_SS;
#endif
		rnd = GET_FATTIME();			/* Random seed */
		align = GPT_ALIGN / ss;			/* Partition alignment [sector] */
		sz_pt = GPT_ITEMS * SZ_GPTE / ss;	/* Size of PT [sector] */
		s_bpt = sz_drv - sz_pt - 1;		/* Backup PT start sector */
		s_lba64 = 2 + sz_pt;			/* First allocatable sector */
		sz_pool = s_bpt - s_lba64;		/* Size of allocatable area */
		bcc = 0xFFFFFFFF; n_lba64 = 1;
		pi = si = 0;	/* partition table index, size table index */
		do {
			if (pi * SZ_GPTE % ss == 0) mem_set(buf, 0, ss);	/* Clean the buffer if needed */
			if (n_lba64 != 0) {	/* Is the size table not termintated? */
				s_lba64 = (s_lba64 + align - 1) & ((QWORD)0 - align);	/* Align partition start */
				n_lba64 = plst[si++];	/* Get a partition size */
				if (n_lba64 <= 100) {	/* Is the size in percentage? */
					n_lba64 = sz_pool * n_lba64 / 100;
					n_lba64 = (n_lba64 + align - 1) & ((QWORD)0 - align);	/* Align partition end (only if in percentage) */
				}
				if (s_lba64 + n_lba64 > s_bpt) {	/* Clip at end of the pool */
					n_lba64 = (s_lba64 < s_bpt) ? s_bpt - s_lba64 : 0;
				}
			}
			if (n_lba64 != 0) {		/* Add a partition? */
				ofs = pi * SZ_GPTE % ss;
				mem_cpy(buf + ofs + GPTE_PtGuid, GUID_MS_Basic, 16);	/* Partition GUID (Microsoft Basic Data) */
				rnd = make_rand(rnd, buf + ofs + GPTE_UpGuid, 16);		/* Unique partition GUID */
				st_qword(buf + ofs + GPTE_FstLba, s_lba64);				/* Partition start LBA */
				st_qword(buf + ofs + GPTE_LstLba, s_lba64 + n_lba64 - 1);	/* Partition end LBA */
				s_lba64 += n_lba64;		/* Next partition LBA */
			}
			if ((pi + 1) * SZ_GPTE % ss == 0) {		/* Write the buffer if it is filled up */
				for (i = 0; i < ss; bcc = crc32(bcc, buf[i++])) ;	/* Calculate table check sum */
				if (disk_write(drv, buf, 2 + pi * SZ_GPTE / ss, 1) != RES_OK) return FR_DISK_ERR;		/* Primary table */
				if (disk_write(drv, buf, s_bpt + pi * SZ_GPTE / ss, 1) != RES_OK) return FR_DISK_ERR;	/* Secondary table */
			}
		} while (++pi < GPT_ITEMS);

		/* Create primary GPT header */
		mem_set(buf, 0, ss);
		mem_cpy(buf + GPTH_Sign, "EFI PART" "\0\0\1\0" "\x5C\0\0", 16);	/* Signature, version (1.0) and size (92) */
		st_dword(buf + GPTH_PtBcc, ~bcc);				/* Table check sum */
		st_qword(buf + GPTH_CurLba, 1);					/* LBA of this header */
		st_qword(buf + GPTH_BakLba, sz_drv - 1);		/* LBA of another header */
		st_qword(buf + GPTH_FstLba, 2 + sz_pt);			/* LBA of first allocatable sector */
		st_qword(buf + GPTH_LstLba, s_bpt - 1);			/* LBA of last allocatable sector */
		st_dword(buf + GPTH_PteSize, SZ_GPTE);			/* Size of a table entry */
		st_dword(buf + GPTH_PtNum, GPT_ITEMS);			/* Number of table entries */
		st_dword(buf + GPTH_PtOfs, 2);					/* LBA of this table */
		rnd = make_rand(rnd, buf + GPTH_DskGuid, 16);	/* Disk GUID */
		for (i = 0, bcc= 0xFFFFFFFF; i < 92; bcc = crc32(bcc, buf[i++])) ;	/* Calculate header check sum */
		st_dword(buf + GPTH_Bcc, ~bcc);					/* Header check sum */
		if (disk_write(drv, buf, 1, 1) != RES_OK) return FR_DISK_ERR;

		/* Create secondary GPT header */
		st_qword(buf + GPTH_CurLba, sz_drv - 1);		/* LBA of this header */
		st_qword(buf + GPTH_BakLba, 1);					/* LBA of another header */
		st_qword(buf + GPTH_PtOfs, s_bpt);				/* LBA of this table */
		st_dword(buf + GPTH_Bcc, 0);
		for (i = 0, bcc= 0xFFFFFFFF; i < 92; bcc = crc32(bcc, buf[i++])) ;	/* Calculate header check sum */
		st_dword(buf + GPTH_Bcc, ~bcc);					/* Header check sum */
		if (disk_write(drv, buf, sz_drv - 1, 1) != RES_OK) return FR_DISK_ERR;

		/* Create protective MBR */
		mem_set(buf, 0, ss);
		mem_cpy(buf + MBR_Table, gpt_mbr, 16);			/* Create a GPT partition */
		st_word(buf + BS_55AA, 0xAA55);
		if (disk_write(drv, buf, 0, 1) != RES_OK) return FR_DISK_ERR;

	} else
#endif
	{					/* Create partitions in MBR */
		sz_drv32 = (DWORD)sz_drv;
		n_sc = N_SEC_TRACK;		/* Determine drive CHS without any consideration of the drive geometry */
		for (n_hd = 8; n_hd != 0 && sz_drv32 / n_hd / n_sc > 1024; n_hd *= 2) ;
		if (n_hd == 0) n_hd = 255;	/* Number of heads needs to be <256 */

		mem_set(buf, 0, FF_MAX_SS);	/* Clear MBR */
		pte = buf + MBR_Table;	/* Partition table in the MBR */
		for (i = 0, s_lba32 = n_sc; i < 4 && s_lba32 != 0 && s_lba32 < sz_drv32; i++, s_lba32 += n_lba32) {
			n_lba32 = (DWORD)plst[i];	/* Get partition size */
			if (n_lba32 <= 100) n_lba32 = (n_lba32 == 100) ? sz_drv32 : sz_drv32 / 100 * n_lba32;	/* Size in percentage? */
			if (s_lba32 + n_lba32 > sz_drv32 || s_lba32 + n_lba32 < s_lba32) n_lba32 = sz_drv32 - s_lba32;	/* Clip at drive size */
			if (n_lba32 == 0) break;	/* End of table or no sector to allocate? */

			st_dword(pte + PTE_StLba, s_lba32);		/* Start LBA */
			st_dword(pte + PTE_SizLba, n_lba32);	/* Number of sectors */
			pte[PTE_System] = sys;					/* System type */

			cy = (UINT)(s_lba32 / n_sc / n_hd);		/* Start cylinder */
			hd = (BYTE)(s_lba32 / n_sc % n_hd);		/* Start head */
			sc = (BYTE)(s_lba32 % n_sc + 1);		/* Start sector */
			pte[PTE_StHead] = hd;
			pte[PTE_StSec] = (BYTE)((cy >> 2 & 0xC0) | sc);
			pte[PTE_StCyl] = (BYTE)cy;

			cy = (UINT)((s_lba32 + n_lba32 - 1) / n_sc / n_hd);	/* End cylinder */
			hd = (BYTE)((s_lba32 + n_lba32 - 1) / n_sc % n_hd);	/* End head */
			sc = (BYTE)((s_lba32 + n_lba32 - 1) % n_sc + 1);	/* End sector */
			pte[PTE_EdHead] = hd;
			pte[PTE_EdSec] = (BYTE)((cy >> 2 & 0xC0) | sc);
			pte[PTE_EdCyl] = (BYTE)cy;

			pte += SZ_PTE;		/* Next entry */
		}

		st_word(buf + BS_55AA, 0xAA55);		/* MBR signature */
		if (disk_write(drv, buf, 0, 1) != RES_OK) return FR_DISK_ERR;	/* Write it to the MBR */
	}

	return FR_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movb %dl, %al
movb %dil, %dl
movb %dl, -0x5(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x1, %esi
leaq -0x30(%rbp), %rdx
movzbl -0x5(%rbp), %edi
callq 0x1b20
cmpl $0x0, %eax
je 0xd541
movl $0x1, -0x4(%rbp)
jmp 0xdd9c
cmpq $0x10000000, -0x30(%rbp) # imm = 0x10000000
jb 0xdadc
movw $0x200, -0x4e(%rbp)     # imm = 0x200
callq 0x1be0
movl %eax, -0x68(%rbp)
movzwl -0x4e(%rbp), %ecx
movl $0x100000, %eax         # imm = 0x100000
cltd
idivl %ecx
movl %eax, -0x6c(%rbp)
movzwl -0x4e(%rbp), %ecx
movl $0x4000, %eax           # imm = 0x4000
cltd
idivl %ecx
movl %eax, -0x54(%rbp)
movq -0x30(%rbp), %rax
movl -0x54(%rbp), %ecx
subq %rcx, %rax
subq $0x1, %rax
movq %rax, -0x90(%rbp)
movl -0x54(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
movq %rax, -0x78(%rbp)
movq -0x90(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
movq $0x1, -0x80(%rbp)
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
shll $0x7, %eax
movzwl -0x4e(%rbp), %ecx
xorl %edx, %edx
divl %ecx
cmpl $0x0, %edx
jne 0xd5ed
movq -0x20(%rbp), %rdi
movzwl -0x4e(%rbp), %edx
xorl %esi, %esi
callq 0x5f80
cmpq $0x0, -0x80(%rbp)
je 0xd6ba
movq -0x78(%rbp), %rax
movl -0x6c(%rbp), %ecx
addq %rcx, %rax
subq $0x1, %rax
movl -0x6c(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
andq %rcx, %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rax
movl -0x5c(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x5c(%rbp)
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
cmpq $0x64, -0x80(%rbp)
ja 0xd670
movq -0x88(%rbp), %rax
imulq -0x80(%rbp), %rax
movl $0x64, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movl -0x6c(%rbp), %ecx
addq %rcx, %rax
subq $0x1, %rax
movl -0x6c(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
andq %rcx, %rax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %rax
addq -0x80(%rbp), %rax
cmpq -0x90(%rbp), %rax
jbe 0xd6b8
movq -0x78(%rbp), %rax
cmpq -0x90(%rbp), %rax
jae 0xd6a2
movq -0x90(%rbp), %rax
subq -0x78(%rbp), %rax
movq %rax, -0x98(%rbp)
jmp 0xd6ad
xorl %eax, %eax
movq %rax, -0x98(%rbp)
jmp 0xd6ad
movq -0x98(%rbp), %rax
movq %rax, -0x80(%rbp)
jmp 0xd6ba
cmpq $0x0, -0x80(%rbp)
je 0xd751
movl -0x58(%rbp), %eax
shll $0x7, %eax
movzwl -0x4e(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movl %edx, -0x60(%rbp)
movq -0x20(%rbp), %rdi
movl -0x60(%rbp), %eax
addq %rax, %rdi
leaq 0x4d69(%rip), %rsi      # 0x12450
movl $0x10, %edx
callq 0x6d20
movl -0x68(%rbp), %edi
movq -0x20(%rbp), %rsi
movl -0x60(%rbp), %eax
addq %rax, %rsi
addq $0x10, %rsi
movl $0x10, %edx
callq 0xfda0
movl %eax, -0x68(%rbp)
movq -0x20(%rbp), %rdi
movl -0x60(%rbp), %eax
addq %rax, %rdi
addq $0x20, %rdi
movq -0x78(%rbp), %rsi
callq 0x79f0
movq -0x20(%rbp), %rdi
movl -0x60(%rbp), %eax
addq %rax, %rdi
addq $0x28, %rdi
movq -0x78(%rbp), %rsi
addq -0x80(%rbp), %rsi
subq $0x1, %rsi
callq 0x79f0
movq -0x80(%rbp), %rax
addq -0x78(%rbp), %rax
movq %rax, -0x78(%rbp)
movl -0x58(%rbp), %eax
addl $0x1, %eax
shll $0x7, %eax
movzwl -0x4e(%rbp), %ecx
xorl %edx, %edx
divl %ecx
cmpl $0x0, %edx
jne 0xd846
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movzwl -0x4e(%rbp), %ecx
cmpl %ecx, %eax
jae 0xd7a1
jmp 0xd77f
movl -0x64(%rbp), %edi
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %esi
callq 0xfd30
movl %eax, -0x64(%rbp)
jmp 0xd772
movb -0x5(%rbp), %al
movb %al, -0x99(%rbp)
movq -0x20(%rbp), %rsi
movl -0x58(%rbp), %eax
shll $0x7, %eax
movzwl -0x4e(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movb -0x99(%rbp), %al
addl $0x2, %ecx
movl %ecx, %ecx
movl %ecx, %edx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
cmpl $0x0, %eax
je 0xd7e9
movl $0x1, -0x4(%rbp)
jmp 0xdd9c
movb -0x5(%rbp), %al
movb %al, -0x9a(%rbp)
movq -0x20(%rbp), %rsi
movq -0x90(%rbp), %rax
movq %rax, -0xa8(%rbp)
movl -0x58(%rbp), %eax
shll $0x7, %eax
movzwl -0x4e(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movq -0xa8(%rbp), %rdx
movl %eax, %ecx
movb -0x9a(%rbp), %al
movl %ecx, %ecx
addq %rcx, %rdx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
cmpl $0x0, %eax
je 0xd844
movl $0x1, -0x4(%rbp)
jmp 0xdd9c
jmp 0xd846
jmp 0xd848
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
cmpl $0x80, %eax
jb 0xd5cb
movq -0x20(%rbp), %rdi
movzwl -0x4e(%rbp), %edx
xorl %esi, %esi
callq 0x5f80
movq -0x20(%rbp), %rdi
leaq 0x4cda(%rip), %rsi      # 0x12550
movl $0x10, %edx
callq 0x6d20
movq -0x20(%rbp), %rdi
addq $0x58, %rdi
movl -0x64(%rbp), %esi
xorl $-0x1, %esi
callq 0x5fc0
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
movl $0x1, %esi
callq 0x79f0
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movq -0x30(%rbp), %rsi
subq $0x1, %rsi
callq 0x79f0
movq -0x20(%rbp), %rdi
addq $0x28, %rdi
movl -0x54(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
movl %eax, %esi
callq 0x79f0
movq -0x20(%rbp), %rdi
addq $0x30, %rdi
movq -0x90(%rbp), %rsi
subq $0x1, %rsi
callq 0x79f0
movq -0x20(%rbp), %rdi
addq $0x54, %rdi
movl $0x80, %esi
callq 0x5fc0
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
movl $0x80, %esi
callq 0x5fc0
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
movl $0x2, %esi
callq 0x5fc0
movl -0x68(%rbp), %edi
movq -0x20(%rbp), %rsi
addq $0x38, %rsi
movl $0x10, %edx
callq 0xfda0
movl %eax, -0x68(%rbp)
movl $0x0, -0x24(%rbp)
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
cmpl $0x5c, -0x24(%rbp)
jae 0xd96f
jmp 0xd94d
movl -0x64(%rbp), %edi
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %esi
callq 0xfd30
movl %eax, -0x64(%rbp)
jmp 0xd945
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movl -0x64(%rbp), %esi
xorl $-0x1, %esi
callq 0x5fc0
movb -0x5(%rbp), %al
movq -0x20(%rbp), %rsi
movl $0x1, %edx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
cmpl $0x0, %eax
je 0xd9ac
movl $0x1, -0x4(%rbp)
jmp 0xdd9c
movq -0x20(%rbp), %rdi
addq $0x18, %rdi
movq -0x30(%rbp), %rsi
subq $0x1, %rsi
callq 0x79f0
movq -0x20(%rbp), %rdi
addq $0x20, %rdi
movl $0x1, %esi
callq 0x79f0
movq -0x20(%rbp), %rdi
addq $0x48, %rdi
movq -0x90(%rbp), %rsi
callq 0x79f0
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
xorl %esi, %esi
callq 0x5fc0
movl $0x0, -0x24(%rbp)
movl $0xffffffff, -0x64(%rbp) # imm = 0xFFFFFFFF
cmpl $0x5c, -0x24(%rbp)
jae 0xda2e
jmp 0xda0c
movl -0x64(%rbp), %edi
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x24(%rbp)
movl %ecx, %ecx
movzbl (%rax,%rcx), %esi
callq 0xfd30
movl %eax, -0x64(%rbp)
jmp 0xda04
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
movl -0x64(%rbp), %esi
xorl $-0x1, %esi
callq 0x5fc0
movb -0x5(%rbp), %al
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
subq $0x1, %rdx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
cmpl $0x0, %eax
je 0xda6e
movl $0x1, -0x4(%rbp)
jmp 0xdd9c
movq -0x20(%rbp), %rdi
movzwl -0x4e(%rbp), %edx
xorl %esi, %esi
callq 0x5f80
movq -0x20(%rbp), %rdi
addq $0x1be, %rdi            # imm = 0x1BE
leaq 0x4a61(%rip), %rsi      # 0x124f0
movl $0x10, %edx
callq 0x6d20
movq -0x20(%rbp), %rdi
addq $0x1fe, %rdi            # imm = 0x1FE
movl $0xaa55, %esi           # imm = 0xAA55
callq 0x7c50
movb -0x5(%rbp), %al
movq -0x20(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
cmpl $0x0, %eax
je 0xdad7
movl $0x1, -0x4(%rbp)
jmp 0xdd9c
jmp 0xdd95
movq -0x30(%rbp), %rax
movl %eax, -0x34(%rbp)
movb $0x3f, -0x4c(%rbp)
movb $0x8, -0x4a(%rbp)
movzbl -0x4a(%rbp), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xa9(%rbp)
je 0xdb1d
movl -0x34(%rbp), %eax
movzbl -0x4a(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movzbl -0x4c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
cmpl $0x400, %eax            # imm = 0x400
seta %al
movb %al, -0xa9(%rbp)
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0xdb29
jmp 0xdb36
jmp 0xdb2b
movzbl -0x4a(%rbp), %eax
shll %eax
movb %al, -0x4a(%rbp)
jmp 0xdaeb
movzbl -0x4a(%rbp), %eax
cmpl $0x0, %eax
jne 0xdb43
movb $-0x1, -0x4a(%rbp)
movq -0x20(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x5f80
movq -0x20(%rbp), %rax
addq $0x1be, %rax            # imm = 0x1BE
movq %rax, -0x48(%rbp)
movl $0x0, -0x24(%rbp)
movzbl -0x4c(%rbp), %eax
movl %eax, -0x38(%rbp)
xorl %eax, %eax
cmpl $0x4, -0x24(%rbp)
movb %al, -0xaa(%rbp)
jae 0xdb9a
xorl %eax, %eax
cmpl $0x0, -0x38(%rbp)
movb %al, -0xaa(%rbp)
je 0xdb9a
movl -0x38(%rbp), %eax
cmpl -0x34(%rbp), %eax
setb %al
movb %al, -0xaa(%rbp)
movb -0xaa(%rbp), %al
testb $0x1, %al
jne 0xdba9
jmp 0xdd58
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movl %eax, -0x3c(%rbp)
cmpl $0x64, -0x3c(%rbp)
ja 0xdbed
cmpl $0x64, -0x3c(%rbp)
jne 0xdbce
movl -0x34(%rbp), %eax
movl %eax, -0xb0(%rbp)
jmp 0xdbe4
movl -0x34(%rbp), %eax
movl $0x64, %ecx
xorl %edx, %edx
divl %ecx
imull -0x3c(%rbp), %eax
movl %eax, -0xb0(%rbp)
movl -0xb0(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x38(%rbp), %eax
addl -0x3c(%rbp), %eax
cmpl -0x34(%rbp), %eax
ja 0xdc03
movl -0x38(%rbp), %eax
addl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jae 0xdc0c
movl -0x34(%rbp), %eax
subl -0x38(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
jne 0xdc17
jmp 0xdd58
movq -0x48(%rbp), %rdi
addq $0x8, %rdi
movl -0x38(%rbp), %esi
callq 0x5fc0
movq -0x48(%rbp), %rdi
addq $0xc, %rdi
movl -0x3c(%rbp), %esi
callq 0x5fc0
movb -0x11(%rbp), %cl
movq -0x48(%rbp), %rax
movb %cl, 0x4(%rax)
movl -0x38(%rbp), %eax
movzbl -0x4c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movzbl -0x4a(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x28(%rbp)
movl -0x38(%rbp), %eax
movzbl -0x4c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movzbl -0x4a(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movb %dl, %al
movb %al, -0x49(%rbp)
movl -0x38(%rbp), %eax
movzbl -0x4c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
addl $0x1, %edx
movb %dl, %al
movb %al, -0x4b(%rbp)
movb -0x49(%rbp), %cl
movq -0x48(%rbp), %rax
movb %cl, 0x1(%rax)
movl -0x28(%rbp), %eax
shrl $0x2, %eax
andl $0xc0, %eax
movzbl -0x4b(%rbp), %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, 0x2(%rax)
movl -0x28(%rbp), %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, 0x3(%rax)
movl -0x38(%rbp), %eax
addl -0x3c(%rbp), %eax
subl $0x1, %eax
movzbl -0x4c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movzbl -0x4a(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movl %eax, -0x28(%rbp)
movl -0x38(%rbp), %eax
addl -0x3c(%rbp), %eax
subl $0x1, %eax
movzbl -0x4c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movzbl -0x4a(%rbp), %ecx
xorl %edx, %edx
divl %ecx
movb %dl, %al
movb %al, -0x49(%rbp)
movl -0x38(%rbp), %eax
addl -0x3c(%rbp), %eax
subl $0x1, %eax
movzbl -0x4c(%rbp), %ecx
xorl %edx, %edx
divl %ecx
addl $0x1, %edx
movb %dl, %al
movb %al, -0x4b(%rbp)
movb -0x49(%rbp), %cl
movq -0x48(%rbp), %rax
movb %cl, 0x5(%rax)
movl -0x28(%rbp), %eax
shrl $0x2, %eax
andl $0xc0, %eax
movzbl -0x4b(%rbp), %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, 0x6(%rax)
movl -0x28(%rbp), %eax
movb %al, %cl
movq -0x48(%rbp), %rax
movb %cl, 0x7(%rax)
movq -0x48(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x48(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x3c(%rbp), %eax
addl -0x38(%rbp), %eax
movl %eax, -0x38(%rbp)
jmp 0xdb6f
movq -0x20(%rbp), %rdi
addq $0x1fe, %rdi            # imm = 0x1FE
movl $0xaa55, %esi           # imm = 0xAA55
callq 0x7c50
movb -0x5(%rbp), %al
movq -0x20(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
movl $0x1, %ecx
movzbl %al, %edi
callq 0x1a40
cmpl $0x0, %eax
je 0xdd93
movl $0x1, -0x4(%rbp)
jmp 0xdd9c
jmp 0xdd95
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)