	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mainLoop
_mainLoop:                              ## @mainLoop
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.1:
	movq	%rdi, %r14
	xorl	%eax, %eax
	callq	_svcGetCurrentProcessorNumber
	movl	24(%r14), %edx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
	cmpl	$0, (%r14)
	je	LBB0_17
## %bb.2:
	leaq	20(%r14), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%r14), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	8(%r14), %r12
	leaq	4(%r14), %r13
	xorl	%eax, %eax
	testq	%rax, %rax
	je	LBB0_5
	.p2align	4, 0x90
LBB0_4:
	movq	(%rax), %rcx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:
	movl	$0, -52(%rbp)
	leaq	-52(%rbp), %rdi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movl	$1, %edx
	movl	$33333333, %ecx                 ## imm = 0x1FCA055
	callq	_svcWaitSynchronization
	movl	(%rbx), %edi
	callq	_svcResetSignal
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-56(%rbp), %rsi
	leaq	-48(%rbp), %rdx
	callq	_audio_ipc_output_get_released_buffer
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_R_FAILED
	testq	%rax, %rax
	jne	LBB0_16
## %bb.6:
	movq	-48(%rbp), %rax
	movq	$0, (%rax)
	xorl	%ecx, %ecx
LBB0_7:
	movq	8(%rax), %rbx
	subq	%rcx, %rbx
	movq	%r12, %rdi
	callq	_compat_mutex_lock
	movl	12(%r14), %edi
	callq	_fifo_read_avail
	movq	%rax, %rdi
	movq	%rbx, %rsi
	callq	_MIN
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	-48(%rbp), %rax
	movl	12(%r14), %edi
	movq	(%rax), %rsi
	shlq	$2, %rsi
	addq	16(%rax), %rsi
	movq	%r15, %rdx
	callq	_fifo_read
LBB0_9:
	movq	%r12, %rdi
	callq	_compat_mutex_unlock
	movq	%r13, %rdi
	callq	_compat_condvar_wake_all
	movq	-48(%rbp), %rsi
	movq	(%rsi), %rax
	addq	%r15, %rax
	movq	%rax, (%rsi)
	movq	8(%rsi), %rcx
	shrq	%rcx
	cmpq	%rcx, %rax
	jae	LBB0_10
## %bb.13:
	movl	$16000000, %edi                 ## imm = 0xF42400
	callq	_svcSleepThread
	cmpl	$0, (%r14)
	jne	LBB0_15
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_10:
	movq	%r14, %rdi
	callq	_switch_audio_ipc_output_append_buffer
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_R_FAILED
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
LBB0_12:
	movq	$0, -48(%rbp)
	cmpl	$0, (%r14)
	je	LBB0_17
LBB0_15:
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	jne	LBB0_4
	jmp	LBB0_5
LBB0_16:
	movl	$0, (%r14)
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_RARCH_LOG
LBB0_17:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[Audio]: start mainLoop cpu %u tid %u\n"

L_.str.1:                               ## @.str.1
	.asciz	"[Audio]: audoutGetReleasedAudioOutBuffer failed: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"[Audio]: audoutAppendAudioOutBuffer failed: %d\n"

	.comm	_U64_MAX,4,2                    ## @U64_MAX
	.no_dead_strip	_mainLoop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mainLoop
_mainLoop:                              ; @mainLoop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	str	wzr, [sp, #28]
	str	xzr, [sp, #16]
	cbz	x0, LBB0_15
; %bb.1:
	mov	x19, x0
	bl	_svcGetCurrentProcessorNumber
	mov	x1, x0
	ldr	w8, [x19, #24]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_RARCH_LOG
	ldr	w8, [x19]
	cbz	w8, LBB0_15
; %bb.2:
	mov	x8, #0
	add	x20, x19, #20
	add	x21, x19, #16
	add	x22, x19, #8
	add	x23, x19, #4
Lloh2:
	adrp	x24, l_.str.2@PAGE
Lloh3:
	add	x24, x24, l_.str.2@PAGEOFF
	cbz	x8, LBB0_4
LBB0_3:
	ldr	x9, [x8]
	b	LBB0_6
LBB0_4:
	str	wzr, [sp, #12]
	add	x0, sp, #12
	mov	x1, x20
	mov	w2, #1
	mov	w3, #41045
	movk	w3, #508, lsl #16
	bl	_svcWaitSynchronization
	ldr	w0, [x20]
	bl	_svcResetSignal
	add	x1, sp, #28
	add	x2, sp, #16
	mov	x0, x21
	bl	_audio_ipc_output_get_released_buffer
	mov	x25, x0
	bl	_R_FAILED
	cbnz	x0, LBB0_14
; %bb.5:
	mov	x9, #0
	ldr	x8, [sp, #16]
	str	xzr, [x8]
LBB0_6:
	ldr	x8, [x8, #8]
	sub	x25, x8, x9
	mov	x0, x22
	bl	_compat_mutex_lock
	ldr	w0, [x19, #12]
	bl	_fifo_read_avail
	mov	x1, x25
	bl	_MIN
	mov	x25, x0
	cbz	x0, LBB0_8
; %bb.7:
	ldr	x8, [sp, #16]
	ldr	x9, [x8, #16]
	ldr	w0, [x19, #12]
	ldr	x8, [x8]
	add	x1, x9, x8, lsl #2
	mov	x2, x25
	bl	_fifo_read
LBB0_8:
	mov	x0, x22
	bl	_compat_mutex_unlock
	mov	x0, x23
	bl	_compat_condvar_wake_all
	ldr	x1, [sp, #16]
	ldp	x8, x9, [x1]
	add	x8, x8, x25
	str	x8, [x1]
	cmp	x8, x9, lsr #1
	b.hs	LBB0_10
; %bb.9:
	mov	w0, #9216
	movk	w0, #244, lsl #16
	bl	_svcSleepThread
	ldr	w8, [x19]
	cbnz	w8, LBB0_13
	b	LBB0_15
LBB0_10:
	mov	x0, x19
	bl	_switch_audio_ipc_output_append_buffer
	mov	x25, x0
	bl	_R_FAILED
	cbz	x0, LBB0_12
; %bb.11:
	mov	x0, x24
	mov	x1, x25
	bl	_RARCH_LOG
LBB0_12:
	str	xzr, [sp, #16]
	ldr	w8, [x19]
	cbz	w8, LBB0_15
LBB0_13:
	ldr	x8, [sp, #16]
	cbnz	x8, LBB0_3
	b	LBB0_4
LBB0_14:
	str	wzr, [x19]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x25
	bl	_RARCH_LOG
LBB0_15:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[Audio]: start mainLoop cpu %u tid %u\n"

l_.str.1:                               ; @.str.1
	.asciz	"[Audio]: audoutGetReleasedAudioOutBuffer failed: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"[Audio]: audoutAppendAudioOutBuffer failed: %d\n"

	.comm	_U64_MAX,4,2                    ; @U64_MAX
	.no_dead_strip	_mainLoop
.subsections_via_symbols
