	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_pre_dma_transfer
_sd_pre_dma_transfer:                   ## @sd_pre_dma_transfer
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	16(%rdi), %r12
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	andl	(%rsi), %r15d
	testl	%edx, %edx
	je	LBB0_1
## %bb.7:
	movl	16(%rbx), %edx
	movl	20(%rbx), %esi
	movq	%r12, %rdi
	movl	%r15d, %ecx
	callq	_rtsx_pci_dma_map_sg
	movl	%eax, 8(%r14)
	movq	(%r14), %rax
	leaq	1(%rax), %rcx
	cmpq	$-1, %rax
	movl	$1, %eax
	cmovgeq	%rcx, %rax
	movq	%rax, (%r14)
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_1:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	cmpq	(%r14), %rax
	je	LBB0_5
## %bb.3:
	movq	%r14, %rdi
	callq	_sdmmc_dev
	movq	8(%rbx), %rdx
	movq	(%r14), %rcx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_dev_err
	movq	$0, 8(%rbx)
LBB0_4:
	xorl	%eax, %eax
LBB0_5:
	cmpq	(%r14), %rax
	jne	LBB0_6
## %bb.8:
	movl	8(%r14), %ecx
	movl	$1, %eax
	jmp	LBB0_9
LBB0_6:
	movl	16(%rbx), %edx
	movl	20(%rbx), %esi
	movq	%r12, %rdi
	movl	%r15d, %ecx
	callq	_rtsx_pci_dma_map_sg
	movl	%eax, %ecx
	xorl	%eax, %eax
LBB0_9:
	movl	%ecx, 12(%r14)
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error: data->host_cookie = %d, host->cookie = %d\n"

	.no_dead_strip	_sd_pre_dma_transfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_pre_dma_transfer
_sd_pre_dma_transfer:                   ; @sd_pre_dma_transfer
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
	ldr	x22, [x0, #16]
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w21, w9, w8
	cbz	w2, LBB0_2
; %bb.1:
	ldp	w2, w1, [x20, #16]
	mov	x0, x22
	mov	x3, x21
	bl	_rtsx_pci_dma_map_sg
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #8]
	ldr	x8, [x19]
	cmn	x8, #1
	mov	w9, #1
	csinc	x8, x9, x8, lt
	str	x8, [x19]
	str	x8, [x20, #8]
	b	LBB0_9
LBB0_2:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	x9, [x19]
	cmp	x8, x9
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_sdmmc_dev
	ldr	x2, [x20, #8]
	ldr	x3, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	mov	x8, #0
	str	xzr, [x20, #8]
LBB0_5:
	ldr	x9, [x19]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	ldr	w8, [x19, #8]
	mov	w0, #1
	b	LBB0_8
LBB0_7:
	ldp	w2, w1, [x20, #16]
	mov	x0, x22
	mov	x3, x21
	bl	_rtsx_pci_dma_map_sg
	mov	x8, x0
	mov	w0, #0
LBB0_8:
	str	w8, [x19, #12]
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error: data->host_cookie = %d, host->cookie = %d\n"

	.no_dead_strip	_sd_pre_dma_transfer
.subsections_via_symbols
