	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_nand_attach_chip
_tegra_nand_attach_chip:                ## @tegra_nand_attach_chip
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	64(%rdi), %edi
	callq	_to_tegra_ctrl
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_to_tegra_chip
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r15
	movl	(%rbx), %eax
	movq	_NAND_BBT_USE_FLASH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_NAND_BBT_NO_OOB@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
LBB0_2:
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%rbx)
	movl	$512, 8(%rbx)                   ## imm = 0x200
	movl	(%r15), %eax
	leal	511(%rax), %ecx
	testl	%eax, %eax
	cmovnsl	%eax, %ecx
	sarl	$9, %ecx
	movl	%ecx, 12(%rbx)
	movl	56(%rbx), %edx
	cmpl	$512, %edx                      ## imm = 0x200
	jne	LBB0_7
## %bb.3:
	movq	%r13, %r14
	movq	_tegra_nand_read_page_hwecc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 48(%rbx)
	movq	_tegra_nand_write_page_hwecc@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 44(%rbx)
	movq	_tegra_nand_read_page_raw@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%rbx)
	movq	_tegra_nand_write_page_raw@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 36(%rbx)
	movq	_tegra_nand_read_oob@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rbx)
	movq	_tegra_nand_write_oob@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rbx)
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%rbx)
	je	LBB0_5
## %bb.4:
	movq	_CONFIG_BUS_WIDTH_16@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, (%r14)
LBB0_5:
	movl	16(%rbx), %ecx
	movq	_NAND_ECC_UNKNOWN@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_9
## %bb.6:
	xorl	%ecx, %ecx
	cmpl	$2048, %eax                     ## imm = 0x800
	setl	%cl
	xorl	$129, %ecx
	movl	%ecx, 16(%rbx)
	jmp	LBB0_12
LBB0_7:
	movl	8(%r12), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r12d, %r12d
LBB0_8:
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_26
LBB0_9:
	cmpl	$129, %ecx
	jne	LBB0_12
## %bb.10:
	cmpl	$2047, %eax                     ## imm = 0x7FF
	jg	LBB0_12
## %bb.11:
	movl	8(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_25
LBB0_12:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movl	20(%rbx), %r12d
	testl	%r12d, %r12d
	jne	LBB0_15
## %bb.13:
	movq	8(%r15), %rsi
	movq	%rbx, %rdi
	callq	_tegra_nand_select_strength
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_29
## %bb.14:
	movl	%r12d, 20(%rbx)
	movl	16(%rbx), %ecx
LBB0_15:
	movq	_CONFIG_PIPE_EN@GOTPCREL(%rip), %rax
	movq	_CONFIG_SKIP_SPARE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movq	_CONFIG_SKIP_SPARE_SIZE_4@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, 4(%r14)
	cmpl	$129, %ecx
	je	LBB0_21
## %bb.16:
	cmpl	$128, %ecx
	jne	LBB0_24
## %bb.17:
	addq	$4, %r13
	movq	_BITS_PER_STEP_RS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_tegra_nand_oob_rs_ops@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_mtd_set_ooblayout
	movq	_CONFIG_HW_ECC@GOTPCREL(%rip), %rcx
	movq	_CONFIG_ECC_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	_CONFIG_ERR_COR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	(%r13), %eax
	movl	%eax, (%r13)
	movl	20(%rbx), %ecx
	cmpl	$4, %ecx
	je	LBB0_31
## %bb.18:
	cmpl	$8, %ecx
	je	LBB0_32
## %bb.19:
	cmpl	$6, %ecx
	jne	LBB0_30
## %bb.20:
	movq	_CONFIG_TVAL_6@GOTPCREL(%rip), %rdx
	jmp	LBB0_35
LBB0_21:
	movq	_BITS_PER_STEP_BCH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_tegra_nand_oob_bch_ops@GOTPCREL(%rip), %rsi
	movq	%r15, %rdi
	callq	_mtd_set_ooblayout
	movq	_BCH_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r14)
	movl	20(%rbx), %ecx
	leal	-4(%rcx), %esi
	rorl	%esi
	cmpl	$6, %esi
	ja	LBB0_30
