	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dac_audio_write
_dac_audio_write:                       ## @dac_audio_write
	.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
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	_buffer_begin@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	_buffer_end@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movl	%ecx, %edx
	subl	%edi, %edx
	movq	_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%edx, %esi
	sarl	$31, %esi
	andl	%eax, %esi
	addl	%edx, %esi
	movq	_empty@GOTPCREL(%rip), %r13
	cmpq	$0, (%r13)
	movl	%esi, %edx
	cmovnel	%eax, %edx
	testl	%esi, %esi
	cmovnel	%esi, %edx
	movslq	%edx, %rdx
	cmpq	%rbx, %rdx
	cmovbq	%rdx, %rbx
	cmpq	%rdi, %rcx
	jle	LBB0_5
## %bb.3:
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_copy_from_user
	testq	%rax, %rax
	jne	LBB0_4
	jmp	LBB0_8
LBB0_1:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dac_audio_sync
	jmp	LBB0_14
LBB0_5:
	movq	_data_buffer@GOTPCREL(%rip), %rcx
	subl	%edi, %eax
	addl	(%rcx), %eax
	movslq	%eax, %r12
	movq	%rbx, %r15
	subq	%r12, %r15
	jae	LBB0_9
## %bb.6:
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_copy_from_user
	testq	%rax, %rax
	jne	LBB0_4
## %bb.7:
	movq	_buffer_end@GOTPCREL(%rip), %r12
LBB0_8:
	movq	(%r12), %r15
	movq	%rbx, %rax
LBB0_12:
	addq	%r15, %rax
	movq	%rax, (%r12)
	cmpq	$0, (%r13)
	je	LBB0_14
## %bb.13:
	movq	$0, (%r13)
	xorl	%eax, %eax
	callq	_dac_audio_start_timer
	jmp	LBB0_14
LBB0_9:
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_copy_from_user
	testq	%rax, %rax
	jne	LBB0_4
## %bb.10:
	movq	_data_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	%r12, %r14
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_copy_from_user
	testq	%rax, %rax
	je	LBB0_11
LBB0_4:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_14:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_data_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_buffer_end@GOTPCREL(%rip), %r12
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,8,3                     ## @EINVAL
	.comm	_buffer_begin,8,3               ## @buffer_begin
	.comm	_buffer_end,8,3                 ## @buffer_end
	.comm	_BUFFER_SIZE,4,2                ## @BUFFER_SIZE
	.comm	_empty,8,3                      ## @empty
	.comm	_EFAULT,8,3                     ## @EFAULT
	.comm	_data_buffer,8,3                ## @data_buffer
	.no_dead_strip	_dac_audio_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dac_audio_write
_dac_audio_write:                       ; @dac_audio_write
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cbz	x2, LBB0_7
; %bb.1:
	mov	x20, x1
Lloh0:
	adrp	x8, _buffer_begin@GOTPAGE
Lloh1:
	ldr	x8, [x8, _buffer_begin@GOTPAGEOFF]
Lloh2:
	adrp	x23, _buffer_end@GOTPAGE
Lloh3:
	ldr	x23, [x23, _buffer_end@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x8]
	ldr	x0, [x23]
Lloh5:
	adrp	x8, _BUFFER_SIZE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BUFFER_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	sub	w10, w9, w0
	and	w11, w8, w10, asr #31
	add	w10, w11, w10
Lloh8:
	adrp	x24, _empty@GOTPAGE
Lloh9:
	ldr	x24, [x24, _empty@GOTPAGEOFF]
	ldr	x11, [x24]
	cmp	x11, #0
	ccmp	w10, #0, #0, ne
	csel	w10, w8, w10, eq
	sxtw	x10, w10
	cmp	x10, x2
	csel	x19, x10, x2, lo
	cmp	x9, x0
	b.gt	LBB0_3
; %bb.2:
Lloh10:
	adrp	x25, _data_buffer@GOTPAGE
Lloh11:
	ldr	x25, [x25, _data_buffer@GOTPAGEOFF]
	ldr	w9, [x25]
	sub	w8, w8, w0
	add	w8, w8, w9
	sxtw	x22, w8
	subs	x21, x19, x22
	b.hs	LBB0_8
LBB0_3:
	mov	x1, x20
	mov	x2, x19
	bl	_copy_from_user
	cbnz	x0, LBB0_10
; %bb.4:
	ldr	x21, [x23]
	mov	x8, x19
LBB0_5:
	add	x8, x21, x8
	str	x8, [x23]
	ldr	x8, [x24]
	cbz	x8, LBB0_11
; %bb.6:
	str	xzr, [x24]
	bl	_dac_audio_start_timer
	b	LBB0_11
LBB0_7:
	bl	_dac_audio_sync
	mov	x19, #0
	b	LBB0_11
LBB0_8:
	mov	x1, x20
	mov	x2, x22
	bl	_copy_from_user
	cbnz	x0, LBB0_10
; %bb.9:
	ldr	x0, [x25]
	add	x1, x20, x22
	mov	x2, x21
	bl	_copy_from_user
	cbz	x0, LBB0_12
LBB0_10:
Lloh12:
	adrp	x8, _EFAULT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	neg	x19, x8
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x8, [x25]
	b	LBB0_5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,8,3                     ; @EINVAL
	.comm	_buffer_begin,8,3               ; @buffer_begin
	.comm	_buffer_end,8,3                 ; @buffer_end
	.comm	_BUFFER_SIZE,4,2                ; @BUFFER_SIZE
	.comm	_empty,8,3                      ; @empty
	.comm	_EFAULT,8,3                     ; @EFAULT
	.comm	_data_buffer,8,3                ; @data_buffer
	.no_dead_strip	_dac_audio_write
.subsections_via_symbols
