	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function venc_open
_venc_open:                             ## @venc_open
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_video_drvdata
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$72, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	leaq	64(%rax), %rdi
	callq	_INIT_LIST_HEAD
	leaq	60(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	56(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	52(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	48(%r12), %rdi
	callq	_mutex_init
	movq	%r14, 40(%r12)
	movq	_VIDC_SESSION_TYPE_ENC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movq	%r12, %rdi
	callq	_venus_helper_init_instance
	movl	(%r14), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r12, %rdi
	callq	_venc_ctrl_init
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.5:
	movq	_venc_hfi_ops@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_hfi_session_create
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	%r12, %rdi
	callq	_venc_inst_init
	movq	_venc_m2m_ops@GOTPCREL(%rip), %rdi
	callq	_v4l2_m2m_init
	movl	%eax, (%r12)
	movl	%eax, %edi
	callq	_IS_ERR
	movl	(%r12), %edi
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	callq	_PTR_ERR
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_3:
	movl	%eax, %ebx
	jmp	LBB0_13
LBB0_8:
	movq	_m2m_queue_init@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rsi
	callq	_v4l2_m2m_ctx_init
	movl	%eax, 24(%r12)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.9:
	movl	24(%r12), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movl	(%r12), %edi
	callq	_v4l2_m2m_release
LBB0_10:
	movq	%r12, %rdi
	callq	_hfi_session_destroy
LBB0_11:
	movq	%r12, %rdi
	callq	_venc_ctrl_deinit
LBB0_12:
	movl	(%r14), %edi
	callq	_pm_runtime_put_sync
LBB0_13:
	movq	%r12, %rdi
	callq	_kfree
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	leaq	8(%r12), %rbx
	movl	4(%r14), %esi
	movq	%rbx, %rdi
	callq	_v4l2_fh_init
	movq	%r12, %rax
	addq	$28, %rax
	movq	%rax, 16(%r12)
	movq	%rbx, %rdi
	callq	_v4l2_fh_add
	movl	24(%r12), %eax
	movl	%eax, 8(%r12)
	movq	%rbx, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VIDC_SESSION_TYPE_ENC,4,2      ## @VIDC_SESSION_TYPE_ENC
	.comm	_venc_hfi_ops,4,2               ## @venc_hfi_ops
	.comm	_venc_m2m_ops,4,2               ## @venc_m2m_ops
	.comm	_m2m_queue_init,4,2             ## @m2m_queue_init
	.no_dead_strip	_venc_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function venc_open
_venc_open:                             ; @venc_open
	.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	x21, x0
	bl	_video_drvdata
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #72
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	add	x0, x0, #64
	bl	_INIT_LIST_HEAD
	add	x0, x19, #60
	bl	_INIT_LIST_HEAD
	add	x0, x19, #56
	bl	_INIT_LIST_HEAD
	add	x0, x19, #52
	bl	_INIT_LIST_HEAD
	add	x0, x19, #48
	bl	_mutex_init
	str	x20, [x19, #40]
Lloh3:
	adrp	x8, _VIDC_SESSION_TYPE_ENC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDC_SESSION_TYPE_ENC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19, #32]
	mov	x0, x19
	bl	_venus_helper_init_instance
	ldr	w0, [x20]
	bl	_pm_runtime_get_sync
	tbnz	w0, #31, LBB0_7
; %bb.2:
	mov	x0, x19
	bl	_venc_ctrl_init
	mov	x22, x0
	cbnz	w0, LBB0_12
; %bb.3:
Lloh6:
	adrp	x1, _venc_hfi_ops@GOTPAGE
Lloh7:
	ldr	x1, [x1, _venc_hfi_ops@GOTPAGEOFF]
	mov	x0, x19
	bl	_hfi_session_create
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.4:
	mov	x0, x19
	bl	_venc_inst_init
Lloh8:
	adrp	x0, _venc_m2m_ops@GOTPAGE
Lloh9:
	ldr	x0, [x0, _venc_m2m_ops@GOTPAGEOFF]
	bl	_v4l2_m2m_init
	str	w0, [x19]
	bl	_IS_ERR
	mov	x8, x0
	ldr	w0, [x19]
	cbz	x8, LBB0_8
; %bb.5:
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_10
LBB0_6:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_7:
	mov	x22, x0
	b	LBB0_13
LBB0_8:
Lloh13:
	adrp	x8, _m2m_queue_init@GOTPAGE
Lloh14:
	ldr	x8, [x8, _m2m_queue_init@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_v4l2_m2m_ctx_init
	str	w0, [x19, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_15
; %bb.9:
	ldr	w0, [x19, #24]
	bl	_PTR_ERR
	mov	x22, x0
	ldr	w0, [x19]
	bl	_v4l2_m2m_release
LBB0_10:
	mov	x0, x19
	bl	_hfi_session_destroy
LBB0_11:
	mov	x0, x19
	bl	_venc_ctrl_deinit
LBB0_12:
	ldr	w0, [x20]
	bl	_pm_runtime_put_sync
LBB0_13:
	mov	x0, x19
	bl	_kfree
LBB0_14:
	mov	x0, x22
	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
LBB0_15:
	add	x23, x19, #8
	ldr	w1, [x20, #4]
	mov	x0, x23
	bl	_v4l2_fh_init
	add	x8, x19, #28
	str	x8, [x19, #16]
	mov	x0, x23
	bl	_v4l2_fh_add
	mov	w22, #0
	ldr	w8, [x19, #24]
	str	w8, [x19, #8]
	str	x23, [x21]
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VIDC_SESSION_TYPE_ENC,4,2      ; @VIDC_SESSION_TYPE_ENC
	.comm	_venc_hfi_ops,4,2               ; @venc_hfi_ops
	.comm	_venc_m2m_ops,4,2               ; @venc_m2m_ops
	.comm	_m2m_queue_init,4,2             ; @m2m_queue_init
	.no_dead_strip	_venc_open
.subsections_via_symbols
