	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_wl_scrub_peb               ## -- Begin function ubi_wl_scrub_peb
	.p2align	4, 0x90
_ubi_wl_scrub_peb:                      ## @ubi_wl_scrub_peb
	.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	%esi, %r14d
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	callq	_dbg_msg
	movq	%r12, %rdi
	callq	_spin_lock
	movq	32(%r12), %rax
	movslq	%r14d, %r13
	movq	(%rax,%r13,8), %rbx
	cmpq	24(%r12), %rbx
	je	LBB0_3
## %bb.1:
	leaq	4(%r12), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_in_wl_tree
	testq	%rax, %rax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	cmpq	16(%r12), %rbx
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %rdi
	callq	_spin_unlock
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	callq	_dbg_wl
	xorl	%eax, %eax
	callq	_yield
	movq	%r12, %rdi
	callq	_spin_lock
	movq	32(%r12), %rax
	movq	(%rax,%r13,8), %rbx
	cmpq	24(%r12), %rbx
	jne	LBB0_2
LBB0_3:
	movq	%r12, %rdi
	callq	_spin_unlock
	xorl	%r13d, %r13d
LBB0_11:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	8(%r12), %r13
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_in_wl_tree
	testq	%rax, %rax
	je	LBB0_9
## %bb.7:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	callq	_paranoid_check_in_wl_tree
	leaq	4(%rbx), %rdi
	movq	%r13, %rsi
	callq	_rb_erase
LBB0_8:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_wl_tree_add
	movq	%r12, %rdi
	callq	_spin_unlock
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ensure_wear_leveling           ## TAILCALL
LBB0_9:
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_prot_queue_del
	testl	%eax, %eax
	je	LBB0_8
## %bb.10:
	movl	%eax, %r13d
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	callq	_ubi_err
	movq	%r12, %rdi
	callq	_ubi_ro_mode
	movq	%r12, %rdi
	callq	_spin_unlock
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"schedule PEB %d for scrubbing"

L_.str.1:                               ## @.str.1
	.asciz	"the PEB %d is not in proper tree, retry"

L_.str.2:                               ## @.str.2
	.asciz	"PEB %d not found"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_wl_scrub_peb               ; -- Begin function ubi_wl_scrub_peb
	.p2align	2
_ubi_wl_scrub_peb:                      ; @ubi_wl_scrub_peb
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_msg
	mov	x0, x19
	bl	_spin_lock
	ldp	x9, x8, [x19, #24]
	ldr	x22, [x8, w20, sxtw #3]
	cmp	x22, x9
	b.eq	LBB0_5
; %bb.1:
	sxtw	x24, w20
	add	x21, x19, #4
Lloh2:
	adrp	x23, l_.str.1@PAGE
Lloh3:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	bl	_in_wl_tree
	cbnz	x0, LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #16]
	cmp	x22, x8
	b.ne	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x23
	mov	x1, x20
	bl	_dbg_wl
	bl	_yield
	mov	x0, x19
	bl	_spin_lock
	ldp	x9, x8, [x19, #24]
	ldr	x22, [x8, x24, lsl #3]
	cmp	x22, x9
	b.ne	LBB0_2
LBB0_5:
	mov	x0, x19
	bl	_spin_unlock
	mov	w23, #0
LBB0_6:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_7:
	add	x23, x19, #8
	mov	x0, x22
	mov	x1, x23
	bl	_in_wl_tree
	cbz	x0, LBB0_10
; %bb.8:
	mov	x0, x22
	mov	x1, x23
	bl	_paranoid_check_in_wl_tree
	add	x0, x22, #4
	mov	x1, x23
	bl	_rb_erase
LBB0_9:
	mov	x0, x22
	mov	x1, x21
	bl	_wl_tree_add
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_ensure_wear_leveling
LBB0_10:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_prot_queue_del
	cbz	w0, LBB0_9
; %bb.11:
	mov	x23, x0
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_ubi_err
	mov	x0, x19
	bl	_ubi_ro_mode
	mov	x0, x19
	bl	_spin_unlock
	b	LBB0_6
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"schedule PEB %d for scrubbing"

l_.str.1:                               ; @.str.1
	.asciz	"the PEB %d is not in proper tree, retry"

l_.str.2:                               ; @.str.2
	.asciz	"PEB %d not found"

.subsections_via_symbols
