	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_du_plane_setup_scanout
_rcar_du_plane_setup_scanout:           ## @rcar_du_plane_setup_scanout
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movswl	26(%rsi), %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movswl	30(%rsi), %edx
	movl	(%rsi), %r15d
	movq	40(%rsi), %rax
	movq	(%rax), %rax
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	andl	(%rax), %r13d
	movq	8(%rsi), %rax
	movq	_RCAR_DU_PLANE_MEMORY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	jne	LBB0_6
## %bb.1:
	movq	16(%rbx), %rsi
	movq	32(%rbx), %r12
	movl	(%rsi), %ecx
	movq	(%r12), %rax
	movl	(%rax), %eax
	cmpl	$2, %ecx
	je	LBB0_3
## %bb.2:
	shll	$3, %eax
	xorl	%edx, %edx
	divl	4(%rsi)
	testl	%ecx, %ecx
	je	LBB0_7
LBB0_3:
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_drm_fb_cma_get_gem_obj
	movq	8(%r12), %rcx
	movl	(%rcx,%r14,4), %ecx
	addl	(%rax), %ecx
	movl	%ecx, -56(%rbp,%r14,4)
	incq	%r14
	movq	16(%rbx), %rax
	movl	(%rax), %eax
	cmpq	%rax, %r14
	jb	LBB0_4
## %bb.5:
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_7
LBB0_6:
	leaq	24(%rbx), %rdi
	callq	_drm_rect_width
	sarl	$16, %eax
	movq	$0, -56(%rbp)
LBB0_7:
	movq	_PnMWR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %r8d
	testl	%r13d, %r13d
	je	LBB0_9
## %bb.8:
	movq	16(%rbx), %rcx
	cmpl	$32, 4(%rcx)
	sete	%cl
	movl	%eax, %r8d
	shll	%cl, %r8d
LBB0_9:
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%r8d, %ecx
	callq	_rcar_du_plane_write
	movq	_PnSPXR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	callq	_rcar_du_plane_write
	movq	_PnSPYR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %ecx
	testl	%r13d, %r13d
	jne	LBB0_11
## %bb.10:
	movq	16(%rbx), %rax
	xorl	%ecx, %ecx
	cmpl	$32, 4(%rax)
	sete	%cl
	incl	%ecx
LBB0_11:
	movl	-68(%rbp), %r12d                ## 4-byte Reload
	imull	%r12d, %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_rcar_du_plane_write
	movq	_PnDSA0R@GOTPCREL(%rip), %r13
	movl	(%r13), %edx
	movl	-56(%rbp), %ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_rcar_du_plane_write
	movq	16(%rbx), %rax
	cmpl	$2, (%rax)
	jne	LBB0_14
## %bb.12:
	incl	%r15d
	andl	$7, %r15d
	movq	_PnMWR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	callq	_rcar_du_plane_write
	movq	_PnSPXR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	-64(%rbp), %ecx                 ## 4-byte Reload
	callq	_rcar_du_plane_write
	movq	_PnSPYR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	16(%rbx), %rax
	xorl	%ecx, %ecx
	cmpl	$16, 4(%rax)
	sete	%cl
	incl	%ecx
	imull	%r12d, %ecx
	shrl	%ecx
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_rcar_du_plane_write
	movl	(%r13), %edx
	movl	-52(%rbp), %ecx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.13:
	movq	%r14, %rdi
	movl	%r15d, %esi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rcar_du_plane_write            ## TAILCALL
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_RCAR_DU_PLANE_MEMORY,8,3       ## @RCAR_DU_PLANE_MEMORY
	.comm	_PnMWR,4,2                      ## @PnMWR
	.comm	_PnSPXR,4,2                     ## @PnSPXR
	.comm	_PnSPYR,4,2                     ## @PnSPYR
	.comm	_PnDSA0R,4,2                    ## @PnDSA0R
	.no_dead_strip	_rcar_du_plane_setup_scanout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_du_plane_setup_scanout
