	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_sdhci_dma_intr
_bcm_sdhci_dma_intr:                    ## @bcm_sdhci_dma_intr
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	leaq	48(%rsi), %r14
	movq	%r14, %rdi
	callq	_mtx_lock
	movq	56(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.1:
	movq	(%rbx), %rcx
	cmpq	8(%rbx), %rcx
	jge	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	callq	_bcm_sdhci_start_dma_seg
	jmp	LBB0_14
LBB0_15:
	movq	%r14, %rdi
	callq	_mtx_unlock
	movl	32(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_printf                  ## TAILCALL
LBB0_3:
	leaq	40(%rbx), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %rax
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%rax), %ecx
	movq	_BUS_DMASYNC_POSTREAD@GOTPCREL(%rip), %rax
	cmoveq	_BUS_DMASYNC_POSTWRITE@GOTPCREL(%rip), %rax
	movq	_SDHCI_INT_SPACE_AVAIL@GOTPCREL(%rip), %rcx
	cmovneq	_SDHCI_INT_DATA_AVAIL@GOTPCREL(%rip), %rcx
	movl	(%rax), %edx
	movl	(%rcx), %r15d
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_bus_dmamap_sync
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	callq	_bus_dmamap_unload
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rbx)
	movq	_BCM_SDHCI_BUFFER_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movq	56(%rbx), %rax
	movq	8(%rax), %rax
	movl	4(%rax), %esi
	subl	40(%rbx), %esi
	callq	_min
	cmpl	(%r12), %eax
	jge	LBB0_5
## %bb.4:
	movq	_SDHCI_INT_SPACE_AVAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SDHCI_INT_DATA_AVAIL@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SDHCI_INT_DATA_END@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	44(%rbx), %ecx
	movl	%ecx, 44(%rbx)
	movl	52(%rbx), %edi
	movq	_SDHCI_SIGNAL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
LBB0_13:
	callq	_bcm_sdhci_write_4
	jmp	LBB0_14
LBB0_5:
	movl	%eax, %r13d
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movl	52(%rbx), %edi
	movq	_SDHCI_INT_STATUS@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_bcm_sdhci_read_4
	movq	_SDHCI_INT_DATA_END@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	testl	%eax, %ecx
	je	LBB0_7
## %bb.6:
	movl	52(%rbx), %edi
	movq	%rdx, %r13
	movl	(%r15), %edx
	movq	%r12, %rsi
	movl	%eax, %ecx
	callq	_bcm_sdhci_write_4
	movq	_SDHCI_INT_SPACE_AVAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_SDHCI_INT_DATA_AVAIL@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	(%r13), %ecx
	orl	44(%rbx), %ecx
	movl	%ecx, 44(%rbx)
	movl	52(%rbx), %edi
	movq	_SDHCI_SIGNAL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rsi
	callq	_bcm_sdhci_write_4
	jmp	LBB0_11
LBB0_7:
	movq	%r15, %rdx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	testl	%r15d, %eax
	movl	%r15d, %eax
	movq	_SDHCI_INT_DATA_AVAIL@GOTPCREL(%rip), %r15
	je	LBB0_12
## %bb.8:
	movl	52(%rbx), %edi
	movl	(%rdx), %edx
	movq	%r12, %rsi
	movl	%eax, %ecx
	callq	_bcm_sdhci_write_4
	movl	24(%rbx), %esi
	movl	28(%rbx), %edi
	movq	56(%rbx), %rax
	movq	8(%rax), %rax
	movslq	40(%rbx), %rdx
	shlq	$2, %rdx
	addq	8(%rax), %rdx
	movq	_bcm_sdhci_dmacb@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_BUS_DMA_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	%r13d, %ecx
	movq	%rbx, %r9
	callq	_bus_dmamap_load
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	cmpq	$0, 16(%rbx)
	je	LBB0_2
LBB0_10:
	movq	_MMC_ERR_NO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	56(%rbx), %rcx
	movl	%eax, (%rcx)
LBB0_11:
	movq	%r12, %rdi
	callq	_sdhci_finish_data
LBB0_14:
	movq	%r14, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtx_unlock                     ## TAILCALL
