	.file	"extr_cs5535audio_pcm.c_cs5535audio_build_dma_packets.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	cs5535audio_build_dma_packets, @function
cs5535audio_build_dma_packets:
.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
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	cmp	DWORD PTR CS5535AUDIO_MAX_DESCRIPTORS[rip], ecx
	mov	QWORD PTR 24[rsp], rdi
	mov	QWORD PTR 16[rsp], rdx
	jb	.L14
	cmp	QWORD PTR 32[rsi], 0
	mov	rbp, rsi
	mov	r13d, ecx
	mov	r12d, r8d
	je	.L4
	mov	eax, DWORD PTR 4[rsi]
.L5:
	cmp	r13d, eax
	je	.L16
.L7:
	mov	rax, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR [rax]
	mov	r15d, DWORD PTR [rax]
	test	r13d, r13d
	je	.L10
	lea	eax, -1[r13]
	lea	r14, 3[rax+rax*2]
	lea	rax, 0[0+r14*8]
	xor	r14d, r14d
	mov	QWORD PTR 8[rsp], rax
	.p2align 4,,10
	.p2align 3
.L9:
	mov	rbx, QWORD PTR 32[rbp]
	mov	edi, r15d
	add	r15d, r12d
	call	cpu_to_le32@PLT
	mov	edi, r12d
	add	rbx, r14
	add	r14, 24
	mov	DWORD PTR [rbx], eax
	call	cpu_to_le32@PLT
	mov	edi, DWORD PTR PRD_EOP[rip]
	mov	QWORD PTR 16[rbx], rax
	call	cpu_to_le32@PLT
	mov	QWORD PTR 8[rbx], rax
	cmp	QWORD PTR 8[rsp], r14
	jne	.L9
.L10:
	mov	eax, r13d
	mov	edi, DWORD PTR 24[rbp]
	lea	rdx, [rax+rax*2]
	mov	rax, QWORD PTR 32[rbp]
	lea	rbx, [rax+rdx*8]
	call	cpu_to_le32@PLT
	mov	QWORD PTR 16[rbx], 0
	mov	edi, DWORD PTR PRD_JMP[rip]
	mov	DWORD PTR [rbx], eax
	call	cpu_to_le32@PLT
	lea	edx, 0[r13+r13*2]
	mov	QWORD PTR 8[rbx], rax
	mov	eax, DWORD PTR [rbx]
	lea	edi, [rax+rdx*8]
	call	cpu_to_le32@PLT
	mov	r15, QWORD PTR 24[rsp]
	mov	DWORD PTR 0[rbp], r12d
	mov	rbx, rax
	mov	rax, QWORD PTR 16[rsp]
	mov	DWORD PTR 4[rbp], r13d
	mov	rdi, r15
	mov	QWORD PTR 16[rbp], rax
	call	spin_lock_irq@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, r15
	call	[QWORD PTR 8[rax]]
	mov	rax, QWORD PTR 8[rbp]
	mov	esi, ebx
	mov	rdi, r15
	call	[QWORD PTR [rax]]
	mov	rdi, r15
	call	spin_unlock_irq@PLT
	xor	eax, eax
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L16:
	.cfi_restore_state
	xor	eax, eax
	cmp	DWORD PTR 0[rbp], r12d
	jne	.L7
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	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
.L4:
	.cfi_restore_state
	mov	rax, QWORD PTR CS5535AUDIO_DESC_LIST_SIZE[rip]
	lea	r14, 1[rax]
	mov	rax, QWORD PTR 24[rsp]
	mov	edi, DWORD PTR 4[rax]
	call	snd_dma_pci_data@PLT
	mov	edi, DWORD PTR SNDRV_DMA_TYPE_DEV[rip]
	lea	rcx, 24[rbp]
	mov	rdx, r14
	mov	esi, eax
	call	snd_dma_alloc_pages@PLT
	test	rax, rax
	js	.L14
	mov	QWORD PTR 0[rbp], 0
	xor	eax, eax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	cs5535audio_build_dma_packets, .-cs5535audio_build_dma_packets
	.comm	SNDRV_DMA_TYPE_DEV,4,4
	.comm	PRD_JMP,4,4
	.comm	PRD_EOP,4,4
	.comm	ENOMEM,4,4
	.comm	CS5535AUDIO_MAX_DESCRIPTORS,4,4
	.comm	CS5535AUDIO_DESC_LIST_SIZE,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_cs5535audio_pcm.c_cs5535audio_build_dma_packets.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	cs5535audio_build_dma_packets, %function
