	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SNDMacUpdateAudio
_SNDMacUpdateAudio:                     ## @SNDMacUpdateAudio
	.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
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_mutex@GOTPCREL(%rip), %rdi
	callq	_pthread_mutex_lock
	movq	_BUFFER_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_write_pos@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rdx
	subl	%edx, %eax
	shll	$2, %r15d
	xorl	%ecx, %ecx
	movl	%r15d, %ebx
	subl	%eax, %ebx
	cmovgel	%eax, %r15d
	cmovlel	%ecx, %ebx
	movq	_buffer@GOTPCREL(%rip), %rax
	shlq	$2, %rdx
	addq	(%rax), %rdx
	movl	%r15d, %r13d
	sarl	$2, %r13d
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r13d, %ecx
	callq	_macConvert32uto16s
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.1:
	movslq	%r13d, %rax
	leaq	(%r12,%rax,4), %rdi
	leaq	(%r14,%rax,4), %rsi
	movq	_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movl	%ebx, %ecx
	sarl	$2, %ecx
	callq	_macConvert32uto16s
LBB0_2:
	addl	%r15d, %ebx
	movq	_write_pos@GOTPCREL(%rip), %rsi
	addl	(%rsi), %ebx
	movl	%ebx, %eax
	cltd
	movq	_BUFFER_LEN@GOTPCREL(%rip), %rcx
	idivl	(%rcx)
	movl	%edx, (%rsi)
	movq	_mutex@GOTPCREL(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pthread_mutex_unlock           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_mutex,4,2                      ## @mutex
	.comm	_BUFFER_LEN,4,2                 ## @BUFFER_LEN
	.comm	_write_pos,4,2                  ## @write_pos
	.comm	_buffer,8,3                     ## @buffer
	.no_dead_strip	_SNDMacUpdateAudio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SNDMacUpdateAudio
_SNDMacUpdateAudio:                     ; @SNDMacUpdateAudio
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x0, _mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _mutex@GOTPAGEOFF]
	bl	_pthread_mutex_lock
Lloh2:
	adrp	x23, _BUFFER_LEN@GOTPAGE
Lloh3:
	ldr	x23, [x23, _BUFFER_LEN@GOTPAGEOFF]
Lloh4:
	adrp	x22, _write_pos@GOTPAGE
Lloh5:
	ldr	x22, [x22, _write_pos@GOTPAGEOFF]
	ldr	w8, [x23]
	ldrsw	x9, [x22]
	lsl	w10, w21, #2
	sub	w8, w8, w9
	subs	w11, w10, w8
	csel	w24, w10, w8, lt
	csel	w25, w11, wzr, gt
Lloh6:
	adrp	x26, _buffer@GOTPAGE
Lloh7:
	ldr	x26, [x26, _buffer@GOTPAGEOFF]
	ldr	x8, [x26]
	add	x2, x8, x9, lsl #2
	asr	w21, w24, #2
	mov	x0, x20
	mov	x1, x19
	mov	x3, x21
	bl	_macConvert32uto16s
	cbz	w25, LBB0_2
; %bb.1:
	sbfiz	x8, x21, #2, #32
	add	x0, x20, x8
	add	x1, x19, x8
	ldr	x2, [x26]
	asr	w3, w25, #2
	bl	_macConvert32uto16s
LBB0_2:
	ldr	w8, [x22]
	add	w9, w25, w24
	add	w8, w9, w8
	ldr	w9, [x23]
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	str	w8, [x22]
Lloh8:
	adrp	x0, _mutex@GOTPAGE
Lloh9:
	ldr	x0, [x0, _mutex@GOTPAGEOFF]
	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
	b	_pthread_mutex_unlock
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_mutex,4,2                      ; @mutex
	.comm	_BUFFER_LEN,4,2                 ; @BUFFER_LEN
	.comm	_write_pos,4,2                  ; @write_pos
	.comm	_buffer,8,3                     ; @buffer
	.no_dead_strip	_SNDMacUpdateAudio
.subsections_via_symbols
