	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_mmap                      ## -- Begin function plat_mmap
	.p2align	4, 0x90
_plat_mmap:                             ## @plat_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	_MAP_PRIVATE@GOTPCREL(%rip), %rax
	movq	_MAP_ANONYMOUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movl	$-1, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %rbx
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_1
## %bb.2:
	testq	%r15, %r15
	je	LBB0_6
## %bb.3:
	cmpq	%r15, %rbx
	je	LBB0_6
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_lprintf
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_munmap
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r15, %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_lprintf
LBB0_6:
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAP_PRIVATE,4,2                ## @MAP_PRIVATE
	.comm	_MAP_ANONYMOUS,4,2              ## @MAP_ANONYMOUS
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmap(%08lx, %zd) failed: %d\n"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"warning: wanted to map @%08lx, got %p\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_plat_mmap                      ; -- Begin function plat_mmap
	.p2align	2
_plat_mmap:                             ; @plat_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
	mov	x21, x3
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _MAP_PRIVATE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAP_PRIVATE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _MAP_ANONYMOUS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAP_ANONYMOUS@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _PROT_READ@GOTPAGE
Lloh7:
	ldr	x10, [x10, _PROT_READ@GOTPAGEOFF]
	orr	w3, w9, w8
Lloh8:
	ldr	w8, [x10]
Lloh9:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	w4, #-1
	mov	w5, #0
	bl	_mmap
Lloh12:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_5
; %bb.1:
	mov	x22, x0
	cbz	x20, LBB0_7
; %bb.2:
	cmp	x22, x20
	b.eq	LBB0_7
; %bb.3:
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	mov	x2, x22
	bl	_lprintf
	cbz	w21, LBB0_7
; %bb.4:
	mov	x0, x22
	mov	x1, x19
	bl	_munmap
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x8, _errno@GOTPAGE
Lloh18:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x19
	bl	_lprintf
LBB0_6:
	mov	x22, #0
LBB0_7:
	mov	x0, x22
	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
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_MAP_PRIVATE,4,2                ; @MAP_PRIVATE
	.comm	_MAP_ANONYMOUS,4,2              ; @MAP_ANONYMOUS
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmap(%08lx, %zd) failed: %d\n"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"warning: wanted to map @%08lx, got %p\n"

.subsections_via_symbols
