	.file	"extr_ipu3-css.c_imgu_css_fmt_set.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	imgu_css_fmt_set
	.type	imgu_css_fmt_set, @function
imgu_css_fmt_set:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	mov	r13, rsi
	push	r12
	.cfi_offset 12, -48
	mov	r12, rdx
	push	rbx
	.cfi_offset 3, -56
	mov	ebx, ecx
	sub	rsp, 56
	mov	QWORD PTR -88[rbp], rdi
	movsx	rcx, DWORD PTR IPU3_CSS_RECTS[rip]
	mov	rdi, rsp
	mov	rsi, rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	lea	rax, 15[0+rcx*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rdi, rax
	and	rdx, -16
	mov	rax, rdi
	cmp	rsp, rax
	je	.L3
.L41:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L41
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L42
.L4:
	lea	rax, 15[0+rcx*8]
	mov	rcx, rsp
	mov	r14, rsp
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L6
.L43:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L43
.L6:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L44
.L7:
	mov	rax, QWORD PTR -88[rbp]
	mov	r15, rsp
	mov	rdi, r14
	xor	ecx, ecx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -96[rbp], rax
	test	esi, esi
	jg	.L13
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L45:
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR [rdi], eax
.L12:
	mov	QWORD PTR [r15+rcx*8], rdi
	add	rcx, 1
	add	rdi, 4
	cmp	DWORD PTR IPU3_CSS_RECTS[rip], ecx
	jle	.L14
.L13:
	mov	rax, QWORD PTR [r12+rcx*8]
	test	rax, rax
	jne	.L45
	mov	edx, 4
	xor	esi, esi
	mov	QWORD PTR -80[rbp], rcx
	mov	QWORD PTR -72[rbp], rdi
	call	memset@PLT
	mov	rcx, QWORD PTR -80[rbp]
	mov	rdi, QWORD PTR -72[rbp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L42:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	mov	rdi, QWORD PTR -88[rbp]
	mov	ecx, ebx
	mov	rdx, r15
	mov	rsi, r13
	call	imgu_css_fmt_try@PLT
	test	eax, eax
	js	.L1
	mov	edx, DWORD PTR IPU3_CSS_QUEUES[rip]
	sal	rbx, 4
	xor	r15d, r15d
	add	rbx, QWORD PTR -96[rbp]
	test	edx, edx
	jg	.L15
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L18:
	add	r15, 1
	cmp	DWORD PTR IPU3_CSS_QUEUES[rip], r15d
	jle	.L19
.L15:
	mov	edi, r15d
	call	IPU3_CSS_QUEUE_TO_FLAGS@PLT
	mov	rsi, QWORD PTR 0[r13+r15*8]
	mov	edx, eax
	mov	rax, QWORD PTR 8[rbx]
	lea	rdi, [rax+r15*4]
	call	imgu_css_queue_init@PLT
	test	rax, rax
	je	.L18
	mov	eax, DWORD PTR EINVAL[rip]
	neg	eax
.L1:
	mov	rbx, QWORD PTR -56[rbp]
	xor	rbx, QWORD PTR fs:40
	jne	.L46
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	eax, DWORD PTR IPU3_CSS_RECTS[rip]
	test	eax, eax
	jle	.L17
	mov	rsi, QWORD PTR [rbx]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L21:
	mov	edx, DWORD PTR [r14+rax*4]
	mov	DWORD PTR [rsi+rax*4], edx
	mov	rdx, QWORD PTR [r12+rax*8]
	test	rdx, rdx
	je	.L20
	mov	ecx, DWORD PTR [r14+rax*4]
	mov	DWORD PTR [rdx], ecx
.L20:
	add	rax, 1
	cmp	DWORD PTR IPU3_CSS_RECTS[rip], eax
	jg	.L21
.L17:
	xor	eax, eax
	jmp	.L1
.L44:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L7
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	imgu_css_fmt_set, .-imgu_css_fmt_set
	.comm	IPU3_CSS_RECTS,4,4
	.comm	IPU3_CSS_QUEUES,4,4
	.comm	EINVAL,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_fmt_set.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	imgu_css_fmt_set
	.syntax unified
	.arm
	.fpu softvfp
	.type	imgu_css_fmt_set, %function
imgu_css_fmt_set:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #28
	ldr	r9, .L28
	mov	r6, r1
	ldr	r1, [r9]
	str	r2, [fp, #-56]
	lsl	r4, r1, #2
	add	r2, r4, #7
	bic	r2, r2, #7
	sub	sp, sp, r2
	str	r3, [fp, #-48]
	ldr	r3, .L28+4
	str	sp, [fp, #-52]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	ldr	r3, [r0]
	sub	sp, sp, r2
	cmp	r1, #0
	mov	r2, sp
	str	r3, [fp, #-60]
	ble	.L8
	ldr	r1, [fp, #-56]
	sub	r4, r4, #4
	ldr	r3, [fp, #-52]
	add	r4, r1, r4
	sub	ip, r1, #4
	sub	lr, r2, #4
.L7:
	ldr	r1, [ip, #4]!
	cmp	r1, #0
	ldrne	r1, [r1]
	strbeq	r1, [r3]
	strne	r1, [r3]
	strbeq	r1, [r3, #1]
	strbeq	r1, [r3, #2]
	strbeq	r1, [r3, #3]
	cmp	ip, r4
	str	r3, [lr, #4]!
	add	r3, r3, #4
	bne	.L7
.L8:
	mov	r1, r6
	ldr	r3, [fp, #-48]
	bl	imgu_css_fmt_try
	cmp	r0, #0
	blt	.L1
	ldr	r2, [fp, #-48]
	ldr	r8, .L28+8
	ldr	r3, [fp, #-60]
	add	r7, r3, r2, lsl #3
	ldr	r2, [r8]
	cmp	r2, #0
	movgt	r4, #0
	subgt	r6, r6, #4
	bgt	.L13
	b	.L14
.L12:
	ldr	r2, [r8]
	add	r4, r4, #1
	cmp	r2, r4
	ble	.L14
.L13:
	mov	r0, r4
	ldr	r5, [r7, #4]
	ldr	r10, [r6, #4]!
	bl	IPU3_CSS_QUEUE_TO_FLAGS
	add	r5, r5, r4, lsl #2
	mov	r2, r0
	mov	r1, r10
	mov	r0, r5
	bl	imgu_css_queue_init
	cmp	r0, #0
	beq	.L12
	ldr	r3, .L28+12
	ldr	r0, [r3]
	rsb	r0, r0, #0
.L1:
	ldr	r3, .L28+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L27
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L14:
	ldr	r3, [r9]
	cmp	r3, #0
	ble	.L11
	mov	r2, #0
	ldr	r3, [fp, #-60]
	ldr	r1, [fp, #-48]
	ldr	r0, [r3, r1, lsl #3]
	ldr	r3, [fp, #-52]
	ldr	r1, [fp, #-56]
	sub	r3, r3, #4
	sub	r0, r0, #4
	sub	r7, r1, #4
.L16:
	ldr	r1, [r7, #4]!
	ldr	ip, [r3, #4]!
	cmp	r1, #0
	str	ip, [r0, #4]!
	ldrne	ip, [r3]
	add	r2, r2, #1
	strne	ip, [r1]
	ldr	r1, [r9]
	cmp	r1, r2
	bgt	.L16
.L11:
	mov	r0, #0
	b	.L1
.L27:
	bl	__stack_chk_fail
.L29:
	.align	2
.L28:
	.word	IPU3_CSS_RECTS
	.word	.LC0
	.word	IPU3_CSS_QUEUES
	.word	EINVAL
	.size	imgu_css_fmt_set, .-imgu_css_fmt_set
	.comm	IPU3_CSS_RECTS,4,4
	.comm	IPU3_CSS_QUEUES,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
