	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mpeg_release
_mpeg_release:                          ## @mpeg_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
	movq	(%rdi), %r15
	movq	32(%r15), %r14
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	movq	%r14, %rdx
	callq	_dprintk
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	callq	_cx231xx_stop_TS1
	cmpq	$0, 8(%r14)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_cx231xx_uninit_isoc
	jmp	LBB0_3
LBB0_2:
	movq	%r14, %rdi
	callq	_cx231xx_uninit_bulk
LBB0_3:
	movq	_CX231XX_SUSPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_cx231xx_set_mode
	movq	32(%r15), %rdi
	movq	_CX2341X_ENC_STOP_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CX231xx_END_NOW@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_CX231xx_MPEG_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_CX231xx_RAW_BITS_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	$3, %edx
	xorl	%ecx, %ecx
	callq	_cx231xx_api_cmd
	leaq	24(%r15), %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_atomic_cmpxchg
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.4:
	leaq	4(%r14), %rdi
	callq	_atomic_dec_return
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_msleep
	movq	%r14, %rdi
	callq	_cx231xx_417_check_encoder
LBB0_6:
	leaq	8(%r15), %rbx
	cmpq	$0, 16(%r15)
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_videobuf_streamoff
LBB0_8:
	cmpq	$0, (%rbx)
	je	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_videobuf_read_stop
LBB0_10:
	movq	%rbx, %rdi
	callq	_videobuf_mmap_free
	movq	%r15, %rdi
	callq	_v4l2_fh_del
	movq	%r15, %rdi
	callq	_v4l2_fh_exit
	movq	%r15, %rdi
	callq	_kfree
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mpeg_release()! dev=0x%p\n"

	.comm	_CX231XX_SUSPEND,4,2            ## @CX231XX_SUSPEND
	.comm	_CX2341X_ENC_STOP_CAPTURE,4,2   ## @CX2341X_ENC_STOP_CAPTURE
	.comm	_CX231xx_END_NOW,4,2            ## @CX231xx_END_NOW
	.comm	_CX231xx_MPEG_CAPTURE,4,2       ## @CX231xx_MPEG_CAPTURE
	.comm	_CX231xx_RAW_BITS_NONE,4,2      ## @CX231xx_RAW_BITS_NONE
	.no_dead_strip	_mpeg_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mpeg_release
_mpeg_release:                          ; @mpeg_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	x20, [x0]
	ldr	x19, [x20, #32]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	mov	x2, x19
	bl	_dprintk
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	bl	_cx231xx_stop_TS1
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_cx231xx_uninit_isoc
	b	LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_cx231xx_uninit_bulk
LBB0_3:
Lloh2:
	adrp	x8, _CX231XX_SUSPEND@GOTPAGE
Lloh3:
	ldr	x8, [x8, _CX231XX_SUSPEND@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cx231xx_set_mode
	ldr	x0, [x20, #32]
Lloh5:
	adrp	x8, _CX2341X_ENC_STOP_CAPTURE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CX2341X_ENC_STOP_CAPTURE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _CX231xx_END_NOW@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CX231xx_END_NOW@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
Lloh11:
	adrp	x8, _CX231xx_MPEG_CAPTURE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CX231xx_MPEG_CAPTURE@GOTPAGEOFF]
Lloh13:
	ldr	w5, [x8]
Lloh14:
	adrp	x8, _CX231xx_RAW_BITS_NONE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CX231xx_RAW_BITS_NONE@GOTPAGEOFF]
Lloh16:
	ldr	w6, [x8]
	mov	w2, #3
	mov	w3, #0
	bl	_cx231xx_api_cmd
	add	x0, x20, #24
	mov	w1, #1
	mov	w2, #0
	bl	_atomic_cmpxchg
	cmp	w0, #1
	b.ne	LBB0_6
; %bb.4:
	add	x0, x19, #4
	bl	_atomic_dec_return
	cbnz	x0, LBB0_6
; %bb.5:
	mov	w0, #500
	bl	_msleep
	mov	x0, x19
	bl	_cx231xx_417_check_encoder
LBB0_6:
	add	x21, x20, #8
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_videobuf_streamoff
LBB0_8:
	ldr	x8, [x21]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x21
	bl	_videobuf_read_stop
LBB0_10:
	mov	x0, x21
	bl	_videobuf_mmap_free
	mov	x0, x20
	bl	_v4l2_fh_del
	mov	x0, x20
	bl	_v4l2_fh_exit
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	bl	_mutex_unlock
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mpeg_release()! dev=0x%p\n"

	.comm	_CX231XX_SUSPEND,4,2            ; @CX231XX_SUSPEND
	.comm	_CX2341X_ENC_STOP_CAPTURE,4,2   ; @CX2341X_ENC_STOP_CAPTURE
	.comm	_CX231xx_END_NOW,4,2            ; @CX231xx_END_NOW
	.comm	_CX231xx_MPEG_CAPTURE,4,2       ; @CX231xx_MPEG_CAPTURE
	.comm	_CX231xx_RAW_BITS_NONE,4,2      ; @CX231xx_RAW_BITS_NONE
	.no_dead_strip	_mpeg_release
.subsections_via_symbols