_rcar_du_plane_setup_scanout:           ; @rcar_du_plane_setup_scanout
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	mov	x19, x0
	ldrsh	w21, [x1, #26]
	ldrsh	w26, [x1, #30]
	ldr	w22, [x1]
	ldr	x8, [x1, #40]
	ldr	x8, [x8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w27, w9, w8
	ldr	x8, [x1, #8]
Lloh3:
	adrp	x9, _RCAR_DU_PLANE_MEMORY@GOTPAGE
Lloh4:
	ldr	x9, [x9, _RCAR_DU_PLANE_MEMORY@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	ldr	x24, [x20, #32]
	ldr	x9, [x20, #16]
	ldr	w8, [x9]
	ldr	x10, [x24]
	ldr	w23, [x10]
	cmp	w8, #2
	b.eq	LBB0_3
; %bb.2:
	lsl	w10, w23, #3
	ldr	w9, [x9, #4]
	udiv	w23, w10, w9
	cbz	w8, LBB0_6
LBB0_3:
	mov	x25, #0
	add	x28, sp, #8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	mov	x1, x25
	bl	_drm_fb_cma_get_gem_obj
	ldr	w8, [x0]
	ldr	x9, [x24, #8]
	lsl	x10, x25, #2
	ldr	w9, [x9, x10]
	add	w8, w9, w8
	str	w8, [x28, x10]
	add	x25, x25, #1
	ldr	x8, [x20, #16]
	ldr	w8, [x8]
	cmp	x25, x8
	b.lo	LBB0_4
	b	LBB0_6
LBB0_5:
	add	x0, x20, #24
	bl	_drm_rect_width
	asr	w23, w0, #16
	str	xzr, [sp, #8]
LBB0_6:
Lloh6:
	adrp	x24, _PnMWR@GOTPAGE
Lloh7:
	ldr	x24, [x24, _PnMWR@GOTPAGEOFF]
	ldr	w2, [x24]
	mov	x3, x23
	cbz	w27, LBB0_8
; %bb.7:
	ldr	x8, [x20, #16]
	ldr	w8, [x8, #4]
	cmp	w8, #32
	cset	w8, eq
	lsl	w3, w23, w8
LBB0_8:
	mov	x0, x19
	mov	x1, x22
	bl	_rcar_du_plane_write
Lloh8:
	adrp	x25, _PnSPXR@GOTPAGE
Lloh9:
	ldr	x25, [x25, _PnSPXR@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x22
	mov	x3, x21
	bl	_rcar_du_plane_write
Lloh10:
	adrp	x28, _PnSPYR@GOTPAGE
Lloh11:
	ldr	x28, [x28, _PnSPYR@GOTPAGEOFF]
	ldr	w2, [x28]
	mov	w8, #1
	cbnz	w27, LBB0_10
; %bb.9:
	ldr	x9, [x20, #16]
	ldr	w9, [x9, #4]
	cmp	w9, #32
	cinc	w8, w8, eq
LBB0_10:
	mul	w3, w8, w26
	mov	x0, x19
	mov	x1, x22
	bl	_rcar_du_plane_write
Lloh12:
	adrp	x27, _PnDSA0R@GOTPAGE
Lloh13:
	ldr	x27, [x27, _PnDSA0R@GOTPAGEOFF]
	ldr	w2, [x27]
	ldr	w3, [sp, #8]
	mov	x0, x19
	mov	x1, x22
	bl	_rcar_du_plane_write
	ldr	x8, [x20, #16]
	ldr	w8, [x8]
	cmp	w8, #2
	b.ne	LBB0_12
; %bb.11:
	add	w8, w22, #1
	and	w22, w8, #0x7
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, x22
	mov	x3, x23
	bl	_rcar_du_plane_write
	ldr	w2, [x25]
	mov	x0, x19
	mov	x1, x22
	mov	x3, x21
	bl	_rcar_du_plane_write
	ldr	w2, [x28]
	ldr	x8, [x20, #16]
	ldr	w8, [x8, #4]
	cmp	w8, #16
	mov	w8, #1
	cinc	w8, w8, eq
	mul	w8, w8, w26
	lsr	w3, w8, #1
	mov	x0, x19
	mov	x1, x22
	bl	_rcar_du_plane_write
	ldr	w2, [x27]
	ldr	w3, [sp, #12]
	mov	x0, x19
	mov	x1, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_rcar_du_plane_write
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_RCAR_DU_PLANE_MEMORY,8,3       ; @RCAR_DU_PLANE_MEMORY
	.comm	_PnMWR,4,2                      ; @PnMWR
	.comm	_PnSPXR,4,2                     ; @PnSPXR
	.comm	_PnSPYR,4,2                     ; @PnSPYR
	.comm	_PnDSA0R,4,2                    ; @PnDSA0R
	.no_dead_strip	_rcar_du_plane_setup_scanout
.subsections_via_symbols
