	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_compare_lebs               ## -- Begin function ubi_compare_lebs
	.p2align	4, 0x90
_ubi_compare_lebs:                      ## @ubi_compare_lebs
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	12(%rcx), %edi
	callq	_be64_to_cpu
	movq	(%rbx), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_ubi_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_24
LBB0_2:
	movq	%rax, %r13
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	seta	%al
	jbe	LBB0_6
## %bb.3:
	cmpl	$0, 8(%r15)
	je	LBB0_5
## %bb.4:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	xorl	%eax, %eax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %r12
	jmp	LBB0_15
LBB0_6:
	cmpl	$0, 12(%rbx)
	je	LBB0_7
## %bb.8:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %r12
	movq	%r14, %rdi
	callq	_ubi_alloc_vid_buf
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %r15
	movl	8(%rbx), %esi
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rax, %rdx
	xorl	%ecx, %ecx
	callq	_ubi_io_read_vid_hdr
	testl	%eax, %eax
	je	LBB0_14
## %bb.11:
	movl	%eax, %ebx
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	movl	$1, %r14d
	cmpl	(%rax), %ebx
	jne	LBB0_12
LBB0_14:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_ubi_get_vid_hdr
	movq	%rax, %r15
LBB0_15:
	movl	4(%r15), %edi
	callq	_be32_to_cpu
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	4(%r12), %esi
	movq	%r12, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	movl	%r14d, %r8d
	callq	_ubi_io_read_data
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_18
## %bb.16:
	movq	_UBI_IO_BITFLIPS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	je	LBB0_18
## %bb.17:
	movl	%ebx, %edi
	callq	_mtd_is_eccerr
	testl	%eax, %eax
	je	LBB0_22
LBB0_18:
	movl	(%r15), %edi
	callq	_be32_to_cpu
	movq	%rax, %r15
	movq	_UBI_CRC32_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%r12), %esi
	movl	%r14d, %edx
	callq	_crc32
	cmpq	%r15, %rax
	je	LBB0_20
