	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wasapi_write_sh
_wasapi_write_sh:                       ## @wasapi_write_sh
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	$0, -40(%rbp)
	movq	32(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	callq	_fifo_write_avail
	testq	%rax, %rax
	je	LBB0_10
LBB0_2:
	movq	32(%r12), %rdi
	callq	_fifo_write_avail
	cmpq	%r15, %rax
	cmovbq	%rax, %r15
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.3:
	movq	32(%r12), %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_fifo_write
	jmp	LBB0_16
LBB0_4:
	cmpq	$0, 24(%r12)
	je	LBB0_6
## %bb.5:
	movl	20(%r12), %edi
	movq	_INFINITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WaitForSingleObject
	movq	_WAIT_OBJECT_0@GOTPCREL(%rip), %rcx
	movl	$-1, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_17
LBB0_6:
	movl	16(%r12), %edi
	leaq	-40(%rbp), %rsi
	callq	__IAudioClient_GetCurrentPadding
	movl	%eax, %edi
	callq	_FAILED
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_17
## %bb.7:
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	imulq	-40(%rbp), %rcx
	xorl	%ebx, %ebx
	subq	%rcx, %rax
	je	LBB0_17
## %bb.8:
	cmpq	%r15, %rax
	cmovbq	%rax, %r15
	testl	%r15d, %r15d
	je	LBB0_15
## %bb.9:
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_wasapi_flush
	movl	$-1, %ebx
	testl	%eax, %eax
	jne	LBB0_16
	jmp	LBB0_17
LBB0_10:
	cmpq	$0, 24(%r12)
	je	LBB0_12
## %bb.11:
	movl	20(%r12), %edi
	movq	_INFINITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_WaitForSingleObject
	movq	_WAIT_OBJECT_0@GOTPCREL(%rip), %rcx
	movl	$-1, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_17
LBB0_12:
	movl	16(%r12), %edi
	leaq	-40(%rbp), %rsi
	callq	__IAudioClient_GetCurrentPadding
	movl	%eax, %edi
	callq	_FAILED
	movl	$-1, %ebx
	testq	%rax, %rax
	jne	LBB0_17
## %bb.13:
	movq	32(%r12), %rdi
	callq	_fifo_read_avail
	movq	(%r12), %rsi
	movq	8(%r12), %rcx
	imulq	-40(%rbp), %rcx
	subq	%rcx, %rsi
	cmpq	%rsi, %rax
	cmovbq	%rax, %rsi
	testl	%esi, %esi
	je	LBB0_2
## %bb.14:
	movq	%r12, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wasapi_flush_buffer
	testl	%eax, %eax
	jne	LBB0_2
	jmp	LBB0_17
LBB0_15:
	xorl	%r15d, %r15d
LBB0_16:
	movl	%r15d, %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INFINITE,4,2                   ## @INFINITE
	.comm	_WAIT_OBJECT_0,8,3              ## @WAIT_OBJECT_0
	.no_dead_strip	_wasapi_write_sh
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wasapi_write_sh
_wasapi_write_sh:                       ; @wasapi_write_sh
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	x0, [x0, #32]
	cbz	x0, LBB0_4
; %bb.1:
	bl	_fifo_write_avail
	cbz	x0, LBB0_9
LBB0_2:
	ldr	x0, [x20, #32]
	bl	_fifo_write_avail
	cmp	x0, x21
	csel	x21, x0, x21, lo
	cbz	w21, LBB0_13
; %bb.3:
	ldr	x0, [x20, #32]
	mov	x1, x19
	mov	x2, x21
	bl	_fifo_write
	b	LBB0_13
LBB0_4:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_6
; %bb.5:
	ldr	w0, [x20, #20]
Lloh0:
	adrp	x8, _INFINITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INFINITE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_WaitForSingleObject
Lloh3:
	adrp	x8, _WAIT_OBJECT_0@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WAIT_OBJECT_0@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_12
LBB0_6:
	ldr	w0, [x20, #16]
	add	x1, sp, #8
	bl	__IAudioClient_GetCurrentPadding
	bl	_FAILED
	cbnz	x0, LBB0_12
; %bb.7:
	ldr	x8, [sp, #8]
	ldp	x9, x10, [x20]
	mul	x8, x10, x8
	subs	x8, x9, x8
	b.ne	LBB0_16
; %bb.8:
	mov	w21, #0
	b	LBB0_13
LBB0_9:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	w0, [x20, #20]
Lloh6:
	adrp	x8, _INFINITE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INFINITE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_WaitForSingleObject
Lloh9:
	adrp	x8, _WAIT_OBJECT_0@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WAIT_OBJECT_0@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_12
LBB0_11:
	ldr	w0, [x20, #16]
	add	x1, sp, #8
	bl	__IAudioClient_GetCurrentPadding
	bl	_FAILED
	cbz	x0, LBB0_14
LBB0_12:
	mov	w21, #-1
LBB0_13:
	mov	x0, x21
	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
	add	sp, sp, #64
	ret
LBB0_14:
	ldr	x0, [x20, #32]
	bl	_fifo_read_avail
	ldr	x8, [sp, #8]
	ldp	x9, x10, [x20]
	msub	x8, x10, x8, x9
	cmp	x0, x8
	csel	x1, x0, x8, lo
	cbz	w1, LBB0_2
; %bb.15:
	mov	x0, x20
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_wasapi_flush_buffer
	cbnz	w0, LBB0_2
	b	LBB0_12
LBB0_16:
	cmp	x8, x21
	csel	x21, x8, x21, lo
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	cbz	w21, LBB0_13
; %bb.17:
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	bl	_wasapi_flush
	cbnz	w0, LBB0_13
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_INFINITE,4,2                   ; @INFINITE
	.comm	_WAIT_OBJECT_0,8,3              ; @WAIT_OBJECT_0
	.no_dead_strip	_wasapi_write_sh
.subsections_via_symbols
