	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_nand_ooblayout_bch_ecc
_tegra_nand_ooblayout_bch_ecc:          ## @tegra_nand_ooblayout_bch_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	callq	_mtd_to_nand
	movq	%rax, %rbx
	movq	_BITS_PER_STEP_BCH@GOTPCREL(%rip), %rax
	movl	(%rbx), %edi
	imull	(%rax), %edi
	movq	_BITS_PER_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_DIV_ROUND_UP
	testl	%r15d, %r15d
	jle	LBB0_2
## %bb.1:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_2:
	movq	_SKIP_SPARE_BYTES@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%r14)
	imull	4(%rbx), %eax
	movl	%eax, %edi
	movl	$4, %esi
	callq	_round_up
	movl	%eax, (%r14)
	xorl	%eax, %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BITS_PER_STEP_BCH,4,2          ## @BITS_PER_STEP_BCH
	.comm	_BITS_PER_BYTE,4,2              ## @BITS_PER_BYTE
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_SKIP_SPARE_BYTES,4,2           ## @SKIP_SPARE_BYTES
	.no_dead_strip	_tegra_nand_ooblayout_bch_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_ooblayout_bch_ecc
_tegra_nand_ooblayout_bch_ecc:          ; @tegra_nand_ooblayout_bch_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	x19, x2
	mov	x21, x1
	bl	_mtd_to_nand
	mov	x20, x0
Lloh0:
	adrp	x8, _BITS_PER_STEP_BCH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BITS_PER_STEP_BCH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x0]
	mul	w0, w9, w8
Lloh3:
	adrp	x8, _BITS_PER_BYTE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BITS_PER_BYTE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_DIV_ROUND_UP
	cmp	w21, #1
	b.lt	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _ERANGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
Lloh9:
	adrp	x8, _SKIP_SPARE_BYTES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SKIP_SPARE_BYTES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x19, #4]
	ldr	w8, [x20, #4]
	mul	w0, w8, w0
	mov	w1, #4
	bl	_round_up
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19]
LBB0_3:
	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
	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	_BITS_PER_STEP_BCH,4,2          ; @BITS_PER_STEP_BCH
	.comm	_BITS_PER_BYTE,4,2              ; @BITS_PER_BYTE
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_SKIP_SPARE_BYTES,4,2           ; @SKIP_SPARE_BYTES
	.no_dead_strip	_tegra_nand_ooblayout_bch_ecc
.subsections_via_symbols
