	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dma64_alloc
_dma64_alloc:                           ## @dma64_alloc
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rax
	movq	%rdi, %rbx
	movq	$0, -40(%rbp)
	movq	_DMA_TX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	cmpq	%rsi, %rcx
	setne	%dl
	movl	(%rdi,%rdx,8), %edx
	shll	$2, %edx
	movl	16(%rdi), %esi
	movl	%esi, -28(%rbp)
	movq	_D64RINGALIGN@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	cmpq	%rax, %rcx
	jne	LBB0_5
## %bb.1:
	leaq	88(%rbx), %r9
	leaq	-28(%rbp), %rcx
	leaq	-40(%rbp), %r8
	movq	%rbx, %rdi
	callq	_dma_ringalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	%rax, %r15
	movb	-28(%rbp), %cl
	movl	$1, %r14d
	movl	$1, %esi
	shll	%cl, %esi
	movq	%rax, %rdi
	callq	_roundup
	movq	%rax, 104(%rbx)
	subq	%r15, %rax
	sarq	$2, %rax
	movq	%rax, 80(%rbx)
	addq	88(%rbx), %rax
	movq	%rax, 96(%rbx)
	movq	-40(%rbp), %rax
	movq	%rax, 72(%rbx)
	jmp	LBB0_8
LBB0_5:
	leaq	40(%rbx), %r9
	leaq	-28(%rbp), %rcx
	leaq	-40(%rbp), %r8
	movq	%rbx, %rdi
	callq	_dma_ringalloc
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r15
	movb	-28(%rbp), %cl
	movl	$1, %r14d
	movl	$1, %esi
	shll	%cl, %esi
	movq	%rax, %rdi
	callq	_roundup
	movq	%rax, 56(%rbx)
	subq	%r15, %rax
	sarq	$2, %rax
	movq	%rax, 32(%rbx)
	addq	40(%rbx), %rax
	movq	%rax, 48(%rbx)
	movq	-40(%rbp), %rax
	movq	%rax, 24(%rbx)
	jmp	LBB0_8
LBB0_2:
	movl	64(%rbx), %edx
	movl	68(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_6:
	movl	64(%rbx), %edx
	movl	68(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	callq	_brcms_dbg_dma
	xorl	%r14d, %r14d
LBB0_8:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_TX,8,3                     ## @DMA_TX
	.comm	_D64RINGALIGN,4,2               ## @D64RINGALIGN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: DMA_ALLOC_CONSISTENT(ntxd) failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"%s: DMA_ALLOC_CONSISTENT(nrxd) failed\n"

	.no_dead_strip	_dma64_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dma64_alloc
_dma64_alloc:                           ; @dma64_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x8, x1
	mov	x19, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x9, _DMA_TX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_TX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	ldr	w10, [x0, #16]
	str	w10, [sp, #4]
Lloh3:
	adrp	x10, _D64RINGALIGN@GOTPAGE
Lloh4:
	ldr	x10, [x10, _D64RINGALIGN@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x10]
	cmp	x9, x8
	cset	w8, ne
	lsl	x8, x8, #3
	ldr	w8, [x0, x8]
	lsl	w2, w8, #2
	b.ne	LBB0_3
; %bb.1:
	add	x5, x19, #88
	add	x3, sp, #4
	add	x4, sp, #8
	mov	x0, x19
	bl	_dma_ringalloc
	cbz	x0, LBB0_5
; %bb.2:
	mov	x21, x0
	ldr	w8, [sp, #4]
	mov	w20, #1
	lsl	w1, w20, w8
	bl	_roundup
	sub	x8, x0, x21
	asr	x8, x8, #2
	ldr	x9, [x19, #88]
	add	x9, x9, x8
	stp	x9, x0, [x19, #96]
	ldr	x9, [sp, #8]
	stp	x9, x8, [x19, #72]
	b	LBB0_8
LBB0_3:
	add	x5, x19, #40
	add	x3, sp, #4
	add	x4, sp, #8
	mov	x0, x19
	bl	_dma_ringalloc
	cbz	x0, LBB0_6
; %bb.4:
	mov	x21, x0
	ldr	w8, [sp, #4]
	mov	w20, #1
	lsl	w1, w20, w8
	bl	_roundup
	sub	x8, x0, x21
	asr	x8, x8, #2
	ldr	x9, [x19, #40]
	add	x9, x9, x8
	stp	x9, x0, [x19, #48]
	ldr	x9, [sp, #8]
	stp	x9, x8, [x19, #24]
	b	LBB0_8
LBB0_5:
	ldp	w2, w0, [x19, #64]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
	ldp	w2, w0, [x19, #64]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_brcms_dbg_dma
	mov	w20, #0
LBB0_8:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_TX,8,3                     ; @DMA_TX
	.comm	_D64RINGALIGN,4,2               ; @D64RINGALIGN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: DMA_ALLOC_CONSISTENT(ntxd) failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"%s: DMA_ALLOC_CONSISTENT(nrxd) failed\n"

	.no_dead_strip	_dma64_alloc
.subsections_via_symbols
