	.file	"extr_ddbridge-core.c_dma_free.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	dma_free, @function
dma_free:
.LFB0:
	.cfi_startproc
	endbr64
	test	rsi, rsi
	je	.L15
	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	eax, DWORD PTR [rsi]
	test	eax, eax
	jle	.L1
	mov	rax, QWORD PTR 8[rsi]
	mov	r13, rdi
	mov	r14d, edx
	xor	ebx, ebx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	test	r14d, r14d
	mov	ecx, DWORD PTR DMA_TO_DEVICE[rip]
	mov	edx, r8d
	mov	rdi, r13
	cmove	ecx, DWORD PTR DMA_FROM_DEVICE[rip]
	call	dma_unmap_single@PLT
	mov	rax, QWORD PTR 8[rbp]
	mov	rdi, QWORD PTR [rax+r12]
	call	kfree@PLT
	mov	rax, QWORD PTR 8[rbp]
	add	r12, rax
	mov	QWORD PTR [r12], 0
.L8:
	mov	QWORD PTR [r12], 0
.L4:
	add	rbx, 1
	cmp	DWORD PTR 0[rbp], ebx
	jle	.L1
.L9:
	mov	rdx, QWORD PTR [rax+rbx*8]
	lea	r12, 0[0+rbx*8]
	test	rdx, rdx
	je	.L4
	mov	rax, QWORD PTR 16[rbp]
	cmp	QWORD PTR alt_dma[rip], 0
	mov	r8d, DWORD PTR 24[rbp]
	mov	esi, DWORD PTR [rax+rbx*4]
	jne	.L19
	mov	ecx, esi
	mov	rdi, r13
	mov	esi, r8d
	call	dma_free_coherent@PLT
	mov	rax, QWORD PTR 8[rbp]
	add	r12, rax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L1:
	pop	rbx
	.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
.L15:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	ret
	.cfi_endproc
.LFE0:
	.size	dma_free, .-dma_free
	.comm	alt_dma,8,8
	.comm	DMA_TO_DEVICE,4,4
	.comm	DMA_FROM_DEVICE,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_ddbridge-core.c_dma_free.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	dma_free, %function
dma_free:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	subs	r5, r1, #0
	popeq	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
	ldr	r1, [r5]
	cmp	r1, #0
	pople	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
	mov	r7, r0
	mov	r8, r2
	mov	r4, #0
	ldr	r3, [r5, #4]
	ldr	r9, .L17
	ldr	fp, .L17+4
	ldr	r10, .L17+8
	b	.L9
.L16:
	cmp	r8, #0
	mov	r2, r0
	ldrne	r3, [r10]
	ldreq	r3, [fp]
	mov	r0, r7
	bl	dma_unmap_single
	ldr	r3, [r5, #4]
	ldr	r0, [r3, r6]
	bl	kfree
	mov	r2, #0
	ldr	r3, [r5, #4]
	str	r2, [r3, r6]
	add	r6, r3, r6
.L8:
	mov	r2, #0
	ldr	r1, [r5]
	str	r2, [r6]
.L4:
	add	r4, r4, #1
	cmp	r1, r4
	pople	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	ldr	r2, [r3, r4, lsl #2]
	lsl	r6, r4, #2
	cmp	r2, #0
	beq	.L4
	ldr	r1, [r9]
	ldr	r3, [r5, #8]
	cmp	r1, #0
	ldr	r0, [r5, #12]
	ldr	r1, [r3, r4, lsl #2]
	bne	.L16
	mov	r3, r1
	mov	r1, r0
	mov	r0, r7
	bl	dma_free_coherent
	ldr	r3, [r5, #4]
	add	r6, r3, r6
	b	.L8
.L18:
	.align	2
.L17:
	.word	alt_dma
	.word	DMA_FROM_DEVICE
	.word	DMA_TO_DEVICE
	.size	dma_free, .-dma_free
	.comm	alt_dma,4,4
	.comm	DMA_TO_DEVICE,4,4
	.comm	DMA_FROM_DEVICE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
