	.file	"extr_sound.c_PsndRender.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	PsndRender, @function
PsndRender:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movsx	rdx, edi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	ebx, edi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	ecx, DWORD PTR PicoOpt[rip]
	mov	edi, DWORD PTR sound[rip]
	mov	rax, QWORD PTR PsndBuffer[rip]
	sar	ecx, 3
	and	ecx, 1
	lea	rbp, [rax+rdx*4]
	sal	ebx, cl
	mov	r13d, ecx
	call	pprof_start@PLT
	test	ebx, ebx
	jne	.L3
	mov	eax, DWORD PTR PsndLen_exc_cnt[rip]
	add	eax, DWORD PTR PsndLen_exc_add[rip]
	cmp	eax, 65535
	jle	.L34
	sub	eax, 65536
	add	r12d, 1
	mov	DWORD PTR PsndLen_exc_cnt[rip], eax
.L3:
	mov	eax, DWORD PTR PicoOpt[rip]
	movsx	rbx, ebx
	test	DWORD PTR POPT_EN_PSG[rip], eax
	jne	.L35
	mov	eax, DWORD PTR PicoAHW[rip]
	test	DWORD PTR PAHW_PICO[rip], eax
	jne	.L36
.L7:
	mov	eax, DWORD PTR PicoOpt[rip]
	test	DWORD PTR POPT_EN_FM[rip], eax
	jne	.L37
	mov	ecx, r13d
	mov	edx, r12d
	xor	esi, esi
	mov	rdi, rbp
	sal	edx, cl
	call	memset32@PLT
	mov	eax, DWORD PTR PicoAHW[rip]
	test	DWORD PTR PAHW_MCD[rip], eax
	jne	.L38
.L11:
	test	DWORD PTR PAHW_32X[rip], eax
	je	.L13
	mov	eax, DWORD PTR PicoOpt[rip]
	test	DWORD PTR POPT_EN_PWM[rip], eax
	jne	.L39
.L13:
	add	rbx, QWORD PTR PsndOut[rip]
	mov	edx, r12d
	mov	rsi, rbp
	mov	rdi, rbx
	call	PsndMix_32_to_16l@PLT
	mov	edi, DWORD PTR sound[rip]
	call	pprof_end@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	.cfi_restore_state
	mov	ecx, 1
	mov	edx, r13d
	mov	esi, r12d
	mov	rdi, rbp
	call	YM2612UpdateOne@PLT
	mov	eax, DWORD PTR PicoAHW[rip]
	test	DWORD PTR PAHW_MCD[rip], eax
	je	.L11
.L38:
	mov	edx, r13d
	mov	esi, r12d
	mov	rdi, rbp
	call	pcd_pcm_update@PLT
	mov	eax, DWORD PTR PicoAHW[rip]
	test	DWORD PTR PAHW_MCD[rip], eax
	je	.L11
	mov	edx, DWORD PTR PicoOpt[rip]
	test	DWORD PTR POPT_EN_MCD_CDDA[rip], edx
	je	.L11
	mov	rdx, QWORD PTR Pico_mcd[rip]
	cmp	QWORD PTR 16[rdx], 0
	je	.L11
	mov	rcx, QWORD PTR [rdx]
	test	BYTE PTR 216[rcx], 1
	jne	.L11
	mov	rax, QWORD PTR CT_MP3[rip]
	cmp	QWORD PTR 8[rdx], rax
	je	.L40
	mov	esi, r12d
	mov	rdi, rbp
	call	cdda_raw_update@PLT
	mov	eax, DWORD PTR PicoAHW[rip]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L34:
	mov	DWORD PTR PsndLen_exc_cnt[rip], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rdi, QWORD PTR PsndOut[rip]
	mov	edx, r13d
	mov	esi, r12d
	add	rdi, rbx
	call	SN76496Update@PLT
	mov	eax, DWORD PTR PicoAHW[rip]
	test	DWORD PTR PAHW_PICO[rip], eax
	je	.L7
.L36:
	add	rbx, QWORD PTR PsndOut[rip]
	mov	edx, r13d
	mov	esi, r12d
	mov	rdi, rbx
	call	PicoPicoPCMUpdate@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	mov	edx, r13d
	mov	esi, r12d
	mov	rdi, rbp
	call	p32x_pwm_update@PLT
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L40:
	mov	edx, r13d
	mov	esi, r12d
	mov	rdi, rbp
	call	mp3_update@PLT
	mov	eax, DWORD PTR PicoAHW[rip]
	jmp	.L11
	.cfi_endproc
.LFE0:
	.size	PsndRender, .-PsndRender
	.comm	sound,4,4
	.comm	PsndOut,8,8
	.comm	PsndLen_exc_cnt,4,4
	.comm	PsndLen_exc_add,8,8
	.comm	PsndBuffer,8,8
	.comm	Pico_mcd,8,8
	.comm	PicoOpt,4,4
	.comm	PicoAHW,4,4
	.comm	POPT_EN_PWM,4,4
	.comm	POPT_EN_PSG,4,4
	.comm	POPT_EN_MCD_CDDA,4,4
	.comm	POPT_EN_FM,4,4
	.comm	PAHW_PICO,4,4
	.comm	PAHW_MCD,4,4
	.comm	PAHW_32X,4,4
	.comm	CT_MP3,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_sound.c_PsndRender.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	PsndRender, %function
