	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_mmap_memseg                 ## -- Begin function vm_mmap_memseg
	.p2align	4, 0x90
_vm_mmap_memseg:                        ## @vm_mmap_memseg
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -48(%rbp)
	testl	%r9d, %r9d
	je	LBB0_3
## %bb.1:
	movl	%r9d, %ebx
	movq	%rcx, %r12
	movq	_VM_PROT_ALL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	testl	%r9d, %ecx
	jne	LBB0_3
## %bb.2:
	movq	_VM_MEMMAP_F_WIRED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	testl	%ecx, 16(%rbp)
	je	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
LBB0_5:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	%edx, %r15d
	testl	%edx, %edx
	js	LBB0_3
## %bb.7:
	movq	_VM_MAX_MEMSEGS@GOTPCREL(%rip), %rcx
	cmpl	%r15d, (%rcx)
	jle	LBB0_3
## %bb.8:
	movq	%rsi, %rax
	movq	%rdi, %r13
	movq	16(%rdi), %rcx
	movl	%r15d, %edx
	shlq	$4, %rdx
	movq	8(%rcx,%rdx), %rsi
	testq	%rsi, %rsi
	je	LBB0_3
## %bb.9:
	testq	%r12, %r12
	js	LBB0_3
## %bb.10:
	movq	%r8, %r14
	leaq	(%r8,%r12), %rdi
	cmpq	%r12, %rdi
	jle	LBB0_3
## %bb.11:
	cmpq	(%rcx,%rdx), %rdi
	jg	LBB0_3
## %bb.12:
	orq	%r12, %rax
	orq	%rdi, %rax
	movq	_PAGE_MASK@GOTPCREL(%rip), %rdi
	testq	%rax, (%rdi)
	jne	LBB0_3
## %bb.13:
	movq	_VM_MAX_MEMMAPS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_17
## %bb.14:
	leaq	(%rcx,%rdx), %rdi
	addq	$8, %rdi
	movq	8(%r13), %rcx
	shlq	$3, %rax
	leaq	(%rax,%rax,4), %rax
	xorl	%edx, %edx
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%rcx,%rdx)
	je	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	addq	$40, %rdx
	cmpq	%rdx, %rax
	jne	LBB0_15
