	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx231xx_close
_cx231xx_close:                         ## @cx231xx_close
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r14
	movq	16(%r14), %r12
	movl	16(%r12), %esi
	leaq	L_.str(%rip), %rbx
	movq	%rbx, %rdi
	callq	_cx231xx_videodbg
	movl	16(%r12), %esi
	movq	%rbx, %rdi
	callq	_cx231xx_videodbg
	movq	%r14, %rdi
	callq	_res_check
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_res_free
LBB0_2:
	cmpl	$0, 28(%r12)
	jne	LBB0_11
## %bb.3:
	movq	(%r14), %rax
	movq	_V4L2_BUF_TYPE_VBI_CAPTURE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.4:
	leaq	24(%r14), %rbx
	movq	%rbx, %rdi
	callq	_videobuf_stop
	movq	%rbx, %rdi
	callq	_videobuf_mmap_free
	movq	_DEV_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_7
## %bb.5:
	leaq	24(%r12), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jg	LBB0_6
	jmp	LBB0_19
LBB0_11:
	leaq	8(%r14), %r15
	movq	%r15, %rdi
	callq	_v4l2_fh_del
	decl	16(%r12)
	je	LBB0_12
LBB0_17:
	movq	%r15, %rdi
	callq	_v4l2_fh_exit
	movq	%r14, %rdi
	callq	_kfree
LBB0_18:
	addq	$4, %r12
	movq	%r12, %rdi
	callq	_wake_up_interruptible
	jmp	LBB0_19
LBB0_12:
	leaq	24(%r14), %rbx
	movq	%rbx, %rdi
	callq	_videobuf_stop
	movq	%rbx, %rdi
	callq	_videobuf_mmap_free
	movq	_DEV_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_13
LBB0_6:
	movq	%r12, %rdi
	callq	_cx231xx_release_resources
	movq	$0, 16(%r14)
LBB0_19:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_tuner@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_standby@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_call_all
	cmpq	$0, 8(%r12)
	je	LBB0_15
## %bb.14:
	movq	%r12, %rdi
	callq	_cx231xx_uninit_isoc
	jmp	LBB0_16
LBB0_7:
	movq	%r12, %rdi
	callq	_cx231xx_uninit_vbi_isoc
	cmpl	$0, 20(%r12)
	jne	LBB0_8
## %bb.9:
	movq	_INDEX_VANC@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_15:
	movq	%r12, %rdi
	callq	_cx231xx_uninit_bulk
LBB0_16:
	movq	_CX231XX_SUSPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_cx231xx_set_mode
	movq	_INDEX_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_cx231xx_set_alt_setting
	jmp	LBB0_17
LBB0_8:
	movq	_INDEX_HANC@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_cx231xx_set_alt_setting
	leaq	8(%r14), %rbx
	movq	%rbx, %rdi
	callq	_v4l2_fh_del
	movq	%rbx, %rdi
	callq	_v4l2_fh_exit
	movq	%r14, %rdi
	callq	_kfree
	decl	16(%r12)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"users=%d\n"

	.comm	_V4L2_BUF_TYPE_VBI_CAPTURE,8,3  ## @V4L2_BUF_TYPE_VBI_CAPTURE
	.comm	_DEV_DISCONNECTED,4,2           ## @DEV_DISCONNECTED
	.comm	_INDEX_VANC,4,2                 ## @INDEX_VANC
	.comm	_INDEX_HANC,4,2                 ## @INDEX_HANC
	.comm	_tuner,4,2                      ## @tuner
	.comm	_standby,4,2                    ## @standby
	.comm	_CX231XX_SUSPEND,4,2            ## @CX231XX_SUSPEND
	.comm	_INDEX_VIDEO,4,2                ## @INDEX_VIDEO
	.no_dead_strip	_cx231xx_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx231xx_close
