	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armada_drm_plane_calc          ## -- Begin function armada_drm_plane_calc
	.p2align	4, 0x90
_armada_drm_plane_calc:                 ## @armada_drm_plane_calc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	8(%rdi), %r15
	movq	16(%r15), %r13
	movl	(%r13), %r12d
	movswl	2(%rdi), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movswl	6(%rdi), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_drm_fb_obj
	movq	(%rax), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	(%r15), %rax
	movl	(%rax), %esi
	movq	8(%r13), %rax
	movl	(%rax), %r8d
	shll	$3, %r8d
	leaq	L_.str(%rip), %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	callq	_DRM_DEBUG_KMS
	cmpl	$3, %r12d
	movl	$3, %ecx
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	cmovbl	%r12d, %ecx
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	(%r15), %r8
	movq	8(%r15), %r11
	movq	(%r11), %rsi
	addq	%r12, %rsi
	movl	(%r8), %r9d
	movl	%r9d, %edi
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	imull	%eax, %edi
	addq	%rsi, %rdi
	movq	8(%r13), %r10
	movl	(%r10), %edx
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	imull	%esi, %edx
	addq	%rdi, %rdx
	movq	%rdx, (%rbx)
	movl	%r9d, (%r14)
	xorl	%edx, %edx
	divl	16(%r13)
	movl	%eax, %r9d
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	20(%r13)
	movl	$1, %edx
	cmpl	$2, %ecx
	jb	LBB0_12
## %bb.1:
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r13d
	leaq	-1(%r13), %rcx
	movl	$1, %edx
	cmpq	$2, %rcx
	jb	LBB0_8
## %bb.2:
	movq	%rbx, %rdi
	subq	%r11, %rdi
	cmpq	$16, %rdi
	jb	LBB0_8
## %bb.3:
	leaq	4(%r14), %r15
	movq	%r15, %rdi
	subq	%r8, %rdi
	addq	$-4, %rdi
	cmpq	$8, %rdi
	jb	LBB0_8
## %bb.4:
	subq	%r10, %r15
	addq	$-4, %r15
	cmpq	$8, %r15
	jb	LBB0_8
## %bb.5:
	movq	%rcx, %r15
	andq	$-2, %r15
	movq	%rcx, %rdx
	orq	$1, %rdx
	movq	%r12, %xmm0
	pshufd	$68, %xmm0, %xmm0               ## xmm0 = xmm0[0,1,0,1]
	movd	%r9d, %xmm1
	pshufd	$80, %xmm1, %xmm1               ## xmm1 = xmm1[0,0,1,1]
	movd	%eax, %xmm2
	pshufd	$80, %xmm2, %xmm2               ## xmm2 = xmm2[0,0,1,1]
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movdqu	8(%r11,%rdi,8), %xmm3
	paddq	%xmm0, %xmm3
	movq	4(%r8,%rdi,4), %rsi
	movq	%rsi, %xmm4
	pmulld	%xmm1, %xmm4
	pmovzxdq	%xmm4, %xmm4                    ## xmm4 = xmm4[0],zero,xmm4[1],zero
	paddq	%xmm3, %xmm4
	movq	4(%r10,%rdi,4), %xmm3           ## xmm3 = mem[0],zero
	pmulld	%xmm2, %xmm3
	pmovzxdq	%xmm3, %xmm3                    ## xmm3 = xmm3[0],zero,xmm3[1],zero
	paddq	%xmm4, %xmm3
	movdqu	%xmm3, 8(%rbx,%rdi,8)
	movq	%rsi, 4(%r14,%rdi,4)
	addq	$2, %rdi
	cmpq	%rdi, %r15
	jne	LBB0_6
## %bb.7:
	cmpq	%r15, %rcx
	je	LBB0_11
LBB0_8:
	movq	%rdx, %rsi
	notq	%rsi
	testb	$1, %r13b
	jne	LBB0_10
