	.file	"extr_mp3.c_mp3_update.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	mp3_update
	.type	mp3_update, @function
mp3_update:
.LFB0:
	.cfi_startproc
	endbr64
	cmp	QWORD PTR mp3_handle[rip], 0
	js	.L18
	mov	rax, QWORD PTR mp3_src_size[rip]
	cmp	QWORD PTR mp3_src_pos[rip], rax
	jge	.L18
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	eax, DWORD PTR PsndRate[rip]
	cmp	eax, 22050
	je	.L22
	lea	ebx, 0[0+rsi*4]
	cmp	eax, 11025
	cmovne	ebx, esi
.L6:
	mov	ecx, DWORD PTR mp3_job_started[rip]
	mov	edx, DWORD PTR mp3_samples_ready[rip]
	test	ecx, ecx
	je	.L7
	cmp	ebx, edx
	jg	.L23
.L8:
	cmp	eax, 22050
	je	.L15
	cmp	eax, 11025
	je	.L24
	mov	r12, QWORD PTR mix_16h_to_32@GOTPCREL[rip]
	xor	r13d, r13d
.L9:
	mov	eax, DWORD PTR mp3_buffer_offs[rip]
	mov	edx, 1152
	mov	rcx, QWORD PTR mp3_play_bufsel[rip]
	mov	rdi, QWORD PTR mp3_mix_buffer[rip]
	sub	edx, eax
	add	eax, eax
	cdqe
	add	rax, rax
	cmp	edx, ebx
	jl	.L10
	add	rax, QWORD PTR [rdi+rcx*8]
	lea	edx, [rsi+rsi]
	mov	rdi, rbp
	mov	rsi, rax
	call	r12
	add	DWORD PTR mp3_buffer_offs[rip], ebx
.L11:
	mov	eax, DWORD PTR mp3_job_started[rip]
	sub	DWORD PTR mp3_samples_ready[rip], ebx
	test	eax, eax
	je	.L13
	add	rsp, 24
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.p2align 4,,10
	.p2align 3
.L23:
	.cfi_def_cfa_offset 80
	.cfi_offset 3, -56
	.cfi_offset 6, -48
	.cfi_offset 12, -40
	.cfi_offset 13, -32
	.cfi_offset 14, -24
	.cfi_offset 15, -16
	mov	edi, DWORD PTR thread_busy_sem[rip]
	mov	DWORD PTR 12[rsp], esi
	call	psp_sem_lock@PLT
	mov	edi, DWORD PTR thread_busy_sem[rip]
	call	psp_sem_unlock@PLT
	mov	eax, DWORD PTR mp3_samples_ready[rip]
	mov	esi, DWORD PTR 12[rsp]
	mov	DWORD PTR mp3_job_started[rip], 0
	lea	edx, 1152[rax]
	mov	DWORD PTR mp3_samples_ready[rip], edx
.L7:
	mov	eax, DWORD PTR PsndRate[rip]
	cmp	ebx, edx
	jle	.L8
.L13:
	mov	edi, DWORD PTR thread_busy_sem[rip]
	xor	DWORD PTR working_buf[rip], 1
	mov	DWORD PTR mp3_job_started[rip], 1
	call	psp_sem_lock@PLT
	mov	edi, DWORD PTR thread_busy_sem[rip]
	call	psp_sem_unlock@PLT
	mov	edi, DWORD PTR thread_job_sem[rip]
	call	psp_sem_unlock@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	edi, 1
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_restore 13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_restore 14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_restore 15
	.cfi_def_cfa_offset 8
	jmp	sceKernelDelayThread@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	r12, QWORD PTR mix_16h_to_32_s1@GOTPCREL[rip]
	mov	r13d, 1
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L22:
	lea	ebx, [rsi+rsi]
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	mov	r15d, ebx
	sub	r15d, edx
	test	rcx, rcx
	jne	.L12
	add	rax, QWORD PTR [rdi]
	lea	edx, [rsi+rsi]
	mov	rdi, rbp
	mov	rsi, rax
	call	r12
	mov	DWORD PTR mp3_buffer_offs[rip], r15d
	mov	QWORD PTR mp3_play_bufsel[rip], 1
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	mov	ecx, r13d
	add	rax, QWORD PTR 8[rdi]
	mov	rdi, rbp
	sar	edx, cl
	mov	rsi, rax
	lea	r14d, [rdx+rdx]
	mov	edx, r14d
	movsx	r14, r14d
	call	r12
	mov	rax, QWORD PTR mp3_mix_buffer[rip]
	mov	ecx, r13d
	lea	rdi, 0[rbp+r14*4]
	mov	DWORD PTR mp3_buffer_offs[rip], r15d
	sar	r15d, cl
	mov	rsi, QWORD PTR [rax]
	lea	edx, [r15+r15]
	call	r12
	mov	QWORD PTR mp3_play_bufsel[rip], 0
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L24:
	mov	r12, QWORD PTR mix_16h_to_32_s2@GOTPCREL[rip]
	mov	r13d, 2
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	mp3_update, .-mp3_update
	.comm	working_buf,4,4
	.comm	thread_job_sem,4,4
	.comm	thread_busy_sem,4,4
	.comm	mp3_src_size,8,8
	.comm	mp3_src_pos,8,8
	.comm	mp3_samples_ready,4,4
	.comm	mp3_play_bufsel,8,8
	.comm	mp3_mix_buffer,8,8
	.comm	mp3_job_started,4,4
	.comm	mp3_handle,8,8
	.comm	mp3_buffer_offs,4,4
	.comm	PsndRate,4,4
	.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_mp3.c_mp3_update.c"
	.text
	.align	2
	.global	mp3_update
	.syntax unified
	.arm
	.fpu softvfp
	.type	mp3_update, %function