cs5535audio_build_dma_packets:
	@ args = 4, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r6, r3
	ldr	r3, .L17
	sub	sp, sp, #12
	ldr	r3, [r3]
	ldr	r7, [sp, #48]
	cmp	r3, r6
	str	r2, [sp, #4]
	bcc	.L14
	ldr	r4, [r1, #20]
	mov	r8, r0
	cmp	r4, #0
	mov	r5, r1
	beq	.L4
	ldr	r3, [r1, #4]
.L5:
	cmp	r6, r3
	beq	.L16
.L7:
	ldr	r3, [sp, #4]
	cmp	r6, #0
	ldr	r3, [r3]
	movne	fp, #0
	ldr	r10, [r3]
	beq	.L10
.L9:
	mov	r0, r10
	ldr	r4, [r5, #20]
	bl	cpu_to_le32
	add	r9, fp, fp, lsl #1
	str	r0, [r4, r9, lsl #2]
	mov	r0, r7
	bl	cpu_to_le32
	ldr	r3, .L17+4
	add	r4, r4, r9, lsl #2
	str	r0, [r4, #8]
	ldr	r0, [r3]
	bl	cpu_to_le32
	add	fp, fp, #1
	cmp	r6, fp
	add	r10, r10, r7
	str	r0, [r4, #4]
	bne	.L9
.L10:
	ldr	r0, [r5, #16]
	ldr	r10, [r5, #20]
	mov	r4, #0
	bl	cpu_to_le32
	add	r9, r6, r6, lsl #1
	ldr	r2, .L17+8
	add	fp, r10, r9, lsl #2
	lsl	r9, r9, #2
	str	r0, [r10, r9]
	ldr	r0, [r2]
	str	r4, [fp, #8]
	bl	cpu_to_le32
	ldr	r3, [r10, r9]
	str	r0, [fp, #4]
	add	r0, r9, r3
	bl	cpu_to_le32
	mov	r9, r0
	ldr	r3, [sp, #4]
	mov	r0, r8
	str	r3, [r5, #12]
	str	r7, [r5]
	str	r6, [r5, #4]
	bl	spin_lock_irq
	ldr	r3, [r5, #8]
	mov	r0, r8
	ldr	r3, [r3, #4]
	blx	r3
	ldr	r3, [r5, #8]
	mov	r1, r9
	ldr	r3, [r3]
	mov	r0, r8
	blx	r3
	mov	r0, r8
	bl	spin_unlock_irq
	mov	r0, r4
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L16:
	ldr	r3, [r5]
	cmp	r3, r7
	moveq	r0, #0
	bne	.L7
	b	.L1
.L4:
	ldr	r3, .L17+12
	ldr	r0, [r0, #4]
	ldr	r9, [r3]
	bl	snd_dma_pci_data
	ldr	r3, .L17+16
	mov	r1, r0
	ldr	r2, [r3]
	mov	r0, r9
	add	r3, r5, #16
	add	r2, r2, #1
	bl	snd_dma_alloc_pages
	cmp	r0, #0
	movge	r3, r4
	strge	r4, [r5, #4]
	strge	r4, [r5]
	bge	.L5
.L14:
	ldr	r3, .L17+20
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L18:
	.align	2
.L17:
	.word	CS5535AUDIO_MAX_DESCRIPTORS
	.word	PRD_EOP
	.word	PRD_JMP
	.word	SNDRV_DMA_TYPE_DEV
	.word	CS5535AUDIO_DESC_LIST_SIZE
	.word	ENOMEM
	.size	cs5535audio_build_dma_packets, .-cs5535audio_build_dma_packets
	.comm	SNDRV_DMA_TYPE_DEV,4,4
	.comm	PRD_JMP,4,4
	.comm	PRD_EOP,4,4
	.comm	ENOMEM,4,4
	.comm	CS5535AUDIO_MAX_DESCRIPTORS,4,4
	.comm	CS5535AUDIO_DESC_LIST_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
