	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov51x_v4l1_mmap
_ov51x_v4l1_mmap:                       ## @ov51x_v4l1_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, %r14
	movq	(%rdi), %rdi
	movq	(%rsi), %r15
	movq	8(%rsi), %rbx
	callq	_video_get_drvdata
	cmpq	$0, 24(%rax)
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	subq	%r15, %rbx
	leaq	L_.str(%rip), %rsi
	movl	$4, %edi
	movq	%rbx, %rdx
	movq	%rbx, %rcx
	callq	_PDEBUG
	movq	_OV511_NUMFRAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	16(%r12), %esi
	movl	20(%r12), %edi
	callq	_MAX_DATA_SIZE
                                        ## kill: def $eax killed $eax def $rax
	imull	%r13d, %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	addl	%ecx, %eax
	decl	%eax
	negl	%ecx
	andl	%eax, %ecx
	movslq	%ecx, %rax
	cmpq	%rax, %rbx
	jbe	LBB0_5
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_5:
	movq	%r12, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_EINTR@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_12
## %bb.8:
	movq	%r13, %r12
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %r13
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_vmalloc_to_pfn
	movl	(%r12), %ecx
	movq	_PAGE_SHARED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%rax, %rdx
	callq	_remap_pfn_range
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	movslq	(%r12), %rax
	addq	%rax, %r15
	addq	%rax, %r13
	subq	%rax, %rbx
	movl	$0, %eax
	cmovbq	%rax, %rbx
	ja	LBB0_9
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_10:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmap: %ld (%lX) bytes"

	.comm	_OV511_NUMFRAMES,4,2            ## @OV511_NUMFRAMES
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_PAGE_SHARED,4,2                ## @PAGE_SHARED
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_ov51x_v4l1_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov51x_v4l1_mmap
_ov51x_v4l1_mmap:                       ; @ov51x_v4l1_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
	ldr	x0, [x0]
	ldp	x20, x22, [x1]
	bl	_video_get_drvdata
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x21, x0
	sub	x22, x22, x20
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	mov	x2, x22
	mov	x3, x22
	bl	_PDEBUG
Lloh2:
	adrp	x8, _OV511_NUMFRAMES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OV511_NUMFRAMES@GOTPAGEOFF]
Lloh4:
	ldr	w23, [x8]
	ldp	w1, w0, [x21, #16]
	bl	_MAX_DATA_SIZE
Lloh5:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh6:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x24]
	madd	w9, w0, w23, w8
	sub	w9, w9, #1
	neg	w8, w8
	and	w8, w9, w8
	cmp	x22, w8, sxtw
	b.ls	LBB0_4
; %bb.2:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:
Lloh9:
	adrp	x8, _EIO@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	mov	x0, x21
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_8
; %bb.5:
Lloh11:
	adrp	x8, _EINTR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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_8:
	cbz	x22, LBB0_12
; %bb.9:
	ldr	x23, [x21, #8]
Lloh13:
	adrp	x25, _PAGE_SHARED@GOTPAGE
Lloh14:
	ldr	x25, [x25, _PAGE_SHARED@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_vmalloc_to_pfn
	mov	x2, x0
	ldr	w3, [x24]
	ldr	w4, [x25]
	mov	x0, x19
	mov	x1, x20
	bl	_remap_pfn_range
	cbnz	x0, LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldrsw	x8, [x24]
	add	x20, x20, x8
	add	x23, x23, x8
	subs	x8, x22, x8
	csel	x22, xzr, x8, lo
	b.hi	LBB0_10
LBB0_12:
	mov	x0, x21
	bl	_mutex_unlock
	mov	w0, #0
	b	LBB0_7
LBB0_13:
	mov	x0, x21
	bl	_mutex_unlock
Lloh15:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmap: %ld (%lX) bytes"

	.comm	_OV511_NUMFRAMES,4,2            ; @OV511_NUMFRAMES
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_PAGE_SHARED,4,2                ; @PAGE_SHARED
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_ov51x_v4l1_mmap
.subsections_via_symbols
