	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_format_populate_layout     ## -- Begin function dpu_format_populate_layout
	.p2align	4, 0x90
_dpu_format_populate_layout:            ## @dpu_format_populate_layout
	.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	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_DPU_MAX_PLANES@GOTPCREL(%rip), %r13
	movl	(%r13), %r14d
	leaq	(,%r14,4), %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	testq	%r12, %r12
	je	LBB0_2
## %bb.1:
	testq	%r15, %r15
	je	LBB0_2
## %bb.3:
	movq	(%r12), %rax
	movq	_DPU_MAX_IMG_WIDTH@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_5
## %bb.4:
	movq	8(%r12), %rax
	movq	_DPU_MAX_IMG_HEIGHT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	jmp	LBB0_29
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_29:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_30:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_32
## %bb.31:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r12, %rdi
	callq	_msm_framebuffer_format
	movl	%eax, %edi
	callq	_to_dpu_format
	movl	%eax, 8(%r15)
	movq	(%r12), %rsi
	movq	8(%r12), %rdx
	movl	16(%r12), %r8d
	movl	%eax, %edi
	movq	%r15, %rcx
	callq	_dpu_format_get_plane_sizes
	testl	%eax, %eax
	jne	LBB0_30
## %bb.7:
	movl	(%r13), %r8d
	testl	%r8d, %r8d
	jle	LBB0_22
## %bb.8:
	movq	(%r15), %rcx
	xorl	%edx, %edx
	cmpl	$8, %r8d
	jb	LBB0_18
## %bb.9:
	movq	%rbx, %rax
	subq	%rcx, %rax
	cmpq	$32, %rax
	jb	LBB0_18
## %bb.10:
	movl	%r8d, %edx
	andl	$-8, %edx
	leaq	-8(%rdx), %rax
	movq	%rax, %rdi
	shrq	$3, %rdi
	incq	%rdi
	movl	%edi, %r9d
	andl	$3, %r9d
	cmpq	$24, %rax
	jae	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_12:
	andq	$-4, %rdi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movups	(%rcx,%rax,4), %xmm0
	movups	16(%rcx,%rax,4), %xmm1
	movaps	%xmm0, (%rbx,%rax,4)
	movaps	%xmm1, 16(%rbx,%rax,4)
	movups	32(%rcx,%rax,4), %xmm0
	movups	48(%rcx,%rax,4), %xmm1
	movaps	%xmm0, 32(%rbx,%rax,4)
	movaps	%xmm1, 48(%rbx,%rax,4)
	movups	64(%rcx,%rax,4), %xmm0
	movups	80(%rcx,%rax,4), %xmm1
	movaps	%xmm0, 64(%rbx,%rax,4)
	movaps	%xmm1, 80(%rbx,%rax,4)
	movups	96(%rcx,%rax,4), %xmm0
	movups	112(%rcx,%rax,4), %xmm1
	movaps	%xmm0, 96(%rbx,%rax,4)
	movaps	%xmm1, 112(%rbx,%rax,4)
	addq	$32, %rax
	addq	$-4, %rdi
	jne	LBB0_13
LBB0_14:
	testq	%r9, %r9
	je	LBB0_17
## %bb.15:
	leaq	(%rbx,%rax,4), %rdi
	addq	$16, %rdi
	leaq	(%rcx,%rax,4), %rax
	addq	$16, %rax
	shlq	$5, %r9
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movups	-16(%rax,%rsi), %xmm0
	movups	(%rax,%rsi), %xmm1
	movaps	%xmm0, -16(%rdi,%rsi)
	movaps	%xmm1, (%rdi,%rsi)
	addq	$32, %rsi
	cmpq	%rsi, %r9
	jne	LBB0_16
LBB0_17:
	cmpq	%r8, %rdx
	je	LBB0_22
LBB0_18:
	movq	%rdx, %rax
	notq	%rax
	addq	%r8, %rax
	movq	%r8, %rsi
	andq	$3, %rsi
	je	LBB0_20
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdx,4), %edi
	movl	%edi, (%rbx,%rdx,4)
	incq	%rdx
	decq	%rsi
	jne	LBB0_19
LBB0_20:
	cmpq	$3, %rax
	jb	LBB0_22
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rcx,%rdx,4), %eax
	movl	%eax, (%rbx,%rdx,4)
	movl	4(%rcx,%rdx,4), %eax
	movl	%eax, 4(%rbx,%rdx,4)
	movl	8(%rcx,%rdx,4), %eax
	movl	%eax, 8(%rbx,%rdx,4)
	movl	12(%rcx,%rdx,4), %eax
	movl	%eax, 12(%rbx,%rdx,4)
	addq	$4, %rdx
	cmpq	%rdx, %r8
	jne	LBB0_21
LBB0_22:
	movl	8(%r15), %edi
	callq	_DPU_FORMAT_IS_UBWC
	testq	%rax, %rax
	jne	LBB0_24
## %bb.23:
	movl	8(%r15), %edi
	callq	_DPU_FORMAT_IS_TILE
	testq	%rax, %rax
	je	LBB0_25
