	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function try_recover_peb
_try_recover_peb:                       ## @try_recover_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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	movl	%edx, %r12d
	movl	%esi, %ebx
	movq	24(%rbp), %rax
	movq	16(%rdi), %r15
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %r14d
	movl	$0, (%rax)
	movq	%r15, %rdi
	callq	_ubi_wl_get_peb
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_16
## %bb.1:
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movq	16(%rbp), %r14
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	%r15, %rdi
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	movq	%r14, %rdx
	movl	$1, %ecx
	callq	_ubi_io_read_vid_hdr
	movl	%eax, %r14d
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.2:
	cmpl	(%rax), %r14d
	je	LBB0_6
## %bb.3:
	testl	%r14d, %r14d
	jle	LBB0_11
## %bb.4:
	movq	_EIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r15, %rdi
	callq	_up_read
	testl	%r14d, %r14d
	je	LBB0_15
## %bb.5:
	negl	%r14d
	jmp	LBB0_12
LBB0_16:
	movq	%r15, %rdi
	callq	_up_read
	jmp	LBB0_17
LBB0_6:
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movq	16(%rbp), %rdi
	callq	_ubi_get_vid_hdr
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	(%rax), %rax
	movq	_UBI_VID_DYNAMIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_ubi_assert
	leaq	4(%r15), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movslq	-44(%rbp), %r12                 ## 4-byte Folded Reload
	movq	8(%r15), %rdi
	addq	%r12, %rdi
	movl	$255, %esi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_memset
	testl	%r12d, %r12d
	jle	LBB0_9
## %bb.7:
	movq	8(%r15), %rsi
	movq	%r15, %rdi
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_ubi_io_read_data
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r14d
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_10
LBB0_9:
	movq	24(%rbp), %rax
	movl	$1, (%rax)
	addq	8(%r15), %r12
	movq	%r12, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	%rbx, %r14
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_memcpy
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	addl	%ebx, %r12d
	movq	%r14, %rbx
	movq	_UBI_CRC32_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r15), %rsi
	movl	%r12d, %edx
	callq	_crc32
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%r15, %rdi
	callq	_ubi_next_sqnum
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, 32(%r14)
	movl	$1, 8(%r14)
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, %edi
	callq	_cpu_to_be32
	movq	%rax, 24(%r14)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_cpu_to_be32
	movq	%rax, 16(%r14)
	movq	%r15, %rdi
	movl	%r13d, %esi
	movq	16(%rbp), %rdx
	callq	_ubi_io_write_vid_hdr
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_13
LBB0_10:
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	-52(%rbp), %r12d                ## 4-byte Reload
LBB0_11:
	movq	%r15, %rdi
	callq	_up_read
LBB0_12:
	movq	%r15, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movl	%r13d, %ecx
	movl	$1, %r8d
	callq	_ubi_wl_put_peb
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_ubi_warn
	movl	%r14d, %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	8(%r15), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_ubi_io_write_data
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testl	%r14d, %r14d
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_11
## %bb.14:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movq	(%rax), %rax
	movslq	%r12d, %rcx
	movl	%r13d, (%rax,%rcx,4)
	movq	%r15, %rdi
	callq	_up_read
