	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sound_init
_sound_init:                            ## @sound_init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_sceKernelCreateSema
	movq	_sound_sem@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	testq	%rax, %rax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_lprintf
LBB0_2:
	movq	_samples_done@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_samples_made@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_SOUND_BLOCK_SIZE_NTSC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_samples_block@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_sound_thread_exit@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_sound_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	movl	$18, %edx
	movl	$65536, %ecx                    ## imm = 0x10000
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_sceKernelCreateThread
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movl	%eax, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_sceKernelStartThread
	testl	%eax, %eax
	js	LBB0_4
## %bb.7:
	popq	%rbp
	retq
LBB0_6:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.3(%rip), %rdi
LBB0_5:
	movl	%eax, %esi
	popq	%rbp
	jmp	_lprintf                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sndsem"

	.comm	_sound_sem,8,3                  ## @sound_sem
L_.str.1:                               ## @.str.1
	.asciz	"sceKernelCreateSema() failed: %i\n"

	.comm	_samples_done,8,3               ## @samples_done
	.comm	_samples_made,8,3               ## @samples_made
	.comm	_SOUND_BLOCK_SIZE_NTSC,4,2      ## @SOUND_BLOCK_SIZE_NTSC
	.comm	_samples_block,4,2              ## @samples_block
	.comm	_sound_thread_exit,8,3          ## @sound_thread_exit
L_.str.2:                               ## @.str.2
	.asciz	"sndthread"

	.comm	_sound_thread,4,2               ## @sound_thread
L_.str.3:                               ## @.str.3
	.asciz	"sound_init: sceKernelStartThread returned %08x\n"

L_.str.4:                               ## @.str.4
	.asciz	"sceKernelCreateThread failed: %i\n"

	.no_dead_strip	_sound_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sound_init
_sound_init:                            ; @sound_init
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	mov	w2, #0
	mov	w3, #1
	mov	x4, #0
	bl	_sceKernelCreateSema
Lloh2:
	adrp	x8, _sound_sem@GOTPAGE
Lloh3:
	ldr	x8, [x8, _sound_sem@GOTPAGEOFF]
Lloh4:
	str	x0, [x8]
	tbz	x0, #63, LBB0_2
; %bb.1:
	mov	x1, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_lprintf
LBB0_2:
Lloh7:
	adrp	x8, _samples_done@GOTPAGE
Lloh8:
	ldr	x8, [x8, _samples_done@GOTPAGEOFF]
Lloh9:
	str	xzr, [x8]
Lloh10:
	adrp	x8, _samples_made@GOTPAGE
Lloh11:
	ldr	x8, [x8, _samples_made@GOTPAGEOFF]
Lloh12:
	str	xzr, [x8]
Lloh13:
	adrp	x8, _SOUND_BLOCK_SIZE_NTSC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SOUND_BLOCK_SIZE_NTSC@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _samples_block@GOTPAGE
Lloh17:
	ldr	x9, [x9, _samples_block@GOTPAGEOFF]
Lloh18:
	str	w8, [x9]
Lloh19:
	adrp	x8, _sound_thread_exit@GOTPAGE
Lloh20:
	ldr	x8, [x8, _sound_thread_exit@GOTPAGEOFF]
Lloh21:
	str	xzr, [x8]
Lloh22:
	adrp	x8, _sound_thread@GOTPAGE
Lloh23:
	ldr	x8, [x8, _sound_thread@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	w2, #18
	mov	w3, #65536
	mov	w4, #0
	mov	x5, #0
	bl	_sceKernelCreateThread
	mov	x1, x0
	tbnz	w0, #31, LBB0_5
; %bb.3:
	mov	x0, x1
	mov	w1, #0
	mov	w2, #0
	bl	_sceKernelStartThread
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_5:
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_lprintf
LBB0_6:
	mov	x1, x0
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	b	_lprintf
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sndsem"

	.comm	_sound_sem,8,3                  ; @sound_sem
l_.str.1:                               ; @.str.1
	.asciz	"sceKernelCreateSema() failed: %i\n"

	.comm	_samples_done,8,3               ; @samples_done
	.comm	_samples_made,8,3               ; @samples_made
	.comm	_SOUND_BLOCK_SIZE_NTSC,4,2      ; @SOUND_BLOCK_SIZE_NTSC
	.comm	_samples_block,4,2              ; @samples_block
	.comm	_sound_thread_exit,8,3          ; @sound_thread_exit
l_.str.2:                               ; @.str.2
	.asciz	"sndthread"

	.comm	_sound_thread,4,2               ; @sound_thread
l_.str.3:                               ; @.str.3
	.asciz	"sound_init: sceKernelStartThread returned %08x\n"

l_.str.4:                               ; @.str.4
	.asciz	"sceKernelCreateThread failed: %i\n"

	.no_dead_strip	_sound_init
.subsections_via_symbols
