	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function omap_ooblayout_ecc
_omap_ooblayout_ecc:                    ## @omap_ooblayout_ecc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	callq	_mtd_to_omap
	movq	_BADBLOCK_MARKER_LENGTH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	(%rax), %rdx
	movq	_OMAP_ECC_HAM1_CODE_HW@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_2
## %bb.1:
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, 8(%rax)
	movl	$1, %edx
	cmovel	%edx, %ecx
LBB0_2:
	testl	%ebx, %ebx
	je	LBB0_4
## %bb.3:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_4:
	movl	%ecx, (%r14)
	movl	12(%rax), %eax
	movl	%eax, 4(%r14)
	xorl	%eax, %eax
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BADBLOCK_MARKER_LENGTH,4,2     ## @BADBLOCK_MARKER_LENGTH
	.comm	_OMAP_ECC_HAM1_CODE_HW,8,3      ## @OMAP_ECC_HAM1_CODE_HW
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_ERANGE,4,2                     ## @ERANGE
	.no_dead_strip	_omap_ooblayout_ecc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function omap_ooblayout_ecc
_omap_ooblayout_ecc:                    ; @omap_ooblayout_ecc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x2
	mov	x20, x1
	bl	_mtd_to_omap
Lloh0:
	adrp	x8, _BADBLOCK_MARKER_LENGTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BADBLOCK_MARKER_LENGTH@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	ldr	x8, [x0]
Lloh3:
	adrp	x10, _OMAP_ECC_HAM1_CODE_HW@GOTPAGE
Lloh4:
	ldr	x10, [x10, _OMAP_ECC_HAM1_CODE_HW@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x10
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x0, #8]
Lloh6:
	adrp	x10, _NAND_BUSWIDTH_16@GOTPAGE
Lloh7:
	ldr	x10, [x10, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	tst	w10, w8
	csinc	w9, w9, wzr, ne
LBB0_2:
	cbz	w20, LBB0_4
; %bb.3:
Lloh9:
	adrp	x8, _ERANGE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w8, w8
	b	LBB0_5
LBB0_4:
	mov	w8, #0
	ldr	w10, [x0, #12]
	stp	w9, w10, [x19]
LBB0_5:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_BADBLOCK_MARKER_LENGTH,4,2     ; @BADBLOCK_MARKER_LENGTH
	.comm	_OMAP_ECC_HAM1_CODE_HW,8,3      ; @OMAP_ECC_HAM1_CODE_HW
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_ERANGE,4,2                     ; @ERANGE
	.no_dead_strip	_omap_ooblayout_ecc
.subsections_via_symbols
