	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function afu_mmap
_afu_mmap:                              ## @afu_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_VM_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rsi)
	je	LBB0_1
## %bb.3:
	movq	%rsi, %rbx
	movq	(%rdi), %rdi
	movl	(%rsi), %r14d
	subl	4(%rsi), %r14d
	callq	_dev_get_platdata
	movl	12(%rbx), %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %r12
	movb	(%r12), %cl
	shll	%cl, %r15d
	leaq	-48(%rbp), %rcx
	movq	%rax, %rdi
	movl	%r15d, %esi
	movl	%r14d, %edx
	callq	_afu_mmio_region_get_by_offset
	testl	%eax, %eax
	jne	LBB0_11
## %bb.4:
	movl	-48(%rbp), %eax
	movq	_DFL_PORT_REGION_MMAP@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.5:
	movl	8(%rbx), %ecx
	movq	_VM_READ@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_8
## %bb.6:
	movq	_DFL_PORT_REGION_READ@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_7
LBB0_8:
	movq	_VM_WRITE@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_10
## %bb.9:
	movq	_DFL_PORT_REGION_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
LBB0_10:
	movl	16(%rbx), %edi
	callq	_pgprot_noncached
	movl	%eax, 16(%rbx)
	movl	4(%rbx), %esi
	addl	-44(%rbp), %r15d
	subl	-40(%rbp), %r15d
	movb	(%r12), %cl
	sarl	%cl, %r15d
	movq	%rbx, %rdi
	movl	%r15d, %edx
	movl	%r14d, %ecx
	movl	%eax, %r8d
	callq	_remap_pfn_range
	jmp	LBB0_11
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_11:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_SHARED,4,2                  ## @VM_SHARED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_DFL_PORT_REGION_MMAP,4,2       ## @DFL_PORT_REGION_MMAP
	.comm	_VM_READ,4,2                    ## @VM_READ
	.comm	_DFL_PORT_REGION_READ,4,2       ## @DFL_PORT_REGION_READ
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_VM_WRITE,4,2                   ## @VM_WRITE
	.comm	_DFL_PORT_REGION_WRITE,4,2      ## @DFL_PORT_REGION_WRITE
	.no_dead_strip	_afu_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function afu_mmap
_afu_mmap:                              ; @afu_mmap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	w8, [x1, #8]
Lloh0:
	adrp	x9, _VM_SHARED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VM_SHARED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.1:
	mov	x19, x1
	ldr	x0, [x0]
	ldp	w8, w9, [x1]
	sub	w20, w8, w9
	bl	_dev_get_platdata
	ldr	w8, [x19, #12]
Lloh3:
	adrp	x22, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x22, [x22, _PAGE_SHIFT@GOTPAGEOFF]
	ldr	w9, [x22]
	lsl	w21, w8, w9
	mov	x3, sp
	mov	x1, x21
	mov	x2, x20
	bl	_afu_mmio_region_get_by_offset
	cbnz	w0, LBB0_10
; %bb.2:
	ldr	w8, [sp]
Lloh5:
	adrp	x9, _DFL_PORT_REGION_MMAP@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DFL_PORT_REGION_MMAP@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.3:
	ldr	w9, [x19, #8]
Lloh8:
	adrp	x10, _VM_READ@GOTPAGE
Lloh9:
	ldr	x10, [x10, _VM_READ@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
; %bb.4:
Lloh11:
	adrp	x10, _DFL_PORT_REGION_READ@GOTPAGE
Lloh12:
	ldr	x10, [x10, _DFL_PORT_REGION_READ@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_11
LBB0_5:
Lloh14:
	adrp	x10, _VM_WRITE@GOTPAGE
Lloh15:
	ldr	x10, [x10, _VM_WRITE@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_7
; %bb.6:
Lloh17:
	adrp	x9, _DFL_PORT_REGION_WRITE@GOTPAGE
Lloh18:
	ldr	x9, [x9, _DFL_PORT_REGION_WRITE@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
LBB0_7:
	ldr	w0, [x19, #16]
	bl	_pgprot_noncached
	mov	x4, x0
	str	w0, [x19, #16]
	ldr	w1, [x19, #4]
	ldp	w8, w9, [sp, #4]
	add	w8, w8, w21
	sub	w8, w8, w9
	ldr	w9, [x22]
	asr	w2, w8, w9
	mov	x0, x19
	mov	x3, x20
	bl	_remap_pfn_range
	b	LBB0_10
LBB0_8:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	add	sp, sp, #64
	ret
LBB0_11:
Lloh22:
	adrp	x8, _EPERM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_9
	.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 AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_SHARED,4,2                  ; @VM_SHARED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_DFL_PORT_REGION_MMAP,4,2       ; @DFL_PORT_REGION_MMAP
	.comm	_VM_READ,4,2                    ; @VM_READ
	.comm	_DFL_PORT_REGION_READ,4,2       ; @DFL_PORT_REGION_READ
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_VM_WRITE,4,2                   ; @VM_WRITE
	.comm	_DFL_PORT_REGION_WRITE,4,2      ; @DFL_PORT_REGION_WRITE
	.no_dead_strip	_afu_mmap
.subsections_via_symbols
