	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pmap_alloc_l2_bucket
_pmap_alloc_l2_bucket:                  ## @pmap_alloc_l2_bucket
	.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
	movq	%rdi, %r15
	movl	%esi, %edi
	callq	_L1_IDX
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_PMAP_ASSERT_LOCKED
	movq	_RA_WLOCKED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_assert
	movq	(%r15), %r14
	movl	%ebx, %edi
	callq	_L2_IDX
	movq	(%r14,%rax,8), %r12
	testq	%r12, %r12
	jne	LBB0_7
## %bb.1:
	movl	%ebx, %r13d
	movq	%r15, %rdi
	callq	_PMAP_UNLOCK
	movq	_pvh_global_lock@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_rw_wunlock
	movq	_l2table_zone@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_uma_zalloc
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_rw_wlock
	movq	%r15, %rdi
	callq	_PMAP_LOCK
	testq	%r12, %r12
	je	LBB0_15
## %bb.2:
	movq	(%r15), %rbx
	movl	%r13d, %edi
	callq	_L2_IDX
	cmpq	$0, (%rbx,%rax,8)
	je	LBB0_5
## %bb.3:
	movl	(%r14), %edi
	movq	%r12, %rsi
	callq	_uma_zfree
	movq	(%r15), %rbx
	movl	%r13d, %edi
	callq	_L2_IDX
	movq	(%rbx,%rax,8), %r12
	jmp	LBB0_6
LBB0_5:
	movq	%r12, %rdi
	movl	$16, %esi
	callq	_bzero
	movq	(%r15), %r14
	movl	%r13d, %edi
	callq	_L2_IDX
	movq	%r12, (%r14,%rax,8)
LBB0_6:
	movl	%r13d, %ebx
LBB0_7:
	movq	8(%r12), %r13
	movl	%ebx, %edi
	callq	_L2_BUCKET
	leaq	(%rax,%rax,2), %r14
	movl	%ebx, %eax
	leaq	(,%r14,8), %rbx
	addq	%r13, %rbx
	cmpq	$0, 8(%r13,%r14,8)
	jne	LBB0_16
## %bb.8:
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	8(,%r14,8), %rax
	addq	%r13, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	incq	(%r12)
	movq	%r15, %rdi
	callq	_PMAP_UNLOCK
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wunlock
	movq	_l2zone@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_M_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_uma_zalloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_pvh_global_lock@GOTPCREL(%rip), %rdi
	callq	_rw_wlock
	movq	%r15, %rdi
	callq	_PMAP_LOCK
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	decq	(%r12)
	movq	_l2zone@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_uma_zfree
	jmp	LBB0_16
