	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdec_open
_vdec_open:                             ## @vdec_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	$88, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	leaq	80(%rax), %rdi
	callq	_INIT_LIST_HEAD
	leaq	76(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	leaq	72(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	leaq	68(%rbx), %rdi
	callq	_INIT_LIST_HEAD
	leaq	64(%rbx), %rdi
	callq	_mutex_init
	movq	%r14, 56(%rbx)
	movq	_VIDC_SESSION_TYPE_DEC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movl	$1, (%rbx)
	movq	_VENUS_DEC_STATE_DEINIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	movq	$0, 40(%rbx)
	leaq	32(%rbx), %rdi
	callq	_init_waitqueue_head
	movq	%rbx, %rdi
	callq	_venus_helper_init_instance
	movl	(%r14), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	callq	_vdec_ctrl_init
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_12
## %bb.5:
	movq	_vdec_hfi_ops@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_hfi_session_create
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	%rbx, %rdi
	callq	_vdec_inst_init
	movq	_vdec_m2m_ops@GOTPCREL(%rip), %rdi
	callq	_v4l2_m2m_init
	movl	%eax, 4(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	movl	4(%rbx), %edi
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	callq	_PTR_ERR
	movl	%eax, %r12d
	jmp	LBB0_10
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_3:
	movl	%eax, %r12d
	jmp	LBB0_13
LBB0_8:
	movq	_m2m_queue_init@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rsi
	callq	_v4l2_m2m_ctx_init
	movl	%eax, 24(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.9:
	movl	24(%rbx), %edi
	callq	_PTR_ERR
	movl	%eax, %r12d
	movl	4(%rbx), %edi
	callq	_v4l2_m2m_release
LBB0_10:
	movq	%rbx, %rdi
	callq	_hfi_session_destroy
LBB0_11:
	movq	%rbx, %rdi
	callq	_vdec_ctrl_deinit
LBB0_12:
	movl	(%r14), %edi
	callq	_pm_runtime_put_sync
LBB0_13:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_14:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	leaq	8(%rbx), %r12
	movl	4(%r14), %esi
	movq	%r12, %rdi
	callq	_v4l2_fh_init
	movq	%rbx, %rax
	addq	$28, %rax
	movq	%rax, 16(%rbx)
	movq	%r12, %rdi
	callq	_v4l2_fh_add
	movl	24(%rbx), %eax
	movl	%eax, 8(%rbx)
	movq	%r12, (%r15)
	xorl	%r12d, %r12d
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_VIDC_SESSION_TYPE_DEC,4,2      ## @VIDC_SESSION_TYPE_DEC
	.comm	_VENUS_DEC_STATE_DEINIT,4,2     ## @VENUS_DEC_STATE_DEINIT
	.comm	_vdec_hfi_ops,4,2               ## @vdec_hfi_ops
	.comm	_vdec_m2m_ops,4,2               ## @vdec_m2m_ops
	.comm	_m2m_queue_init,4,2             ## @m2m_queue_init
	.no_dead_strip	_vdec_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdec_open
_vdec_open:                             ; @vdec_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, #88
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	add	x0, x0, #80
	bl	_INIT_LIST_HEAD
	add	x0, x19, #76
	bl	_INIT_LIST_HEAD
	add	x0, x19, #72
	bl	_INIT_LIST_HEAD
	add	x0, x19, #68
	bl	_INIT_LIST_HEAD
	add	x0, x19, #64
	bl	_mutex_init
	str	x20, [x19, #56]
Lloh3:
	adrp	x8, _VIDC_SESSION_TYPE_DEC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDC_SESSION_TYPE_DEC@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	w9, #1
Lloh6:
	adrp	x10, _VENUS_DEC_STATE_DEINIT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _VENUS_DEC_STATE_DEINIT@GOTPAGEOFF]
	str	w9, [x19]
Lloh8:
	ldr	w9, [x10]
	stp	w9, w8, [x19, #48]
	str	xzr, [x19, #40]
	add	x0, x19, #32
	bl	_init_waitqueue_head
	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	_vdec_ctrl_init
	mov	x22, x0
	cbnz	w0, LBB0_12
; %bb.3:
Lloh9:
	adrp	x1, _vdec_hfi_ops@GOTPAGE
Lloh10:
	ldr	x1, [x1, _vdec_hfi_ops@GOTPAGEOFF]
	mov	x0, x19
	bl	_hfi_session_create
	mov	x22, x0
	cbnz	w0, LBB0_11
; %bb.4:
	mov	x0, x19
	bl	_vdec_inst_init
Lloh11:
	adrp	x0, _vdec_m2m_ops@GOTPAGE
Lloh12:
	ldr	x0, [x0, _vdec_m2m_ops@GOTPAGEOFF]
	bl	_v4l2_m2m_init
	str	w0, [x19, #4]
	bl	_IS_ERR
	mov	x8, x0
	ldr	w0, [x19, #4]
	cbz	x8, LBB0_8
; %bb.5:
	bl	_PTR_ERR
	mov	x22, x0
	b	LBB0_10
LBB0_6:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_14
LBB0_7:
	mov	x22, x0
	b	LBB0_13
LBB0_8:
Lloh16:
	adrp	x8, _m2m_queue_init@GOTPAGE
Lloh17:
	ldr	x8, [x8, _m2m_queue_init@GOTPAGEOFF]
Lloh18:
	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, #4]
	bl	_v4l2_m2m_release
LBB0_10:
	mov	x0, x19
	bl	_hfi_session_destroy
LBB0_11:
	mov	x0, x19
	bl	_vdec_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	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_VIDC_SESSION_TYPE_DEC,4,2      ; @VIDC_SESSION_TYPE_DEC
	.comm	_VENUS_DEC_STATE_DEINIT,4,2     ; @VENUS_DEC_STATE_DEINIT
	.comm	_vdec_hfi_ops,4,2               ; @vdec_hfi_ops
	.comm	_vdec_m2m_ops,4,2               ; @vdec_m2m_ops
	.comm	_m2m_queue_init,4,2             ; @m2m_queue_init
	.no_dead_strip	_vdec_open
.subsections_via_symbols