mp3_update:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L27
	ldr	r3, [r3]
	cmp	r3, #0
	bxlt	lr
	ldr	r2, .L27+4
	ldr	r3, .L27+8
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	bxge	lr
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r8, .L27+12
	ldr	r2, .L27+16
	ldr	r3, [r8]
	mov	r4, r0
	cmp	r3, r2
	sub	sp, sp, #20
	lsleq	r5, r1, #1
	beq	.L6
	ldr	r2, .L27+20
	cmp	r3, r2
	movne	r5, r1
	lsleq	r5, r1, #2
.L6:
	ldr	r7, .L27+24
	ldr	r6, .L27+28
	ldr	r0, [r7]
	ldr	r2, [r6]
	cmp	r0, #0
	beq	.L7
	cmp	r5, r2
	bgt	.L25
	ldr	r2, .L27+16
	cmp	r3, r2
	beq	.L15
.L26:
	ldr	r2, .L27+20
	ldr	r8, .L27+32
	cmp	r3, r2
	ldr	r2, .L27+36
	movne	r3, #0
	moveq	r3, #2
	moveq	r8, r2
.L9:
	ldr	r9, .L27+40
	ldr	r10, .L27+44
	ldr	r2, [r9]
	ldr	fp, .L27+48
	rsb	ip, r2, #1152
	cmp	ip, r5
	lsl	r0, r2, #2
	ldr	lr, [fp]
	ldr	r2, [r10]
	blt	.L10
	ldr	r3, [lr, r2, lsl #2]
	lsl	r2, r1, #1
	add	r1, r3, r0
	mov	r0, r4
	blx	r8
	ldr	r3, [r9]
	add	r3, r3, r5
	str	r3, [r9]
.L11:
	ldr	r3, [r6]
	ldr	r2, [r7]
	sub	r5, r3, r5
	cmp	r2, #0
	str	r5, [r6]
	beq	.L13
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L25:
	ldr	r9, .L27+52
	str	r1, [sp, #4]
	ldr	r0, [r9]
	bl	psp_sem_lock
	ldr	r0, [r9]
	bl	psp_sem_unlock
	mov	r3, #0
	ldr	r2, [r6]
	ldr	r1, [sp, #4]
	add	r2, r2, #1152
	str	r3, [r7]
	str	r2, [r6]
.L7:
	cmp	r5, r2
	bgt	.L13
	ldr	r3, [r8]
	ldr	r2, .L27+16
	cmp	r3, r2
	bne	.L26
	b	.L15
.L13:
	mov	r4, #1
	ldr	r2, .L27+56
	ldr	r5, .L27+52
	ldr	r3, [r2]
	ldr	r0, [r5]
	eor	r3, r3, r4
	str	r3, [r2]
	str	r4, [r7]
	bl	psp_sem_lock
	ldr	r0, [r5]
	bl	psp_sem_unlock
	ldr	r3, .L27+60
	ldr	r0, [r3]
	bl	psp_sem_unlock
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	sceKernelDelayThread
.L15:
	mov	r3, #1
	ldr	r8, .L27+64
	b	.L9
.L10:
	cmp	r2, #0
	sub	r2, r5, ip
	str	r2, [sp, #4]
	bne	.L12
	ldr	r3, [lr]
	lsl	r2, r1, #1
	add	r1, r3, r0
	mov	r0, r4
	blx	r8
	mov	r3, #1
	ldr	r2, [sp, #4]
	str	r3, [r10]
	str	r2, [r9]
	b	.L11
.L12:
	ldr	r1, [lr, #4]
	asr	r2, ip, r3
	add	r1, r1, r0
	str	r2, [sp, #8]
	mov	r0, r4
	lsl	r2, r2, #1
	str	r3, [sp, #12]
	blx	r8
	ldr	ip, [sp, #4]
	ldr	r3, [sp, #12]
	ldr	r1, [fp]
	asr	r2, ip, r3
	ldr	r3, [sp, #8]
	ldr	r1, [r1]
	add	r0, r4, r3, lsl #3
	lsl	r2, r2, #1
	str	ip, [r9]
	blx	r8
	mov	r3, #0
	str	r3, [r10]
	b	.L11
.L28:
	.align	2
.L27:
	.word	mp3_handle
	.word	mp3_src_pos
	.word	mp3_src_size
	.word	PsndRate
	.word	22050
	.word	11025
	.word	mp3_job_started
	.word	mp3_samples_ready
	.word	mix_16h_to_32
	.word	mix_16h_to_32_s2
	.word	mp3_buffer_offs
	.word	mp3_play_bufsel
	.word	mp3_mix_buffer
	.word	thread_busy_sem
	.word	working_buf
	.word	thread_job_sem
	.word	mix_16h_to_32_s1
	.size	mp3_update, .-mp3_update
	.comm	working_buf,4,4
	.comm	thread_job_sem,4,4
	.comm	thread_busy_sem,4,4
	.comm	mp3_src_size,4,4
	.comm	mp3_src_pos,4,4
	.comm	mp3_samples_ready,4,4
	.comm	mp3_play_bufsel,4,4
	.comm	mp3_mix_buffer,4,4
	.comm	mp3_job_started,4,4
	.comm	mp3_handle,4,4
	.comm	mp3_buffer_offs,4,4
	.comm	PsndRate,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
