	.file	"extr_wss_lib.c_snd_wss_close.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	snd_wss_close, @function
snd_wss_close:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	lea	r12, 16[rdi]
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	mov	rdi, r12
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	mutex_lock@PLT
	mov	esi, ebp
	not	esi
	and	esi, DWORD PTR [rbx]
	mov	DWORD PTR [rbx], esi
	test	DWORD PTR WSS_MODE_OPEN[rip], esi
	jne	.L10
	lea	rbp, 20[rbx]
	xor	r13d, r13d
	mov	rsi, r13
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	mov	eax, DWORD PTR 4[rbx]
	test	DWORD PTR WSS_HW_AD1848_MASK[rip], eax
	je	.L12
.L3:
	mov	edi, DWORD PTR STATUS[rip]
	call	CS4231P@PLT
	xor	edx, edx
	mov	rdi, rbx
	mov	esi, eax
	call	wss_outb@PLT
	mov	edi, DWORD PTR STATUS[rip]
	call	CS4231P@PLT
	xor	edx, edx
	mov	rdi, rbx
	mov	esi, eax
	call	wss_outb@PLT
	mov	rsi, QWORD PTR CS4231_PIN_CTRL[rip]
	mov	rax, QWORD PTR 8[rbx]
	mov	rdi, rbx
	mov	edx, DWORD PTR CS4231_IRQ_ENABLE[rip]
	lea	rax, [rax+rsi*4]
	not	edx
	and	edx, DWORD PTR [rax]
	mov	DWORD PTR [rax], edx
	call	snd_wss_out@PLT
	mov	rdx, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR CS4231_IFACE_CTRL[rip]
	mov	eax, DWORD PTR CS4231_PLAYBACK_ENABLE[rip]
	or	eax, DWORD PTR CS4231_PLAYBACK_PIO[rip]
	or	eax, DWORD PTR CS4231_RECORD_ENABLE[rip]
	or	eax, DWORD PTR CS4231_RECORD_PIO[rip]
	test	DWORD PTR [rdx+rcx*4], eax
	jne	.L13
	mov	eax, DWORD PTR 4[rbx]
	test	DWORD PTR WSS_HW_AD1848_MASK[rip], eax
	je	.L14
.L5:
	mov	edi, DWORD PTR STATUS[rip]
	xor	r13d, r13d
	call	CS4231P@PLT
	xor	edx, edx
	mov	rdi, rbx
	mov	esi, eax
	call	wss_outb@PLT
	mov	edi, DWORD PTR STATUS[rip]
	call	CS4231P@PLT
	xor	edx, edx
	mov	rdi, rbx
	mov	esi, eax
	call	wss_outb@PLT
	mov	rsi, r13
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
	mov	DWORD PTR [rbx], 0
.L10:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, r12
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	mutex_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	mov	rsi, QWORD PTR CS4231_IRQ_STATUS[rip]
	xor	edx, edx
	mov	rdi, rbx
	call	snd_wss_out@PLT
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	xor	r13d, r13d
	mov	rdi, rbp
	mov	rsi, r13
	call	spin_unlock_irqrestore@PLT
	mov	rdi, rbx
	call	snd_wss_mce_up@PLT
	mov	rsi, r13
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	mov	rsi, QWORD PTR CS4231_IFACE_CTRL[rip]
	mov	rax, QWORD PTR 8[rbx]
	mov	rdi, rbx
	mov	edx, DWORD PTR CS4231_PLAYBACK_ENABLE[rip]
	or	edx, DWORD PTR CS4231_PLAYBACK_PIO[rip]
	lea	rax, [rax+rsi*4]
	or	edx, DWORD PTR CS4231_RECORD_ENABLE[rip]
	or	edx, DWORD PTR CS4231_RECORD_PIO[rip]
	not	edx
	and	edx, DWORD PTR [rax]
	mov	DWORD PTR [rax], edx
	call	snd_wss_out@PLT
	mov	rsi, r13
	mov	rdi, rbp
	call	spin_unlock_irqrestore@PLT
	mov	rdi, rbx
	call	snd_wss_mce_down@PLT
	mov	rsi, r13
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	mov	eax, DWORD PTR 4[rbx]
	test	DWORD PTR WSS_HW_AD1848_MASK[rip], eax
	jne	.L5
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	mov	rsi, QWORD PTR CS4231_IRQ_STATUS[rip]
	xor	edx, edx
	mov	rdi, rbx
	call	snd_wss_out@PLT
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	snd_wss_close, .-snd_wss_close
	.comm	WSS_MODE_OPEN,4,4
	.comm	WSS_HW_AD1848_MASK,4,4
	.comm	STATUS,4,4
	.comm	CS4231_RECORD_PIO,4,4
	.comm	CS4231_RECORD_ENABLE,4,4
	.comm	CS4231_PLAYBACK_PIO,4,4
	.comm	CS4231_PLAYBACK_ENABLE,4,4
	.comm	CS4231_PIN_CTRL,8,8
	.comm	CS4231_IRQ_STATUS,8,8
	.comm	CS4231_IRQ_ENABLE,4,4
	.comm	CS4231_IFACE_CTRL,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_wss_lib.c_snd_wss_close.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	snd_wss_close, %function
