	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_correct_data
_omap_correct_data:                     ## @omap_correct_data
	.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
	movq	%rcx, %r14
	movq	%rdx, %rbx
	movq	%rsi, %r15
	callq	_nand_to_mtd
	movl	%eax, %edi
	callq	_mtd_to_omap
	movq	(%rax), %rcx
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_2
## %bb.1:
	movl	$4, %r13d
	cmpl	$2048, 8(%rax)                  ## imm = 0x800
	je	LBB0_3
LBB0_2:
	movl	$1, %r13d
LBB0_3:
	xorl	%r12d, %r12d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	$12, %rbx
	addq	$12, %r14
	addq	$2048, %r15                     ## imm = 0x800
	decl	%r13d
	je	LBB0_9
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$3, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_omap_compare_ecc
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	addl	%eax, %r12d
	jmp	LBB0_8
LBB0_6:
	movl	%eax, %r12d
LBB0_9:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ECC_HW,8,3                ## @NAND_ECC_HW
	.no_dead_strip	_omap_correct_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_correct_data
_omap_correct_data:                     ; @omap_correct_data
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x3
	mov	x21, x2
	mov	x19, x1
	bl	_nand_to_mtd
	bl	_mtd_to_omap
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NAND_ECC_HW@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_ECC_HW@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	w8, [x0, #8]
	cmp	w8, #2048
	b.ne	LBB0_3
; %bb.2:
	mov	w23, #0
	b	LBB0_4
LBB0_3:
	mov	w23, #1
LBB0_4:
	mov	x0, x21
	mov	x1, x20
	mov	w2, #3
	bl	_memcmp
	cbz	x0, LBB0_7
; %bb.5:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_omap_compare_ecc
	mov	x22, x0
	tbnz	w0, #31, LBB0_17
; %bb.6:
	tbz	w23, #0, LBB0_8
	b	LBB0_17
LBB0_7:
	mov	w22, #0
	tbnz	w23, #0, LBB0_17
LBB0_8:
	add	x23, x21, #12
	add	x24, x20, #12
	mov	x0, x23
	mov	x1, x24
	mov	w2, #3
	bl	_memcmp
	cbz	x0, LBB0_11
; %bb.9:
	add	x2, x19, #2048
	mov	x0, x23
	mov	x1, x24
	bl	_omap_compare_ecc
	tbnz	w0, #31, LBB0_16
; %bb.10:
	add	w22, w0, w22
LBB0_11:
	add	x23, x21, #24
	add	x24, x20, #24
	mov	x0, x23
	mov	x1, x24
	mov	w2, #3
	bl	_memcmp
	cbz	x0, LBB0_14
; %bb.12:
	add	x2, x19, #1, lsl #12            ; =4096
	mov	x0, x23
	mov	x1, x24
	bl	_omap_compare_ecc
	tbnz	w0, #31, LBB0_16
; %bb.13:
	add	w22, w0, w22
LBB0_14:
	add	x21, x21, #36
	add	x20, x20, #36
	mov	x0, x21
	mov	x1, x20
	mov	w2, #3
	bl	_memcmp
	cbz	x0, LBB0_17
; %bb.15:
	mov	w8, #6144
	add	x2, x19, x8
	mov	x0, x21
	mov	x1, x20
	bl	_omap_compare_ecc
	add	w8, w0, w22
	cmp	w0, #0
	csel	w22, w0, w8, lt
	b	LBB0_17
LBB0_16:
	mov	x22, x0
LBB0_17:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_HW,8,3                ; @NAND_ECC_HW
	.no_dead_strip	_omap_correct_data
.subsections_via_symbols