LBB0_12:
	movq	_SDHCI_INT_SPACE_AVAIL@GOTPCREL(%rip), %rax
	orl	(%r15), %ecx
	orl	(%rax), %ecx
	orl	44(%rbx), %ecx
	movl	%ecx, 44(%rbx)
	movl	52(%rbx), %edi
	movq	_SDHCI_SIGNAL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rsi
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"command aborted in the middle of DMA\n"

	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_BUS_DMASYNC_POSTREAD,4,2       ## @BUS_DMASYNC_POSTREAD
	.comm	_SDHCI_INT_DATA_AVAIL,4,2       ## @SDHCI_INT_DATA_AVAIL
	.comm	_BUS_DMASYNC_POSTWRITE,4,2      ## @BUS_DMASYNC_POSTWRITE
	.comm	_SDHCI_INT_SPACE_AVAIL,4,2      ## @SDHCI_INT_SPACE_AVAIL
	.comm	_BCM_SDHCI_BUFFER_SIZE,4,2      ## @BCM_SDHCI_BUFFER_SIZE
	.comm	_SDHCI_INT_DATA_END,4,2         ## @SDHCI_INT_DATA_END
	.comm	_SDHCI_SIGNAL_ENABLE,4,2        ## @SDHCI_SIGNAL_ENABLE
	.comm	_SDHCI_INT_STATUS,4,2           ## @SDHCI_INT_STATUS
	.comm	_bcm_sdhci_dmacb,4,2            ## @bcm_sdhci_dmacb
	.comm	_BUS_DMA_NOWAIT,4,2             ## @BUS_DMA_NOWAIT
	.comm	_MMC_ERR_NO_MEMORY,4,2          ## @MMC_ERR_NO_MEMORY
	.no_dead_strip	_bcm_sdhci_dma_intr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_sdhci_dma_intr
