	.file	"extr_spi-pic32-sqi.c_ring_desc_ring_alloc.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"failed allocating dma buffer\n"
	.text
	.p2align 4
	.type	ring_desc_ring_alloc, @function
ring_desc_ring_alloc:
.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
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rdx, r12
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	eax, DWORD PTR PESQI_BD_COUNT[rip]
	mov	rdi, QWORD PTR 32[rdi]
	mov	ecx, DWORD PTR GFP_KERNEL[rip]
	lea	esi, 0[0+rax*4]
	call	dma_alloc_coherent@PLT
	mov	QWORD PTR 24[r12], rax
	test	rax, rax
	je	.L14
	mov	edx, DWORD PTR GFP_KERNEL[rip]
	mov	edi, DWORD PTR PESQI_BD_COUNT[rip]
	mov	esi, 16
	call	kcalloc@PLT
	mov	QWORD PTR 8[r12], rax
	test	rax, rax
	je	.L15
	lea	r13, 16[r12]
	mov	r14, QWORD PTR 24[r12]
	mov	rdi, r13
	call	INIT_LIST_HEAD@PLT
	lea	rdi, 20[r12]
	call	INIT_LIST_HEAD@PLT
	movsx	rax, DWORD PTR PESQI_BD_COUNT[rip]
	mov	rbx, QWORD PTR 8[r12]
	test	eax, eax
	jle	.L8
	add	rbx, 4
	mov	r15, r14
	xor	ebp, ebp
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rdi, rbx
	call	INIT_LIST_HEAD@PLT
	movsx	rax, DWORD PTR [r12]
	mov	QWORD PTR 4[rbx], r15
	mov	rdi, rbx
	mov	rsi, r13
	add	rbx, 16
	add	r15, 4
	lea	rax, [rax+rbp*4]
	add	rbp, 1
	mov	DWORD PTR -20[rbx], eax
	call	list_add_tail@PLT
	movsx	rax, DWORD PTR PESQI_BD_COUNT[rip]
	cmp	eax, ebp
	jg	.L6
	mov	rcx, QWORD PTR 8[r12]
	cmp	eax, 1
	jle	.L8
	mov	rax, r14
	mov	rdx, r14
	neg	rax
	lea	rdi, [rcx+rax*4]
	xor	ecx, ecx
	.p2align 4,,10
	.p2align 3
.L9:
	mov	eax, DWORD PTR 16[rdi+rdx*4]
	add	ecx, 1
	add	rdx, 4
	mov	DWORD PTR -4[rdx], eax
	movsx	rax, DWORD PTR PESQI_BD_COUNT[rip]
	lea	esi, -1[rax]
	cmp	esi, ecx
	jg	.L9
.L8:
	mov	DWORD PTR -4[r14+rax*4], 0
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L14:
	.cfi_restore_state
	mov	rdi, QWORD PTR 32[r12]
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.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
.L15:
	.cfi_restore_state
	mov	eax, DWORD PTR PESQI_BD_COUNT[rip]
	mov	rdx, QWORD PTR 24[r12]
	mov	rdi, QWORD PTR 32[r12]
	mov	ecx, DWORD PTR [r12]
	lea	esi, 0[0+rax*4]
	call	dma_free_coherent@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	add	rsp, 8
	.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
	.cfi_endproc
.LFE0:
	.size	ring_desc_ring_alloc, .-ring_desc_ring_alloc
	.comm	PESQI_BD_COUNT,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,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_spi-pic32-sqi.c_ring_desc_ring_alloc.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"failed allocating dma buffer\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ring_desc_ring_alloc, %function
ring_desc_ring_alloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r7, .L16
	ldr	r4, .L16+4
	ldr	r1, [r7]
	mov	r5, r0
	mov	r2, r0
	ldr	r3, [r4]
	ldr	r0, [r0, #20]
	lsl	r1, r1, #2
	bl	dma_alloc_coherent
	cmp	r0, #0
	str	r0, [r5, #16]
	beq	.L14
	mov	r1, #12
	ldr	r2, [r4]
	ldr	r0, [r7]
	bl	kcalloc
	cmp	r0, #0
	str	r0, [r5, #4]
	beq	.L15
	add	r9, r5, #8
	mov	r0, r9
	ldr	r8, [r5, #16]
	bl	INIT_LIST_HEAD
	add	r0, r5, #12
	bl	INIT_LIST_HEAD
	ldr	r3, [r7]
	ldr	r4, [r5, #4]
	cmp	r3, #0
	ble	.L8
	mov	r6, r8
	mov	r10, #0
	add	r4, r4, #4
.L6:
	mov	r0, r4
	bl	INIT_LIST_HEAD
	ldr	r3, [r5]
	mov	r0, r4
	add	r3, r3, r10, lsl #2
	str	r6, [r4, #4]
	str	r3, [r4, #-4]
	mov	r1, r9
	bl	list_add_tail
	ldr	r3, [r7]
	add	r10, r10, #1
	cmp	r3, r10
	add	r6, r6, #4
	add	r4, r4, #12
	bgt	.L6
	cmp	r3, #1
	ldr	r1, [r5, #4]
	ble	.L8
	mov	r0, r8
	mov	r2, #0
.L9:
	ldr	r3, [r1, #12]!
	add	r2, r2, #1
	str	r3, [r0], #4
	ldr	r3, [r7]
	sub	ip, r3, #1
	cmp	ip, r2
	bgt	.L9
.L8:
	mov	r2, #0
	sub	r3, r3, #-1073741823
	mov	r0, r2
	str	r2, [r8, r3, lsl #2]
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L14:
	ldr	r0, [r5, #20]
	ldr	r1, .L16+8
	bl	dev_err
	ldr	r3, .L16+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L15:
	ldr	r1, [r7]
	ldr	r3, [r5]
	ldr	r2, [r5, #16]
	ldr	r0, [r5, #20]
	lsl	r1, r1, #2
	bl	dma_free_coherent
	ldr	r3, .L16+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L17:
	.align	2
.L16:
	.word	PESQI_BD_COUNT
	.word	GFP_KERNEL
	.word	.LC0
	.word	ENOMEM
	.size	ring_desc_ring_alloc, .-ring_desc_ring_alloc
	.comm	PESQI_BD_COUNT,4,4
	.comm	GFP_KERNEL,4,4
	.comm	ENOMEM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
