	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ac97_write_mixer
_ac97_write_mixer:                      ## @ac97_write_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	%ecx, %eax
	movl	%edx, %ebx
	movq	%rdi, %r14
	movq	_ac97_hw@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r15
	movslq	%esi, %r12
	movq	_AC97_STEREO_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%r12d, %ecx
	jae	LBB0_11
## %bb.1:
	movl	%eax, %ecx
	orl	%ebx, %ecx
	je	LBB0_2
## %bb.3:
	movq	_SOUND_MIXER_IGAIN@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	jne	LBB0_5
## %bb.4:
	movl	(%r15,%r12,8), %ecx
	imull	%ecx, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	imull	%ecx, %ebx
	imulq	$1374389535, %rbx, %rsi         ## imm = 0x51EB851F
	shrq	$37, %rsi
	leal	-1(%rcx), %edx
	cmpl	%ecx, %eax
	cmovael	%edx, %eax
	cmpl	%ecx, %esi
	cmovbl	%esi, %edx
	jmp	LBB0_10
LBB0_11:
	movq	_SOUND_MIXER_BASS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_13
## %bb.12:
	movl	4(%r15,%r12,8), %esi
	movq	%r14, %rdi
	callq	*8(%r14)
	andl	$-3841, %eax                    ## imm = 0xF0FF
	movl	$100, %ecx
	subl	%ebx, %ecx
	movl	(%r15,%r12,8), %esi
	imull	%esi, %ecx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	shrq	$37, %rcx
	leal	-1(%rsi), %edx
	cmpl	%esi, %ecx
	cmovbl	%ecx, %edx
	andl	$14, %edx
	shll	$8, %edx
	orl	%eax, %edx
	jmp	LBB0_25
LBB0_5:
	movq	_SOUND_MIXER_VOLUME@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_SOUND_MIXER_ALTPCM@GOTPCREL(%rip), %rcx
	cmpl	%esi, (%rcx)
	je	LBB0_7
## %bb.8:
	movl	(%r15,%r12,8), %esi
	jmp	LBB0_9
LBB0_13:
	movq	_SOUND_MIXER_TREBLE@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_15
## %bb.14:
	movl	4(%r15,%r12,8), %esi
	movq	%r14, %rdi
	callq	*8(%r14)
	andl	$-16, %eax
	movl	$100, %ecx
	subl	%ebx, %ecx
	movl	(%r15,%r12,8), %esi
	imull	%esi, %ecx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	shrq	$37, %rcx
	leal	-1(%rsi), %edx
	cmpl	%esi, %ecx
	cmovbl	%ecx, %edx
	andl	$14, %edx
	orl	%eax, %edx
	jmp	LBB0_25
LBB0_7:
	movb	(%r14), %cl
	movl	$1, %esi
	shll	%cl, %esi
LBB0_9:
	movl	$100, %ecx
	movl	$100, %edx
	subl	%eax, %edx
	imull	%esi, %edx
	imulq	$1374389535, %rdx, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	subl	%ebx, %ecx
	imull	%esi, %ecx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	shrq	$37, %rcx
	leal	-1(%rsi), %edx
	cmpl	%esi, %eax
	cmovael	%edx, %eax
	cmpl	%esi, %ecx
	cmovbl	%ecx, %edx
LBB0_10:
	shll	$8, %edx
	orl	%eax, %edx
	jmp	LBB0_25
LBB0_15:
	testl	%ebx, %ebx
	je	LBB0_2
## %bb.16:
	movq	_SOUND_MIXER_SPEAKER@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_18
## %bb.17:
	movl	$100, %eax
	subl	%ebx, %eax
	movl	(%r15,%r12,8), %ecx
	imull	%ecx, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	leal	-1(%rcx), %edx
	cmpl	%ecx, %eax
	cmovbl	%eax, %edx
	addl	%edx, %edx
	jmp	LBB0_25
LBB0_2:
	movq	_AC97_MUTE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
LBB0_25:
	movq	16(%r14), %rax
	movl	4(%r15,%r12,8), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_18:
	movq	_SOUND_MIXER_PHONEIN@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_21
## %bb.19:
	movl	$100, %eax
	subl	%ebx, %eax
	movl	(%r15,%r12,8), %ecx
	imull	%ecx, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	jmp	LBB0_20
LBB0_21:
	movq	_SOUND_MIXER_PHONEOUT@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_23
