	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bcm_dma_init
_bcm_dma_init:                          ## @bcm_dma_init
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	(%rax), %edi
	movq	_BCM_DMA_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bus_read_4
	movq	_bcm_dma_channel_mask@GOTPCREL(%rip), %r15
	notl	%eax
	testl	%eax, (%r15)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_BCM_DMA_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bus_read_4
	testl	%eax, (%r15)
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_4:
	movl	%r14d, %edi
	callq	_bus_get_dma_tag
	movq	_BUS_SPACE_MAXADDR_32BIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_BUS_SPACE_MAXADDR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	_BUS_DMA_ALLOCNOW@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	addq	$4, %rbx
	movq	%rbx, 56(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rsp)
	movl	%edx, 32(%rsp)
	movl	$4, 24(%rsp)
	movl	$1, 16(%rsp)
	movl	$4, 8(%rsp)
	movq	$0, (%rsp)
	xorl	%r12d, %r12d
	movl	%eax, %edi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	callq	_bus_dma_tag_create
	testl	%eax, %eax
	je	LBB0_5
## %bb.19:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rsi
	movl	%r14d, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movl	%ebx, %r12d
LBB0_18:
	movl	%r12d, %eax
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%rbx, %rcx
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	_BCM_DMA_CH_MAX@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_18
## %bb.6:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movl	$24, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%rbx
	movq	_BCM_DMA_CH_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	addq	$32, %r12
	cmpq	%rax, %rbx
	jge	LBB0_17
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r14
	leaq	(%r14,%r12), %rdi
	addq	$-24, %rdi
	movl	$32, %esi
	callq	_bzero
	movl	%ebx, -24(%r14,%r12)
	movq	_BCM_DMA_CH_UNMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%r14,%r12)
	movl	(%r15), %eax
	btl	%ebx, %eax
	jae	LBB0_16
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_BUS_DMA_COHERENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BUS_DMA_WAITOK@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_BUS_DMA_ZERO@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	leaq	(%r14,%r12), %r13
	leaq	-80(%rbp), %rsi
	movq	%r13, %rcx
	callq	_bus_dmamem_alloc
	testl	%eax, %eax
	jne	LBB0_9
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rdx
	testb	$31, %dl
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movl	(%r13), %esi
	movq	_bcm_dmamap_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_BUS_DMA_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	$4, %ecx
	leaq	-60(%rbp), %r9
	callq	_bus_dmamap_load
	testl	%eax, %eax
	jne	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %rax
	movq	%rax, -16(%r14,%r12)
	movl	-60(%rbp), %ecx
	movl	%ecx, -4(%r14,%r12)
	movq	_BCM_DMA_CH_FREE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -8(%r14,%r12)
	movq	_INFO_WAIT_RESP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r13d
	movl	%ebx, %edi
	callq	_BCM_DMA_CS
	movq	_CS_RESET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_bus_write_4
	jmp	LBB0_16
LBB0_17:
	xorl	%r12d, %r12d
	jmp	LBB0_18
LBB0_9:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_10
LBB0_12:
	leaq	L_.str.4(%rip), %rsi
	xorl	%r12d, %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_18
LBB0_14:
	leaq	L_.str.5(%rip), %rsi
LBB0_10:
	xorl	%r12d, %r12d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_BCM_DMA_ENABLE,4,2             ## @BCM_DMA_ENABLE
	.comm	_bcm_dma_channel_mask,4,2       ## @bcm_dma_channel_mask
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"channels are not enabled\n"

	.comm	_BCM_DMA_INT_STATUS,4,2         ## @BCM_DMA_INT_STATUS
L_.str.1:                               ## @.str.1
	.asciz	"statuses are not cleared\n"

	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ## @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ## @BUS_SPACE_MAXADDR
	.comm	_BUS_DMA_ALLOCNOW,4,2           ## @BUS_DMA_ALLOCNOW
L_.str.2:                               ## @.str.2
	.asciz	"failed allocate DMA tag\n"

	.comm	_BCM_DMA_CH_MAX,4,2             ## @BCM_DMA_CH_MAX
	.comm	_BCM_DMA_CH_UNMAP,4,2           ## @BCM_DMA_CH_UNMAP
	.comm	_BUS_DMA_WAITOK,4,2             ## @BUS_DMA_WAITOK
	.comm	_BUS_DMA_COHERENT,4,2           ## @BUS_DMA_COHERENT
	.comm	_BUS_DMA_ZERO,4,2               ## @BUS_DMA_ZERO
