	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_ensure_anchor_pebs         ## -- Begin function ubi_ensure_anchor_pebs
	.p2align	4, 0x90
_ubi_ensure_anchor_pebs:                ## @ubi_ensure_anchor_pebs
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	4(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	cmpl	$0, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_spin_unlock
	jmp	LBB0_5
LBB0_2:
	movl	$1, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	_GFP_NOFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	$1, (%rax)
	movq	_wear_leveling_worker@GOTPCREL(%rip), %rcx
	movq	%rcx, 8(%rax)
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	___schedule_ubi_work
LBB0_5:
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	callq	_spin_lock
	movl	$0, (%rbx)
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_NOFS,4,2                   ## @GFP_NOFS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_wear_leveling_worker,4,2       ## @wear_leveling_worker
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_ensure_anchor_pebs         ; -- Begin function ubi_ensure_anchor_pebs
	.p2align	2
_ubi_ensure_anchor_pebs:                ; @ubi_ensure_anchor_pebs
	.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	x19, x0
	add	x20, x0, #4
	mov	x0, x20
	bl	_spin_lock
	ldr	w8, [x19]
	cbz	w8, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_spin_unlock
	b	LBB0_4
LBB0_2:
	mov	w21, #1
	str	w21, [x19]
	mov	x0, x20
	bl	_spin_unlock
Lloh0:
	adrp	x8, _GFP_NOFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOFS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_6
; %bb.3:
	mov	x1, x0
	str	w21, [x0]
Lloh3:
	adrp	x8, _wear_leveling_worker@GOTPAGE
Lloh4:
	ldr	x8, [x8, _wear_leveling_worker@GOTPAGEOFF]
	str	x8, [x0, #8]
	mov	x0, x19
	bl	___schedule_ubi_work
LBB0_4:
	mov	w0, #0
LBB0_5:
	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
LBB0_6:
	mov	x0, x20
	bl	_spin_lock
	str	wzr, [x19]
	mov	x0, x20
	bl	_spin_unlock
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOFS,4,2                   ; @GFP_NOFS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_wear_leveling_worker,4,2       ; @wear_leveling_worker
.subsections_via_symbols
