	.file	"extr_ipu3-css.c_imgu_css_binary_preallocate.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	imgu_css_binary_preallocate, @function
imgu_css_binary_preallocate:
.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
	mov	r13, rdi
	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
	mov	ebx, esi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	edi, DWORD PTR 8[rdi]
	mov	DWORD PTR 12[rsp], esi
	call	dev_get_drvdata@PLT
	mov	ecx, ebx
	mov	r12d, DWORD PTR IMGU_ABI_PARAM_CLASS_CONFIG[rip]
	sal	rcx, 4
	add	rcx, QWORD PTR 0[r13]
	cmp	r12d, DWORD PTR IMGU_ABI_PARAM_CLASS_NUM[rip]
	mov	rbp, rax
	mov	r14, rcx
	jnb	.L3
.L2:
	mov	edx, DWORD PTR IMGU_ABI_NUM_MEMORIES[rip]
	test	edx, edx
	je	.L7
	lea	ebx, -1[r12]
	xor	r15d, r15d
	sal	rbx, 3
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L32:
	add	r15d, 1
	cmp	DWORD PTR IMGU_ABI_NUM_MEMORIES[rip], r15d
	jbe	.L7
.L5:
	mov	rdx, QWORD PTR 8[r14]
	mov	eax, r15d
	mov	rdi, rbp
	mov	rdx, QWORD PTR [rdx+rbx]
	lea	rsi, [rdx+rax*4]
	mov	edx, DWORD PTR CSS_ABI_SIZE[rip]
	call	imgu_dmamap_alloc@PLT
	test	eax, eax
	jne	.L32
.L4:
	mov	esi, DWORD PTR 12[rsp]
	mov	rdi, r13
	call	imgu_css_binary_cleanup@PLT
	mov	eax, DWORD PTR ENOMEM[rip]
	neg	eax
.L1:
	add	rsp, 24
	.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
.L7:
	.cfi_restore_state
	add	r12d, 1
	cmp	DWORD PTR IMGU_ABI_PARAM_CLASS_NUM[rip], r12d
	ja	.L2
.L3:
	mov	eax, DWORD PTR IPU3_CSS_AUX_FRAMES[rip]
	xor	ebx, ebx
	test	eax, eax
	jne	.L8
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L34:
	mov	eax, DWORD PTR IPU3_CSS_AUX_FRAMES[rip]
	add	ebx, 1
	cmp	eax, ebx
	jbe	.L33
.L8:
	mov	rsi, QWORD PTR IPU3_CSS_AUX_FRAME_REF[rip]
	mov	rdx, QWORD PTR [r14]
	mov	eax, ebx
	mov	rdi, rbp
	mov	rdx, QWORD PTR [rdx+rsi*8]
	lea	rsi, [rdx+rax*4]
	mov	edx, DWORD PTR CSS_BDS_SIZE[rip]
	call	imgu_dmamap_alloc@PLT
	test	eax, eax
	jne	.L34
	jmp	.L4
.L33:
	test	eax, eax
	je	.L10
	xor	ebx, ebx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L35:
	add	ebx, 1
	cmp	DWORD PTR IPU3_CSS_AUX_FRAMES[rip], ebx
	jbe	.L10
.L11:
	mov	rsi, QWORD PTR IPU3_CSS_AUX_FRAME_TNR[rip]
	mov	rdx, QWORD PTR [r14]
	mov	eax, ebx
	mov	rdi, rbp
	mov	rdx, QWORD PTR [rdx+rsi*8]
	lea	rsi, [rdx+rax*4]
	mov	edx, DWORD PTR CSS_GDC_SIZE[rip]
	call	imgu_dmamap_alloc@PLT
	test	eax, eax
	jne	.L35
	jmp	.L4
.L10:
	xor	eax, eax
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	imgu_css_binary_preallocate, .-imgu_css_binary_preallocate
	.comm	IPU3_CSS_AUX_FRAME_TNR,8,8
	.comm	IPU3_CSS_AUX_FRAME_REF,8,8
	.comm	IPU3_CSS_AUX_FRAMES,4,4
	.comm	IMGU_ABI_PARAM_CLASS_NUM,4,4
	.comm	IMGU_ABI_PARAM_CLASS_CONFIG,4,4
	.comm	IMGU_ABI_NUM_MEMORIES,4,4
	.comm	ENOMEM,4,4
	.comm	CSS_GDC_SIZE,4,4
	.comm	CSS_BDS_SIZE,4,4
	.comm	CSS_ABI_SIZE,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_ipu3-css.c_imgu_css_binary_preallocate.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	imgu_css_binary_preallocate, %function
