	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atmel_hlcdc_plane_atomic_check
_atmel_hlcdc_plane_atomic_check:        ## @atmel_hlcdc_plane_atomic_check
	.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
	callq	_drm_plane_to_atmel_hlcdc_plane
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_drm_plane_state_to_atmel_hlcdc_plane_state
	cmpl	$0, 80(%rax)
	je	LBB0_9
## %bb.1:
	movq	%rax, %r15
	movq	72(%rax), %r13
	testq	%r13, %r13
	je	LBB0_9
## %bb.2:
	movq	(%r14), %r12
	movl	20(%rbx), %esi
	movl	24(%rbx), %edi
	callq	_drm_atomic_get_existing_crtc_state
	movq	%rax, %r14
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$32, %edx
	movl	$1, %r8d
	movl	$1, %r9d
	callq	_drm_atomic_helper_check_plane_state
	testl	%eax, %eax
	jne	LBB0_10
## %bb.3:
	cmpl	$0, 16(%rbx)
	je	LBB0_9
## %bb.4:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%rbx), %r12
	movl	8(%rbx), %eax
	movl	%eax, (%r15)
	movl	12(%rbx), %eax
	movl	%eax, 4(%r15)
	movq	%r12, %rdi
	callq	_drm_rect_width
	movl	%eax, 8(%r15)
	movq	%r12, %rdi
	callq	_drm_rect_height
	movl	%eax, 12(%r15)
	movl	(%rbx), %eax
	movl	%eax, 16(%r15)
	movl	4(%rbx), %eax
	movl	%eax, 20(%r15)
	movq	%rbx, %rdi
	callq	_drm_rect_width
	movl	%eax, 24(%r15)
	movq	%rbx, %rdi
	callq	_drm_rect_height
	movl	%eax, 28(%r15)
	movdqu	(%r15), %xmm0
	pshufd	$238, %xmm0, %xmm1              ## xmm1 = xmm0[2,3,2,3]
	por	%xmm0, %xmm1
	pshufd	$85, %xmm1, %xmm2               ## xmm2 = xmm1[1,1,1,1]
	por	%xmm1, %xmm2
	movd	%xmm2, %eax
	movq	_SUBPIXEL_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_6
## %bb.5:
	psrad	$16, %xmm0
	movdqu	%xmm0, (%r15)
	movq	8(%r13), %r10
	movl	(%r10), %eax
	movl	%eax, 32(%r15)
	movq	_ATMEL_HLCDC_LAYER_MAX_PLANES@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_11
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_10
LBB0_11:
	testl	%eax, %eax
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jle	LBB0_25
## %bb.12:
	movq	16(%r10), %r9
	movq	40(%r15), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	%r9, -64(%rbp)                  ## 8-byte Spill
	movq	%r10, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_15
LBB0_13:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	(%r15), %ecx
	movl	4(%r15), %eax
	cltd
	idivl	%r8d
	movl	%eax, %r8d
	movq	(%r13), %rax
	movl	(%rax,%rbx,4), %edi
	imull	%edi, %r8d
	movl	%ecx, %eax
	cltd
	idivl	%r11d
	movl	%eax, %ecx
	imull	%esi, %ecx
	addl	%r8d, %ecx
	movl	8(%r15), %eax
	cltd
	idivl	%r11d
	imull	%esi, %eax
	subl	%eax, %edi
	movq	48(%r15), %rax
	movl	%edi, (%rax,%rbx,4)
	xorl	%eax, %eax
