	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vicam_close
_vicam_close:                           ## @vicam_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), %rbx
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_set_camera_power
	movq	32(%rbx), %rdi
	callq	_kfree
	movl	24(%rbx), %edi
	movq	_VICAM_MAX_FRAME_SIZE@GOTPCREL(%rip), %rax
	movq	_VICAM_FRAMES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	imull	(%rax), %esi
	callq	_rvfree
	movq	16(%rbx), %rdi
	callq	_kfree
	leaq	4(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	decl	(%rbx)
	movq	8(%rbx), %r15
	setne	%r12b
	movq	%r14, %rdi
	callq	_mutex_unlock
	testb	%r12b, %r12b
	jne	LBB0_3
## %bb.1:
	testq	%r15, %r15
	jne	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_3:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"close\n"

	.comm	_VICAM_MAX_FRAME_SIZE,4,2       ## @VICAM_MAX_FRAME_SIZE
	.comm	_VICAM_FRAMES,4,2               ## @VICAM_FRAMES
	.no_dead_strip	_vicam_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vicam_close
_vicam_close:                           ; @vicam_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]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	mov	x0, x19
	mov	w1, #0
	bl	_set_camera_power
	ldr	x0, [x19, #32]
	bl	_kfree
Lloh2:
	adrp	x8, _VICAM_MAX_FRAME_SIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VICAM_MAX_FRAME_SIZE@GOTPAGEOFF]
	ldr	w0, [x19, #24]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _VICAM_FRAMES@GOTPAGE
Lloh6:
	ldr	x9, [x9, _VICAM_FRAMES@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	mul	w1, w9, w8
	bl	_rvfree
	ldr	x0, [x19, #16]
	bl	_kfree
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	ldr	w8, [x19]
	sub	w21, w8, #1
	str	w21, [x19]
	ldr	x22, [x19, #8]
	mov	x0, x20
	bl	_mutex_unlock
	cmp	w21, #0
	ccmp	x22, #0, #0, eq
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_kfree
LBB0_2:
	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 AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"close\n"

	.comm	_VICAM_MAX_FRAME_SIZE,4,2       ; @VICAM_MAX_FRAME_SIZE
	.comm	_VICAM_FRAMES,4,2               ; @VICAM_FRAMES
	.no_dead_strip	_vicam_close
.subsections_via_symbols
