	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia_mmap
_cpia_mmap:                             ## @cpia_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	(%rdi), %rdi
	movq	(%rsi), %r12
	movq	8(%rsi), %r14
	callq	_video_get_drvdata
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rax, %rbx
	cmpl	$0, 16(%rax)
	je	LBB0_2
## %bb.4:
	subq	%r12, %r14
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_DBG
	movq	_FRAME_NUM@GOTPCREL(%rip), %rax
	movq	_CPIA_MAX_FRAME_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	imulq	(%rax), %rcx
	cmpq	%rcx, %r14
	jbe	LBB0_6
## %bb.5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_6:
	cmpl	$0, 16(%rbx)
	je	LBB0_2
## %bb.7:
	movq	%rbx, %rdi
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_EINTR@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_19:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	8(%rbx), %r13
	testq	%r13, %r13
	je	LBB0_10
LBB0_12:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	testq	%r14, %r14
	je	LBB0_17
## %bb.13:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	callq	_vmalloc_to_pfn
	movq	(%rbx), %rcx
	movq	_PAGE_SHARED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%rax, %rdx
	callq	_remap_pfn_range
	testq	%rax, %rax
	jne	LBB0_15
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	(%rbx), %rax
	addq	%rax, %r12
	addq	%rax, %r13
	subq	%rax, %r14
	movl	$0, %eax
	cmovbq	%rax, %r14
	ja	LBB0_14
LBB0_17:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_DBG
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_18
LBB0_10:
	movq	%rbx, %rdi
	callq	_allocate_frame_buf
	movq	%rbx, %rdi
	testl	%eax, %eax
	je	LBB0_11
## %bb.20:
	movl	%eax, %ebx
LBB0_18:
	callq	_mutex_unlock
	jmp	LBB0_19
LBB0_15:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_11:
	movq	8(%rdi), %r13
	movq	%rdi, %rbx
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"cpia_mmap: %ld\n"

	.comm	_FRAME_NUM,8,3                  ## @FRAME_NUM
	.comm	_CPIA_MAX_FRAME_SIZE,8,3        ## @CPIA_MAX_FRAME_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_PAGE_SHARED,4,2                ## @PAGE_SHARED
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_cpia_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia_mmap
_cpia_mmap:                             ; @cpia_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	x20, x1
	ldr	x0, [x0]
	ldp	x21, x22, [x1]
	bl	_video_get_drvdata
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_7
; %bb.2:
	sub	x22, x22, x21
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_DBG
Lloh2:
	adrp	x8, _FRAME_NUM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FRAME_NUM@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _CPIA_MAX_FRAME_SIZE@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CPIA_MAX_FRAME_SIZE@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	mul	x8, x9, x8
	cmp	x22, x8
	b.ls	LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_7
; %bb.5:
	mov	x0, x19
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_10
; %bb.6:
Lloh10:
	adrp	x8, _EINTR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_9:
	mov	x0, x23
	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_10:
	ldr	x23, [x19, #8]
	cbz	x23, LBB0_15
; %bb.11:
	cbz	x22, LBB0_19
LBB0_12:
Lloh14:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
Lloh16:
	adrp	x25, _PAGE_SHARED@GOTPAGE
Lloh17:
	ldr	x25, [x25, _PAGE_SHARED@GOTPAGEOFF]
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_vmalloc_to_pfn
	mov	x2, x0
	ldr	x3, [x24]
	ldr	w4, [x25]
	mov	x0, x20
	mov	x1, x21
	bl	_remap_pfn_range
	cbnz	x0, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x24]
	add	x21, x8, x21
	add	x23, x8, x23
	subs	x8, x22, x8
	csel	x22, xzr, x8, lo
	b.hi	LBB0_13
	b	LBB0_19
LBB0_15:
	mov	x0, x19
	bl	_allocate_frame_buf
	cbz	w0, LBB0_18
; %bb.16:
	mov	x23, x0
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_9
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
Lloh18:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_8
LBB0_18:
	ldr	x23, [x19, #8]
	cbnz	x22, LBB0_12
LBB0_19:
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, #0
	bl	_DBG
	mov	x0, x19
	bl	_mutex_unlock
	mov	w23, #0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"cpia_mmap: %ld\n"

	.comm	_FRAME_NUM,8,3                  ; @FRAME_NUM
	.comm	_CPIA_MAX_FRAME_SIZE,8,3        ; @CPIA_MAX_FRAME_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_PAGE_SHARED,4,2                ; @PAGE_SHARED
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_cpia_mmap
.subsections_via_symbols
