	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function FatReadFile
_FatReadFile:                           ## @FatReadFile
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	24(%rdi), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	L_.str(%rip), %rdi
	movq	%rcx, %rdx
	xorl	%eax, %eax
	callq	_TRACE
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	$0, (%rbx)
LBB0_2:
	movq	(%r13), %rax
	movq	8(%r13), %rcx
	movq	_TRUE@GOTPCREL(%rip), %rsi
	movq	%rcx, %r14
	subq	%rax, %r14
	jle	LBB0_8
## %bb.3:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%r15), %rdx
	cmpq	%rcx, %rdx
	cmovleq	%r15, %r14
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movslq	(%rdx), %rcx
	movslq	4(%rdx), %r15
	imulq	%rcx, %r15
	movq	%rax, %rcx
	orq	%r15, %rcx
	shrq	$32, %rcx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_9
## %bb.4:
	cqto
	idivq	%r15
	movq	%rdx, %r12
	testq	%r12, %r12
	je	LBB0_5
LBB0_10:
	movl	%r15d, %esi
	subl	%r12d, %esi
	movq	%r14, %rdi
	callq	_min
	movl	%eax, %ebx
	cmpl	%r15d, %eax
	setle	%al
	testl	%ebx, %ebx
	setg	%cl
	andb	%al, %cl
	movzbl	%cl, %edi
	callq	_ASSERT
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movl	16(%r13), %esi
	movslq	%ebx, %rbx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movq	%rbx, %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_FatReadPartialCluster
	movq	_FALSE@GOTPCREL(%rip), %r13
	testl	%eax, %eax
	je	LBB0_34