## %bb.9:
	movq	(%r11,%rdx,8), %rcx
	addq	%r12, %rcx
	movl	(%r8,%rdx,4), %edi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	%edi, %r15d
	imull	%r9d, %r15d
	addq	%rcx, %r15
	movl	(%r10,%rdx,4), %edi
	imull	%eax, %edi
	addq	%r15, %rdi
	movq	%rdi, (%rbx,%rdx,8)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, (%r14,%rdx,4)
	incq	%rdx
LBB0_10:
	addq	%r13, %rsi
	je	LBB0_11
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r11,%rdx,8), %rsi
	addq	%r12, %rsi
	movl	(%r8,%rdx,4), %edi
	movl	%edi, %ecx
	imull	%r9d, %ecx
	addq	%rsi, %rcx
	movl	(%r10,%rdx,4), %esi
	imull	%eax, %esi
	addq	%rcx, %rsi
	movq	%rsi, (%rbx,%rdx,8)
	movl	%edi, (%r14,%rdx,4)
	movq	8(%r11,%rdx,8), %rcx
	addq	%r12, %rcx
	movl	4(%r8,%rdx,4), %esi
	movl	%esi, %edi
	imull	%r9d, %edi
	addq	%rcx, %rdi
	movl	4(%r10,%rdx,4), %ecx
	imull	%eax, %ecx
	addq	%rdi, %rcx
	movq	%rcx, 8(%rbx,%rdx,8)
	movl	%esi, 4(%r14,%rdx,4)
	addq	$2, %rdx
	cmpq	%rdx, %r13
	jne	LBB0_18
LBB0_11:
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	cmpl	$2, -52(%rbp)                   ## 4-byte Folded Reload
	ja	LBB0_14
LBB0_12:
	movl	%edx, %eax
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	$0, (%rbx,%rax,8)
	movl	$0, (%r14,%rax,4)
	incq	%rax
	cmpq	$3, %rax
	jne	LBB0_13
LBB0_14:
	movq	(%rbx), %rax
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_16
## %bb.15:
	movslq	(%r14), %rcx
	addq	%rcx, %rax
	movq	%rax, 24(%rbx)
	leal	(%rcx,%rcx), %eax
	movl	%eax, (%r14)
	movq	4(%r14), %rax
	movq	%rax, %xmm0
	leal	(%rax,%rax), %ecx
	movl	%ecx, 4(%r14)
	movdqu	8(%rbx), %xmm1
	pmovsxdq	%xmm0, %xmm0
	paddq	%xmm1, %xmm0
	movdqu	%xmm0, 32(%rbx)
	shrq	$32, %rax
	addl	%eax, %eax
	movl	%eax, 8(%r14)
	jmp	LBB0_17
LBB0_16:
	movq	%rax, 24(%rbx)
	movdqu	8(%rbx), %xmm0
	movdqu	%xmm0, 32(%rbx)
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pitch %u x %d y %d bpp %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_armada_drm_plane_calc          ; -- Begin function armada_drm_plane_calc
	.p2align	2
