	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_mremap                     ## -- Begin function sys_mremap
	.p2align	4, 0x90
_sys_mremap:                            ## @sys_mremap
	.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
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movl	%esi, %r14d
	movl	%edi, %r13d
	leaq	L_.str(%rip), %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	movl	%ebx, %r8d
	callq	_STRACE
	movl	%r13d, %edi
	callq	_PGOFFSET
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	_MREMAP_MAYMOVE_@GOTPCREL(%rip), %rcx
	movq	_MREMAP_FIXED_@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	(%rcx), %ecx
	orl	%eax, %ecx
	notl	%ecx
	testl	%ebx, %ecx
	jne	LBB0_4
## %bb.2:
	testl	%ebx, %eax
	je	LBB0_7
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	callq	_FIXME
LBB0_4:
	movq	__EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %r13d
LBB0_6:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%r14d, %edi
	callq	_PAGE
	movq	%rax, %r14
	movl	%r15d, %edi
	callq	_PAGE
	movq	%rax, %rbx
	movq	_current@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax), %r12d
	movl	%r13d, %edi
	callq	_PAGE
	movq	%rbx, %rcx
	subq	%r14, %rcx
	jle	LBB0_12
## %bb.8:
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edi
	movq	%rax, %rsi
	callq	_mem_pt
	testq	%rax, %rax
	je	LBB0_17
## %bb.9:
	movl	(%rax), %r12d
	movl	%r13d, %edi
	callq	_PAGE
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %edi
	callq	_PAGE
	addq	%r14, %rax
	cmpq	%rax, %rbx
	jge	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r15), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_mem_pt
	incq	%rbx
	jmp	LBB0_10
LBB0_12:
	addq	%rbx, %rax
	subq	%rbx, %r14
	movl	%r12d, %edi
	movq	%rax, %rsi
	movq	%r14, %rdx
	callq	_pt_unmap
	testl	%eax, %eax
	jns	LBB0_6
	jmp	LBB0_17
LBB0_13:
	movq	_P_ANONYMOUS@GOTPCREL(%rip), %rax
	testl	%r12d, (%rax)
	je	LBB0_16
## %bb.14:
	movl	%r13d, %edi
	callq	_PAGE
	movq	%rax, %rbx
	addq	%r14, %rbx
	movq	(%r15), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_pt_is_hole
	testl	%eax, %eax
	je	LBB0_18
## %bb.15:
	movq	(%r15), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	movq	%r14, %rdx
	movl	%r12d, %ecx
	callq	_pt_map_nothing
	testl	%eax, %eax
	cmovsl	%eax, %r13d
	jmp	LBB0_6
LBB0_16:
	leaq	L_.str.2(%rip), %rdi
	callq	_FIXME
LBB0_17:
	movq	__EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_18:
	movq	__ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mremap(%#x, %#x, %#x, %d)"

	.comm	__EINVAL,4,2                    ## @_EINVAL
	.comm	_MREMAP_MAYMOVE_,4,2            ## @MREMAP_MAYMOVE_
	.comm	_MREMAP_FIXED_,4,2              ## @MREMAP_FIXED_
L_.str.1:                               ## @.str.1
	.asciz	"missing MREMAP_FIXED"

	.comm	_current,8,3                    ## @current
	.comm	__EFAULT,4,2                    ## @_EFAULT
	.comm	_P_ANONYMOUS,4,2                ## @P_ANONYMOUS
L_.str.2:                               ## @.str.2
	.asciz	"mremap grow on file mappings"

	.comm	__ENOMEM,4,2                    ## @_ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_mremap                     ; -- Begin function sys_mremap
	.p2align	2
_sys_mremap:                            ; @sys_mremap
	.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	x22, x3
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	mov	x2, x21
	mov	x3, x20
	mov	x4, x22
	bl	_STRACE
	mov	x0, x19
	bl	_PGOFFSET
	cbnz	x0, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _MREMAP_MAYMOVE_@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MREMAP_MAYMOVE_@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x8]
Lloh5:
	adrp	x8, _MREMAP_FIXED_@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MREMAP_FIXED_@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	orr	w9, w8, w9
	bics	wzr, w22, w9
	b.ne	LBB0_4
; %bb.2:
	tst	w8, w22
	b.eq	LBB0_7
; %bb.3:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_FIXME
LBB0_4:
Lloh10:
	adrp	x8, __EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, __EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	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_7:
	mov	x0, x21
	bl	_PAGE
	mov	x21, x0
	mov	x0, x20
	bl	_PAGE
	mov	x23, x0
Lloh12:
	adrp	x24, _current@GOTPAGE
Lloh13:
	ldr	x24, [x24, _current@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	w22, [x8]
	mov	x0, x19
	bl	_PAGE
	mov	x1, x0
	subs	x20, x23, x21
	b.le	LBB0_12
; %bb.8:
	mov	x0, x22
	bl	_mem_pt
	cbz	x0, LBB0_17
; %bb.9:
	ldr	w22, [x0]
	mov	x0, x19
	bl	_PAGE
	mov	x23, x0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_PAGE
	add	x8, x0, x21
	cmp	x23, x8
	b.ge	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [x24]
	ldr	w0, [x8]
	mov	x1, x23
	bl	_mem_pt
	add	x23, x23, #1
	b	LBB0_10
LBB0_12:
	add	x1, x1, x23
	sub	x2, x21, x23
	mov	x0, x22
	bl	_pt_unmap
Lloh14:
	adrp	x8, __EFAULT@GOTPAGE
Lloh15:
	ldr	x8, [x8, __EFAULT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w0, w8, w19, lt
	b	LBB0_6
LBB0_13:
Lloh17:
	adrp	x8, _P_ANONYMOUS@GOTPAGE
Lloh18:
	ldr	x8, [x8, _P_ANONYMOUS@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_16
; %bb.14:
	mov	x0, x19
	bl	_PAGE
	add	x21, x0, x21
	ldr	x8, [x24]
	ldr	w0, [x8]
	mov	x1, x21
	mov	x2, x20
	bl	_pt_is_hole
	cbz	w0, LBB0_18
; %bb.15:
	ldr	x8, [x24]
	ldr	w0, [x8]
	mov	x1, x21
	mov	x2, x20
	mov	x3, x22
	bl	_pt_map_nothing
	cmp	w0, #0
	csel	w0, w0, w19, lt
	b	LBB0_6
LBB0_16:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_FIXME
LBB0_17:
Lloh22:
	adrp	x8, __EFAULT@GOTPAGE
Lloh23:
	ldr	x8, [x8, __EFAULT@GOTPAGEOFF]
	b	LBB0_5
LBB0_18:
Lloh24:
	adrp	x8, __ENOMEM@GOTPAGE
Lloh25:
	ldr	x8, [x8, __ENOMEM@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mremap(%#x, %#x, %#x, %d)"

	.comm	__EINVAL,4,2                    ; @_EINVAL
	.comm	_MREMAP_MAYMOVE_,4,2            ; @MREMAP_MAYMOVE_
	.comm	_MREMAP_FIXED_,4,2              ; @MREMAP_FIXED_
l_.str.1:                               ; @.str.1
	.asciz	"missing MREMAP_FIXED"

	.comm	_current,8,3                    ; @current
	.comm	__EFAULT,4,2                    ; @_EFAULT
	.comm	_P_ANONYMOUS,4,2                ; @P_ANONYMOUS
l_.str.2:                               ; @.str.2
	.asciz	"mremap grow on file mappings"

	.comm	__ENOMEM,4,2                    ; @_ENOMEM
.subsections_via_symbols