L_.str.3:                               ## @.str.3
	.asciz	"cannot allocate DMA memory\n"

L_.str.4:                               ## @.str.4
	.asciz	"DMA address is not 32-bytes aligned: %p\n"

	.comm	_bcm_dmamap_cb,4,2              ## @bcm_dmamap_cb
L_.str.5:                               ## @.str.5
	.asciz	"cannot load DMA memory\n"

	.comm	_BCM_DMA_CH_FREE,4,2            ## @BCM_DMA_CH_FREE
	.comm	_INFO_WAIT_RESP,4,2             ## @INFO_WAIT_RESP
	.comm	_CS_RESET,4,2                   ## @CS_RESET
	.no_dead_strip	_bcm_dma_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bcm_dma_init
_bcm_dma_init:                          ; @bcm_dma_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	ldr	w0, [x0]
Lloh0:
	adrp	x8, _BCM_DMA_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BCM_DMA_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_bus_read_4
Lloh3:
	adrp	x24, _bcm_dma_channel_mask@GOTPAGE
Lloh4:
	ldr	x24, [x24, _bcm_dma_channel_mask@GOTPAGEOFF]
	ldr	w8, [x24]
	bics	wzr, w8, w0
	b.eq	LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_2:
	ldr	w0, [x20]
Lloh7:
	adrp	x8, _BCM_DMA_INT_STATUS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BCM_DMA_INT_STATUS@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	bl	_bus_read_4
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_4
; %bb.3:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_4:
	mov	x0, x19
	bl	_bus_get_dma_tag
Lloh12:
	adrp	x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGEOFF]
Lloh14:
	adrp	x9, _BUS_SPACE_MAXADDR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _BUS_SPACE_MAXADDR@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
Lloh17:
	ldr	w4, [x9]
