	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function validate_vid_hdr
_validate_vid_hdr:                      ## @validate_vid_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	4(%rsi), %r14d
	movl	32(%rsi), %edi
	callq	_be32_to_cpu
	movl	%eax, %r13d
	movl	28(%rbx), %edi
	callq	_be32_to_cpu
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	8(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	24(%rbx), %edi
	callq	_be32_to_cpu
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	20(%rbx), %edi
	callq	_be32_to_cpu
	movl	%eax, %r12d
	movl	16(%rbx), %edi
	callq	_be32_to_cpu
	movl	%eax, %r15d
	movl	12(%rbx), %edi
	callq	_be32_to_cpu
	cmpl	$1, %r14d
	ja	LBB0_1
## %bb.2:
	leaq	L_.str.1(%rip), %rdi
	testl	%r13d, %r13d
	js	LBB0_41
## %bb.3:
	movl	-56(%rbp), %r9d                 ## 4-byte Reload
	testl	%r9d, %r9d
	js	LBB0_41
## %bb.4:
	movl	%r13d, %esi
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	testl	%r13d, %r13d
	js	LBB0_41
## %bb.5:
	testl	%r12d, %r12d
	js	LBB0_41
## %bb.6:
	testl	%r15d, %r15d
	js	LBB0_41
## %bb.7:
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %r8d
	movq	_UBI_MAX_VOLUMES@GOTPCREL(%rip), %rdi
	movq	_UBI_INTERNAL_VOL_START@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmpl	(%rdi), %esi
	jl	LBB0_10
## %bb.8:
	cmpl	%edx, %esi
	jge	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_41
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_41:
	callq	_dbg_err
	leaq	L_.str.15(%rip), %rdi
	callq	_ubi_err
	movq	%rbx, %rdi
	callq	_ubi_dbg_dump_vid_hdr
	xorl	%eax, %eax
	callq	_ubi_dbg_dump_stack
	movl	$1, %eax
LBB0_42:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	leaq	L_.str.3(%rip), %rdi
	cmpl	%edx, %esi
	jge	LBB0_12
## %bb.11:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_41
LBB0_12:
	cmpl	%edx, %esi
	jl	LBB0_17
## %bb.13:
	movq	_UBI_COMPAT_DELETE@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	(%rdx), %esi
	je	LBB0_17
## %bb.14:
	movq	_UBI_COMPAT_RO@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	(%rdx), %esi
	je	LBB0_17
## %bb.15:
	movq	_UBI_COMPAT_PRESERVE@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	(%rdx), %esi
	je	LBB0_17
## %bb.16:
	movq	_UBI_COMPAT_REJECT@GOTPCREL(%rip), %rdx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	cmpl	(%rdx), %esi
	jne	LBB0_41
LBB0_17:
	movq	_UBI_VID_DYNAMIC@GOTPCREL(%rip), %rsi
	movq	_UBI_VID_STATIC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	cmpl	(%rsi), %edi
	je	LBB0_20
## %bb.18:
	cmpl	%edx, %edi
	je	LBB0_20
## %bb.19:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_41
LBB0_20:
	movl	%r8d, %esi
	shrl	$31, %esi
	addl	%r8d, %esi
	sarl	%esi
	cmpl	%esi, %r15d
	jge	LBB0_21
## %bb.22:
	cmpl	%edx, %edi
	jne	LBB0_32
## %bb.23:
	testl	%r12d, %r12d
	je	LBB0_24
## %bb.25:
	testl	%r13d, %r13d
	je	LBB0_26
## %bb.27:
	decl	%r12d
	cmpl	%r12d, %r9d
	jae	LBB0_30
## %bb.28:
	subl	%r15d, %r8d
	xorl	%eax, %eax
	cmpl	%r8d, %r13d
	je	LBB0_42
## %bb.29:
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_41
LBB0_21:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_41
LBB0_32:
	testl	%r14d, %r14d
	je	LBB0_33
## %bb.37:
	testl	%r13d, %r13d
	je	LBB0_38
LBB0_39:
	testl	%r12d, %r12d
	je	LBB0_43
## %bb.40:
	leaq	L_.str.14(%rip), %rdi
	jmp	LBB0_41
LBB0_24:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_41
LBB0_33:
	testl	%eax, %eax
	je	LBB0_35
## %bb.34:
	leaq	L_.str.11(%rip), %rdi
	jmp	LBB0_41
LBB0_26:
	leaq	L_.str.7(%rip), %rdi
	jmp	LBB0_41
LBB0_38:
	leaq	L_.str.13(%rip), %rdi
	jmp	LBB0_41
LBB0_30:
	xorl	%eax, %eax
	cmpl	%r12d, %r9d
	je	LBB0_42
## %bb.31:
	leaq	L_.str.10(%rip), %rdi
	jmp	LBB0_41
LBB0_43:
	xorl	%eax, %eax
	jmp	LBB0_42
LBB0_35:
	testl	%r13d, %r13d
	je	LBB0_39
## %bb.36:
	leaq	L_.str.12(%rip), %rdi
	jmp	LBB0_41
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad copy_flag"

L_.str.1:                               ## @.str.1
	.asciz	"negative values"

	.comm	_UBI_MAX_VOLUMES,4,2            ## @UBI_MAX_VOLUMES
	.comm	_UBI_INTERNAL_VOL_START,4,2     ## @UBI_INTERNAL_VOL_START
L_.str.2:                               ## @.str.2
	.asciz	"bad vol_id"

L_.str.3:                               ## @.str.3
	.asciz	"bad compat"

	.comm	_UBI_COMPAT_DELETE,4,2          ## @UBI_COMPAT_DELETE
	.comm	_UBI_COMPAT_RO,4,2              ## @UBI_COMPAT_RO
	.comm	_UBI_COMPAT_PRESERVE,4,2        ## @UBI_COMPAT_PRESERVE
	.comm	_UBI_COMPAT_REJECT,4,2          ## @UBI_COMPAT_REJECT
	.comm	_UBI_VID_DYNAMIC,4,2            ## @UBI_VID_DYNAMIC
	.comm	_UBI_VID_STATIC,4,2             ## @UBI_VID_STATIC
L_.str.4:                               ## @.str.4
	.asciz	"bad vol_type"

L_.str.5:                               ## @.str.5
	.asciz	"bad data_pad"

L_.str.6:                               ## @.str.6
	.asciz	"zero used_ebs"

L_.str.7:                               ## @.str.7
	.asciz	"zero data_size"

L_.str.8:                               ## @.str.8
	.asciz	"bad data_size"

L_.str.10:                              ## @.str.10
	.asciz	"too high lnum"

L_.str.11:                              ## @.str.11
	.asciz	"non-zero data CRC"

L_.str.12:                              ## @.str.12
	.asciz	"non-zero data_size"

L_.str.13:                              ## @.str.13
	.asciz	"zero data_size of copy"

L_.str.14:                              ## @.str.14
	.asciz	"bad used_ebs"

L_.str.15:                              ## @.str.15
	.asciz	"bad VID header"

	.no_dead_strip	_validate_vid_hdr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function validate_vid_hdr
_validate_vid_hdr:                      ; @validate_vid_hdr
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	mov	x25, x0
	ldp	w27, w26, [x1]
	ldr	w0, [x1, #32]
	bl	_be32_to_cpu
	mov	x24, x0
	ldr	w0, [x19, #28]
	bl	_be32_to_cpu
	mov	x21, x0
	ldr	w28, [x19, #8]
	ldr	w0, [x19, #24]
	bl	_be32_to_cpu
	mov	x20, x0
	ldr	w0, [x19, #20]
	bl	_be32_to_cpu
	mov	x22, x0
	ldr	w0, [x19, #16]
	bl	_be32_to_cpu
	mov	x23, x0
	ldr	w0, [x19, #12]
	bl	_be32_to_cpu
	cmp	w26, #1
	b.hi	LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, l_.str.1@PAGE
Lloh1:
	add	x8, x8, l_.str.1@PAGEOFF
	tbnz	w24, #31, LBB0_10
; %bb.2:
	tbnz	w21, #31, LBB0_10
; %bb.3:
	tbnz	w20, #31, LBB0_10
; %bb.4:
	tbnz	w22, #31, LBB0_10
; %bb.5:
	tbnz	w23, #31, LBB0_10
; %bb.6:
Lloh2:
	adrp	x9, _UBI_MAX_VOLUMES@GOTPAGE
Lloh3:
	ldr	x9, [x9, _UBI_MAX_VOLUMES@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh4:
	ldr	w10, [x9]
Lloh5:
	adrp	x9, _UBI_INTERNAL_VOL_START@GOTPAGE
Lloh6:
	ldr	x9, [x9, _UBI_INTERNAL_VOL_START@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	cmp	w24, w10
	b.lt	LBB0_12
; %bb.7:
	cmp	w24, w9
	b.ge	LBB0_12
; %bb.8:
Lloh8:
	adrp	x8, l_.str.2@PAGE
Lloh9:
	add	x8, x8, l_.str.2@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh10:
	adrp	x8, l_.str@PAGE
Lloh11:
	add	x8, x8, l_.str@PAGEOFF
LBB0_10:
	mov	x0, x8
	bl	_dbg_err
Lloh12:
	adrp	x0, l_.str.15@PAGE
Lloh13:
	add	x0, x0, l_.str.15@PAGEOFF
	bl	_ubi_err
	mov	x0, x19
	bl	_ubi_dbg_dump_vid_hdr
	bl	_ubi_dbg_dump_stack
	mov	w0, #1
LBB0_11:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_12:
	cmp	w24, w9
	b.ge	LBB0_14
; %bb.13:
	cbnz	w28, LBB0_19
LBB0_14:
	cmp	w24, w9
	b.lt	LBB0_20
; %bb.15:
Lloh14:
	adrp	x9, _UBI_COMPAT_DELETE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _UBI_COMPAT_DELETE@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w28, w9
	b.eq	LBB0_20
; %bb.16:
Lloh17:
	adrp	x9, _UBI_COMPAT_RO@GOTPAGE
Lloh18:
	ldr	x9, [x9, _UBI_COMPAT_RO@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	cmp	w28, w9
	b.eq	LBB0_20
; %bb.17:
Lloh20:
	adrp	x9, _UBI_COMPAT_PRESERVE@GOTPAGE
Lloh21:
	ldr	x9, [x9, _UBI_COMPAT_PRESERVE@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	cmp	w28, w9
	b.eq	LBB0_20
; %bb.18:
Lloh23:
	adrp	x9, _UBI_COMPAT_REJECT@GOTPAGE
Lloh24:
	ldr	x9, [x9, _UBI_COMPAT_REJECT@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	cmp	w28, w9
	b.eq	LBB0_20
LBB0_19:
Lloh26:
	adrp	x8, l_.str.3@PAGE
Lloh27:
	add	x8, x8, l_.str.3@PAGEOFF
	b	LBB0_10
LBB0_20:
Lloh28:
	adrp	x9, _UBI_VID_DYNAMIC@GOTPAGE
Lloh29:
	ldr	x9, [x9, _UBI_VID_DYNAMIC@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x9]
Lloh31:
	adrp	x9, _UBI_VID_STATIC@GOTPAGE
Lloh32:
	ldr	x9, [x9, _UBI_VID_STATIC@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	cmp	w27, w10
	b.eq	LBB0_23
; %bb.21:
	cmp	w27, w9
	b.eq	LBB0_23
; %bb.22:
Lloh34:
	adrp	x8, l_.str.4@PAGE
Lloh35:
	add	x8, x8, l_.str.4@PAGEOFF
	b	LBB0_10
LBB0_23:
	cmp	w8, #0
	cinc	w10, w8, lt
	cmp	w23, w10, asr #1
	b.ge	LBB0_30
; %bb.24:
	cmp	w27, w9
	b.ne	LBB0_31
; %bb.25:
	cbz	w22, LBB0_35
; %bb.26:
	cbz	w20, LBB0_38
; %bb.27:
	sub	w9, w22, #1
	cmp	w21, w9
	b.hs	LBB0_40
; %bb.28:
	sub	w8, w8, w23
	cmp	w20, w8
	b.eq	LBB0_41
; %bb.29:
Lloh36:
	adrp	x8, l_.str.8@PAGE
Lloh37:
	add	x8, x8, l_.str.8@PAGEOFF
	b	LBB0_10
LBB0_30:
Lloh38:
	adrp	x8, l_.str.5@PAGE
Lloh39:
	add	x8, x8, l_.str.5@PAGEOFF
	b	LBB0_10
LBB0_31:
	cbz	w26, LBB0_36
; %bb.32:
	cbz	w20, LBB0_39
LBB0_33:
	cbz	w22, LBB0_41
; %bb.34:
Lloh40:
	adrp	x8, l_.str.14@PAGE
Lloh41:
	add	x8, x8, l_.str.14@PAGEOFF
	b	LBB0_10
LBB0_35:
Lloh42:
	adrp	x8, l_.str.6@PAGE
Lloh43:
	add	x8, x8, l_.str.6@PAGEOFF
	b	LBB0_10
LBB0_36:
	cbz	w0, LBB0_42
; %bb.37:
Lloh44:
	adrp	x8, l_.str.11@PAGE
Lloh45:
	add	x8, x8, l_.str.11@PAGEOFF
	b	LBB0_10
LBB0_38:
Lloh46:
	adrp	x8, l_.str.7@PAGE
Lloh47:
	add	x8, x8, l_.str.7@PAGEOFF
	b	LBB0_10
LBB0_39:
Lloh48:
	adrp	x8, l_.str.13@PAGE
Lloh49:
	add	x8, x8, l_.str.13@PAGEOFF
	b	LBB0_10
LBB0_40:
	cmp	w21, w9
	b.ne	LBB0_44
LBB0_41:
	mov	w0, #0
	b	LBB0_11
LBB0_42:
	cbz	w20, LBB0_33
; %bb.43:
Lloh50:
	adrp	x8, l_.str.12@PAGE
Lloh51:
	add	x8, x8, l_.str.12@PAGEOFF
	b	LBB0_10
LBB0_44:
Lloh52:
	adrp	x8, l_.str.10@PAGE
Lloh53:
	add	x8, x8, l_.str.10@PAGEOFF
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh48, Lloh49
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpAdd	Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad copy_flag"

l_.str.1:                               ; @.str.1
	.asciz	"negative values"

	.comm	_UBI_MAX_VOLUMES,4,2            ; @UBI_MAX_VOLUMES
	.comm	_UBI_INTERNAL_VOL_START,4,2     ; @UBI_INTERNAL_VOL_START
l_.str.2:                               ; @.str.2
	.asciz	"bad vol_id"

l_.str.3:                               ; @.str.3
	.asciz	"bad compat"

	.comm	_UBI_COMPAT_DELETE,4,2          ; @UBI_COMPAT_DELETE
	.comm	_UBI_COMPAT_RO,4,2              ; @UBI_COMPAT_RO
	.comm	_UBI_COMPAT_PRESERVE,4,2        ; @UBI_COMPAT_PRESERVE
	.comm	_UBI_COMPAT_REJECT,4,2          ; @UBI_COMPAT_REJECT
	.comm	_UBI_VID_DYNAMIC,4,2            ; @UBI_VID_DYNAMIC
	.comm	_UBI_VID_STATIC,4,2             ; @UBI_VID_STATIC
l_.str.4:                               ; @.str.4
	.asciz	"bad vol_type"

l_.str.5:                               ; @.str.5
	.asciz	"bad data_pad"

l_.str.6:                               ; @.str.6
	.asciz	"zero used_ebs"

l_.str.7:                               ; @.str.7
	.asciz	"zero data_size"

l_.str.8:                               ; @.str.8
	.asciz	"bad data_size"

l_.str.10:                              ; @.str.10
	.asciz	"too high lnum"

l_.str.11:                              ; @.str.11
	.asciz	"non-zero data CRC"

l_.str.12:                              ; @.str.12
	.asciz	"non-zero data_size"

l_.str.13:                              ; @.str.13
	.asciz	"zero data_size of copy"

l_.str.14:                              ; @.str.14
	.asciz	"bad used_ebs"

l_.str.15:                              ; @.str.15
	.asciz	"bad VID header"

	.no_dead_strip	_validate_vid_hdr
.subsections_via_symbols
