	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_wss_close
_snd_wss_close:                         ## @snd_wss_close
	.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, %ebx
	movq	%rdi, %r12
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	notl	%ebx
	andl	(%r12), %ebx
	movl	%ebx, (%r12)
	movq	_WSS_MODE_OPEN@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_8
## %bb.1:
	leaq	20(%r12), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	_WSS_HW_AD1848_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	jne	LBB0_3
## %bb.2:
	movq	_CS4231_IRQ_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_snd_wss_out
LBB0_3:
	movq	_STATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_CS4231P
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_wss_outb
	movl	(%rbx), %edi
	callq	_CS4231P
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_wss_outb
	movq	_CS4231_IRQ_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	movq	8(%r12), %rax
	movq	_CS4231_PIN_CTRL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	andl	(%rax,%rsi,4), %edx
	movl	%edx, (%rax,%rsi,4)
	movq	%r12, %rdi
	callq	_snd_wss_out
	movq	8(%r12), %rax
	movq	_CS4231_IFACE_CTRL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_CS4231_PLAYBACK_ENABLE@GOTPCREL(%rip), %rdi
	movq	_CS4231_PLAYBACK_PIO@GOTPCREL(%rip), %rsi
	movl	(%rsi), %edx
	orl	(%rdi), %edx
	movq	_CS4231_RECORD_ENABLE@GOTPCREL(%rip), %rbx
	orl	(%rbx), %edx
	movq	_CS4231_RECORD_PIO@GOTPCREL(%rip), %r13
	orl	(%r13), %edx
	testl	%edx, (%rax,%rcx,4)
	je	LBB0_5
## %bb.4:
	movq	%r15, %rdi
	movq	%rsi, %rbx
	callq	_spin_unlock_irqrestore
	movq	%r12, %rdi
	callq	_snd_wss_mce_up
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movl	(%rbx), %edx
	movq	_CS4231_PLAYBACK_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	_CS4231_RECORD_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	orl	(%r13), %edx
	notl	%edx
	movq	8(%r12), %rax
	movq	_CS4231_IFACE_CTRL@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	andl	(%rax,%rsi,4), %edx
	movl	%edx, (%rax,%rsi,4)
	movq	%r12, %rdi
	callq	_snd_wss_out
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r12, %rdi
	callq	_snd_wss_mce_down
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
LBB0_5:
	movq	_WSS_HW_AD1848_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r12)
	jne	LBB0_7
## %bb.6:
	movq	_CS4231_IRQ_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_snd_wss_out
LBB0_7:
	movq	_STATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_CS4231P
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_wss_outb
	movl	(%rbx), %edi
	callq	_CS4231P
	movq	%r12, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_wss_outb
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	movl	$0, (%r12)
LBB0_8:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WSS_MODE_OPEN,4,2              ## @WSS_MODE_OPEN
	.comm	_WSS_HW_AD1848_MASK,4,2         ## @WSS_HW_AD1848_MASK
	.comm	_CS4231_IRQ_STATUS,8,3          ## @CS4231_IRQ_STATUS
	.comm	_STATUS,4,2                     ## @STATUS
	.comm	_CS4231_IRQ_ENABLE,4,2          ## @CS4231_IRQ_ENABLE
	.comm	_CS4231_PIN_CTRL,8,3            ## @CS4231_PIN_CTRL
	.comm	_CS4231_IFACE_CTRL,8,3          ## @CS4231_IFACE_CTRL
	.comm	_CS4231_PLAYBACK_ENABLE,4,2     ## @CS4231_PLAYBACK_ENABLE
	.comm	_CS4231_PLAYBACK_PIO,4,2        ## @CS4231_PLAYBACK_PIO
	.comm	_CS4231_RECORD_ENABLE,4,2       ## @CS4231_RECORD_ENABLE
	.comm	_CS4231_RECORD_PIO,4,2          ## @CS4231_RECORD_PIO
	.no_dead_strip	_snd_wss_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_wss_close
_snd_wss_close:                         ; @snd_wss_close
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x1
	mov	x20, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	bic	w8, w8, w21
	str	w8, [x20]
Lloh0:
	adrp	x9, _WSS_MODE_OPEN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WSS_MODE_OPEN@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_8