Lloh18:
	adrp	x8, _BUS_DMA_ALLOCNOW@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BUS_DMA_ALLOCNOW@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	add	x25, x20, #4
	stp	xzr, xzr, [sp, #16]
	str	x25, [sp, #32]
	str	w8, [sp, #8]
	mov	x8, #1
	movk	x8, #4, lsl #32
	str	x8, [sp]
	mov	w1, #1
	mov	w2, #0
	mov	x5, #0
	mov	x6, #0
	mov	w7, #4
	bl	_bus_dma_tag_create
	cbz	w0, LBB0_6
; %bb.5:
	mov	x21, x0
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_device_printf
	b	LBB0_19
LBB0_6:
Lloh23:
	adrp	x8, _BCM_DMA_CH_MAX@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BCM_DMA_CH_MAX@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.7:
	mov	x27, #0
	mov	x21, #0
Lloh26:
	adrp	x28, _BUS_DMA_WAITOK@GOTPAGE
Lloh27:
	ldr	x28, [x28, _BUS_DMA_WAITOK@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x21, x21, #1
Lloh28:
	adrp	x8, _BCM_DMA_CH_MAX@GOTPAGE
Lloh29:
	ldr	x8, [x8, _BCM_DMA_CH_MAX@GOTPAGEOFF]
Lloh30:
	ldrsw	x8, [x8]
	add	x27, x27, #32
	cmp	x21, x8
	b.ge	LBB0_18
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x26, [x20, #8]
	add	x22, x26, x27
	mov	x0, x22
	mov	w1, #32
	bl	_bzero
	str	w21, [x22]
Lloh31:
	adrp	x8, _BCM_DMA_CH_UNMAP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _BCM_DMA_CH_UNMAP@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	str	w8, [x22, #16]
	ldr	w8, [x24]
	lsr	w8, w8, w21
	tbz	w8, #0, LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x25]
	ldr	w8, [x28]
Lloh34:
	adrp	x9, _BUS_DMA_COHERENT@GOTPAGE
Lloh35:
	ldr	x9, [x9, _BUS_DMA_COHERENT@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh37:
	adrp	x9, _BUS_DMA_ZERO@GOTPAGE
Lloh38:
	ldr	x9, [x9, _BUS_DMA_ZERO@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	orr	w2, w8, w9
	add	x23, x22, #24
	add	x1, sp, #56
	mov	x3, x23
	bl	_bus_dmamem_alloc
	cbnz	w0, LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x2, [sp, #56]
	tst	x2, #0x1f
	b.ne	LBB0_15
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w0, [x25]
	ldr	w1, [x23]
Lloh40:
	adrp	x8, _bcm_dmamap_cb@GOTPAGE
Lloh41:
	ldr	x8, [x8, _bcm_dmamap_cb@GOTPAGEOFF]
Lloh42:
	ldr	w4, [x8]
	ldr	w6, [x28]
	add	x5, sp, #52
	mov	w3, #4
	bl	_bus_dmamap_load
	cbnz	w0, LBB0_16
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [sp, #56]
	add	x9, x26, x27
	str	x8, [x9, #8]
	ldr	w10, [sp, #52]
	str	w10, [x9, #20]
Lloh43:
	adrp	x9, _BCM_DMA_CH_FREE@GOTPAGE
Lloh44:
	ldr	x9, [x9, _BCM_DMA_CH_FREE@GOTPAGEOFF]
Lloh45:
	ldr	w9, [x9]
	str	w9, [x22, #16]
Lloh46:
	adrp	x9, _INFO_WAIT_RESP@GOTPAGE
Lloh47:
	ldr	x9, [x9, _INFO_WAIT_RESP@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	str	w9, [x8]
	ldr	w22, [x20]
	mov	x0, x21
	bl	_BCM_DMA_CS
	mov	x1, x0
Lloh49:
	adrp	x8, _CS_RESET@GOTPAGE
Lloh50:
	ldr	x8, [x8, _CS_RESET@GOTPAGEOFF]
Lloh51:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_bus_write_4
	b	LBB0_8
LBB0_14:
Lloh52:
	adrp	x1, l_.str.3@PAGE
Lloh53:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_15:
	str	x2, [sp]
Lloh54:
	adrp	x1, l_.str.4@PAGE
Lloh55:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh56:
	adrp	x1, l_.str.5@PAGE
Lloh57:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_17:
	mov	x0, x19
	bl	_device_printf
LBB0_18:
	mov	w21, #0
LBB0_19:
	mov	x0, x21
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh16
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpAdd	Lloh54, Lloh55
	.loh AdrpAdd	Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_BCM_DMA_ENABLE,4,2             ; @BCM_DMA_ENABLE
	.comm	_bcm_dma_channel_mask,4,2       ; @bcm_dma_channel_mask
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"channels are not enabled\n"

	.comm	_BCM_DMA_INT_STATUS,4,2         ; @BCM_DMA_INT_STATUS
l_.str.1:                               ; @.str.1
	.asciz	"statuses are not cleared\n"

	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ; @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ; @BUS_SPACE_MAXADDR
	.comm	_BUS_DMA_ALLOCNOW,4,2           ; @BUS_DMA_ALLOCNOW
l_.str.2:                               ; @.str.2
	.asciz	"failed allocate DMA tag\n"

	.comm	_BCM_DMA_CH_MAX,4,2             ; @BCM_DMA_CH_MAX
	.comm	_BCM_DMA_CH_UNMAP,4,2           ; @BCM_DMA_CH_UNMAP
	.comm	_BUS_DMA_WAITOK,4,2             ; @BUS_DMA_WAITOK
	.comm	_BUS_DMA_COHERENT,4,2           ; @BUS_DMA_COHERENT
	.comm	_BUS_DMA_ZERO,4,2               ; @BUS_DMA_ZERO
l_.str.3:                               ; @.str.3
	.asciz	"cannot allocate DMA memory\n"

l_.str.4:                               ; @.str.4
	.asciz	"DMA address is not 32-bytes aligned: %p\n"

	.comm	_bcm_dmamap_cb,4,2              ; @bcm_dmamap_cb
l_.str.5:                               ; @.str.5
	.asciz	"cannot load DMA memory\n"

	.comm	_BCM_DMA_CH_FREE,4,2            ; @BCM_DMA_CH_FREE
	.comm	_INFO_WAIT_RESP,4,2             ; @INFO_WAIT_RESP
	.comm	_CS_RESET,4,2                   ; @CS_RESET
	.no_dead_strip	_bcm_dma_init
.subsections_via_symbols
