	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function marvell_nand_attach_chip
_marvell_nand_attach_chip:              ## @marvell_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_marvell_nand
	movq	%rax, %r12
	movl	40(%rbx), %edi
	callq	_to_marvell_nfc
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax), %edi
	callq	_dev_get_platdata
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	cmpq	$0, 8(%r13)
	je	LBB0_3
## %bb.2:
	movq	_NAND_BBT_USE_FLASH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_3:
	movl	(%rbx), %eax
	movq	_NAND_BBT_USE_FLASH@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	_NAND_BBT_NO_OOB_BBM@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	movq	_bbt_main_descr@GOTPCREL(%rip), %rax
	movq	%rax, 32(%rbx)
	movq	_bbt_mirror_descr@GOTPCREL(%rip), %rax
	movq	%rax, 24(%rbx)
LBB0_5:
	movl	(%r14), %edi
	callq	_NDCR_PAGE_SZ
	movl	%eax, (%r12)
	movl	4(%rbx), %ecx
	movq	_NAND_BUSWIDTH_16@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_7
## %bb.6:
	movq	_NDCR_DWIDTH_M@GOTPCREL(%rip), %rdx
	movq	_NDCR_DWIDTH_C@GOTPCREL(%rip), %rsi
	movl	(%rdx), %edx
	orl	%eax, %edx
	orl	(%rsi), %edx
	movl	%edx, (%r12)
	movl	%edx, %eax
LBB0_7:
	movl	$1, %edx
	cmpl	$513, (%r14)                    ## imm = 0x201
	jl	LBB0_9
## %bb.8:
	movq	_NDCR_RA_START@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, (%r12)
	movl	$2, %edx
LBB0_9:
	movq	_NAND_ROW_ADDR_3@GOTPCREL(%rip), %rax
	andl	(%rax), %ecx
	cmpl	$1, %ecx
	sbbl	$0, %edx
	addl	$3, %edx
	movl	%edx, 4(%r12)
	testq	%r13, %r13
	je	LBB0_11
## %bb.10:
	movl	4(%r13), %eax
	movl	%eax, 20(%rbx)
	movl	(%r13), %eax
	movl	%eax, 16(%rbx)
LBB0_11:
	leaq	8(%rbx), %r15
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_marvell_nand_ecc_init
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %r14d
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_21
LBB0_13:
	movq	%r14, %rdx
	movq	(%r15), %rax
	movq	_NAND_ECC_HW@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.14:
	movq	_NAND_NO_SUBPAGE_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%rbx)
LBB0_15:
	testq	%r13, %r13
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jne	LBB0_17
## %bb.16:
	movq	8(%rcx), %rax
	cmpq	$0, (%rax)
	je	LBB0_18
LBB0_17:
	leaq	L_.str.1(%rip), %rax
	movq	%rax, 8(%rdx)
	xorl	%r14d, %r14d
LBB0_21:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	xorl	%r14d, %r14d
	cmpq	$0, 8(%rdx)
	jne	LBB0_21
## %bb.19:
	movq	%rdx, %rbx
	movl	(%rcx), %r13d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r13d, %edi
	callq	_dev_name
	movq	8(%r12), %rcx
	movl	(%rcx), %r8d
	leaq	L_.str.2(%rip), %rdx
	movl	%r13d, %edi
	movl	%r15d, %esi
	movl	%eax, %ecx
	callq	_devm_kasprintf
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	jne	LBB0_21
## %bb.20:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_21
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_BBT_USE_FLASH,4,2         ## @NAND_BBT_USE_FLASH
	.comm	_NAND_BBT_NO_OOB_BBM,4,2        ## @NAND_BBT_NO_OOB_BBM
	.comm	_bbt_main_descr,4,2             ## @bbt_main_descr
	.comm	_bbt_mirror_descr,4,2           ## @bbt_mirror_descr
	.comm	_NAND_BUSWIDTH_16,4,2           ## @NAND_BUSWIDTH_16
	.comm	_NDCR_DWIDTH_M,4,2              ## @NDCR_DWIDTH_M
	.comm	_NDCR_DWIDTH_C,4,2              ## @NDCR_DWIDTH_C
	.comm	_NDCR_RA_START,4,2              ## @NDCR_RA_START
	.comm	_NAND_ROW_ADDR_3,4,2            ## @NAND_ROW_ADDR_3
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ECC init failed: %d\n"

	.comm	_NAND_ECC_HW,8,3                ## @NAND_ECC_HW
	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ## @NAND_NO_SUBPAGE_WRITE
L_.str.1:                               ## @.str.1
	.asciz	"pxa3xx_nand-0"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
L_.str.2:                               ## @.str.2
	.asciz	"%s:nand.%d"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate mtd->name\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_marvell_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 marvell_nand_attach_chip
_marvell_nand_attach_chip:              ; @marvell_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
	bl	_nand_to_mtd
	mov	x19, x0
	mov	x0, x22
	bl	_to_marvell_nand
	mov	x21, x0
	ldr	w0, [x22, #40]
	bl	_to_marvell_nfc
	mov	x20, x0
	ldr	w0, [x0]
	bl	_dev_get_platdata
	mov	x23, x0
Lloh0:
	adrp	x8, _NAND_BBT_USE_FLASH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_BBT_USE_FLASH@GOTPAGEOFF]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x9, [x23, #8]
	cbz	x9, LBB0_3
; %bb.2:
	ldr	w9, [x8]
	ldr	w10, [x22]
	orr	w9, w10, w9
	str	w9, [x22]
LBB0_3:
	ldr	w9, [x22]
	ldr	w8, [x8]
	tst	w8, w9
	b.eq	LBB0_5
; %bb.4:
Lloh2:
	adrp	x8, _NAND_BBT_NO_OOB_BBM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NAND_BBT_NO_OOB_BBM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w8, w8, w9
	str	w8, [x22]
Lloh5:
	adrp	x8, _bbt_main_descr@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bbt_main_descr@GOTPAGEOFF]
