	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tm6000_release
_tm6000_release:                        ## @tm6000_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r14
	movq	16(%r14), %rbx
	callq	_video_devdata
	movq	_V4L2_DEBUG_OPEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
	movq	%rax, %rdi
	callq	_video_device_node_name
	movl	24(%rbx), %r8d
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movl	%eax, %ecx
	callq	_dprintk
	movq	%rbx, %rdi
	callq	_mutex_lock
	decl	24(%rbx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_res_free
	cmpl	$0, 24(%rbx)
	jne	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_tm6000_uninit_isoc
	movq	%rbx, %rdi
	callq	_tm6000_ir_int_stop
	movl	8(%rbx), %edi
	callq	_usb_reset_configuration
	xorl	%edx, %edx
	cmpq	$0, 16(%rbx)
	setne	%dl
	movl	4(%rbx), %esi
	movl	8(%rbx), %edi
	addl	%edx, %edx
	callq	_usb_set_interface
	movq	%rbx, %rdi
	callq	_tm6000_ir_int_start
	cmpl	$0, 8(%r14)
	jne	LBB0_3
## %bb.2:
	leaq	4(%r14), %rdi
	callq	_videobuf_mmap_free
LBB0_3:
	movq	%r14, %rdi
	callq	_v4l2_fh_del
	movq	%r14, %rdi
	callq	_v4l2_fh_exit
	movq	%r14, %rdi
	callq	_kfree
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_DEBUG_OPEN,4,2            ## @V4L2_DEBUG_OPEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tm6000: close called (dev=%s, users=%d)\n"

	.no_dead_strip	_tm6000_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tm6000_release
_tm6000_release:                        ; @tm6000_release
	.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	x20, [x0]
	ldr	x19, [x20, #16]
	bl	_video_devdata
Lloh0:
	adrp	x8, _V4L2_DEBUG_OPEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _V4L2_DEBUG_OPEN@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	bl	_video_device_node_name
	mov	x3, x0
	ldr	w4, [x19, #24]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	bl	_dprintk
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x19, #24]
	sub	w8, w8, #1
	str	w8, [x19, #24]
	mov	x0, x19
	mov	x1, x20
	bl	_res_free
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_tm6000_uninit_isoc
	mov	x0, x19
	bl	_tm6000_ir_int_stop
	ldr	w0, [x19, #8]
	bl	_usb_reset_configuration
	ldr	x8, [x19, #16]
	cmp	x8, #0
	cset	w8, ne
	ldp	w1, w0, [x19, #4]
	lsl	w2, w8, #1
	bl	_usb_set_interface
	mov	x0, x19
	bl	_tm6000_ir_int_start
	ldr	w8, [x20, #8]
	cbnz	w8, LBB0_3
; %bb.2:
	add	x0, x20, #4
	bl	_videobuf_mmap_free
LBB0_3:
	mov	x0, x20
	bl	_v4l2_fh_del
	mov	x0, x20
	bl	_v4l2_fh_exit
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	bl	_mutex_unlock
	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
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_DEBUG_OPEN,4,2            ; @V4L2_DEBUG_OPEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tm6000: close called (dev=%s, users=%d)\n"

	.no_dead_strip	_tm6000_release
.subsections_via_symbols
