	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dpu_encoder_virt_add_phys_encs
_dpu_encoder_virt_add_phys_encs:        ## @dpu_encoder_virt_add_phys_encs
	.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
	pushq	%rax
	.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, %r13
	movl	%edi, %r12d
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_DPU_DEBUG_ENC
	movslq	(%r13), %rbx
	movq	_NUM_PHYS_ENCODER_TYPES@GOTPCREL(%rip), %rax
	addq	(%rax), %rbx
	movq	24(%r13), %rdi
	callq	_ARRAY_SIZE
	cmpq	%rax, %rbx
	jge	LBB0_1
## %bb.2:
	movq	_MSM_DISPLAY_CAP_VID_MODE@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_dpu_encoder_phys_vid_init
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	movq	%r14, %rdi
	callq	_PTR_ERR
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_6
LBB0_1:
	movl	(%r13), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	callq	_DPU_ERROR_ENC
LBB0_7:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_3:
	xorl	%r14d, %r14d
	jmp	LBB0_9
LBB0_8:
	movq	24(%r13), %rax
	movslq	(%r13), %rcx
	movq	%r14, (%rax,%rcx,8)
	leal	1(%rcx), %eax
	movl	%eax, (%r13)
LBB0_9:
	movq	_MSM_DISPLAY_CAP_CMD_MODE@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_14
## %bb.10:
	movq	%r15, %rdi
	callq	_dpu_encoder_phys_cmd_init
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR_OR_NULL
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	%r14, %rdi
	callq	_PTR_ERR
	leaq	L_.str.3(%rip), %rsi
LBB0_6:
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_DPU_ERROR_ENC
	testq	%r14, %r14
	je	LBB0_7
## %bb.12:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_13:
	movq	24(%r13), %rax
	movslq	(%r13), %rcx
	movq	%r14, (%rax,%rcx,8)
	leal	1(%rcx), %eax
	movl	%eax, (%r13)
LBB0_14:
	movq	(%r15), %rax
	movq	_ENC_ROLE_SLAVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_16
## %bb.15:
	movq	%r14, 16(%r13)
	jmp	LBB0_17
LBB0_16:
	movq	%r14, 8(%r13)
LBB0_17:
	xorl	%eax, %eax
LBB0_18:
	addq	$8, %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	"\n"

	.comm	_NUM_PHYS_ENCODER_TYPES,8,3     ## @NUM_PHYS_ENCODER_TYPES
L_.str.1:                               ## @.str.1
	.asciz	"too many physical encoders %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MSM_DISPLAY_CAP_VID_MODE,4,2   ## @MSM_DISPLAY_CAP_VID_MODE
L_.str.2:                               ## @.str.2
	.asciz	"failed to init vid enc: %ld\n"

	.comm	_MSM_DISPLAY_CAP_CMD_MODE,4,2   ## @MSM_DISPLAY_CAP_CMD_MODE
L_.str.3:                               ## @.str.3
	.asciz	"failed to init cmd enc: %ld\n"

	.comm	_ENC_ROLE_SLAVE,8,3             ## @ENC_ROLE_SLAVE
	.no_dead_strip	_dpu_encoder_virt_add_phys_encs
.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_add_phys_encs
_dpu_encoder_virt_add_phys_encs:        ; @dpu_encoder_virt_add_phys_encs
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_DPU_DEBUG_ENC
	ldrsw	x8, [x19]
Lloh2:
	adrp	x9, _NUM_PHYS_ENCODER_TYPES@GOTPAGE
Lloh3:
	ldr	x9, [x9, _NUM_PHYS_ENCODER_TYPES@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x20, x9, x8
	ldr	x0, [x19, #24]
	bl	_ARRAY_SIZE
	cmp	x20, x0
	b.ge	LBB0_4
; %bb.1:
Lloh5:
	adrp	x8, _MSM_DISPLAY_CAP_VID_MODE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSM_DISPLAY_CAP_VID_MODE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_7
; %bb.2:
	mov	x0, x21
	bl	_dpu_encoder_phys_vid_init
	mov	x20, x0
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_8
; %bb.3:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_4:
	ldr	w2, [x19]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_DPU_ERROR_ENC
LBB0_5:
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x20, #0
	b	LBB0_9
LBB0_8:
	ldr	x8, [x19, #24]
	ldrsw	x9, [x19]
	str	x20, [x8, x9, lsl #3]
	add	w8, w9, #1
	str	w8, [x19]
LBB0_9:
Lloh15:
	adrp	x8, _MSM_DISPLAY_CAP_CMD_MODE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MSM_DISPLAY_CAP_CMD_MODE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_15
; %bb.10:
	mov	x0, x21
	bl	_dpu_encoder_phys_cmd_init
	mov	x20, x0
	bl	_IS_ERR_OR_NULL
	cbz	x0, LBB0_14
; %bb.11:
	mov	x0, x20
	bl	_PTR_ERR
	mov	x2, x0
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_DPU_ERROR_ENC
	cbz	x20, LBB0_5
; %bb.13:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_14:
	ldr	x8, [x19, #24]
	ldrsw	x9, [x19]
	str	x20, [x8, x9, lsl #3]
	add	w8, w9, #1
	str	w8, [x19]
LBB0_15:
	ldr	x8, [x21]
Lloh20:
	adrp	x9, _ENC_ROLE_SLAVE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _ENC_ROLE_SLAVE@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.16:
	mov	w0, #0
	str	x20, [x19, #16]
	b	LBB0_6
LBB0_17:
	mov	w0, #0
	str	x20, [x19, #8]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_NUM_PHYS_ENCODER_TYPES,8,3     ; @NUM_PHYS_ENCODER_TYPES
l_.str.1:                               ; @.str.1
	.asciz	"too many physical encoders %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MSM_DISPLAY_CAP_VID_MODE,4,2   ; @MSM_DISPLAY_CAP_VID_MODE
l_.str.2:                               ; @.str.2
	.asciz	"failed to init vid enc: %ld\n"

	.comm	_MSM_DISPLAY_CAP_CMD_MODE,4,2   ; @MSM_DISPLAY_CAP_CMD_MODE
l_.str.3:                               ; @.str.3
	.asciz	"failed to init cmd enc: %ld\n"

	.comm	_ENC_ROLE_SLAVE,8,3             ; @ENC_ROLE_SLAVE
	.no_dead_strip	_dpu_encoder_virt_add_phys_encs
.subsections_via_symbols
