	.file	"extr_hda_intel.c_azx_pcm_open.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	azx_pcm_open, @function
azx_pcm_open:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	snd_pcm_substream_chip@PLT
	mov	rdx, QWORD PTR [r12]
	mov	rbx, QWORD PTR 8[r12]
	mov	rbp, rax
	mov	rax, QWORD PTR 16[rax]
	mov	r15, QWORD PTR 8[rbp]
	mov	r13, QWORD PTR [rax+rdx*8]
	mov	rdi, r15
	call	mutex_lock@PLT
	mov	rsi, r12
	mov	rdi, r15
	call	azx_assign_device@PLT
	test	rax, rax
	je	.L11
	mov	r14, rax
	mov	eax, DWORD PTR 28[r13]
	mov	rdi, rbx
	mov	DWORD PTR 20[rbx], eax
	mov	eax, DWORD PTR 24[r13]
	mov	DWORD PTR 16[rbx], eax
	mov	eax, DWORD PTR 20[r13]
	mov	DWORD PTR 12[rbx], eax
	mov	eax, DWORD PTR 16[r13]
	mov	DWORD PTR 8[rbx], eax
	call	snd_pcm_limit_hw_rates@PLT
	mov	esi, DWORD PTR SNDRV_PCM_HW_PARAM_PERIODS[rip]
	mov	rdi, rbx
	call	snd_pcm_hw_constraint_integer@PLT
	cmp	QWORD PTR 8[r15], 1
	mov	edx, DWORD PTR SNDRV_PCM_HW_PARAM_BUFFER_BYTES[rip]
	mov	rdi, rbx
	sbb	ecx, ecx
	xor	esi, esi
	and	ecx, -124
	sub	ecx, -128
	mov	DWORD PTR 12[rsp], ecx
	call	snd_pcm_hw_constraint_step@PLT
	mov	edx, DWORD PTR SNDRV_PCM_HW_PARAM_PERIOD_BYTES[rip]
	xor	esi, esi
	mov	rdi, rbx
	mov	ecx, DWORD PTR 12[rsp]
	call	snd_pcm_hw_constraint_step@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	snd_hda_power_up_d3wait@PLT
	mov	esi, DWORD PTR 0[rbp]
	mov	rdx, r12
	mov	rdi, r13
	call	[QWORD PTR 0[r13]]
	test	eax, eax
	js	.L12
	mov	rdi, rbx
	call	snd_pcm_limit_hw_rates@PLT
	mov	esi, DWORD PTR 20[rbx]
	xor	edi, edi
	test	esi, esi
	sete	dil
	call	snd_BUG_ON@PLT
	test	rax, rax
	jne	.L7
	mov	ecx, DWORD PTR 16[rbx]
	xor	edi, edi
	test	ecx, ecx
	sete	dil
	call	snd_BUG_ON@PLT
	test	rax, rax
	je	.L13