snd_wss_close:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r0
	mov	r5, r1
	add	r6, r0, #12
	mov	r0, r6
	bl	mutex_lock
	ldr	r2, .L15
	ldr	r3, [r4]
	ldr	r2, [r2]
	bic	r1, r3, r5
	tst	r1, r2
	str	r1, [r4]
	bne	.L11
	ldr	r8, .L15+4
	add	r7, r4, #16
	mov	r0, r7
	mov	r1, #0
	bl	spin_lock_irqsave
	ldr	r3, [r8]
	ldr	r2, [r4, #4]
	ands	r2, r2, r3
	beq	.L12
.L3:
	ldr	r5, .L15+8
	ldr	fp, .L15+12
	ldr	r0, [r5]
	bl	CS4231P
	mov	r2, #0
	mov	r1, r0
	mov	r0, r4
	bl	wss_outb
	ldr	r0, [r5]
	bl	CS4231P
	mov	r2, #0
	mov	r1, r0
	mov	r0, r4
	bl	wss_outb
	ldr	r2, .L15+16
	ldr	r0, [r4, #8]
	ldr	r1, [r2]
	ldr	ip, .L15+20
	ldr	r2, [r0, r1, lsl #2]
	ldr	ip, [ip]
	ldr	r10, .L15+24
	bic	r2, r2, ip
	str	r2, [r0, r1, lsl #2]
	mov	r0, r4
	bl	snd_wss_out
	ldr	r3, .L15+28
	ldr	r0, [fp]
	ldr	r9, .L15+32
	ldr	r1, [r3]
	ldr	lr, [r10]
	ldr	r2, .L15+36
	orr	r1, r1, r0
	ldr	ip, [r9]
	ldr	r0, [r4, #8]
	orr	r1, r1, lr
	ldr	lr, [r2]
	ldr	r0, [r0, ip, lsl #2]
	orr	r1, r1, lr
	tst	r1, r0
	bne	.L13
	ldr	r3, [r8]
	ldr	r2, [r4, #4]
	ands	r2, r2, r3
	beq	.L14
.L5:
	ldr	r0, [r5]
	bl	CS4231P
	mov	r2, #0
	mov	r1, r0
	mov	r0, r4
	bl	wss_outb
	ldr	r0, [r5]
	bl	CS4231P
	mov	r2, #0
	mov	r1, r0
	mov	r0, r4
	bl	wss_outb
	mov	r0, r7
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r3, #0
	mov	r0, r6
	str	r3, [r4]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mutex_unlock
.L14:
	ldr	r3, .L15+40
	mov	r0, r4
	ldr	r1, [r3]
	bl	snd_wss_out
	b	.L5
.L13:
	mov	r1, #0
	mov	r0, r7
	bl	spin_unlock_irqrestore
	mov	r0, r4
	bl	snd_wss_mce_up
	mov	r1, #0
	mov	r0, r7
	bl	spin_lock_irqsave
	ldr	r3, .L15+28
	ldr	ip, [fp]
	ldr	r3, [r3]
	ldr	r2, .L15+36
	ldr	lr, [r10]
	ldr	r1, [r9]
	ldr	r0, [r4, #8]
	orr	r3, r3, ip
	ldr	ip, [r2]
	orr	r2, r3, lr
	ldr	r3, [r0, r1, lsl #2]
	orr	r2, r2, ip
	bic	r2, r3, r2
	str	r2, [r0, r1, lsl #2]
	mov	r0, r4
	bl	snd_wss_out
	mov	r1, #0
	mov	r0, r7
	bl	spin_unlock_irqrestore
	mov	r0, r4
	bl	snd_wss_mce_down
	mov	r1, #0
	mov	r0, r7
	bl	spin_lock_irqsave
	ldr	r3, [r8]
	ldr	r2, [r4, #4]
	ands	r2, r2, r3
	bne	.L5
	b	.L14
.L12:
	ldr	r3, .L15+40
	mov	r0, r4
	ldr	r1, [r3]
	bl	snd_wss_out
	b	.L3
.L11:
	mov	r0, r6
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	mutex_unlock
.L16:
	.align	2
.L15:
	.word	WSS_MODE_OPEN
	.word	WSS_HW_AD1848_MASK
	.word	STATUS
	.word	CS4231_PLAYBACK_PIO
	.word	CS4231_PIN_CTRL
	.word	CS4231_IRQ_ENABLE
	.word	CS4231_RECORD_ENABLE
	.word	CS4231_PLAYBACK_ENABLE
	.word	CS4231_IFACE_CTRL
	.word	CS4231_RECORD_PIO
	.word	CS4231_IRQ_STATUS
	.size	snd_wss_close, .-snd_wss_close
	.comm	WSS_MODE_OPEN,4,4
	.comm	WSS_HW_AD1848_MASK,4,4
	.comm	STATUS,4,4
	.comm	CS4231_RECORD_PIO,4,4
	.comm	CS4231_RECORD_ENABLE,4,4
	.comm	CS4231_PLAYBACK_PIO,4,4
	.comm	CS4231_PLAYBACK_ENABLE,4,4
	.comm	CS4231_PIN_CTRL,4,4
	.comm	CS4231_IRQ_STATUS,4,4
	.comm	CS4231_IRQ_ENABLE,4,4
	.comm	CS4231_IFACE_CTRL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
