	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function recover_peb
_recover_peb:                           ## @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, %r12d
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r15d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movl	%edx, %esi
	callq	_vol_id2idx
	movq	16(%r14), %rcx
	cltq
	movq	(%rcx,%rax,8), %r13
	movq	_GFP_NOFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ubi_zalloc_vid_hdr
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_19
## %bb.1:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	_UBI_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ubi_wl_get_peb
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_18
## %bb.2:
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movl	16(%rbp), %eax
	addl	%r12d, %eax
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movslq	%r12d, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	$-1, %r15d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	leaq	L_.str(%rip), %rdi
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	%r14, %rdi
	movl	%ebx, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	$1, %ecx
	callq	_ubi_io_read_vid_hdr
	testl	%eax, %eax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r12d
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_5
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_next_sqnum
	movl	%eax, %edi
	callq	_cpu_to_be64
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, (%rdx)
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_ubi_io_write_vid_hdr
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	8(%r14), %rdi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	addq	%rbx, %rdi
	movl	$255, %esi
	movl	16(%rbp), %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	testl	%ebx, %ebx
	jle	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rsi
	movq	%r14, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	movq	-88(%rbp), %r8                  ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_ubi_io_read_data
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, %r12d
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r14), %rdi
	addq	-72(%rbp), %rdi                 ## 8-byte Folded Reload
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movl	16(%rbp), %edx
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	8(%r14), %rsi
	movq	%r14, %rdi
	movl	%r13d, %edx
	xorl	%ecx, %ecx
	movl	-64(%rbp), %r8d                 ## 4-byte Reload
	callq	_ubi_io_write_data
	movl	%eax, %r12d
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r12d, %r12d
	je	LBB0_12
LBB0_15:                                ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.2(%rip), %rdi
	movl	%r13d, %esi
	callq	_ubi_warn
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	$1, %edx
	callq	_ubi_wl_put_peb
	incl	%r15d
	movq	_UBI_IO_RETRIES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jge	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_msg
	movq	_UBI_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_ubi_wl_get_peb
	movl	%eax, %r13d
	testl	%eax, %eax
	jns	LBB0_3
LBB0_18:
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ubi_free_vid_hdr
	movl	%r13d, %r12d
	jmp	LBB0_20
LBB0_19:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_20
LBB0_5:
	testl	%r12d, %r12d
	jle	LBB0_14
## %bb.6:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_12:
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ubi_free_vid_hdr
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movslq	-60(%rbp), %rcx                 ## 4-byte Folded Reload
	movl	%r13d, (%rax,%rcx,4)
	movq	%r14, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movl	$1, %edx
	callq	_ubi_wl_put_peb
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_ubi_msg
	jmp	LBB0_20
LBB0_13:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_14:
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	$1, %edx
	callq	_ubi_wl_put_peb
LBB0_16:
	movq	%r14, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_ubi_free_vid_hdr
LBB0_20:
	movl	%r12d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_NOFS,4,2                   ## @GFP_NOFS
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_UBI_UNKNOWN,4,2                ## @UBI_UNKNOWN
	.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
L_.str.1:                               ## @.str.1
	.asciz	"data was successfully recovered"

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

	.comm	_UBI_IO_RETRIES,4,2             ## @UBI_IO_RETRIES
L_.str.3:                               ## @.str.3
	.asciz	"try again"

	.no_dead_strip	_recover_peb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function recover_peb
