	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dpu_encoder_virt_atomic_check
_dpu_encoder_virt_atomic_check:         ## @dpu_encoder_virt_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, %r14
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	testq	%r15, %r15
	je	LBB0_3
## %bb.2:
	testq	%r13, %r13
	je	LBB0_3
## %bb.4:
	movq	%r14, %rdi
	callq	_to_dpu_encoder_virt
	movq	%rax, %rbx
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	callq	_DPU_DEBUG_ENC
	movq	(%r14), %rax
	movq	(%rax), %rax
	movl	(%rax), %edi
	callq	_to_dpu_kms
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_DRMID
	movl	%eax, %edi
	callq	_trace_dpu_enc_atomic_check
	movl	(%r13), %edi
	movq	%r15, %rsi
	callq	__dpu_encoder_adjust_mode
	cmpl	$0, (%rbx)
	jle	LBB0_15
## %bb.5:
	leaq	8(%r15), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_6 Depth=1
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	*%rax
	movl	%eax, %r12d
	testl	%r12d, %r12d
	je	LBB0_14
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	movq	(%rax,%r14,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%rdi), %rax
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=1
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	*%rax
	testl	%eax, %eax
	jne	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r12d, %r12d
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	testl	%r12d, %r12d
	jne	LBB0_13
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r14
	movslq	(%rbx), %rax
	cmpq	%rax, %r14
	jl	LBB0_6
LBB0_15:
	movq	%rbx, %rdi
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r15, %rdx
	callq	_dpu_encoder_get_topology
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_drm_atomic_crtc_needs_modeset
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_18
## %bb.16:
	cmpl	$0, 4(%rbx)
	je	LBB0_18
## %bb.17:
	movq	%r13, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	%r14d, %ecx
	movl	$1, %r8d
	callq	_dpu_rm_reserve
	movl	%eax, %r12d
	movl	$0, 4(%rbx)
	jmp	LBB0_18
LBB0_3:
	xorl	%ecx, %ecx
	testq	%r13, %r13
	setne	%cl
	xorl	%edx, %edx
	testq	%r15, %r15
	setne	%dl
	xorl	%esi, %esi
	testq	%r14, %r14
	setne	%sil
	leaq	L_.str(%rip), %rdi
	callq	_DPU_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_19
LBB0_13:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_DPU_ERROR_ENC
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rdx
	callq	_dpu_encoder_get_topology
LBB0_18:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_DRMID
	movl	(%r15), %edx
	movl	4(%r15), %esi
	movl	%eax, %edi
	callq	_trace_dpu_enc_atomic_check_flags
LBB0_19:
	movl	%r12d, %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	"invalid arg(s), drm_enc %d, crtc/conn state %d/%d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"\n"

L_.str.2:                               ## @.str.2
	.asciz	"mode unsupported, phys idx %d\n"

	.no_dead_strip	_dpu_encoder_virt_atomic_check
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dpu_encoder_virt_atomic_check
_dpu_encoder_virt_atomic_check:         ; @dpu_encoder_virt_atomic_check
	.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	x23, x2
	mov	x19, x1
	mov	x20, x0
	cbz	x0, LBB0_13
; %bb.1:
	cbz	x19, LBB0_13
; %bb.2:
	cbz	x23, LBB0_13
; %bb.3:
	mov	x0, x20
	bl	_to_dpu_encoder_virt
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DPU_DEBUG_ENC
	ldr	x8, [x20]
	ldr	x8, [x8]
	ldr	w0, [x8]
	bl	_to_dpu_kms
	mov	x22, x0
	mov	x0, x20
	bl	_DRMID
	bl	_trace_dpu_enc_atomic_check
	ldr	w0, [x23]
	mov	x1, x19
	bl	__dpu_encoder_adjust_mode
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.4:
	mov	x24, #0
	add	x25, x19, #8
Lloh2:
	adrp	x27, _EINVAL@GOTPAGE
Lloh3:
	ldr	x27, [x27, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, x19
	mov	x2, x23
	blr	x8
	mov	x26, x0
	cbnz	w26, LBB0_12
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x21]
	cmp	x24, x8
	b.ge	LBB0_14
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldr	x0, [x8, x24, lsl #3]
	cbz	x0, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x0]
	cbnz	x8, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_6
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x1, x25
	mov	x2, x19
	blr	x8
	cbnz	w0, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	ldr	w8, [x27]
	neg	w26, w8
	cbz	w26, LBB0_6
LBB0_12:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x24
	bl	_DPU_ERROR_ENC
	mov	x0, x21
	mov	x1, x22
	mov	x2, x19
	bl	_dpu_encoder_get_topology
	b	LBB0_18
LBB0_13:
	cmp	x23, #0
	cset	w3, ne
	cmp	x19, #0
	cset	w2, ne
	cmp	x20, #0
	cset	w1, ne
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPU_ERROR
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_19
LBB0_14:
	mov	x0, x21
	mov	x1, x22
	mov	x2, x19
	bl	_dpu_encoder_get_topology
	mov	x23, x0
	mov	x0, x19
	bl	_drm_atomic_crtc_needs_modeset
	cbz	x0, LBB0_17
; %bb.15:
	ldr	w8, [x21, #4]
	cbz	w8, LBB0_17
; %bb.16:
	mov	w3, w23
	mov	x0, x22
	mov	x1, x20
	mov	x2, x19
	mov	w4, #1
	bl	_dpu_rm_reserve
	mov	x26, x0
	str	wzr, [x21, #4]
	b	LBB0_18
LBB0_17:
	mov	w26, #0
LBB0_18:
	mov	x0, x20
	bl	_DRMID
	ldp	w2, w1, [x19]
	bl	_trace_dpu_enc_atomic_check_flags
LBB0_19:
	mov	x0, x26
	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
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid arg(s), drm_enc %d, crtc/conn state %d/%d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"\n"

l_.str.2:                               ; @.str.2
	.asciz	"mode unsupported, phys idx %d\n"

	.no_dead_strip	_dpu_encoder_virt_atomic_check
.subsections_via_symbols
