	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ac97_switch_put
_ac97_switch_put:                       ## @ac97_switch_put
	.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
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r13
	movl	(%rdi), %ebx
	movl	%ebx, %r15d
	shrl	$24, %r15d
	andl	$1, %r15d
	movzbl	%bl, %r12d
	movl	%ebx, %r14d
	shrl	$8, %r14d
	movq	%r13, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%r12d, %edx
	callq	_oxygen_read_ac97
	movq	%r13, %rdi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rdx
	xorl	%ecx, %ecx
	cmpl	$0, (%rdx)
	sete	%cl
	shrl	$16, %ebx
	andl	$1, %ebx
	xorl	%ecx, %ebx
	movl	%eax, %ecx
	btsl	%r14d, %ecx
	movl	%eax, %r13d
	btrl	%r14d, %r13d
	cmpl	$1, %ebx
	cmovnel	%ecx, %r13d
	cmpl	%eax, %r13d
	je	LBB0_16
## %bb.1:
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movl	%r15d, %esi
	movl	%r12d, %edx
	movl	%r13d, %ecx
	callq	_oxygen_write_ac97
	testl	%r15d, %r15d
	movq	%rbx, %r15
	movl	%r12d, %ebx
	jne	LBB0_4
## %bb.2:
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	%r13d, %edx
	andl	$32768, %edx                    ## imm = 0x8000
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	*%rax
LBB0_4:
	movq	_AC97_LINE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_7
## %bb.5:
	movq	_CM9780_GPIO_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movswl	%r13w, %ecx
	sarl	$15, %ecx
	movq	_CM9780_GPO0@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	andl	%r8d, %ecx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_oxygen_write_ac97_masked
	testl	$32768, %r13d                   ## imm = 0x8000
	movq	%r15, %rdi
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jne	LBB0_16
## %bb.6:
	movq	_CONTROL_MIC_CAPTURE_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, %rbx
	callq	_mute_ac97_ctl
	movq	_CONTROL_CD_CAPTURE_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mute_ac97_ctl
	movq	_CONTROL_AUX_CAPTURE_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mute_ac97_ctl
	jmp	LBB0_15
LBB0_7:
	movzbl	%r14b, %edx
	movq	_AC97_MIC@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	je	LBB0_12
## %bb.8:
	movq	_AC97_CD@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	je	LBB0_12
## %bb.9:
	movq	_AC97_VIDEO@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	je	LBB0_12
## %bb.10:
	movq	_AC97_AUX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %ebx
	movq	%r15, %rdi
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jne	LBB0_16
## %bb.11:
	cmpl	$15, %edx
	je	LBB0_13
	jmp	LBB0_16
LBB0_12:
	cmpl	$15, %edx
	movq	%r15, %rdi
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	jne	LBB0_16
LBB0_13:
	testl	$32768, %r13d                   ## imm = 0x8000
	jne	LBB0_16
## %bb.14:
	movq	_CONTROL_LINE_CAPTURE_SWITCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, %rbx
	callq	_mute_ac97_ctl
	movq	_CM9780_GPIO_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_CM9780_GPO0@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%ecx, %r8d
	callq	_oxygen_write_ac97_masked
LBB0_15:
	movq	%rbx, %rdi
	movl	-48(%rbp), %eax                 ## 4-byte Reload
LBB0_16:
	xorl	%ebx, %ebx
	cmpl	%eax, %r13d
	setne	%bl
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AC97_LINE,4,2                  ## @AC97_LINE
	.comm	_CM9780_GPIO_STATUS,4,2         ## @CM9780_GPIO_STATUS
	.comm	_CM9780_GPO0,4,2                ## @CM9780_GPO0
	.comm	_CONTROL_MIC_CAPTURE_SWITCH,4,2 ## @CONTROL_MIC_CAPTURE_SWITCH
	.comm	_CONTROL_CD_CAPTURE_SWITCH,4,2  ## @CONTROL_CD_CAPTURE_SWITCH
	.comm	_CONTROL_AUX_CAPTURE_SWITCH,4,2 ## @CONTROL_AUX_CAPTURE_SWITCH
	.comm	_AC97_MIC,4,2                   ## @AC97_MIC
	.comm	_AC97_CD,4,2                    ## @AC97_CD
	.comm	_AC97_VIDEO,4,2                 ## @AC97_VIDEO
	.comm	_AC97_AUX,4,2                   ## @AC97_AUX
	.comm	_CONTROL_LINE_CAPTURE_SWITCH,4,2 ## @CONTROL_LINE_CAPTURE_SWITCH
	.no_dead_strip	_ac97_switch_put
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ac97_switch_put
_ac97_switch_put:                       ; @ac97_switch_put
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	ldr	x19, [x0, #8]
	ldr	w24, [x0]
	ubfx	w23, w24, #24, #1
	and	w22, w24, #0xff
	lsr	w25, w24, #8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_oxygen_read_ac97
	mov	x20, x0
	ldr	x8, [x21]
	ldr	w8, [x8]
	cmp	w8, #0
	cset	w8, eq
	ubfx	w9, w24, #16, #1
	eor	w8, w9, w8
	mov	w9, #1
	lsl	w9, w9, w25
	orr	w10, w9, w0
	bic	w9, w0, w9
	cmp	w8, #1
	csel	w21, w9, w10, eq
	cmp	w21, w0
	b.eq	LBB0_12
; %bb.1:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	bl	_oxygen_write_ac97
	cbnz	w23, LBB0_4
; %bb.2:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_4
; %bb.3:
	and	w2, w21, #0x8000
	mov	x0, x19
	mov	x1, x22
	blr	x8
LBB0_4:
Lloh0:
	adrp	x8, _AC97_LINE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AC97_LINE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_7
; %bb.5:
Lloh3:
	adrp	x8, _CM9780_GPIO_STATUS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CM9780_GPIO_STATUS@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	lsl	w8, w21, #16
Lloh6:
	adrp	x9, _CM9780_GPO0@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CM9780_GPO0@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x9]
	and	w3, w4, w8, asr #31
	mov	x0, x19
	mov	w1, #0
	bl	_oxygen_write_ac97_masked
	tbnz	w21, #15, LBB0_12
