	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_v4l2_close                ## -- Begin function cx18_v4l2_close
	.p2align	4, 0x90
_cx18_v4l2_close:                       ## @cx18_v4l2_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	movq	%r15, %rdi
	callq	_fh2id
	movq	%rax, %r14
	movq	(%rax), %r13
	movq	16(%rax), %r12
	movq	24(%r12), %rax
	shlq	$4, %r13
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	12(%rax,%r13), %esi
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_IOCTL
	movq	%r12, %rdi
	callq	_mutex_lock
	movq	(%r14), %rax
	movq	_CX18_ENC_STREAM_TYPE_RAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	movq	%rbx, %rdi
	callq	_v4l2_fh_is_singular_file
	testq	%rax, %rax
	je	LBB0_5
## %bb.2:
	movq	%r12, %rdi
	callq	_cx18_mute
	movq	_CX18_F_I_RADIO_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	20(%r12), %rsi
	callq	_clear_bit
	movq	_video@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_s_std@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r12), %ecx
	movq	%r12, %rdi
	callq	_cx18_call_all
	movq	%r12, %rdi
	callq	_cx18_audio_set_io
	leaq	12(%r12), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_4
## %bb.3:
	movq	_CX18_CPU_SET_VIDEO_MUTE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax,%r13), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	8(%r12), %edi
	callq	_v4l2_ctrl_g_ctrl
	movl	%eax, %ebx
	movl	4(%r12), %edi
	callq	_v4l2_ctrl_g_ctrl
	shll	$8, %eax
	orl	%eax, %ebx
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$2, %edx
	movl	-48(%rbp), %ecx                 ## 4-byte Reload
	movl	%ebx, %r8d
	callq	_cx18_vapi
LBB0_4:
	movq	%r12, %rdi
	callq	_cx18_unmute
LBB0_5:
	movq	%r15, %rdi
	callq	_v4l2_fh_del
	movq	%r15, %rdi
	callq	_v4l2_fh_exit
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax,%r13), %rax
	cmpq	8(%r14), %rax
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_cx18_stop_capture
LBB0_7:
	movq	%r14, %rdi
	callq	_kfree
	movq	%r12, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"close() of %s\n"

	.comm	_CX18_ENC_STREAM_TYPE_RAD,8,3   ## @CX18_ENC_STREAM_TYPE_RAD
	.comm	_CX18_F_I_RADIO_USER,4,2        ## @CX18_F_I_RADIO_USER
	.comm	_video,4,2                      ## @video
	.comm	_s_std,4,2                      ## @s_std
	.comm	_CX18_CPU_SET_VIDEO_MUTE,4,2    ## @CX18_CPU_SET_VIDEO_MUTE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cx18_v4l2_close                ; -- Begin function cx18_v4l2_close
	.p2align	2
_cx18_v4l2_close:                       ; @cx18_v4l2_close
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x22, x0
	ldr	x21, [x0]
	mov	x0, x21
	bl	_fh2id
	mov	x20, x0
	ldr	x19, [x0, #16]
	ldr	x25, [x19, #24]
	ldr	x26, [x0]
	add	x8, x25, x26, lsl #4
	ldr	w1, [x8, #12]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_IOCTL
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20]
Lloh2:
	adrp	x9, _CX18_ENC_STREAM_TYPE_RAD@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CX18_ENC_STREAM_TYPE_RAD@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	x0, x22
	bl	_v4l2_fh_is_singular_file
	cbz	x0, LBB0_5
; %bb.2:
	mov	x0, x19
	bl	_cx18_mute
Lloh5:
	adrp	x8, _CX18_F_I_RADIO_USER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CX18_F_I_RADIO_USER@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x19, #20
	bl	_clear_bit
Lloh8:
	adrp	x8, _video@GOTPAGE
Lloh9:
	ldr	x8, [x8, _video@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _s_std@GOTPAGE
Lloh12:
	ldr	x8, [x8, _s_std@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	ldr	w3, [x19, #16]
	mov	x0, x19
	bl	_cx18_call_all
	mov	x0, x19
	bl	_cx18_audio_set_io
	add	x0, x19, #12
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_4
; %bb.3:
Lloh14:
	adrp	x8, _CX18_CPU_SET_VIDEO_MUTE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _CX18_CPU_SET_VIDEO_MUTE@GOTPAGEOFF]
Lloh16:
	ldr	w22, [x8]
	add	x8, x25, x26, lsl #4
	ldr	w23, [x8, #8]
	ldr	w0, [x19, #8]
	bl	_v4l2_ctrl_g_ctrl
	mov	x24, x0
	ldr	w0, [x19, #4]
	bl	_v4l2_ctrl_g_ctrl
	orr	w4, w24, w0, lsl #8
	mov	x0, x19
	mov	x1, x22
	mov	w2, #2
	mov	x3, x23
	bl	_cx18_vapi
LBB0_4:
	mov	x0, x19
	bl	_cx18_unmute
LBB0_5:
	mov	x0, x21
	bl	_v4l2_fh_del
	mov	x0, x21
	bl	_v4l2_fh_exit
	lsl	x8, x26, #4
	ldr	x8, [x25, x8]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	mov	w1, #0
	bl	_cx18_stop_capture
LBB0_7:
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	bl	_mutex_unlock
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"close() of %s\n"

	.comm	_CX18_ENC_STREAM_TYPE_RAD,8,3   ; @CX18_ENC_STREAM_TYPE_RAD
	.comm	_CX18_F_I_RADIO_USER,4,2        ; @CX18_F_I_RADIO_USER
	.comm	_video,4,2                      ; @video
	.comm	_s_std,4,2                      ; @s_std
	.comm	_CX18_CPU_SET_VIDEO_MUTE,4,2    ; @CX18_CPU_SET_VIDEO_MUTE
.subsections_via_symbols
