	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_close_mfc_inst         ## -- Begin function s5p_mfc_close_mfc_inst
	.p2align	4, 0x90
_s5p_mfc_close_mfc_inst:                ## @s5p_mfc_close_mfc_inst
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_MFCINST_RETURN_INST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rsi)
	movq	%rsi, %rdi
	callq	_set_work_bit_irqsave
	movl	16(%r14), %edi
	movq	_try_run@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_s5p_mfc_hw_call
	movq	_S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_s5p_mfc_wait_for_done_ctx
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_mfc_err
LBB0_2:
	movl	16(%r14), %edi
	movq	_release_codec_buffers@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_s5p_mfc_hw_call
	movl	16(%r14), %edi
	movq	_release_instance_buffer@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_s5p_mfc_hw_call
	movq	(%rbx), %rax
	movq	_MFCINST_DECODER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.3:
	movl	16(%r14), %edi
	movq	_release_dec_desc_buffer@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_s5p_mfc_hw_call
LBB0_4:
	movq	_MFC_NO_INSTANCE_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_MFCINST_FREE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MFCINST_RETURN_INST,4,2        ## @MFCINST_RETURN_INST
	.comm	_try_run,4,2                    ## @try_run
	.comm	_S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET,4,2 ## @S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Err returning instance\n"

	.comm	_release_codec_buffers,4,2      ## @release_codec_buffers
	.comm	_release_instance_buffer,4,2    ## @release_instance_buffer
	.comm	_MFCINST_DECODER,8,3            ## @MFCINST_DECODER
	.comm	_release_dec_desc_buffer,4,2    ## @release_dec_desc_buffer
	.comm	_MFC_NO_INSTANCE_SET,4,2        ## @MFC_NO_INSTANCE_SET
	.comm	_MFCINST_FREE,4,2               ## @MFCINST_FREE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_s5p_mfc_close_mfc_inst         ; -- Begin function s5p_mfc_close_mfc_inst
	.p2align	2
_s5p_mfc_close_mfc_inst:                ; @s5p_mfc_close_mfc_inst
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _MFCINST_RETURN_INST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MFCINST_RETURN_INST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x1, #8]
	mov	x0, x1
	bl	_set_work_bit_irqsave
	ldr	w0, [x20, #16]
Lloh3:
	adrp	x8, _try_run@GOTPAGE
Lloh4:
	ldr	x8, [x8, _try_run@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x2, x20
	bl	_s5p_mfc_hw_call
Lloh6:
	adrp	x8, _S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET@GOTPAGE
Lloh7:
	ldr	x8, [x8, _S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_s5p_mfc_wait_for_done_ctx
	cbz	x0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_mfc_err
LBB0_2:
	ldr	w0, [x20, #16]
Lloh11:
	adrp	x8, _release_codec_buffers@GOTPAGE
Lloh12:
	ldr	x8, [x8, _release_codec_buffers@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_s5p_mfc_hw_call
	ldr	w0, [x20, #16]
Lloh14:
	adrp	x8, _release_instance_buffer@GOTPAGE
Lloh15:
	ldr	x8, [x8, _release_instance_buffer@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_s5p_mfc_hw_call
	ldr	x8, [x19]
Lloh17:
	adrp	x9, _MFCINST_DECODER@GOTPAGE
Lloh18:
	ldr	x9, [x9, _MFCINST_DECODER@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x20, #16]
Lloh20:
	adrp	x8, _release_dec_desc_buffer@GOTPAGE
Lloh21:
	ldr	x8, [x8, _release_dec_desc_buffer@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_s5p_mfc_hw_call
LBB0_4:
Lloh23:
	adrp	x8, _MFC_NO_INSTANCE_SET@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MFC_NO_INSTANCE_SET@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _MFCINST_FREE@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MFCINST_FREE@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_MFCINST_RETURN_INST,4,2        ; @MFCINST_RETURN_INST
	.comm	_try_run,4,2                    ; @try_run
	.comm	_S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET,4,2 ; @S5P_MFC_R2H_CMD_CLOSE_INSTANCE_RET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Err returning instance\n"

	.comm	_release_codec_buffers,4,2      ; @release_codec_buffers
	.comm	_release_instance_buffer,4,2    ; @release_instance_buffer
	.comm	_MFCINST_DECODER,8,3            ; @MFCINST_DECODER
	.comm	_release_dec_desc_buffer,4,2    ; @release_dec_desc_buffer
	.comm	_MFC_NO_INSTANCE_SET,4,2        ; @MFC_NO_INSTANCE_SET
	.comm	_MFCINST_FREE,4,2               ; @MFCINST_FREE
.subsections_via_symbols