## %bb.19:
	cmpq	-56(%rbp), %r13                 ## 8-byte Folded Reload
	setbe	%r14b
	leaq	L_.str.4(%rip), %rdi
	xorl	%ebx, %ebx
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	movq	%rax, %rdx
	movq	%r15, %rcx
	xorl	%eax, %eax
	callq	_dbg_bld
	movl	$4, -56(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_21
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dbg_bld
	movl	$1, %ebx
	jmp	LBB0_24
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%ebx, %ebx
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dbg_bld
	jmp	LBB0_24
LBB0_20:
	xorl	%r15d, %r15d
	testl	%ebx, %ebx
	setne	%r15b
	leaq	L_.str.5(%rip), %rdi
	movl	$0, -56(%rbp)                   ## 4-byte Folded Spill
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_dbg_bld
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	orl	%r15d, %eax
	addl	%eax, %eax
	movl	%eax, %ebx
	movb	-41(%rbp), %r14b                ## 1-byte Reload
LBB0_21:
	movzbl	%r14b, %r15d
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_ubi_free_vid_buf
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.7(%rip), %rdi
	testb	%r15b, %r15b
	cmovneq	%rax, %rdi
	movl	%r13d, %esi
	xorl	%eax, %eax
	callq	_dbg_bld
	orl	-56(%rbp), %ebx                 ## 4-byte Folded Reload
	orl	%r15d, %ebx
	jmp	LBB0_24
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_24
LBB0_22:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_23
LBB0_12:
	leaq	L_.str.3(%rip), %rsi
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_ubi_err
	testl	%ebx, %ebx
	jle	LBB0_23
## %bb.13:
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	movl	%r14d, %ebx
LBB0_23:
	movq	%r15, %rdi
	callq	_ubi_free_vid_buf
LBB0_24:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported on-flash UBI format"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"second PEB %d is newer, copy_flag is unset"

L_.str.2:                               ## @.str.2
	.asciz	"first PEB %d is newer, copy_flag is unset"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_UBI_IO_BITFLIPS,4,2            ## @UBI_IO_BITFLIPS
L_.str.3:                               ## @.str.3
	.asciz	"VID of PEB %d header is bad, but it was OK earlier, err %d"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_UBI_CRC32_INIT,4,2             ## @UBI_CRC32_INIT
L_.str.4:                               ## @.str.4
	.asciz	"PEB %d CRC error: calculated %#08x, must be %#08x"

L_.str.5:                               ## @.str.5
	.asciz	"PEB %d CRC is OK"

L_.str.6:                               ## @.str.6
	.asciz	"second PEB %d is newer, copy_flag is set"

L_.str.7:                               ## @.str.7
	.asciz	"first PEB %d is newer, copy_flag is set"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ubi_compare_lebs               ; -- Begin function ubi_compare_lebs
	.p2align	2
_ubi_compare_lebs:                      ; @ubi_compare_lebs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x24, x3
	mov	x19, x2
	mov	x23, x1
	mov	x20, x0
	ldr	w0, [x3, #12]
	bl	_be64_to_cpu
	ldr	x27, [x23]
	cmp	x0, x27
	b.ne	LBB0_3
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_ubi_err
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_27
LBB0_3:
	mov	x22, x0
	cset	w26, hi
	b.ls	LBB0_6
; %bb.4:
	ldr	w8, [x24, #8]
	cbz	w8, LBB0_11
; %bb.5:
	mov	w28, #0
	mov	x21, #0
	b	LBB0_16
LBB0_6:
	ldr	w8, [x23, #12]
	cbz	w8, LBB0_12
; %bb.7:
Lloh4:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ubi_alloc_vid_buf
	cbz	x0, LBB0_13
; %bb.8:
	mov	x21, x0
	ldr	w19, [x23, #8]
	mov	x0, x20
	mov	x1, x19
	mov	x2, x21
	mov	w3, #0
	bl	_ubi_io_read_vid_hdr
	cbz	w0, LBB0_14
; %bb.9:
	mov	x23, 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_24
; %bb.10:
	mov	w28, #1
	b	LBB0_15
LBB0_11:
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_dbg_bld
	mov	w23, #1
	b	LBB0_27
LBB0_12:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_dbg_bld
	mov	w23, #0
	b	LBB0_27
LBB0_13:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_14:
	mov	w28, #0
LBB0_15:
	mov	x0, x21
	bl	_ubi_get_vid_hdr
	mov	x24, x0
LBB0_16:
	ldr	w0, [x24, #4]
	bl	_be32_to_cpu
	mov	x25, x0
	mov	x0, x20
	bl	_mutex_lock
	ldr	w1, [x20, #4]
	mov	x0, x20
	mov	x2, x19
	mov	w3, #0
	mov	x4, x25
	bl	_ubi_io_read_data
	mov	x23, x0
	cbz	w0, LBB0_19
; %bb.17:
Lloh16:
	adrp	x8, _UBI_IO_BITFLIPS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _UBI_IO_BITFLIPS@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w23, w8
	b.eq	LBB0_19
; %bb.18:
	mov	x0, x23
	bl	_mtd_is_eccerr
	cbz	w0, LBB0_23
LBB0_19:
	ldr	w0, [x24]
	bl	_be32_to_cpu
	mov	x24, x0
Lloh19:
	adrp	x8, _UBI_CRC32_INIT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _UBI_CRC32_INIT@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	ldr	w1, [x20, #4]
	mov	x2, x25
	bl	_crc32
	cmp	x0, x24
	b.eq	LBB0_21
; %bb.20:
	cmp	x22, x27
	cset	w26, ls
	stp	x0, x24, [sp]
Lloh22:
	adrp	x0, l_.str.4@PAGE
Lloh23:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x19
	bl	_dbg_bld
	mov	w23, #0
	mov	w22, #4
	b	LBB0_22
LBB0_21:
	cmp	w23, #0
	cset	w23, ne
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	mov	x1, x19
	bl	_dbg_bld
	mov	w22, #0
	orr	w8, w28, w23
	lsl	w23, w8, #1
LBB0_22:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x21
	bl	_ubi_free_vid_buf
Lloh26:
	adrp	x8, l_.str.7@PAGE
Lloh27:
	add	x8, x8, l_.str.7@PAGEOFF
Lloh28:
	adrp	x9, l_.str.6@PAGE
Lloh29:
	add	x9, x9, l_.str.6@PAGEOFF
	cmp	w26, #0
	csel	x0, x9, x8, ne
	mov	x1, x19
	bl	_dbg_bld
	orr	w8, w23, w26
	orr	w23, w8, w22
	b	LBB0_27
LBB0_23:
	mov	x0, x20
	bl	_mutex_unlock
	b	LBB0_26
LBB0_24:
	stp	x19, x23, [sp]
Lloh30:
	adrp	x1, l_.str.3@PAGE
Lloh31:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_ubi_err
	cmp	w23, #1
	b.lt	LBB0_26
; %bb.25:
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_26:
	mov	x0, x21
	bl	_ubi_free_vid_buf
LBB0_27:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported on-flash UBI format"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"second PEB %d is newer, copy_flag is unset"

l_.str.2:                               ; @.str.2
	.asciz	"first PEB %d is newer, copy_flag is unset"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_UBI_IO_BITFLIPS,4,2            ; @UBI_IO_BITFLIPS
l_.str.3:                               ; @.str.3
	.asciz	"VID of PEB %d header is bad, but it was OK earlier, err %d"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_UBI_CRC32_INIT,4,2             ; @UBI_CRC32_INIT
l_.str.4:                               ; @.str.4
	.asciz	"PEB %d CRC error: calculated %#08x, must be %#08x"

l_.str.5:                               ; @.str.5
	.asciz	"PEB %d CRC is OK"

l_.str.6:                               ; @.str.6
	.asciz	"second PEB %d is newer, copy_flag is set"

l_.str.7:                               ; @.str.7
	.asciz	"first PEB %d is newer, copy_flag is set"

.subsections_via_symbols
