	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function usbvision_mmap
_usbvision_mmap:                        ## @usbvision_mmap
	.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	%rsi, %r15
	movq	(%rsi), %r13
	movq	8(%rsi), %r14
	callq	_video_drvdata
	movq	%rax, %rbx
	movq	_DBG_MMAP@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_PDEBUG
	movq	%rbx, %rdi
	callq	_USBVISION_IS_OPERATIONAL
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_VM_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 16(%r15)
	je	LBB0_12
## %bb.4:
	subq	%r14, %r13
	movl	16(%rbx), %edi
	callq	_PAGE_ALIGN
	cmpq	%rax, %r13
	jne	LBB0_12
## %bb.5:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%rbx)
	je	LBB0_11
## %bb.6:
	xorl	%r14d, %r14d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%rbx), %edi
	callq	_PAGE_ALIGN
	imulq	%r14, %rax
	movzbl	(%r12), %ecx
	shrq	%cl, %rax
	cmpq	24(%r15), %rax
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	incq	%r14
	movq	(%rbx), %rax
	cmpq	%rax, %r14
	jb	LBB0_7
	jmp	LBB0_10
LBB0_1:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_8:
	movq	(%rbx), %rax
LBB0_10:
	cmpq	%rax, %r14
	movq	_DBG_MMAP@GOTPCREL(%rip), %r12
	jne	LBB0_13
LBB0_11:
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_PDEBUG
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_18:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_VM_IO@GOTPCREL(%rip), %rax
	movq	_VM_DONTEXPAND@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_VM_DONTDUMP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	orl	%ecx, 16(%r15)
	xorl	%r12d, %r12d
	testq	%r13, %r13
	je	LBB0_18
## %bb.14:
	movq	8(%rbx), %rax
	movq	(%rax,%r14,8), %rbx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_vmalloc_to_page
	movq	%r15, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	callq	_vm_insert_page
	testq	%rax, %rax
	jne	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%rax, %r14
	addq	%rax, %rbx
	subq	%rax, %r13
	jne	LBB0_15
	jmp	LBB0_18
LBB0_16:
	movq	_DBG_MMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_PDEBUG
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_DBG_MMAP,4,2                   ## @DBG_MMAP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmap"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_VM_WRITE,4,2                   ## @VM_WRITE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"mmap: user supplied mapping address is out of range"

	.comm	_VM_IO,4,2                      ## @VM_IO
	.comm	_VM_DONTEXPAND,4,2              ## @VM_DONTEXPAND
	.comm	_VM_DONTDUMP,4,2                ## @VM_DONTDUMP
L_.str.2:                               ## @.str.2
	.asciz	"mmap: vm_insert_page failed"

	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_usbvision_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function usbvision_mmap
_usbvision_mmap:                        ; @usbvision_mmap
	.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	x19, x1
	ldp	x23, x20, [x1]
	bl	_video_drvdata
	mov	x21, x0
Lloh0:
	adrp	x22, _DBG_MMAP@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DBG_MMAP@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
	mov	x0, x21
	bl	_USBVISION_IS_OPERATIONAL
	cbz	w0, LBB0_10
; %bb.1:
	ldr	w8, [x19, #16]
Lloh4:
	adrp	x9, _VM_WRITE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _VM_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.2:
	sub	x23, x23, x20
	ldr	w0, [x21, #16]
	bl	_PAGE_ALIGN
	cmp	x23, x0
	b.ne	LBB0_9
; %bb.3:
	ldr	x8, [x21]
	cbz	x8, LBB0_8
; %bb.4:
	mov	x24, #0
Lloh7:
	adrp	x25, _PAGE_SHIFT@GOTPAGE
Lloh8:
	ldr	x25, [x25, _PAGE_SHIFT@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21, #16]
	bl	_PAGE_ALIGN
	mul	x8, x0, x24
	ldr	x9, [x25]
	lsr	x8, x8, x9
	ldr	x9, [x19, #24]
	cmp	x8, x9
	b.eq	LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x24, x24, #1
	ldr	x8, [x21]
	cmp	x24, x8
	b.lo	LBB0_5
; %bb.7:
	cmp	x24, x8
	b.ne	LBB0_14
LBB0_8:
	ldr	w0, [x22]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_PDEBUG
LBB0_9:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh13:
	adrp	x8, _EFAULT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
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
LBB0_13:
	ldr	x8, [x21]
	cmp	x24, x8
	b.eq	LBB0_8
LBB0_14:
Lloh15:
	adrp	x8, _VM_IO@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VM_IO@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _VM_DONTEXPAND@GOTPAGE
Lloh19:
	ldr	x9, [x9, _VM_DONTEXPAND@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
Lloh21:
	adrp	x10, _VM_DONTDUMP@GOTPAGE
Lloh22:
	ldr	x10, [x10, _VM_DONTDUMP@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh23:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	w9, [x19, #16]
	orr	w8, w8, w9
	str	w8, [x19, #16]
	cbz	x23, LBB0_18
; %bb.15:
	ldr	x8, [x21, #8]
	ldr	x21, [x8, x24, lsl #3]
Lloh24:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh25:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_vmalloc_to_page
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_vm_insert_page
	cbnz	x0, LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	x8, [x24]
	add	x20, x8, x20
	add	x21, x21, x8
	subs	x23, x23, x8
	b.ne	LBB0_16
	b	LBB0_12
LBB0_18:
	mov	w0, #0
	b	LBB0_12
LBB0_19:
	ldr	w0, [x22]
Lloh26:
	adrp	x1, l_.str.2@PAGE
Lloh27:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_PDEBUG
Lloh28:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_11
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_DBG_MMAP,4,2                   ; @DBG_MMAP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmap"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_VM_WRITE,4,2                   ; @VM_WRITE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"mmap: user supplied mapping address is out of range"

	.comm	_VM_IO,4,2                      ; @VM_IO
	.comm	_VM_DONTEXPAND,4,2              ; @VM_DONTEXPAND
	.comm	_VM_DONTDUMP,4,2                ; @VM_DONTDUMP
l_.str.2:                               ; @.str.2
	.asciz	"mmap: vm_insert_page failed"

	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_usbvision_mmap
.subsections_via_symbols
