	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_ReadAsync                 ## -- Begin function CARD_ReadAsync
	.p2align	4, 0x90
_CARD_ReadAsync:                        ## @CARD_ReadAsync
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	$0, -40(%rbp)
	testl	%edx, %edx
	jle	LBB0_4
## %bb.1:
	movl	%edx, %ebx
	movl	%edx, %eax
	andl	$511, %eax                      ## imm = 0x1FF
	jne	LBB0_4
## %bb.2:
	movq	%r8, %r12
	movq	%rsi, %r14
	movq	%rdi, %r15
	testl	%ecx, %ecx
	jle	LBB0_5
## %bb.3:
	movl	%ecx, %eax
	andl	$511, %eax                      ## imm = 0x1FF
	je	LBB0_5
LBB0_4:
	movq	_CARD_ERROR_FATAL_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	-40(%rbp), %rax
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%ecx, %edx
	movq	%rax, %rcx
	callq	___card_seek
	testl	%eax, %eax
	js	LBB0_10
## %bb.6:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_DCInvalidateRange
	testq	%r12, %r12
	jne	LBB0_8
## %bb.7:
	movq	___card_defaultapicallback@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
LBB0_8:
	movq	-40(%rbp), %rax
	movq	%r12, 8(%rax)
	movl	(%rax), %esi
	leal	-1(%rsi), %eax
	andl	(%r15), %eax
	movl	%esi, %edx
	subl	%eax, %edx
	cmpl	%ebx, %edx
	cmovgel	%ebx, %edx
	movl	8(%r15), %edi
	imull	4(%r15), %esi
	movq	___read_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
                                        ## kill: def $esi killed $esi killed $rsi
	movq	%r14, %rcx
	callq	___card_read
	movl	%eax, %ebx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	jns	LBB0_10
## %bb.9:
	movq	-40(%rbp), %rdi
	movl	%ebx, %esi
	callq	___card_putcntrlblock
	movl	%ebx, %eax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ## @CARD_ERROR_FATAL_ERROR
	.comm	___card_defaultapicallback,8,3  ## @__card_defaultapicallback
	.comm	___read_callback,4,2            ## @__read_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CARD_ReadAsync                 ; -- Begin function CARD_ReadAsync
	.p2align	2
_CARD_ReadAsync:                        ; @CARD_ReadAsync
	.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
	str	xzr, [sp, #8]
	cmp	w2, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x20, x2
	and	w9, w2, #0x1ff
	cbnz	w9, LBB0_4
; %bb.2:
	mov	x22, x4
	mov	x8, x3
	mov	x19, x1
	mov	x21, x0
	cmp	w3, #1
	b.lt	LBB0_6
; %bb.3:
	and	w9, w8, #0x1ff
	cbz	w9, LBB0_6
LBB0_4:
Lloh0:
	adrp	x8, _CARD_ERROR_FATAL_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CARD_ERROR_FATAL_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
LBB0_5:
	mov	x0, x23
	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
LBB0_6:
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x8
	bl	___card_seek
	tbnz	w0, #31, LBB0_9
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_DCInvalidateRange
Lloh3:
	adrp	x8, ___card_defaultapicallback@GOTPAGE
Lloh4:
	ldr	x8, [x8, ___card_defaultapicallback@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x22, #0
	csel	x8, x8, x22, eq
	ldr	x9, [sp, #8]
	str	x8, [x9, #8]
	ldr	w8, [x9]
	sub	w9, w8, #1
	ldp	w10, w11, [x21]
	and	w9, w10, w9
	sub	w9, w8, w9
	cmp	w9, w20
	csel	w2, w9, w20, lt
	ldr	w0, [x21, #8]
	mul	w1, w11, w8
Lloh6:
	adrp	x8, ___read_callback@GOTPAGE
Lloh7:
	ldr	x8, [x8, ___read_callback@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	x3, x19
	bl	___card_read
	tbnz	w0, #31, LBB0_10
; %bb.8:
	mov	w23, #0
	b	LBB0_5
LBB0_9:
	mov	x23, x0
	b	LBB0_5
LBB0_10:
	mov	x23, x0
	ldr	x0, [sp, #8]
	mov	x1, x23
	bl	___card_putcntrlblock
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_CARD_ERROR_FATAL_ERROR,4,2     ; @CARD_ERROR_FATAL_ERROR
	.comm	___card_defaultapicallback,8,3  ; @__card_defaultapicallback
	.comm	___read_callback,4,2            ; @__read_callback
.subsections_via_symbols
