	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_nand_hw_ecc
_tegra_nand_hw_ecc:                     ## @tegra_nand_hw_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_to_tegra_chip
	movq	%rax, %r14
	xorl	%edi, %edi
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.1:
	movq	_NAND_ECC_BCH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rax, (%rbx)
	jne	LBB0_3
## %bb.2:
	movl	8(%r14), %edi
LBB0_3:
	xorl	%ebx, %ebx
	testl	%r12d, %r12d
	setne	%bl
	movq	_BCH_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel_relaxed
	movl	(%r14,%rbx,4), %edi
	movq	_CONFIG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_writel_relaxed                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ECC_BCH,8,3               ## @NAND_ECC_BCH
	.comm	_BCH_CONFIG,8,3                 ## @BCH_CONFIG
	.comm	_CONFIG,8,3                     ## @CONFIG
	.no_dead_strip	_tegra_nand_hw_ecc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_nand_hw_ecc
_tegra_nand_hw_ecc:                     ; @tegra_nand_hw_ecc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	mov	x0, x1
	bl	_to_tegra_chip
	mov	x20, x0
	mov	w0, #0
	cbz	w21, LBB0_3
; %bb.1:
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _NAND_ECC_BCH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_ECC_BCH@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x20, #8]
LBB0_3:
	cmp	w21, #0
	cset	w21, ne
	ldr	x8, [x19]
Lloh3:
	adrp	x9, _BCH_CONFIG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _BCH_CONFIG@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
	ldr	w0, [x20, w21, uxtw #2]
	ldr	x8, [x19]
Lloh6:
	adrp	x9, _CONFIG@GOTPAGE
Lloh7:
	ldr	x9, [x9, _CONFIG@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_writel_relaxed
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ECC_BCH,8,3               ; @NAND_ECC_BCH
	.comm	_BCH_CONFIG,8,3                 ; @BCH_CONFIG
	.comm	_CONFIG,8,3                     ; @CONFIG
	.no_dead_strip	_tegra_nand_hw_ecc
.subsections_via_symbols
