	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _dpu_format_get_plane_sizes_ubwc
__dpu_format_get_plane_sizes_ubwc:      ## @_dpu_format_get_plane_sizes_ubwc
	.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
	movq	%rcx, %r15
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_DPU_FORMAT_IS_UBWC
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$48, %edx
	callq	_memset
	movq	%r14, 40(%r15)
	movl	%ebx, -52(%rbp)                 ## 4-byte Spill
	movl	%ebx, (%r15)
	movl	%r12d, -56(%rbp)                ## 4-byte Spill
	movl	%r12d, 4(%r15)
	movl	(%r14), %eax
	movl	%eax, 8(%r15)
	movq	%r14, %rdi
	callq	__dpu_format_get_media_color_ubwc
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %r12d
	movq	40(%r15), %rdi
	callq	_DPU_FORMAT_IS_YUV
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movl	$2, 8(%r15)
	movl	%r12d, %edi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	callq	_VENUS_Y_STRIDE
	movq	16(%r15), %rcx
	movl	%eax, (%rcx)
	movl	%r12d, %edi
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	callq	_VENUS_Y_SCANLINES
	movq	16(%r15), %rcx
	imull	(%rcx), %eax
	movq	_DPU_UBWC_PLANE_SIZE_ALIGNMENT@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	%eax, %edi
	callq	_MSM_MEDIA_ALIGN
	movq	24(%r15), %rcx
	movq	%rax, (%rcx)
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_VENUS_UV_STRIDE
	movq	16(%r15), %rcx
	movl	%eax, 4(%rcx)
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_VENUS_UV_SCANLINES
	movq	16(%r15), %rcx
	imull	4(%rcx), %eax
	movl	(%r14), %esi
	movl	%eax, %edi
	callq	_MSM_MEDIA_ALIGN
	movq	24(%r15), %rcx
	movq	%rax, 8(%rcx)
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.4:
	leaq	16(%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leaq	24(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addl	$2, 8(%r15)
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_VENUS_Y_META_STRIDE
	movq	16(%r15), %rcx
	movl	%eax, 8(%rcx)
	movl	%r12d, %edi
	movl	%r13d, %esi
	callq	_VENUS_Y_META_SCANLINES
	movq	16(%r15), %rcx
	imull	8(%rcx), %eax
	movl	(%r14), %esi
	movl	%eax, %edi
	callq	_MSM_MEDIA_ALIGN
	movq	24(%r15), %rcx
	movq	%rax, 16(%rcx)
	movl	%r12d, %edi
	movl	%ebx, %esi
	callq	_VENUS_UV_META_STRIDE
	movq	16(%r15), %rcx
	movl	%eax, 12(%rcx)
	movl	%r12d, %edi
	movl	%r13d, %esi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	callq	_VENUS_UV_META_SCANLINES
	movl	$3, %r14d
	jmp	LBB0_7
LBB0_1:
	addq	$4, %r14
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
	jmp	LBB0_18
LBB0_5:
	movl	$1, 8(%r15)
	movl	%r12d, %edi
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	callq	_VENUS_RGB_STRIDE
	movq	16(%r15), %rcx
	movl	%eax, (%rcx)
	movl	%r12d, %edi
	movl	-56(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %esi
	callq	_VENUS_RGB_SCANLINES
	movq	16(%r15), %rcx
	imull	(%rcx), %eax
	movq	_DPU_UBWC_PLANE_SIZE_ALIGNMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_MSM_MEDIA_ALIGN
	movq	24(%r15), %rcx
	movq	%rax, (%rcx)
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_8
## %bb.6:
	movl	%ebx, %esi
	leaq	16(%r15), %rbx
	leaq	24(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addl	$2, 8(%r15)
	movl	%r12d, %edi
	callq	_VENUS_RGB_META_STRIDE
	movq	16(%r15), %rcx
	movl	%eax, 8(%rcx)
	movl	%r12d, %edi
	movl	%r14d, %esi
	callq	_VENUS_RGB_META_SCANLINES
	movl	$2, %r14d
LBB0_7:
	movq	(%rbx), %rcx
	imull	(%rcx,%r14,4), %eax
	movq	_DPU_UBWC_PLANE_SIZE_ALIGNMENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_MSM_MEDIA_ALIGN
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movq	%rax, (%rcx,%r14,8)
LBB0_8:
	movq	_DPU_MAX_PLANES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%esi, %esi
	jle	LBB0_17
## %bb.9:
	movq	24(%r15), %rdx
	movl	32(%r15), %eax
	leaq	-1(%rsi), %rdi
	movl	%esi, %ecx
	andl	$7, %ecx
	cmpq	$7, %rdi
	jae	LBB0_11
## %bb.10:
	xorl	%edi, %edi
	jmp	LBB0_13
LBB0_11:
	andl	$-8, %esi
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rdx,%rdi,8), %eax
	addl	8(%rdx,%rdi,8), %eax
	addl	16(%rdx,%rdi,8), %eax
	addl	24(%rdx,%rdi,8), %eax
	addl	32(%rdx,%rdi,8), %eax
	addl	40(%rdx,%rdi,8), %eax
	addl	48(%rdx,%rdi,8), %eax
	cltq
	addq	56(%rdx,%rdi,8), %rax
	addq	$8, %rdi
	cmpq	%rdi, %rsi
	jne	LBB0_12
LBB0_13:
	testq	%rcx, %rcx
	je	LBB0_16
## %bb.14:
	leaq	(%rdx,%rdi,8), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	cltq
	addq	(%rdx,%rsi,8), %rax
	incq	%rsi
	cmpq	%rsi, %rcx
	jne	LBB0_15
LBB0_16:
	movl	%eax, 32(%r15)
LBB0_17:
	xorl	%r13d, %r13d
LBB0_18:
	movl	%r13d, %eax
	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	"UBWC format not supported for fmt: %4.4s\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DPU_UBWC_PLANE_SIZE_ALIGNMENT,4,2 ## @DPU_UBWC_PLANE_SIZE_ALIGNMENT
	.comm	_DPU_MAX_PLANES,4,2             ## @DPU_MAX_PLANES
	.no_dead_strip	__dpu_format_get_plane_sizes_ubwc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _dpu_format_get_plane_sizes_ubwc
__dpu_format_get_plane_sizes_ubwc:      ; @_dpu_format_get_plane_sizes_ubwc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x24, x0
	bl	_DPU_FORMAT_IS_UBWC
	mov	x23, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #48
	bl	_memset
	str	x24, [x19, #40]
	stp	w21, w20, [x19]
	ldr	w8, [x24]
	str	w8, [x19, #8]
	mov	x0, x24
	bl	__dpu_format_get_media_color_ubwc
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x22, x0
	ldr	x0, [x19, #40]
	bl	_DPU_FORMAT_IS_YUV
Lloh0:
	adrp	x24, _DPU_UBWC_PLANE_SIZE_ALIGNMENT@GOTPAGE
Lloh1:
	ldr	x24, [x24, _DPU_UBWC_PLANE_SIZE_ALIGNMENT@GOTPAGEOFF]
	cbz	x0, LBB0_5
; %bb.2:
	mov	w8, #2
	str	w8, [x19, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_VENUS_Y_STRIDE
	mov	x25, x19
	ldr	x8, [x25, #16]!
	str	w0, [x8]
	mov	x0, x22
	mov	x1, x20
	bl	_VENUS_Y_SCANLINES
	ldr	x8, [x25]
	ldr	w8, [x8]
	mul	w0, w8, w0
	ldr	w1, [x24]
	bl	_MSM_MEDIA_ALIGN
	mov	x26, x19
	ldr	x8, [x26, #24]!
	str	x0, [x8]
	mov	x0, x22
	mov	x1, x21
	bl	_VENUS_UV_STRIDE
	ldr	x8, [x25]
	str	w0, [x8, #4]
	mov	x0, x22
	mov	x1, x20
	bl	_VENUS_UV_SCANLINES
	ldr	x8, [x25]
	ldr	w8, [x8, #4]
	mul	w0, w8, w0
	ldr	w1, [x24]
	bl	_MSM_MEDIA_ALIGN
	ldr	x8, [x26]
	str	x0, [x8, #8]
	cbz	w23, LBB0_8
; %bb.3:
	ldr	w8, [x19, #8]
	add	w8, w8, #2
	str	w8, [x19, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_VENUS_Y_META_STRIDE
	ldr	x8, [x19, #16]
	str	w0, [x8, #8]
	mov	x0, x22
	mov	x1, x20
	bl	_VENUS_Y_META_SCANLINES
	ldr	x8, [x19, #16]
	ldr	w8, [x8, #8]
	mul	w0, w8, w0
	ldr	w1, [x24]
	bl	_MSM_MEDIA_ALIGN
	ldr	x8, [x19, #24]
	str	x0, [x8, #16]
	mov	x0, x22
	mov	x1, x21
	bl	_VENUS_UV_META_STRIDE
	ldr	x8, [x19, #16]
	str	w0, [x8, #12]
	mov	x0, x22
	mov	x1, x20
	bl	_VENUS_UV_META_SCANLINES
	mov	w20, #3
	b	LBB0_7
LBB0_4:
	add	x1, x24, #4
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_5:
	mov	w8, #1
	str	w8, [x19, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_VENUS_RGB_STRIDE
	mov	x25, x19
	ldr	x8, [x25, #16]!
	str	w0, [x8]
	mov	x0, x22
	mov	x1, x20
	bl	_VENUS_RGB_SCANLINES
	ldr	x8, [x25]
	ldr	w8, [x8]
	mul	w0, w8, w0
	ldr	w1, [x24]
	bl	_MSM_MEDIA_ALIGN
	mov	x26, x19
	ldr	x8, [x26, #24]!
	str	x0, [x8]
	cbz	w23, LBB0_8
; %bb.6:
	ldr	w8, [x19, #8]
	add	w8, w8, #2
	str	w8, [x19, #8]
	mov	x0, x22
	mov	x1, x21
	bl	_VENUS_RGB_META_STRIDE
	ldr	x8, [x19, #16]
	str	w0, [x8, #8]
	mov	x0, x22
	mov	x1, x20
	bl	_VENUS_RGB_META_SCANLINES
	mov	w20, #2
LBB0_7:
	ldr	x8, [x25]
	ldr	w8, [x8, x20, lsl #2]
	mul	w0, w8, w0
	ldr	w1, [x24]
	bl	_MSM_MEDIA_ALIGN
	ldr	x8, [x26]
	str	x0, [x8, x20, lsl #3]
LBB0_8:
Lloh7:
	adrp	x8, _DPU_MAX_PLANES@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DPU_MAX_PLANES@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:
	ldr	x10, [x19, #24]
	ldr	w9, [x19, #32]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10], #8
	add	x9, x11, w9, sxtw
	subs	x8, x8, #1
	b.ne	LBB0_10
; %bb.11:
	mov	w0, #0
	str	w9, [x19, #32]
	b	LBB0_13
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"UBWC format not supported for fmt: %4.4s\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DPU_UBWC_PLANE_SIZE_ALIGNMENT,4,2 ; @DPU_UBWC_PLANE_SIZE_ALIGNMENT
	.comm	_DPU_MAX_PLANES,4,2             ; @DPU_MAX_PLANES
	.no_dead_strip	__dpu_format_get_plane_sizes_ubwc
.subsections_via_symbols