_bcm_sdhci_dma_intr:                    ; @bcm_sdhci_dma_intr
	.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, x1
	add	x19, x1, #48
	mov	x0, x19
	bl	_mtx_lock
	ldr	x8, [x20, #56]
	cbz	x8, LBB0_3
; %bb.1:
	ldp	x9, x10, [x20]
	cmp	x9, x10
	b.ge	LBB0_4
LBB0_2:
	mov	x0, x20
	bl	_bcm_sdhci_start_dma_seg
	b	LBB0_14
LBB0_3:
	mov	x0, x19
	bl	_mtx_unlock
	ldr	w0, [x20, #32]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	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
	b	_device_printf
LBB0_4:
	add	x21, x20, #40
	ldr	x8, [x8, #8]
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh4:
	adrp	x10, _BUS_DMASYNC_POSTWRITE@GOTPAGE
Lloh5:
	ldr	x10, [x10, _BUS_DMASYNC_POSTWRITE@GOTPAGEOFF]
Lloh6:
	adrp	x11, _BUS_DMASYNC_POSTREAD@GOTPAGE
Lloh7:
	ldr	x11, [x11, _BUS_DMASYNC_POSTREAD@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	csel	x8, x10, x11, eq
	ldr	w2, [x8]
Lloh9:
	adrp	x24, _SDHCI_INT_SPACE_AVAIL@GOTPAGE
Lloh10:
	ldr	x24, [x24, _SDHCI_INT_SPACE_AVAIL@GOTPAGEOFF]
Lloh11:
	adrp	x25, _SDHCI_INT_DATA_AVAIL@GOTPAGE
Lloh12:
	ldr	x25, [x25, _SDHCI_INT_DATA_AVAIL@GOTPAGEOFF]
	csel	x8, x24, x25, eq
	ldr	w22, [x8]
	ldp	w1, w0, [x20, #24]
	bl	_bus_dmamap_sync
	ldp	w1, w0, [x20, #24]
	bl	_bus_dmamap_unload
	stp	xzr, xzr, [x20]
Lloh13:
	adrp	x26, _BCM_SDHCI_BUFFER_SIZE@GOTPAGE
Lloh14:
	ldr	x26, [x26, _BCM_SDHCI_BUFFER_SIZE@GOTPAGEOFF]
	ldr	w0, [x26]
	ldr	x8, [x20, #56]
	ldr	x8, [x8, #8]
	ldr	w8, [x8, #4]
	ldr	w9, [x20, #40]
	sub	w1, w8, w9
	bl	_min
	ldr	w8, [x26]
	cmp	w0, w8
	b.ge	LBB0_7
; %bb.5:
	ldr	w8, [x25]
	ldr	w9, [x24]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _SDHCI_INT_DATA_END@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SDHCI_INT_DATA_END@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x20, #44]
	orr	w3, w8, w9
LBB0_6:
	str	w3, [x20, #44]
	ldr	w0, [x20, #52]
Lloh18:
	adrp	x8, _SDHCI_SIGNAL_ENABLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SDHCI_SIGNAL_ENABLE@GOTPAGEOFF]
Lloh20:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_bcm_sdhci_write_4
	b	LBB0_14
LBB0_7:
	mov	x23, x0
	ldr	w0, [x20, #52]
Lloh21:
	adrp	x26, _SDHCI_INT_STATUS@GOTPAGE
Lloh22:
	ldr	x26, [x26, _SDHCI_INT_STATUS@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x1, x21
	bl	_bcm_sdhci_read_4
	mov	x3, x0
Lloh23:
	adrp	x27, _SDHCI_INT_DATA_END@GOTPAGE
Lloh24:
	ldr	x27, [x27, _SDHCI_INT_DATA_END@GOTPAGEOFF]
	ldr	w8, [x27]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.8:
	ldr	w0, [x20, #52]
	ldr	w2, [x26]
	mov	x1, x21
	bl	_bcm_sdhci_write_4
	ldr	w8, [x25]
	ldr	w9, [x24]
	orr	w8, w9, w8
	ldr	w9, [x27]
	orr	w8, w8, w9
	ldr	w9, [x20, #44]
	orr	w3, w8, w9
	str	w3, [x20, #44]
	ldr	w0, [x20, #52]
Lloh25:
	adrp	x8, _SDHCI_SIGNAL_ENABLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _SDHCI_SIGNAL_ENABLE@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_bcm_sdhci_write_4
	b	LBB0_13
LBB0_9:
	tst	w3, w22
	b.eq	LBB0_15
; %bb.10:
	ldr	w0, [x20, #52]
	ldr	w2, [x26]
	mov	x1, x21
	mov	x3, x22
	bl	_bcm_sdhci_write_4
	ldp	w1, w0, [x20, #24]
	ldr	x8, [x20, #56]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, #8]
	ldrsw	x9, [x20, #40]
	add	x2, x8, x9, lsl #2
Lloh28:
	adrp	x8, _bcm_sdhci_dmacb@GOTPAGE
Lloh29:
	ldr	x8, [x8, _bcm_sdhci_dmacb@GOTPAGEOFF]
Lloh30:
	ldr	w4, [x8]
Lloh31:
	adrp	x8, _BUS_DMA_NOWAIT@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BUS_DMA_NOWAIT@GOTPAGEOFF]
Lloh33:
	ldr	w6, [x8]
	mov	x3, x23
	mov	x5, x20
	bl	_bus_dmamap_load
	cbnz	x0, LBB0_12
; %bb.11:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_2
LBB0_12:
Lloh34:
	adrp	x8, _MMC_ERR_NO_MEMORY@GOTPAGE
Lloh35:
	ldr	x8, [x8, _MMC_ERR_NO_MEMORY@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	ldr	x9, [x20, #56]
	str	w8, [x9]
LBB0_13:
	mov	x0, x21
	bl	_sdhci_finish_data
LBB0_14:
	mov	x0, x19
	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
	b	_mtx_unlock
LBB0_15:
	ldr	w9, [x25]
	ldr	w10, [x24]
	ldr	w11, [x20, #44]
	orr	w8, w9, w8
	orr	w8, w8, w10
	orr	w3, w8, w11
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"command aborted in the middle of DMA\n"

	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_BUS_DMASYNC_POSTREAD,4,2       ; @BUS_DMASYNC_POSTREAD
	.comm	_SDHCI_INT_DATA_AVAIL,4,2       ; @SDHCI_INT_DATA_AVAIL
	.comm	_BUS_DMASYNC_POSTWRITE,4,2      ; @BUS_DMASYNC_POSTWRITE
	.comm	_SDHCI_INT_SPACE_AVAIL,4,2      ; @SDHCI_INT_SPACE_AVAIL
	.comm	_BCM_SDHCI_BUFFER_SIZE,4,2      ; @BCM_SDHCI_BUFFER_SIZE
	.comm	_SDHCI_INT_DATA_END,4,2         ; @SDHCI_INT_DATA_END
	.comm	_SDHCI_SIGNAL_ENABLE,4,2        ; @SDHCI_SIGNAL_ENABLE
	.comm	_SDHCI_INT_STATUS,4,2           ; @SDHCI_INT_STATUS
	.comm	_bcm_sdhci_dmacb,4,2            ; @bcm_sdhci_dmacb
	.comm	_BUS_DMA_NOWAIT,4,2             ; @BUS_DMA_NOWAIT
	.comm	_MMC_ERR_NO_MEMORY,4,2          ; @MMC_ERR_NO_MEMORY
	.no_dead_strip	_bcm_sdhci_dma_intr
.subsections_via_symbols
