	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cafe_v4l_mmap
_cafe_v4l_mmap:                         ## @cafe_v4l_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), %r13
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shlq	%cl, %r13
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movl	8(%rsi), %eax
	movq	_VM_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.1:
	movq	_VM_SHARED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_9
## %bb.2:
	movq	%rsi, %r14
	movq	(%rdi), %rbx
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.3:
	movq	8(%rbx), %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r13, 8(%rbx)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	$24, %rbx
	decq	%rax
	jne	LBB0_4
	jmp	LBB0_8
LBB0_6:
	movl	16(%rbx), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_remap_vmalloc_range
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	_VM_DONTEXPAND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%r14)
	movq	%rbx, 24(%r14)
	movq	_cafe_v4l_vm_ops@GOTPCREL(%rip), %rax
	movq	%rax, 16(%r14)
	movq	_V4L2_BUF_FLAG_MAPPED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
	movq	%r14, %rdi
	callq	_cafe_v4l_vm_open
	xorl	%r12d, %r12d
LBB0_8:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_WRITE,4,2                   ## @VM_WRITE
	.comm	_VM_SHARED,4,2                  ## @VM_SHARED
	.comm	_VM_DONTEXPAND,4,2              ## @VM_DONTEXPAND
	.comm	_cafe_v4l_vm_ops,4,2            ## @cafe_v4l_vm_ops
	.comm	_V4L2_BUF_FLAG_MAPPED,4,2       ## @V4L2_BUF_FLAG_MAPPED
	.no_dead_strip	_cafe_v4l_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cafe_v4l_mmap
_cafe_v4l_mmap:                         ; @cafe_v4l_mmap
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w20, w8
	ldr	w8, [x1, #8]
Lloh3:
	adrp	x9, _VM_WRITE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VM_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.1:
Lloh6:
	adrp	x9, _VM_SHARED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VM_SHARED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.2:
	mov	x19, x1
	ldr	x22, [x0]
	ldr	x23, [x1]
Lloh9:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	x24, [x8]
	add	x21, x22, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.3:
	lsl	x9, x23, x24
	ldr	x22, [x22, #8]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x22, #8]
	cmp	x10, x9
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, #24
	subs	x8, x8, #1
	b.ne	LBB0_4
	b	LBB0_8
LBB0_6:
	ldr	w1, [x22, #16]
	mov	x0, x19
	mov	w2, #0
	bl	_remap_vmalloc_range
	mov	x20, x0
	cbnz	w0, LBB0_8
; %bb.7:
Lloh12:
	adrp	x8, _VM_DONTEXPAND@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VM_DONTEXPAND@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
Lloh15:
	adrp	x8, _cafe_v4l_vm_ops@GOTPAGE
Lloh16:
	ldr	x8, [x8, _cafe_v4l_vm_ops@GOTPAGEOFF]
	stp	x8, x22, [x19, #16]
Lloh17:
	adrp	x8, _V4L2_BUF_FLAG_MAPPED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _V4L2_BUF_FLAG_MAPPED@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	ldr	w9, [x22]
	orr	w8, w9, w8
	str	w8, [x22]
	mov	x0, x19
	bl	_cafe_v4l_vm_open
LBB0_8:
	mov	x0, x21
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_WRITE,4,2                   ; @VM_WRITE
	.comm	_VM_SHARED,4,2                  ; @VM_SHARED
	.comm	_VM_DONTEXPAND,4,2              ; @VM_DONTEXPAND
	.comm	_cafe_v4l_vm_ops,4,2            ; @cafe_v4l_vm_ops
	.comm	_V4L2_BUF_FLAG_MAPPED,4,2       ; @V4L2_BUF_FLAG_MAPPED
	.no_dead_strip	_cafe_v4l_mmap
.subsections_via_symbols
