	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vpif_release
_vpif_release:                          ## @vpif_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	%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, -64(%rbp)                 ## 8-byte Spill
	movq	(%rdi), %r12
	movq	24(%r12), %r15
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movl	$2, %edi
	callq	_vpif_dbg
	movq	24(%r15), %rbx
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %r13
	leaq	(%rbx,%r13,8), %r14
	addq	$4, %r14
	movq	%r14, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_2:
	movq	%r13, %rdx
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	16(%r12), %rax
	movq	_VPIF_VIDEO_INDEX@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_9
## %bb.3:
	movq	%rbx, %r12
	movq	%rdx, %rbx
	movq	$0, 16(%r12,%rdx,8)
	movq	_VPIF_CHANNEL0_VIDEO@GOTPCREL(%rip), %rcx
	movq	(%r15), %rax
	cmpq	%rax, (%rcx)
	jne	LBB0_5
## %bb.4:
	xorl	%edi, %edi
	callq	_enable_channel0
	xorl	%edi, %edi
	callq	_channel0_intr_enable
	movq	(%r15), %rax
LBB0_5:
	leaq	(%r12,%rbx,8), %rdx
	movq	_VPIF_CHANNEL1_VIDEO@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	je	LBB0_7
## %bb.6:
	cmpl	$2, (%rdx)
	jne	LBB0_8
LBB0_7:
	xorl	%edi, %edi
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %r14
	movq	%rdx, %r13
	callq	_enable_channel1
	xorl	%edi, %edi
	callq	_channel1_intr_enable
	movq	%r13, %rdx
	movq	%r14, %r13
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_8:
	movl	$0, (%rdx)
	leaq	(%r12,%rbx,8), %r12
	addq	$8, %r12
	movq	%r12, %rdi
	callq	_videobuf_queue_cancel
	movq	%r12, %rdi
	callq	_videobuf_mmap_free
LBB0_9:
	decl	20(%r15)
	movq	%r14, %rdi
	callq	_mutex_unlock
	leaq	16(%r15), %rdi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	leaq	8(%rbx), %rsi
	callq	_v4l2_prio_close
	cmpq	$0, (%rbx)
	je	LBB0_11
## %bb.10:
	movq	$0, 8(%r15)
LBB0_11:
	movq	$0, (%r13)
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%eax, %eax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vpif_release\n"

	.comm	_VPIF_VIDEO_INDEX,8,3           ## @VPIF_VIDEO_INDEX
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_VPIF_CHANNEL0_VIDEO,8,3        ## @VPIF_CHANNEL0_VIDEO
	.comm	_VPIF_CHANNEL1_VIDEO,8,3        ## @VPIF_CHANNEL1_VIDEO
	.no_dead_strip	_vpif_release
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vpif_release
_vpif_release:                          ; @vpif_release
	.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	x20, x0
	ldr	x19, [x0]
	ldr	x23, [x19, #24]
Lloh0:
	adrp	x8, _debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	bl	_vpif_dbg
	ldr	x22, [x23, #24]
Lloh5:
	adrp	x26, _VPIF_VIDEO_INDEX@GOTPAGE
Lloh6:
	ldr	x26, [x26, _VPIF_VIDEO_INDEX@GOTPAGEOFF]
	ldr	x24, [x26]
	mov	w8, #24
	madd	x25, x24, x8, x22
	add	x21, x25, #4
	mov	x0, x21
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_2
; %bb.1:
Lloh7:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_2:
	ldr	x8, [x19, #16]
	ldr	x9, [x26]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_9
; %bb.3:
	mov	w8, #24
	madd	x8, x24, x8, x22
	str	xzr, [x8, #16]
Lloh10:
	adrp	x8, _VPIF_CHANNEL0_VIDEO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VPIF_CHANNEL0_VIDEO@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x8]
	ldr	x8, [x23]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	mov	w0, #0
	bl	_enable_channel0
	mov	w0, #0
	bl	_channel0_intr_enable
	ldr	x8, [x23]
LBB0_5:
Lloh13:
	adrp	x9, _VPIF_CHANNEL1_VIDEO@GOTPAGE
Lloh14:
	ldr	x9, [x9, _VPIF_CHANNEL1_VIDEO@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.eq	LBB0_7
; %bb.6:
	ldr	w8, [x25]
	cmp	w8, #2
	b.ne	LBB0_8
LBB0_7:
	mov	w0, #0
	bl	_enable_channel1
	mov	w0, #0
	bl	_channel1_intr_enable
LBB0_8:
	str	wzr, [x25]
	mov	w8, #24
	madd	x8, x24, x8, x22
	add	x22, x8, #8
	mov	x0, x22
	bl	_videobuf_queue_cancel
	mov	x0, x22
	bl	_videobuf_mmap_free
LBB0_9:
	ldr	w8, [x23, #20]
	sub	w8, w8, #1
	str	w8, [x23, #20]
	mov	x0, x21
	bl	_mutex_unlock
	add	x0, x23, #16
	add	x1, x19, #8
	bl	_v4l2_prio_close
	ldr	x8, [x19]
	cbz	x8, LBB0_11
; %bb.10:
	str	xzr, [x23, #8]
LBB0_11:
	str	xzr, [x20]
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
LBB0_12:
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vpif_release\n"

	.comm	_VPIF_VIDEO_INDEX,8,3           ; @VPIF_VIDEO_INDEX
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_VPIF_CHANNEL0_VIDEO,8,3        ; @VPIF_CHANNEL0_VIDEO
	.comm	_VPIF_CHANNEL1_VIDEO,8,3        ; @VPIF_CHANNEL1_VIDEO
	.no_dead_strip	_vpif_release
.subsections_via_symbols