## %bb.22:
	movb	(%r14), %cl
	movl	$100, %eax
	subl	%ebx, %eax
	shll	%cl, %eax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	shrq	$37, %rax
	movl	(%r15,%r12,8), %ecx
LBB0_20:
	leal	-1(%rcx), %edx
	cmpl	%ecx, %eax
	cmovbl	%eax, %edx
	jmp	LBB0_25
LBB0_23:
	movq	_SOUND_MIXER_MIC@GOTPCREL(%rip), %rax
	xorl	%edx, %edx
	cmpl	%esi, (%rax)
	jne	LBB0_25
## %bb.24:
	movl	4(%r15,%r12,8), %esi
	movq	%r14, %rdi
	callq	*8(%r14)
	andl	$-32800, %eax                   ## imm = 0xFFFF7FE0
	movl	$100, %ecx
	subl	%ebx, %ecx
	movl	(%r15,%r12,8), %esi
	imull	%esi, %ecx
	imulq	$1374389535, %rcx, %rcx         ## imm = 0x51EB851F
	shrq	$37, %rcx
	leal	-1(%rsi), %edx
	cmpl	%esi, %ecx
	cmovbl	%ecx, %edx
	orl	%eax, %edx
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_ac97_hw,8,3                    ## @ac97_hw
	.comm	_AC97_STEREO_MASK,4,2           ## @AC97_STEREO_MASK
	.comm	_AC97_MUTE,4,2                  ## @AC97_MUTE
	.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_BASS,4,2           ## @SOUND_MIXER_BASS
	.comm	_SOUND_MIXER_TREBLE,4,2         ## @SOUND_MIXER_TREBLE
	.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
	.no_dead_strip	_ac97_write_mixer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ac97_write_mixer
_ac97_write_mixer:                      ; @ac97_write_mixer
	.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	x20, x2
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
Lloh0:
	adrp	x8, _ac97_hw@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ac97_hw@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	sxtw	x22, w1
	add	x23, x21, w1, sxtw #3
Lloh3:
	adrp	x8, _AC97_STEREO_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AC97_STEREO_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsr	w8, w8, w1
	tbz	w8, #0, LBB0_4
; %bb.1:
	orr	w8, w3, w20
	cbz	w8, LBB0_16
; %bb.2:
Lloh6:
	adrp	x8, _SOUND_MIXER_IGAIN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SOUND_MIXER_IGAIN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_6
; %bb.3:
	ldr	w8, [x23]
	mul	w9, w8, w3
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	umull	x9, w9, w10
	lsr	x9, x9, #37
	mul	w11, w8, w20
	umull	x10, w11, w10
	lsr	x10, x10, #37
	sub	w11, w8, #1
	cmp	w9, w8
	csel	w9, w9, w11, lo
	cmp	w10, w8
	csel	w8, w10, w11, lo
	orr	w2, w9, w8, lsl #8
	b	LBB0_17
LBB0_4:
Lloh9:
	adrp	x8, _SOUND_MIXER_BASS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SOUND_MIXER_BASS@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_8