## %bb.22:
	addq	$8, %r13
	movq	_BCH_TVAL_4@GOTPCREL(%rip), %rdx
	leaq	LJTI0_0(%rip), %rdi
	movslq	(%rdi,%rsi,4), %rsi
	addq	%rdi, %rsi
	jmpq	*%rsi
LBB0_23:
	movq	_BCH_TVAL_8@GOTPCREL(%rip), %rdx
	jmp	LBB0_35
LBB0_24:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
LBB0_25:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_dev_err
LBB0_26:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_27:
	subl	(%rax), %r12d
LBB0_28:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	movl	60(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_28
LBB0_30:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r12d, %r12d
	movl	%ecx, %edx
	jmp	LBB0_8
LBB0_31:
	movq	_CONFIG_TVAL_4@GOTPCREL(%rip), %rdx
	jmp	LBB0_35
LBB0_32:
	movq	_CONFIG_TVAL_8@GOTPCREL(%rip), %rdx
	jmp	LBB0_35
LBB0_33:
	movq	_BCH_TVAL_14@GOTPCREL(%rip), %rdx
	jmp	LBB0_35
LBB0_34:
	movq	_BCH_TVAL_16@GOTPCREL(%rip), %rdx
LBB0_35:
	imull	-52(%rbp), %r12d                ## 4-byte Folded Reload
	orl	(%rdx), %eax
	movl	%eax, (%r13)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	cmpl	$129, 16(%rbx)
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.7(%rip), %rdx
	cmoveq	%rax, %rdx
	leaq	L_.str.5(%rip), %rsi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_dev_info
	movq	_BITS_PER_BYTE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	callq	_DIV_ROUND_UP
	movl	%eax, 24(%rbx)
	movl	(%r15), %edx
	cmpl	$1023, %edx                     ## imm = 0x3FF
	jle	LBB0_40
## %bb.36:
	cmpl	$1024, %edx                     ## imm = 0x400
	je	LBB0_44
## %bb.37:
	cmpl	$2048, %edx                     ## imm = 0x800
	je	LBB0_45
## %bb.38:
	cmpl	$4096, %edx                     ## imm = 0x1000
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_49
## %bb.39:
	movq	_CONFIG_PS_4096@GOTPCREL(%rip), %rcx
	jmp	LBB0_43
LBB0_40:
	cmpl	$256, %edx                      ## imm = 0x100
	je	LBB0_46
## %bb.41:
	cmpl	$512, %edx                      ## imm = 0x200
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_49
## %bb.42:
	movq	_CONFIG_PS_512@GOTPCREL(%rip), %rcx
LBB0_43:
	movl	(%r14), %eax
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	jmp	LBB0_48
LBB0_44:
	movq	_CONFIG_PS_1024@GOTPCREL(%rip), %rcx
	jmp	LBB0_47
LBB0_45:
	movq	_CONFIG_PS_2048@GOTPCREL(%rip), %rcx
	jmp	LBB0_47
LBB0_46:
	movq	_CONFIG_PS_256@GOTPCREL(%rip), %rcx
LBB0_47:
	movl	(%r14), %eax
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_48:
	orl	%eax, 4(%r14)
	movq	8(%r15), %rdi
	decq	%rdi
	callq	_CONFIG_TAG_BYTE_SIZE
	orl	(%r14), %eax
	movl	%eax, (%r14)
	movq	_CONFIG@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%rbx), %rsi
	movl	%eax, %edi
	callq	_writel_relaxed
	xorl	%r12d, %r12d
	jmp	LBB0_28
