	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_encoder_prepare_for_kickoff ## -- Begin function dpu_encoder_prepare_for_kickoff
	.p2align	4, 0x90
_dpu_encoder_prepare_for_kickoff:       ## @dpu_encoder_prepare_for_kickoff
	.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	%rdi, %rbx
	callq	_to_dpu_encoder_virt
	movq	%rax, %r15
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_DRMID
	movl	%eax, %edi
	callq	_trace_dpu_enc_prepare_kickoff
	leaq	L_.str(%rip), %rdi
	callq	_DPU_ATRACE_BEGIN
	movl	(%r15), %eax
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	xorl	%ebx, %ebx
	movl	$1, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r13), %rcx
	movq	_DPU_ENC_ERR_NEEDS_HW_RESET@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	cmovel	%r14d, %r12d
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movl	%eax, %ecx
	cmpq	%rcx, %rbx
	jae	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rcx
	movq	(%rcx,%rbx,8), %r13
	testq	%r13, %r13
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r13), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r13, %rdi
	callq	*%rcx
	movl	(%r15), %eax
	jmp	LBB0_6
LBB0_1:
	xorl	%r12d, %r12d
LBB0_8:
	leaq	L_.str(%rip), %rdi
	callq	_DPU_ATRACE_END
	movq	_DPU_ENC_RC_EVENT_KICKOFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_dpu_encoder_resource_control
	testl	%r12d, %r12d
	je	LBB0_12
## %bb.9:
	movq	%rbx, %rdi
	callq	_DRMID
	movl	%eax, %edi
	callq	_trace_dpu_enc_prepare_kickoff_reset
	cmpl	$0, (%r15)
	je	LBB0_12
## %bb.10:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_dpu_encoder_helper_hw_reset
	incq	%rbx
	movl	(%r15), %eax
	cmpq	%rax, %rbx
	jb	LBB0_11
LBB0_12:
	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	"enc_prepare_for_kickoff"

	.comm	_DPU_ENC_ERR_NEEDS_HW_RESET,8,3 ## @DPU_ENC_ERR_NEEDS_HW_RESET
	.comm	_DPU_ENC_RC_EVENT_KICKOFF,4,2   ## @DPU_ENC_RC_EVENT_KICKOFF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_encoder_prepare_for_kickoff ; -- Begin function dpu_encoder_prepare_for_kickoff
	.p2align	2
_dpu_encoder_prepare_for_kickoff:       ; @dpu_encoder_prepare_for_kickoff
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x0
	bl	_to_dpu_encoder_virt
	mov	x19, x0
	mov	x0, x20
	bl	_DRMID
	bl	_trace_dpu_enc_prepare_kickoff
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPU_ATRACE_BEGIN
	ldr	w8, [x19]
	cbz	w8, LBB0_7
; %bb.1:
	mov	x23, #0
	mov	w22, #0
Lloh2:
	adrp	x24, _DPU_ENC_ERR_NEEDS_HW_RESET@GOTPAGE
Lloh3:
	ldr	x24, [x24, _DPU_ENC_ERR_NEEDS_HW_RESET@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x21]
	ldr	x10, [x24]
	cmp	x9, x10
	csinc	w22, w22, wzr, ne
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x23, x23, #1
	cmp	x23, w8, uxtw
	b.hs	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #8]
	ldr	x21, [x9, x23, lsl #3]
	cbz	x21, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x9, [x21, #8]
	cbz	x9, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	blr	x9
	ldr	w8, [x19]
	b	LBB0_2
LBB0_7:
	mov	w22, #0
LBB0_8:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPU_ATRACE_END
Lloh6:
	adrp	x8, _DPU_ENC_RC_EVENT_KICKOFF@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DPU_ENC_RC_EVENT_KICKOFF@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dpu_encoder_resource_control
	cbz	w22, LBB0_12
; %bb.9:
	mov	x0, x20
	bl	_DRMID
	bl	_trace_dpu_enc_prepare_kickoff_reset
	ldr	w8, [x19]
	cbz	w8, LBB0_12
; %bb.10:
	mov	x20, #0
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	ldr	x0, [x8, x20, lsl #3]
	bl	_dpu_encoder_helper_hw_reset
	add	x20, x20, #1
	ldr	w8, [x19]
	cmp	x20, x8
	b.lo	LBB0_11
LBB0_12:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enc_prepare_for_kickoff"

	.comm	_DPU_ENC_ERR_NEEDS_HW_RESET,8,3 ; @DPU_ENC_ERR_NEEDS_HW_RESET
	.comm	_DPU_ENC_RC_EVENT_KICKOFF,4,2   ; @DPU_ENC_RC_EVENT_KICKOFF
.subsections_via_symbols