; %bb.5:
	ldr	x8, [x19, #8]
	add	x9, x21, x22, lsl #3
	ldr	w1, [x9, #4]
	mov	x0, x19
	blr	x8
	and	w2, w0, #0xfffff0ff
	mov	w8, #100
	sub	w8, w8, w20
	ldr	w9, [x23]
	mul	w8, w9, w8
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	umull	x8, w8, w10
	lsr	x8, x8, #37
	sub	w10, w9, #1
	cmp	w8, w9
	csel	w8, w8, w10, lo
	lsr	w8, w8, #1
	bfi	w2, w8, #9, #3
	b	LBB0_17
LBB0_6:
Lloh12:
	adrp	x8, _SOUND_MIXER_VOLUME@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SOUND_MIXER_VOLUME@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _SOUND_MIXER_ALTPCM@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SOUND_MIXER_ALTPCM@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	cmp	w8, w1
	ccmp	w9, w1, #4, ne
	b.ne	LBB0_11
; %bb.7:
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w8, w9, w8
	b	LBB0_12
LBB0_8:
Lloh18:
	adrp	x8, _SOUND_MIXER_TREBLE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _SOUND_MIXER_TREBLE@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_13
; %bb.9:
	ldr	x8, [x19, #8]
	add	x9, x21, x22, lsl #3
	ldr	w1, [x9, #4]
	mov	x0, x19
	blr	x8
	and	w8, w0, #0xfffffff0
	mov	w9, #100
	sub	w9, w9, w20
	ldr	w10, [x23]
	mul	w9, w10, w9
	mov	w11, #34079
	movk	w11, #20971, lsl #16
	umull	x9, w9, w11
	lsr	x9, x9, #37
	sub	w11, w10, #1
	cmp	w9, w10
	csel	w9, w9, w11, lo
	and	w9, w9, #0xe
LBB0_10:
	orr	w2, w9, w8
	b	LBB0_17
LBB0_11:
	ldr	w8, [x23]
LBB0_12:
	mov	w9, #100
	sub	w10, w9, w3
	mul	w10, w8, w10
	mov	w11, #34079
	movk	w11, #20971, lsl #16
	umull	x10, w10, w11
	lsr	x10, x10, #37
	sub	w9, w9, w20
	mul	w9, w8, w9
	umull	x9, w9, w11
	lsr	x11, x9, #37
	sub	w12, w8, #1
	cmp	w10, w8
	csel	w9, w10, w12, lo
	cmp	w11, w8
	csel	w8, w11, w12, lo
	orr	w2, w9, w8, lsl #8
	b	LBB0_17
LBB0_13:
	cbz	w20, LBB0_16
; %bb.14:
Lloh21:
	adrp	x8, _SOUND_MIXER_SPEAKER@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SOUND_MIXER_SPEAKER@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_18
; %bb.15:
	mov	w8, #100
	sub	w8, w8, w20
	ldr	w9, [x23]
	mul	w8, w9, w8
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	umull	x8, w8, w10
	lsr	x8, x8, #37
	sub	w10, w9, #1
	cmp	w8, w9
	csel	w8, w8, w10, lo
	lsl	w2, w8, #1
	b	LBB0_17
LBB0_16:
Lloh24:
	adrp	x8, _AC97_MUTE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _AC97_MUTE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
LBB0_17:
	ldr	x3, [x19, #16]
	add	x8, x21, x22, lsl #3
	ldr	w1, [x8, #4]
	mov	x0, x19
	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
	br	x3
LBB0_18:
Lloh27:
	adrp	x8, _SOUND_MIXER_PHONEIN@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SOUND_MIXER_PHONEIN@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_20
; %bb.19:
	mov	w8, #100
	sub	w8, w8, w20
	ldr	w9, [x23]
	mul	w8, w9, w8
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	umull	x8, w8, w10
	lsr	x8, x8, #37
	b	LBB0_22
LBB0_20:
Lloh30:
	adrp	x8, _SOUND_MIXER_PHONEOUT@GOTPAGE
Lloh31:
	ldr	x8, [x8, _SOUND_MIXER_PHONEOUT@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_23
; %bb.21:
	ldr	w8, [x19]
	mov	w9, #100
	sub	w9, w9, w20
	lsl	w8, w9, w8
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	umull	x8, w8, w9
	lsr	x8, x8, #37
	ldr	w9, [x23]
LBB0_22:
	sub	w10, w9, #1
	cmp	w8, w9
	csel	w2, w8, w10, lo
	b	LBB0_17
LBB0_23:
Lloh33:
	adrp	x8, _SOUND_MIXER_MIC@GOTPAGE
Lloh34:
	ldr	x8, [x8, _SOUND_MIXER_MIC@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_25
; %bb.24:
	ldr	x8, [x19, #8]
	add	x9, x21, x22, lsl #3
	ldr	w1, [x9, #4]
	mov	x0, x19
	blr	x8
	mov	w8, #-32800
	and	w8, w0, w8
	mov	w9, #100
	sub	w9, w9, w20
	ldr	w10, [x23]
	mul	w9, w10, w9
	mov	w11, #34079
	movk	w11, #20971, lsl #16
	umull	x9, w9, w11
	lsr	x9, x9, #37
	sub	w11, w10, #1
	cmp	w9, w10
	csel	w9, w9, w11, lo
	b	LBB0_10
LBB0_25:
	mov	w2, #0
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.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_STEREO_MASK,4,2           ; @AC97_STEREO_MASK
	.comm	_AC97_MUTE,4,2                  ; @AC97_MUTE
	.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_BASS,4,2           ; @SOUND_MIXER_BASS
	.comm	_SOUND_MIXER_TREBLE,4,2         ; @SOUND_MIXER_TREBLE
	.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
	.no_dead_strip	_ac97_write_mixer
.subsections_via_symbols
