	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _dpu_kms_set_encoder_mode
__dpu_kms_set_encoder_mode:             ## @_dpu_kms_set_encoder_mode
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	8(%rsi), %rax
	movq	(%rax), %r12
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	16(%r15), %eax
	movl	%eax, -36(%rbp)
	testl	%r14d, %r14d
	jne	LBB0_1
## %bb.2:
	movq	_MSM_DISPLAY_CAP_VID_MODE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_MSM_DISPLAY_CAP_CMD_MODE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_8
## %bb.4:
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_8
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	cmpq	$0, (%rdi,%rbx,8)
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rax
	movq	-48(%rbp), %rcx
	movl	%ebx, (%rax,%rcx,4)
	incq	%rcx
	movq	%rcx, -48(%rbp)
	jmp	LBB0_7
LBB0_8:
	movq	8(%r15), %rdi
	leaq	-56(%rbp), %rdx
	movq	%r15, %rsi
	callq	_dpu_encoder_setup
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdi
	movl	%eax, %edx
	callq	_DPU_ERROR
LBB0_10:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MSM_DISPLAY_CAP_CMD_MODE,4,2   ## @MSM_DISPLAY_CAP_CMD_MODE
	.comm	_MSM_DISPLAY_CAP_VID_MODE,4,2   ## @MSM_DISPLAY_CAP_VID_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to setup DPU encoder %d: rc:%d\n"

	.no_dead_strip	__dpu_kms_set_encoder_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _dpu_kms_set_encoder_mode
__dpu_kms_set_encoder_mode:             ; @_dpu_kms_set_encoder_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x2
	mov	x19, x1
	ldr	x8, [x1, #8]
	ldr	x21, [x8]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	w8, [x19, #16]
Lloh0:
	adrp	x9, _MSM_DISPLAY_CAP_CMD_MODE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MSM_DISPLAY_CAP_CMD_MODE@GOTPAGEOFF]
Lloh2:
	adrp	x10, _MSM_DISPLAY_CAP_VID_MODE@GOTPAGE
Lloh3:
	ldr	x10, [x10, _MSM_DISPLAY_CAP_VID_MODE@GOTPAGEOFF]
	str	w8, [sp, #28]
	cmp	w20, #0
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [sp, #24]
	ldr	x0, [x21]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x20, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, #1
	bl	_ARRAY_SIZE
	cmp	x20, w0, sxtw
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	ldr	x8, [x0, x20, lsl #3]
	cbz	x8, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldp	x8, x9, [sp, #8]
	str	w20, [x8, x9, lsl #2]
	add	x8, x9, #1
	str	x8, [sp, #16]
	b	LBB0_2
LBB0_5:
	ldr	x0, [x19, #8]
	add	x2, sp, #8
	mov	x1, x19
	bl	_dpu_encoder_setup
	cbz	w0, LBB0_7
; %bb.6:
	mov	x2, x0
	ldr	w1, [x19]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPU_ERROR
LBB0_7:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_MSM_DISPLAY_CAP_CMD_MODE,4,2   ; @MSM_DISPLAY_CAP_CMD_MODE
	.comm	_MSM_DISPLAY_CAP_VID_MODE,4,2   ; @MSM_DISPLAY_CAP_VID_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to setup DPU encoder %d: rc:%d\n"

	.no_dead_strip	__dpu_kms_set_encoder_mode
.subsections_via_symbols
