	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5p_mfc_release
_s5p_mfc_release:                       ## @s5p_mfc_release
	.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
	movl	(%rdi), %edi
	callq	_fh_to_ctx
	movq	%rax, %rbx
	movq	%rax, %r14
	movq	32(%rax), %r15
	xorl	%eax, %eax
	callq	_mfc_debug_enter
	testq	%r15, %r15
	je	LBB0_9
## %bb.1:
	leaq	16(%r15), %rdi
	callq	_mutex_lock
	leaq	24(%rbx), %rdi
	callq	_vb2_queue_release
	leaq	20(%rbx), %rdi
	callq	_vb2_queue_release
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_on
	movq	%r14, %rdi
	callq	_clear_work_bit_irqsave
	movq	(%r14), %rax
	movq	_MFCINST_FREE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.2:
	movq	_MFCINST_INIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	callq	_mfc_debug
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_s5p_mfc_close_mfc_inst
LBB0_4:
	movq	(%r15), %rax
	cmpq	8(%r14), %rax
	jne	LBB0_6
## %bb.5:
	leaq	36(%r15), %rsi
	xorl	%edi, %edi
	callq	_clear_bit
LBB0_6:
	decq	8(%r15)
	je	LBB0_7
## %bb.10:
	leaq	L_.str.3(%rip), %rsi
	movl	$2, %edi
	callq	_mfc_debug
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_off
	jmp	LBB0_11
LBB0_9:
	leaq	24(%rbx), %rdi
	callq	_vb2_queue_release
	leaq	20(%rbx), %rdi
	callq	_vb2_queue_release
	jmp	LBB0_12
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	movl	$2, %edi
	callq	_mfc_debug
	movq	%r15, %rdi
	callq	_s5p_mfc_deinit_hw
	leaq	32(%r15), %rdi
	callq	_del_timer_sync
	xorl	%eax, %eax
	callq	_s5p_mfc_clock_off
	xorl	%eax, %eax
	callq	_s5p_mfc_power_off
	testq	%rax, %rax
	jns	LBB0_11
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	callq	_mfc_err
LBB0_11:
	movq	24(%r15), %rax
	movq	8(%r14), %rcx
	movq	$0, (%rax,%rcx,8)
LBB0_12:
	movq	%r14, %rdi
	callq	_s5p_mfc_dec_ctrls_delete
	addq	$16, %rbx
	movq	%rbx, %rdi
	callq	_v4l2_fh_del
	testq	%r15, %r15
	je	LBB0_14
## %bb.13:
	movq	%rbx, %rdi
	callq	_v4l2_fh_exit
	movq	%r14, %rdi
	callq	_kfree
	xorl	%eax, %eax
	callq	_mfc_debug_leave
	addq	$16, %r15
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_15
LBB0_14:
	movq	%r14, %rdi
	callq	_kfree
	xorl	%eax, %eax
	callq	_mfc_debug_leave
LBB0_15:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MFCINST_FREE,8,3               ## @MFCINST_FREE
	.comm	_MFCINST_INIT,8,3               ## @MFCINST_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Has to free instance\n"

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

L_.str.2:                               ## @.str.2
	.asciz	"Power off failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"Shutting down clock\n"

	.no_dead_strip	_s5p_mfc_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5p_mfc_release
_s5p_mfc_release:                       ; @s5p_mfc_release
	.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
	ldr	w0, [x0]
	bl	_fh_to_ctx
	mov	x20, x0
	ldr	x19, [x0, #32]
	bl	_mfc_debug_enter
	cbz	x19, LBB0_7
; %bb.1:
	add	x0, x19, #16
	bl	_mutex_lock
	add	x0, x20, #24
	bl	_vb2_queue_release
	add	x0, x20, #20
	bl	_vb2_queue_release
	bl	_s5p_mfc_clock_on
	mov	x0, x20
	bl	_clear_work_bit_irqsave
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _MFCINST_FREE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MFCINST_FREE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _MFCINST_INIT@GOTPAGE
Lloh4:
	ldr	x10, [x10, _MFCINST_INIT@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.eq	LBB0_3
; %bb.2:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	mov	x0, x19
	mov	x1, x20
	bl	_s5p_mfc_close_mfc_inst
LBB0_3:
	ldr	x8, [x19]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.4:
	add	x1, x19, #36
	mov	w0, #0
	bl	_clear_bit
LBB0_5:
	ldr	x8, [x19, #8]
	subs	x8, x8, #1
	str	x8, [x19, #8]
	b.eq	LBB0_8
; %bb.6:
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	bl	_s5p_mfc_clock_off
	b	LBB0_10
LBB0_7:
	add	x0, x20, #24
	bl	_vb2_queue_release
	add	x0, x20, #20
	bl	_vb2_queue_release
	b	LBB0_11
LBB0_8:
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #2
	bl	_mfc_debug
	mov	x0, x19
	bl	_s5p_mfc_deinit_hw
	add	x0, x19, #32
	bl	_del_timer_sync
	bl	_s5p_mfc_clock_off
	bl	_s5p_mfc_power_off
	tbz	x0, #63, LBB0_10
; %bb.9:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_mfc_err
LBB0_10:
	ldr	x8, [x19, #24]
	ldr	x9, [x20, #8]
	str	xzr, [x8, x9, lsl #3]
LBB0_11:
	mov	x0, x20
	bl	_s5p_mfc_dec_ctrls_delete
	add	x21, x20, #16
	mov	x0, x21
	bl	_v4l2_fh_del
	cbz	x19, LBB0_13
; %bb.12:
	mov	x0, x21
	bl	_v4l2_fh_exit
	mov	x0, x20
	bl	_kfree
	bl	_mfc_debug_leave
	add	x0, x19, #16
	bl	_mutex_unlock
	b	LBB0_14
LBB0_13:
	mov	x0, x20
	bl	_kfree
	bl	_mfc_debug_leave
LBB0_14:
	mov	w0, #0
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_MFCINST_FREE,8,3               ; @MFCINST_FREE
	.comm	_MFCINST_INIT,8,3               ; @MFCINST_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Has to free instance\n"

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

l_.str.2:                               ; @.str.2
	.asciz	"Power off failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"Shutting down clock\n"

	.no_dead_strip	_s5p_mfc_release
.subsections_via_symbols