_recover_peb:                           ; @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	x23, x6
	mov	x24, x5
	str	x4, [sp, #40]                   ; 8-byte Folded Spill
	mov	x22, x3
	mov	x21, x1
	mov	x19, x0
	mov	x1, x2
	bl	_vol_id2idx
	ldr	x8, [x19, #16]
	ldr	x25, [x8, w0, sxtw #3]
Lloh0:
	adrp	x8, _GFP_NOFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOFS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_ubi_zalloc_vid_hdr
	cbz	x0, LBB0_13
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x27, _UBI_UNKNOWN@GOTPAGE
Lloh4:
	ldr	x27, [x27, _UBI_UNKNOWN@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x19
	bl	_ubi_wl_get_peb
	mov	x26, x0
	tbnz	w0, #31, LBB0_12
; %bb.2:
	str	x25, [sp, #24]                  ; 8-byte Folded Spill
	add	w8, w23, w24
	stp	w22, w8, [sp, #32]              ; 8-byte Folded Spill
	sxtw	x22, w24
	mov	w28, #-1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	stp	x21, x26, [sp]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ubi_msg
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	mov	w3, #1
	bl	_ubi_io_read_vid_hdr
	cbz	w0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, x0
Lloh7:
	adrp	x8, _UBI_IO_BITFLIPS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _UBI_IO_BITFLIPS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_14
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_next_sqnum
	bl	_cpu_to_be64
	str	w0, [x20]
	mov	x0, x19
	mov	x1, x26
	mov	x2, x20
	bl	_ubi_io_write_vid_hdr
	mov	x25, x0
	cbnz	w0, LBB0_10
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x19, #8]
	add	x0, x8, x22
	mov	w1, #255
	mov	x2, x23
	bl	_memset
	cmp	w24, #1
	b.lt	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x1, [x19, #8]
	mov	x0, x19
	mov	x2, x21
	mov	w3, #0
	mov	x4, x24
	bl	_ubi_io_read_data
	cbz	w0, LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, x0
Lloh10:
	adrp	x8, _UBI_IO_BITFLIPS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _UBI_IO_BITFLIPS@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_17
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #8]
	add	x0, x8, x22
	ldr	x1, [sp, #40]                   ; 8-byte Folded Reload
	mov	x2, x23
	bl	_memcpy
	ldr	x1, [x19, #8]
	mov	x0, x19
	mov	x2, x26
	mov	w3, #0
	ldr	w4, [sp, #36]                   ; 4-byte Folded Reload
	bl	_ubi_io_write_data
	mov	x25, x0
	mov	x0, x19
	bl	_mutex_unlock
	cbz	w25, LBB0_16
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x26
	bl	_ubi_warn
	mov	x0, x19
	mov	x1, x26
	mov	w2, #1
	bl	_ubi_wl_put_peb
Lloh15:
	adrp	x8, _UBI_IO_RETRIES@GOTPAGE
Lloh16:
	ldr	x8, [x8, _UBI_IO_RETRIES@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	add	w28, w28, #1
	cmp	w28, w8
	b.ge	LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ubi_msg
	ldr	w1, [x27]
	mov	x0, x19
	bl	_ubi_wl_get_peb
	mov	x26, x0
	tbz	w0, #31, LBB0_3
LBB0_12:
	mov	x0, x19
	mov	x1, x20
	bl	_ubi_free_vid_hdr
	mov	x25, x26
	b	LBB0_20
LBB0_13:
Lloh20:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_20
LBB0_14:
	cmp	w25, #1
	b.lt	LBB0_18
; %bb.15:
Lloh23:
	adrp	x8, _EIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_18
LBB0_16:
	mov	x0, x19
	mov	x1, x20
	bl	_ubi_free_vid_hdr
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	ldr	w9, [sp, #32]                   ; 4-byte Folded Reload
	str	w26, [x8, w9, sxtw #2]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_ubi_wl_put_peb
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ubi_msg
	b	LBB0_20
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_18:
	mov	x0, x19
	mov	x1, x26
	mov	w2, #1
	bl	_ubi_wl_put_peb
LBB0_19:
	mov	x0, x19
	mov	x1, x20
	bl	_ubi_free_vid_hdr
LBB0_20:
	mov	x0, x25
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOFS,4,2                   ; @GFP_NOFS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_UBI_UNKNOWN,4,2                ; @UBI_UNKNOWN
	.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
l_.str.1:                               ; @.str.1
	.asciz	"data was successfully recovered"

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

	.comm	_UBI_IO_RETRIES,4,2             ; @UBI_IO_RETRIES
l_.str.3:                               ; @.str.3
	.asciz	"try again"

	.no_dead_strip	_recover_peb
.subsections_via_symbols
