	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_wl_get_peb                 ## -- Begin function ubi_wl_get_peb
	.p2align	4, 0x90
_ubi_wl_get_peb:                        ## @ubi_wl_get_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	16(%rdi), %r14
	movl	$10, %r12d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_down_read
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	48(%rbx), %rax
	movq	56(%rbx), %rcx
	cmpq	%rcx, %rax
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	24(%rbx), %rdx
	cmpq	32(%rbx), %rdx
	jne	LBB0_6
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	%r14, %rdi
	callq	_up_read
	movq	%rbx, %rdi
	callq	_ubi_update_fastmap
	testl	%eax, %eax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_down_read
	movq	%rbx, %rdi
	callq	_spin_lock
	movq	48(%rbx), %rax
	movq	56(%rbx), %rcx
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rcx, %rax
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_spin_unlock
	decl	%r12d
	je	LBB0_8
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_up_read
	movq	%rbx, %rdi
	callq	_produce_free_peb
	testl	%eax, %eax
	jns	LBB0_1
## %bb.11:
	movl	%eax, %r15d
	movq	%r14, %rdi
	callq	_down_read
	jmp	LBB0_13
LBB0_12:
	setl	%al
	movzbl	%al, %edi
	callq	_ubi_assert
	movq	64(%rbx), %rax
	movq	8(%rbx), %rcx
	movq	48(%rbx), %rdx
	leaq	1(%rdx), %rsi
	movq	%rsi, 48(%rbx)
	movslq	(%rax,%rdx,4), %r15
	movl	(%rcx,%r15,4), %esi
	movq	%rbx, %rdi
	callq	_prot_queue_add
	movq	%rbx, %rdi
	callq	_spin_unlock
	jmp	LBB0_13
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_ubi_err
	jmp	LBB0_9
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_ubi_msg
	movq	%r14, %rdi
	callq	_down_read
LBB0_9:
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_13:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to write a new fastmap: %i"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.1:                               ## @.str.1
	.asciz	"Unable to get a free PEB from user WL pool"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_wl_get_peb                 ; -- Begin function ubi_wl_get_peb
	.p2align	2
_ubi_wl_get_peb:                        ; @ubi_wl_get_peb
	.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, #16
	mov	w22, #10
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_down_read
	mov	x0, x19
	bl	_spin_lock
	ldp	x8, x9, [x19, #48]
	cmp	x8, x9
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldp	x10, x11, [x19, #24]
	cmp	x10, x11
	b.ne	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x20
	bl	_up_read
	mov	x0, x19
	bl	_ubi_update_fastmap
	cbnz	w0, LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	bl	_down_read
	mov	x0, x19
	bl	_spin_lock
	ldp	x8, x9, [x19, #48]
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_spin_unlock
	subs	w22, w22, #1
	b.eq	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	bl	_up_read
	mov	x0, x19
	bl	_produce_free_peb
	tbz	w0, #31, LBB0_1
; %bb.8:
	mov	x21, x0
	mov	x0, x20
	bl	_down_read
	b	LBB0_13
LBB0_9:
	cset	w0, lt
	bl	_ubi_assert
	ldr	x8, [x19, #64]
	ldr	x9, [x19, #48]
	add	x10, x9, #1
	str	x10, [x19, #48]
	ldrsw	x21, [x8, x9, lsl #2]
	ldr	x8, [x19, #8]
	ldr	w1, [x8, x21, lsl #2]
	mov	x0, x19
	bl	_prot_queue_add
	mov	x0, x19
	bl	_spin_unlock
	b	LBB0_13
LBB0_10:
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ubi_err
	b	LBB0_12
LBB0_11:
	mov	x2, x0
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ubi_msg
	mov	x0, x20
	bl	_down_read
LBB0_12:
Lloh4:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_13:
	mov	x0, x21
	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
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to write a new fastmap: %i"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.1:                               ; @.str.1
	.asciz	"Unable to get a free PEB from user WL pool"

.subsections_via_symbols
