	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vm_alloc_memseg                ## -- Begin function vm_alloc_memseg
	.p2align	4, 0x90
_vm_alloc_memseg:                       ## @vm_alloc_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testl	%esi, %esi
	js	LBB0_4
## %bb.1:
	movq	_VM_MAX_MEMSEGS@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_4
## %bb.2:
	movq	%rdx, %rbx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.3:
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	testq	%rbx, (%rax)
	je	LBB0_7
LBB0_4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movl	%ecx, %r14d
	movq	(%rdi), %r15
	movl	%esi, %eax
	leaq	(%rax,%rax,2), %r12
	leaq	(%r15,%r12,8), %r13
	cmpq	$0, 16(%r15,%r12,8)
	je	LBB0_11
## %bb.8:
	cmpq	%rbx, (%r13)
	jne	LBB0_4
## %bb.9:
	cmpl	%r14d, 8(%r15,%r12,8)
	jne	LBB0_4
## %bb.10:
	movq	_EEXIST@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_11:
	movq	_OBJT_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	%rbx, %rsi
	shrq	%cl, %rsi
	callq	_vm_object_allocate
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	(%r15,%r12,8), %rcx
	addq	$16, %rcx
	movq	%rbx, (%r13)
	movq	%rax, (%rcx)
	movl	%r14d, 8(%r15,%r12,8)
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_MAX_MEMSEGS,4,2             ## @VM_MAX_MEMSEGS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_EEXIST,4,2                     ## @EEXIST
	.comm	_OBJT_DEFAULT,4,2               ## @OBJT_DEFAULT
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.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_alloc_memseg                ; -- Begin function vm_alloc_memseg
	.p2align	2
_vm_alloc_memseg:                       ; @vm_alloc_memseg
	.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
	tbnz	w1, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _VM_MAX_MEMSEGS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VM_MAX_MEMSEGS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_4
; %bb.2:
	mov	x20, x2
	cbz	x2, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	tst	x8, x20
	b.eq	LBB0_7
LBB0_4:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	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	x19, x3
	ldr	x21, [x0]
	mov	w22, w1
	mov	w8, #24
	umaddl	x23, w1, w8, x21
	mov	x24, x23
	ldr	x8, [x24, #16]!
	cbz	x8, LBB0_11
; %bb.8:
	ldr	x8, [x23]
	cmp	x8, x20
	b.ne	LBB0_4
; %bb.9:
	mov	w8, #24
	madd	x8, x22, x8, x21
	ldr	w8, [x8, #8]
	cmp	w8, w19
	b.ne	LBB0_4
; %bb.10:
Lloh8:
	adrp	x8, _EEXIST@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EEXIST@GOTPAGEOFF]
	b	LBB0_5
LBB0_11:
Lloh10:
	adrp	x8, _OBJT_DEFAULT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _OBJT_DEFAULT@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
Lloh13:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	lsr	x1, x20, x8
	bl	_vm_object_allocate
	cbz	x0, LBB0_13
; %bb.12:
	mov	x8, x0
	mov	w0, #0
	str	x20, [x23]
	str	x8, [x24]
	mov	w8, #24
	madd	x8, x22, x8, x21
	str	w19, [x8, #8]
	b	LBB0_6
LBB0_13:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_MAX_MEMSEGS,4,2             ; @VM_MAX_MEMSEGS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_EEXIST,4,2                     ; @EEXIST
	.comm	_OBJT_DEFAULT,4,2               ; @OBJT_DEFAULT
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
