	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_fat_read_r
_sd_fat_read_r:                         ## @sd_fat_read_r
	.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	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	8(%rsi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r13
	cmpl	$0, 20(%rsi)
	je	LBB0_4
## %bb.5:
	movq	%rcx, %r15
	movl	(%rax), %edi
	callq	_OSLockMutex
	movq	%r15, %rdi
	callq	_FS_ALIGN
	cmpq	$16384, %rax                    ## imm = 0x4000
	movl	$16384, %esi                    ## imm = 0x4000
	cmovbq	%rax, %rsi
	movq	_FS_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	callq	_memalign
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	testq	%r15, %r15
	je	LBB0_7
## %bb.9:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	subq	%rbx, %r15
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%r15, %rcx
	cmovbq	%rcx, %r15
	movq	8(%r13), %rcx
	movl	4(%rcx), %esi
	movl	8(%rcx), %edi
	movq	%r13, %r12
	movl	16(%r13), %r9d
	movq	%rax, %r13
	movq	%rax, %rdx
	movl	$1, %ecx
	movq	%r15, %r8
	pushq	$-1
	pushq	$0
	callq	_FSReadFile
	addq	$16, %rsp
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	je	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	leaq	(%rax,%rbx), %rdi
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	movq	%r13, %rax
	movl	%r14d, %ecx
	addq	%rcx, %rbx
	movq	%r12, %r13
	addl	%r14d, (%r12)
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	cmpq	%r15, %rbx
	jb	LBB0_10
	jmp	LBB0_15
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_EACCES@GOTPCREL(%rip), %rax
LBB0_2:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	movq	8(%r13), %rax
	movl	(%rax), %edi
	callq	_OSUnlockMutex
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_7:
	xorl	%ebx, %ebx
	jmp	LBB0_15
LBB0_11:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r14d, (%rax)
	xorl	%ebx, %ebx
LBB0_13:
	movq	%r13, %rax
	movq	%r12, %r13
LBB0_15:
	movq	%rax, %rdi
	callq	_free
	movq	8(%r13), %rax
	movl	(%rax), %edi
	callq	_OSUnlockMutex
LBB0_16:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_FS_ALIGNMENT,4,2               ## @FS_ALIGNMENT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_sd_fat_read_r
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_fat_read_r
_sd_fat_read_r:                         ; @sd_fat_read_r
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_7
; %bb.1:
	mov	x19, x1
	ldr	w9, [x1, #20]
	cbz	w9, LBB0_8
; %bb.2:
	mov	x21, x3
	mov	x22, x2
	ldr	w0, [x8]
	bl	_OSLockMutex
	mov	x0, x21
	bl	_FS_ALIGN
	mov	w8, #16384
	cmp	x0, #4, lsl #12                 ; =16384
	csel	x25, x0, x8, lo
Lloh0:
	adrp	x8, _FS_ALIGNMENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FS_ALIGNMENT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x25
	bl	_memalign
	cbz	x0, LBB0_10
; %bb.3:
	mov	x24, x0
	mov	x23, #0
	cbz	x21, LBB0_12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	x8, x21, x23
	cmp	x25, x8
	csel	x26, x25, x8, lo
	ldr	x8, [x19, #8]
	ldp	w1, w0, [x8, #4]
	ldr	w5, [x19, #16]
	mov	x2, x24
	mov	w3, #1
	mov	x4, x26
	mov	w6, #0
	mov	w7, #-1
	bl	_FSReadFile
	mov	x27, x0
	tbnz	w0, #31, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cbz	w27, LBB0_12
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x0, x22, x23
	mov	x1, x24
	mov	x2, x26
	bl	_memcpy
	add	x23, x23, w27, uxtw
	ldr	w8, [x19]
	add	w8, w8, w27
	str	w8, [x19]
	cmp	x23, x21
	b.lo	LBB0_4
	b	LBB0_12
LBB0_7:
	mov	x23, #0
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
	mov	x23, #0
Lloh5:
	adrp	x8, _EACCES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	str	w8, [x20]
	b	LBB0_13
LBB0_10:
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x20]
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_OSUnlockMutex
	mov	x23, #0
	b	LBB0_13
LBB0_11:
	mov	x23, #0
	str	w27, [x20]
LBB0_12:
	mov	x0, x24
	bl	_free
	ldr	x8, [x19, #8]
	ldr	w0, [x8]
	bl	_OSUnlockMutex
LBB0_13:
	mov	x0, x23
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_FS_ALIGNMENT,4,2               ; @FS_ALIGNMENT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_sd_fat_read_r
.subsections_via_symbols
