	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __read_callback
___read_callback:                       ## @__read_callback
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_EXI_CHANNEL_0@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	ja	LBB0_13
## %bb.1:
	movq	%rdi, %r14
	movq	_EXI_CHANNEL_2@GOTPCREL(%rip), %rax
	cmpq	%rdi, (%rax)
	jbe	LBB0_13
## %bb.2:
	movq	_cardmap@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	leaq	(%r14,%r14,4), %r13
	leaq	(%r12,%r13,8), %rdi
	movq	32(%r12,%r13,8), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	movq	%rsi, %rbx
	movl	4(%r15), %ecx
	movl	(%rdi), %edx
	leal	(%rdx,%rcx), %esi
	negl	%edx
	andl	%esi, %edx
	subl	%edx, %ecx
	addl	%eax, %ecx
	movl	%ecx, (%r15)
	testl	%ecx, %ecx
	jle	LBB0_4
## %bb.5:
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	___card_getbatblock
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	(%rdi), %ecx
	movl	4(%r15), %edx
	addl	%ecx, %edx
	movl	%ecx, %esi
	negl	%esi
	andl	%edx, %esi
	movl	%esi, 4(%r15)
	movq	(%rax), %r8
	movq	8(%r15), %rdx
	movq	_CARD_SYSAREA@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rax
	subq	%rax, %rdx
	movq	(%r8,%rdx,8), %rsi
	movq	%rsi, 8(%r15)
	cmpq	%rax, %rsi
	jb	LBB0_7
## %bb.6:
	cmpq	8(%r12,%r13,8), %rsi
	jae	LBB0_7
## %bb.12:
	movl	(%r15), %eax
	cmpl	%ecx, %eax
	cmovlel	%ecx, %eax
	movslq	%eax, %rdx
	imull	%ecx, %esi
	movl	24(%r12,%r13,8), %ecx
	leaq	___read_callback(%rip), %r8
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	___card_read
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	testq	%rax, %rax
	movq	%rbx, %r15
	jns	LBB0_13
	jmp	LBB0_10
LBB0_8:
	movq	_CARD_ERROR_CANCELED@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_CARD_ERROR_BROKEN@GOTPCREL(%rip), %rax
LBB0_9:
	movq	(%rax), %r15
	jmp	LBB0_10
LBB0_4:
	movq	%rbx, %r15
LBB0_10:
	movq	16(%r12,%r13,8), %rbx
	movq	$0, 16(%r12,%r13,8)
	movq	%r15, %rsi
	callq	___card_putcntrlblock
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.11:
	movq	%rbx, %rax
	movq	%r14, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EXI_CHANNEL_0,8,3              ## @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ## @EXI_CHANNEL_2
	.comm	_cardmap,8,3                    ## @cardmap
	.comm	_CARD_SYSAREA,8,3               ## @CARD_SYSAREA
	.comm	_CARD_ERROR_BROKEN,8,3          ## @CARD_ERROR_BROKEN
	.comm	_CARD_ERROR_CANCELED,8,3        ## @CARD_ERROR_CANCELED
	.no_dead_strip	___read_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __read_callback
___read_callback:                       ; @__read_callback
	.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
Lloh0:
	adrp	x8, _EXI_CHANNEL_0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXI_CHANNEL_0@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _EXI_CHANNEL_2@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EXI_CHANNEL_2@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x0
	ccmp	x9, x0, #0, ls
	b.ls	LBB0_11
; %bb.1:
	mov	x19, x0
Lloh6:
	adrp	x8, _cardmap@GOTPAGE
Lloh7:
	ldr	x8, [x8, _cardmap@GOTPAGEOFF]
Lloh8:
	ldr	x22, [x8]
	mov	w8, #40
	madd	x21, x0, x8, x22
	ldr	x23, [x21, #32]
	ldr	w8, [x23]
	tbnz	w8, #31, LBB0_6
; %bb.2:
	mov	x20, x1
	ldr	w9, [x23, #4]
	ldr	w10, [x21]
	add	w11, w10, w9
	neg	w10, w10
	and	w10, w11, w10
	sub	w9, w9, w10
	add	w8, w9, w8
	str	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x0, x21
	bl	___card_getbatblock
	ldr	w9, [x23, #4]
	ldr	w8, [x21]
	add	w9, w8, w9
	neg	w10, w8
	and	w9, w9, w10
	str	w9, [x23, #4]
	ldr	x9, [x0]
	ldr	x10, [x23, #8]
Lloh9:
	adrp	x11, _CARD_SYSAREA@GOTPAGE
Lloh10:
	ldr	x11, [x11, _CARD_SYSAREA@GOTPAGEOFF]
Lloh11:
	ldr	x11, [x11]
	sub	x10, x10, x11
	ldr	x9, [x9, x10, lsl #3]
	str	x9, [x23, #8]
	cmp	x9, x11
	b.lo	LBB0_7
; %bb.4:
	mov	w10, #40
	madd	x10, x19, x10, x22
	ldr	x10, [x10, #8]
	cmp	x9, x10
	b.hs	LBB0_7
; %bb.5:
	ldr	w10, [x23]
	cmp	w10, w8
	csel	w10, w10, w8, gt
	sxtw	x2, w10
	mul	w1, w8, w9
	mov	w8, #40
	madd	x8, x19, x8, x22
	ldr	w3, [x8, #24]
Lloh12:
	adrp	x4, ___read_callback@PAGE
Lloh13:
	add	x4, x4, ___read_callback@PAGEOFF
	mov	x0, x19
	bl	___card_read
	tbz	x0, #63, LBB0_11
	b	LBB0_9
LBB0_6:
Lloh14:
	adrp	x8, _CARD_ERROR_CANCELED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CARD_ERROR_CANCELED@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh16:
	adrp	x8, _CARD_ERROR_BROKEN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CARD_ERROR_BROKEN@GOTPAGEOFF]
LBB0_8:
	ldr	x20, [x8]
LBB0_9:
	mov	w8, #40
	madd	x8, x19, x8, x22
	ldr	x0, [x8, #16]
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	str	xzr, [x8, #16]
	mov	x0, x21
	mov	x1, x20
	bl	___card_putcntrlblock
	ldr	x2, [sp, #8]                    ; 8-byte Folded Reload
	cbz	x2, LBB0_11
; %bb.10:
	mov	x0, x19
	mov	x1, x20
	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
	br	x2
LBB0_11:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_EXI_CHANNEL_0,8,3              ; @EXI_CHANNEL_0
	.comm	_EXI_CHANNEL_2,8,3              ; @EXI_CHANNEL_2
	.comm	_cardmap,8,3                    ; @cardmap
	.comm	_CARD_SYSAREA,8,3               ; @CARD_SYSAREA
	.comm	_CARD_ERROR_BROKEN,8,3          ; @CARD_ERROR_BROKEN
	.comm	_CARD_ERROR_CANCELED,8,3        ; @CARD_ERROR_CANCELED
	.no_dead_strip	___read_callback
.subsections_via_symbols
