	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function self_check_peb_ec_hdr
_self_check_peb_ec_hdr:                 ## @self_check_peb_ec_hdr
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_ubi_dbg_chk_io
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	(%r12), %edi
	movq	_GFP_NOFS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	_UBI_EC_HDR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	callq	_ubi_io_read
	testl	%eax, %eax
	je	LBB0_7
## %bb.5:
	movl	%eax, %ebx
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_7
## %bb.6:
	movl	%ebx, %edi
	callq	_mtd_is_eccerr
	testl	%eax, %eax
	je	LBB0_10
LBB0_7:
	movq	_UBI_CRC32_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_UBI_EC_HDR_SIZE_CRC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rsi
	callq	_crc32
	movq	%rax, %r13
	movl	(%r15), %edi
	callq	_be32_to_cpu
	cmpq	%r13, %rax
	jne	LBB0_8
## %bb.9:
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r15, %rdx
	callq	_self_check_ec_hdr
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_1:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movl	%r13d, %edx
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_ubi_err
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_ubi_err
	movq	%r15, %rdi
	callq	_ubi_dump_ec_hdr
	xorl	%eax, %eax
	callq	_dump_stack
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_10:
	movq	%r15, %rdi
	callq	_kfree
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %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_EC_HDR_SIZE,4,2            ## @UBI_EC_HDR_SIZE
	.comm	_UBI_IO_BITFLIPS,4,2            ## @UBI_IO_BITFLIPS
	.comm	_UBI_CRC32_INIT,4,2             ## @UBI_CRC32_INIT
	.comm	_UBI_EC_HDR_SIZE_CRC,4,2        ## @UBI_EC_HDR_SIZE_CRC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad CRC, calculated %#08x, read %#08x"

L_.str.1:                               ## @.str.1
	.asciz	"self-check failed for PEB %d"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_self_check_peb_ec_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function self_check_peb_ec_hdr
_self_check_peb_ec_hdr:                 ; @self_check_peb_ec_hdr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x1
	mov	x21, x0
	bl	_ubi_dbg_chk_io
	cbz	w0, LBB0_6
; %bb.1:
	ldr	w0, [x21]
Lloh0:
	adrp	x8, _GFP_NOFS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOFS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.2:
	mov	x19, x0
Lloh3:
	adrp	x8, _UBI_EC_HDR_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UBI_EC_HDR_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	mov	w3, #0
	bl	_ubi_io_read
Lloh6:
	adrp	x8, _UBI_IO_BITFLIPS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _UBI_IO_BITFLIPS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w0, #0
	ccmp	w0, w8, #4, ne
	b.eq	LBB0_4
; %bb.3:
	mov	x22, x0
	bl	_mtd_is_eccerr
	cbz	w0, LBB0_9
LBB0_4:
Lloh9:
	adrp	x8, _UBI_CRC32_INIT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _UBI_CRC32_INIT@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _UBI_EC_HDR_SIZE_CRC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _UBI_EC_HDR_SIZE_CRC@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_crc32
	mov	x22, x0
	ldr	w0, [x19]
	bl	_be32_to_cpu
	cmp	x0, x22
	b.ne	LBB0_8
; %bb.5:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_self_check_ec_hdr
	mov	x22, x0
	b	LBB0_9
LBB0_6:
	mov	w22, #0
	b	LBB0_10
LBB0_7:
Lloh15:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_8:
	str	x0, [sp]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_ubi_err
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_ubi_err
	mov	x0, x19
	bl	_ubi_dump_ec_hdr
	bl	_dump_stack
Lloh22:
	adrp	x8, _EINVAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x19
	bl	_kfree
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOFS,4,2                   ; @GFP_NOFS
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_UBI_EC_HDR_SIZE,4,2            ; @UBI_EC_HDR_SIZE
	.comm	_UBI_IO_BITFLIPS,4,2            ; @UBI_IO_BITFLIPS
	.comm	_UBI_CRC32_INIT,4,2             ; @UBI_CRC32_INIT
	.comm	_UBI_EC_HDR_SIZE_CRC,4,2        ; @UBI_EC_HDR_SIZE_CRC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad CRC, calculated %#08x, read %#08x"

l_.str.1:                               ; @.str.1
	.asciz	"self-check failed for PEB %d"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_self_check_peb_ec_hdr
.subsections_via_symbols
