	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_memseg
_alloc_memseg:                          ## @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
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_VM_MEMSEG_NAME
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_M_VMMDEV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4, %edi
	callq	_malloc
	movq	%rax, %r14
	movl	8(%r13), %edi
	movq	%rax, %rsi
	movl	$4, %edx
	xorl	%ecx, %ecx
	callq	_copystr
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
	jmp	LBB0_3
LBB0_1:
	movl	$1, %r12d
	xorl	%r14d, %r14d
LBB0_3:
	movl	(%r15), %edi
	movl	(%r13), %esi
	movl	4(%r13), %edx
	movl	%r12d, %ecx
	callq	_vm_alloc_memseg
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %ebx
LBB0_10:
	movq	_M_VMMDEV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_free
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	%r13, %rdi
	callq	_VM_MEMSEG_NAME
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movl	(%r15), %edi
	callq	_vm_name
	movl	(%r13), %esi
	movl	%eax, %edi
	movq	%r14, %rdx
	callq	_devmem_create_cdev
	testl	%eax, %eax
	je	LBB0_8
## %bb.9:
	movl	%eax, %ebx
	movl	(%r15), %edi
	movl	(%r13), %esi
	callq	_vm_free_memseg
	jmp	LBB0_10
LBB0_6:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_8:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_M_VMMDEV,4,2                   ## @M_VMMDEV
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.no_dead_strip	_alloc_memseg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_memseg
_alloc_memseg:                          ; @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
	mov	x20, x1
	mov	x21, x0
	mov	x0, x1
	bl	_VM_MEMSEG_NAME
Lloh0:
	adrp	x23, _M_VMMDEV@GOTPAGE
Lloh1:
	ldr	x23, [x23, _M_VMMDEV@GOTPAGEOFF]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w1, [x23]
Lloh2:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh3:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w0, #4
	bl	_malloc
	mov	x19, x0
	ldr	w0, [x20, #8]
	mov	x1, x19
	mov	w2, #4
	mov	x3, #0
	bl	_copystr
	cbnz	w0, LBB0_5
; %bb.2:
	mov	w3, #0
	b	LBB0_4
LBB0_3:
	mov	x19, #0
	mov	w3, #1
LBB0_4:
	ldr	w0, [x21]
	ldp	w1, w2, [x20]
	bl	_vm_alloc_memseg
	cbz	w0, LBB0_7
LBB0_5:
	mov	x22, x0
LBB0_6:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_free
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	mov	x0, x20
	bl	_VM_MEMSEG_NAME
	cbz	x0, LBB0_10
; %bb.8:
	ldr	w0, [x21]
	bl	_vm_name
	ldr	w1, [x20]
	mov	x2, x19
	bl	_devmem_create_cdev
	mov	x22, x0
	cbz	w0, LBB0_11
; %bb.9:
	ldr	w0, [x21]
	ldr	w1, [x20]
	bl	_vm_free_memseg
	b	LBB0_6
LBB0_10:
	mov	w22, #0
	b	LBB0_6
LBB0_11:
	mov	x19, #0
	b	LBB0_6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_M_VMMDEV,4,2                   ; @M_VMMDEV
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.no_dead_strip	_alloc_memseg
.subsections_via_symbols
