	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_update_volume             ## -- Begin function plat_update_volume
	.p2align	4, 0x90
_plat_update_volume:                    ## @plat_update_volume
	.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
	movl	%esi, %r15d
	movl	%edi, %r13d
	movq	_currentConfig@GOTPCREL(%rip), %r14
	movl	(%r14), %r12d
	xorl	%eax, %eax
	callq	_soc_detect
	movq	_PicoOpt@GOTPCREL(%rip), %rcx
	movq	_POPT_EN_STEREO@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rcx)
	setne	%cl
	movq	_SOCID_MMSP2@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	sete	%bl
	andb	%cl, %bl
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.1:
	cmpl	$5, %r12d
	setl	%al
	andb	%bl, %al
	cmpb	$1, %al
	jne	LBB0_5
## %bb.2:
	movq	_Pico@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpl	%eax, _plat_update_volume.prev_frame(%rip)
	jne	LBB0_5
## %bb.3:
	movl	_plat_update_volume.wait_frames(%rip), %eax
	cmpl	$11, %eax
	jg	LBB0_5
## %bb.4:
	incl	%eax
	movl	%eax, _plat_update_volume.wait_frames(%rip)
	jmp	LBB0_6
LBB0_5:
	movl	$0, _plat_update_volume.wait_frames(%rip)
	xorl	%esi, %esi
	cmpl	$1, %r15d
	sbbl	%esi, %esi
	orl	$1, %esi
	movq	%r14, %rdi
	callq	_plat_target_step_volume
	movl	(%r14), %r12d
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movl	%r12d, %esi
	callq	_emu_status_msg
	movq	_Pico@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, _plat_update_volume.prev_frame(%rip)
LBB0_7:
	testb	%bl, %bl
	je	LBB0_12
## %bb.8:
	cmpl	$4, %r12d
	jle	LBB0_10
## %bb.9:
	movq	_mix_32_to_16l_stereo@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	movl	$5, %eax
	subl	%r12d, %eax
	movq	_mix_32_to_16l_level@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_mix_32_to_16l_stereo_lvl@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	movq	_PsndMix_32_to_16l@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_plat_update_volume.prev_frame,4,2 ## @plat_update_volume.prev_frame
.zerofill __DATA,__bss,_plat_update_volume.wait_frames,4,2 ## @plat_update_volume.wait_frames
	.comm	_currentConfig,4,2              ## @currentConfig
	.comm	_PicoOpt,4,2                    ## @PicoOpt
	.comm	_POPT_EN_STEREO,4,2             ## @POPT_EN_STEREO
	.comm	_SOCID_MMSP2,8,3                ## @SOCID_MMSP2
	.comm	_Pico,4,2                       ## @Pico
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VOL: %02i"

	.comm	_mix_32_to_16l_stereo,4,2       ## @mix_32_to_16l_stereo
	.comm	_PsndMix_32_to_16l,4,2          ## @PsndMix_32_to_16l
	.comm	_mix_32_to_16l_level,4,2        ## @mix_32_to_16l_level
	.comm	_mix_32_to_16l_stereo_lvl,4,2   ## @mix_32_to_16l_stereo_lvl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_update_volume             ; -- Begin function plat_update_volume
	.p2align	2
_plat_update_volume:                    ; @plat_update_volume
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x20, _currentConfig@GOTPAGE
Lloh1:
	ldr	x20, [x20, _currentConfig@GOTPAGEOFF]
	ldr	w19, [x20]
	bl	_soc_detect
Lloh2:
	adrp	x8, _PicoOpt@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PicoOpt@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _POPT_EN_STEREO@GOTPAGE
Lloh6:
	ldr	x9, [x9, _POPT_EN_STEREO@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
Lloh8:
	adrp	x8, _SOCID_MMSP2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SOCID_MMSP2@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ccmp	x0, x8, #0, ne
	cset	w23, eq
	cbz	w22, LBB0_6
; %bb.1:
	cmp	w19, #5
	cset	w8, lt
	and	w9, w23, w8
	adrp	x22, _plat_update_volume.prev_frame@PAGE
Lloh11:
	adrp	x24, _Pico@GOTPAGE
Lloh12:
	ldr	x24, [x24, _Pico@GOTPAGEOFF]
	adrp	x8, _plat_update_volume.wait_frames@PAGE
	cmp	w9, #1
	b.ne	LBB0_3
; %bb.2:
	ldr	w10, [x22, _plat_update_volume.prev_frame@PAGEOFF]
	ldr	w9, [x24]
	sub	w11, w9, #1
	ldr	w9, [x8, _plat_update_volume.wait_frames@PAGEOFF]
	cmp	w10, w11
	ccmp	w9, #11, #0, eq
	b.le	LBB0_4
LBB0_3:
	str	wzr, [x8, _plat_update_volume.wait_frames@PAGEOFF]
	cmp	w21, #0
	mov	w8, #-1
	cneg	w1, w8, ne
	mov	x0, x20
	bl	_plat_target_step_volume
	ldr	w19, [x20]
	b	LBB0_5
LBB0_4:
	add	w9, w9, #1
	str	w9, [x8, _plat_update_volume.wait_frames@PAGEOFF]
LBB0_5:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_emu_status_msg
	ldr	w8, [x24]
	str	w8, [x22, _plat_update_volume.prev_frame@PAGEOFF]
LBB0_6:
	cbz	w23, LBB0_11
; %bb.7:
	cmp	w19, #4
	b.le	LBB0_9
; %bb.8:
Lloh15:
	adrp	x8, _mix_32_to_16l_stereo@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mix_32_to_16l_stereo@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
	mov	w8, #5
	sub	w8, w8, w19
Lloh17:
	adrp	x9, _mix_32_to_16l_level@GOTPAGE
Lloh18:
	ldr	x9, [x9, _mix_32_to_16l_level@GOTPAGEOFF]
Lloh19:
	str	w8, [x9]
Lloh20:
	adrp	x8, _mix_32_to_16l_stereo_lvl@GOTPAGE
Lloh21:
	ldr	x8, [x8, _mix_32_to_16l_stereo_lvl@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
Lloh22:
	adrp	x9, _PsndMix_32_to_16l@GOTPAGE
Lloh23:
	ldr	x9, [x9, _PsndMix_32_to_16l@GOTPAGEOFF]
Lloh24:
	str	w8, [x9]
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_plat_update_volume.prev_frame,4,2 ; @plat_update_volume.prev_frame
.zerofill __DATA,__bss,_plat_update_volume.wait_frames,4,2 ; @plat_update_volume.wait_frames
	.comm	_currentConfig,4,2              ; @currentConfig
	.comm	_PicoOpt,4,2                    ; @PicoOpt
	.comm	_POPT_EN_STEREO,4,2             ; @POPT_EN_STEREO
	.comm	_SOCID_MMSP2,8,3                ; @SOCID_MMSP2
	.comm	_Pico,4,2                       ; @Pico
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VOL: %02i"

	.comm	_mix_32_to_16l_stereo,4,2       ; @mix_32_to_16l_stereo
	.comm	_PsndMix_32_to_16l,4,2          ; @PsndMix_32_to_16l
	.comm	_mix_32_to_16l_level,4,2        ; @mix_32_to_16l_level
	.comm	_mix_32_to_16l_stereo_lvl,4,2   ; @mix_32_to_16l_stereo_lvl
.subsections_via_symbols