LBB0_49:
	movl	8(%rbx), %edi
	leaq	L_.str.8(%rip), %rsi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_27
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_35, LBB0_35-LJTI0_0
.set L0_0_set_30, LBB0_30-LJTI0_0
.set L0_0_set_23, LBB0_23-LJTI0_0
.set L0_0_set_33, LBB0_33-LJTI0_0
.set L0_0_set_34, LBB0_34-LJTI0_0
LJTI0_0:
	.long	L0_0_set_35
	.long	L0_0_set_30
	.long	L0_0_set_23
	.long	L0_0_set_30
	.long	L0_0_set_30
	.long	L0_0_set_33
	.long	L0_0_set_34
	.end_data_region
                                        ## -- End function
	.comm	_NAND_BBT_USE_FLASH,4,2         ## @NAND_BBT_USE_FLASH
	.comm	_NAND_BBT_NO_OOB,4,2            ## @NAND_BBT_NO_OOB
	.comm	_NAND_ECC_HW,4,2                ## @NAND_ECC_HW
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported step size %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_tegra_nand_read_page_hwecc,4,2 ## @tegra_nand_read_page_hwecc
	.comm	_tegra_nand_write_page_hwecc,4,2 ## @tegra_nand_write_page_hwecc
	.comm	_tegra_nand_read_page_raw,4,2   ## @tegra_nand_read_page_raw
	.comm	_tegra_nand_write_page_raw,4,2  ## @tegra_nand_write_page_raw
	.comm	_tegra_nand_read_oob,4,2        ## @tegra_nand_read_oob
	.comm	_tegra_nand_write_oob,4,2       ## @tegra_nand_write_oob
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_CONFIG_BUS_WIDTH_16,4,2        ## @CONFIG_BUS_WIDTH_16
	.comm	_NAND_ECC_UNKNOWN,4,2           ## @NAND_ECC_UNKNOWN
L_.str.1:                               ## @.str.1
	.asciz	"BCH supports 2K or 4K page size only\n"

L_.str.2:                               ## @.str.2
	.asciz	"No valid strength found, minimum %d\n"

	.comm	_CONFIG_PIPE_EN,4,2             ## @CONFIG_PIPE_EN
	.comm	_CONFIG_SKIP_SPARE,4,2          ## @CONFIG_SKIP_SPARE
	.comm	_CONFIG_SKIP_SPARE_SIZE_4,4,2   ## @CONFIG_SKIP_SPARE_SIZE_4
	.comm	_BITS_PER_STEP_RS,4,2           ## @BITS_PER_STEP_RS
	.comm	_tegra_nand_oob_rs_ops,4,2      ## @tegra_nand_oob_rs_ops
	.comm	_CONFIG_HW_ECC,4,2              ## @CONFIG_HW_ECC
	.comm	_CONFIG_ECC_SEL,4,2             ## @CONFIG_ECC_SEL
	.comm	_CONFIG_ERR_COR,4,2             ## @CONFIG_ERR_COR
	.comm	_CONFIG_TVAL_4,4,2              ## @CONFIG_TVAL_4
	.comm	_CONFIG_TVAL_6,4,2              ## @CONFIG_TVAL_6
	.comm	_CONFIG_TVAL_8,4,2              ## @CONFIG_TVAL_8
L_.str.3:                               ## @.str.3
	.asciz	"ECC strength %d not supported\n"

	.comm	_BITS_PER_STEP_BCH,4,2          ## @BITS_PER_STEP_BCH
	.comm	_tegra_nand_oob_bch_ops,4,2     ## @tegra_nand_oob_bch_ops
	.comm	_BCH_ENABLE,4,2                 ## @BCH_ENABLE
	.comm	_BCH_TVAL_4,4,2                 ## @BCH_TVAL_4
	.comm	_BCH_TVAL_8,4,2                 ## @BCH_TVAL_8
	.comm	_BCH_TVAL_14,4,2                ## @BCH_TVAL_14
	.comm	_BCH_TVAL_16,4,2                ## @BCH_TVAL_16
L_.str.4:                               ## @.str.4
	.asciz	"ECC algorithm not supported\n"

L_.str.5:                               ## @.str.5
	.asciz	"Using %s with strength %d per 512 byte step\n"

L_.str.6:                               ## @.str.6
	.asciz	"BCH"

L_.str.7:                               ## @.str.7
	.asciz	"RS"

	.comm	_BITS_PER_BYTE,4,2              ## @BITS_PER_BYTE
	.comm	_CONFIG_PS_256,4,2              ## @CONFIG_PS_256
	.comm	_CONFIG_PS_512,4,2              ## @CONFIG_PS_512
	.comm	_CONFIG_PS_1024,4,2             ## @CONFIG_PS_1024
	.comm	_CONFIG_PS_2048,4,2             ## @CONFIG_PS_2048
	.comm	_CONFIG_PS_4096,4,2             ## @CONFIG_PS_4096
