	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pvr2_v4l2_release
_pvr2_v4l2_release:                     ## @pvr2_v4l2_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	8(%rbx), %rax
	movq	32(%rbx), %rcx
	movq	(%rcx), %r14
	leaq	8(%rbx), %r12
	movq	(%rax), %r13
	movq	_PVR2_TRACE_OPEN_CLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_pvr2_trace
	cmpq	$0, 24(%rbx)
	je	LBB0_4
## %bb.1:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_pvr2_hdw_set_streaming
	movq	24(%rbx), %rdi
	callq	_pvr2_ioread_get_stream
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rax, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_pvr2_stream_set_callback
LBB0_3:
	movq	24(%rbx), %rdi
	callq	_pvr2_ioread_destroy
	movq	$0, 24(%rbx)
LBB0_4:
	leaq	16(%rbx), %r13
	movq	%r13, %rdi
	callq	_v4l2_fh_del
	movq	%r13, %rdi
	callq	_v4l2_fh_exit
	movq	$0, (%r15)
	movq	%r12, %rdi
	callq	_pvr2_channel_done
	movq	_PVR2_TRACE_STRUCT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_pvr2_trace
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_kfree
	movq	$0, (%rbx)
LBB0_6:
	movq	%rbx, %rdi
	callq	_kfree
	movq	16(%r14), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.7:
	movq	8(%r14), %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	(%r14), %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_pvr2_v4l2_destroy_no_lock
LBB0_10:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PVR2_TRACE_OPEN_CLOSE,4,2      ## @PVR2_TRACE_OPEN_CLOSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pvr2_v4l2_release"

	.comm	_PVR2_TRACE_STRUCT,4,2          ## @PVR2_TRACE_STRUCT
L_.str.1:                               ## @.str.1
	.asciz	"Destroying pvr_v4l2_fh id=%p"

	.no_dead_strip	_pvr2_v4l2_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pvr2_v4l2_release
_pvr2_v4l2_release:                     ; @pvr2_v4l2_release
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	ldr	x20, [x0]
	ldr	x8, [x20, #32]
	ldr	x19, [x8]
	mov	x22, x20
	ldr	x8, [x22, #8]!
	ldr	x23, [x8]
Lloh0:
	adrp	x8, _PVR2_TRACE_OPEN_CLOSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PVR2_TRACE_OPEN_CLOSE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_pvr2_trace
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x0, x23
	mov	w1, #0
	bl	_pvr2_hdw_set_streaming
	ldr	x0, [x20, #24]
	bl	_pvr2_ioread_get_stream
	cbz	x0, LBB0_3
; %bb.2:
	mov	x1, #0
	mov	x2, #0
	bl	_pvr2_stream_set_callback
LBB0_3:
	ldr	x0, [x20, #24]
	bl	_pvr2_ioread_destroy
	str	xzr, [x20, #24]
LBB0_4:
	add	x23, x20, #16
	mov	x0, x23
	bl	_v4l2_fh_del
	mov	x0, x23
	bl	_v4l2_fh_exit
	str	xzr, [x21]
	mov	x0, x22
	bl	_pvr2_channel_done
Lloh5:
	adrp	x8, _PVR2_TRACE_STRUCT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PVR2_TRACE_STRUCT@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	str	x20, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_pvr2_trace
	ldr	x0, [x20]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_kfree
	str	xzr, [x20]
LBB0_6:
	mov	x0, x20
	bl	_kfree
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.7:
	ldr	x0, [x19, #8]
	bl	_list_empty
	cbz	x0, LBB0_10
; %bb.8:
	ldr	x0, [x19]
	bl	_list_empty
	cbz	x0, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_pvr2_v4l2_destroy_no_lock
LBB0_10:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PVR2_TRACE_OPEN_CLOSE,4,2      ; @PVR2_TRACE_OPEN_CLOSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pvr2_v4l2_release"

	.comm	_PVR2_TRACE_STRUCT,4,2          ; @PVR2_TRACE_STRUCT
l_.str.1:                               ; @.str.1
	.asciz	"Destroying pvr_v4l2_fh id=%p"

	.no_dead_strip	_pvr2_v4l2_release
.subsections_via_symbols
