	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snd_wss_open
_snd_wss_open:                          ## @snd_wss_open
	.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, %r15d
	movq	%rdi, %r13
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r13), %eax
	testl	%r15d, %eax
	je	LBB0_1
LBB0_3:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_WSS_MODE_OPEN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.2:
	cmpq	$0, 24(%r13)
	jne	LBB0_3
## %bb.4:
	orl	%r15d, %eax
	movl	%eax, (%r13)
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_5:
	leaq	20(%r13), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock_irqsave
	movq	_WSS_HW_AD1848_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	jne	LBB0_7
## %bb.6:
	movq	_CS4231_IRQ_STATUS@GOTPCREL(%rip), %rbx
	movq	_CS4231_PLAYBACK_IRQ@GOTPCREL(%rip), %rax
	movq	_CS4231_RECORD_IRQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	(%rbx), %rsi
	movq	_CS4231_TIMER_IRQ@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_snd_wss_out
	movq	(%rbx), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_snd_wss_out
LBB0_7:
	movq	_STATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_CS4231P
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_wss_outb
	movl	(%r12), %edi
	callq	_CS4231P
	movq	%r13, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_wss_outb
	movq	_CS4231_IRQ_ENABLE@GOTPCREL(%rip), %rax
	movq	8(%r13), %rcx
	movq	_CS4231_PIN_CTRL@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movl	(%rcx,%rsi,4), %edx
	orl	(%rax), %edx
	movl	%edx, (%rcx,%rsi,4)
	movq	%r13, %rdi
	callq	_snd_wss_out
	movq	_WSS_HW_AD1848_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r13)
	jne	LBB0_9
## %bb.8:
	movq	_CS4231_IRQ_STATUS@GOTPCREL(%rip), %r12
	movq	_CS4231_PLAYBACK_IRQ@GOTPCREL(%rip), %rax
	movq	_CS4231_RECORD_IRQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	(%r12), %rsi
	movq	_CS4231_TIMER_IRQ@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r13, %rdi
	callq	_snd_wss_out
	movq	(%r12), %rsi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_snd_wss_out
LBB0_9:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_spin_unlock_irqrestore
	movl	%r15d, (%r13)
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_WSS_MODE_OPEN,4,2              ## @WSS_MODE_OPEN
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_WSS_HW_AD1848_MASK,4,2         ## @WSS_HW_AD1848_MASK
	.comm	_CS4231_IRQ_STATUS,8,3          ## @CS4231_IRQ_STATUS
	.comm	_CS4231_PLAYBACK_IRQ,4,2        ## @CS4231_PLAYBACK_IRQ
	.comm	_CS4231_RECORD_IRQ,4,2          ## @CS4231_RECORD_IRQ
	.comm	_CS4231_TIMER_IRQ,4,2           ## @CS4231_TIMER_IRQ
	.comm	_STATUS,4,2                     ## @STATUS
	.comm	_CS4231_IRQ_ENABLE,4,2          ## @CS4231_IRQ_ENABLE
	.comm	_CS4231_PIN_CTRL,8,3            ## @CS4231_PIN_CTRL
	.no_dead_strip	_snd_wss_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snd_wss_open
_snd_wss_open:                          ; @snd_wss_open
	.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	x21, x1
	mov	x20, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	tst	w8, w21
	b.eq	LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_mutex_unlock
