	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_mmap                    ## -- Begin function ocrdma_mmap
	.p2align	4, 0x90
_ocrdma_mmap:                           ## @ocrdma_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, %rbx
	callq	_get_ocrdma_ucontext
	movq	%rax, %r13
	movl	(%rbx), %edi
	callq	_get_ocrdma_dev
	movq	%rax, %r12
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	(%r15), %rbx
	shlq	%cl, %rbx
	movslq	16(%r15), %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	decl	%ecx
	testl	%eax, %ecx
	je	LBB0_3
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	8(%r15), %rcx
	movq	32(%r12), %r14
	subq	%rax, %rcx
	movq	%r13, %rdi
	movq	%rcx, %r13
	movq	%rbx, %rsi
	movq	%rcx, %rdx
	callq	_ocrdma_search_mmap
	testl	%eax, %eax
	je	LBB0_1
## %bb.4:
	cmpq	%r14, %rbx
	jb	LBB0_11
## %bb.5:
	addq	(%r12), %r14
	cmpq	%r14, %rbx
	ja	LBB0_11
## %bb.6:
	cmpq	8(%r12), %r13
	jbe	LBB0_7
LBB0_11:
	movq	16(%r12), %rax
	testq	%rax, %rax
	je	LBB0_17
## %bb.12:
	movq	24(%r12), %rcx
	cmpq	%rcx, %rbx
	jb	LBB0_17
## %bb.13:
	addq	%rax, %rcx
	cmpq	%rcx, %rbx
	ja	LBB0_17
## %bb.14:
	cmpq	%rax, %r13
	ja	LBB0_17
## %bb.15:
	movq	_VM_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 20(%r15)
	jne	LBB0_8
## %bb.16:
	movl	24(%r15), %edi
	callq	_pgprot_writecombine
	jmp	LBB0_10
LBB0_17:
	movl	16(%r15), %esi
	movq	(%r15), %rdx
	movl	24(%r15), %r8d
	movq	%r15, %rdi
	movq	%r13, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_remap_pfn_range                ## TAILCALL
LBB0_7:
	movq	_VM_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 20(%r15)
	je	LBB0_9
LBB0_8:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_9:
	movl	24(%r15), %edi
	callq	_pgprot_noncached
LBB0_10:
	movl	%eax, 24(%r15)
	movl	16(%r15), %esi
	movq	(%r15), %rdx
	movq	%r15, %rdi
	movq	%r13, %rcx
	movl	%eax, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_io_remap_pfn_range             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_READ,4,2                    ## @VM_READ
	.comm	_EPERM,4,2                      ## @EPERM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ocrdma_mmap                    ; -- Begin function ocrdma_mmap
	.p2align	2
_ocrdma_mmap:                           ; @ocrdma_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
	mov	x19, x1
	mov	x20, x0
	bl	_get_ocrdma_ucontext
	mov	x23, x0
	ldr	w0, [x20]
	bl	_get_ocrdma_dev
	ldrsw	x8, [x19, #16]
Lloh0:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w9, w9, #1
	tst	w9, w8
	b.eq	LBB0_3
LBB0_1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
	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
LBB0_3:
	mov	x21, x0
Lloh5:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	ldp	x10, x11, [x19]
	lsl	x22, x10, x9
	ldr	x24, [x0, #32]
	sub	x20, x11, x8
	mov	x0, x23
	mov	x1, x22
	mov	x2, x20
	bl	_ocrdma_search_mmap
	cbz	w0, LBB0_1
; %bb.4:
	cmp	x22, x24
	b.lo	LBB0_7
; %bb.5:
	ldr	x8, [x21]
	add	x8, x8, x24
	cmp	x22, x8
	b.hi	LBB0_7
; %bb.6:
	ldr	x8, [x21, #8]
	cmp	x20, x8
	b.ls	LBB0_12
LBB0_7:
	ldr	x8, [x21, #16]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	x9, [x21, #24]
	add	x10, x9, x8
	cmp	x22, x9
	ccmp	x22, x10, #2, hs
	ccmp	x20, x8, #2, ls
	b.ls	LBB0_10
LBB0_9:
	ldr	w1, [x19, #16]
	ldr	x2, [x19]
	ldr	w4, [x19, #24]
	mov	x0, x19
	mov	x3, 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
	b	_remap_pfn_range
LBB0_10:
	ldr	w8, [x19, #20]
Lloh8:
	adrp	x9, _VM_READ@GOTPAGE
Lloh9:
	ldr	x9, [x9, _VM_READ@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_13
; %bb.11:
	ldr	w0, [x19, #24]
	bl	_pgprot_writecombine
	b	LBB0_15
LBB0_12:
	ldr	w8, [x19, #20]
Lloh11:
	adrp	x9, _VM_READ@GOTPAGE
Lloh12:
	ldr	x9, [x9, _VM_READ@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
LBB0_13:
Lloh14:
	adrp	x8, _EPERM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_2
LBB0_14:
	ldr	w0, [x19, #24]
	bl	_pgprot_noncached
LBB0_15:
	mov	x4, x0
	str	w0, [x19, #24]
	ldr	w1, [x19, #16]
	ldr	x2, [x19]
	mov	x0, x19
	mov	x3, 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
	b	_io_remap_pfn_range
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_READ,4,2                    ; @VM_READ
	.comm	_EPERM,4,2                      ; @EPERM
.subsections_via_symbols