PsndRender:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r3, r0
	ldr	r7, .L42
	ldr	r2, .L42+4
	ldr	r5, [r7]
	ldr	r8, .L42+8
	asr	r5, r5, #3
	ldr	r6, [r2]
	and	r5, r5, #1
	lsl	r9, r0, r5
	ldr	r0, [r8]
	mov	r4, r1
	add	r6, r6, r3, lsl #2
	bl	pprof_start
	cmp	r9, #0
	bne	.L3
	ldr	r2, .L42+12
	ldr	r1, .L42+16
	ldr	r3, [r2]
	ldr	r1, [r1]
	add	r3, r3, r1
	cmp	r3, #65536
	subge	r3, r3, #65536
	strlt	r3, [r2]
	strge	r3, [r2]
	addge	r4, r4, #1
.L3:
	ldr	r3, .L42+20
	ldr	r2, [r7]
	ldr	r3, [r3]
	ldr	fp, .L42+24
	tst	r2, r3
	bne	.L34
.L6:
	ldr	r10, .L42+28
	ldr	r3, .L42+32
	ldr	r2, [r10]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L37
	ldr	r3, .L42+36
	ldr	r1, [r7]
	ldr	r3, [r3]
	ands	r1, r1, r3
	bne	.L38
	mov	r0, r6
	lsl	r2, r4, r5
	bl	memset32
.L10:
	ldr	r3, .L42+40
	ldr	r2, [r10]
	ldr	r1, [r3]
	tst	r2, r1
	bne	.L39
.L11:
	ldr	r3, .L42+44
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L13
	ldr	r3, .L42+48
	ldr	r2, [r7]
	ldr	r3, [r3]
	tst	r2, r3
	bne	.L40
.L13:
	ldr	r0, [fp]
	mov	r1, r6
	mov	r2, r4
	add	r0, r9, r0
	bl	PsndMix_32_to_16l
	ldr	r0, [r8]
	bl	pprof_end
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L38:
	mov	r3, #1
	mov	r2, r5
	mov	r1, r4
	mov	r0, r6
	bl	YM2612UpdateOne
	b	.L10
.L39:
	mov	r2, r5
	mov	r1, r4
	mov	r0, r6
	bl	pcd_pcm_update
	ldr	r3, .L42+40
	ldr	r2, [r10]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L11
	ldr	r3, .L42+52
	ldr	r1, [r7]
	ldr	r3, [r3]
	tst	r1, r3
	beq	.L11
	ldr	r3, .L42+56
	ldr	r3, [r3]
	ldr	r1, [r3, #8]
	cmp	r1, #0
	beq	.L11
	ldr	r1, [r3]
	ldr	r1, [r1, #216]
	tst	r1, #1
	bne	.L11
	ldr	r1, .L42+60
	ldr	r2, [r3, #4]
	ldr	r3, [r1]
	cmp	r2, r3
	beq	.L41
	mov	r1, r4
	mov	r0, r6
	bl	cdda_raw_update
	ldr	r2, [r10]
	b	.L11
.L34:
	ldr	r0, [fp]
	mov	r2, r5
	mov	r1, r4
	add	r0, r9, r0
	bl	SN76496Update
	b	.L6
.L37:
	ldr	r0, [fp]
	mov	r2, r5
	mov	r1, r4
	add	r0, r9, r0
	bl	PicoPicoPCMUpdate
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L40:
	mov	r2, r5
	mov	r1, r4
	mov	r0, r6
	bl	p32x_pwm_update
	b	.L13
.L41:
	mov	r2, r5
	mov	r1, r4
	mov	r0, r6
	bl	mp3_update
	ldr	r2, [r10]
	b	.L11
.L43:
	.align	2
.L42:
	.word	PicoOpt
	.word	PsndBuffer
	.word	sound
	.word	PsndLen_exc_cnt
	.word	PsndLen_exc_add
	.word	POPT_EN_PSG
	.word	PsndOut
	.word	PicoAHW
	.word	PAHW_PICO
	.word	POPT_EN_FM
	.word	PAHW_MCD
	.word	PAHW_32X
	.word	POPT_EN_PWM
	.word	POPT_EN_MCD_CDDA
	.word	Pico_mcd
	.word	CT_MP3
	.size	PsndRender, .-PsndRender
	.comm	sound,4,4
	.comm	PsndOut,4,4
	.comm	PsndLen_exc_cnt,4,4
	.comm	PsndLen_exc_add,4,4
	.comm	PsndBuffer,4,4
	.comm	Pico_mcd,4,4
	.comm	PicoOpt,4,4
	.comm	PicoAHW,4,4
	.comm	POPT_EN_PWM,4,4
	.comm	POPT_EN_PSG,4,4
	.comm	POPT_EN_MCD_CDDA,4,4
	.comm	POPT_EN_FM,4,4
	.comm	PAHW_PICO,4,4
	.comm	PAHW_MCD,4,4
	.comm	PAHW_32X,4,4
	.comm	CT_MP3,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
