	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function videobuf_vm_close
_videobuf_vm_close:                     ## @videobuf_vm_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	8(%rdi), %r14
	movq	(%r14), %rcx
	movq	8(%r14), %r12
	movl	(%rdi), %r9d
	movl	4(%rdi), %r8d
	leaq	L_.str(%rip), %rsi
	movl	$2, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_dprintk
	decq	(%r14)
	je	LBB0_1
## %bb.9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movq	%r14, %rdx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_dprintk
	movq	%r12, %rdi
	callq	_videobuf_queue_lock
	movq	_VIDEO_MAX_FRAME@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_8
## %bb.2:
	xorl	%ebx, %ebx
	movq	_MAGIC_SG_MEM@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jge	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	16(%rax), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rax), %edi
	movl	(%r13), %esi
	callq	_MAGIC_CHECK
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rcx
	cmpq	%r14, 8(%rcx)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	$0, 8(%rcx)
	movq	(%rax,%rbx,8), %rsi
	movq	$0, (%rsi)
	movq	8(%r12), %rax
	movq	%r12, %rdi
	callq	*(%rax)
	jmp	LBB0_7
LBB0_8:
	movq	%r12, %rdi
	callq	_videobuf_queue_unlock
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vm_close %p [count=%d,vma=%08lx-%08lx]\n"

L_.str.1:                               ## @.str.1
	.asciz	"munmap %p q=%p\n"

	.comm	_VIDEO_MAX_FRAME,4,2            ## @VIDEO_MAX_FRAME
	.comm	_MAGIC_SG_MEM,4,2               ## @MAGIC_SG_MEM
	.no_dead_strip	_videobuf_vm_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function videobuf_vm_close
_videobuf_vm_close:                     ; @videobuf_vm_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	ldr	x19, [x0, #8]
	ldp	x3, x20, [x19]
	ldp	w9, w8, [x0]
	stp	x8, x9, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #2
	mov	x2, x19
	bl	_dprintk
	ldr	x8, [x19]
	subs	x8, x8, #1
	str	x8, [x19]
	b.eq	LBB0_2
; %bb.1:
	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
	add	sp, sp, #80
	ret
LBB0_2:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x3, x20
	bl	_dprintk
	mov	x0, x20
	bl	_videobuf_queue_lock
Lloh4:
	adrp	x21, _VIDEO_MAX_FRAME@GOTPAGE
Lloh5:
	ldr	x21, [x21, _VIDEO_MAX_FRAME@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	x22, #0
Lloh6:
	adrp	x23, _MAGIC_SG_MEM@GOTPAGE
Lloh7:
	ldr	x23, [x23, _MAGIC_SG_MEM@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x22, x22, #1
	ldrsw	x8, [x21]
	cmp	x22, x8
	b.ge	LBB0_9
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x8, [x8, x22, lsl #3]
	cbz	x8, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x8, #16]
	cbz	x8, LBB0_4
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w0, [x8]
	ldr	w1, [x23]
	bl	_MAGIC_CHECK
	ldr	x8, [x20]
	ldr	x9, [x8, x22, lsl #3]
	ldr	x10, [x9, #8]
	cmp	x10, x19
	b.ne	LBB0_4
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	str	xzr, [x9, #8]
	ldr	x1, [x8, x22, lsl #3]
	str	xzr, [x1]
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	mov	x0, x20
	blr	x8
	b	LBB0_4
LBB0_9:
	mov	x0, x20
	bl	_videobuf_queue_unlock
	mov	x0, x19
	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
	add	sp, sp, #80
	b	_kfree
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vm_close %p [count=%d,vma=%08lx-%08lx]\n"

l_.str.1:                               ; @.str.1
	.asciz	"munmap %p q=%p\n"

	.comm	_VIDEO_MAX_FRAME,4,2            ; @VIDEO_MAX_FRAME
	.comm	_MAGIC_SG_MEM,4,2               ; @MAGIC_SG_MEM
	.no_dead_strip	_videobuf_vm_close
.subsections_via_symbols
