	.file	"extr_sb_audio.c_sbpro_audio_prepare_for_input.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sbpro_audio_prepare_for_input, @function
sbpro_audio_prepare_for_input:
.LFB0:
	.cfi_startproc
	endbr64
	mov	rax, QWORD PTR audio_devs[rip]
	movsx	rdi, edi
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rdx, QWORD PTR [rax+rdi*8]
	mov	rbx, QWORD PTR 16[rdx]
	mov	rax, QWORD PTR [rbx]
	test	rax, rax
	js	.L2
	mov	rcx, QWORD PTR 8[rbx]
	cmp	rax, rcx
	je	.L2
	cmp	DWORD PTR 16[rbx], 16
	cmovne	rax, rcx
	mov	rcx, QWORD PTR [rdx]
	mov	rdx, QWORD PTR 8[rdx]
	mov	QWORD PTR [rcx], rax
	mov	QWORD PTR [rdx], rax
.L2:
	mov	rax, QWORD PTR 24[rbx]
	cmp	rax, QWORD PTR MDL_JAZZ[rip]
	je	.L4
	xor	ebp, ebp
	cmp	rax, QWORD PTR MDL_SMW[rip]
	je	.L4
.L5:
	lea	r12, 48[rbx]
	xor	esi, esi
	mov	rdi, r12
	call	spin_lock_irqsave@PLT
	mov	esi, 64
	mov	rdi, rbx
	call	sb_dsp_command@PLT
	test	rax, rax
	jne	.L16
.L6:
	mov	esi, DWORD PTR DSP_CMD_SPKOFF[rip]
	mov	rdi, rbx
	call	sb_dsp_command@PLT
	cmp	DWORD PTR 36[rbx], 1
	je	.L17
	or	ebp, -88
	mov	rdi, rbx
	movzx	esi, bpl
	call	sb_dsp_command@PLT
.L8:
	mov	rdi, r12
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	mov	QWORD PTR 40[rbx], 0
	xor	eax, eax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	eax, DWORD PTR AFMT_S16_LE[rip]
	cmp	DWORD PTR 16[rbx], eax
	sete	bpl
	sal	ebp, 2
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L17:
	or	ebp, -96
	mov	rdi, rbx
	movzx	esi, bpl
	call	sb_dsp_command@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L16:
	mov	esi, DWORD PTR 32[rbx]
	mov	rdi, rbx
	call	sb_dsp_command@PLT
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	sbpro_audio_prepare_for_input, .-sbpro_audio_prepare_for_input
	.comm	audio_devs,8,8
	.comm	MDL_SMW,8,8
	.comm	MDL_JAZZ,8,8
	.comm	DSP_CMD_SPKOFF,4,4
	.comm	AFMT_S16_LE,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_sb_audio.c_sbpro_audio_prepare_for_input.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbpro_audio_prepare_for_input, %function
sbpro_audio_prepare_for_input:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L19
	push	{r4, r5, r6, lr}
	ldr	r3, [r3]
	ldr	r2, [r3, r0, lsl #2]
	ldr	r4, [r2, #8]
	ldr	r3, [r4]
	cmp	r3, #0
	blt	.L2
	ldr	r1, [r4, #4]
	cmp	r3, r1
	beq	.L2
	ldr	ip, [r4, #8]
	ldr	r0, [r2]
	cmp	ip, #16
	movne	r3, r1
	ldr	r2, [r2, #4]
	str	r3, [r0]
	str	r3, [r2]
.L2:
	ldr	r2, .L19+4
	ldr	r3, [r4, #12]
	ldr	r2, [r2]
	cmp	r3, r2
	beq	.L4
	ldr	r2, .L19+8
	ldr	r2, [r2]
	cmp	r3, r2
	movne	r5, #0
	beq	.L4
.L5:
	add	r6, r4, #28
	mov	r1, #0
	mov	r0, r6
	bl	spin_lock_irqsave
	mov	r1, #64
	mov	r0, r4
	bl	sb_dsp_command
	cmp	r0, #0
	bne	.L18
.L6:
	ldr	r3, .L19+12
	mov	r0, r4
	ldr	r1, [r3]
	bl	sb_dsp_command
	ldr	r3, [r4, #20]
	mov	r0, r4
	cmp	r3, #1
	orreq	r1, r5, #160
	orrne	r1, r5, #168
	bl	sb_dsp_command
	mov	r0, r6
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r0, #0
	str	r0, [r4, #24]
	pop	{r4, r5, r6, pc}
.L4:
	ldr	r3, .L19+16
	ldr	r5, [r4, #8]
	ldr	r3, [r3]
	cmp	r5, r3
	moveq	r5, #4
	movne	r5, #0
	b	.L5
.L18:
	mov	r0, r4
	ldr	r1, [r4, #16]
	bl	sb_dsp_command
	b	.L6
.L20:
	.align	2
.L19:
	.word	audio_devs
	.word	MDL_JAZZ
	.word	MDL_SMW
	.word	DSP_CMD_SPKOFF
	.word	AFMT_S16_LE
	.size	sbpro_audio_prepare_for_input, .-sbpro_audio_prepare_for_input
	.comm	audio_devs,4,4
	.comm	MDL_SMW,4,4
	.comm	MDL_JAZZ,4,4
	.comm	DSP_CMD_SPKOFF,4,4
	.comm	AFMT_S16_LE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
