	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function decode_thread
_decode_thread:                         ## @decode_thread
	.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
	xorl	%eax, %eax
	callq	_sceKernelGetThreadId
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_sceKernelGetThreadCurrentPriority
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_lprintf
	movq	_thread_exit@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_1
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_lprintf
	xorl	%edi, %edi
	callq	_sceKernelExitDeleteThread
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_thread_job_sem@GOTPCREL(%rip), %r15
	movq	_thread_busy_sem@GOTPCREL(%rip), %r12
	movq	_working_buf@GOTPCREL(%rip), %r13
	movq	_mp3_mix_buffer@GOTPCREL(%rip), %r14
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	callq	_psp_sem_unlock
	cmpq	$0, (%rbx)
	jne	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_psp_sem_lock
	cmpq	$0, (%rbx)
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r12), %edi
	callq	_psp_sem_lock
	movq	(%r13), %rdi
	callq	_read_next_frame
	testl	%eax, %eax
	jle	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_mp3_src_buffer@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	(%r13), %rdx
	movl	(%rcx,%rdx,8), %ecx
	movq	_mp3_codec_struct@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rdi
	movl	%ecx, 24(%rdi)
	movq	(%r14), %rcx
	movl	(%rcx,%rdx,8), %ecx
	movl	%ecx, 32(%rdi)
	movl	%eax, 40(%rdi)
	movl	%eax, 28(%rdi)
	movl	$4608, 36(%rdi)                 ## imm = 0x1200
	movl	$4098, %esi                     ## imm = 0x1002
	callq	_sceAudiocodecDecode
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_lprintf
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"decode_thread started with id %08x, priority %i\n"

	.comm	_thread_exit,8,3                ## @thread_exit
	.comm	_thread_job_sem,4,2             ## @thread_job_sem
	.comm	_thread_busy_sem,4,2            ## @thread_busy_sem
	.comm	_working_buf,8,3                ## @working_buf
	.comm	_mp3_src_buffer,8,3             ## @mp3_src_buffer
	.comm	_mp3_codec_struct,8,3           ## @mp3_codec_struct
	.comm	_mp3_mix_buffer,8,3             ## @mp3_mix_buffer
L_.str.1:                               ## @.str.1
	.asciz	"sceAudiocodecDecode failed with %08x\n"

L_.str.2:                               ## @.str.2
	.asciz	"leaving decode thread\n"

	.no_dead_strip	_decode_thread
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function decode_thread
_decode_thread:                         ; @decode_thread
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	bl	_sceKernelGetThreadId
	mov	x19, x0
	bl	_sceKernelGetThreadCurrentPriority
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x19, x0, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_lprintf
Lloh2:
	adrp	x20, _thread_exit@GOTPAGE
Lloh3:
	ldr	x20, [x20, _thread_exit@GOTPAGEOFF]
	ldr	x8, [x20]
	cbz	x8, LBB0_2
LBB0_1:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_lprintf
	mov	w0, #0
	bl	_sceKernelExitDeleteThread
	mov	w0, #0
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
Lloh6:
	adrp	x21, _thread_job_sem@GOTPAGE
Lloh7:
	ldr	x21, [x21, _thread_job_sem@GOTPAGEOFF]
Lloh8:
	adrp	x22, _thread_busy_sem@GOTPAGE
Lloh9:
	ldr	x22, [x22, _thread_busy_sem@GOTPAGEOFF]
Lloh10:
	adrp	x23, _working_buf@GOTPAGE
Lloh11:
	ldr	x23, [x23, _working_buf@GOTPAGEOFF]
	mov	w24, #4608
Lloh12:
	adrp	x25, _mp3_src_buffer@GOTPAGE
Lloh13:
	ldr	x25, [x25, _mp3_src_buffer@GOTPAGEOFF]
Lloh14:
	adrp	x26, _mp3_codec_struct@GOTPAGE
Lloh15:
	ldr	x26, [x26, _mp3_codec_struct@GOTPAGEOFF]
Lloh16:
	adrp	x19, l_.str.1@PAGE
Lloh17:
	add	x19, x19, l_.str.1@PAGEOFF
Lloh18:
	adrp	x27, _mp3_mix_buffer@GOTPAGE
Lloh19:
	ldr	x27, [x27, _mp3_mix_buffer@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x22]
	bl	_psp_sem_unlock
	ldr	x8, [x20]
	cbnz	x8, LBB0_1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_psp_sem_lock
	ldr	x8, [x20]
	cbnz	x8, LBB0_1
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x22]
	bl	_psp_sem_lock
	ldr	x0, [x23]
	bl	_read_next_frame
	cmp	w0, #1
	b.lt	LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x25]
	ldr	x9, [x23]
	lsl	x9, x9, #3
	ldr	x10, [x8, x9]
	ldr	x8, [x27]
	ldr	x9, [x8, x9]
	ldr	x8, [x26]
	stp	w24, w0, [x8, #36]
	stp	w10, w0, [x8, #24]
	str	w9, [x8, #32]
	mov	x0, x8
	mov	w1, #4098
	bl	_sceAudiocodecDecode
                                        ; kill: def $w0 killed $w0 def $x0
	tbz	w0, #31, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x0, [sp]
	mov	x0, x19
	bl	_lprintf
	b	LBB0_3
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"decode_thread started with id %08x, priority %i\n"

	.comm	_thread_exit,8,3                ; @thread_exit
	.comm	_thread_job_sem,4,2             ; @thread_job_sem
	.comm	_thread_busy_sem,4,2            ; @thread_busy_sem
	.comm	_working_buf,8,3                ; @working_buf
	.comm	_mp3_src_buffer,8,3             ; @mp3_src_buffer
	.comm	_mp3_codec_struct,8,3           ; @mp3_codec_struct
	.comm	_mp3_mix_buffer,8,3             ; @mp3_mix_buffer
l_.str.1:                               ; @.str.1
	.asciz	"sceAudiocodecDecode failed with %08x\n"

l_.str.2:                               ; @.str.2
	.asciz	"leaving decode thread\n"

	.no_dead_strip	_decode_thread
.subsections_via_symbols
