	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_dma_setup_dst              ## -- Begin function bcm_dma_setup_dst
	.p2align	4, 0x90
_bcm_dma_setup_dst:                     ## @bcm_dma_setup_dst
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	$-1, %eax
	testl	%edi, %edi
	js	LBB0_4
## %bb.1:
	movl	%ecx, %r8d
	movq	_BCM_DMA_CH_MAX@GOTPCREL(%rip), %rcx
	cmpl	%edi, (%rcx)
	jle	LBB0_4
## %bb.2:
	movq	_bcm_dma_sc@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %r9
	movl	%edi, %edi
	shlq	$4, %rdi
	movq	_BCM_DMA_CH_USED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%r9,%rdi)
	je	LBB0_4
## %bb.3:
	movq	8(%r9,%rdi), %r9
	movl	(%r9), %edi
	movq	_INFO_PERMAP_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	%esi, %eax
	shll	%cl, %eax
	movq	_INFO_PERMAP_MASK@GOTPCREL(%rip), %rcx
	xorl	%edi, %eax
	andl	(%rcx), %eax
	xorl	%edi, %eax
	movq	_INFO_D_DREQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edi
	orl	%eax, %edi
	notl	%ecx
	andl	%eax, %ecx
	testl	%esi, %esi
	cmovnel	%edi, %ecx
	movq	_BCM_DMA_128BIT@GOTPCREL(%rip), %rax
	movq	_INFO_D_WIDTH@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	movl	%esi, %edi
	orl	%ecx, %edi
	notl	%esi
	andl	%ecx, %esi
	cmpl	%r8d, (%rax)
	cmovel	%edi, %esi
	movq	_BCM_DMA_INC_ADDR@GOTPCREL(%rip), %rax
	movq	_INFO_D_INC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edi
	orl	%esi, %edi
	notl	%ecx
	andl	%esi, %ecx
	cmpl	%edx, (%rax)
	cmovel	%edi, %ecx
	movl	%ecx, (%r9)
	xorl	%eax, %eax
LBB0_4:
	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	_INFO_PERMAP_MASK,4,2           ## @INFO_PERMAP_MASK
	.comm	_INFO_PERMAP_SHIFT,4,2          ## @INFO_PERMAP_SHIFT
	.comm	_INFO_D_DREQ,4,2                ## @INFO_D_DREQ
	.comm	_BCM_DMA_128BIT,4,2             ## @BCM_DMA_128BIT
	.comm	_INFO_D_WIDTH,4,2               ## @INFO_D_WIDTH
	.comm	_BCM_DMA_INC_ADDR,4,2           ## @BCM_DMA_INC_ADDR
	.comm	_INFO_D_INC,4,2                 ## @INFO_D_INC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bcm_dma_setup_dst              ; -- Begin function bcm_dma_setup_dst
	.p2align	2
_bcm_dma_setup_dst:                     ; @bcm_dma_setup_dst
	.cfi_startproc
; %bb.0:
	mov	x8, x0
	mov	w0, #-1
	tbnz	w8, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x9, _BCM_DMA_CH_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BCM_DMA_CH_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	cmp	w9, w8
	b.le	LBB0_4
; %bb.2:
Lloh3:
	adrp	x9, _bcm_dma_sc@GOTPAGE
Lloh4:
	ldr	x9, [x9, _bcm_dma_sc@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	ldr	x9, [x9]
	mov	w8, w8
	lsl	x10, x8, #4
	ldr	w10, [x9, x10]
Lloh6:
	adrp	x11, _BCM_DMA_CH_USED@GOTPAGE
Lloh7:
	ldr	x11, [x11, _BCM_DMA_CH_USED@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	tst	w11, w10
	b.eq	LBB0_5
; %bb.3:
	mov	w0, #0
	add	x8, x9, x8, lsl #4
	ldr	x8, [x8, #8]
	ldr	w9, [x8]
Lloh9:
	adrp	x10, _INFO_PERMAP_MASK@GOTPAGE
Lloh10:
	ldr	x10, [x10, _INFO_PERMAP_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	bic	w9, w9, w10
Lloh12:
	adrp	x11, _INFO_PERMAP_SHIFT@GOTPAGE
Lloh13:
	ldr	x11, [x11, _INFO_PERMAP_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x11]
	lsl	w11, w1, w11
	and	w10, w11, w10
	orr	w9, w10, w9
Lloh15:
	adrp	x10, _INFO_D_DREQ@GOTPAGE
Lloh16:
	ldr	x10, [x10, _INFO_D_DREQ@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	orr	w11, w10, w9
	bic	w9, w9, w10
	cmp	w1, #0
	csel	w9, w9, w11, eq
Lloh18:
	adrp	x10, _INFO_D_WIDTH@GOTPAGE
Lloh19:
	ldr	x10, [x10, _INFO_D_WIDTH@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	orr	w11, w10, w9
	bic	w9, w9, w10
Lloh21:
	adrp	x10, _BCM_DMA_128BIT@GOTPAGE
Lloh22:
	ldr	x10, [x10, _BCM_DMA_128BIT@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	cmp	w10, w3
	csel	w9, w11, w9, eq
Lloh24:
	adrp	x10, _BCM_DMA_INC_ADDR@GOTPAGE
Lloh25:
	ldr	x10, [x10, _BCM_DMA_INC_ADDR@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
Lloh27:
	adrp	x11, _INFO_D_INC@GOTPAGE
Lloh28:
	ldr	x11, [x11, _INFO_D_INC@GOTPAGEOFF]
Lloh29:
	ldr	w11, [x11]
	orr	w12, w11, w9
	bic	w9, w9, w11
	cmp	w10, w2
	csel	w9, w12, w9, eq
	str	w9, [x8]
LBB0_4:
	ret
LBB0_5:
	mov	w0, #-1
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.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	_INFO_PERMAP_MASK,4,2           ; @INFO_PERMAP_MASK
	.comm	_INFO_PERMAP_SHIFT,4,2          ; @INFO_PERMAP_SHIFT
	.comm	_INFO_D_DREQ,4,2                ; @INFO_D_DREQ
	.comm	_BCM_DMA_128BIT,4,2             ; @BCM_DMA_128BIT
	.comm	_INFO_D_WIDTH,4,2               ; @INFO_D_WIDTH
	.comm	_BCM_DMA_INC_ADDR,4,2           ; @BCM_DMA_INC_ADDR
	.comm	_INFO_D_INC,4,2                 ; @INFO_D_INC
.subsections_via_symbols
