	.file	"extr_psc-ac97.c_au1xpsc_ac97_hw_params.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	au1xpsc_ac97_hw_params, @function
au1xpsc_ac97_hw_params:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, QWORD PTR au1xpsc_ac97_workdata[rip]
	call	SUBSTREAM_TYPE@PLT
	mov	rdi, rbp
	mov	r14d, eax
	call	params_channels@PLT
	mov	rdi, rbx
	call	AC97_CFG@PLT
	mov	edi, eax
	call	au_readl@PLT
	mov	rdi, rbx
	movsx	r12, eax
	call	AC97_STAT@PLT
	mov	edi, eax
	call	au_readl@PLT
	mov	rdx, QWORD PTR PSC_AC97STAT_TB[rip]
	or	rdx, QWORD PTR PSC_AC97STAT_RB[rip]
	cdqe
	test	rdx, rax
	je	.L2
	mov	rdi, r12
	call	PSC_AC97CFG_GET_LEN@PLT
	cmp	rax, QWORD PTR 0[rbp]
	je	.L3
.L5:
	mov	r12d, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	neg	r12d
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	r13, QWORD PTR PSC_AC97CFG_LEN_MASK[rip]
	mov	rdi, QWORD PTR 0[rbp]
	call	PSC_AC97CFG_SET_LEN@PLT
	not	r13
	and	r13, r12
	or	r13, rax
	cmp	DWORD PTR PCM_TX[rip], r14d
	je	.L15
	mov	rax, QWORD PTR PSC_AC97CFG_RXSLOT_MASK[rip]
	mov	edi, 3
	not	rax
	and	r13, rax
	call	PSC_AC97CFG_RXSLOT_ENA@PLT
	mov	edi, 4
	mov	r14, rax
	call	PSC_AC97CFG_RXSLOT_ENA@PLT
	or	r14, rax
	or	r13, r14
.L7:
	cmp	r13, r12
	je	.L8
	lea	r14, 16[rbx]
	mov	rdi, r14
	call	mutex_lock@PLT
	mov	rdi, rbx
	call	AC97_CFG@PLT
	mov	rdi, QWORD PTR PSC_AC97CFG_DE_ENABLE[rip]
	mov	esi, eax
	not	rdi
	and	rdi, r13
	call	au_writel@PLT
	xor	eax, eax
	call	au_sync@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L10:
#APP
# 94 "data/fastsocket/kernel/sound/soc/au1x/extr_psc-ac97.c_au1xpsc_ac97_hw_params.c" 1
	nop
# 0 "" 2
#NO_APP
.L9:
	mov	rdi, rbx
	call	AC97_STAT@PLT
	mov	edi, eax
	call	au_readl@PLT
	and	eax, DWORD PTR PSC_AC97STAT_DR[rip]
	mov	r12d, eax
	jne	.L10
	mov	rdi, rbx
	call	AC97_CFG@PLT
	mov	rdi, r13
	mov	esi, eax
	call	au_writel@PLT
	xor	eax, eax
	call	au_sync@PLT
	mov	rdi, rbx
	call	AC97_CFG@PLT
	mov	rdi, QWORD PTR PSC_AC97CFG_DE_ENABLE[rip]
	mov	esi, eax
	or	rdi, r13
	call	au_writel@PLT
	xor	eax, eax
	call	au_sync@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
#APP
# 106 "data/fastsocket/kernel/sound/soc/au1x/extr_psc-ac97.c_au1xpsc_ac97_hw_params.c" 1
	nop
# 0 "" 2
#NO_APP
.L11:
	mov	rdi, rbx
	call	AC97_STAT@PLT
	mov	edi, eax
	call	au_readl@PLT
	test	DWORD PTR PSC_AC97STAT_DR[rip], eax
	je	.L12
	mov	rdi, r14
	call	mutex_unlock@PLT
	mov	QWORD PTR 8[rbx], r13
	mov	rdi, rbp
	call	params_rate@PLT
	mov	QWORD PTR [rbx], rax
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	mov	rbx, QWORD PTR [rbx]
	mov	rdi, rbp
	call	params_rate@PLT
	cmp	rbx, rax
	jne	.L5
.L8:
	xor	r12d, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	rax, QWORD PTR PSC_AC97CFG_TXSLOT_MASK[rip]
	mov	edi, 3
	not	rax
	and	r13, rax
	call	PSC_AC97CFG_TXSLOT_ENA@PLT
	mov	edi, 4
	mov	r14, rax
	call	PSC_AC97CFG_TXSLOT_ENA@PLT
	or	r14, rax
	or	r13, r14
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	au1xpsc_ac97_hw_params, .-au1xpsc_ac97_hw_params
	.comm	au1xpsc_ac97_workdata,8,8
	.comm	PSC_AC97STAT_TB,8,8
	.comm	PSC_AC97STAT_RB,8,8
	.comm	PSC_AC97STAT_DR,4,4
	.comm	PSC_AC97CFG_TXSLOT_MASK,8,8
	.comm	PSC_AC97CFG_RXSLOT_MASK,8,8
	.comm	PSC_AC97CFG_LEN_MASK,8,8
	.comm	PSC_AC97CFG_DE_ENABLE,8,8
	.comm	PCM_TX,4,4
	.comm	EINVAL,4,4
	.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_psc-ac97.c_au1xpsc_ac97_hw_params.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	au1xpsc_ac97_hw_params, %function
