	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_encoder_setup              ## -- Begin function dpu_encoder_setup
	.p2align	4, 0x90
_dpu_encoder_setup:                     ## @dpu_encoder_setup
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	(%rdi), %rax
	movl	(%rax), %edi
	callq	_to_dpu_kms
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_to_dpu_encoder_virt
	movq	%rax, %rbx
	leaq	32(%rax), %rdi
	callq	_mutex_init
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r14, %rdx
	callq	_dpu_encoder_setup_display
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_1
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPU_ERROR
	jmp	LBB0_5
LBB0_1:
	leaq	28(%rbx), %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	leaq	24(%rbx), %rdi
	movq	_dpu_encoder_frame_done_timeout@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_timer_setup
	movq	(%r14), %rax
	movq	_DRM_MODE_ENCODER_DSI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
## %bb.2:
	leaq	20(%rbx), %rdi
	movq	_dpu_encoder_vsync_event_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_timer_setup
LBB0_3:
	leaq	16(%rbx), %rdi
	callq	_mutex_init
	leaq	12(%rbx), %rdi
	movq	_dpu_encoder_off_work@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_DELAYED_WORK
	movq	_IDLE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	addq	$4, %rdi
	movq	_dpu_encoder_vsync_event_work_handler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kthread_init_work
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$8, %edx
	callq	_memcpy
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_DPU_DEBUG_ENC
LBB0_5:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dpu_encoder_frame_done_timeout,4,2 ## @dpu_encoder_frame_done_timeout
	.comm	_DRM_MODE_ENCODER_DSI,8,3       ## @DRM_MODE_ENCODER_DSI
	.comm	_dpu_encoder_vsync_event_handler,4,2 ## @dpu_encoder_vsync_event_handler
	.comm	_dpu_encoder_off_work,4,2       ## @dpu_encoder_off_work
	.comm	_IDLE_TIMEOUT,4,2               ## @IDLE_TIMEOUT
	.comm	_dpu_encoder_vsync_event_work_handler,4,2 ## @dpu_encoder_vsync_event_work_handler
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"created\n"

L_.str.1:                               ## @.str.1
	.asciz	"failed to create encoder\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dpu_encoder_setup              ; -- Begin function dpu_encoder_setup
	.p2align	2
_dpu_encoder_setup:                     ; @dpu_encoder_setup
	.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	x19, x2
	mov	x20, x1
	ldr	x8, [x0]
	ldr	w0, [x8]
	bl	_to_dpu_kms
	mov	x21, x0
	mov	x0, x20
	bl	_to_dpu_encoder_virt
	mov	x20, x0
	add	x0, x0, #32
	bl	_mutex_init
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_dpu_encoder_setup_display
	mov	x21, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPU_ERROR
	b	LBB0_5
LBB0_2:
	add	x0, x20, #28
	mov	w1, #0
	bl	_atomic_set
	add	x0, x20, #24
Lloh2:
	adrp	x8, _dpu_encoder_frame_done_timeout@GOTPAGE
Lloh3:
	ldr	x8, [x8, _dpu_encoder_frame_done_timeout@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_timer_setup
	ldr	x8, [x19]
Lloh5:
	adrp	x9, _DRM_MODE_ENCODER_DSI@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DRM_MODE_ENCODER_DSI@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	add	x0, x20, #20
Lloh8:
	adrp	x8, _dpu_encoder_vsync_event_handler@GOTPAGE
Lloh9:
	ldr	x8, [x8, _dpu_encoder_vsync_event_handler@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_timer_setup
LBB0_4:
	add	x0, x20, #16
	bl	_mutex_init
	add	x0, x20, #12
Lloh11:
	adrp	x8, _dpu_encoder_off_work@GOTPAGE
Lloh12:
	ldr	x8, [x8, _dpu_encoder_off_work@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_INIT_DELAYED_WORK
Lloh14:
	adrp	x8, _IDLE_TIMEOUT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _IDLE_TIMEOUT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [x20, #8]
	add	x0, x20, #4
Lloh17:
	adrp	x8, _dpu_encoder_vsync_event_work_handler@GOTPAGE
Lloh18:
	ldr	x8, [x8, _dpu_encoder_vsync_event_work_handler@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_kthread_init_work
	mov	x0, x20
	mov	x1, x19
	mov	w2, #8
	bl	_memcpy
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_DPU_DEBUG_ENC
LBB0_5:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_dpu_encoder_frame_done_timeout,4,2 ; @dpu_encoder_frame_done_timeout
	.comm	_DRM_MODE_ENCODER_DSI,8,3       ; @DRM_MODE_ENCODER_DSI
	.comm	_dpu_encoder_vsync_event_handler,4,2 ; @dpu_encoder_vsync_event_handler
	.comm	_dpu_encoder_off_work,4,2       ; @dpu_encoder_off_work
	.comm	_IDLE_TIMEOUT,4,2               ; @IDLE_TIMEOUT
	.comm	_dpu_encoder_vsync_event_work_handler,4,2 ; @dpu_encoder_vsync_event_work_handler
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"created\n"

l_.str.1:                               ; @.str.1
	.asciz	"failed to create encoder\n"

.subsections_via_symbols