LBB0_14:                                ##   in Loop: Header=BB0_15 Depth=1
	movq	56(%r15), %rdx
	movl	%eax, (%rdx,%rbx,4)
	movl	%ecx, %eax
	movq	16(%r13), %rcx
	addq	(%rcx,%rbx,8), %rax
	movq	88(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	incq	%rbx
	movslq	32(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_25
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	4(%r10), %r11d
	movl	8(%r10), %r8d
	jmp	LBB0_18
LBB0_17:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	$1, %r11d
	movl	$1, %r8d
LBB0_18:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	(%r9,%rbx,4), %esi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%esi, (%rax,%rbx,4)
	testl	%esi, %esi
	je	LBB0_6
## %bb.19:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	_DRM_MODE_ROTATE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	64(%r15), %eax
	cmpl	$130, %eax
	je	LBB0_23
## %bb.20:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpl	$129, %eax
	je	LBB0_24
## %bb.21:                              ##   in Loop: Header=BB0_15 Depth=1
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.22:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	(%r15), %ecx
	movl	4(%r15), %eax
	cltd
	idivl	%r8d
	movl	%eax, %edi
	movq	(%r13), %r12
	movl	(%r12,%rbx,4), %r9d
	imull	%r9d, %edi
	movl	8(%r15), %eax
	addl	%ecx, %eax
	decl	%eax
	cltd
	idivl	%r11d
	movl	%eax, %ecx
	imull	%esi, %ecx
	addl	%edi, %ecx
	movl	12(%r15), %eax
	decl	%eax
	cltd
	idivl	%r8d
                                        ## kill: def $eax killed $eax def $rax
	imull	%r9d, %eax
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	leal	(%rax,%rsi,2), %eax
	negl	%eax
	movq	48(%r15), %rdx
	movl	%eax, (%rdx,%rbx,4)
	movl	(%r12,%rbx,4), %eax
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	subl	(%rdx,%rbx,4), %eax
	jmp	LBB0_14
LBB0_23:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	12(%r15), %eax
	movl	4(%r15), %ecx
	movl	8(%r15), %edi
	addl	%ecx, %eax
	decl	%eax
	cltd
	idivl	%r8d
	movl	%eax, %r12d
	movq	(%r13), %rax
	movl	(%rax,%rbx,4), %r8d
	imull	%r8d, %r12d
	decl	%edi
	movl	(%r15), %eax
	addl	%edi, %eax
	cltd
	idivl	%r11d
	movl	%eax, %ecx
	imull	%esi, %ecx
	addl	%r12d, %ecx
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movl	%edi, %eax
	cltd
	idivl	%r11d
	decl	%eax
	imull	%esi, %eax
	subl	%r8d, %eax
	movq	48(%r15), %rdx
	movl	%eax, (%rdx,%rbx,4)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%rbx,4), %eax
	addl	%eax, %eax
	negl	%eax
	jmp	LBB0_14
LBB0_24:                                ##   in Loop: Header=BB0_15 Depth=1
	movl	(%r15), %ecx
	movl	12(%r15), %r12d
	decl	%r12d
	movl	4(%r15), %eax
	addl	%r12d, %eax
	cltd
	idivl	%r8d
	movl	%eax, %edi
	movq	(%r13), %r9
	movl	(%r9,%rbx,4), %r10d
	imull	%r10d, %edi
	movl	%ecx, %eax
	cltd
	idivl	%r11d
	movl	%eax, %ecx
	imull	%esi, %ecx
	addl	%edi, %ecx
	movl	%r12d, %eax
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	cltd
	idivl	%r8d
	imull	%r10d, %eax
	movq	-72(%rbp), %r10                 ## 8-byte Reload
	movq	48(%r15), %rdx
	movl	%eax, (%rdx,%rbx,4)
	movl	(%r9,%rbx,4), %eax
	movq	-64(%rbp), %r9                  ## 8-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	addl	(%rdx,%rbx,4), %eax
	negl	%eax
	jmp	LBB0_14
LBB0_25:
	movl	64(%r15), %edi
	callq	_drm_rotation_90_or_270
	testq	%rax, %rax
	je	LBB0_27
## %bb.26:
	rolq	$32, 8(%r15)
LBB0_27:
	cmpl	$0, 4(%r12)
	je	LBB0_34
## %bb.28:
	movl	28(%r15), %eax
LBB0_29:
	cmpl	12(%r15), %eax
	jne	LBB0_32
## %bb.30:
	movl	24(%r15), %eax
	cmpl	8(%r15), %eax
	jne	LBB0_32
LBB0_9:
	xorl	%eax, %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_32:
	cmpl	$0, (%r12)
	je	LBB0_6
## %bb.33:
	movq	72(%r15), %rax
	movq	8(%rax), %rax
	cmpq	$0, 24(%rax)
	movl	$0, %eax
	jne	LBB0_6
	jmp	LBB0_10
LBB0_34:
	movl	(%r14), %eax
	cmpl	24(%r15), %eax
	jne	LBB0_6
## %bb.35:
	movl	4(%r14), %eax
	cmpl	28(%r15), %eax
	jne	LBB0_6
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_SUBPIXEL_MASK,4,2              ## @SUBPIXEL_MASK
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ATMEL_HLCDC_LAYER_MAX_PLANES,4,2 ## @ATMEL_HLCDC_LAYER_MAX_PLANES
	.comm	_DRM_MODE_ROTATE_MASK,4,2       ## @DRM_MODE_ROTATE_MASK
	.no_dead_strip	_atmel_hlcdc_plane_atomic_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atmel_hlcdc_plane_atomic_check
_atmel_hlcdc_plane_atomic_check:        ; @atmel_hlcdc_plane_atomic_check
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	bl	_drm_plane_to_atmel_hlcdc_plane
	mov	x20, x0
	mov	x0, x21
	bl	_drm_plane_state_to_atmel_hlcdc_plane_state
	ldr	x24, [x0, #72]
	ldr	w8, [x0, #80]
	cmp	w8, #0
	ccmp	x24, #0, #4, ne
	b.ne	LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_7
LBB0_2:
	mov	x19, x0
	ldr	x23, [x20]
	ldp	w1, w0, [x21, #20]
	bl	_drm_atomic_get_existing_crtc_state
	mov	x20, x0
Lloh0:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x21
	mov	x1, x20
	mov	w2, #32
	mov	w4, #1
	mov	w5, #1
	bl	_drm_atomic_helper_check_plane_state
	cbnz	w0, LBB0_7
; %bb.3:
	ldr	w8, [x21, #16]
	cbz	w8, LBB0_1
; %bb.4:
	mov	x22, x21
	ldr	d0, [x22, #8]!
	str	d0, [x19]
	mov	x0, x22
	bl	_drm_rect_width
	str	w0, [x19, #8]
	mov	x0, x22
	bl	_drm_rect_height
	str	w0, [x19, #12]
	ldr	d0, [x21]
	str	d0, [x19, #16]
	mov	x0, x21
	bl	_drm_rect_width
	str	w0, [x19, #24]
	mov	x0, x21
	bl	_drm_rect_height
	str	w0, [x19, #28]
	ldp	w11, w8, [x19]
	orr	w12, w8, w11
	ldp	w9, w10, [x19, #8]
	orr	w12, w12, w9
	orr	w12, w12, w10
Lloh3:
	adrp	x13, _SUBPIXEL_MASK@GOTPAGE
Lloh4:
	ldr	x13, [x13, _SUBPIXEL_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w13, [x13]
	tst	w12, w13
	b.ne	LBB0_6
; %bb.5:
	asr	w11, w11, #16
	asr	w8, w8, #16
	stp	w11, w8, [x19]
	asr	w8, w9, #16
	asr	w9, w10, #16
	stp	w8, w9, [x19, #8]
	ldr	x8, [x24, #8]
	ldr	w9, [x8]
	str	w9, [x19, #32]
Lloh6:
	adrp	x10, _ATMEL_HLCDC_LAYER_MAX_PLANES@GOTPAGE
Lloh7:
	ldr	x10, [x10, _ATMEL_HLCDC_LAYER_MAX_PLANES@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	cmp	w9, w10
	b.le	LBB0_8
LBB0_6:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	cmp	w9, #1
	b.lt	LBB0_22
; %bb.9:
	mov	x9, #0
	ldr	x10, [x8, #16]
	ldr	x11, [x19, #40]
Lloh12:
	adrp	x12, _DRM_MODE_ROTATE_MASK@GOTPAGE
Lloh13:
	ldr	x12, [x12, _DRM_MODE_ROTATE_MASK@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w0, #0
	ldp	w1, w17, [x19]
	sdiv	w16, w17, w16
	ldr	x17, [x24]
	ldr	w2, [x17, x13]
	mul	w16, w2, w16
	sdiv	w17, w1, w14
	madd	w17, w17, w15, w16
	ldr	w16, [x19, #8]
	sdiv	w14, w16, w14
	msub	w14, w14, w15, w2
	ldr	x15, [x19, #48]
	str	w14, [x15, x13]
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	x13, [x19, #56]
	str	w0, [x13, x9, lsl #2]
	ldr	x13, [x24, #16]
	lsl	x14, x9, #3
	ldr	x13, [x13, x14]
	add	x13, x13, w17, uxtw
	ldr	x15, [x19, #88]
	str	x13, [x15, x14]
	add	x9, x9, #1
	ldrsw	x13, [x19, #32]
	cmp	x9, x13
	b.ge	LBB0_22
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	cbz	x9, LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldp	w14, w16, [x8, #4]
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w14, #1
	mov	w16, #1
LBB0_15:                                ;   in Loop: Header=BB0_12 Depth=1
	lsl	x13, x9, #2
	ldr	w15, [x10, x13]
	str	w15, [x11, x13]
	cbz	w15, LBB0_6
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w17, [x19, #64]
	ldr	w0, [x12]
	and	w17, w0, w17
	cmp	w17, #130
	b.eq	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	w17, #129
	b.eq	LBB0_21
; %bb.18:                               ;   in Loop: Header=BB0_12 Depth=1
	cmp	w17, #128
	b.ne	LBB0_10
; %bb.19:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x0, [x24]
	ldp	w1, w17, [x19]
	ldp	w2, w3, [x19, #8]
	add	w1, w1, w2
	ldr	w2, [x0, x13]
	sdiv	w17, w17, w16
	mul	w17, w2, w17
	sub	w1, w1, #1
	sub	w3, w3, #1
	sdiv	w16, w3, w16
	mul	w16, w16, w2
	add	w16, w16, w15, lsl #1
	neg	w16, w16
	ldr	x2, [x19, #48]
	str	w16, [x2, x13]
	sdiv	w14, w1, w14
	madd	w17, w14, w15, w17
	ldr	w14, [x0, x13]
	ldr	w13, [x11, x13]
	sub	w0, w14, w13
	b	LBB0_11
LBB0_20:                                ;   in Loop: Header=BB0_12 Depth=1
	ldp	w0, w17, [x19]
	ldp	w2, w1, [x19, #8]
	add	w17, w17, w1
	sub	w17, w17, #1
	sdiv	w16, w17, w16
	ldr	x17, [x24]
	ldr	w1, [x17, x13]
	mul	w16, w1, w16
	sub	w2, w2, #1
	add	w17, w2, w0
	sdiv	w17, w17, w14
	madd	w17, w17, w15, w16
	sdiv	w14, w2, w14
	sub	w14, w14, #1
	neg	w16, w1
	madd	w14, w14, w15, w16
	ldr	x15, [x19, #48]
	str	w14, [x15, x13]
	ldr	w13, [x11, x13]
	neg	w0, w13, lsl #1
	b	LBB0_11
LBB0_21:                                ;   in Loop: Header=BB0_12 Depth=1
	ldr	w17, [x19, #12]
	sub	w0, w17, #1
	ldp	w1, w17, [x19]
	add	w17, w0, w17
	sdiv	w17, w17, w16
	ldr	x2, [x24]
	ldr	w3, [x2, x13]
	mul	w17, w3, w17
	sdiv	w14, w1, w14
	madd	w17, w14, w15, w17
	sdiv	w14, w0, w16
	mul	w14, w14, w3
	ldr	x15, [x19, #48]
	str	w14, [x15, x13]
	ldr	w14, [x2, x13]
	ldr	w13, [x11, x13]
	add	w13, w14, w13
	neg	w0, w13
	b	LBB0_11
LBB0_22:
	ldr	w0, [x19, #64]
	bl	_drm_rotation_90_or_270
	cbz	x0, LBB0_24
; %bb.23:
	ldr	d0, [x19, #8]
	rev64.2s	v0, v0
	str	d0, [x19, #8]
LBB0_24:
	ldr	w8, [x23, #4]
	cbz	w8, LBB0_30
; %bb.25:
	ldr	w8, [x19, #28]
LBB0_26:
	ldr	w9, [x19, #12]
	cmp	w8, w9
	b.ne	LBB0_28
; %bb.27:
	ldr	w8, [x19, #24]
	ldr	w9, [x19, #8]
	cmp	w8, w9
	b.eq	LBB0_1
LBB0_28:
	ldr	w8, [x23]
	cbz	w8, LBB0_6
; %bb.29:
	ldr	x8, [x19, #72]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, #24]
	cbnz	x8, LBB0_6
	b	LBB0_1
LBB0_30:
	ldr	w8, [x20]
	ldr	w9, [x19, #24]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.31:
	ldr	w8, [x20, #4]
	ldr	w9, [x19, #28]
	cmp	w8, w9
	b.ne	LBB0_6
	b	LBB0_26
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_SUBPIXEL_MASK,4,2              ; @SUBPIXEL_MASK
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ATMEL_HLCDC_LAYER_MAX_PLANES,4,2 ; @ATMEL_HLCDC_LAYER_MAX_PLANES
	.comm	_DRM_MODE_ROTATE_MASK,4,2       ; @DRM_MODE_ROTATE_MASK
	.no_dead_strip	_atmel_hlcdc_plane_atomic_check
.subsections_via_symbols