; %bb.1:
	add	x21, x20, #20
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w8, [x20, #4]
Lloh3:
	adrp	x23, _WSS_HW_AD1848_MASK@GOTPAGE
Lloh4:
	ldr	x23, [x23, _WSS_HW_AD1848_MASK@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_3
; %bb.2:
Lloh5:
	adrp	x8, _CS4231_IRQ_STATUS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CS4231_IRQ_STATUS@GOTPAGEOFF]
Lloh7:
	ldr	x1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_snd_wss_out
LBB0_3:
Lloh8:
	adrp	x22, _STATUS@GOTPAGE
Lloh9:
	ldr	x22, [x22, _STATUS@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_CS4231P
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_wss_outb
	ldr	w0, [x22]
	bl	_CS4231P
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_wss_outb
Lloh10:
	adrp	x8, _CS4231_IRQ_ENABLE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CS4231_IRQ_ENABLE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	x9, [x20, #8]
Lloh13:
	adrp	x10, _CS4231_PIN_CTRL@GOTPAGE
Lloh14:
	ldr	x10, [x10, _CS4231_PIN_CTRL@GOTPAGEOFF]
Lloh15:
	ldr	x1, [x10]
	lsl	x10, x1, #2
	ldr	w11, [x9, x10]
	bic	w2, w11, w8
	str	w2, [x9, x10]
	mov	x0, x20
	bl	_snd_wss_out
	ldr	x8, [x20, #8]
Lloh16:
	adrp	x24, _CS4231_IFACE_CTRL@GOTPAGE
Lloh17:
	ldr	x24, [x24, _CS4231_IFACE_CTRL@GOTPAGEOFF]
	ldr	x9, [x24]
	ldr	w8, [x8, x9, lsl #2]
Lloh18:
	adrp	x25, _CS4231_PLAYBACK_ENABLE@GOTPAGE
Lloh19:
	ldr	x25, [x25, _CS4231_PLAYBACK_ENABLE@GOTPAGEOFF]
Lloh20:
	adrp	x26, _CS4231_PLAYBACK_PIO@GOTPAGE
Lloh21:
	ldr	x26, [x26, _CS4231_PLAYBACK_PIO@GOTPAGEOFF]
	ldr	w9, [x25]
	ldr	w10, [x26]
	orr	w9, w10, w9
Lloh22:
	adrp	x27, _CS4231_RECORD_ENABLE@GOTPAGE
Lloh23:
	ldr	x27, [x27, _CS4231_RECORD_ENABLE@GOTPAGEOFF]
	ldr	w10, [x27]
	orr	w9, w9, w10
Lloh24:
	adrp	x28, _CS4231_RECORD_PIO@GOTPAGE
Lloh25:
	ldr	x28, [x28, _CS4231_RECORD_PIO@GOTPAGEOFF]
	ldr	w10, [x28]
	orr	w9, w9, w10
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	bl	_snd_wss_mce_up
	mov	x0, x21
	bl	_spin_lock_irqsave
	ldr	w8, [x25]
	ldr	w9, [x26]
	orr	w8, w9, w8
	ldr	w9, [x27]
	orr	w8, w8, w9
	ldr	w9, [x28]
	orr	w8, w8, w9
	ldr	x9, [x20, #8]
	ldr	x1, [x24]
	lsl	x10, x1, #2
	ldr	w11, [x9, x10]
	bic	w2, w11, w8
	str	w2, [x9, x10]
	mov	x0, x20
	bl	_snd_wss_out
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	mov	x0, x20
	bl	_snd_wss_mce_down
	mov	x0, x21
	bl	_spin_lock_irqsave
LBB0_5:
	ldr	w8, [x20, #4]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.6:
Lloh26:
	adrp	x8, _CS4231_IRQ_STATUS@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CS4231_IRQ_STATUS@GOTPAGEOFF]
Lloh28:
	ldr	x1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_snd_wss_out
LBB0_7:
	ldr	w0, [x22]
	bl	_CS4231P
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_wss_outb
	ldr	w0, [x22]
	bl	_CS4231P
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_wss_outb
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	str	wzr, [x20]
LBB0_8:
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_WSS_MODE_OPEN,4,2              ; @WSS_MODE_OPEN
	.comm	_WSS_HW_AD1848_MASK,4,2         ; @WSS_HW_AD1848_MASK
	.comm	_CS4231_IRQ_STATUS,8,3          ; @CS4231_IRQ_STATUS
	.comm	_STATUS,4,2                     ; @STATUS
	.comm	_CS4231_IRQ_ENABLE,4,2          ; @CS4231_IRQ_ENABLE
	.comm	_CS4231_PIN_CTRL,8,3            ; @CS4231_PIN_CTRL
	.comm	_CS4231_IFACE_CTRL,8,3          ; @CS4231_IFACE_CTRL
	.comm	_CS4231_PLAYBACK_ENABLE,4,2     ; @CS4231_PLAYBACK_ENABLE
	.comm	_CS4231_PLAYBACK_PIO,4,2        ; @CS4231_PLAYBACK_PIO
	.comm	_CS4231_RECORD_ENABLE,4,2       ; @CS4231_RECORD_ENABLE
	.comm	_CS4231_RECORD_PIO,4,2          ; @CS4231_RECORD_PIO
	.no_dead_strip	_snd_wss_close
.subsections_via_symbols