au1xpsc_ac97_hw_params:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L16
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r4, [r3]
	mov	r6, r1
	bl	SUBSTREAM_TYPE
	mov	r8, r0
	mov	r0, r6
	bl	params_channels
	mov	r0, r4
	bl	AC97_CFG
	bl	au_readl
	mov	r5, r0
	mov	r0, r4
	bl	AC97_STAT
	bl	au_readl
	ldr	r3, .L16+4
	ldr	r2, .L16+8
	ldr	r3, [r3]
	ldr	r2, [r2]
	orr	r3, r3, r2
	tst	r3, r0
	beq	.L2
	mov	r0, r5
	bl	PSC_AC97CFG_GET_LEN
	ldr	r3, [r6]
	cmp	r0, r3
	beq	.L3
.L5:
	ldr	r3, .L16+12
	ldr	r0, [r3]
	rsb	r10, r0, #0
	mov	r0, r10
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L2:
	ldr	r3, .L16+16
	ldr	r0, [r6]
	ldr	r7, [r3]
	bl	PSC_AC97CFG_SET_LEN
	ldr	r3, .L16+20
	bic	r7, r5, r7
	ldr	r3, [r3]
	orr	r7, r7, r0
	cmp	r3, r8
	beq	.L15
	ldr	r3, .L16+24
	mov	r0, #3
	ldr	r3, [r3]
	bic	r7, r7, r3
	bl	PSC_AC97CFG_RXSLOT_ENA
	mov	r8, r0
	mov	r0, #4
	bl	PSC_AC97CFG_RXSLOT_ENA
	orr	r8, r8, r0
	orr	r7, r8, r7
.L7:
	cmp	r7, r5
	beq	.L8
	add	r8, r4, #8
	mov	r0, r8
	ldr	r9, .L16+28
	bl	mutex_lock
	mov	r0, r4
	ldr	r5, [r9]
	bl	AC97_CFG
	bic	r5, r7, r5
	mov	r1, r0
	mov	r0, r5
	bl	au_writel
	ldr	r5, .L16+32
	bl	au_sync
	b	.L9
.L10:
	.syntax divided
@ 94 "data/fastsocket/kernel/sound/soc/au1x/extr_psc-ac97.c_au1xpsc_ac97_hw_params.c" 1
	nop
@ 0 "" 2
	.arm
	.syntax unified
.L9:
	mov	r0, r4
	bl	AC97_STAT
	bl	au_readl
	ldr	r3, [r5]
	ands	r10, r0, r3
	bne	.L10
	mov	r0, r4
	bl	AC97_CFG
	mov	r1, r0
	mov	r0, r7
	bl	au_writel
	bl	au_sync
	mov	r0, r4
	ldr	r9, [r9]
	bl	AC97_CFG
	orr	r9, r7, r9
	mov	r1, r0
	mov	r0, r9
	bl	au_writel
	bl	au_sync
	b	.L11
.L12:
	.syntax divided
@ 106 "data/fastsocket/kernel/sound/soc/au1x/extr_psc-ac97.c_au1xpsc_ac97_hw_params.c" 1
	nop
@ 0 "" 2
	.arm
	.syntax unified
.L11:
	mov	r0, r4
	bl	AC97_STAT
	bl	au_readl
	ldr	r3, [r5]
	tst	r0, r3
	beq	.L12
	mov	r0, r8
	bl	mutex_unlock
	mov	r0, r6
	str	r7, [r4, #4]
	bl	params_rate
	str	r0, [r4]
	mov	r0, r10
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L3:
	mov	r0, r6
	ldr	r4, [r4]
	bl	params_rate
	cmp	r4, r0
	bne	.L5
.L8:
	mov	r10, #0
	mov	r0, r10
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L15:
	ldr	r3, .L16+36
	mov	r0, #3
	ldr	r3, [r3]
	bic	r7, r7, r3
	bl	PSC_AC97CFG_TXSLOT_ENA
	mov	r8, r0
	mov	r0, #4
	bl	PSC_AC97CFG_TXSLOT_ENA
	orr	r8, r8, r0
	orr	r7, r8, r7
	b	.L7
.L17:
	.align	2
.L16:
	.word	au1xpsc_ac97_workdata
	.word	PSC_AC97STAT_TB
	.word	PSC_AC97STAT_RB
	.word	EINVAL
	.word	PSC_AC97CFG_LEN_MASK
	.word	PCM_TX
	.word	PSC_AC97CFG_RXSLOT_MASK
	.word	PSC_AC97CFG_DE_ENABLE
	.word	PSC_AC97STAT_DR
	.word	PSC_AC97CFG_TXSLOT_MASK
	.size	au1xpsc_ac97_hw_params, .-au1xpsc_ac97_hw_params
	.comm	au1xpsc_ac97_workdata,4,4
	.comm	PSC_AC97STAT_TB,4,4
	.comm	PSC_AC97STAT_RB,4,4
	.comm	PSC_AC97STAT_DR,4,4
	.comm	PSC_AC97CFG_TXSLOT_MASK,4,4
	.comm	PSC_AC97CFG_RXSLOT_MASK,4,4
	.comm	PSC_AC97CFG_LEN_MASK,4,4
	.comm	PSC_AC97CFG_DE_ENABLE,4,4
	.comm	PCM_TX,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