LBB0_24:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	__dpu_format_populate_addrs_ubwc
	testl	%eax, %eax
	jne	LBB0_30
LBB0_27:
	movq	(%r15), %rsi
	shll	$2, %r14d
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_memcmp
	movl	%eax, %ecx
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_30
## %bb.28:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_29
LBB0_25:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	__dpu_format_populate_addrs_linear
	testl	%eax, %eax
	jne	LBB0_30
	jmp	LBB0_27
LBB0_32:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DPU_MAX_PLANES,4,2             ## @DPU_MAX_PLANES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid arguments\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DPU_MAX_IMG_WIDTH,8,3          ## @DPU_MAX_IMG_WIDTH
	.comm	_DPU_MAX_IMG_HEIGHT,8,3         ## @DPU_MAX_IMG_HEIGHT
L_.str.1:                               ## @.str.1
	.asciz	"image dimensions outside max range\n"

	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_EAGAIN,4,2                     ## @EAGAIN
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_format_populate_layout     ; -- Begin function dpu_format_populate_layout
	.p2align	2
_dpu_format_populate_layout:            ; @dpu_format_populate_layout
	.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
	sub	sp, sp, #16
	mov	x19, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x24, _DPU_MAX_PLANES@GOTPAGE
Lloh4:
	ldr	x24, [x24, _DPU_MAX_PLANES@GOTPAGEOFF]
	ldr	w23, [x24]
	lsl	x8, x23, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	cbz	x1, LBB0_5
; %bb.1:
	cbz	x19, LBB0_5
; %bb.2:
	ldr	x8, [x21]
Lloh7:
	adrp	x9, _DPU_MAX_IMG_WIDTH@GOTPAGE
Lloh8:
	ldr	x9, [x9, _DPU_MAX_IMG_WIDTH@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.gt	LBB0_4
; %bb.3:
	ldr	x8, [x21, #8]
Lloh10:
	adrp	x9, _DPU_MAX_IMG_HEIGHT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DPU_MAX_IMG_HEIGHT@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_9
LBB0_4:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
Lloh15:
	adrp	x8, _ERANGE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldur	x8, [x29, #-56]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_25
; %bb.8:
	sub	sp, x29, #48
	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_9:
	mov	x0, x21
	bl	_msm_framebuffer_format
	bl	_to_dpu_format
	str	w0, [x19, #8]
	ldp	x1, x2, [x21]
	ldr	w4, [x21, #16]
	mov	x3, x19
	bl	_dpu_format_get_plane_sizes
	cbnz	w0, LBB0_7
; %bb.10:
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.11:
	mov	x9, #0
	ldr	x10, [x19]
	cmp	w8, #16
	b.lo	LBB0_16
; %bb.12:
	sub	x11, x20, x10
	cmp	x11, #64
	b.lo	LBB0_16
; %bb.13:
	and	x9, x8, #0xfffffff0
	add	x11, x20, #32
	add	x12, x10, #32
	mov	x13, x9
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldp	q0, q1, [x12, #-32]
	ldp	q2, q3, [x12], #64
	stp	q0, q1, [x11, #-32]
	stp	q2, q3, [x11], #64
	subs	x13, x13, #16
	b.ne	LBB0_14
; %bb.15:
	cmp	x9, x8
	b.eq	LBB0_18
LBB0_16:
	lsl	x12, x9, #2
	add	x11, x20, x12
	add	x10, x10, x12
	sub	x8, x8, x9
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x10], #4
	str	w9, [x11], #4
	subs	x8, x8, #1
	b.ne	LBB0_17
LBB0_18:
	ldr	w0, [x19, #8]
	bl	_DPU_FORMAT_IS_UBWC
	cbnz	x0, LBB0_20
; %bb.19:
	ldr	w0, [x19, #8]
	bl	_DPU_FORMAT_IS_TILE
	cbz	x0, LBB0_23
LBB0_20:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x19
	bl	__dpu_format_populate_addrs_ubwc
	cbnz	w0, LBB0_7
LBB0_21:
	ldr	x1, [x19]
	lsl	w2, w23, #2
	mov	x0, x20
	bl	_memcmp
	cbz	w0, LBB0_24
; %bb.22:
	mov	w0, #0
	b	LBB0_7
LBB0_23:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x19
	bl	__dpu_format_populate_addrs_linear
	cbnz	w0, LBB0_7
	b	LBB0_21
LBB0_24:
Lloh24:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_6
LBB0_25:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_DPU_MAX_PLANES,4,2             ; @DPU_MAX_PLANES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid arguments\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DPU_MAX_IMG_WIDTH,8,3          ; @DPU_MAX_IMG_WIDTH
	.comm	_DPU_MAX_IMG_HEIGHT,8,3         ; @DPU_MAX_IMG_HEIGHT
l_.str.1:                               ; @.str.1
	.asciz	"image dimensions outside max range\n"

	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_EAGAIN,4,2                     ; @EAGAIN
.subsections_via_symbols
