	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_corruption
_check_corruption:                      ## @check_corruption
	.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
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %r12
	callq	_mutex_lock
	movl	4(%r12), %edx
	movl	8(%r12), %edi
	xorl	%esi, %esi
	callq	_memset
	movl	4(%r12), %r8d
	movl	8(%r12), %esi
	movl	12(%r12), %ecx
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_ubi_io_read
	movl	%eax, %ebx
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_1
## %bb.2:
	movl	%ebx, %edi
	callq	_mtd_is_eccerr
	testq	%rax, %rax
	je	LBB0_4
LBB0_1:
	xorl	%ebx, %ebx
LBB0_7:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.5:
	movl	4(%r12), %edx
	movl	8(%r12), %edi
	movl	$255, %esi
	callq	_ubi_check_pattern
	movl	$0, %ebx
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_ubi_err
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_ubi_err
	movq	%r15, %rdi
	callq	_ubi_dump_vid_hdr
	movl	4(%r12), %ecx
	movl	12(%r12), %edx
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	callq	_pr_err
	movq	_KERN_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DUMP_PREFIX_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	4(%r12), %eax
	movl	8(%r12), %r9d
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %ebx
	movl	$32, %ecx
	movl	$1, %r8d
	pushq	$1
	pushq	%rax
	callq	_ubi_dbg_print_hex_dump
	addq	$16, %rsp
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_UBI_IO_BITFLIPS,4,2            ## @UBI_IO_BITFLIPS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PEB %d contains corrupted VID header, and the data does not contain all 0xFF"

L_.str.1:                               ## @.str.1
	.asciz	"this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection"

L_.str.2:                               ## @.str.2
	.asciz	"hexdump of PEB %d offset %d, length %d"

	.comm	_KERN_DEBUG,4,2                 ## @KERN_DEBUG
L_.str.3:                               ## @.str.3
	.space	1

	.comm	_DUMP_PREFIX_OFFSET,4,2         ## @DUMP_PREFIX_OFFSET
	.no_dead_strip	_check_corruption
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_corruption
_check_corruption:                      ; @check_corruption
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x2
	mov	x21, x1
	mov	x19, x0
	bl	_mutex_lock
	ldp	w2, w0, [x19, #4]
	mov	w1, #0
	bl	_memset
	ldp	w1, w3, [x19, #8]
	ldr	w4, [x19, #4]
	mov	x0, x19
	mov	x2, x20
	bl	_ubi_io_read
	mov	w22, #0
Lloh0:
	adrp	x8, _UBI_IO_BITFLIPS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _UBI_IO_BITFLIPS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_4
; %bb.1:
	mov	x23, x0
	bl	_mtd_is_eccerr
	cbz	x0, LBB0_3
LBB0_2:
	mov	w22, #0
	b	LBB0_4
LBB0_3:
	mov	x22, x23
	cbz	w23, LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	ldp	w2, w0, [x19, #4]
	mov	w1, #255
	bl	_ubi_check_pattern
	cbnz	x0, LBB0_2
; %bb.6:
	str	x20, [sp]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ubi_err
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ubi_err
	mov	x0, x21
	bl	_ubi_dump_vid_hdr
	ldr	w2, [x19, #12]
	ldr	w3, [x19, #4]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x20
	bl	_pr_err
Lloh9:
	adrp	x8, _KERN_DEBUG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _KERN_DEBUG@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _DUMP_PREFIX_OFFSET@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DUMP_PREFIX_OFFSET@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	ldp	w6, w5, [x19, #4]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w22, #1
	mov	w3, #32
	mov	w4, #1
	mov	w7, #1
	bl	_ubi_dbg_print_hex_dump
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_UBI_IO_BITFLIPS,4,2            ; @UBI_IO_BITFLIPS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PEB %d contains corrupted VID header, and the data does not contain all 0xFF"

l_.str.1:                               ; @.str.1
	.asciz	"this may be a non-UBI PEB or a severe VID header corruption which requires manual inspection"

l_.str.2:                               ; @.str.2
	.asciz	"hexdump of PEB %d offset %d, length %d"

	.comm	_KERN_DEBUG,4,2                 ; @KERN_DEBUG
l_.str.3:                               ; @.str.3
	.space	1

	.comm	_DUMP_PREFIX_OFFSET,4,2         ; @DUMP_PREFIX_OFFSET
	.no_dead_strip	_check_corruption
.subsections_via_symbols
