	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_sync                    ## -- Begin function DMAbuf_sync
	.p2align	4, 0x90
_DMAbuf_sync:                           ## @DMAbuf_sync
	.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	%edi, %ebx
	movq	_audio_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rcx
	movq	(%rax,%rcx,8), %r14
	cmpl	$0, 32(%r14)
	jne	LBB0_3
## %bb.1:
	movq	_PCM_ENABLE_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_2
LBB0_3:
	movq	8(%r14), %r15
	movq	(%r15), %rax
	movq	_DMODE_OUTPUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.4:
	leaq	32(%r15), %r13
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	cmpq	$0, 8(%r15)
	jle	LBB0_7
## %bb.5:
	movq	_DMA_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15)
	jne	LBB0_7
## %bb.6:
	movl	%ebx, %edi
	movq	%r15, %rsi
	callq	_DMAbuf_launch_output
LBB0_7:
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	_DMA_SYNCING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	8(%r14), %rcx
	orl	%eax, 16(%rcx)
	movq	$0, 24(%rcx)
	leaq	16(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$-1, %r12d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testl	%eax, %eax
	jne	LBB0_9
## %bb.16:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r14), %rax
	incl	%r12d
	cmpl	36(%rax), %r12d
	jge	LBB0_10
## %bb.17:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpq	$0, 8(%rax)
	je	LBB0_10
## %bb.18:                              ##   in Loop: Header=BB0_8 Depth=1
	cmpq	$0, 24(%rax)
	jne	LBB0_10
## %bb.19:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	callq	_dmabuf_timeout
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_interruptible_sleep_on_timeout
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	testq	%rbx, %rbx
	jne	LBB0_8
## %bb.20:
	movq	_DMA_SYNCING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movq	8(%r14), %rcx
	andl	%eax, 16(%rcx)
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	8(%r14), %r15
	jmp	LBB0_21
LBB0_2:
	xorl	%eax, %eax
	jmp	LBB0_22
LBB0_9:
	movq	8(%r14), %rax
LBB0_10:
	movq	_DMA_ACTIVE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_DMA_SYNCING@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	notl	%ecx
	andl	%ecx, 16(%rax)
	movq	24(%r14), %rax
	cmpq	$0, (%rax)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_14
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_signal_pending
	testl	%eax, %eax
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	24(%r14), %rax
	movl	%ebx, %edi
	callq	*(%rax)
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r15, %rdi
	callq	_dmabuf_timeout
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_interruptible_sleep_on_timeout
	movq	%r13, %rdi
	callq	_spin_lock_irqsave
	jmp	LBB0_11
LBB0_14:
	movq	%r13, %rdi
	callq	_spin_unlock_irqrestore
	movq	8(%r14), %r15
LBB0_15:
	movq	_DMODE_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r15)
LBB0_21:
	movl	8(%r15), %eax
LBB0_22:
	addq	$24, %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	_PCM_ENABLE_OUTPUT,4,2          ## @PCM_ENABLE_OUTPUT
	.comm	_DMODE_OUTPUT,8,3               ## @DMODE_OUTPUT
	.comm	_DMA_ACTIVE,4,2                 ## @DMA_ACTIVE
	.comm	_DMA_SYNCING,4,2                ## @DMA_SYNCING
	.comm	_current,4,2                    ## @current
	.comm	_DMODE_NONE,8,3                 ## @DMODE_NONE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_DMAbuf_sync                    ; -- Begin function DMAbuf_sync
	.p2align	2
_DMAbuf_sync:                           ; @DMAbuf_sync
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
Lloh0:
	adrp	x8, _audio_devs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _audio_devs@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x24, [x8, w0, sxtw #3]
	ldr	w8, [x24, #32]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	w8, [x24]
Lloh3:
	adrp	x9, _PCM_ENABLE_OUTPUT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCM_ENABLE_OUTPUT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
LBB0_2:
	ldr	x19, [x24, #8]
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _DMODE_OUTPUT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DMODE_OUTPUT@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_20
; %bb.3:
	add	x21, x19, #32
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x26, _DMA_ACTIVE@GOTPAGE
Lloh10:
	ldr	x26, [x26, _DMA_ACTIVE@GOTPAGEOFF]
	cmp	x8, #1
	b.lt	LBB0_6
; %bb.4:
	ldr	w8, [x19, #16]
	ldr	w9, [x26]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_DMAbuf_launch_output
LBB0_6:
Lloh11:
	adrp	x27, _DMA_SYNCING@GOTPAGE
Lloh12:
	ldr	x27, [x27, _DMA_SYNCING@GOTPAGEOFF]
	ldr	w8, [x27]
	ldr	x9, [x24, #8]
	ldr	w10, [x9, #16]
	orr	w8, w10, w8
	str	w8, [x9, #16]
	str	xzr, [x9, #24]
	add	x22, x24, #16
	mov	w28, #-1
Lloh13:
	adrp	x25, _current@GOTPAGE
Lloh14:
	ldr	x25, [x25, _current@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	bl	_signal_pending
	cbnz	w0, LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x24, #8]
	ldr	w9, [x8, #36]
	add	w28, w28, #1
	cmp	w28, w9
	b.ge	LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x8, #8]
	cbz	x9, LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x8, #24]
	cbnz	x9, LBB0_15
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x19
	bl	_dmabuf_timeout
	mov	x23, x0
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x22
	mov	x1, x23
	bl	_interruptible_sleep_on_timeout
	mov	x23, x0
	mov	x0, x21
	bl	_spin_lock_irqsave
	cbnz	x23, LBB0_7
; %bb.12:
	ldr	w8, [x27]
	ldr	x9, [x24, #8]
	ldr	w10, [x9, #16]
	bic	w8, w10, w8
	str	w8, [x9, #16]
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	x19, [x24, #8]
	b	LBB0_21
LBB0_13:
	mov	w0, #0
	b	LBB0_22
LBB0_14:
	ldr	x8, [x24, #8]
LBB0_15:
	ldr	w9, [x27]
	ldr	w10, [x26]
	orr	w9, w10, w9
	ldr	w10, [x8, #16]
	bic	w9, w10, w9
	str	w9, [x8, #16]
	ldr	x8, [x24, #24]
	ldr	x8, [x8]
	cbz	x8, LBB0_19
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	bl	_signal_pending
	cbnz	w0, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x24, #24]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
	cbz	x0, LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x19
	bl	_dmabuf_timeout
	mov	x1, x0
	mov	x0, x22
	bl	_interruptible_sleep_on_timeout
	mov	x0, x21
	bl	_spin_lock_irqsave
	b	LBB0_16
LBB0_19:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	ldr	x19, [x24, #8]
LBB0_20:
Lloh15:
	adrp	x8, _DMODE_NONE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DMODE_NONE@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	str	x8, [x19]
LBB0_21:
	ldr	w0, [x19, #8]
LBB0_22:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_audio_devs,8,3                 ; @audio_devs
	.comm	_PCM_ENABLE_OUTPUT,4,2          ; @PCM_ENABLE_OUTPUT
	.comm	_DMODE_OUTPUT,8,3               ; @DMODE_OUTPUT
	.comm	_DMA_ACTIVE,4,2                 ; @DMA_ACTIVE
	.comm	_DMA_SYNCING,4,2                ; @DMA_SYNCING
	.comm	_current,4,2                    ; @current
	.comm	_DMODE_NONE,8,3                 ; @DMODE_NONE
.subsections_via_symbols
