	.file	"extr_rcar_du_plane.c_rcar_du_plane_setup_scanout.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	rcar_du_plane_setup_scanout, @function
rcar_du_plane_setup_scanout:
.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, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	movsx	r14d, WORD PTR 26[rsi]
	mov	ebx, DWORD PTR [rsi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	movsx	eax, WORD PTR 30[rsi]
	mov	DWORD PTR 16[rsp], eax
	mov	rax, QWORD PTR 40[rsi]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
	and	eax, DWORD PTR DRM_MODE_FLAG_INTERLACE[rip]
	mov	DWORD PTR 20[rsp], eax
	mov	rax, QWORD PTR RCAR_DU_PLANE_MEMORY[rip]
	cmp	QWORD PTR 8[rsi], rax
	jne	.L2
	mov	rcx, QWORD PTR 32[rsi]
	mov	rsi, QWORD PTR 16[rsi]
	mov	rax, QWORD PTR [rcx]
	mov	edi, DWORD PTR [rsi]
	mov	r12d, DWORD PTR [rax]
	cmp	edi, 2
	je	.L3
	sal	r12d, 3
	xor	edx, edx
	mov	eax, r12d
	div	DWORD PTR 4[rsi]
	mov	r12d, eax
	test	edi, edi
	jne	.L3
.L20:
	mov	r15d, DWORD PTR 32[rsp]
.L4:
	mov	eax, DWORD PTR 20[rsp]
	mov	edx, DWORD PTR PnMWR[rip]
	test	eax, eax
	je	.L6
	mov	rax, QWORD PTR 16[r13]
	mov	ecx, r12d
	cmp	DWORD PTR 4[rax], 32
	jne	.L7
	lea	ecx, [r12+r12]
.L7:
	mov	esi, ebx
	mov	rdi, rbp
	call	rcar_du_plane_write@PLT
	mov	edx, DWORD PTR PnSPXR[rip]
	mov	ecx, r14d
	mov	esi, ebx
	mov	rdi, rbp
	call	rcar_du_plane_write@PLT
	mov	ecx, DWORD PTR 16[rsp]
.L11:
	mov	edx, DWORD PTR PnSPYR[rip]
	mov	esi, ebx
	mov	rdi, rbp
	call	rcar_du_plane_write@PLT
	mov	edx, DWORD PTR PnDSA0R[rip]
	mov	ecx, r15d
	mov	esi, ebx
	mov	rdi, rbp
	call	rcar_du_plane_write@PLT
	mov	rax, QWORD PTR 16[r13]
	cmp	DWORD PTR [rax], 2
	je	.L23
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L21
	add	rsp, 56
	.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
.L3:
	.cfi_restore_state
	lea	rax, 32[rsp]
	xor	r15d, r15d
	mov	QWORD PTR 24[rsp], rax
.L5:
	mov	esi, r15d
	mov	rdi, rcx
	mov	QWORD PTR 8[rsp], rcx
	call	drm_fb_cma_get_gem_obj@PLT
	mov	rcx, QWORD PTR 8[rsp]
	mov	rdx, QWORD PTR 24[rsp]
	mov	eax, DWORD PTR [rax]
	mov	rsi, QWORD PTR 8[rcx]
	add	eax, DWORD PTR [rsi+r15*4]
	mov	DWORD PTR [rdx+r15*4], eax
	mov	rax, QWORD PTR 16[r13]
	add	r15, 1
	cmp	DWORD PTR [rax], r15d
	ja	.L5
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L6:
	mov	ecx, r12d
	mov	esi, ebx
	mov	rdi, rbp
	call	rcar_du_plane_write@PLT
	mov	edx, DWORD PTR PnSPXR[rip]
	mov	ecx, r14d
	mov	esi, ebx
	mov	rdi, rbp
	call	rcar_du_plane_write@PLT
	mov	rax, QWORD PTR 16[r13]
	mov	ecx, DWORD PTR 16[rsp]
	cmp	DWORD PTR 4[rax], 32
	jne	.L11
	lea	ecx, [rcx+rcx]
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L2:
	lea	rdi, 24[rsi]
	xor	r15d, r15d
	call	drm_rect_width@PLT
	mov	DWORD PTR 36[rsp], 0
	sar	eax, 16
	mov	r12d, eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L23:
	lea	r15d, 1[rbx]
	mov	edx, DWORD PTR PnMWR[rip]
	mov	ecx, r12d
	mov	rdi, rbp
	and	r15d, 7
	mov	esi, r15d
	call	rcar_du_plane_write@PLT
	mov	ecx, r14d
	mov	esi, r15d
	mov	rdi, rbp
	mov	edx, DWORD PTR PnSPXR[rip]
	call	rcar_du_plane_write@PLT
	mov	rax, QWORD PTR 16[r13]
	cmp	DWORD PTR 4[rax], 16
	je	.L24
.L9:
	mov	ecx, DWORD PTR 16[rsp]
	mov	edx, DWORD PTR PnSPYR[rip]
	mov	esi, r15d
	mov	rdi, rbp
	shr	ecx
	call	rcar_du_plane_write@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L21
	mov	ecx, DWORD PTR 36[rsp]
	mov	edx, DWORD PTR PnDSA0R[rip]
	mov	esi, r15d
	mov	rdi, rbp
	add	rsp, 56
	.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
	jmp	rcar_du_plane_write@PLT
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	sal	DWORD PTR 16[rsp]
	jmp	.L9
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	rcar_du_plane_setup_scanout, .-rcar_du_plane_setup_scanout
	.comm	RCAR_DU_PLANE_MEMORY,8,8
	.comm	PnSPYR,4,4
	.comm	PnSPXR,4,4
	.comm	PnMWR,4,4
	.comm	PnDSA0R,4,4
	.comm	DRM_MODE_FLAG_INTERLACE,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_rcar_du_plane.c_rcar_du_plane_setup_scanout.c"
	.text
	.global	__aeabi_uidiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	rcar_du_plane_setup_scanout, %function
rcar_du_plane_setup_scanout:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r1
	ldr	r3, [r1, #24]
	ldr	r2, .L24
	ldr	ip, [r3]
	ldr	r3, .L24+4
	ldr	r2, [r2]
	ldr	r1, [r1, #4]
	ldr	r8, [ip]
	ldr	r3, [r3]
	cmp	r1, r2
	ldr	r2, .L24+8
	sub	sp, sp, #28
	and	r3, r8, r3
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	str	r3, [sp, #4]
	ldrsh	r3, [r4, #18]
	mov	r5, r0
	ldrsh	r9, [r4, #14]
	ldr	r6, [r4]
	str	r3, [sp]
	bne	.L2
	ldr	r3, [r4, #8]
	ldr	fp, [r4, #20]
	ldr	r10, [r3]
	ldr	r2, [fp]
	cmp	r10, #2
	ldr	r7, [r2]
	beq	.L3
	lsl	r0, r7, #3
	ldr	r1, [r3, #4]
	bl	__aeabi_uidiv
	cmp	r10, #0
	mov	r7, r0
	bne	.L3
.L20:
	ldr	fp, [sp, #12]
.L4:
	ldr	r3, [sp, #4]
	cmp	r3, #0
	ldr	r3, .L24+12
	ldr	r2, [r3]
	beq	.L6
	ldr	r3, [r4, #8]
	ldr	r3, [r3, #4]
	cmp	r3, #32
	lsleq	r3, r7, #1
	movne	r3, r7
.L7:
	ldr	r10, .L24+16
	mov	r1, r6
	mov	r0, r5
	ldr	r8, .L24+20
	bl	rcar_du_plane_write
	mov	r3, r9
	ldr	r2, [r10]
	mov	r1, r6
	mov	r0, r5
	bl	rcar_du_plane_write
	ldr	r2, [r8]
	ldr	r3, [sp]
.L11:
	mov	r1, r6
	mov	r0, r5
	bl	rcar_du_plane_write
	ldr	r2, .L24+24
	mov	r3, fp
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [r2]
	bl	rcar_du_plane_write
	ldr	r3, [r4, #8]
	ldr	r3, [r3]
	cmp	r3, #2
	beq	.L23
	ldr	r3, .L24+8
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	mov	r10, #0
	add	r8, sp, #12
.L5:
	mov	r1, r10
	mov	r0, fp
	bl	drm_fb_cma_get_gem_obj
	ldr	r3, [fp, #4]
	ldr	r2, [r4, #8]
	ldr	r3, [r3, r10, lsl #2]
	ldr	r1, [r0]
	ldr	r2, [r2]
	add	r10, r10, #1
	add	r3, r3, r1
	cmp	r2, r10
	str	r3, [r8], #4
	bhi	.L5
	b	.L20
.L6:
	ldr	r10, .L24+16
	mov	r3, r7
	mov	r1, r6
	mov	r0, r5
	bl	rcar_du_plane_write
	mov	r3, r9
	ldr	r2, [r10]
	mov	r1, r6
	mov	r0, r5
	bl	rcar_du_plane_write
	ldr	r3, [r4, #8]
	ldr	r8, .L24+20
	ldr	r3, [r3, #4]
	ldr	r2, [r8]
	cmp	r3, #32
	ldr	r3, [sp]
	lsleq	r3, r3, #1
	b	.L11
.L2:
	add	r0, r4, #12
	bl	drm_rect_width
	mov	r3, #0
	asr	r7, r0, #16
	mov	fp, r3
	str	r3, [sp, #16]
	b	.L4
.L23:
	ldr	r2, .L24+12
	add	r6, r6, #1
	and	r6, r6, #7
	mov	r3, r7
	mov	r1, r6
	ldr	r2, [r2]
	mov	r0, r5
	bl	rcar_du_plane_write
	mov	r3, r9
	mov	r1, r6
	ldr	r2, [r10]
	mov	r0, r5
	bl	rcar_du_plane_write
	ldr	r3, [r4, #8]
	ldr	r2, [r8]
	ldr	r3, [r3, #4]
	mov	r1, r6
	cmp	r3, #16
	ldreq	r3, [sp]
	mov	r0, r5
	lsleq	r3, r3, #1
	streq	r3, [sp]
	ldr	r3, [sp]
	lsr	r3, r3, #1
	bl	rcar_du_plane_write
	ldr	r3, .L24+8
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r1, r6
	mov	r0, r5
	ldr	r3, .L24+24
	ldr	r2, [r3]
	ldr	r3, [sp, #16]
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	rcar_du_plane_write
.L21:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	RCAR_DU_PLANE_MEMORY
	.word	DRM_MODE_FLAG_INTERLACE
	.word	.LC0
	.word	PnMWR
	.word	PnSPXR
	.word	PnSPYR
	.word	PnDSA0R
	.size	rcar_du_plane_setup_scanout, .-rcar_du_plane_setup_scanout
	.comm	RCAR_DU_PLANE_MEMORY,4,4
	.comm	PnSPYR,4,4
	.comm	PnSPXR,4,4
	.comm	PnMWR,4,4
	.comm	PnDSA0R,4,4
	.comm	DRM_MODE_FLAG_INTERLACE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
