	.file	"extr_ad1816a_lib.c_snd_ad1816a_capture_prepare.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	snd_ad1816a_capture_prepare, @function
snd_ad1816a_capture_prepare:
.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
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	snd_pcm_substream_chip@PLT
	xor	esi, esi
	mov	rbx, QWORD PTR [r12]
	lea	r13, 8[rax]
	mov	rbp, rax
	mov	rdi, r13
	call	spin_lock_irqsave@PLT
	mov	rdi, r12
	call	snd_pcm_lib_buffer_bytes@PLT
	mov	esi, DWORD PTR AD1816A_CAPTURE_CONFIG[rip]
	xor	ecx, ecx
	mov	rdi, rbp
	mov	DWORD PTR 0[rbp], eax
	mov	edx, DWORD PTR AD1816A_CAPTURE_ENABLE[rip]
	mov	r14d, eax
	or	edx, DWORD PTR AD1816A_CAPTURE_PIO[rip]
	call	snd_ad1816a_out_mask@PLT
	mov	esi, DWORD PTR 12[rbx]
	mov	edi, DWORD PTR 12[rbp]
	mov	edx, r14d
	mov	ecx, DWORD PTR DMA_MODE_READ[rip]
	or	ecx, DWORD PTR DMA_AUTOINIT[rip]
	call	snd_dma_program@PLT
	mov	ecx, DWORD PTR 4[rbp]
	mov	eax, DWORD PTR [rbx]
	test	ecx, ecx
	je	.L2
	imul	eax, eax, 33000
	xor	edx, edx
	div	ecx
.L2:
	mov	esi, DWORD PTR AD1816A_CAPTURE_SAMPLE_RATE[rip]
	mov	rdi, rbp
	mov	edx, eax
	call	snd_ad1816a_write@PLT
	mov	edx, DWORD PTR 4[rbx]
	mov	esi, DWORD PTR 8[rbx]
	mov	rdi, rbp
	call	snd_ad1816a_get_format@PLT
	mov	esi, DWORD PTR AD1816A_CAPTURE_CONFIG[rip]
	mov	rdi, rbp
	mov	edx, DWORD PTR AD1816A_FMT_ALL[rip]
	mov	ecx, eax
	or	edx, DWORD PTR AD1816A_FMT_STEREO[rip]
	call	snd_ad1816a_out_mask@PLT
	mov	rdi, r12
	call	snd_pcm_lib_period_bytes@PLT
	mov	esi, DWORD PTR AD1816A_CAPTURE_BASE_COUNT[rip]
	mov	rdi, rbp
	test	eax, eax
	lea	edx, 3[rax]
	cmovns	edx, eax
	sar	edx, 2
	sub	edx, 1
	call	snd_ad1816a_write@PLT
	mov	rdi, r13
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	xor	eax, eax
	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
	.cfi_endproc
.LFE0:
	.size	snd_ad1816a_capture_prepare, .-snd_ad1816a_capture_prepare
	.comm	DMA_MODE_READ,4,4
	.comm	DMA_AUTOINIT,4,4
	.comm	AD1816A_FMT_STEREO,4,4
	.comm	AD1816A_FMT_ALL,4,4
	.comm	AD1816A_CAPTURE_SAMPLE_RATE,4,4
	.comm	AD1816A_CAPTURE_PIO,4,4
	.comm	AD1816A_CAPTURE_ENABLE,4,4
	.comm	AD1816A_CAPTURE_CONFIG,4,4
	.comm	AD1816A_CAPTURE_BASE_COUNT,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_ad1816a_lib.c_snd_ad1816a_capture_prepare.c"
	.text
	.global	__aeabi_uidiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	snd_ad1816a_capture_prepare, %function
snd_ad1816a_capture_prepare:
	@ 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
	add	r5, r0, #8
	mov	r4, r0
	mov	r1, #0
	mov	r0, r5
	ldr	r7, [r6]
	bl	spin_lock_irqsave
	mov	r0, r6
	bl	snd_pcm_lib_buffer_bytes
	mov	r9, r0
	ldr	r2, .L8
	ldr	r3, .L8+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r8, .L8+8
	orr	r2, r2, r3
	ldr	r1, [r8]
	mov	r3, #0
	str	r0, [r4]
	mov	r0, r4
	bl	snd_ad1816a_out_mask
	ldr	r2, .L8+12
	ldr	r3, .L8+16
	ldr	ip, [r2]
	ldr	r3, [r3]
	mov	r2, r9
	ldr	r1, [r7, #12]
	ldr	r0, [r4, #12]
	orr	r3, ip, r3
	bl	snd_dma_program
	ldr	r1, [r4, #4]
	ldr	r2, [r7]
	cmp	r1, #0
	beq	.L2
	rsb	r0, r2, r2, lsl #5
	add	r2, r2, r0, lsl #2
	add	r2, r2, r2, lsl #5
	lsl	r0, r2, #3
	bl	__aeabi_uidiv
	mov	r2, r0
.L2:
	ldr	r3, .L8+20
	mov	r0, r4
	ldr	r1, [r3]
	bl	snd_ad1816a_write
	ldr	r3, .L8+24
	ldr	r2, .L8+28
	ldr	r3, [r3]
	ldr	r2, [r2]
	ldr	r9, [r8]
	ldr	r1, [r7, #8]
	orr	r8, r3, r2
	mov	r0, r4
	ldr	r2, [r7, #4]
	bl	snd_ad1816a_get_format
	mov	r2, r8
	mov	r1, r9
	mov	r3, r0
	mov	r0, r4
	bl	snd_ad1816a_out_mask
	ldr	r3, .L8+32
	mov	r0, r6
	ldr	r6, [r3]
	bl	snd_pcm_lib_period_bytes
	cmp	r0, #0
	add	r2, r0, #3
	movlt	r0, r2
	asr	r2, r0, #2
	mov	r1, r6
	sub	r2, r2, #1
	mov	r0, r4
	bl	snd_ad1816a_write
	mov	r0, r5
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L9:
	.align	2
.L8:
	.word	AD1816A_CAPTURE_ENABLE
	.word	AD1816A_CAPTURE_PIO
	.word	AD1816A_CAPTURE_CONFIG
	.word	DMA_MODE_READ
	.word	DMA_AUTOINIT
	.word	AD1816A_CAPTURE_SAMPLE_RATE
	.word	AD1816A_FMT_ALL
	.word	AD1816A_FMT_STEREO
	.word	AD1816A_CAPTURE_BASE_COUNT
	.size	snd_ad1816a_capture_prepare, .-snd_ad1816a_capture_prepare
	.comm	DMA_MODE_READ,4,4
	.comm	DMA_AUTOINIT,4,4
	.comm	AD1816A_FMT_STEREO,4,4
	.comm	AD1816A_FMT_ALL,4,4
	.comm	AD1816A_CAPTURE_SAMPLE_RATE,4,4
	.comm	AD1816A_CAPTURE_PIO,4,4
	.comm	AD1816A_CAPTURE_ENABLE,4,4
	.comm	AD1816A_CAPTURE_CONFIG,4,4
	.comm	AD1816A_CAPTURE_BASE_COUNT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
