	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dpu_encoder_virt_enable
_dpu_encoder_virt_enable:               ## @dpu_encoder_virt_enable
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.1:
	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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_to_dpu_encoder_virt
	movq	%rax, %r15
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	24(%r15), %rax
	movq	(%rax), %rbx
	movq	%r12, %rdi
	callq	_DRMID
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	movl	%eax, %edi
	callq	_trace_dpu_enc_enable
	movq	16(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.2:
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	*%rax
LBB0_4:
	movq	8(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.5:
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	callq	*%rax
LBB0_7:
	movq	_DPU_ENC_RC_EVENT_KICKOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_dpu_encoder_resource_control
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_DPU_ERROR_ENC
	jmp	LBB0_10
LBB0_11:
	leaq	L_.str(%rip), %rdi
	jmp	_DPU_ERROR                      ## TAILCALL
LBB0_9:
	movq	%r12, %rdi
	callq	__dpu_encoder_virt_enable_helper
	movl	$1, (%r15)
LBB0_10:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid encoder\n"

	.comm	_DPU_ENC_RC_EVENT_KICKOFF,4,2   ## @DPU_ENC_RC_EVENT_KICKOFF
L_.str.1:                               ## @.str.1
	.asciz	"dpu resource control failed: %d\n"

	.no_dead_strip	_dpu_encoder_virt_enable
.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_enable
_dpu_encoder_virt_enable:               ; @dpu_encoder_virt_enable
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_9
; %bb.1:
	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
	.cfi_remember_state
	mov	x21, x0
	bl	_to_dpu_encoder_virt
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20, #24]
	ldr	x22, [x8]
	mov	x0, x21
	bl	_DRMID
	ldp	w2, w1, [x22]
	bl	_trace_dpu_enc_enable
	ldr	x0, [x20, #16]
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x8, [x0]
	cbz	x8, LBB0_4
; %bb.3:
	blr	x8
LBB0_4:
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x8, [x0]
	cbz	x8, LBB0_7
; %bb.6:
	blr	x8
LBB0_7:
Lloh0:
	adrp	x8, _DPU_ENC_RC_EVENT_KICKOFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DPU_ENC_RC_EVENT_KICKOFF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_dpu_encoder_resource_control
	cbz	w0, LBB0_10
; %bb.8:
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_DPU_ERROR_ENC
	b	LBB0_11
LBB0_9:
	.cfi_def_cfa wsp, 0
	.cfi_same_value w30
	.cfi_same_value w29
	.cfi_same_value w19
	.cfi_same_value w20
	.cfi_same_value w21
	.cfi_same_value w22
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	_DPU_ERROR
LBB0_10:
	.cfi_restore_state
	mov	x0, x21
	bl	__dpu_encoder_virt_enable_helper
	mov	w8, #1
	str	w8, [x20]
LBB0_11:
	mov	x0, x19
	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	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid encoder\n"

	.comm	_DPU_ENC_RC_EVENT_KICKOFF,4,2   ; @DPU_ENC_RC_EVENT_KICKOFF
l_.str.1:                               ; @.str.1
	.asciz	"dpu resource control failed: %d\n"

	.no_dead_strip	_dpu_encoder_virt_enable
.subsections_via_symbols
