	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_lvl2_pble
_get_lvl2_pble:                         ## @get_lvl2_pble
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %eax
	movl	%eax, %r15d
	sarl	$9, %r15d
	movq	_PBLE_PER_PAGE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%edx, %r13d
	cmpl	$1, %edx
	sbbl	$-1, %r15d
	movl	%r15d, 8(%rsi)
	leal	(,%r15,8), %r14d
	leal	(%r14,%r14,2), %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, 16(%r12)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%r14d, %esi
	callq	_gen_pool_alloc
	movq	%rax, 40(%r12)
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_gen_pool_virt_to_phys
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_fpm_to_idx
	movq	%rax, 32(%r12)
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movl	%r15d, 24(%r12)
	testl	%r15d, %r15d
	jle	LBB0_7
## %bb.4:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	40(%rax), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	addq	$16, %rbx
	negl	%r15d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%r15,%r14), %eax
	cmpl	$-1, %eax
	movq	_PBLE_PER_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %r12d
	cmovel	%r13d, %r12d
	testl	%r13d, %r13d
	cmovel	%eax, %r12d
	leal	(,%r12,8), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_gen_pool_alloc
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_gen_pool_virt_to_phys
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rsi
	callq	_fpm_to_idx
	movq	%rax, -8(%rbx)
	movl	%r12d, -16(%rbx)
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx,%r14,8)
	addq	$24, %rbx
	incq	%r14
	movl	%r14d, %eax
	addl	%r15d, %eax
	jne	LBB0_5
LBB0_7:
	movq	_I40IW_LEVEL_2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 4(%rcx)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_2:
	movq	16(%r12), %rdi
	callq	_kfree
	movq	$0, 16(%r12)
	jmp	LBB0_9
LBB0_8:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_free_lvl2
LBB0_9:
	movq	_I40IW_ERR_NO_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_10:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PBLE_PER_PAGE,4,2              ## @PBLE_PER_PAGE
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_I40IW_ERR_NO_MEMORY,4,2        ## @I40IW_ERR_NO_MEMORY
	.comm	_I40IW_LEVEL_2,4,2              ## @I40IW_LEVEL_2
	.no_dead_strip	_get_lvl2_pble
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_lvl2_pble
_get_lvl2_pble:                         ; @get_lvl2_pble
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x1]
Lloh0:
	adrp	x23, _PBLE_PER_PAGE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PBLE_PER_PAGE@GOTPAGEOFF]
	asr	w9, w8, #9
	ldr	w10, [x23]
	sdiv	w11, w8, w10
	msub	w24, w11, w10, w8
	cmp	w24, #0
	cinc	w25, w9, ne
	str	w25, [x1, #8]
	add	w8, w25, w25, lsl #1
	lsl	w0, w8, #3
Lloh2:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_9
; %bb.1:
	mov	x22, x0
	str	x0, [x19, #16]
	lsl	w1, w25, #3
	mov	x0, x21
	bl	_gen_pool_alloc
	str	x0, [x19, #40]
	cbz	x0, LBB0_7
; %bb.2:
	mov	x1, x0
	mov	x0, x21
	bl	_gen_pool_virt_to_phys
	mov	x1, x0
	mov	x0, x20
	bl	_fpm_to_idx
	str	x0, [x19, #32]
	str	w25, [x19, #24]
	cmp	w25, #1
	b.lt	LBB0_6
; %bb.3:
	ldr	x26, [x19, #40]
	add	x22, x22, #8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w25, #1
	ccmp	w24, #0, #4, eq
	ldr	w8, [x23]
	csel	w27, w24, w8, ne
	lsl	w1, w27, #3
	mov	x0, x21
	bl	_gen_pool_alloc
	str	x0, [x22, #8]
	cbz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x1, x0
	mov	x0, x21
	bl	_gen_pool_virt_to_phys
	mov	x1, x0
	mov	x0, x20
	bl	_fpm_to_idx
	str	x0, [x22]
	stur	w27, [x22, #-8]
	str	x0, [x26], #8
	add	x22, x22, #24
	subs	w25, w25, #1
	b.ne	LBB0_4
LBB0_6:
	mov	w0, #0
Lloh5:
	adrp	x8, _I40IW_LEVEL_2@GOTPAGE
Lloh6:
	ldr	x8, [x8, _I40IW_LEVEL_2@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	b	LBB0_10
LBB0_7:
	ldr	x0, [x19, #16]
	bl	_kfree
	str	xzr, [x19, #16]
	b	LBB0_9
LBB0_8:
	mov	x0, x20
	mov	x1, x19
	bl	_free_lvl2
LBB0_9:
Lloh8:
	adrp	x8, _I40IW_ERR_NO_MEMORY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _I40IW_ERR_NO_MEMORY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
LBB0_10:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PBLE_PER_PAGE,4,2              ; @PBLE_PER_PAGE
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_I40IW_ERR_NO_MEMORY,4,2        ; @I40IW_ERR_NO_MEMORY
	.comm	_I40IW_LEVEL_2,4,2              ; @I40IW_LEVEL_2
	.no_dead_strip	_get_lvl2_pble
.subsections_via_symbols
