	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rmap_add
_rmap_add:                              ## @rmap_add
	.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	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	(%rsi), %edi
	callq	_is_rmap_spte
	xorl	%r13d, %r13d
	testl	%eax, %eax
	je	LBB0_14
## %bb.1:
	movl	(%r15), %edi
	movl	%r12d, %esi
	callq	_unalias_gfn
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	___pa
	movl	%eax, %edi
	callq	_page_header
	movq	%r14, %rcx
	subq	8(%rax), %rcx
	movq	16(%rax), %rdx
	movl	%r12d, (%rdx,%rcx)
	movl	(%r15), %edi
	movl	(%rax), %edx
	movl	%r12d, %esi
	callq	_gfn_to_rmap
	movq	%rax, %r12
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movl	(%r14), %edx
	testb	$1, %al
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	callq	_rmap_printk
	movq	%r15, %rdi
	callq	_mmu_alloc_rmap_desc
	movq	(%r12), %rcx
	movq	(%rax), %rdx
	movq	%rcx, (%rdx)
	movq	(%rax), %rcx
	movq	%r14, 8(%rcx)
	orq	$1, %rax
	movq	%rax, (%r12)
	jmp	LBB0_14
LBB0_2:
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_rmap_printk
	movq	%r14, (%r12)
	jmp	LBB0_14
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	callq	_rmap_printk
	movq	(%r12), %rbx
	andq	$-2, %rbx
	movq	_RMAP_EXT@GOTPCREL(%rip), %rax
	movslq	(%rax), %rcx
	movq	(%rbx), %rax
	cmpq	$0, -8(%rax,%rcx,8)
	je	LBB0_6
## %bb.7:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	(%rdx), %rax
	addl	%ecx, %r13d
	cmpq	$0, -8(%rax,%rcx,8)
	movq	%rdx, %rbx
	jne	LBB0_8
	jmp	LBB0_11
LBB0_6:
	xorl	%r13d, %r13d
	jmp	LBB0_11
LBB0_10:
	movq	%r15, %rdi
	callq	_mmu_alloc_rmap_desc
	movq	%rax, 8(%rbx)
	movq	(%rax), %rax
LBB0_11:
	movq	$-1, %rcx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 8(%rax,%rcx,8)
	leaq	1(%rcx), %rcx
	jne	LBB0_12
## %bb.13:
	movl	%ecx, %ecx
	movq	%r14, (%rax,%rcx,8)
LBB0_14:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rmap_add: %p %llx 0->1\n"

L_.str.1:                               ## @.str.1
	.asciz	"rmap_add: %p %llx 1->many\n"

L_.str.2:                               ## @.str.2
	.asciz	"rmap_add: %p %llx many->many\n"

	.comm	_RMAP_EXT,4,2                   ## @RMAP_EXT
	.no_dead_strip	_rmap_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rmap_add
_rmap_add:                              ; @rmap_add
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x1]
	bl	_is_rmap_spte
	cbz	w0, LBB0_4
; %bb.1:
	ldr	w0, [x20]
	mov	x1, x21
	bl	_unalias_gfn
	mov	x21, x0
	mov	x0, x19
	bl	___pa
	bl	_page_header
	ldp	x9, x8, [x0, #8]
	sub	x9, x19, x9
	str	w21, [x8, x9]
	ldr	w8, [x20]
	ldr	w2, [x0]
	mov	x0, x8
	mov	x1, x21
	bl	_gfn_to_rmap
	mov	x22, x0
	ldr	x8, [x0]
	cbz	x8, LBB0_5
; %bb.2:
	ldr	w2, [x19]
	tbnz	w8, #0, LBB0_6
; %bb.3:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_rmap_printk
	mov	x0, x20
	bl	_mmu_alloc_rmap_desc
	mov	w21, #0
	ldr	x8, [x22]
	ldr	x9, [x0]
	str	x8, [x9]
	ldr	x8, [x0]
	str	x19, [x8, #8]
	orr	x8, x0, #0x1
	str	x8, [x22]
	b	LBB0_15
LBB0_4:
	mov	w21, #0
	b	LBB0_15
LBB0_5:
	ldr	w2, [x19]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_rmap_printk
	mov	w21, #0
	str	x19, [x22]
	b	LBB0_15
LBB0_6:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_rmap_printk
	ldr	x8, [x22]
Lloh6:
	adrp	x9, _RMAP_EXT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _RMAP_EXT@GOTPAGEOFF]
	and	x22, x8, #0xfffffffffffffffe
Lloh8:
	ldr	w9, [x9]
	sub	w10, w9, #1
	ldr	x8, [x22]
	ldr	x11, [x8, w10, sxtw #3]
	cbz	x11, LBB0_10
; %bb.7:
	mov	w21, #0
	sxtw	x10, w10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x22, #8]
	cbz	x11, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x11]
	ldr	x12, [x8, x10, lsl #3]
	add	w21, w21, w9
	mov	x22, x11
	cbnz	x12, LBB0_8
	b	LBB0_12
LBB0_10:
	mov	w21, #0
	b	LBB0_12
LBB0_11:
	mov	x0, x20
	bl	_mmu_alloc_rmap_desc
	str	x0, [x22, #8]
	ldr	x8, [x0]
LBB0_12:
	mov	x9, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8, x9, lsl #3]
	add	x9, x9, #1
	cbnz	x10, LBB0_13
; %bb.14:
	sub	w9, w9, #1
	str	x19, [x8, w9, uxtw #3]
LBB0_15:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rmap_add: %p %llx 0->1\n"

l_.str.1:                               ; @.str.1
	.asciz	"rmap_add: %p %llx 1->many\n"

l_.str.2:                               ; @.str.2
	.asciz	"rmap_add: %p %llx many->many\n"

	.comm	_RMAP_EXT,4,2                   ; @RMAP_EXT
	.no_dead_strip	_rmap_add
.subsections_via_symbols
