	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_dma_reset
_bcm_dma_reset:                         ## @bcm_dma_reset
	.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
	movl	%esi, %r13d
	movl	%edi, %ebx
	callq	_device_get_softc
	testl	%r13d, %r13d
	js	LBB0_10
## %bb.1:
	movq	%rax, %r14
	movq	_BCM_DMA_CH_MAX@GOTPCREL(%rip), %rax
	cmpl	%r13d, (%rax)
	jle	LBB0_10
## %bb.2:
	movl	8(%r14), %r12d
	movl	%r13d, %edi
	callq	_BCM_DMA_CS
	movl	%r12d, %edi
	movl	%eax, %esi
	callq	_bus_read_4
	movq	_CS_ACTIVE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.3:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	8(%r14), %r12d
	movl	%r13d, %edi
	callq	_BCM_DMA_CS
	movl	%r12d, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bus_write_4
	movl	$-1000, %r15d                   ## imm = 0xFC18
	movq	_CS_ISPAUSED@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	8(%r14), %ebx
	movl	%r13d, %edi
	callq	_BCM_DMA_CS
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_bus_read_4
	andl	(%r12), %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	1(%r15), %ecx
	testl	%r15d, %r15d
	movl	%ecx, %r15d
	jne	LBB0_4
LBB0_6:
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r13d, %edx
	callq	_device_printf
LBB0_8:
	movl	8(%r14), %ebx
	movl	%r13d, %edi
	callq	_BCM_DMA_CBNEXT
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bus_write_4
	movl	8(%r14), %ebx
	movl	%r13d, %edi
	callq	_BCM_DMA_CS
	movq	_CS_ABORT@GOTPCREL(%rip), %rcx
	movq	_CS_INT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_CS_END@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_CS_ACTIVE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_bus_write_4
LBB0_9:
	movl	8(%r14), %ebx
	movl	%r13d, %edi
	callq	_BCM_DMA_CBADDR
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bus_write_4
	movl	8(%r14), %ebx
	movl	%r13d, %edi
	callq	_BCM_DMA_CBNEXT
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_bus_write_4
	movq	(%r14), %rax
	movslq	%r13d, %rcx
	movq	(%rax,%rcx,8), %rbx
	movq	%rbx, %rdi
	movl	$4, %esi
	callq	_bzero
	movq	_INFO_WAIT_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BCM_DMA_CH_MAX,4,2             ## @BCM_DMA_CH_MAX
	.comm	_CS_ACTIVE,4,2                  ## @CS_ACTIVE
	.comm	_CS_ISPAUSED,4,2                ## @CS_ISPAUSED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't abort DMA transfer at channel %d\n"

	.comm	_CS_ABORT,4,2                   ## @CS_ABORT
	.comm	_CS_INT,4,2                     ## @CS_INT
	.comm	_CS_END,4,2                     ## @CS_END
	.comm	_INFO_WAIT_RESP,4,2             ## @INFO_WAIT_RESP
	.no_dead_strip	_bcm_dma_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_dma_reset
_bcm_dma_reset:                         ; @bcm_dma_reset
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x21, x0
	bl	_device_get_softc
	tbnz	w19, #31, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _BCM_DMA_CH_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BCM_DMA_CH_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w19
	b.le	LBB0_9
; %bb.2:
	mov	x20, x0
	ldr	w22, [x0, #8]
	mov	x0, x19
	bl	_BCM_DMA_CS
	mov	x1, x0
	mov	x0, x22
	bl	_bus_read_4
Lloh3:
	adrp	x23, _CS_ACTIVE@GOTPAGE
Lloh4:
	ldr	x23, [x23, _CS_ACTIVE@GOTPAGEOFF]
	ldr	w8, [x23]
	tst	w8, w0
	b.eq	LBB0_8
; %bb.3:
	ldr	w22, [x20, #8]
	mov	x0, x19
	bl	_BCM_DMA_CS
	mov	x1, x0
	mov	x0, x22
	mov	w2, #0
	bl	_bus_write_4
	mov	w24, #-1000
Lloh5:
	adrp	x25, _CS_ISPAUSED@GOTPAGE
Lloh6:
	ldr	x25, [x25, _CS_ISPAUSED@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w22, [x20, #8]
	mov	x0, x19
	bl	_BCM_DMA_CS
	mov	x1, x0
	mov	x0, x22
	bl	_bus_read_4
	ldr	w8, [x25]
	and	w8, w8, w0
	cmp	w8, #0
	ccmp	w24, #0, #4, eq
	add	w24, w24, #1
	b.ne	LBB0_4
; %bb.5:
	cbnz	w8, LBB0_7
; %bb.6:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x19
	bl	_device_printf
LBB0_7:
	ldr	w21, [x20, #8]
	mov	x0, x19
	bl	_BCM_DMA_CBNEXT
	mov	x1, x0
	mov	x0, x21
	mov	w2, #0
	bl	_bus_write_4
	ldr	w21, [x20, #8]
	mov	x0, x19
	bl	_BCM_DMA_CS
	mov	x1, x0
Lloh9:
	adrp	x8, _CS_ABORT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CS_ABORT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _CS_INT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CS_INT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh15:
	adrp	x9, _CS_END@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CS_END@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x23]
	orr	w2, w8, w9
	mov	x0, x21
	bl	_bus_write_4
LBB0_8:
	ldr	w21, [x20, #8]
	mov	x0, x19
	bl	_BCM_DMA_CBADDR
	mov	x1, x0
	mov	x0, x21
	mov	w2, #0
	bl	_bus_write_4
	ldr	w21, [x20, #8]
	mov	x0, x19
	bl	_BCM_DMA_CBNEXT
	mov	x1, x0
	mov	x0, x21
	mov	w2, #0
	bl	_bus_write_4
	ldr	x8, [x20]
	ldr	x19, [x8, w19, sxtw #3]
	mov	x0, x19
	mov	w1, #4
	bl	_bzero
Lloh18:
	adrp	x8, _INFO_WAIT_RESP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _INFO_WAIT_RESP@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_9:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_BCM_DMA_CH_MAX,4,2             ; @BCM_DMA_CH_MAX
	.comm	_CS_ACTIVE,4,2                  ; @CS_ACTIVE
	.comm	_CS_ISPAUSED,4,2                ; @CS_ISPAUSED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't abort DMA transfer at channel %d\n"

	.comm	_CS_ABORT,4,2                   ; @CS_ABORT
	.comm	_CS_INT,4,2                     ; @CS_INT
	.comm	_CS_END,4,2                     ; @CS_END
	.comm	_INFO_WAIT_RESP,4,2             ; @INFO_WAIT_RESP
	.no_dead_strip	_bcm_dma_reset
.subsections_via_symbols