.L7:
	mov	rdi, r14
	call	azx_release_device@PLT
	mov	esi, DWORD PTR 0[rbp]
	mov	rdx, r12
	mov	rdi, r13
	call	[QWORD PTR 8[r13]]
	mov	edi, DWORD PTR 0[rbp]
	call	snd_hda_power_down@PLT
	mov	rdi, r15
	call	mutex_unlock@PLT
	mov	r8d, DWORD PTR EINVAL[rip]
	neg	r8d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r8d
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L12:
	.cfi_restore_state
	mov	rdi, r14
	mov	DWORD PTR 12[rsp], eax
	call	azx_release_device@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	snd_hda_power_down@PLT
	mov	rdi, r15
	call	mutex_unlock@PLT
	mov	r8d, DWORD PTR 12[rsp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	mov	edx, DWORD PTR 12[rbx]
	xor	edi, edi
	test	edx, edx
	sete	dil
	call	snd_BUG_ON@PLT
	test	rax, rax
	jne	.L7
	mov	eax, DWORD PTR 8[rbx]
	xor	edi, edi
	test	eax, eax
	sete	dil
	call	snd_BUG_ON@PLT
	test	rax, rax
	jne	.L7
	lea	rbp, 4[r15]
	xor	r13d, r13d
	mov	rsi, r13
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	mov	QWORD PTR 8[r14], r12
	mov	rsi, r13
	mov	rdi, rbp
	mov	QWORD PTR [r14], 0
	call	spin_unlock_irqrestore@PLT
	mov	QWORD PTR [rbx], r14
	mov	rdi, r12
	call	snd_pcm_set_sync@PLT
	mov	rdi, r15
	call	mutex_unlock@PLT
	xor	r8d, r8d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rdi, r15
	call	mutex_unlock@PLT
	mov	r8d, DWORD PTR EBUSY[rip]
	neg	r8d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	azx_pcm_open, .-azx_pcm_open
	.comm	azx_pcm_hw,16,16
	.comm	SNDRV_PCM_HW_PARAM_PERIOD_BYTES,4,4
	.comm	SNDRV_PCM_HW_PARAM_PERIODS,4,4
	.comm	SNDRV_PCM_HW_PARAM_BUFFER_BYTES,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,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_hda_intel.c_azx_pcm_open.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	azx_pcm_open, %function
azx_pcm_open:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r6, r0
	bl	snd_pcm_substream_chip
	ldr	r10, [r0, #4]
	ldr	r3, [r0, #8]
	ldr	r2, [r6]
	mov	r5, r0
	mov	r0, r10
	ldr	r7, [r3, r2, lsl #2]
	ldr	r4, [r6, #4]
	bl	mutex_lock
	mov	r1, r6
	mov	r0, r10
	bl	azx_assign_device
	subs	r9, r0, #0
	beq	.L11
	ldr	r2, [r7, #12]
	ldr	r0, [r7, #20]
	ldr	r1, [r7, #16]
	ldr	r3, [r7, #8]
	str	r2, [r4, #8]
	str	r0, [r4, #16]
	str	r1, [r4, #12]
	str	r3, [r4, #4]
	mov	r0, r4
	bl	snd_pcm_limit_hw_rates
	ldr	r3, .L14
	mov	r0, r4
	ldr	r1, [r3]
	bl	snd_pcm_hw_constraint_integer
	ldr	r2, [r10, #8]
	ldr	r3, .L14+4
	cmp	r2, #0
	movne	r8, #128
	moveq	r8, #4
	ldr	r2, [r3]
	mov	r1, #0
	mov	r3, r8
	mov	r0, r4
	bl	snd_pcm_hw_constraint_step
	ldr	r2, .L14+8
	mov	r3, r8
	mov	r1, #0
	ldr	r2, [r2]
	mov	r0, r4
	bl	snd_pcm_hw_constraint_step
	ldr	r0, [r5]
	bl	snd_hda_power_up_d3wait
	mov	r2, r6
	mov	r0, r7
	ldr	r3, [r7]
	ldr	r1, [r5]
	blx	r3
	subs	r8, r0, #0
	blt	.L12
	mov	r0, r4
	bl	snd_pcm_limit_hw_rates
	ldr	r0, [r4, #16]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	snd_BUG_ON
	cmp	r0, #0
	bne	.L7
	ldr	r0, [r4, #12]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	snd_BUG_ON
	cmp	r0, #0
	beq	.L13
.L7:
	mov	r0, r9
	bl	azx_release_device
	ldr	r3, [r7, #4]
	mov	r2, r6
	ldr	r1, [r5]
	mov	r0, r7
	blx	r3
	ldr	r0, [r5]
	bl	snd_hda_power_down
	mov	r0, r10
	bl	mutex_unlock
	ldr	r3, .L14+12
	ldr	r8, [r3]
	rsb	r8, r8, #0
.L1:
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L12:
	mov	r0, r9
	bl	azx_release_device
	ldr	r0, [r5]
	bl	snd_hda_power_down
	mov	r0, r10
	bl	mutex_unlock
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	ldr	r0, [r4, #8]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	snd_BUG_ON
	cmp	r0, #0
	bne	.L7
	ldr	r0, [r4, #4]
	clz	r0, r0
	lsr	r0, r0, #5
	bl	snd_BUG_ON
	subs	r8, r0, #0
	bne	.L7
	mov	r7, #0
	add	r5, r10, #4
	mov	r1, r7
	mov	r0, r5
	bl	spin_lock_irqsave
	mov	r1, r7
	mov	r0, r5
	str	r6, [r9, #4]
	str	r8, [r9]
	bl	spin_unlock_irqrestore
	mov	r0, r6
	str	r9, [r4]
	bl	snd_pcm_set_sync
	mov	r0, r10
	bl	mutex_unlock
	b	.L1
.L11:
	mov	r0, r10
	bl	mutex_unlock
	ldr	r3, .L14+16
	ldr	r8, [r3]
	rsb	r8, r8, #0
	mov	r0, r8
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L15:
	.align	2
.L14:
	.word	SNDRV_PCM_HW_PARAM_PERIODS
	.word	SNDRV_PCM_HW_PARAM_BUFFER_BYTES
	.word	SNDRV_PCM_HW_PARAM_PERIOD_BYTES
	.word	EINVAL
	.word	EBUSY
	.size	azx_pcm_open, .-azx_pcm_open
	.comm	azx_pcm_hw,16,4
	.comm	SNDRV_PCM_HW_PARAM_PERIOD_BYTES,4,4
	.comm	SNDRV_PCM_HW_PARAM_PERIODS,4,4
	.comm	SNDRV_PCM_HW_PARAM_BUFFER_BYTES,4,4
	.comm	EINVAL,4,4
	.comm	EBUSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