_cx231xx_close:                         ; @cx231xx_close
	.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	x19, [x0]
	ldr	x20, [x19, #16]
	ldr	w1, [x20, #16]
Lloh0:
	adrp	x21, l_.str@PAGE
Lloh1:
	add	x21, x21, l_.str@PAGEOFF
	mov	x0, x21
	bl	_cx231xx_videodbg
	ldr	w1, [x20, #16]
	mov	x0, x21
	bl	_cx231xx_videodbg
	mov	x0, x19
	bl	_res_check
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_res_free
LBB0_2:
	ldr	w8, [x20, #28]
	cbnz	w8, LBB0_6
; %bb.3:
	ldr	x8, [x19]
Lloh2:
	adrp	x9, _V4L2_BUF_TYPE_VBI_CAPTURE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _V4L2_BUF_TYPE_VBI_CAPTURE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	add	x21, x19, #24
	mov	x0, x21
	bl	_videobuf_stop
	mov	x0, x21
	bl	_videobuf_mmap_free
	ldr	w8, [x20]
Lloh5:
	adrp	x9, _DEV_DISCONNECTED@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DEV_DISCONNECTED@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.5:
	add	x0, x20, #24
	bl	_atomic_read
	cmp	x0, #1
	b.ge	LBB0_10
	b	LBB0_11
LBB0_6:
	add	x21, x19, #8
	mov	x0, x21
	bl	_v4l2_fh_del
	ldr	w8, [x20, #16]
	subs	w8, w8, #1
	str	w8, [x20, #16]
	b.eq	LBB0_9
LBB0_7:
	mov	x0, x21
	bl	_v4l2_fh_exit
	mov	x0, x19
	bl	_kfree
LBB0_8:
	add	x0, x20, #4
	bl	_wake_up_interruptible
	b	LBB0_11
LBB0_9:
	add	x22, x19, #24
	mov	x0, x22
	bl	_videobuf_stop
	mov	x0, x22
	bl	_videobuf_mmap_free
	ldr	w8, [x20]
Lloh8:
	adrp	x9, _DEV_DISCONNECTED@GOTPAGE
Lloh9:
	ldr	x9, [x9, _DEV_DISCONNECTED@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
LBB0_10:
	mov	x0, x20
	bl	_cx231xx_release_resources
	str	xzr, [x19, #16]
LBB0_11:
	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
LBB0_12:
Lloh11:
	adrp	x8, _tuner@GOTPAGE
Lloh12:
	ldr	x8, [x8, _tuner@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _standby@GOTPAGE
Lloh15:
	ldr	x8, [x8, _standby@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_call_all
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_15
; %bb.13:
	mov	x0, x20
	bl	_cx231xx_uninit_isoc
	b	LBB0_16
LBB0_14:
	mov	x0, x20
	bl	_cx231xx_uninit_vbi_isoc
Lloh17:
	adrp	x8, _INDEX_VANC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _INDEX_VANC@GOTPAGEOFF]
	ldr	w9, [x20, #20]
Lloh19:
	adrp	x10, _INDEX_HANC@GOTPAGE
Lloh20:
	ldr	x10, [x10, _INDEX_HANC@GOTPAGEOFF]
	cmp	w9, #0
	csel	x8, x8, x10, eq
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_cx231xx_set_alt_setting
	add	x21, x19, #8
	mov	x0, x21
	bl	_v4l2_fh_del
	mov	x0, x21
	bl	_v4l2_fh_exit
	mov	x0, x19
	bl	_kfree
	ldr	w8, [x20, #16]
	sub	w8, w8, #1
	str	w8, [x20, #16]
	b	LBB0_8
LBB0_15:
	mov	x0, x20
	bl	_cx231xx_uninit_bulk
LBB0_16:
Lloh21:
	adrp	x8, _CX231XX_SUSPEND@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CX231XX_SUSPEND@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_cx231xx_set_mode
Lloh24:
	adrp	x8, _INDEX_VIDEO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _INDEX_VIDEO@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #0
	bl	_cx231xx_set_alt_setting
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"users=%d\n"

	.comm	_V4L2_BUF_TYPE_VBI_CAPTURE,8,3  ; @V4L2_BUF_TYPE_VBI_CAPTURE
	.comm	_DEV_DISCONNECTED,4,2           ; @DEV_DISCONNECTED
	.comm	_INDEX_VANC,4,2                 ; @INDEX_VANC
	.comm	_INDEX_HANC,4,2                 ; @INDEX_HANC
	.comm	_tuner,4,2                      ; @tuner
	.comm	_standby,4,2                    ; @standby
	.comm	_CX231XX_SUSPEND,4,2            ; @CX231XX_SUSPEND
	.comm	_INDEX_VIDEO,4,2                ; @INDEX_VIDEO
	.no_dead_strip	_cx231xx_close
.subsections_via_symbols
