	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_sdhci_start_dma_seg
_bcm_sdhci_start_dma_seg:               ## @bcm_sdhci_start_dma_seg
	.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	%rdi, %rbx
	movslq	56(%rdi), %r13
	leal	1(%r13), %eax
	movl	%eax, 56(%rdi)
	movq	(%rdi), %rax
	movl	(%rax,%r13,4), %r14d
	addl	%r14d, 16(%rdi)
	movq	_BCM_DMA_32BIT@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movl	%ecx, %r15d
	testb	$15, %r14b
	jne	LBB0_2
## %bb.1:
	movq	_BCM_DMA_128BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_2:
	movq	24(%rbx), %rax
	movq	(%rax), %rax
	movq	_MMC_DATA_READ@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	8(%rbx), %edi
	testl	%edx, (%rax)
	je	LBB0_4
## %bb.3:
	movq	_BCM_DMA_DREQ_EMMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM_DMA_SAME_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bcm_dma_setup_src
	movl	8(%rbx), %edi
	movq	_BCM_DMA_DREQ_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM_DMA_INC_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %ecx
	callq	_bcm_dma_setup_dst
	leaq	44(%rbx), %rax
	leaq	(,%r13,4), %rdx
	addq	48(%rbx), %rdx
	movq	_BUS_DMASYNC_PREREAD@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_4:
	movq	_BCM_DMA_DREQ_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM_DMA_INC_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %ecx
	callq	_bcm_dma_setup_src
	movl	8(%rbx), %edi
	movq	_BCM_DMA_DREQ_EMMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BCM_DMA_SAME_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r12), %ecx
	callq	_bcm_dma_setup_dst
	leaq	(,%r13,4), %rax
	addq	48(%rbx), %rax
	leaq	44(%rbx), %rdx
	movq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %rcx
LBB0_5:
	movl	(%rdx), %r15d
	movl	(%rax), %r12d
	testl	%r13d, %r13d
	jne	LBB0_7
## %bb.6:
	leaq	16(%rbx), %r13
	movl	(%rcx), %edx
	movl	36(%rbx), %esi
	movl	40(%rbx), %edi
	callq	_bus_dmamap_sync
	movq	_SDHCI_INT_DATA_AVAIL@GOTPCREL(%rip), %rax
	movq	_SDHCI_INT_SPACE_AVAIL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SDHCI_INT_DATA_END@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	notl	%ecx
	andl	20(%rbx), %ecx
	movl	%ecx, 20(%rbx)
	movl	32(%rbx), %edi
	movq	_SDHCI_SIGNAL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_bcm_sdhci_write_4
LBB0_7:
	movl	8(%rbx), %edi
	movl	%r12d, %esi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	callq	_bcm_dma_start
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_KASSERT                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_BCM_DMA_32BIT,4,2              ## @BCM_DMA_32BIT
	.comm	_BCM_DMA_128BIT,4,2             ## @BCM_DMA_128BIT
	.comm	_MMC_DATA_READ,4,2              ## @MMC_DATA_READ
	.comm	_BCM_DMA_DREQ_EMMC,4,2          ## @BCM_DMA_DREQ_EMMC
	.comm	_BCM_DMA_SAME_ADDR,4,2          ## @BCM_DMA_SAME_ADDR
	.comm	_BCM_DMA_DREQ_NONE,4,2          ## @BCM_DMA_DREQ_NONE
	.comm	_BCM_DMA_INC_ADDR,4,2           ## @BCM_DMA_INC_ADDR
	.comm	_BUS_DMASYNC_PREREAD,4,2        ## @BUS_DMASYNC_PREREAD
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.comm	_SDHCI_INT_DATA_AVAIL,4,2       ## @SDHCI_INT_DATA_AVAIL
	.comm	_SDHCI_INT_SPACE_AVAIL,4,2      ## @SDHCI_INT_SPACE_AVAIL
	.comm	_SDHCI_INT_DATA_END,4,2         ## @SDHCI_INT_DATA_END
	.comm	_SDHCI_SIGNAL_ENABLE,4,2        ## @SDHCI_SIGNAL_ENABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bcm2835_sdhci: failed DMA start"

	.no_dead_strip	_bcm_sdhci_start_dma_seg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_sdhci_start_dma_seg
