	.file	"extr_dma.c_dma_transfer.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	dma_transfer
	.type	dma_transfer, @function
dma_transfer:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, edi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, r8
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	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
	mov	DWORD PTR 12[rsp], edx
	call	HandleToChannel@PLT
	test	rax, rax
	je	.L7
	mov	rbx, QWORD PTR [rax]
	mov	rbp, rax
	sal	rbx, 5
	add	rbx, QWORD PTR DMA_gDeviceAttribute[rip]
	cmp	QWORD PTR 16[rbx], r12
	je	.L4
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r12d
	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
.L4:
	.cfi_restore_state
	mov	edx, DWORD PTR 12[rsp]
	mov	rsi, r12
	mov	r8, r13
	mov	ecx, r14d
	mov	edi, r15d
	call	dma_alloc_descriptors@PLT
	mov	r12d, eax
	test	eax, eax
	jne	.L1
	mov	QWORD PTR [rbx], r13
	xor	eax, eax
	call	timer_get_tick_count@PLT
	mov	edx, DWORD PTR 8[rbx]
	mov	edi, DWORD PTR 8[rbp]
	lea	rsi, 16[rbx]
	mov	DWORD PTR 24[rbx], eax
	call	dmacHw_initiateTransfer@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	r12d, DWORD PTR ENODEV[rip]
	neg	r12d
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	dma_transfer, .-dma_transfer
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.comm	DMA_gDeviceAttribute,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_dma.c_dma_transfer.c"
	.text
	.align	2
	.global	dma_transfer
	.syntax unified
	.arm
	.fpu softvfp
	.type	dma_transfer, %function
dma_transfer:
	@ args = 4, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #12
	mov	r5, r1
	mov	r10, r2
	mov	fp, r3
	mov	r6, r0
	bl	HandleToChannel
	subs	r4, r0, #0
	beq	.L7
	ldr	r3, .L8
	ldr	r9, [r4]
	ldr	r8, [r3]
	add	r7, r8, r9, lsl #4
	ldr	r1, [r7, #8]
	cmp	r1, r5
	beq	.L4
	ldr	r3, .L8+4
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	r3, [sp, #48]
	mov	r2, r10
	str	r3, [sp]
	mov	r0, r6
	mov	r3, fp
	bl	dma_alloc_descriptors
	subs	r5, r0, #0
	bne	.L1
	ldr	r3, [sp, #48]
	str	r3, [r8, r9, lsl #4]
	bl	timer_get_tick_count
	ldr	r2, [r7, #4]
	str	r0, [r7, #12]
	add	r1, r7, #8
	ldr	r0, [r4, #4]
	bl	dmacHw_initiateTransfer
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r3, .L8+8
	ldr	r5, [r3]
	rsb	r5, r5, #0
	mov	r0, r5
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	.align	2
.L8:
	.word	DMA_gDeviceAttribute
	.word	EINVAL
	.word	ENODEV
	.size	dma_transfer, .-dma_transfer
	.comm	ENODEV,4,4
	.comm	EINVAL,4,4
	.comm	DMA_gDeviceAttribute,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