Lloh0:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_2:
Lloh3:
	adrp	x9, _WSS_MODE_OPEN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _WSS_MODE_OPEN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
	ldr	x9, [x20, #24]
	cbnz	x9, LBB0_1
; %bb.4:
	orr	w8, w8, w21
	str	w8, [x20]
	b	LBB0_10
LBB0_5:
	add	x22, x20, #20
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	w8, [x20, #4]
Lloh6:
	adrp	x23, _WSS_HW_AD1848_MASK@GOTPAGE
Lloh7:
	ldr	x23, [x23, _WSS_HW_AD1848_MASK@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_7
; %bb.6:
Lloh8:
	adrp	x24, _CS4231_IRQ_STATUS@GOTPAGE
Lloh9:
	ldr	x24, [x24, _CS4231_IRQ_STATUS@GOTPAGEOFF]
	ldr	x1, [x24]
Lloh10:
	adrp	x8, _CS4231_PLAYBACK_IRQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CS4231_PLAYBACK_IRQ@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _CS4231_RECORD_IRQ@GOTPAGE
Lloh14:
	ldr	x9, [x9, _CS4231_RECORD_IRQ@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh16:
	adrp	x9, _CS4231_TIMER_IRQ@GOTPAGE
Lloh17:
	ldr	x9, [x9, _CS4231_TIMER_IRQ@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_snd_wss_out
	ldr	x1, [x24]
	mov	x0, x20
	mov	w2, #0
	bl	_snd_wss_out
LBB0_7:
Lloh19:
	adrp	x24, _STATUS@GOTPAGE
Lloh20:
	ldr	x24, [x24, _STATUS@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_CS4231P
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_wss_outb
	ldr	w0, [x24]
	bl	_CS4231P
	mov	x1, x0
	mov	x0, x20
	mov	w2, #0
	bl	_wss_outb
Lloh21:
	adrp	x8, _CS4231_IRQ_ENABLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CS4231_IRQ_ENABLE@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	x9, [x20, #8]
Lloh24:
	adrp	x10, _CS4231_PIN_CTRL@GOTPAGE
Lloh25:
	ldr	x10, [x10, _CS4231_PIN_CTRL@GOTPAGEOFF]
Lloh26:
	ldr	x1, [x10]
	lsl	x10, x1, #2
	ldr	w11, [x9, x10]
	orr	w2, w11, w8
	str	w2, [x9, x10]
	mov	x0, x20
	bl	_snd_wss_out
	ldr	w8, [x20, #4]
	ldr	w9, [x23]
	tst	w9, w8
	b.ne	LBB0_9
; %bb.8:
Lloh27:
	adrp	x23, _CS4231_IRQ_STATUS@GOTPAGE
Lloh28:
	ldr	x23, [x23, _CS4231_IRQ_STATUS@GOTPAGEOFF]
	ldr	x1, [x23]
Lloh29:
	adrp	x8, _CS4231_PLAYBACK_IRQ@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CS4231_PLAYBACK_IRQ@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _CS4231_RECORD_IRQ@GOTPAGE
Lloh33:
	ldr	x9, [x9, _CS4231_RECORD_IRQ@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh35:
	adrp	x9, _CS4231_TIMER_IRQ@GOTPAGE
Lloh36:
	ldr	x9, [x9, _CS4231_TIMER_IRQ@GOTPAGEOFF]
Lloh37:
	ldr	w9, [x9]
	orr	w2, w8, w9
	mov	x0, x20
	bl	_snd_wss_out
	ldr	x1, [x23]
	mov	x0, x20
	mov	w2, #0
	bl	_snd_wss_out
LBB0_9:
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	str	w21, [x20]
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w0, #0
LBB0_11:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_WSS_MODE_OPEN,4,2              ; @WSS_MODE_OPEN
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_WSS_HW_AD1848_MASK,4,2         ; @WSS_HW_AD1848_MASK
	.comm	_CS4231_IRQ_STATUS,8,3          ; @CS4231_IRQ_STATUS
	.comm	_CS4231_PLAYBACK_IRQ,4,2        ; @CS4231_PLAYBACK_IRQ
	.comm	_CS4231_RECORD_IRQ,4,2          ; @CS4231_RECORD_IRQ
	.comm	_CS4231_TIMER_IRQ,4,2           ; @CS4231_TIMER_IRQ
	.comm	_STATUS,4,2                     ; @STATUS
	.comm	_CS4231_IRQ_ENABLE,4,2          ; @CS4231_IRQ_ENABLE
	.comm	_CS4231_PIN_CTRL,8,3            ; @CS4231_PIN_CTRL
	.no_dead_strip	_snd_wss_open
.subsections_via_symbols