LBB0_17:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_18:
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -64(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rdi
	movq	_VMFS_NO_SPACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	-48(%rbp), %rcx
	movq	%r12, %rdx
	movq	%r14, %r8
	xorl	%r9d, %r9d
	pushq	$0
	pushq	%rbx
	pushq	%rbx
	pushq	%rax
	callq	_vm_map_find
	addq	$32, %rsp
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_22
## %bb.19:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_vm_object_reference
	movl	16(%rbp), %ecx
	movq	_VM_MEMMAP_F_WIRED@GOTPCREL(%rip), %rax
	testl	%ecx, (%rax)
	je	LBB0_21
## %bb.20:
	movq	(%r13), %rdi
	movq	-48(%rbp), %rsi
	leal	(%rsi,%r14), %edx
	movq	_VM_MAP_WIRE_USER@GOTPCREL(%rip), %rax
	movq	_VM_MAP_WIRE_NOHOLES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	callq	_vm_map_wire
	movl	16(%rbp), %ecx
	movl	%eax, %edx
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_23
LBB0_21:
	movq	-48(%rbp), %rax
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	movq	%rax, 32(%rdx,%rsi)
	movq	%r14, (%rdx,%rsi)
	movq	%r12, 24(%rdx,%rsi)
	movl	%r15d, 8(%rdx,%rsi)
	movl	%ebx, 12(%rdx,%rsi)
	movl	%ecx, 16(%rdx,%rsi)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_23:
	movq	(%r13), %rdi
	movq	-48(%rbp), %rsi
	addl	%esi, %r14d
	movl	%edx, %ebx
	movl	%r14d, %edx
	callq	_vm_map_remove
	movq	_KERN_RESOURCE_SHORTAGE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_22
## %bb.24:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_22:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_PROT_ALL,4,2                ## @VM_PROT_ALL
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_MEMMAP_F_WIRED,4,2          ## @VM_MEMMAP_F_WIRED
	.comm	_VM_MAX_MEMSEGS,4,2             ## @VM_MAX_MEMSEGS
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_VM_MAX_MEMMAPS,4,2             ## @VM_MAX_MEMMAPS
	.comm	_ENOSPC,4,2                     ## @ENOSPC
	.comm	_VMFS_NO_SPACE,4,2              ## @VMFS_NO_SPACE
	.comm	_KERN_SUCCESS,4,2               ## @KERN_SUCCESS
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_VM_MAP_WIRE_USER,4,2           ## @VM_MAP_WIRE_USER
	.comm	_VM_MAP_WIRE_NOHOLES,4,2        ## @VM_MAP_WIRE_NOHOLES
	.comm	_KERN_RESOURCE_SHORTAGE,4,2     ## @KERN_RESOURCE_SHORTAGE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_mmap_memseg                 ; -- Begin function vm_mmap_memseg
	.p2align	2
_vm_mmap_memseg:                        ; @vm_mmap_memseg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	str	x1, [sp, #8]
	cbz	w5, LBB0_3
; %bb.1:
	mov	x21, x5
Lloh0:
	adrp	x9, _VM_PROT_ALL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VM_PROT_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	bics	wzr, w5, w9
	b.ne	LBB0_3
; %bb.2:
	mov	x19, x6
Lloh3:
	adrp	x25, _VM_MEMMAP_F_WIRED@GOTPAGE
Lloh4:
	ldr	x25, [x25, _VM_MEMMAP_F_WIRED@GOTPAGEOFF]
	ldr	w9, [x25]
	bics	wzr, w6, w9
	b.eq	LBB0_6
LBB0_3:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w0, [x8]
LBB0_5:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_6:
	mov	x22, x2
	tbnz	w2, #31, LBB0_3
; %bb.7:
Lloh7:
	adrp	x9, _VM_MAX_MEMSEGS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _VM_MAX_MEMSEGS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w9, w22
	b.le	LBB0_3
; %bb.8:
	mov	x8, x1
	mov	x24, x0
	ldr	x9, [x0, #16]
	add	x26, x9, w22, uxtw #4
	ldr	x1, [x26, #8]!
	cbz	x1, LBB0_3
; %bb.9:
	mov	x23, x3
	tbnz	x3, #63, LBB0_3
; %bb.10:
	mov	x20, x4
	add	x10, x4, x23
	cmp	x10, x23
	b.le	LBB0_3
; %bb.11:
	mov	w11, w22
	lsl	x11, x11, #4
	ldr	x9, [x9, x11]
	cmp	x10, x9
	b.gt	LBB0_3
; %bb.12:
	orr	x8, x23, x8
	orr	x8, x8, x10
Lloh10:
	adrp	x9, _PAGE_MASK@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PAGE_MASK@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	tst	x9, x8
	b.ne	LBB0_3
; %bb.13:
Lloh13:
	adrp	x8, _VM_MAX_MEMMAPS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _VM_MAX_MEMMAPS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.14:
	ldr	x9, [x24, #8]
	add	x27, x9, #16
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldur	x9, [x27, #-16]
	cbz	x9, LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	add	x27, x27, #40
	subs	x8, x8, #1
	b.ne	LBB0_15
LBB0_17:
Lloh16:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_4
LBB0_18:
	ldr	x0, [x24]
Lloh18:
	adrp	x8, _VMFS_NO_SPACE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VMFS_NO_SPACE@GOTPAGEOFF]
Lloh20:
	ldr	w6, [x8]
	stp	w21, wzr, [sp]
	add	x3, sp, #8
	mov	x2, x23
	mov	x4, x20
	mov	w5, #0
	mov	x7, x21
	bl	_vm_map_find
Lloh21:
	adrp	x28, _KERN_SUCCESS@GOTPAGE
Lloh22:
	ldr	x28, [x28, _KERN_SUCCESS@GOTPAGEOFF]
	ldr	w8, [x28]
	cmp	w0, w8
	b.ne	LBB0_22
; %bb.19:
	ldr	x0, [x26]
	bl	_vm_object_reference
	ldr	w8, [x25]
	tst	w8, w19
	b.eq	LBB0_21
; %bb.20:
	ldr	x0, [x24]
	ldr	x1, [sp, #8]
Lloh23:
	adrp	x8, _VM_MAP_WIRE_USER@GOTPAGE
Lloh24:
	ldr	x8, [x8, _VM_MAP_WIRE_USER@GOTPAGEOFF]
	add	w2, w1, w20
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _VM_MAP_WIRE_NOHOLES@GOTPAGE
Lloh27:
	ldr	x9, [x9, _VM_MAP_WIRE_NOHOLES@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w3, w9, w8
	bl	_vm_map_wire
	ldr	w8, [x28]
	cmp	w0, w8
	b.ne	LBB0_23
LBB0_21:
	mov	w0, #0
	ldr	x8, [sp, #8]
	stur	x20, [x27, #-16]
	stp	x23, x8, [x27, #8]
	stp	w22, w21, [x27, #-8]
	str	w19, [x27]
	b	LBB0_5
LBB0_22:
Lloh29:
	adrp	x8, _EFAULT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_4
LBB0_23:
	mov	x25, x0
	ldr	x0, [x24]
	ldr	x1, [sp, #8]
	add	w2, w1, w20
	bl	_vm_map_remove
Lloh31:
	adrp	x8, _KERN_RESOURCE_SHORTAGE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _KERN_RESOURCE_SHORTAGE@GOTPAGEOFF]
Lloh33:
	adrp	x9, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x9, [x9, _ENOMEM@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x10, _EFAULT@GOTPAGE
Lloh37:
	ldr	x10, [x10, _EFAULT@GOTPAGEOFF]
	cmp	w25, w8
	csel	x8, x9, x10, eq
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_PROT_ALL,4,2                ; @VM_PROT_ALL
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_MEMMAP_F_WIRED,4,2          ; @VM_MEMMAP_F_WIRED
	.comm	_VM_MAX_MEMSEGS,4,2             ; @VM_MAX_MEMSEGS
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_VM_MAX_MEMMAPS,4,2             ; @VM_MAX_MEMMAPS
	.comm	_ENOSPC,4,2                     ; @ENOSPC
	.comm	_VMFS_NO_SPACE,4,2              ; @VMFS_NO_SPACE
	.comm	_KERN_SUCCESS,4,2               ; @KERN_SUCCESS
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_VM_MAP_WIRE_USER,4,2           ; @VM_MAP_WIRE_USER
	.comm	_VM_MAP_WIRE_NOHOLES,4,2        ; @VM_MAP_WIRE_NOHOLES
	.comm	_KERN_RESOURCE_SHORTAGE,4,2     ; @KERN_RESOURCE_SHORTAGE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
