	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _readfat
__readfat:                              ## @_readfat
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %r14d
	movq	%rsi, %r12
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	(%rsi), %ebx
	movl	4(%rsi), %r13d
	movl	%ebx, %edi
	movl	%r13d, %esi
	callq	_calloc
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	imull	%r14d, %ebx
	addl	8(%r12), %ebx
	imull	%r13d, %ebx
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %edi
	movl	%ebx, %esi
	callq	_lseek
	cmpl	%ebx, %eax
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_4
## %bb.3:
	movq	(%r14), %rsi
	movl	4(%r12), %edx
	imull	(%r12), %edx
	movl	%r15d, %edi
	callq	_read
	movslq	(%r12), %rcx
	movslq	4(%r12), %rdx
	imulq	%rcx, %rdx
	movl	$1, %ebx
	cmpq	%rdx, %rax
	je	LBB0_5
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_perr
	movq	(%r14), %rdi
	callq	_free
	jmp	LBB0_5
LBB0_1:
	movslq	%ebx, %rsi
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_perr
LBB0_5:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No space for FAT sectors (%zu)"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.1:                               ## @.str.1
	.asciz	"Unable to read FAT"

	.no_dead_strip	__readfat
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _readfat
__readfat:                              ; @_readfat
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldp	w0, w23, [x1]
	sxtw	x24, w0
                                        ; kill: def $w0 killed $w0 killed $x0
	mov	x1, x23
	bl	_calloc
	str	x0, [x19]
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w8, [x20, #8]
	madd	w8, w24, w22, w8
	mul	w22, w8, w23
Lloh0:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x22
	bl	_lseek
	cmp	w0, w22
	b.ne	LBB0_4
; %bb.2:
	ldr	x1, [x19]
	ldp	w8, w9, [x20]
	mul	w2, w9, w8
	mov	x0, x21
	bl	_read
	ldpsw	x8, x9, [x20]
	mul	x8, x9, x8
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #1
	b	LBB0_7
LBB0_4:
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_perr
	ldr	x0, [x19]
	bl	_free
	b	LBB0_6
LBB0_5:
	str	x24, [sp]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_perr
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No space for FAT sectors (%zu)"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.1:                               ; @.str.1
	.asciz	"Unable to read FAT"

	.no_dead_strip	__readfat
.subsections_via_symbols
