	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rcar_du_crtc_update_planes
_rcar_du_crtc_update_planes:            ## @rcar_du_crtc_update_planes
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_RCAR_DU_NUM_HW_PLANES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	8(%r13), %rax
	movq	24(%r13), %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%rax)
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.6:
	leaq	16(%r13), %rbx
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%r12d, %r12d
	movq	%rbx, -104(%rbp)                ## 8-byte Spill
	jmp	LBB0_7
LBB0_10:                                ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r15d, %r15d
LBB0_16:                                ##   in Loop: Header=BB0_7 Depth=1
	incl	%esi
	movl	%r15d, %eax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rdi, (%r14,%rax,8)
	movq	%rsi, %rbx
	callq	_plane_format
	movq	%rbx, %rsi
	movl	(%rax), %eax
	leal	(%r12,%rax,4), %r12d
	movq	8(%r13), %rax
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-104(%rbp), %rbx                ## 8-byte Reload
LBB0_17:                                ##   in Loop: Header=BB0_7 Depth=1
	incq	%rdi
	movl	(%rax), %ecx
	cmpq	%rcx, %rdi
	jae	LBB0_2
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	movq	32(%rax), %rcx
	movq	(%rcx,%rdi,8), %rdx
	cmpq	%rbx, 8(%rdx)
	jne	LBB0_17
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$0, (%rdx)
	je	LBB0_17
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rdi,8), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%esi, %esi
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	movl	%esi, %r15d
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	leal	-1(%rsi), %r13d
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r14,%r13,8), %rbx
	movq	%rbx, %rdi
	callq	_plane_zpos
	movq	%rax, %r12
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_plane_zpos
	cmpq	%rax, %r12
	jle	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=2
	movq	%rbx, (%r14,%r15,8)
	decq	%r15
	decq	%r13
	testl	%r15d, %r15d
	jne	LBB0_12
## %bb.14:                              ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r15d, %r15d
LBB0_15:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	jmp	LBB0_16
LBB0_2:
	testl	%esi, %esi
	je	LBB0_1
## %bb.3:
	movl	%esi, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %r15
	xorl	%r12d, %r12d
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
	xorl	%r13d, %r13d
	movq	%r14, -112(%rbp)                ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	andl	$7, %r14d
	addl	$-8, %r15d
	leal	1(%r14), %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	orl	%eax, %ebx
	btsl	%r14d, %r13d
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movl	%r15d, %eax
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%r12
	movl	%eax, %r15d
	movl	%ebx, %r13d
	cmpq	%r12, -64(%rbp)                 ## 8-byte Folded Reload
	movq	-112(%rbp), %r14                ## 8-byte Reload
	je	LBB0_20
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14,%r12,8), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rdi
	callq	_to_rcar_plane_state
	movl	(%rax), %eax
	leal	-4(%r15), %ecx
	leal	1(%rax), %r14d
	movl	%r14d, %ebx
	movl	%ecx, -72(%rbp)                 ## 4-byte Spill
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %ebx
	orl	%r13d, %ebx
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	btsl	%eax, %r13d
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_plane_format
	cmpl	$2, (%rax)
	je	LBB0_18
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%r13d, -56(%rbp)                ## 4-byte Spill
	movl	-72(%rbp), %eax                 ## 4-byte Reload
	jmp	LBB0_19
LBB0_1:
	xorl	%ebx, %ebx
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
LBB0_20:
	movl	%ebx, %r12d
	movq	_RCAR_DU_FEATURE_VSP1_SOURCE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_rcar_du_has
	testq	%rax, %rax
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_25
## %bb.21:
	movq	(%r15), %rax
	cmpl	$2, (%rax)
	movl	(%r14), %ecx
	jg	LBB0_23
## %bb.22:
	movl	%ecx, %edx
	shrl	$31, %edx
	addl	%ecx, %edx
	andl	$-2, %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	negl	%edx
	leal	(%rcx,%rdx), %r12d
	incl	%r12d
	movl	$1, %ebx
	movl	%eax, %ecx
	jmp	LBB0_24
LBB0_23:
	addl	%ecx, %ecx
	andl	$2, %ecx
	leal	1(%rcx), %r12d
	movl	$1, %ebx
                                        ## kill: def $cl killed $cl killed $rcx
LBB0_24:
	shll	%cl, %ebx
