	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_refill_pools               ## -- Begin function ubi_refill_pools
	.p2align	4, 0x90
_ubi_refill_pools:                      ## @ubi_refill_pools
	.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	%rdi, %rbx
	leaq	48(%rdi), %r12
	leaq	16(%rdi), %r15
	addq	$8, %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_spin_lock
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_return_unused_pool_pebs
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_return_unused_pool_pebs
	movq	$0, 48(%rbx)
	movq	$0, 16(%rbx)
	leaq	12(%rbx), %r12
	xorl	%eax, %eax
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	24(%rbx), %r14
	cmpq	%r14, %r13
	jb	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	56(%rbx), %rax
	jae	LBB0_9
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, (%r12)
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rbx), %eax
	subl	4(%rbx), %eax
	cmpl	$5, %eax
	jl	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_WL_FREE_MAX_DIFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_find_wl_entry
	movq	%rax, %r13
	movq	%rbx, %rdi
	movq	%rax, %rsi
	movq	%r12, %rdx
	callq	_self_check_in_wl_tree
	leaq	4(%r13), %rdi
	movq	%r12, %rsi
	callq	_rb_erase
	decl	(%rbx)
	movl	(%r13), %ecx
	movq	48(%rbx), %rax
	movq	72(%rbx), %rdx
	movl	%ecx, (%rdx,%rax,4)
	incq	%rax
	movq	%rax, 48(%rbx)
	movq	(%r15), %r13
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, 12(%rbx)
	je	LBB0_11
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_wl_get_wle
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%rax), %eax
	movq	16(%rbx), %rcx
	movq	40(%rbx), %rdx
	movl	%eax, (%rdx,%rcx,4)
	incq	%rcx
	movq	%rcx, 16(%rbx)
	movq	48(%rbx), %rax
	cmpq	56(%rbx), %rax
	jb	LBB0_6
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%r14, %r13
	jae	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r15), %r13
	jmp	LBB0_1
LBB0_11:
	movq	$0, 64(%rbx)
	movq	$0, 32(%rbx)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_spin_unlock                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WL_FREE_MAX_DIFF,4,2           ## @WL_FREE_MAX_DIFF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_refill_pools               ; -- Begin function ubi_refill_pools
	.p2align	2
_ubi_refill_pools:                      ; @ubi_refill_pools
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x0
	add	x22, x0, #48
	add	x21, x0, #16
	add	x20, x0, #8
	mov	x0, x20
	bl	_spin_lock
	mov	x0, x19
	mov	x1, x22
	bl	_return_unused_pool_pebs
	mov	x0, x19
	mov	x1, x21
	bl	_return_unused_pool_pebs
	mov	x8, #0
	mov	x23, #0
	str	xzr, [x19, #48]
	str	xzr, [x19, #16]
	add	x22, x19, #12
Lloh0:
	adrp	x24, _WL_FREE_MAX_DIFF@GOTPAGE
Lloh1:
	ldr	x24, [x24, _WL_FREE_MAX_DIFF@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x19, #24]
	cmp	x23, x25
	b.hs	LBB0_5
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x19, #12]
	cbz	w8, LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_wl_get_wle
	cbz	x0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [x0]
	ldr	x10, [x19, #16]
	ldp	x11, x8, [x19, #40]
	str	w9, [x11, x10, lsl #2]
	add	x9, x10, #1
	str	x9, [x19, #16]
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	x9, [x19, #56]
	cmp	x8, x9
	b.hs	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [x22]
	cbz	w8, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	ldp	w8, w9, [x19]
	sub	w8, w8, w9
	cmp	w8, #5
	b.lt	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w2, [x24]
	mov	x0, x19
	mov	x1, x22
	bl	_find_wl_entry
	mov	x23, x0
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	bl	_self_check_in_wl_tree
	add	x0, x23, #4
	mov	x1, x22
	bl	_rb_erase
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19]
	ldr	w8, [x23]
	ldr	x9, [x19, #72]
	ldr	x10, [x19, #48]
	str	w8, [x9, x10, lsl #2]
	add	x8, x10, #1
	str	x8, [x19, #48]
	ldr	x23, [x21]
	b	LBB0_1
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	x23, x25
	b.hs	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_1 Depth=1
	ldr	x23, [x21]
	b	LBB0_1
LBB0_11:
	str	xzr, [x19, #64]
	str	xzr, [x19, #32]
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_spin_unlock
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_WL_FREE_MAX_DIFF,4,2           ; @WL_FREE_MAX_DIFF
.subsections_via_symbols
