	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function validate_ec_hdr
_validate_ec_hdr:                       ## @validate_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	16(%rsi), %edi
	callq	_be64_to_cpu
	movq	%rax, %r14
	movl	12(%rbx), %edi
	callq	_be32_to_cpu
	movl	%eax, %r12d
	movl	8(%rbx), %edi
	callq	_be32_to_cpu
	movq	(%rbx), %rdx
	movq	_UBI_VERSION@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	cmpq	%rsi, %rdx
	jne	LBB0_1
## %bb.2:
	movl	(%r15), %edx
	cmpl	%edx, %r12d
	jne	LBB0_3
## %bb.5:
	movl	4(%r15), %edx
	cmpl	%edx, %eax
	jne	LBB0_6
## %bb.7:
	testq	%r14, %r14
	js	LBB0_9
## %bb.8:
	xorl	%eax, %eax
	movq	_UBI_MAX_ERASECOUNTER@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r14
	jle	LBB0_11
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_ubi_err
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str(%rip), %rdi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_ubi_err
	jmp	LBB0_10
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
LBB0_4:
	xorl	%eax, %eax
	callq	_ubi_err
LBB0_10:
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_ubi_err
	movq	%rbx, %rdi
	callq	_ubi_dbg_dump_ec_hdr
	xorl	%eax, %eax
	callq	_ubi_dbg_dump_stack
	movl	$1, %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UBI_VERSION,8,3                ## @UBI_VERSION
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"node with incompatible UBI version found: this UBI version is %d, image version is %d"

L_.str.1:                               ## @.str.1
	.asciz	"bad VID header offset %d, expected %d"

L_.str.2:                               ## @.str.2
	.asciz	"bad data offset %d, expected %d"

	.comm	_UBI_MAX_ERASECOUNTER,8,3       ## @UBI_MAX_ERASECOUNTER
L_.str.3:                               ## @.str.3
	.asciz	"bad erase counter %lld"

L_.str.4:                               ## @.str.4
	.asciz	"bad EC header"

	.no_dead_strip	_validate_ec_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function validate_ec_hdr
_validate_ec_hdr:                       ; @validate_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	x19, x1
	mov	x21, x0
	ldr	w0, [x1, #16]
	bl	_be64_to_cpu
	mov	x20, x0
	ldr	w0, [x19, #12]
	bl	_be32_to_cpu
	mov	x22, x0
	ldr	w0, [x19, #8]
	bl	_be32_to_cpu
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _UBI_VERSION@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UBI_VERSION@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.1:
	ldr	w8, [x21]
	cmp	w22, w8
	b.ne	LBB0_7
; %bb.2:
	ldr	w8, [x21, #4]
	cmp	w0, w8
	b.ne	LBB0_8
; %bb.3:
	tbnz	x20, #63, LBB0_9
; %bb.4:
Lloh3:
	adrp	x8, _UBI_MAX_ERASECOUNTER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _UBI_MAX_ERASECOUNTER@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x20, x8
	b.gt	LBB0_9
; %bb.5:
	mov	w0, #0
	b	LBB0_11
LBB0_6:
	stp	x9, x8, [sp]
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_10
LBB0_7:
	stp	x22, x8, [sp]
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_8:
	stp	x0, x8, [sp]
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_9:
	str	x20, [sp]
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_10:
	bl	_ubi_err
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_ubi_err
	mov	x0, x19
	bl	_ubi_dbg_dump_ec_hdr
	bl	_ubi_dbg_dump_stack
	mov	w0, #1
LBB0_11:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_UBI_VERSION,8,3                ; @UBI_VERSION
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"node with incompatible UBI version found: this UBI version is %d, image version is %d"

l_.str.1:                               ; @.str.1
	.asciz	"bad VID header offset %d, expected %d"

l_.str.2:                               ; @.str.2
	.asciz	"bad data offset %d, expected %d"

	.comm	_UBI_MAX_ERASECOUNTER,8,3       ; @UBI_MAX_ERASECOUNTER
l_.str.3:                               ; @.str.3
	.asciz	"bad erase counter %lld"

l_.str.4:                               ; @.str.4
	.asciz	"bad EC header"

	.no_dead_strip	_validate_ec_hdr
.subsections_via_symbols
