	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ScspGenerateAudio
_ScspGenerateAudio:                     ## @ScspGenerateAudio
	.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
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	testq	%rdx, %rdx
	je	LBB0_15
## %bb.1:
	xorl	%eax, %eax
	cmpq	$4, %r14
	jb	LBB0_11
## %bb.2:
	movq	%r12, %rcx
	subq	%r15, %rcx
	cmpq	$32, %rcx
	jb	LBB0_11
## %bb.3:
	movq	%r14, %rax
	andq	$-4, %rax
	leaq	-4(%rax), %rsi
	movq	%rsi, %rdx
	shrq	$2, %rdx
	incq	%rdx
	movl	%edx, %ecx
	andl	$3, %ecx
	cmpq	$12, %rsi
	jae	LBB0_5
## %bb.4:
	xorl	%esi, %esi
	jmp	LBB0_7
LBB0_5:
	andq	$-4, %rdx
	xorl	%esi, %esi
	xorps	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movups	%xmm0, (%r15,%rsi,8)
	movups	%xmm0, 16(%r15,%rsi,8)
	movups	%xmm0, (%r12,%rsi,8)
	movups	%xmm0, 16(%r12,%rsi,8)
	movups	%xmm0, 32(%r15,%rsi,8)
	movups	%xmm0, 48(%r15,%rsi,8)
	movups	%xmm0, 32(%r12,%rsi,8)
	movups	%xmm0, 48(%r12,%rsi,8)
	movups	%xmm0, 64(%r15,%rsi,8)
	movups	%xmm0, 80(%r15,%rsi,8)
	movups	%xmm0, 64(%r12,%rsi,8)
	movups	%xmm0, 80(%r12,%rsi,8)
	movups	%xmm0, 96(%r15,%rsi,8)
	movups	%xmm0, 112(%r15,%rsi,8)
	movups	%xmm0, 96(%r12,%rsi,8)
	movups	%xmm0, 112(%r12,%rsi,8)
	addq	$16, %rsi
	addq	$-4, %rdx
	jne	LBB0_6
LBB0_7:
	testq	%rcx, %rcx
	je	LBB0_10
## %bb.8:
	leaq	(%r12,%rsi,8), %rdx
	addq	$16, %rdx
	leaq	(%r15,%rsi,8), %rsi
	addq	$16, %rsi
	shlq	$5, %rcx
	xorl	%edi, %edi
	xorps	%xmm0, %xmm0
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movups	%xmm0, -16(%rsi,%rdi)
	movups	%xmm0, (%rsi,%rdi)
	movups	%xmm0, -16(%rdx,%rdi)
	movups	%xmm0, (%rdx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %rcx
	jne	LBB0_9
LBB0_10:
	cmpq	%r14, %rax
	je	LBB0_15
LBB0_11:
	movq	%rax, %rcx
	notq	%rcx
	addq	%r14, %rcx
	movq	%r14, %rdx
	andq	$3, %rdx
	je	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	$0, (%r15,%rax,8)
	movq	$0, (%r12,%rax,8)
	incq	%rax
	decq	%rdx
	jne	LBB0_12
LBB0_13:
	cmpq	$3, %rcx
	jb	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	$0, (%r15,%rax,8)
	movq	$0, (%r12,%rax,8)
	movq	$0, 8(%r15,%rax,8)
	movq	$0, 8(%r12,%rax,8)
	movq	$0, 16(%r15,%rax,8)
	movq	$0, 16(%r12,%rax,8)
	movq	$0, 24(%r15,%rax,8)
	movq	$0, 24(%r12,%rax,8)
	addq	$4, %rax
	cmpq	%rax, %r14
	jne	LBB0_14
LBB0_15:
	movq	_scsp_bufL@GOTPCREL(%rip), %rax
	movq	%r12, (%rax)
	movq	_scsp_bufR@GOTPCREL(%rip), %rax
	movq	%r15, (%rax)
	xorl	%ebx, %ebx
	movq	_scsp@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdi
	addq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_ScspGenerateAudioForSlot
	addq	$4, %rbx
	cmpq	$128, %rbx
	jne	LBB0_16
## %bb.17:
	movq	_cdda_next_out@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_cdda_next_in@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	callq	_PSP_UC
	imull	$2352, %eax, %eax               ## imm = 0x930
	cmpl	%eax, %ebx
	je	LBB0_25
## %bb.18:
	movq	_cdda_delay@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	testq	%rdx, %rdx
	jle	LBB0_19
## %bb.20:
	movq	%rdx, %rax
	subq	%r14, %rax
	jae	LBB0_22
## %bb.21:
	subq	%rdx, %r14
	movq	$0, (%rcx)
	jmp	LBB0_24
LBB0_19:
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	LBB0_25
	jmp	LBB0_24
LBB0_22:
	movq	%rax, (%rcx)
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_25
LBB0_24:
	movq	%r12, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_ScspGenerateAudioForCDDA
LBB0_25:
	movq	_cdda_next_out@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	(%r13), %edi
	callq	_PSP_UC
	imull	$2352, %eax, %eax               ## imm = 0x930
	cmpl	%eax, %ebx
	jne	LBB0_27
## %bb.26:
	movq	_CDDA_DELAY_SAMPLES@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_cdda_delay@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_scsp_bufL,8,3                  ## @scsp_bufL
	.comm	_scsp_bufR,8,3                  ## @scsp_bufR
	.comm	_scsp,8,3                       ## @scsp
	.comm	_cdda_next_out,4,2              ## @cdda_next_out
	.comm	_cdda_next_in,4,2               ## @cdda_next_in
	.comm	_cdda_delay,8,3                 ## @cdda_delay
	.comm	_CDDA_DELAY_SAMPLES,8,3         ## @CDDA_DELAY_SAMPLES
	.no_dead_strip	_ScspGenerateAudio
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ScspGenerateAudio
_ScspGenerateAudio:                     ; @ScspGenerateAudio
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	cbz	x2, LBB0_8
; %bb.1:
	mov	x8, #0
	cmp	x19, #8
	b.lo	LBB0_6
; %bb.2:
	sub	x9, x21, x20
	cmp	x9, #64
	b.lo	LBB0_6
; %bb.3:
	and	x8, x19, #0xfffffffffffffff8
	add	x9, x20, #32
	add	x10, x21, #32
	movi.2d	v0, #0000000000000000
	mov	x11, x8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x9, #-32]
	stp	q0, q0, [x9], #64
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x11, x11, #8
	b.ne	LBB0_4
; %bb.5:
	cmp	x8, x19
	b.eq	LBB0_8
LBB0_6:
	sub	x9, x19, x8
	lsl	x10, x8, #3
	add	x8, x21, x10
	add	x10, x20, x10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [x10], #8
	str	xzr, [x8], #8
	subs	x9, x9, #1
	b.ne	LBB0_7
LBB0_8:
	mov	x22, #0
Lloh0:
	adrp	x8, _scsp_bufL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _scsp_bufL@GOTPAGEOFF]
