	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vb2_mmap                       ## -- Begin function vb2_mmap
	.p2align	4, 0x90
_vb2_mmap:                              ## @vb2_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), %rbx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %rbx
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movq	(%rdi), %rax
	movq	_VB2_MEMORY_MMAP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.1:
	movq	%rsi, %r15
	movl	8(%rsi), %eax
	movq	_VM_SHARED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.2:
	movq	%rdi, %r13
	cmpq	$0, 24(%rdi)
	je	LBB0_9
## %bb.3:
	movq	_VM_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_10
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	xorl	%r12d, %r12d
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_dprintk
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_8:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_VM_READ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
LBB0_10:
	leaq	8(%r13), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_vb2_fileio_is_active
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:
	leaq	L_.str.4(%rip), %rsi
	xorl	%r12d, %r12d
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_dprintk
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_12:
	subl	(%rax), %r12d
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r12d, %r12d
	jne	LBB0_8
## %bb.14:
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	leaq	L_.str.6(%rip), %rsi
	xorl	%r12d, %r12d
	movl	$3, %edi
	xorl	%eax, %eax
	callq	_dprintk
	jmp	LBB0_8
LBB0_15:
	leaq	-48(%rbp), %rdx
	leaq	-44(%rbp), %rcx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	___find_plane_by_offset
	testl	%eax, %eax
	je	LBB0_18
## %bb.16:
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_8
LBB0_17:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_7
LBB0_18:
	movq	16(%r13), %rax
	movl	-48(%rbp), %ecx
	movq	(%rax,%rcx,8), %rbx
	movq	(%rbx), %rax
	movl	-44(%rbp), %ecx
	movl	4(%rax,%rcx,8), %edi
	callq	_PAGE_ALIGN
	movq	16(%r15), %rcx
	subq	24(%r15), %rcx
	cmpq	%rcx, %rax
	jae	LBB0_20
## %bb.19:
	leaq	L_.str.5(%rip), %rsi
	xorl	%r12d, %r12d
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_dprintk
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_20:
	movq	$0, (%r15)
	movq	_mmap@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rbx), %rax
	movl	-44(%rbp), %ecx
	movl	(%rax,%rcx,8), %edx
	movq	%rbx, %rdi
	movq	%r15, %rcx
	callq	_call_memop
	movl	%eax, %r12d
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_VB2_MEMORY_MMAP,8,3            ## @VB2_MEMORY_MMAP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"queue is not currently set up for mmap\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_SHARED,4,2                  ## @VM_SHARED
L_.str.1:                               ## @.str.1
	.asciz	"invalid vma flags, VM_SHARED needed\n"

	.comm	_VM_WRITE,4,2                   ## @VM_WRITE
L_.str.2:                               ## @.str.2
	.asciz	"invalid vma flags, VM_WRITE needed\n"

	.comm	_VM_READ,4,2                    ## @VM_READ
L_.str.3:                               ## @.str.3
	.asciz	"invalid vma flags, VM_READ needed\n"

L_.str.4:                               ## @.str.4
	.asciz	"mmap: file io in progress\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.5:                               ## @.str.5
	.asciz	"MMAP invalid, as it would overflow buffer length\n"

	.comm	_mmap,4,2                       ## @mmap
L_.str.6:                               ## @.str.6
	.asciz	"buffer %d, plane %d successfully mapped\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vb2_mmap                       ; -- Begin function vb2_mmap
	.p2align	2
_vb2_mmap:                              ; @vb2_mmap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x22, [x1]
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	str	xzr, [sp, #24]
	ldr	x8, [x0]
Lloh3:
	adrp	x9, _VB2_MEMORY_MMAP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VB2_MEMORY_MMAP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x1
	ldr	w8, [x1, #8]
Lloh6:
	adrp	x9, _VM_SHARED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VM_SHARED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.2:
	mov	x21, x0
	ldr	x9, [x0, #24]
	cbz	x9, LBB0_9
; %bb.3:
Lloh9:
	adrp	x9, _VM_WRITE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _VM_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_10
; %bb.4:
Lloh12:
	adrp	x1, l_.str.2@PAGE
Lloh13:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_5:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	mov	w0, #1
	bl	_dprintk
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_9:
Lloh21:
	adrp	x9, _VM_READ@GOTPAGE
Lloh22:
	ldr	x9, [x9, _VM_READ@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_17
LBB0_10:
	add	x19, x21, #8
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x21
	bl	_vb2_fileio_is_active
	cbz	x0, LBB0_15
; %bb.11:
Lloh24:
	adrp	x1, l_.str.4@PAGE
Lloh25:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_dprintk
Lloh26:
	adrp	x8, _EBUSY@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	cbnz	w22, LBB0_8
; %bb.14:
	ldp	w9, w8, [sp, #24]
	stp	x8, x9, [sp]
Lloh28:
	adrp	x1, l_.str.6@PAGE
Lloh29:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #3
	bl	_dprintk
	b	LBB0_8
LBB0_15:
	lsl	x1, x22, x23
	add	x2, sp, #28
	add	x3, sp, #24
	mov	x0, x21
	bl	___find_plane_by_offset
	cbz	w0, LBB0_18
; %bb.16:
	mov	x22, x0
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_8
LBB0_17:
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_7
LBB0_18:
	ldr	x8, [x21, #16]
	ldr	w9, [sp, #28]
	ldr	x21, [x8, x9, lsl #3]
	ldr	x8, [x21]
	ldr	w9, [sp, #24]
	add	x8, x8, x9, lsl #3
	ldr	w0, [x8, #4]
	bl	_PAGE_ALIGN
	ldp	x8, x9, [x20, #16]
	sub	x8, x8, x9
	cmp	x0, x8
	b.hs	LBB0_20
; %bb.19:
Lloh32:
	adrp	x1, l_.str.5@PAGE
Lloh33:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #1
	bl	_dprintk
Lloh34:
	adrp	x8, _EINVAL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_20:
	str	xzr, [x20]
Lloh36:
	adrp	x8, _mmap@GOTPAGE
Lloh37:
	ldr	x8, [x8, _mmap@GOTPAGEOFF]
Lloh38:
	ldr	w1, [x8]
	ldr	x8, [x21]
	ldr	w9, [sp, #24]
	lsl	x9, x9, #3
	ldr	w2, [x8, x9]
	mov	x0, x21
	mov	x3, x20
	bl	_call_memop
	mov	x22, x0
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_VB2_MEMORY_MMAP,8,3            ; @VB2_MEMORY_MMAP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"queue is not currently set up for mmap\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_SHARED,4,2                  ; @VM_SHARED
l_.str.1:                               ; @.str.1
	.asciz	"invalid vma flags, VM_SHARED needed\n"

	.comm	_VM_WRITE,4,2                   ; @VM_WRITE
l_.str.2:                               ; @.str.2
	.asciz	"invalid vma flags, VM_WRITE needed\n"

	.comm	_VM_READ,4,2                    ; @VM_READ
l_.str.3:                               ; @.str.3
	.asciz	"invalid vma flags, VM_READ needed\n"

l_.str.4:                               ; @.str.4
	.asciz	"mmap: file io in progress\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.5:                               ; @.str.5
	.asciz	"MMAP invalid, as it would overflow buffer length\n"

	.comm	_mmap,4,2                       ; @mmap
l_.str.6:                               ; @.str.6
	.asciz	"buffer %d, plane %d successfully mapped\n"

.subsections_via_symbols