LBB0_25:
	movq	8(%r14), %rdi
	addq	$8, %rdi
	callq	_mutex_lock
	movq	8(%r14), %rdi
	movl	4(%rdi), %eax
	movl	%eax, %ecx
	orl	%ebx, %ecx
	notl	%ebx
	andl	%eax, %ebx
	testb	$1, (%r14)
	cmovnel	%ecx, %ebx
	cmpl	%eax, %ebx
	je	LBB0_28
## %bb.26:
	movq	_DPTSR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	shll	$16, %edx
	orl	%ebx, %edx
	callq	_rcar_du_group_write
	movq	8(%r14), %rdi
	movl	%ebx, 4(%rdi)
	cmpq	$0, 24(%rdi)
	je	LBB0_28
## %bb.27:
	callq	_rcar_du_group_restart
	movq	8(%r14), %rdi
LBB0_28:
	cmpq	$0, 16(%rdi)
	je	LBB0_30
## %bb.29:
	callq	_rcar_du_group_restart
	movq	8(%r14), %rdi
LBB0_30:
	addq	$8, %rdi
	callq	_mutex_unlock
	testb	$1, (%r14)
	jne	LBB0_31
## %bb.32:
	movq	_DS1PR@GOTPCREL(%rip), %rax
	jmp	LBB0_33
LBB0_31:
	movq	_DS2PR@GOTPCREL(%rip), %rax
LBB0_33:
	movq	8(%r14), %rdi
	movl	(%rax), %esi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_34
## %bb.35:
	movl	%r12d, %edx
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rcar_du_group_write            ## TAILCALL
LBB0_34:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_RCAR_DU_NUM_HW_PLANES,4,2      ## @RCAR_DU_NUM_HW_PLANES
	.comm	_RCAR_DU_FEATURE_VSP1_SOURCE,4,2 ## @RCAR_DU_FEATURE_VSP1_SOURCE
	.comm	_DPTSR,4,2                      ## @DPTSR
	.comm	_DS2PR,4,2                      ## @DS2PR
	.comm	_DS1PR,4,2                      ## @DS1PR
	.no_dead_strip	_rcar_du_crtc_update_planes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rcar_du_crtc_update_planes
