	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libnx_audren_audio_write
_libnx_audren_audio_write:              ## @libnx_audren_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	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r13
	testq	%rdx, %rdx
	je	LBB0_3
## %bb.4:
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	4(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r15, %rdi
	callq	_mutexLock
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_audrvUpdate
	movq	%r15, %rdi
	callq	_mutexUnlock
	xorl	%eax, %eax
	callq	_audrenWaitFrame
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r13, %r12
	jae	LBB0_9
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rbx
	leaq	(%r14,%r12), %rsi
	movq	%r13, %rdx
	subq	%r12, %rdx
	movq	%r15, %rdi
	callq	_libnx_audren_audio_append
	movq	%rax, %r12
	addq	%rbx, %r12
	cmpq	%r13, %r12
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$0, 8(%r15)
	je	LBB0_7
	jmp	LBB0_9
LBB0_1:
	movl	$-1, %r12d
	jmp	LBB0_9
LBB0_3:
	xorl	%r12d, %r12d
LBB0_9:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_libnx_audren_audio_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libnx_audren_audio_write
_libnx_audren_audio_write:              ; @libnx_audren_audio_write
	.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
	cbz	x0, LBB0_7
; %bb.1:
	mov	x20, x2
	cbz	x2, LBB0_8
; %bb.2:
	mov	x21, x1
	mov	x22, x0
	mov	x19, #0
	add	x23, x0, #4
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x22
	bl	_mutexLock
	mov	x0, x23
	bl	_audrvUpdate
	mov	x0, x22
	bl	_mutexUnlock
	bl	_audrenWaitFrame
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	cmp	x19, x20
	b.hs	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x1, x21, x19
	sub	x2, x20, x19
	mov	x0, x22
	bl	_libnx_audren_audio_append
	add	x19, x0, x19
	cmp	x19, x20
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_3
	b	LBB0_9
LBB0_7:
	mov	w19, #-1
	b	LBB0_9
LBB0_8:
	mov	w19, #0
LBB0_9:
	mov	x0, x19
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_libnx_audren_audio_write
.subsections_via_symbols
