	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tvaudio_g_ctrl
_tvaudio_g_ctrl:                        ## @tvaudio_g_ctrl
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	callq	_to_state
	movl	(%r14), %ecx
	addl	$-128, %ecx
	cmpl	$4, %ecx
	ja	LBB0_15
## %bb.1:
	movq	%rax, %rbx
	movq	24(%rax), %rax
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_5:
	movq	_CHIP_HAS_VOLUME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_15
## %bb.6:
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	callq	_max
	movl	%eax, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_13:
	movq	_CHIP_HAS_BASSTREBLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_15
## %bb.14:
	movl	8(%rbx), %eax
	jmp	LBB0_4
LBB0_2:
	movq	_CHIP_HAS_INPUTSEL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_15
## %bb.3:
	movl	(%rbx), %eax
	jmp	LBB0_4
LBB0_11:
	movq	_CHIP_HAS_BASSTREBLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_15
## %bb.12:
	movl	4(%rbx), %eax
	jmp	LBB0_4
LBB0_7:
	movq	_CHIP_HAS_VOLUME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_15
## %bb.8:
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	callq	_max
	movq	%rax, %r15
	testl	%r15d, %r15d
	je	LBB0_10
## %bb.9:
	movl	12(%rbx), %esi
	movl	16(%rbx), %edi
	callq	_min
	shll	$15, %eax
	cltd
	idivl	%r15d
LBB0_4:
	movl	%eax, 4(%r14)
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_15:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	$32768, 4(%r14)                 ## imm = 0x8000
	xorl	%eax, %eax
	jmp	LBB0_16
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_13
	.long	L0_0_set_2
	.long	L0_0_set_11
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_CHIP_HAS_INPUTSEL,4,2          ## @CHIP_HAS_INPUTSEL
	.comm	_CHIP_HAS_VOLUME,4,2            ## @CHIP_HAS_VOLUME
	.comm	_CHIP_HAS_BASSTREBLE,4,2        ## @CHIP_HAS_BASSTREBLE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_tvaudio_g_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tvaudio_g_ctrl
_tvaudio_g_ctrl:                        ; @tvaudio_g_ctrl
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	bl	_to_state
	ldr	w8, [x19]
	sub	w9, w8, #128
	cmp	w9, #4
	b.hi	LBB0_13
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #24]
Lloh0:
	adrp	x10, lJTI0_0@PAGE
Lloh1:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_2
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_2:
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _CHIP_HAS_VOLUME@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CHIP_HAS_VOLUME@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.3:
	ldp	w1, w0, [x20, #12]
	bl	_max
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _CHIP_HAS_BASSTREBLE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CHIP_HAS_BASSTREBLE@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.5:
	mov	w0, #0
	ldr	w8, [x20, #8]
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_6:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _CHIP_HAS_INPUTSEL@GOTPAGE
Lloh9:
	ldr	x9, [x9, _CHIP_HAS_INPUTSEL@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.7:
	mov	w0, #0
	ldr	w8, [x20]
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_8:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _CHIP_HAS_BASSTREBLE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CHIP_HAS_BASSTREBLE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.9:
	mov	w0, #0
	ldr	w8, [x20, #4]
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_10:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _CHIP_HAS_VOLUME@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CHIP_HAS_VOLUME@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_13
; %bb.11:
	ldp	w1, w0, [x20, #12]
	bl	_max
	mov	x21, x0
	cbz	w21, LBB0_15
; %bb.12:
	ldp	w1, w0, [x20, #12]
	bl	_min
	mov	x8, x0
	mov	w0, #0
	lsl	w8, w8, #15
	sdiv	w8, w8, w21
	str	w8, [x19, #4]
	b	LBB0_14
LBB0_13:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_15:
	mov	w0, #0
	mov	w8, #32768
	str	w8, [x19, #4]
	b	LBB0_14
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
                                        ; -- End function
	.comm	_CHIP_HAS_INPUTSEL,4,2          ; @CHIP_HAS_INPUTSEL
	.comm	_CHIP_HAS_VOLUME,4,2            ; @CHIP_HAS_VOLUME
	.comm	_CHIP_HAS_BASSTREBLE,4,2        ; @CHIP_HAS_BASSTREBLE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_tvaudio_g_ctrl
.subsections_via_symbols
