	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_getwrbuffer             ## -- Begin function DMAbuf_getwrbuffer
	.p2align	4, 0x90
_DMAbuf_getwrbuffer:                    ## @DMAbuf_getwrbuffer
	.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	%rdx, %r15
	movq	_audio_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	(%rax), %r14
	movq	_DMA_MAP_MAPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_2:
	movq	%rsi, %r12
	movl	%edi, %ebx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	leaq	16(%r14), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 24(%r14)
	je	LBB0_4
## %bb.3:
	movl	%ebx, %edi
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_reorganize_buffers
LBB0_4:
	movq	8(%r14), %rax
	movq	_DMODE_INPUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.5:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %edi
	callq	_DMAbuf_reset
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
LBB0_6:
	movq	_DMODE_OUTPUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r14)
	movl	%ebx, %edi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_find_output_space
	testq	%rax, %rax
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	jle	LBB0_7
LBB0_9:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	movl	%ebx, %edi
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_find_output_space
	testq	%rax, %rax
	jg	LBB0_9
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_output_sleep
	testl	%eax, %eax
	jns	LBB0_8
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_audio_devs,8,3                 ## @audio_devs
	.comm	_EIO,4,2                        ## @EIO
	.comm	_DMA_MAP_MAPPED,4,2             ## @DMA_MAP_MAPPED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DMODE_INPUT,8,3                ## @DMODE_INPUT
	.comm	_DMODE_OUTPUT,8,3               ## @DMODE_OUTPUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_getwrbuffer             ; -- Begin function DMAbuf_getwrbuffer
	.p2align	2
_DMAbuf_getwrbuffer:                    ; @DMAbuf_getwrbuffer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x8, _audio_devs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _audio_devs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x8, [x8, w0, sxtw #3]
	ldr	x24, [x8]
	ldr	w8, [x24]
Lloh3:
	adrp	x9, _DMA_MAP_MAPPED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DMA_MAP_MAPPED@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_2:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	add	x23, x24, #16
	mov	x0, x23
	bl	_spin_lock_irqsave
	ldr	x8, [x24, #24]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x22
	mov	x1, x24
	mov	w2, #0
	bl	_reorganize_buffers
LBB0_4:
	ldr	x8, [x24, #8]
Lloh9:
	adrp	x9, _DMODE_INPUT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DMODE_INPUT@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	bl	_DMAbuf_reset
	mov	x0, x23
	bl	_spin_lock_irqsave
LBB0_6:
Lloh12:
	adrp	x8, _DMODE_OUTPUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DMODE_OUTPUT@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [x24, #8]
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_find_output_space
	cmp	x0, #0
	b.le	LBB0_9
LBB0_7:
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	b	LBB0_10
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x23
	bl	_spin_lock_irqsave
	mov	x0, x22
	mov	x1, x21
	mov	x2, x20
	bl	_find_output_space
	cmp	x0, #1
	b.ge	LBB0_7
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	mov	x1, x19
	bl	_output_sleep
	tbz	w0, #31, LBB0_8
LBB0_10:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_EIO,4,2                        ; @EIO
	.comm	_DMA_MAP_MAPPED,4,2             ; @DMA_MAP_MAPPED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DMODE_INPUT,8,3                ; @DMODE_INPUT
	.comm	_DMODE_OUTPUT,8,3               ; @DMODE_OUTPUT
.subsections_via_symbols
