	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function au1550_mmap
_au1550_mmap:                           ## @au1550_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	(%rdi), %r14
	xorl	%eax, %eax
	callq	_lock_kernel
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%rbx), %eax
	movq	_VM_WRITE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.1:
	leaq	24(%r14), %r13
	cmpq	$0, 8(%rbx)
	jne	LBB0_8
	jmp	LBB0_3
LBB0_6:
	movq	_VM_READ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	leaq	8(%r14), %r13
	cmpq	$0, 8(%rbx)
	jne	LBB0_8
LBB0_3:
	movq	16(%rbx), %r15
	movq	24(%rbx), %r12
	subq	%r12, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movb	(%r13), %cl
	shlq	%cl, %rax
	cmpq	%rax, %r15
	jbe	LBB0_4
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
	callq	_unlock_kernel
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	12(%r13), %edi
	callq	_virt_to_page
	movl	%eax, %edi
	callq	_page_to_pfn
	movl	32(%rbx), %r8d
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_remap_pfn_range
	testq	%rax, %rax
	je	LBB0_10
## %bb.5:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_10:
	movq	_VM_IO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, (%rbx)
	movl	$1, 8(%r13)
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_WRITE,4,2                   ## @VM_WRITE
	.comm	_VM_READ,4,2                    ## @VM_READ
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_VM_IO,4,2                      ## @VM_IO
	.no_dead_strip	_au1550_mmap
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function au1550_mmap
_au1550_mmap:                           ; @au1550_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	x20, x1
	ldr	x19, [x0]
	bl	_lock_kernel
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _VM_WRITE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VM_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	add	x23, x19, #24
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_5
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x9, _VM_READ@GOTPAGE
Lloh4:
	ldr	x9, [x9, _VM_READ@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.3:
	add	x23, x19, #8
	ldr	x8, [x20, #8]
	cbnz	x8, LBB0_5
LBB0_4:
Lloh6:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
	ldp	x9, x21, [x20, #16]
Lloh8:
	ldr	x8, [x8]
	ldr	x10, [x23]
	lsl	x8, x8, x10
	sub	x22, x9, x21
	cmp	x22, x8
	b.ls	LBB0_8
LBB0_5:
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	bl	_unlock_kernel
	mov	x0, x21
	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_8:
	ldr	w0, [x23, #12]
	bl	_virt_to_page
	bl	_page_to_pfn
	mov	x2, x0
	ldr	w4, [x20, #32]
	mov	x0, x20
	mov	x1, x21
	mov	x3, x22
	bl	_remap_pfn_range
	cbz	x0, LBB0_10
; %bb.9:
Lloh11:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_6
LBB0_10:
	mov	w21, #0
Lloh13:
	adrp	x8, _VM_IO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VM_IO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ldr	w9, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
	mov	w8, #1
	str	w8, [x23, #8]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_WRITE,4,2                   ; @VM_WRITE
	.comm	_VM_READ,4,2                    ; @VM_READ
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_VM_IO,4,2                      ; @VM_IO
	.no_dead_strip	_au1550_mmap
.subsections_via_symbols