imgu_css_binary_preallocate:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r10, r0
	sub	sp, sp, #12
	ldr	r0, [r0, #4]
	mov	r4, r1
	str	r1, [sp, #4]
	bl	dev_get_drvdata
	ldr	r3, .L39
	ldr	r7, [r10]
	ldr	r9, [r3]
	ldr	r3, .L39+4
	mov	r6, r0
	ldr	r3, [r3]
	add	r7, r7, r4, lsl #3
	cmp	r9, r3
	bcs	.L3
	ldr	fp, .L39+8
	ldr	r8, .L39+12
.L2:
	ldr	r3, [fp]
	cmp	r3, #0
	lslne	r5, r9, #2
	movne	r4, #0
	subne	r5, r5, #4
	bne	.L5
	b	.L7
.L35:
	ldr	r3, [fp]
	cmp	r3, r4
	bls	.L7
.L5:
	ldr	r3, [r7, #4]
	mov	r0, r6
	ldr	r1, [r3, r5]
	ldr	r2, [r8]
	add	r1, r1, r4, lsl #2
	bl	imgu_dmamap_alloc
	cmp	r0, #0
	add	r4, r4, #1
	bne	.L35
.L4:
	mov	r0, r10
	ldr	r1, [sp, #4]
	bl	imgu_css_binary_cleanup
	ldr	r3, .L39+16
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r3, .L39+4
	add	r9, r9, #1
	ldr	r3, [r3]
	cmp	r3, r9
	bhi	.L2
.L3:
	ldr	r5, .L39+20
	ldr	r3, [r5]
	cmp	r3, #0
	beq	.L10
	mov	r4, #0
	ldr	r8, .L39+24
	ldr	r9, .L39+28
	b	.L8
.L37:
	ldr	r3, [r5]
	cmp	r3, r4
	bls	.L36
.L8:
	ldr	r1, [r9]
	ldr	r3, [r7]
	mov	r0, r6
	ldr	r1, [r3, r1, lsl #2]
	ldr	r2, [r8]
	add	r1, r1, r4, lsl #2
	bl	imgu_dmamap_alloc
	cmp	r0, #0
	add	r4, r4, #1
	bne	.L37
	b	.L4
.L36:
	cmp	r3, #0
	beq	.L10
	mov	r4, #0
	ldr	r8, .L39+32
	ldr	r9, .L39+36
	b	.L11
.L38:
	ldr	r3, [r5]
	cmp	r3, r4
	bls	.L10
.L11:
	ldr	r1, [r9]
	ldr	r3, [r7]
	mov	r0, r6
	ldr	r1, [r3, r1, lsl #2]
	ldr	r2, [r8]
	add	r1, r1, r4, lsl #2
	bl	imgu_dmamap_alloc
	cmp	r0, #0
	add	r4, r4, #1
	bne	.L38
	b	.L4
.L10:
	mov	r0, #0
	b	.L1
.L40:
	.align	2
.L39:
	.word	IMGU_ABI_PARAM_CLASS_CONFIG
	.word	IMGU_ABI_PARAM_CLASS_NUM
	.word	IMGU_ABI_NUM_MEMORIES
	.word	CSS_ABI_SIZE
	.word	ENOMEM
	.word	IPU3_CSS_AUX_FRAMES
	.word	CSS_BDS_SIZE
	.word	IPU3_CSS_AUX_FRAME_REF
	.word	CSS_GDC_SIZE
	.word	IPU3_CSS_AUX_FRAME_TNR
	.size	imgu_css_binary_preallocate, .-imgu_css_binary_preallocate
	.comm	IPU3_CSS_AUX_FRAME_TNR,4,4
	.comm	IPU3_CSS_AUX_FRAME_REF,4,4
	.comm	IPU3_CSS_AUX_FRAMES,4,4
	.comm	IMGU_ABI_PARAM_CLASS_NUM,4,4
	.comm	IMGU_ABI_PARAM_CLASS_CONFIG,4,4
	.comm	IMGU_ABI_NUM_MEMORIES,4,4
	.comm	ENOMEM,4,4
	.comm	CSS_GDC_SIZE,4,4
	.comm	CSS_BDS_SIZE,4,4
	.comm	CSS_ABI_SIZE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
