	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tw686x_audio_dma_alloc
_tw686x_audio_dma_alloc:                ## @tw686x_audio_dma_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	%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
	movq	(%rdi), %rax
	movq	_TW686X_DMA_MODE_MEMCPY@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_ADMA_P_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rsi), %rcx
	movq	8(%rsi), %rdx
	movl	(%rax,%rcx,4), %r12d
	movq	8(%rdi), %rdi
	movq	_AUDIO_DMA_SIZE_MAX@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_2
## %bb.4:
	movq	8(%r15), %rcx
	movq	%rax, 8(%rcx)
	movl	(%r13), %eax
	movl	%eax, 4(%rcx)
	movl	(%rcx), %edx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_reg_write
	movq	_ADMA_B_ADDR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%r15), %rcx
	movq	8(%r15), %rdx
	movl	(%rax,%rcx,4), %r12d
	movq	8(%rbx), %rdi
	movl	(%r13), %esi
	addq	$16, %rdx
	callq	_pci_alloc_consistent
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	8(%r15), %rcx
	movq	%rax, 24(%rcx)
	movl	(%r13), %eax
	movl	%eax, 20(%rcx)
	movl	16(%rcx), %edx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_reg_write
	jmp	LBB0_7
LBB0_2:
	leaq	L_.str.2(%rip), %rcx
	jmp	LBB0_3
LBB0_5:
	leaq	L_.str.1(%rip), %rcx
LBB0_3:
	movq	8(%rbx), %rdi
	movq	(%r15), %rdx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_7:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TW686X_DMA_MODE_MEMCPY,8,3     ## @TW686X_DMA_MODE_MEMCPY
	.comm	_ADMA_B_ADDR,8,3                ## @ADMA_B_ADDR
	.comm	_ADMA_P_ADDR,8,3                ## @ADMA_P_ADDR
	.comm	_AUDIO_DMA_SIZE_MAX,4,2         ## @AUDIO_DMA_SIZE_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dma%d: unable to allocate audio DMA %s-buffer\n"

L_.str.1:                               ## @.str.1
	.asciz	"B"

L_.str.2:                               ## @.str.2
	.asciz	"P"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_tw686x_audio_dma_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tw686x_audio_dma_alloc
_tw686x_audio_dma_alloc:                ; @tw686x_audio_dma_alloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _TW686X_DMA_MODE_MEMCPY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TW686X_DMA_MODE_MEMCPY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh3:
	adrp	x8, _ADMA_P_ADDR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ADMA_P_ADDR@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldp	x9, x2, [x1]
	ldr	w21, [x8, x9, lsl #2]
	ldr	x0, [x0, #8]
Lloh6:
	adrp	x22, _AUDIO_DMA_SIZE_MAX@GOTPAGE
Lloh7:
	ldr	x22, [x22, _AUDIO_DMA_SIZE_MAX@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_5
; %bb.2:
	ldr	x8, [x20, #8]
	str	x0, [x8, #8]
	ldr	w9, [x22]
	str	w9, [x8, #4]
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x21
	bl	_reg_write
Lloh8:
	adrp	x8, _ADMA_B_ADDR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ADMA_B_ADDR@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldp	x9, x10, [x20]
	ldr	w21, [x8, x9, lsl #2]
	ldr	x0, [x19, #8]
	ldr	w1, [x22]
	add	x2, x10, #16
	bl	_pci_alloc_consistent
	cbz	x0, LBB0_6
; %bb.3:
	ldr	x8, [x20, #8]
	str	x0, [x8, #24]
	ldr	w9, [x22]
	str	w9, [x8, #20]
	ldr	w2, [x8, #16]
	mov	x0, x19
	mov	x1, x21
	bl	_reg_write
LBB0_4:
	mov	w0, #0
	b	LBB0_8
LBB0_5:
Lloh11:
	adrp	x3, l_.str.2@PAGE
Lloh12:
	add	x3, x3, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh13:
	adrp	x3, l_.str.1@PAGE
Lloh14:
	add	x3, x3, l_.str.1@PAGEOFF
LBB0_7:
	ldr	x0, [x19, #8]
	ldr	x2, [x20]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_TW686X_DMA_MODE_MEMCPY,8,3     ; @TW686X_DMA_MODE_MEMCPY
	.comm	_ADMA_B_ADDR,8,3                ; @ADMA_B_ADDR
	.comm	_ADMA_P_ADDR,8,3                ; @ADMA_P_ADDR
	.comm	_AUDIO_DMA_SIZE_MAX,4,2         ; @AUDIO_DMA_SIZE_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dma%d: unable to allocate audio DMA %s-buffer\n"

l_.str.1:                               ; @.str.1
	.asciz	"B"

l_.str.2:                               ; @.str.2
	.asciz	"P"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_tw686x_audio_dma_alloc
.subsections_via_symbols