_armada_drm_plane_calc:                 ; @armada_drm_plane_calc
	.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
	mov	x21, x3
	mov	x20, x2
	mov	x19, x1
	ldr	x24, [x0, #8]
	ldr	x27, [x24, #16]
	ldr	w25, [x27]
	ldrsh	w22, [x0, #2]
	ldrsh	w23, [x0, #6]
	mov	x0, x24
	bl	_drm_fb_obj
	ldr	x26, [x0]
	ldr	x8, [x24]
	ldr	w1, [x8]
	ldr	x8, [x27, #8]
	ldr	w8, [x8]
	lsl	w4, w8, #3
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x22
	mov	x3, x23
	bl	_DRM_DEBUG_KMS
	mov	w8, #3
	cmp	w25, #3
	csel	w8, w25, w8, lo
	ldp	x12, x11, [x24]
	ldr	x9, [x11]
	ldr	w10, [x12]
	mul	w13, w10, w23
	add	x9, x9, x26
	add	x9, x9, x13
	ldr	x13, [x27, #8]
	ldr	w14, [x13]
	mul	w14, w14, w22
	add	x9, x9, x14
	str	x9, [x19]
	str	w10, [x20]
	cmp	w8, #2
	b.lo	LBB0_3
; %bb.1:
	ldp	w9, w10, [x27, #16]
	udiv	w9, w23, w9
	sub	x15, x8, #1
	udiv	w10, w22, w10
	cmp	x15, #4
	b.hs	LBB0_4
; %bb.2:
	mov	w14, #1
	b	LBB0_10
LBB0_3:
	mov	w8, #1
	b	LBB0_13
LBB0_4:
	sub	x16, x19, x11
	mov	w14, #1
	cmp	x16, #32
	b.lo	LBB0_10
; %bb.5:
	add	x16, x20, #4
	sub	x17, x16, x12
	sub	x17, x17, #4
	cmp	x17, #16
	b.lo	LBB0_10
; %bb.6:
	sub	x16, x16, x13
	sub	x16, x16, #4
	cmp	x16, #16
	b.lo	LBB0_10
; %bb.7:
	and	x16, x15, #0xfffffffffffffffc
	orr	x14, x16, #0x1
	dup.2d	v0, x26
	dup.2s	v1, w9
	add	x17, x11, #24
	add	x0, x20, #12
	dup.2s	v2, w10
	add	x1, x12, #12
	add	x2, x19, #24
	add	x3, x13, #12
	mov	x4, x16
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldp	q3, q4, [x17, #-16]
	add.2d	v3, v3, v0
	add.2d	v4, v4, v0
	ldp	d5, d6, [x1, #-8]
	mul.2s	v7, v5, v1
	mul.2s	v16, v6, v1
	uaddw.2d	v3, v3, v7
	uaddw.2d	v4, v4, v16
	ldp	d7, d16, [x3, #-8]
	mul.2s	v7, v7, v2
	mul.2s	v16, v16, v2
	uaddw.2d	v3, v3, v7
	uaddw.2d	v4, v4, v16
	stp	d5, d6, [x0, #-8]
	add	x17, x17, #32
	add	x0, x0, #16
	stp	q3, q4, [x2, #-16]
	add	x1, x1, #16
	add	x2, x2, #32
	add	x3, x3, #16
	subs	x4, x4, #4
	b.ne	LBB0_8
; %bb.9:
	cmp	x15, x16
	b.eq	LBB0_12
LBB0_10:
	lsl	x17, x14, #2
	add	x15, x20, x17
	lsl	x0, x14, #3
	add	x16, x19, x0
	add	x13, x13, x17
	add	x12, x12, x17
	add	x11, x11, x0
	sub	x14, x8, x14
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x17, [x11], #8
	ldr	w0, [x12], #4
	mul	w1, w0, w9
	add	x17, x17, x26
	add	x17, x17, x1
	ldr	w1, [x13], #4
	mul	w1, w1, w10
	add	x17, x17, x1
	str	x17, [x16], #8
	str	w0, [x15], #4
	subs	x14, x14, #1
	b.ne	LBB0_11
LBB0_12:
	cmp	w25, #2
	b.hi	LBB0_15
LBB0_13:
	mov	w8, w8
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	str	xzr, [x19, x8, lsl #3]
	str	wzr, [x20, x8, lsl #2]
	add	x8, x8, #1
	cmp	x8, #3
	b.ne	LBB0_14
LBB0_15:
	ldr	x8, [x19]
	cbz	w21, LBB0_17
; %bb.16:
	ldrsw	x9, [x20]
	add	x8, x8, x9
	str	x8, [x19, #24]
	lsl	w8, w9, #1
	str	w8, [x20]
	ldur	d0, [x20, #4]
	ldur	q1, [x19, #8]
	saddw.2d	v1, v1, v0
	str	q1, [x19, #32]
	shl.2s	v0, v0, #1
	stur	d0, [x20, #4]
	b	LBB0_18
LBB0_17:
	str	x8, [x19, #24]
	ldur	q0, [x19, #8]
	str	q0, [x19, #32]
LBB0_18:
	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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pitch %u x %d y %d bpp %d\n"

.subsections_via_symbols
