	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movq	(%r12), %rbx
	movq	24(%r12), %r14
	movq	32(%r14), %r13
	shlq	$4, %rbx
	movl	12(%r13,%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_IOCTL
	leaq	24(%r14), %rdi
	movl	16(%r12), %esi
	callq	_v4l2_prio_close
	movq	(%r13,%rbx), %rax
	cmpq	8(%r12), %rax
	jne	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r12), %rax
	movq	_CX18_ENC_STREAM_TYPE_RAD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	leaq	(%rbx,%r13), %r15
	movq	%r14, %rdi
	callq	_cx18_mute
	movq	_CX18_F_I_RADIO_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	20(%r14), %rsi
	callq	_clear_bit
	movq	_core@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_s_std@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	16(%r14), %ecx
	movq	%r14, %rdi
	callq	_cx18_call_all
	movq	%r14, %rdi
	callq	_cx18_audio_set_io
	leaq	12(%r14), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_5
## %bb.4:
	movq	_CX18_CPU_SET_VIDEO_MUTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r13,%rbx), %ecx
	movl	8(%r14), %r8d
	shll	$8, %r8d
	orl	4(%r14), %r8d
	movq	%r14, %rdi
	movl	$2, %edx
	callq	_cx18_vapi
LBB0_5:
	movq	%r14, %rdi
	callq	_cx18_unmute
	movq	%r15, %rdi
	callq	_cx18_release_stream
	jmp	LBB0_7
LBB0_1:
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_8
LBB0_6:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_cx18_stop_capture
LBB0_7:
	movq	%r12, %rdi
	callq	_kfree
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %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	_core,4,2                       ## @core
	.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	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x19, [x0]
	ldr	x20, [x19, #24]
	ldr	x22, [x20, #32]
	ldr	x23, [x19]
	add	x21, x22, x23, lsl #4
	ldr	w1, [x21, #12]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_IOCTL
	add	x0, x20, #24
	ldr	w1, [x19, #16]
	bl	_v4l2_prio_close
	ldr	x8, [x21]
	ldr	x9, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x19]
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_6
; %bb.2:
	mov	x0, x20
	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, x20, #20
	bl	_clear_bit
Lloh8:
	adrp	x8, _core@GOTPAGE
Lloh9:
	ldr	x8, [x8, _core@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _s_std@GOTPAGE
Lloh12:
	ldr	x8, [x8, _s_std@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	ldr	w3, [x20, #16]
	mov	x0, x20
	bl	_cx18_call_all
	mov	x0, x20
	bl	_cx18_audio_set_io
	add	x0, x20, #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	w1, [x8]
	add	x8, x22, x23, lsl #4
	ldr	w3, [x8, #8]
	ldp	w8, w9, [x20, #4]
	orr	w4, w8, w9, lsl #8
	mov	x0, x20
	mov	w2, #2
	bl	_cx18_vapi
LBB0_4:
	mov	x0, x20
	bl	_cx18_unmute
	mov	x0, x21
	bl	_cx18_release_stream
	b	LBB0_7
LBB0_5:
	mov	x0, x19
	bl	_kfree
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	mov	w1, #0
	bl	_cx18_stop_capture
LBB0_7:
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	bl	_mutex_unlock
LBB0_8:
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.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	_core,4,2                       ; @core
	.comm	_s_std,4,2                      ; @s_std
	.comm	_CX18_CPU_SET_VIDEO_MUTE,4,2    ; @CX18_CPU_SET_VIDEO_MUTE
.subsections_via_symbols