; %bb.6:
Lloh9:
	adrp	x8, _CONTROL_MIC_CAPTURE_SWITCH@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CONTROL_MIC_CAPTURE_SWITCH@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mute_ac97_ctl
Lloh12:
	adrp	x8, _CONTROL_CD_CAPTURE_SWITCH@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CONTROL_CD_CAPTURE_SWITCH@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mute_ac97_ctl
Lloh15:
	adrp	x8, _CONTROL_AUX_CAPTURE_SWITCH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _CONTROL_AUX_CAPTURE_SWITCH@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mute_ac97_ctl
	b	LBB0_12
LBB0_7:
	ubfx	w8, w24, #8, #8
Lloh18:
	adrp	x9, _AC97_MIC@GOTPAGE
Lloh19:
	ldr	x9, [x9, _AC97_MIC@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _AC97_CD@GOTPAGE
Lloh22:
	ldr	x10, [x10, _AC97_CD@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
Lloh24:
	adrp	x11, _AC97_VIDEO@GOTPAGE
Lloh25:
	ldr	x11, [x11, _AC97_VIDEO@GOTPAGEOFF]
Lloh26:
	ldr	w11, [x11]
	cmp	w22, w9
	ccmp	w22, w10, #4, ne
	ccmp	w22, w11, #4, ne
	b.eq	LBB0_9
; %bb.8:
Lloh27:
	adrp	x9, _AC97_AUX@GOTPAGE
Lloh28:
	ldr	x9, [x9, _AC97_AUX@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	cmp	w22, w9
	b.ne	LBB0_12
LBB0_9:
	cmp	w8, #15
	b.ne	LBB0_12
; %bb.10:
	tbnz	w21, #15, LBB0_12
; %bb.11:
Lloh30:
	adrp	x8, _CONTROL_LINE_CAPTURE_SWITCH@GOTPAGE
Lloh31:
	ldr	x8, [x8, _CONTROL_LINE_CAPTURE_SWITCH@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_mute_ac97_ctl
Lloh33:
	adrp	x8, _CM9780_GPIO_STATUS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CM9780_GPIO_STATUS@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
Lloh36:
	adrp	x8, _CM9780_GPO0@GOTPAGE
Lloh37:
	ldr	x8, [x8, _CM9780_GPO0@GOTPAGEOFF]
Lloh38:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #0
	mov	x4, x3
	bl	_oxygen_write_ac97_masked
LBB0_12:
	cmp	w21, w20
	cset	w20, ne
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_AC97_LINE,4,2                  ; @AC97_LINE
	.comm	_CM9780_GPIO_STATUS,4,2         ; @CM9780_GPIO_STATUS
	.comm	_CM9780_GPO0,4,2                ; @CM9780_GPO0
	.comm	_CONTROL_MIC_CAPTURE_SWITCH,4,2 ; @CONTROL_MIC_CAPTURE_SWITCH
	.comm	_CONTROL_CD_CAPTURE_SWITCH,4,2  ; @CONTROL_CD_CAPTURE_SWITCH
	.comm	_CONTROL_AUX_CAPTURE_SWITCH,4,2 ; @CONTROL_AUX_CAPTURE_SWITCH
	.comm	_AC97_MIC,4,2                   ; @AC97_MIC
	.comm	_AC97_CD,4,2                    ; @AC97_CD
	.comm	_AC97_VIDEO,4,2                 ; @AC97_VIDEO
	.comm	_AC97_AUX,4,2                   ; @AC97_AUX
	.comm	_CONTROL_LINE_CAPTURE_SWITCH,4,2 ; @CONTROL_LINE_CAPTURE_SWITCH
	.no_dead_strip	_ac97_switch_put
.subsections_via_symbols
