	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ac97_read_mixer
_ac97_read_mixer:                       ## @ac97_read_mixer
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_ac97_hw@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movslq	%esi, %r12
	movl	4(%r15,%r12,8), %esi
	callq	*(%rdi)
	movq	_AC97_MUTE@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	testl	%eax, (%rdx)
	jne	LBB0_23
## %bb.1:
	movq	_AC97_STEREO_MASK@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	btl	%r14d, %edx
	jae	LBB0_10
## %bb.2:
	movl	%eax, %edi
	shrl	$8, %edi
	andl	$127, %edi
	andl	$127, %eax
	movq	_SOUND_MIXER_IGAIN@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	jne	LBB0_4
## %bb.3:
	imull	$100, %eax, %eax
	movl	(%r15,%r12,8), %esi
	xorl	%edx, %edx
	idivl	%esi
	movl	%eax, %ecx
	imull	$100, %edi, %eax
	xorl	%edx, %edx
	idivl	%esi
	movl	%eax, %esi
	jmp	LBB0_9
LBB0_10:
	movq	_SOUND_MIXER_SPEAKER@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	jne	LBB0_12
## %bb.11:
	shrl	%eax
	andl	$15, %eax
	jmp	LBB0_21
LBB0_4:
	movq	_SOUND_MIXER_VOLUME@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_SOUND_MIXER_ALTPCM@GOTPCREL(%rip), %rcx
	cmpl	%r14d, (%rcx)
	je	LBB0_6
## %bb.7:
	movl	(%r15,%r12,8), %ebx
	jmp	LBB0_8
LBB0_12:
	movq	_SOUND_MIXER_PHONEIN@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	jne	LBB0_14
LBB0_13:
	andl	$31, %eax
LBB0_21:
	imull	$100, %eax, %eax
	xorl	%edx, %edx
	idivl	(%r15,%r12,8)
LBB0_22:
	movl	$100, %ecx
	subl	%eax, %ecx
	jmp	LBB0_23
LBB0_6:
	movb	8(%rbx), %cl
	movl	$1, %ebx
	shll	%cl, %ebx
LBB0_8:
	imull	$100, %eax, %eax
	xorl	%edx, %edx
	idivl	%ebx
	movl	$100, %esi
	movl	$100, %ecx
	subl	%eax, %ecx
	imull	$100, %edi, %eax
	xorl	%edx, %edx
	idivl	%ebx
	subl	%eax, %esi
LBB0_9:
	shll	$8, %ecx
	orl	%esi, %ecx
LBB0_23:
	movl	%ecx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_SOUND_MIXER_PHONEOUT@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	jne	LBB0_16
## %bb.15:
	movb	8(%rbx), %cl
	andl	$31, %eax
	imull	$100, %eax, %eax
	shrl	%cl, %eax
	jmp	LBB0_22
LBB0_16:
	movq	_SOUND_MIXER_MIC@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	je	LBB0_13
## %bb.17:
	movq	_SOUND_MIXER_BASS@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	jne	LBB0_19
## %bb.18:
	shrl	$8, %eax
	jmp	LBB0_20
LBB0_19:
	movq	_SOUND_MIXER_TREBLE@GOTPCREL(%rip), %rdx
	cmpl	%r14d, (%rdx)
	jne	LBB0_23
LBB0_20:
	andl	$14, %eax
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_ac97_hw,8,3                    ## @ac97_hw
	.comm	_AC97_MUTE,4,2                  ## @AC97_MUTE
	.comm	_AC97_STEREO_MASK,4,2           ## @AC97_STEREO_MASK
	.comm	_SOUND_MIXER_IGAIN,4,2          ## @SOUND_MIXER_IGAIN
	.comm	_SOUND_MIXER_VOLUME,4,2         ## @SOUND_MIXER_VOLUME
	.comm	_SOUND_MIXER_ALTPCM,4,2         ## @SOUND_MIXER_ALTPCM
	.comm	_SOUND_MIXER_SPEAKER,4,2        ## @SOUND_MIXER_SPEAKER
	.comm	_SOUND_MIXER_PHONEIN,4,2        ## @SOUND_MIXER_PHONEIN
	.comm	_SOUND_MIXER_PHONEOUT,4,2       ## @SOUND_MIXER_PHONEOUT
	.comm	_SOUND_MIXER_MIC,4,2            ## @SOUND_MIXER_MIC
	.comm	_SOUND_MIXER_BASS,4,2           ## @SOUND_MIXER_BASS
	.comm	_SOUND_MIXER_TREBLE,4,2         ## @SOUND_MIXER_TREBLE
	.no_dead_strip	_ac97_read_mixer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ac97_read_mixer