## %bb.11:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	addq	%rbx, (%rax)
LBB0_13:
	subq	%rbx, %r14
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	addq	%rbx, (%rcx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%ebx, %eax
	cltq
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	addl	%ebx, %r12d
	cmpl	%r15d, %r12d
	jne	LBB0_16
## %bb.14:
	movq	%rcx, %rbx
	movl	16(%rcx), %esi
	leaq	-44(%rbp), %rdx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_FatGetFatEntry
	testl	%eax, %eax
	je	LBB0_34
## %bb.15:
	movl	-44(%rbp), %esi
	movq	%rbx, %r13
	movl	%esi, 16(%rbx)
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	jmp	LBB0_17
LBB0_9:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r15d
	movl	%edx, %r12d
	testq	%r12, %r12
	jne	LBB0_10
LBB0_5:
	testq	%r14, %r14
	jle	LBB0_8
LBB0_6:
	movq	%r14, %rax
	orq	%r15, %rax
	shrq	$32, %rax
	je	LBB0_19
## %bb.7:
	movq	%r14, %rax
	cqto
	idivq	%r15
	movq	%rax, %r12
	jmp	LBB0_20
LBB0_16:
	movq	%rcx, %r13
LBB0_17:
	movq	_TRUE@GOTPCREL(%rip), %rsi
	testq	%r14, %r14
	jg	LBB0_6
LBB0_8:
	movq	%rsi, %r13
LBB0_34:
	movl	(%r13), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	%r15d
	movl	%eax, %r12d
LBB0_20:
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_TRACE
	testl	%r12d, %r12d
	jle	LBB0_26
## %bb.21:
	movl	16(%r13), %edi
	callq	_FAT_IS_END_CLUSTER
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_ASSERT
	movl	16(%r13), %esi
	leaq	-44(%rbp), %r8
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_FatReadClusterChain
	testl	%eax, %eax
	je	LBB0_33
## %bb.22:
	imull	%r15d, %r12d
	movslq	%r12d, %rbx
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	testq	%r15, %r15
	je	LBB0_24
## %bb.23:
	addq	%rbx, (%r15)
LBB0_24:
	movl	-44(%rbp), %edi
	callq	_FAT_IS_END_CLUSTER
	testl	%eax, %eax
	sete	%al
	cmpq	%rbx, %r14
	sete	%cl
	orb	%al, %cl
	movzbl	%cl, %edi
	callq	_ASSERT
	addq	%rbx, (%r13)
	movl	-44(%rbp), %esi
	movl	%esi, 16(%r13)
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	subq	%rbx, %r14
	jle	LBB0_31
## %bb.25:
	addl	-56(%rbp), %r12d                ## 4-byte Folded Reload
	movslq	%r12d, %rbx
	jmp	LBB0_27
LBB0_26:
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_27:
	movl	16(%r13), %edi
	callq	_FAT_IS_END_CLUSTER
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_ASSERT
	movl	16(%r13), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	movq	%r14, %rcx
	movq	%rbx, %r8
	callq	_FatReadPartialCluster
	testl	%eax, %eax
	je	LBB0_33
## %bb.28:
	testq	%r15, %r15
	je	LBB0_30
## %bb.29:
	addq	%r14, (%r15)
LBB0_30:
	addq	%r14, (%r13)
LBB0_31:
	movq	_TRUE@GOTPCREL(%rip), %r13
	jmp	LBB0_34
LBB0_33:
	movq	_FALSE@GOTPCREL(%rip), %r13
	jmp	LBB0_34
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FatReadFile() BytesToRead = %d Buffer = 0x%x\n"

	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_FALSE,4,2                      ## @FALSE
L_.str.1:                               ## @.str.1
	.asciz	"FatReadFile() FatFileInfo->CurrentCluster = 0x%x\n"

L_.str.2:                               ## @.str.2
	.asciz	"Going to read: %u clusters\n"

	.no_dead_strip	_FatReadFile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function FatReadFile
_FatReadFile:                           ; @FatReadFile
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
	ldr	x22, [x0, #24]
	str	x3, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	cbz	x20, LBB0_2
; %bb.1:
	str	xzr, [x20]
LBB0_2:
	ldp	x8, x9, [x19]
	subs	x10, x9, x8
	b.le	LBB0_21
; %bb.3:
	add	x11, x8, x23
	cmp	x11, x9
	csel	x23, x10, x23, gt
	ldpsw	x9, x10, [x22]
	mul	x26, x10, x9
	sdiv	x9, x8, x26
	msub	x24, x9, x26, x8
	cbz	x24, LBB0_10
; %bb.4:
	sub	w1, w26, w24
	mov	x0, x23
	bl	_min
	mov	x25, x0
	cmp	w0, w26
	ccmp	w0, #0, #4, le
	cset	w0, gt
	bl	_ASSERT
	ldr	w1, [x19, #16]
	sxtw	x25, w25
	mov	x0, x22
	mov	x2, x24
	mov	x3, x25
	mov	x4, x21
	bl	_FatReadPartialCluster
	cbz	w0, LBB0_22
; %bb.5:
	cbz	x20, LBB0_7
; %bb.6:
	ldr	x8, [x20]
	add	x8, x8, x25
	str	x8, [x20]
LBB0_7:
	sub	x23, x23, x25
	ldr	x8, [x19]
	add	x8, x8, x25
	str	x8, [x19]
	add	w8, w25, w21
	sxtw	x21, w8
	add	w8, w25, w24
	cmp	w8, w26
	b.ne	LBB0_10
; %bb.8:
	ldr	w1, [x19, #16]
	add	x2, sp, #12
	mov	x0, x22
	bl	_FatGetFatEntry
	cbz	w0, LBB0_22
; %bb.9:
	ldr	w1, [sp, #12]
	str	w1, [x19, #16]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
LBB0_10:
	cmp	x23, #1
	b.lt	LBB0_21
; %bb.11:
	sdiv	x24, x23, x26
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x24
	bl	_TRACE
	cmp	w24, #1
	b.lt	LBB0_17
; %bb.12:
	ldr	w0, [x19, #16]
	bl	_FAT_IS_END_CLUSTER
	cmp	w0, #0
	cset	w0, eq
	bl	_ASSERT
	ldr	w1, [x19, #16]
	add	x4, sp, #12
	mov	x0, x22
	mov	x2, x24
	mov	x3, x21
	bl	_FatReadClusterChain
	cbz	w0, LBB0_22
; %bb.13:
	mul	w24, w26, w24
	sxtw	x25, w24
	cbz	x20, LBB0_15
; %bb.14:
	ldr	x8, [x20]
	add	x8, x8, x25
	str	x8, [x20]
LBB0_15:
	sub	x23, x23, x25
	ldr	w0, [sp, #12]
	bl	_FAT_IS_END_CLUSTER
	cmp	w0, #0
	ccmp	x23, #0, #4, ne
	cset	w0, eq
	bl	_ASSERT
	ldr	x8, [x19]
	add	x8, x8, x25
	str	x8, [x19]
	ldr	w1, [sp, #12]
	str	w1, [x19, #16]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
	cmp	x23, #1
	b.lt	LBB0_21
; %bb.16:
	add	w8, w24, w21
	sxtw	x21, w8
LBB0_17:
	ldr	w0, [x19, #16]
	bl	_FAT_IS_END_CLUSTER
	cmp	w0, #0
	cset	w0, eq
	bl	_ASSERT
	ldr	w1, [x19, #16]
	mov	x0, x22
	mov	w2, #0
	mov	x3, x23
	mov	x4, x21
	bl	_FatReadPartialCluster
	cbz	w0, LBB0_22
; %bb.18:
	cbz	x20, LBB0_20
; %bb.19:
	ldr	x8, [x20]
	add	x8, x8, x23
	str	x8, [x20]
LBB0_20:
	ldr	x8, [x19]
	add	x8, x8, x23
	str	x8, [x19]
LBB0_21:
Lloh8:
	adrp	x8, _TRUE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
	b	LBB0_23
LBB0_22:
Lloh10:
	adrp	x8, _FALSE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
LBB0_23:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FatReadFile() BytesToRead = %d Buffer = 0x%x\n"

	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_FALSE,4,2                      ; @FALSE
l_.str.1:                               ; @.str.1
	.asciz	"FatReadFile() FatFileInfo->CurrentCluster = 0x%x\n"

l_.str.2:                               ; @.str.2
	.asciz	"Going to read: %u clusters\n"

	.no_dead_strip	_FatReadFile
.subsections_via_symbols
