	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmm_mmio_alloc                 ## -- Begin function vmm_mmio_alloc
	.p2align	4, 0x90
_vmm_mmio_alloc:                        ## @vmm_mmio_alloc
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %ebx
	movq	%rdx, %r12
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, -44(%rbp)
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$1, %edi
	callq	_sglist_alloc
	movq	%rax, %r14
	movq	%rax, %rdi
	movl	%ebx, %esi
	movq	%r12, %rdx
	callq	_sglist_append_phys
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	movslq	%eax, %rsi
	callq	_KASSERT
	movq	_OBJT_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VM_PROT_RW@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	xorl	%r13d, %r13d
	movq	%r14, %rsi
	movq	%r12, %rdx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_vm_pager_allocate
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_VM_OBJECT_WLOCK
	movq	_VM_MEMATTR_UNCACHEABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_vm_object_set_memattr
	movl	%eax, %r13d
	movq	%rbx, %rdi
	callq	_VM_OBJECT_WUNLOCK
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	je	LBB0_3
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	movl	%r13d, %esi
	callq	_panic
LBB0_3:
	movq	_VMFS_NO_SPACE@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	movl	(%r15), %eax
	leaq	-44(%rbp), %rcx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	xorl	%edx, %edx
	movq	%r12, %r8
	xorl	%r9d, %r9d
	pushq	$0
	pushq	%rax
	pushq	%rax
	pushq	%r10
	callq	_vm_map_find
	addq	$32, %rsp
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %r13
	jmp	LBB0_6
LBB0_5:
	movq	%rbx, %rdi
	callq	_vm_object_deallocate
	xorl	%r13d, %r13d
LBB0_6:
	movq	%r14, %rdi
	callq	_sglist_free
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_OBJT_SG,4,2                    ## @OBJT_SG
	.comm	_VM_PROT_RW,4,2                 ## @VM_PROT_RW
	.comm	_VM_MEMATTR_UNCACHEABLE,4,2     ## @VM_MEMATTR_UNCACHEABLE
	.comm	_KERN_SUCCESS,4,2               ## @KERN_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"vmm_mmio_alloc: vm_object_set_memattr error %d"

	.comm	_VMFS_NO_SPACE,4,2              ## @VMFS_NO_SPACE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmm_mmio_alloc                 ; -- Begin function vmm_mmio_alloc
	.p2align	2
_vmm_mmio_alloc:                        ; @vmm_mmio_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x3
	mov	x20, x2
	mov	x21, x0
	str	w1, [sp, #12]
Lloh0:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #1
	bl	_sglist_alloc
	mov	x19, x0
	mov	x1, x22
	mov	x2, x20
	bl	_sglist_append_phys
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, #0
	cset	w8, eq
	sxtw	x1, w0
	mov	x0, x8
	bl	_KASSERT
Lloh3:
	adrp	x8, _OBJT_SG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _OBJT_SG@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x24, _VM_PROT_RW@GOTPAGE
Lloh7:
	ldr	x24, [x24, _VM_PROT_RW@GOTPAGEOFF]
	ldr	w3, [x24]
	mov	x1, x19
	mov	x2, x20
	mov	w4, #0
	mov	x5, #0
	bl	_vm_pager_allocate
	mov	x22, x0
	cbz	x0, LBB0_5
; %bb.1:
	mov	x0, x22
	bl	_VM_OBJECT_WLOCK
Lloh8:
	adrp	x8, _VM_MEMATTR_UNCACHEABLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VM_MEMATTR_UNCACHEABLE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_vm_object_set_memattr
	mov	x23, x0
	mov	x0, x22
	bl	_VM_OBJECT_WUNLOCK
Lloh11:
	adrp	x25, _KERN_SUCCESS@GOTPAGE
Lloh12:
	ldr	x25, [x25, _KERN_SUCCESS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w23, w8
	b.eq	LBB0_3
; %bb.2:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x23
	bl	_panic
LBB0_3:
Lloh15:
	adrp	x8, _VMFS_NO_SPACE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VMFS_NO_SPACE@GOTPAGEOFF]
Lloh17:
	ldr	w6, [x8]
	ldr	w7, [x24]
	stp	w7, wzr, [sp]
	add	x3, sp, #12
	mov	x0, x21
	mov	x1, x22
	mov	w2, #0
	mov	x4, x20
	mov	w5, #0
	bl	_vm_map_find
	ldr	w8, [x25]
	cmp	w0, w8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x22
	bl	_vm_object_deallocate
	mov	x22, #0
LBB0_5:
	mov	x0, x19
	bl	_sglist_free
	mov	x0, x22
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_OBJT_SG,4,2                    ; @OBJT_SG
	.comm	_VM_PROT_RW,4,2                 ; @VM_PROT_RW
	.comm	_VM_MEMATTR_UNCACHEABLE,4,2     ; @VM_MEMATTR_UNCACHEABLE
	.comm	_KERN_SUCCESS,4,2               ; @KERN_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"vmm_mmio_alloc: vm_object_set_memattr error %d"

	.comm	_VMFS_NO_SPACE,4,2              ; @VMFS_NO_SPACE
.subsections_via_symbols