LBB0_15:
	movq	%r15, %rdi
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movl	%r12d, %edx
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	$1, %r8d
	callq	_ubi_wl_put_peb
	leaq	L_.str.1(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"recover PEB %d, move data to PEB %d"

	.comm	_UBI_IO_BITFLIPS,4,2            ## @UBI_IO_BITFLIPS
	.comm	_EIO,4,2                        ## @EIO
	.comm	_UBI_VID_DYNAMIC,8,3            ## @UBI_VID_DYNAMIC
	.comm	_UBI_CRC32_INIT,4,2             ## @UBI_CRC32_INIT
L_.str.1:                               ## @.str.1
	.asciz	"data was successfully recovered"

L_.str.2:                               ## @.str.2
	.asciz	"failed to write to PEB %d"

	.no_dead_strip	_try_recover_peb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function try_recover_peb
_try_recover_peb:                       ; @try_recover_peb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x22, x7
	mov	x25, x6
	mov	x27, x5
	mov	x28, x4
	str	x3, [sp, #40]                   ; 8-byte Folded Spill
	mov	x23, x2
	mov	x20, x1
	mov	x24, x0
	ldr	x19, [x0, #16]
	ldr	w26, [x0]
	str	wzr, [x7]
	mov	x0, x19
	bl	_ubi_wl_get_peb
	mov	x21, x0
	tbnz	w0, #31, LBB0_7
; %bb.1:
	stp	x20, x21, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ubi_msg
	mov	x0, x19
	str	x20, [sp, #32]                  ; 8-byte Folded Spill
	mov	x1, x20
	mov	x2, x25
	mov	w3, #1
	bl	_ubi_io_read_vid_hdr
Lloh2:
	adrp	x8, _UBI_IO_BITFLIPS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _UBI_IO_BITFLIPS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w0, #0
	ccmp	w0, w8, #4, ne
	b.ne	LBB0_8
; %bb.2:
	stp	w26, w23, [sp, #24]             ; 8-byte Folded Spill
	mov	x0, x25
	bl	_ubi_get_vid_hdr
	mov	x26, x0
	ldr	x8, [x0]
Lloh5:
	adrp	x9, _UBI_VID_DYNAMIC@GOTPAGE
Lloh6:
	ldr	x9, [x9, _UBI_VID_DYNAMIC@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_ubi_assert
	add	x0, x19, #4
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	sxtw	x23, w28
	add	x0, x8, x23
	mov	w1, #255
	mov	x2, x27
	bl	_memset
	cmp	w28, #1
	b.lt	LBB0_5
; %bb.3:
	ldr	x1, [x19, #8]
	mov	x0, x19
	ldr	x2, [sp, #32]                   ; 8-byte Folded Reload
                                        ; kill: def $w2 killed $w2 killed $x2
	mov	w3, #0
	mov	x4, x28
	bl	_ubi_io_read_data
	cbz	w0, LBB0_5
; %bb.4:
	mov	x20, x0
Lloh8:
	adrp	x8, _UBI_IO_BITFLIPS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UBI_IO_BITFLIPS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_6
LBB0_5:
	mov	w8, #1
	str	w8, [x22]
	ldr	x8, [x19, #8]
	add	x0, x8, x23
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	mov	x2, x27
	bl	_memcpy
	add	w22, w27, w28
Lloh11:
	adrp	x8, _UBI_CRC32_INIT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _UBI_CRC32_INIT@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	ldr	x1, [x19, #8]
	mov	x2, x22
	bl	_crc32
	mov	x20, x0
	mov	x0, x19
	bl	_ubi_next_sqnum
	bl	_cpu_to_be64
	str	w0, [x26, #32]
	mov	w8, #1
	str	w8, [x26, #8]
	mov	x0, x22
	bl	_cpu_to_be32
	str	x0, [x26, #24]
	mov	x0, x20
	bl	_cpu_to_be32
	str	x0, [x26, #16]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x25
	bl	_ubi_io_write_vid_hdr
	mov	x20, x0
	cbz	w0, LBB0_11
LBB0_6:
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_mutex_unlock
	ldp	w26, w23, [sp, #24]             ; 8-byte Folded Reload
	b	LBB0_12
LBB0_7:
	mov	x0, x19
	bl	_up_read
	b	LBB0_14
LBB0_8:
	mov	x20, x0
	cmp	w0, #0
	b.le	LBB0_12
; %bb.9:
Lloh14:
	adrp	x8, _EIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w20, [x8]
	mov	x0, x19
	bl	_up_read
	cbz	w20, LBB0_16
; %bb.10:
	neg	w20, w20
	b	LBB0_13
LBB0_11:
	ldr	x1, [x19, #8]
	mov	x0, x19
	mov	x2, x21
	mov	w3, #0
	mov	x4, x22
	bl	_ubi_io_write_data
	mov	x20, x0
	ldr	x0, [sp, #16]                   ; 8-byte Folded Reload
	bl	_mutex_unlock
	ldp	w26, w23, [sp, #24]             ; 8-byte Folded Reload
	cbz	w20, LBB0_15
LBB0_12:
	mov	x0, x19
	bl	_up_read
LBB0_13:
	mov	x0, x19
	mov	x1, x26
	mov	x2, x23
	mov	x3, x21
	mov	w4, #1
	bl	_ubi_wl_put_peb
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_ubi_warn
	mov	x21, x20
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_15:
	ldr	x8, [x24, #8]
	ldr	x8, [x8]
	str	w21, [x8, w23, sxtw #2]
	mov	x0, x19
	bl	_up_read
LBB0_16:
	mov	x0, x19
	mov	x1, x26
	mov	x2, x23
	ldr	x3, [sp, #32]                   ; 8-byte Folded Reload
                                        ; kill: def $w3 killed $w3 killed $x3
	mov	w4, #1
	bl	_ubi_wl_put_peb
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ubi_msg
	mov	w21, #0
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"recover PEB %d, move data to PEB %d"

	.comm	_UBI_IO_BITFLIPS,4,2            ; @UBI_IO_BITFLIPS
	.comm	_EIO,4,2                        ; @EIO
	.comm	_UBI_VID_DYNAMIC,8,3            ; @UBI_VID_DYNAMIC
	.comm	_UBI_CRC32_INIT,4,2             ; @UBI_CRC32_INIT
l_.str.1:                               ; @.str.1
	.asciz	"data was successfully recovered"

l_.str.2:                               ; @.str.2
	.asciz	"failed to write to PEB %d"

	.no_dead_strip	_try_recover_peb
.subsections_via_symbols
