	.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), %r12
	movq	(%r12), %rcx
	movq	8(%r12), %r14
	movl	8(%r14), %eax
	movl	(%rdi), %r9d
	movl	4(%rdi), %r8d
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movq	%r12, %rdx
	xorl	%eax, %eax
	callq	_dev_dbg
	decq	(%r12)
	je	LBB0_1
## %bb.12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdx
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_dev_dbg
	movq	%r14, %rdi
	callq	_videobuf_queue_lock
	cmpq	$0, 16(%r14)
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_videobuf_queue_cancel
LBB0_3:
	movq	_VIDEO_MAX_FRAME@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_11
## %bb.4:
	movq	(%r14), %rcx
	xorl	%ebx, %ebx
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	(%rcx,%rbx,8), %rdx
	movq	$0, 8(%rdx)
	movq	(%rcx,%rbx,8), %rdx
	movq	$0, (%rdx)
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movslq	%eax, %rdx
	cmpq	%rdx, %rbx
	jge	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rbx,8), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	%r12, 8(%rdx)
	jne	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	16(%rdx), %r13
	testq	%r13, %r13
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	8(%r13), %edi
	movq	_MAGIC_DC_MEM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_MAGIC_CHECK
	movl	8(%r14), %edi
	movq	(%r13), %rcx
	leaq	L_.str.2(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_dbg
	movl	8(%r14), %edi
	movq	%r13, %rsi
	callq	___videobuf_dc_free
	movq	$0, (%r13)
	movq	(%r14), %rcx
	movl	(%r15), %eax
	jmp	LBB0_9
LBB0_11:
	movq	%r12, %rdi
	callq	_kfree
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_videobuf_queue_unlock          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vm_close %p [count=%u,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_DC_MEM,4,2               ## @MAGIC_DC_MEM
L_.str.2:                               ## @.str.2
	.asciz	"buf[%d] freeing %p\n"

	.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, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x20, [x0, #8]
	ldp	x9, x19, [x20]
	ldr	w8, [x19, #8]
	ldp	w11, w10, [x0]
	stp	x10, x11, [sp, #16]
	stp	x20, x9, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_dev_dbg
	ldr	x8, [x20]
	subs	x8, x8, #1
	str	x8, [x20]
	b.eq	LBB0_2
; %bb.1:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_2:
	ldr	w0, [x19, #8]
	stp	x20, x19, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	x0, x19
	bl	_videobuf_queue_lock
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_videobuf_queue_cancel
LBB0_4:
Lloh4:
	adrp	x23, _VIDEO_MAX_FRAME@GOTPAGE
Lloh5:
	ldr	x23, [x23, _VIDEO_MAX_FRAME@GOTPAGEOFF]
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.5:
	mov	x24, #0
	ldr	x9, [x19]
Lloh6:
	adrp	x25, _MAGIC_DC_MEM@GOTPAGE
Lloh7:
	ldr	x25, [x25, _MAGIC_DC_MEM@GOTPAGEOFF]
Lloh8:
	adrp	x21, l_.str.2@PAGE
Lloh9:
	add	x21, x21, l_.str.2@PAGEOFF
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	lsl	x10, x24, #3
	ldr	x11, [x9, x10]
	str	xzr, [x11, #8]
	ldr	x10, [x9, x10]
	str	xzr, [x10]
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x24, x24, #1
	cmp	x24, w8, sxtw
	b.ge	LBB0_12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, x24, lsl #3]
	cbz	x10, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x11, [x10, #8]
	cmp	x11, x20
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	x22, [x10, #16]
	cbz	x22, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x22, #8]
	ldr	w1, [x25]
	bl	_MAGIC_CHECK
	ldr	w0, [x19, #8]
	ldr	x8, [x22]
	stp	x24, x8, [sp]
	mov	x1, x21
	bl	_dev_dbg
	ldr	w0, [x19, #8]
	mov	x1, x22
	bl	___videobuf_dc_free
	str	xzr, [x22]
	ldr	x9, [x19]
	ldr	w8, [x23]
	b	LBB0_6
LBB0_12:
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_videobuf_queue_unlock
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vm_close %p [count=%u,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_DC_MEM,4,2               ; @MAGIC_DC_MEM
l_.str.2:                               ; @.str.2
	.asciz	"buf[%d] freeing %p\n"

	.no_dead_strip	_videobuf_vm_close
.subsections_via_symbols