Lloh2:
	str	x21, [x8]
Lloh3:
	adrp	x8, _scsp_bufR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _scsp_bufR@GOTPAGEOFF]
Lloh5:
	str	x20, [x8]
Lloh6:
	adrp	x23, _scsp@GOTPAGE
Lloh7:
	ldr	x23, [x23, _scsp@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x23]
	add	x0, x8, x22
	mov	x1, x19
	bl	_ScspGenerateAudioForSlot
	add	x22, x22, #4
	cmp	x22, #128
	b.ne	LBB0_9
; %bb.10:
Lloh8:
	adrp	x22, _cdda_next_out@GOTPAGE
Lloh9:
	ldr	x22, [x22, _cdda_next_out@GOTPAGEOFF]
	ldr	w25, [x22]
Lloh10:
	adrp	x23, _cdda_next_in@GOTPAGE
Lloh11:
	ldr	x23, [x23, _cdda_next_in@GOTPAGEOFF]
	ldr	w0, [x23]
	bl	_PSP_UC
	mov	w24, #2352
	mul	w8, w0, w24
	cmp	w25, w8
	b.eq	LBB0_17
; %bb.11:
Lloh12:
	adrp	x9, _cdda_delay@GOTPAGE
Lloh13:
	ldr	x9, [x9, _cdda_delay@GOTPAGEOFF]
	ldr	x8, [x9]
	cmp	x8, #1
	b.lt	LBB0_15
; %bb.12:
	subs	x10, x8, x19
	b.hs	LBB0_14
; %bb.13:
	sub	x19, x19, x8
	str	xzr, [x9]
	b	LBB0_16
LBB0_14:
	mov	x19, #0
	str	x10, [x9]
	mov	x8, x10
LBB0_15:
	cbnz	x8, LBB0_17
LBB0_16:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_ScspGenerateAudioForCDDA
LBB0_17:
	ldr	w19, [x22]
	ldr	w0, [x23]
	bl	_PSP_UC
	mul	w8, w0, w24
	cmp	w19, w8
	b.ne	LBB0_19
; %bb.18:
Lloh14:
	adrp	x8, _CDDA_DELAY_SAMPLES@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CDDA_DELAY_SAMPLES@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
Lloh17:
	adrp	x9, _cdda_delay@GOTPAGE
Lloh18:
	ldr	x9, [x9, _cdda_delay@GOTPAGEOFF]
Lloh19:
	str	x8, [x9]
LBB0_19:
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_scsp_bufL,8,3                  ; @scsp_bufL
	.comm	_scsp_bufR,8,3                  ; @scsp_bufR
	.comm	_scsp,8,3                       ; @scsp
	.comm	_cdda_next_out,4,2              ; @cdda_next_out
	.comm	_cdda_next_in,4,2               ; @cdda_next_in
	.comm	_cdda_delay,8,3                 ; @cdda_delay
	.comm	_CDDA_DELAY_SAMPLES,8,3         ; @CDDA_DELAY_SAMPLES
	.no_dead_strip	_ScspGenerateAudio
.subsections_via_symbols
