	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_dma_start                  ## -- Begin function bcm_dma_start
	.p2align	4, 0x90
_bcm_dma_start:                         ## @bcm_dma_start
	.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
	movl	$-1, %eax
	testl	%edi, %edi
	js	LBB0_10
## %bb.1:
	movl	%edx, %r15d
	movl	%edi, %ebx
	movq	_BCM_DMA_CH_MAX@GOTPCREL(%rip), %rdx
	cmpl	%edi, (%rdx)
	jle	LBB0_10
## %bb.2:
	movl	%esi, %r12d
	movq	_bcm_dma_sc@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r13
	movq	(%r13), %rdi
	movl	%ebx, %r14d
	leaq	(%r14,%r14,2), %rdx
	movq	_BCM_DMA_CH_USED@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, (%rdi,%rdx,8)
	je	LBB0_10
## %bb.3:
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movq	8(%rdi,%rdx,8), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	callq	_BCM2835_ARM_IS_IO
	movl	%r12d, %edi
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	callq	_IO_TO_VCBUS
	jmp	LBB0_6
LBB0_5:
	callq	_PHYS_TO_VCBUS
LBB0_6:
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	movq	%rax, 16(%r12)
	movl	%r15d, %edi
	callq	_BCM2835_ARM_IS_IO
	movl	%r15d, %edi
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	callq	_IO_TO_VCBUS
	jmp	LBB0_9
LBB0_8:
	callq	_PHYS_TO_VCBUS
LBB0_9:
	movq	%rax, 8(%r12)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r12)
	movl	12(%r13), %edi
	movq	(%r13), %rax
	shlq	$3, %r14
	leaq	(%r14,%r14,2), %r15
	movl	20(%rax,%r15), %esi
	movq	_BUS_DMASYNC_PREWRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_bus_dmamap_sync
	movl	8(%r13), %r14d
	movl	%ebx, %edi
	callq	_BCM_DMA_CBADDR
	movq	(%r13), %rcx
	movl	16(%rcx,%r15), %edx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_bus_write_4
	movl	8(%r13), %r14d
	movl	%ebx, %edi
	callq	_BCM_DMA_CS
	movq	_CS_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_bus_write_4
	xorl	%eax, %eax
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bcm_dma_sc,8,3                 ## @bcm_dma_sc
	.comm	_BCM_DMA_CH_MAX,4,2             ## @BCM_DMA_CH_MAX
	.comm	_BCM_DMA_CH_USED,4,2            ## @BCM_DMA_CH_USED
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ## @BUS_DMASYNC_PREWRITE
	.comm	_CS_ACTIVE,4,2                  ## @CS_ACTIVE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_dma_start                  ; -- Begin function bcm_dma_start
	.p2align	2
_bcm_dma_start:                         ; @bcm_dma_start
	.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, x0
	mov	w0, #-1
	tbnz	w19, #31, LBB0_11
; %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_11
; %bb.2:
Lloh3:
	adrp	x8, _bcm_dma_sc@GOTPAGE
Lloh4:
	ldr	x8, [x8, _bcm_dma_sc@GOTPAGEOFF]
Lloh5:
	ldr	x23, [x8]
	ldr	x8, [x23]
	mov	w9, #24
	umull	x9, w19, w9
	ldr	w9, [x8, x9]
Lloh6:
	adrp	x10, _BCM_DMA_CH_USED@GOTPAGE
Lloh7:
	ldr	x10, [x10, _BCM_DMA_CH_USED@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
; %bb.3:
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	w24, w19
	mov	w9, #24
	madd	x8, x24, x9, x8
	ldr	x25, [x8, #8]
	mov	x0, x1
	bl	_BCM2835_ARM_IS_IO
	cbz	x0, LBB0_6
; %bb.4:
	mov	x0, x22
	bl	_IO_TO_VCBUS
	b	LBB0_7
LBB0_5:
	mov	w0, #-1
	b	LBB0_11
LBB0_6:
	mov	x0, x22
	bl	_PHYS_TO_VCBUS
LBB0_7:
	str	x0, [x25, #16]
	mov	x0, x21
	bl	_BCM2835_ARM_IS_IO
	cbz	x0, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_IO_TO_VCBUS
	b	LBB0_10
LBB0_9:
	mov	x0, x21
	bl	_PHYS_TO_VCBUS
LBB0_10:
	str	x0, [x25, #8]
	str	w20, [x25]
	ldr	w0, [x23, #12]
	ldr	x8, [x23]
	add	x9, x24, x24, lsl #1
	lsl	x21, x9, #3
	add	x8, x8, x21
	ldr	w1, [x8, #20]
Lloh9:
	adrp	x8, _BUS_DMASYNC_PREWRITE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BUS_DMASYNC_PREWRITE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	bl	_bus_dmamap_sync
	ldr	w20, [x23, #8]
	mov	x0, x19
	bl	_BCM_DMA_CBADDR
	mov	x1, x0
	ldr	x8, [x23]
	add	x8, x8, x21
	ldr	w2, [x8, #16]
	mov	x0, x20
	bl	_bus_write_4
	ldr	w20, [x23, #8]
	mov	x0, x19
	bl	_BCM_DMA_CS
	mov	x1, x0
Lloh12:
	adrp	x8, _CS_ACTIVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CS_ACTIVE@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_bus_write_4
	mov	w0, #0
LBB0_11:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_bcm_dma_sc,8,3                 ; @bcm_dma_sc
	.comm	_BCM_DMA_CH_MAX,4,2             ; @BCM_DMA_CH_MAX
	.comm	_BCM_DMA_CH_USED,4,2            ; @BCM_DMA_CH_USED
	.comm	_BUS_DMASYNC_PREWRITE,4,2       ; @BUS_DMASYNC_PREWRITE
	.comm	_CS_ACTIVE,4,2                  ; @CS_ACTIVE
.subsections_via_symbols