_rcar_du_crtc_update_planes:            ; @rcar_du_crtc_update_planes
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	sub	sp, sp, #32
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _RCAR_DU_NUM_HW_PLANES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RCAR_DU_NUM_HW_PLANES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x24, x9, x8
	mov	sp, x24
	ldr	x28, [x0, #24]
	ldr	x8, [x0, #8]
	ldr	w9, [x8]
	stur	x0, [x29, #-96]                 ; 8-byte Folded Spill
	cbz	w9, LBB0_16
; %bb.1:
	stur	x28, [x29, #-104]               ; 8-byte Folded Spill
	mov	x27, #0
	mov	w26, #0
	mov	w25, #0
	add	x28, x19, #16
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x20, #0
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w26, w26, #1
	str	x21, [x24, w20, uxtw #3]
	mov	x0, x21
	bl	_plane_format
	ldr	w8, [x0]
	add	w25, w25, w8, lsl #2
	ldr	x8, [x19, #8]
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x27, x27, #1
	ldr	w9, [x8]
	cmp	x27, x9
	b.hs	LBB0_13
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	x9, [x8, #32]
	add	x21, x9, x27, lsl #3
	ldr	x9, [x21]
	ldr	x10, [x9, #8]
	cmp	x10, x28
	b.ne	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w9, [x9]
	cbz	w9, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cbz	w26, LBB0_2
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w20, w26
	sub	w8, w26, #1
	lsl	x19, x8, #3
LBB0_9:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x22, [x24, x19]
	mov	x0, x22
	bl	_plane_zpos
	mov	x23, x0
	mov	x0, x21
	bl	_plane_zpos
	cmp	x23, x0
	b.le	LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	str	x22, [x24, x20, lsl #3]
	sub	x19, x19, #8
	sub	x8, x20, #1
	mov	x20, x8
	cbnz	w8, LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x20, #0
LBB0_12:                                ;   in Loop: Header=BB0_5 Depth=1
	ldur	x19, [x29, #-96]                ; 8-byte Folded Reload
	b	LBB0_3
LBB0_13:
	cbz	w26, LBB0_17
; %bb.14:
	mov	w23, #0
	mov	w21, #0
	mov	w27, #1
	mov	w26, w26
	ldur	x28, [x29, #-104]               ; 8-byte Folded Reload
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x24], #8
	ldr	x0, [x22]
	bl	_to_rcar_plane_state
	ldr	w8, [x0]
	sub	w19, w25, #4
	add	w20, w8, #1
	lsl	w9, w20, w19
	orr	w21, w9, w21
	lsl	w8, w27, w8
	orr	w23, w8, w23
	mov	x0, x22
	bl	_plane_format
	ldr	w8, [x0]
	and	w9, w20, #0x7
	sub	w10, w25, #8
	add	w11, w9, #1
	lsl	w11, w11, w10
	orr	w11, w11, w21
	lsl	w9, w27, w9
	orr	w9, w9, w23
	cmp	w8, #2
	csel	w21, w21, w11, ne
	csel	w25, w19, w10, ne
	csel	w23, w23, w9, ne
	subs	x26, x26, #1
	b.ne	LBB0_15
	b	LBB0_18
LBB0_16:
	mov	w21, #0
	mov	w23, #0
	b	LBB0_18
LBB0_17:
	mov	w21, #0
	mov	w23, #0
	ldur	x28, [x29, #-104]               ; 8-byte Folded Reload
LBB0_18:
Lloh8:
	adrp	x8, _RCAR_DU_FEATURE_VSP1_SOURCE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RCAR_DU_FEATURE_VSP1_SOURCE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x28
	bl	_rcar_du_has
	ldur	x20, [x29, #-96]                ; 8-byte Folded Reload
	cbz	x0, LBB0_20
; %bb.19:
	ldr	x8, [x28]
	ldr	w8, [x8]
	ldr	w9, [x20]
	ands	w10, w9, #0x1
	mov	w11, #3
	csinc	w11, w11, wzr, ne
	lsl	w10, w10, #1
	mov	w12, #1
	lsl	w10, w12, w10
	and	w13, w9, #0x1
	cmp	w9, #0
	cneg	w9, w13, lt
	lsl	w12, w12, w9
	cmp	w8, #2
	csel	w23, w10, w12, gt
	csinc	w21, w11, w9, gt
LBB0_20:
	ldr	x8, [x20, #8]
	add	x0, x8, #8
	bl	_mutex_lock
	ldr	x0, [x20, #8]
	ldr	w8, [x0, #4]
	orr	w9, w8, w23
	bic	w10, w8, w23
	ldrb	w11, [x20]
	tst	w11, #0x1
	csel	w19, w10, w9, eq
	cmp	w19, w8
	b.eq	LBB0_23
; %bb.21:
Lloh11:
	adrp	x8, _DPTSR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DPTSR@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	orr	w2, w19, w19, lsl #16
	bl	_rcar_du_group_write
	ldr	x0, [x20, #8]
	str	w19, [x0, #4]
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_23
; %bb.22:
	bl	_rcar_du_group_restart
	ldr	x0, [x20, #8]
LBB0_23:
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_25
; %bb.24:
	bl	_rcar_du_group_restart
	ldr	x0, [x20, #8]
LBB0_25:
	add	x0, x0, #8
	bl	_mutex_unlock
	ldr	x0, [x20, #8]
	ldr	w8, [x20]
Lloh14:
	adrp	x9, _DS2PR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _DS2PR@GOTPAGEOFF]
Lloh16:
	adrp	x10, _DS1PR@GOTPAGE
Lloh17:
	ldr	x10, [x10, _DS1PR@GOTPAGEOFF]
	tst	w8, #0x1
	csel	x8, x10, x9, eq
	ldr	w1, [x8]
	ldur	x8, [x29, #-88]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.26:
	mov	x2, x21
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_rcar_du_group_write
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_RCAR_DU_NUM_HW_PLANES,4,2      ; @RCAR_DU_NUM_HW_PLANES
	.comm	_RCAR_DU_FEATURE_VSP1_SOURCE,4,2 ; @RCAR_DU_FEATURE_VSP1_SOURCE
	.comm	_DPTSR,4,2                      ; @DPTSR
	.comm	_DS2PR,4,2                      ; @DS2PR
	.comm	_DS1PR,4,2                      ; @DS1PR
	.no_dead_strip	_rcar_du_crtc_update_planes
.subsections_via_symbols
