	.file	"extr_k3dma.c_k3_dma_alloc_desc_resource.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"vch %p: sg num %d exceed max %d\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"vch %p: dma alloc fail\n"
	.text
	.p2align 4
	.type	k3_dma_alloc_desc_resource, @function
k3_dma_alloc_desc_resource:
.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
	mov	r13d, edi
	mov	rdi, rsi
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	call	to_k3_chan@PLT
	mov	rdi, QWORD PTR [rbx]
	mov	r14, rax
	call	to_k3_dma@PLT
	movsx	r8, DWORD PTR LLI_BLOCK_SIZE[rip]
	shr	r8, 2
	cmp	r8d, r13d
	jl	.L10
	mov	esi, DWORD PTR GFP_NOWAIT[rip]
	mov	edi, 12
	mov	rbp, rax
	call	kzalloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L1
	mov	esi, DWORD PTR GFP_NOWAIT[rip]
	mov	edi, DWORD PTR 0[rbp]
	lea	rdx, 8[rax]
	call	dma_pool_zalloc@PLT
	mov	DWORD PTR 4[r12], eax
	test	eax, eax
	je	.L11
	mov	DWORD PTR [r12], r13d
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	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
.L10:
	.cfi_restore_state
	mov	rax, QWORD PTR [rbx]
	mov	ecx, r13d
	mov	rdx, r14
	xor	r12d, r12d
	lea	rsi, .LC0[rip]
	mov	edi, DWORD PTR [rax]
	xor	eax, eax
	call	dev_dbg@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, r12
	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
.L11:
	.cfi_restore_state
	mov	rax, QWORD PTR [rbx]
	mov	rdx, r14
	lea	rsi, .LC1[rip]
	mov	edi, DWORD PTR [rax]
	xor	eax, eax
	call	dev_dbg@PLT
	mov	rdi, r12
	xor	r12d, r12d
	call	kfree@PLT
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	k3_dma_alloc_desc_resource, .-k3_dma_alloc_desc_resource
	.comm	LLI_BLOCK_SIZE,4,4
	.comm	GFP_NOWAIT,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_k3dma.c_k3_dma_alloc_desc_resource.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"vch %p: sg num %d exceed max %d\012\000"
	.align	2
.LC1:
	.ascii	"vch %p: dma alloc fail\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	k3_dma_alloc_desc_resource, %function
k3_dma_alloc_desc_resource:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r6, r0
	sub	sp, sp, #12
	mov	r0, r1
	mov	r5, r1
	bl	to_k3_chan
	mov	r7, r0
	ldr	r0, [r5]
	bl	to_k3_dma
	ldr	r3, .L12
	ldr	r3, [r3]
	cmp	r6, r3, lsr #2
	bgt	.L10
	ldr	r9, .L12+4
	mov	r8, r0
	ldr	r1, [r9]
	mov	r0, #12
	bl	kzalloc
	subs	r4, r0, #0
	beq	.L1
	ldr	r0, [r8]
	ldr	r1, [r9]
	add	r2, r4, #8
	bl	dma_pool_zalloc
	cmp	r0, #0
	mov	r8, r0
	str	r0, [r4, #4]
	strne	r6, [r4]
	beq	.L11
.L1:
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L10:
	mov	r4, #0
	ldr	r2, [r5]
	lsr	r1, r3, #2
	ldr	r0, [r2]
	mov	r3, r6
	str	r1, [sp]
	mov	r2, r7
	ldr	r1, .L12+8
	bl	dev_dbg
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L11:
	ldr	r3, [r5]
	mov	r2, r7
	ldr	r0, [r3]
	ldr	r1, .L12+12
	bl	dev_dbg
	mov	r0, r4
	bl	kfree
	mov	r4, r8
	b	.L1
.L13:
	.align	2
.L12:
	.word	LLI_BLOCK_SIZE
	.word	GFP_NOWAIT
	.word	.LC0
	.word	.LC1
	.size	k3_dma_alloc_desc_resource, .-k3_dma_alloc_desc_resource
	.comm	LLI_BLOCK_SIZE,4,4
	.comm	GFP_NOWAIT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