LBB0_10:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_vtophys
	movl	%eax, 16(%r13,%r14,8)
	cmpq	$0, -56(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_12
## %bb.11:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	%rcx, (%rax)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rbx)
	jmp	LBB0_16
LBB0_12:
	decq	(%r12)
	jne	LBB0_15
## %bb.14:
	movq	(%r15), %r14
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_L2_IDX
	movq	$0, (%r14,%rax,8)
	movq	_l2table_zone@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_uma_zfree
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pvh_global_lock,4,2            ## @pvh_global_lock
	.comm	_RA_WLOCKED,4,2                 ## @RA_WLOCKED
	.comm	_l2table_zone,4,2               ## @l2table_zone
	.comm	_M_NOWAIT,4,2                   ## @M_NOWAIT
	.comm	_l2zone,4,2                     ## @l2zone
	.no_dead_strip	_pmap_alloc_l2_bucket
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pmap_alloc_l2_bucket
_pmap_alloc_l2_bucket:                  ; @pmap_alloc_l2_bucket
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	mov	x0, x1
	bl	_L1_IDX
	mov	x20, x0
	mov	x0, x19
	bl	_PMAP_ASSERT_LOCKED
Lloh0:
	adrp	x8, _RA_WLOCKED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RA_WLOCKED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, _pvh_global_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _pvh_global_lock@GOTPAGEOFF]
	bl	_rw_assert
	ldr	x21, [x19]
	mov	x0, x20
	bl	_L2_IDX
	ldr	x21, [x21, x0, lsl #3]
	cbz	x21, LBB0_4
LBB0_1:
	ldr	x26, [x21, #8]
	mov	x0, x20
	bl	_L2_BUCKET
	mov	w8, #24
	madd	x22, x0, x8, x26
	mov	x27, x22
	ldr	x8, [x27, #8]!
	cbnz	x8, LBB0_13
; %bb.2:
	mov	x23, x0
	ldr	x8, [x21]
	add	x8, x8, #1
	str	x8, [x21]
	mov	x0, x19
	bl	_PMAP_UNLOCK
Lloh5:
	adrp	x25, _pvh_global_lock@GOTPAGE
Lloh6:
	ldr	x25, [x25, _pvh_global_lock@GOTPAGEOFF]
	mov	x0, x25
	bl	_rw_wunlock
Lloh7:
	adrp	x28, _l2zone@GOTPAGE
Lloh8:
	ldr	x28, [x28, _l2zone@GOTPAGEOFF]
	ldr	w0, [x28]
Lloh9:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_uma_zalloc
	mov	x24, x0
	mov	x0, x25
	bl	_rw_wlock
	mov	x0, x19
	bl	_PMAP_LOCK
	ldr	x8, [x27]
	cbz	x8, LBB0_7
; %bb.3:
	ldr	x8, [x21]
	sub	x8, x8, #1
	str	x8, [x21]
	ldr	w0, [x28]
	mov	x1, x24
	bl	_uma_zfree
	b	LBB0_13
LBB0_4:
	mov	x0, x19
	bl	_PMAP_UNLOCK
Lloh12:
	adrp	x22, _pvh_global_lock@GOTPAGE
Lloh13:
	ldr	x22, [x22, _pvh_global_lock@GOTPAGEOFF]
	mov	x0, x22
	bl	_rw_wunlock
Lloh14:
	adrp	x23, _l2table_zone@GOTPAGE
Lloh15:
	ldr	x23, [x23, _l2table_zone@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh16:
	adrp	x8, _M_NOWAIT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _M_NOWAIT@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_uma_zalloc
	mov	x21, x0
	mov	x0, x22
	bl	_rw_wlock
	mov	x0, x19
	bl	_PMAP_LOCK
	cbz	x21, LBB0_12
; %bb.5:
	ldr	x22, [x19]
	mov	x0, x20
	bl	_L2_IDX
	ldr	x8, [x22, x0, lsl #3]
	cbz	x8, LBB0_9
; %bb.6:
	ldr	w0, [x23]
	mov	x1, x21
	bl	_uma_zfree
	ldr	x21, [x19]
	mov	x0, x20
	bl	_L2_IDX
	ldr	x21, [x21, x0, lsl #3]
	b	LBB0_1
LBB0_7:
	mov	x0, x24
	bl	_vtophys
	mov	w8, #24
	madd	x8, x23, x8, x26
	str	w0, [x8, #16]
	cbz	x24, LBB0_10
; %bb.8:
	str	x24, [x27]
	str	w20, [x22]
	b	LBB0_13
LBB0_9:
	mov	x0, x21
	mov	w1, #16
	bl	_bzero
	ldr	x22, [x19]
	mov	x0, x20
	bl	_L2_IDX
	str	x21, [x22, x0, lsl #3]
	b	LBB0_1
LBB0_10:
	ldr	x8, [x21]
	subs	x8, x8, #1
	str	x8, [x21]
	b.ne	LBB0_12
; %bb.11:
	ldr	x19, [x19]
	mov	x0, x20
	bl	_L2_IDX
	str	xzr, [x19, x0, lsl #3]
Lloh19:
	adrp	x8, _l2table_zone@GOTPAGE
Lloh20:
	ldr	x8, [x8, _l2table_zone@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_uma_zfree
LBB0_12:
	mov	x22, #0
LBB0_13:
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_pvh_global_lock,4,2            ; @pvh_global_lock
	.comm	_RA_WLOCKED,4,2                 ; @RA_WLOCKED
	.comm	_l2table_zone,4,2               ; @l2table_zone
	.comm	_M_NOWAIT,4,2                   ; @M_NOWAIT
	.comm	_l2zone,4,2                     ; @l2zone
	.no_dead_strip	_pmap_alloc_l2_bucket
.subsections_via_symbols