_ac97_read_mixer:                       ; @ac97_read_mixer
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _ac97_hw@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ac97_hw@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	add	x21, x8, w1, sxtw #3
	ldr	x8, [x0]
	ldr	w1, [x21, #4]
	blr	x8
Lloh3:
	adrp	x8, _AC97_MUTE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AC97_MUTE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
LBB0_1:
	mov	w0, #0
LBB0_2:
	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_3:
Lloh6:
	adrp	x8, _AC97_STEREO_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AC97_STEREO_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsr	w8, w8, w19
	tbz	w8, #0, LBB0_6
; %bb.4:
	ubfx	w8, w0, #8, #7
	and	w9, w0, #0x7f
Lloh9:
	adrp	x10, _SOUND_MIXER_IGAIN@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SOUND_MIXER_IGAIN@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	w10, w19
	b.ne	LBB0_8
; %bb.5:
	mov	w10, #100
	mul	w9, w9, w10
	ldr	w11, [x21]
	sdiv	w9, w9, w11
	mul	w8, w8, w10
	sdiv	w8, w8, w11
	orr	w0, w8, w9, lsl #8
	b	LBB0_2
LBB0_6:
Lloh12:
	adrp	x8, _SOUND_MIXER_SPEAKER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SOUND_MIXER_SPEAKER@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_10
; %bb.7:
	ubfx	w8, w0, #1, #4
	b	LBB0_12
LBB0_8:
Lloh15:
	adrp	x10, _SOUND_MIXER_VOLUME@GOTPAGE
Lloh16:
	ldr	x10, [x10, _SOUND_MIXER_VOLUME@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _SOUND_MIXER_ALTPCM@GOTPAGE
Lloh19:
	ldr	x11, [x11, _SOUND_MIXER_ALTPCM@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	cmp	w10, w19
	ccmp	w11, w19, #4, ne
	b.ne	LBB0_13
; %bb.9:
	ldr	w10, [x20, #8]
	mov	w11, #1
	lsl	w10, w11, w10
	b	LBB0_14
LBB0_10:
Lloh21:
	adrp	x8, _SOUND_MIXER_PHONEIN@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SOUND_MIXER_PHONEIN@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_15
LBB0_11:
	and	w8, w0, #0x1f
LBB0_12:
	mov	w9, #100
	mul	w8, w8, w9
	ldr	w10, [x21]
	sdiv	w8, w8, w10
	sub	w0, w9, w8
	b	LBB0_2
LBB0_13:
	ldr	w10, [x21]
LBB0_14:
	mov	w11, #100
	mul	w9, w9, w11
	sdiv	w9, w9, w10
	sub	w9, w11, w9
	mul	w8, w8, w11
	sdiv	w8, w8, w10
	sub	w8, w11, w8
	orr	w0, w8, w9, lsl #8
	b	LBB0_2
LBB0_15:
Lloh24:
	adrp	x8, _SOUND_MIXER_PHONEOUT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SOUND_MIXER_PHONEOUT@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_17
; %bb.16:
	ldr	w8, [x20, #8]
	and	w9, w0, #0x1f
	mov	w10, #100
	mul	w9, w9, w10
	lsr	w8, w9, w8
	sub	w0, w10, w8
	b	LBB0_2
LBB0_17:
Lloh27:
	adrp	x8, _SOUND_MIXER_MIC@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SOUND_MIXER_MIC@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cmp	w8, w19
	b.eq	LBB0_11
; %bb.18:
Lloh30:
	adrp	x8, _SOUND_MIXER_BASS@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SOUND_MIXER_BASS@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_20
; %bb.19:
	lsr	w8, w0, #8
	and	w8, w8, #0xe
	b	LBB0_12
LBB0_20:
Lloh33:
	adrp	x8, _SOUND_MIXER_TREBLE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SOUND_MIXER_TREBLE@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	cmp	w8, w19
	b.ne	LBB0_1
; %bb.21:
	and	w8, w0, #0xe
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_ac97_hw,8,3                    ; @ac97_hw
	.comm	_AC97_MUTE,4,2                  ; @AC97_MUTE
	.comm	_AC97_STEREO_MASK,4,2           ; @AC97_STEREO_MASK
	.comm	_SOUND_MIXER_IGAIN,4,2          ; @SOUND_MIXER_IGAIN
	.comm	_SOUND_MIXER_VOLUME,4,2         ; @SOUND_MIXER_VOLUME
	.comm	_SOUND_MIXER_ALTPCM,4,2         ; @SOUND_MIXER_ALTPCM
	.comm	_SOUND_MIXER_SPEAKER,4,2        ; @SOUND_MIXER_SPEAKER
	.comm	_SOUND_MIXER_PHONEIN,4,2        ; @SOUND_MIXER_PHONEIN
	.comm	_SOUND_MIXER_PHONEOUT,4,2       ; @SOUND_MIXER_PHONEOUT
	.comm	_SOUND_MIXER_MIC,4,2            ; @SOUND_MIXER_MIC
	.comm	_SOUND_MIXER_BASS,4,2           ; @SOUND_MIXER_BASS
	.comm	_SOUND_MIXER_TREBLE,4,2         ; @SOUND_MIXER_TREBLE
	.no_dead_strip	_ac97_read_mixer
.subsections_via_symbols