L_.str.8:                               ## @.str.8
	.asciz	"Unsupported writesize %d\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_CONFIG,8,3                     ## @CONFIG
	.no_dead_strip	_tegra_nand_attach_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_nand_attach_chip
_tegra_nand_attach_chip:                ; @tegra_nand_attach_chip
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x22, x0
	ldr	w0, [x0, #64]
	bl	_to_tegra_ctrl
	mov	x19, x0
	mov	x0, x22
	bl	_to_tegra_chip
	mov	x20, x0
	mov	x0, x22
	bl	_nand_to_mtd
	mov	x21, x0
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _NAND_BBT_USE_FLASH@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NAND_BBT_USE_FLASH@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _NAND_BBT_NO_OOB@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NAND_BBT_NO_OOB@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x22]
LBB0_2:
Lloh6:
	adrp	x8, _NAND_ECC_HW@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NAND_ECC_HW@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x22, #52]
	mov	w9, #512
	ldr	w8, [x21]
	add	w10, w8, #511
	cmp	w8, #0
	csel	w10, w10, w8, lt
	asr	w10, w10, #9
	stp	w9, w10, [x22, #8]
	ldr	w9, [x22, #56]
	cmp	w9, #512
	b.ne	LBB0_7
; %bb.3:
Lloh9:
	adrp	x9, _tegra_nand_read_page_hwecc@GOTPAGE
Lloh10:
	ldr	x9, [x9, _tegra_nand_read_page_hwecc@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _tegra_nand_write_page_hwecc@GOTPAGE
Lloh13:
	ldr	x10, [x10, _tegra_nand_write_page_hwecc@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	stp	w10, w9, [x22, #44]
Lloh15:
	adrp	x9, _tegra_nand_read_page_raw@GOTPAGE
Lloh16:
	ldr	x9, [x9, _tegra_nand_read_page_raw@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _tegra_nand_write_page_raw@GOTPAGE
Lloh19:
	ldr	x10, [x10, _tegra_nand_write_page_raw@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
Lloh21:
	adrp	x11, _tegra_nand_read_oob@GOTPAGE
Lloh22:
	ldr	x11, [x11, _tegra_nand_read_oob@GOTPAGEOFF]
	stp	w10, w9, [x22, #36]
Lloh23:
	ldr	w9, [x11]
Lloh24:
	adrp	x10, _tegra_nand_write_oob@GOTPAGE
Lloh25:
	ldr	x10, [x10, _tegra_nand_write_oob@GOTPAGEOFF]
Lloh26:
	ldr	w10, [x10]
	stp	w10, w9, [x22, #28]
	ldr	w9, [x22, #4]
Lloh27:
	adrp	x10, _NAND_BUSWIDTH_16@GOTPAGE
Lloh28:
	ldr	x10, [x10, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh29:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_5
; %bb.4:
Lloh30:
	adrp	x9, _CONFIG_BUS_WIDTH_16@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CONFIG_BUS_WIDTH_16@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	ldr	w10, [x20]
	orr	w9, w10, w9
	str	w9, [x20]
LBB0_5:
	ldr	w9, [x22, #16]
Lloh33:
	adrp	x10, _NAND_ECC_UNKNOWN@GOTPAGE
Lloh34:
	ldr	x10, [x10, _NAND_ECC_UNKNOWN@GOTPAGEOFF]
Lloh35:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_11
; %bb.6:
	cmp	w8, #2048
	mov	w8, #128
	cinc	w9, w8, ge
	str	w9, [x22, #16]
	b	LBB0_14
LBB0_7:
	ldr	w0, [x19, #8]
	str	x9, [sp]
Lloh36:
	adrp	x1, l_.str@PAGE
Lloh37:
	add	x1, x1, l_.str@PAGEOFF
LBB0_8:
	bl	_dev_err
Lloh38:
	adrp	x8, _EINVAL@GOTPAGE
Lloh39:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_11:
	cmp	w9, #129
	b.ne	LBB0_14
; %bb.12:
	cmp	w8, #2047
	b.gt	LBB0_14
; %bb.13:
	ldr	w0, [x19, #8]
Lloh40:
	adrp	x1, l_.str.1@PAGE
Lloh41:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_14:
	ldr	w23, [x22, #20]
	cbnz	w23, LBB0_17
; %bb.15:
	ldr	x1, [x21, #8]
	mov	x0, x22
	bl	_tegra_nand_select_strength
	mov	x23, x0
	tbnz	w0, #31, LBB0_27
; %bb.16:
	str	w23, [x22, #20]
	ldr	w9, [x22, #16]
LBB0_17:
Lloh42:
	adrp	x8, _CONFIG_PIPE_EN@GOTPAGE
Lloh43:
	ldr	x8, [x8, _CONFIG_PIPE_EN@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
Lloh45:
	adrp	x10, _CONFIG_SKIP_SPARE@GOTPAGE
Lloh46:
	ldr	x10, [x10, _CONFIG_SKIP_SPARE@GOTPAGEOFF]
Lloh47:
	ldr	w10, [x10]
	orr	w8, w10, w8
Lloh48:
	adrp	x10, _CONFIG_SKIP_SPARE_SIZE_4@GOTPAGE
Lloh49:
	ldr	x10, [x10, _CONFIG_SKIP_SPARE_SIZE_4@GOTPAGEOFF]
Lloh50:
	ldr	w10, [x10]
	orr	w8, w8, w10
	mov	x24, x20
	str	w8, [x24, #4]!
	cmp	w9, #129
	b.eq	LBB0_23
; %bb.18:
	cmp	w9, #128
	b.ne	LBB0_26
; %bb.19:
Lloh51:
	adrp	x8, _BITS_PER_STEP_RS@GOTPAGE
Lloh52:
	ldr	x8, [x8, _BITS_PER_STEP_RS@GOTPAGEOFF]
Lloh53:
	ldr	w25, [x8]
Lloh54:
	adrp	x1, _tegra_nand_oob_rs_ops@GOTPAGE
Lloh55:
	ldr	x1, [x1, _tegra_nand_oob_rs_ops@GOTPAGEOFF]
	mov	x0, x21
	bl	_mtd_set_ooblayout
Lloh56:
	adrp	x8, _CONFIG_HW_ECC@GOTPAGE
Lloh57:
	ldr	x8, [x8, _CONFIG_HW_ECC@GOTPAGEOFF]
Lloh58:
	adrp	x9, _CONFIG_ECC_SEL@GOTPAGE
Lloh59:
	ldr	x9, [x9, _CONFIG_ECC_SEL@GOTPAGEOFF]
Lloh60:
	ldr	w8, [x8]
Lloh61:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh62:
	adrp	x9, _CONFIG_ERR_COR@GOTPAGE
Lloh63:
	ldr	x9, [x9, _CONFIG_ERR_COR@GOTPAGEOFF]
Lloh64:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	w9, [x24]
	orr	w8, w8, w9
	str	w8, [x24]
	ldr	w3, [x22, #20]
	cmp	w3, #4
	b.eq	LBB0_28
; %bb.20:
	cmp	w3, #8
	b.eq	LBB0_29
; %bb.21:
	cmp	w3, #6
	b.ne	LBB0_30
; %bb.22:
Lloh65:
	adrp	x9, _CONFIG_TVAL_6@GOTPAGE
Lloh66:
	ldr	x9, [x9, _CONFIG_TVAL_6@GOTPAGEOFF]
	b	LBB0_35
LBB0_23:
Lloh67:
	adrp	x8, _BITS_PER_STEP_BCH@GOTPAGE
Lloh68:
	ldr	x8, [x8, _BITS_PER_STEP_BCH@GOTPAGEOFF]
Lloh69:
	ldr	w25, [x8]
Lloh70:
	adrp	x1, _tegra_nand_oob_bch_ops@GOTPAGE
Lloh71:
	ldr	x1, [x1, _tegra_nand_oob_bch_ops@GOTPAGEOFF]
	mov	x0, x21
	bl	_mtd_set_ooblayout
Lloh72:
	adrp	x8, _BCH_ENABLE@GOTPAGE
Lloh73:
	ldr	x8, [x8, _BCH_ENABLE@GOTPAGEOFF]
Lloh74:
	ldr	w8, [x8]
	mov	x24, x20
	str	w8, [x24, #8]!
	ldr	w3, [x22, #20]
	sub	w9, w3, #4
	ror	w10, w9, #1
	cmp	w10, #6
	b.hi	LBB0_31
; %bb.24:
Lloh75:
	adrp	x9, _BCH_TVAL_4@GOTPAGE
Lloh76:
	ldr	x9, [x9, _BCH_TVAL_4@GOTPAGEOFF]
Lloh77:
	adrp	x11, lJTI0_0@PAGE
Lloh78:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_25
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_25:
Lloh79:
	adrp	x9, _BCH_TVAL_8@GOTPAGE
Lloh80:
	ldr	x9, [x9, _BCH_TVAL_8@GOTPAGEOFF]
	b	LBB0_35
LBB0_26:
	ldr	w0, [x19, #8]
Lloh81:
	adrp	x1, l_.str.4@PAGE
Lloh82:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_8
LBB0_27:
	ldr	w0, [x19, #8]
	ldr	w8, [x22, #60]
	str	x8, [sp]
Lloh83:
	adrp	x1, l_.str.2@PAGE
Lloh84:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_10
LBB0_28:
Lloh85:
	adrp	x9, _CONFIG_TVAL_4@GOTPAGE
Lloh86:
	ldr	x9, [x9, _CONFIG_TVAL_4@GOTPAGEOFF]
	b	LBB0_35
LBB0_29:
Lloh87:
	adrp	x9, _CONFIG_TVAL_8@GOTPAGE
Lloh88:
	ldr	x9, [x9, _CONFIG_TVAL_8@GOTPAGEOFF]
	b	LBB0_35
LBB0_30:
	ldr	w0, [x19, #8]
                                        ; kill: def $w3 killed $w3 killed $x3 def $x3
	b	LBB0_32
LBB0_31:
	ldr	w0, [x19, #8]
LBB0_32:
	str	x3, [sp]
Lloh89:
	adrp	x1, l_.str.3@PAGE
Lloh90:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_33:
Lloh91:
	adrp	x9, _BCH_TVAL_14@GOTPAGE
Lloh92:
	ldr	x9, [x9, _BCH_TVAL_14@GOTPAGEOFF]
	b	LBB0_35
LBB0_34:
Lloh93:
	adrp	x9, _BCH_TVAL_16@GOTPAGE
Lloh94:
	ldr	x9, [x9, _BCH_TVAL_16@GOTPAGEOFF]
LBB0_35:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x24]
	mul	w23, w23, w25
	ldr	w0, [x19, #8]
	ldr	w8, [x22, #16]
Lloh95:
	adrp	x9, l_.str.7@PAGE
Lloh96:
	add	x9, x9, l_.str.7@PAGEOFF
Lloh97:
	adrp	x10, l_.str.6@PAGE
Lloh98:
	add	x10, x10, l_.str.6@PAGEOFF
	cmp	w8, #129
	csel	x2, x10, x9, eq
Lloh99:
	adrp	x1, l_.str.5@PAGE
Lloh100:
	add	x1, x1, l_.str.5@PAGEOFF
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_dev_info
Lloh101:
	adrp	x8, _BITS_PER_BYTE@GOTPAGE
Lloh102:
	ldr	x8, [x8, _BITS_PER_BYTE@GOTPAGEOFF]
Lloh103:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_DIV_ROUND_UP
	str	w0, [x22, #24]
	ldr	w8, [x21]
	cmp	w8, #1023
	b.le	LBB0_40
; %bb.36:
	cmp	w8, #1024
	b.eq	LBB0_43
; %bb.37:
	cmp	w8, #2048
	b.eq	LBB0_44
; %bb.38:
	cmp	w8, #1, lsl #12                 ; =4096
	b.ne	LBB0_47
; %bb.39:
Lloh104:
	adrp	x8, _CONFIG_PS_4096@GOTPAGE
Lloh105:
	ldr	x8, [x8, _CONFIG_PS_4096@GOTPAGEOFF]
	b	LBB0_46
LBB0_40:
	cmp	w8, #256
	b.eq	LBB0_45
; %bb.41:
	cmp	w8, #512
	b.ne	LBB0_47
; %bb.42:
Lloh106:
	adrp	x8, _CONFIG_PS_512@GOTPAGE
Lloh107:
	ldr	x8, [x8, _CONFIG_PS_512@GOTPAGEOFF]
	b	LBB0_46
LBB0_43:
Lloh108:
	adrp	x8, _CONFIG_PS_1024@GOTPAGE
Lloh109:
	ldr	x8, [x8, _CONFIG_PS_1024@GOTPAGEOFF]
	b	LBB0_46
LBB0_44:
Lloh110:
	adrp	x8, _CONFIG_PS_2048@GOTPAGE
Lloh111:
	ldr	x8, [x8, _CONFIG_PS_2048@GOTPAGEOFF]
	b	LBB0_46
LBB0_45:
Lloh112:
	adrp	x8, _CONFIG_PS_256@GOTPAGE
Lloh113:
	ldr	x8, [x8, _CONFIG_PS_256@GOTPAGEOFF]
LBB0_46:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	ldr	w9, [x20, #4]
	orr	w8, w9, w8
	str	w8, [x20, #4]
	ldr	x8, [x21, #8]
	sub	x0, x8, #1
	bl	_CONFIG_TAG_BYTE_SIZE
	ldr	w8, [x20]
	orr	w0, w8, w0
	str	w0, [x20]
	ldr	x8, [x19]
Lloh114:
	adrp	x9, _CONFIG@GOTPAGE
Lloh115:
	ldr	x9, [x9, _CONFIG@GOTPAGEOFF]
Lloh116:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel_relaxed
	mov	w23, #0
	b	LBB0_10
LBB0_47:
	ldr	w0, [x19, #8]
	str	x8, [sp]
Lloh117:
	adrp	x1, l_.str.8@PAGE
Lloh118:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_dev_err
Lloh119:
	adrp	x8, _ENODEV@GOTPAGE
Lloh120:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh61
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh60
	.loh AdrpLdrGot	Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGot	Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh72, Lloh73, Lloh74
	.loh AdrpLdrGot	Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpAdd	Lloh77, Lloh78
	.loh AdrpLdrGot	Lloh75, Lloh76
	.loh AdrpLdrGot	Lloh79, Lloh80
	.loh AdrpAdd	Lloh81, Lloh82
	.loh AdrpAdd	Lloh83, Lloh84
	.loh AdrpLdrGot	Lloh85, Lloh86
	.loh AdrpLdrGot	Lloh87, Lloh88
	.loh AdrpAdd	Lloh89, Lloh90
	.loh AdrpLdrGot	Lloh91, Lloh92
	.loh AdrpLdrGot	Lloh93, Lloh94
	.loh AdrpLdrGotLdr	Lloh101, Lloh102, Lloh103
	.loh AdrpAdd	Lloh99, Lloh100
	.loh AdrpAdd	Lloh97, Lloh98
	.loh AdrpAdd	Lloh95, Lloh96
	.loh AdrpLdrGot	Lloh104, Lloh105
	.loh AdrpLdrGot	Lloh106, Lloh107
	.loh AdrpLdrGot	Lloh108, Lloh109
	.loh AdrpLdrGot	Lloh110, Lloh111
	.loh AdrpLdrGot	Lloh112, Lloh113
	.loh AdrpLdrGotLdr	Lloh114, Lloh115, Lloh116
	.loh AdrpLdrGot	Lloh119, Lloh120
	.loh AdrpAdd	Lloh117, Lloh118
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_35-LBB0_25)>>2
	.byte	(LBB0_31-LBB0_25)>>2
	.byte	(LBB0_25-LBB0_25)>>2
	.byte	(LBB0_31-LBB0_25)>>2
	.byte	(LBB0_31-LBB0_25)>>2
	.byte	(LBB0_33-LBB0_25)>>2
	.byte	(LBB0_34-LBB0_25)>>2
                                        ; -- End function
	.comm	_NAND_BBT_USE_FLASH,4,2         ; @NAND_BBT_USE_FLASH
	.comm	_NAND_BBT_NO_OOB,4,2            ; @NAND_BBT_NO_OOB
	.comm	_NAND_ECC_HW,4,2                ; @NAND_ECC_HW
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported step size %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_tegra_nand_read_page_hwecc,4,2 ; @tegra_nand_read_page_hwecc
	.comm	_tegra_nand_write_page_hwecc,4,2 ; @tegra_nand_write_page_hwecc
	.comm	_tegra_nand_read_page_raw,4,2   ; @tegra_nand_read_page_raw
	.comm	_tegra_nand_write_page_raw,4,2  ; @tegra_nand_write_page_raw
	.comm	_tegra_nand_read_oob,4,2        ; @tegra_nand_read_oob
	.comm	_tegra_nand_write_oob,4,2       ; @tegra_nand_write_oob
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_CONFIG_BUS_WIDTH_16,4,2        ; @CONFIG_BUS_WIDTH_16
	.comm	_NAND_ECC_UNKNOWN,4,2           ; @NAND_ECC_UNKNOWN
l_.str.1:                               ; @.str.1
	.asciz	"BCH supports 2K or 4K page size only\n"

l_.str.2:                               ; @.str.2
	.asciz	"No valid strength found, minimum %d\n"

	.comm	_CONFIG_PIPE_EN,4,2             ; @CONFIG_PIPE_EN
	.comm	_CONFIG_SKIP_SPARE,4,2          ; @CONFIG_SKIP_SPARE
	.comm	_CONFIG_SKIP_SPARE_SIZE_4,4,2   ; @CONFIG_SKIP_SPARE_SIZE_4
	.comm	_BITS_PER_STEP_RS,4,2           ; @BITS_PER_STEP_RS
	.comm	_tegra_nand_oob_rs_ops,4,2      ; @tegra_nand_oob_rs_ops
	.comm	_CONFIG_HW_ECC,4,2              ; @CONFIG_HW_ECC
	.comm	_CONFIG_ECC_SEL,4,2             ; @CONFIG_ECC_SEL
	.comm	_CONFIG_ERR_COR,4,2             ; @CONFIG_ERR_COR
	.comm	_CONFIG_TVAL_4,4,2              ; @CONFIG_TVAL_4
	.comm	_CONFIG_TVAL_6,4,2              ; @CONFIG_TVAL_6
	.comm	_CONFIG_TVAL_8,4,2              ; @CONFIG_TVAL_8
l_.str.3:                               ; @.str.3
	.asciz	"ECC strength %d not supported\n"

	.comm	_BITS_PER_STEP_BCH,4,2          ; @BITS_PER_STEP_BCH
	.comm	_tegra_nand_oob_bch_ops,4,2     ; @tegra_nand_oob_bch_ops
	.comm	_BCH_ENABLE,4,2                 ; @BCH_ENABLE
	.comm	_BCH_TVAL_4,4,2                 ; @BCH_TVAL_4
	.comm	_BCH_TVAL_8,4,2                 ; @BCH_TVAL_8
	.comm	_BCH_TVAL_14,4,2                ; @BCH_TVAL_14
	.comm	_BCH_TVAL_16,4,2                ; @BCH_TVAL_16
l_.str.4:                               ; @.str.4
	.asciz	"ECC algorithm not supported\n"

l_.str.5:                               ; @.str.5
	.asciz	"Using %s with strength %d per 512 byte step\n"

l_.str.6:                               ; @.str.6
	.asciz	"BCH"

l_.str.7:                               ; @.str.7
	.asciz	"RS"

	.comm	_BITS_PER_BYTE,4,2              ; @BITS_PER_BYTE
	.comm	_CONFIG_PS_256,4,2              ; @CONFIG_PS_256
	.comm	_CONFIG_PS_512,4,2              ; @CONFIG_PS_512
	.comm	_CONFIG_PS_1024,4,2             ; @CONFIG_PS_1024
	.comm	_CONFIG_PS_2048,4,2             ; @CONFIG_PS_2048
	.comm	_CONFIG_PS_4096,4,2             ; @CONFIG_PS_4096
l_.str.8:                               ; @.str.8
	.asciz	"Unsupported writesize %d\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_CONFIG,8,3                     ; @CONFIG
	.no_dead_strip	_tegra_nand_attach_chip
.subsections_via_symbols