Lloh7:
	adrp	x9, _bbt_mirror_descr@GOTPAGE
Lloh8:
	ldr	x9, [x9, _bbt_mirror_descr@GOTPAGEOFF]
	stp	x9, x8, [x22, #24]
LBB0_5:
	ldr	w0, [x19]
	bl	_NDCR_PAGE_SZ
	str	w0, [x21]
	ldr	w8, [x22, #4]
Lloh9:
	adrp	x9, _NAND_BUSWIDTH_16@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NAND_BUSWIDTH_16@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh12:
	adrp	x9, _NDCR_DWIDTH_M@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NDCR_DWIDTH_M@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _NDCR_DWIDTH_C@GOTPAGE
Lloh16:
	ldr	x10, [x10, _NDCR_DWIDTH_C@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	orr	w9, w9, w0
	orr	w0, w9, w10
	str	w0, [x21]
LBB0_7:
	ldr	w9, [x19]
	cmp	w9, #513
	b.ge	LBB0_9
; %bb.8:
	mov	w9, #1
	b	LBB0_10
LBB0_9:
Lloh18:
	adrp	x9, _NDCR_RA_START@GOTPAGE
Lloh19:
	ldr	x9, [x9, _NDCR_RA_START@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w9, w0, w9
	str	w9, [x21]
	mov	w9, #2
LBB0_10:
Lloh21:
	adrp	x10, _NAND_ROW_ADDR_3@GOTPAGE
Lloh22:
	ldr	x10, [x10, _NAND_ROW_ADDR_3@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	tst	w10, w8
	mov	w8, #2
	cinc	w8, w8, ne
	add	w8, w9, w8
	str	w8, [x21, #4]
	cbz	x23, LBB0_12
; %bb.11:
	ldr	d0, [x23]
	str	d0, [x22, #16]
LBB0_12:
	add	x25, x22, #8
	mov	x0, x19
	mov	x1, x25
	bl	_marvell_nand_ecc_init
	cbz	w0, LBB0_14
; %bb.13:
	mov	x24, x0
	ldr	w0, [x20]
	str	x24, [sp]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_19
LBB0_14:
	ldr	x8, [x25]
Lloh26:
	adrp	x9, _NAND_ECC_HW@GOTPAGE
Lloh27:
	ldr	x9, [x9, _NAND_ECC_HW@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_16
; %bb.15:
Lloh29:
	adrp	x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	ldr	w9, [x22, #4]
	orr	w8, w9, w8
	str	w8, [x22, #4]
LBB0_16:
	cbnz	x23, LBB0_18
; %bb.17:
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	cbz	x8, LBB0_20
LBB0_18:
	mov	w24, #0
Lloh32:
	adrp	x8, l_.str.1@PAGE
Lloh33:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x19, #8]
LBB0_19:
	mov	x0, x24
	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_20:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_22
; %bb.21:
	ldr	w22, [x20]
Lloh34:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh35:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh36:
	ldr	w23, [x8]
	mov	x0, x22
	bl	_dev_name
	mov	x3, x0
	ldr	x8, [x21, #8]
	ldr	w4, [x8]
Lloh37:
	adrp	x2, l_.str.2@PAGE
Lloh38:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	x1, x23
	bl	_devm_kasprintf
	str	x0, [x19, #8]
	cbz	x0, LBB0_23
LBB0_22:
	mov	w24, #0
	b	LBB0_19
LBB0_23:
	ldr	w0, [x20]
Lloh39:
	adrp	x1, l_.str.3@PAGE
Lloh40:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
Lloh41:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh42:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_19
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_BBT_USE_FLASH,4,2         ; @NAND_BBT_USE_FLASH
	.comm	_NAND_BBT_NO_OOB_BBM,4,2        ; @NAND_BBT_NO_OOB_BBM
	.comm	_bbt_main_descr,4,2             ; @bbt_main_descr
	.comm	_bbt_mirror_descr,4,2           ; @bbt_mirror_descr
	.comm	_NAND_BUSWIDTH_16,4,2           ; @NAND_BUSWIDTH_16
	.comm	_NDCR_DWIDTH_M,4,2              ; @NDCR_DWIDTH_M
	.comm	_NDCR_DWIDTH_C,4,2              ; @NDCR_DWIDTH_C
	.comm	_NDCR_RA_START,4,2              ; @NDCR_RA_START
	.comm	_NAND_ROW_ADDR_3,4,2            ; @NAND_ROW_ADDR_3
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ECC init failed: %d\n"

	.comm	_NAND_ECC_HW,8,3                ; @NAND_ECC_HW
	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ; @NAND_NO_SUBPAGE_WRITE
l_.str.1:                               ; @.str.1
	.asciz	"pxa3xx_nand-0"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
l_.str.2:                               ; @.str.2
	.asciz	"%s:nand.%d"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate mtd->name\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_marvell_nand_attach_chip
.subsections_via_symbols