_bcm_sdhci_start_dma_seg:               ; @bcm_sdhci_start_dma_seg
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	mov	x21, x0
	ldr	w8, [x21, #16]!
	ldrsw	x24, [x0, #56]
	add	w9, w24, #1
	str	w9, [x0, #56]
	ldr	x9, [x0]
	ldr	w20, [x9, x24, lsl #2]
	add	w8, w8, w20
	str	w8, [x21]
Lloh0:
	adrp	x23, _BCM_DMA_32BIT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _BCM_DMA_32BIT@GOTPAGEOFF]
Lloh2:
	adrp	x8, _BCM_DMA_128BIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BCM_DMA_128BIT@GOTPAGEOFF]
	ldr	w3, [x23]
Lloh4:
	ldr	w8, [x8]
	tst	w20, #0xf
	csel	w22, w8, w3, eq
	ldr	x8, [x0, #24]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _MMC_DATA_READ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _MMC_DATA_READ@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	ldr	w0, [x0, #8]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh8:
	adrp	x8, _BCM_DMA_DREQ_EMMC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BCM_DMA_DREQ_EMMC@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _BCM_DMA_SAME_ADDR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BCM_DMA_SAME_ADDR@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	bl	_bcm_dma_setup_src
	ldr	w0, [x19, #8]
Lloh14:
	adrp	x8, _BCM_DMA_DREQ_NONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BCM_DMA_DREQ_NONE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _BCM_DMA_INC_ADDR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BCM_DMA_INC_ADDR@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x3, x22
	bl	_bcm_dma_setup_dst
	add	x8, x19, #44
	ldr	x9, [x19, #48]
	add	x10, x9, x24, lsl #2
Lloh20:
	adrp	x9, _BUS_DMASYNC_PREREAD@GOTPAGE
Lloh21:
	ldr	x9, [x9, _BUS_DMASYNC_PREREAD@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh22:
	adrp	x8, _BCM_DMA_DREQ_NONE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BCM_DMA_DREQ_NONE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x8, _BCM_DMA_INC_ADDR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BCM_DMA_INC_ADDR@GOTPAGEOFF]
Lloh27:
	ldr	w2, [x8]
	mov	x3, x22
	bl	_bcm_dma_setup_src
Lloh28:
	adrp	x8, _BCM_DMA_DREQ_EMMC@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BCM_DMA_DREQ_EMMC@GOTPAGEOFF]
	ldr	w0, [x19, #8]
Lloh30:
	ldr	w1, [x8]
Lloh31:
	adrp	x8, _BCM_DMA_SAME_ADDR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BCM_DMA_SAME_ADDR@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	ldr	w3, [x23]
	bl	_bcm_dma_setup_dst
	ldr	x8, [x19, #48]
	add	x8, x8, x24, lsl #2
	add	x10, x19, #44
Lloh34:
	adrp	x9, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh35:
	ldr	x9, [x9, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
LBB0_3:
	ldr	w22, [x10]
	ldr	w23, [x8]
	cbnz	w24, LBB0_5
; %bb.4:
	ldr	w2, [x9]
	ldp	w1, w0, [x19, #36]
	bl	_bus_dmamap_sync
Lloh36:
	adrp	x8, _SDHCI_INT_DATA_AVAIL@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SDHCI_INT_DATA_AVAIL@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
Lloh39:
	adrp	x9, _SDHCI_INT_SPACE_AVAIL@GOTPAGE
Lloh40:
	ldr	x9, [x9, _SDHCI_INT_SPACE_AVAIL@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh42:
	adrp	x9, _SDHCI_INT_DATA_END@GOTPAGE
Lloh43:
	ldr	x9, [x9, _SDHCI_INT_DATA_END@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x19, #20]
	bic	w3, w9, w8
	str	w3, [x19, #20]
	ldr	w0, [x19, #32]
Lloh45:
	adrp	x8, _SDHCI_SIGNAL_ENABLE@GOTPAGE
Lloh46:
	ldr	x8, [x8, _SDHCI_SIGNAL_ENABLE@GOTPAGEOFF]
Lloh47:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_bcm_sdhci_write_4
LBB0_5:
	ldr	w0, [x19, #8]
	mov	x1, x23
	mov	x2, x22
	mov	x3, x20
	bl	_bcm_dma_start
	cmp	w0, #0
	cset	w0, eq
Lloh48:
	adrp	x1, l_.str@PAGE
Lloh49:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_KASSERT
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_BCM_DMA_32BIT,4,2              ; @BCM_DMA_32BIT
	.comm	_BCM_DMA_128BIT,4,2             ; @BCM_DMA_128BIT
	.comm	_MMC_DATA_READ,4,2              ; @MMC_DATA_READ
	.comm	_BCM_DMA_DREQ_EMMC,4,2          ; @BCM_DMA_DREQ_EMMC
	.comm	_BCM_DMA_SAME_ADDR,4,2          ; @BCM_DMA_SAME_ADDR
	.comm	_BCM_DMA_DREQ_NONE,4,2          ; @BCM_DMA_DREQ_NONE
	.comm	_BCM_DMA_INC_ADDR,4,2           ; @BCM_DMA_INC_ADDR
	.comm	_BUS_DMASYNC_PREREAD,4,2        ; @BUS_DMASYNC_PREREAD
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.comm	_SDHCI_INT_DATA_AVAIL,4,2       ; @SDHCI_INT_DATA_AVAIL
	.comm	_SDHCI_INT_SPACE_AVAIL,4,2      ; @SDHCI_INT_SPACE_AVAIL
	.comm	_SDHCI_INT_DATA_END,4,2         ; @SDHCI_INT_DATA_END
	.comm	_SDHCI_SIGNAL_ENABLE,4,2        ; @SDHCI_SIGNAL_ENABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bcm2835_sdhci: failed DMA start"

	.no_dead_strip	_bcm_sdhci_start_dma_seg
.subsections_via_symbols
