	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dpu_encoder_destroy
_dpu_encoder_destroy:                   ## @dpu_encoder_destroy
	.cfi_startproc
## %bb.0:
	testq	%rdi, %rdi
	je	LBB0_10
## %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, %r15
	callq	_to_dpu_encoder_virt
	movq	%rax, %r12
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	callq	_DPU_DEBUG_ENC
	leaq	4(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r12), %edx
	testl	%edx, %edx
	jle	LBB0_7
## %bb.2:
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	%edx, %rax
	cmpq	%rax, %rbx
	jge	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	callq	*%rax
	movl	(%r12), %edx
	decl	%edx
	movl	%edx, (%r12)
	movq	8(%r12), %rax
	movq	$0, (%rax,%rbx,8)
	jmp	LBB0_6
LBB0_7:
	testl	%edx, %edx
	je	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	callq	_DPU_ERROR_ENC
LBB0_9:
	movl	$0, (%r12)
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_drm_encoder_cleanup
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_destroy                  ## TAILCALL
LBB0_10:
	leaq	L_.str(%rip), %rdi
	jmp	_DPU_ERROR                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid encoder\n"

L_.str.1:                               ## @.str.1
	.asciz	"\n"

L_.str.2:                               ## @.str.2
	.asciz	"expected 0 num_phys_encs not %d\n"

	.no_dead_strip	_dpu_encoder_destroy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dpu_encoder_destroy
_dpu_encoder_destroy:                   ; @dpu_encoder_destroy
	.cfi_startproc
; %bb.0:
	cbz	x0, LBB0_10
; %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
	mov	x19, x0
	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
	add	x20, x21, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w2, [x21]
	cmp	w2, #1
	b.lt	LBB0_7
; %bb.2:
	mov	x22, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #1
	cmp	x22, w2, sxtw
	b.ge	LBB0_7
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldr	x0, [x8, x22, lsl #3]
	cbz	x0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	blr	x8
	ldr	w8, [x21]
	sub	w2, w8, #1
	str	w2, [x21]
	ldr	x8, [x21, #8]
	str	xzr, [x8, x22, lsl #3]
	b	LBB0_3
LBB0_7:
	cbz	w2, LBB0_9
; %bb.8:
Lloh2:
	adrp	x1, l_.str.2@PAGE
Lloh3:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_DPU_ERROR_ENC
LBB0_9:
	str	wzr, [x21]
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_drm_encoder_cleanup
	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	_mutex_destroy
LBB0_10:
	.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
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	b	_DPU_ERROR
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid encoder\n"

l_.str.1:                               ; @.str.1
	.asciz	"\n"

l_.str.2:                               ; @.str.2
	.asciz	"expected 0 num_phys_encs not %d\n"

	.no_dead_strip	_dpu_encoder_destroy
.subsections_via_symbols
