	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function video_release
_video_release:                         ## @video_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, %r14
	movq	(%rdi), %rbx
	movq	40(%rbx), %r15
	movq	_RESOURCE_OVERLAY@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_res_check
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	8(%r15), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_stop_preview
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r13), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_res_free
LBB0_2:
	movq	_RESOURCE_VIDEO@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_res_check
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	24(%rbx), %rdi
	callq	_videobuf_streamoff
	movl	(%r12), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_res_free
LBB0_4:
	leaq	24(%rbx), %r12
	movq	24(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.5:
	movq	%r12, %rdi
	callq	_buffer_release
	movq	(%r12), %rdi
	callq	_kfree
LBB0_6:
	movq	_RESOURCE_VBI@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_res_check
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	16(%rbx), %rdi
	callq	_videobuf_stop
	movl	(%r13), %edx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_res_free
LBB0_8:
	movq	_SAA7134_OFMT_VIDEO_A@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$31, %esi
	xorl	%edx, %edx
	callq	_saa_andorb
	movq	_SAA7134_OFMT_VIDEO_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$31, %esi
	xorl	%edx, %edx
	callq	_saa_andorb
	movq	_SAA7134_OFMT_DATA_A@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$31, %esi
	xorl	%edx, %edx
	callq	_saa_andorb
	movq	_SAA7134_OFMT_DATA_B@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$31, %esi
	xorl	%edx, %edx
	callq	_saa_andorb
	movq	_core@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_s_power@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	callq	_saa_call_all
	cmpq	$0, 32(%rbx)
	je	LBB0_10
## %bb.9:
	movl	(%r13), %esi
	movq	_ioctl@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_SAA6588_CMD_CLOSE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %r8
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_saa_call_all
LBB0_10:
	movq	%r12, %rdi
	callq	_videobuf_mmap_free
	leaq	16(%rbx), %rdi
	callq	_videobuf_mmap_free
	movl	4(%r15), %edi
	leaq	8(%rbx), %rsi
	callq	_saa7134_pgtable_free
	movl	4(%r15), %edi
	leaq	4(%rbx), %rsi
	callq	_saa7134_pgtable_free
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_v4l2_prio_close
	movq	$0, (%r14)
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RESOURCE_OVERLAY,4,2           ## @RESOURCE_OVERLAY
	.comm	_RESOURCE_VIDEO,4,2             ## @RESOURCE_VIDEO
	.comm	_RESOURCE_VBI,4,2               ## @RESOURCE_VBI
	.comm	_SAA7134_OFMT_VIDEO_A,4,2       ## @SAA7134_OFMT_VIDEO_A
	.comm	_SAA7134_OFMT_VIDEO_B,4,2       ## @SAA7134_OFMT_VIDEO_B
	.comm	_SAA7134_OFMT_DATA_A,4,2        ## @SAA7134_OFMT_DATA_A
	.comm	_SAA7134_OFMT_DATA_B,4,2        ## @SAA7134_OFMT_DATA_B
	.comm	_core,4,2                       ## @core
	.comm	_s_power,4,2                    ## @s_power
	.comm	_ioctl,4,2                      ## @ioctl
	.comm	_SAA6588_CMD_CLOSE,4,2          ## @SAA6588_CMD_CLOSE
	.no_dead_strip	_video_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function video_release
_video_release:                         ; @video_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	x20, x0
	ldr	x19, [x0]
	ldr	x21, [x19, #40]
Lloh0:
	adrp	x23, _RESOURCE_OVERLAY@GOTPAGE
Lloh1:
	ldr	x23, [x23, _RESOURCE_OVERLAY@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_res_check
	cbz	x0, LBB0_2
; %bb.1:
	add	x22, x21, #8
	mov	x0, x22
	bl	_spin_lock_irqsave
	mov	x0, x21
	mov	x1, x19
	bl	_stop_preview
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	ldr	w2, [x23]
	mov	x0, x21
	mov	x1, x19
	bl	_res_free
LBB0_2:
Lloh2:
	adrp	x22, _RESOURCE_VIDEO@GOTPAGE
Lloh3:
	ldr	x22, [x22, _RESOURCE_VIDEO@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x19
	bl	_res_check
	cbz	x0, LBB0_4
; %bb.3:
	add	x0, x19, #24
	bl	_videobuf_streamoff
	ldr	w2, [x22]
	mov	x0, x21
	mov	x1, x19
	bl	_res_free
LBB0_4:
	mov	x22, x19
	ldr	x1, [x22, #24]!
	cbz	x1, LBB0_6
; %bb.5:
	mov	x0, x22
	bl	_buffer_release
	ldr	x0, [x22]
	bl	_kfree
LBB0_6:
Lloh4:
	adrp	x23, _RESOURCE_VBI@GOTPAGE
Lloh5:
	ldr	x23, [x23, _RESOURCE_VBI@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_res_check
	cbz	x0, LBB0_8
; %bb.7:
	add	x0, x19, #16
	bl	_videobuf_stop
	ldr	w2, [x23]
	mov	x0, x21
	mov	x1, x19
	bl	_res_free
LBB0_8:
Lloh6:
	adrp	x8, _SAA7134_OFMT_VIDEO_A@GOTPAGE
Lloh7:
	ldr	x8, [x8, _SAA7134_OFMT_VIDEO_A@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	w1, #31
	mov	w2, #0
	bl	_saa_andorb
Lloh9:
	adrp	x8, _SAA7134_OFMT_VIDEO_B@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SAA7134_OFMT_VIDEO_B@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	w1, #31
	mov	w2, #0
	bl	_saa_andorb
Lloh12:
	adrp	x8, _SAA7134_OFMT_DATA_A@GOTPAGE
Lloh13:
	ldr	x8, [x8, _SAA7134_OFMT_DATA_A@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	w1, #31
	mov	w2, #0
	bl	_saa_andorb
Lloh15:
	adrp	x8, _SAA7134_OFMT_DATA_B@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SAA7134_OFMT_DATA_B@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	mov	w1, #31
	mov	w2, #0
	bl	_saa_andorb
Lloh18:
	adrp	x23, _core@GOTPAGE
Lloh19:
	ldr	x23, [x23, _core@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh20:
	adrp	x8, _s_power@GOTPAGE
Lloh21:
	ldr	x8, [x8, _s_power@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x21
	mov	w3, #0
	bl	_saa_call_all
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w1, [x23]
Lloh23:
	adrp	x8, _ioctl@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ioctl@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
Lloh26:
	adrp	x8, _SAA6588_CMD_CLOSE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _SAA6588_CMD_CLOSE@GOTPAGEOFF]
Lloh28:
	ldr	w3, [x8]
	add	x8, sp, #8
	str	x8, [sp]
	mov	x0, x21
	bl	_saa_call_all
LBB0_10:
	mov	x0, x22
	bl	_videobuf_mmap_free
	add	x0, x19, #16
	bl	_videobuf_mmap_free
	ldr	w0, [x21, #4]
	add	x1, x19, #8
	bl	_saa7134_pgtable_free
	ldr	w0, [x21, #4]
	add	x1, x19, #4
	bl	_saa7134_pgtable_free
	ldr	w1, [x19]
	mov	x0, x21
	bl	_v4l2_prio_close
	str	xzr, [x20]
	mov	x0, x19
	bl	_kfree
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_RESOURCE_OVERLAY,4,2           ; @RESOURCE_OVERLAY
	.comm	_RESOURCE_VIDEO,4,2             ; @RESOURCE_VIDEO
	.comm	_RESOURCE_VBI,4,2               ; @RESOURCE_VBI
	.comm	_SAA7134_OFMT_VIDEO_A,4,2       ; @SAA7134_OFMT_VIDEO_A
	.comm	_SAA7134_OFMT_VIDEO_B,4,2       ; @SAA7134_OFMT_VIDEO_B
	.comm	_SAA7134_OFMT_DATA_A,4,2        ; @SAA7134_OFMT_DATA_A
	.comm	_SAA7134_OFMT_DATA_B,4,2        ; @SAA7134_OFMT_DATA_B
	.comm	_core,4,2                       ; @core
	.comm	_s_power,4,2                    ; @s_power
	.comm	_ioctl,4,2                      ; @ioctl
	.comm	_SAA6588_CMD_CLOSE,4,2          ; @SAA6588_CMD_CLOSE
	.no_dead_strip	_video_release
.subsections_via_symbols
