	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s3c2410_nand_attach_chip
_s3c2410_nand_attach_chip:              ## @s3c2410_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_nand_to_mtd
	movq	%rax, %rdi
	callq	_s3c2410_nand_mtd_toinfo
	movq	%rax, %r14
	movl	16(%rbx), %eax
	cmpl	$133, %eax
	je	LBB0_5
## %bb.1:
	cmpl	$132, %eax
	je	LBB0_2
## %bb.3:
	cmpl	$131, %eax
	jne	LBB0_14
## %bb.4:
	movq	_NAND_ECC_HAMMING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%rbx)
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_17
LBB0_5:
	movq	_s3c2410_nand_calculate_ecc@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 32(%rbx)
	movq	_s3c2410_nand_correct_data@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movl	$1, 20(%rbx)
	movl	4(%r14), %eax
	cmpl	$128, %eax
	je	LBB0_10
## %bb.6:
	cmpl	$129, %eax
	je	LBB0_9
## %bb.7:
	cmpl	$130, %eax
	jne	LBB0_12
## %bb.8:
	movq	_s3c2410_nand_enable_hwecc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_17
LBB0_14:
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_19
LBB0_10:
	movq	_s3c2440_nand_enable_hwecc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_s3c2440_nand_calculate_ecc@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_9:
	movq	_s3c2412_nand_enable_hwecc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_s3c2412_nand_calculate_ecc@GOTPCREL(%rip), %rax
LBB0_11:
	movq	(%rax), %rax
	movq	%rax, 32(%rbx)
LBB0_12:
	movl	(%r14), %edi
	movl	(%rbx), %ecx
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdx
	callq	_dev_dbg
	cmpl	$11, (%rbx)
	jl	LBB0_15
## %bb.13:
	movabsq	$12884902144, %rax              ## imm = 0x300000100
	movq	%rax, 24(%rbx)
	jmp	LBB0_16
LBB0_15:
	movabsq	$12884902400, %rax              ## imm = 0x300000200
	movq	%rax, 24(%rbx)
	movq	%rbx, %rdi
	callq	_nand_to_mtd
	movq	_s3c2410_ooblayout_ops@GOTPCREL(%rip), %rsi
	movq	%rax, %rdi
	callq	_mtd_set_ooblayout
LBB0_16:
	leaq	L_.str.3(%rip), %rsi
LBB0_17:
	movl	(%r14), %edi
	callq	_dev_info
	movq	_NAND_BBT_USE_FLASH@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%eax, %eax
	testl	%ecx, 4(%rbx)
	je	LBB0_19
## %bb.18:
	movq	_NAND_SKIP_BBTSCAN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, 8(%rbx)
LBB0_19:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ECC disabled\n"

	.comm	_NAND_ECC_HAMMING,4,2           ## @NAND_ECC_HAMMING
L_.str.1:                               ## @.str.1
	.asciz	"soft ECC\n"

	.comm	_s3c2410_nand_calculate_ecc,8,3 ## @s3c2410_nand_calculate_ecc
	.comm	_s3c2410_nand_correct_data,4,2  ## @s3c2410_nand_correct_data
	.comm	_s3c2410_nand_enable_hwecc,4,2  ## @s3c2410_nand_enable_hwecc
	.comm	_s3c2412_nand_enable_hwecc,4,2  ## @s3c2412_nand_enable_hwecc
	.comm	_s3c2412_nand_calculate_ecc,8,3 ## @s3c2412_nand_calculate_ecc
	.comm	_s3c2440_nand_enable_hwecc,4,2  ## @s3c2440_nand_enable_hwecc
	.comm	_s3c2440_nand_calculate_ecc,8,3 ## @s3c2440_nand_calculate_ecc
L_.str.2:                               ## @.str.2
	.asciz	"chip %p => page shift %d\n"

	.comm	_s3c2410_ooblayout_ops,4,2      ## @s3c2410_ooblayout_ops
L_.str.3:                               ## @.str.3
	.asciz	"hardware ECC\n"

L_.str.4:                               ## @.str.4
	.asciz	"invalid ECC mode!\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NAND_BBT_USE_FLASH,4,2         ## @NAND_BBT_USE_FLASH
	.comm	_NAND_SKIP_BBTSCAN,4,2          ## @NAND_SKIP_BBTSCAN
	.no_dead_strip	_s3c2410_nand_attach_chip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function s3c2410_nand_attach_chip
lCPI0_0:
	.long	512                             ; 0x200
	.long	3                               ; 0x3
lCPI0_1:
	.long	256                             ; 0x100
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_s3c2410_nand_attach_chip:              ; @s3c2410_nand_attach_chip
	.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, x0
	bl	_nand_to_mtd
	bl	_s3c2410_nand_mtd_toinfo
	mov	x20, x0
	ldr	w8, [x19, #16]
	cmp	w8, #133
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #132
	b.eq	LBB0_8
; %bb.2:
	cmp	w8, #131
	b.ne	LBB0_9
; %bb.3:
Lloh0:
	adrp	x8, _NAND_ECC_HAMMING@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_ECC_HAMMING@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x19, #48]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_4:
Lloh5:
	adrp	x8, _s3c2410_nand_calculate_ecc@GOTPAGE
Lloh6:
	ldr	x8, [x8, _s3c2410_nand_calculate_ecc@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	str	x8, [x19, #32]
Lloh8:
	adrp	x8, _s3c2410_nand_correct_data@GOTPAGE
Lloh9:
	ldr	x8, [x8, _s3c2410_nand_correct_data@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w8, [x19, #44]
	mov	w8, #1
	str	w8, [x19, #20]
	ldr	w8, [x20, #4]
	cmp	w8, #128
	b.eq	LBB0_10
; %bb.5:
	cmp	w8, #129
	b.eq	LBB0_11
; %bb.6:
	cmp	w8, #130
	b.ne	LBB0_13
; %bb.7:
Lloh11:
	adrp	x8, _s3c2410_nand_enable_hwecc@GOTPAGE
Lloh12:
	ldr	x8, [x8, _s3c2410_nand_enable_hwecc@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19, #40]
	b	LBB0_13
LBB0_8:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_17
LBB0_9:
	ldr	w0, [x20]
Lloh16:
	adrp	x1, l_.str.4@PAGE
Lloh17:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
Lloh18:
	adrp	x8, _EINVAL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_20
LBB0_10:
Lloh21:
	adrp	x8, _s3c2440_nand_enable_hwecc@GOTPAGE
Lloh22:
	ldr	x8, [x8, _s3c2440_nand_enable_hwecc@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh24:
	adrp	x8, _s3c2440_nand_calculate_ecc@GOTPAGE
Lloh25:
	ldr	x8, [x8, _s3c2440_nand_calculate_ecc@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh26:
	adrp	x8, _s3c2412_nand_enable_hwecc@GOTPAGE
Lloh27:
	ldr	x8, [x8, _s3c2412_nand_enable_hwecc@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh29:
	adrp	x8, _s3c2412_nand_calculate_ecc@GOTPAGE
Lloh30:
	ldr	x8, [x8, _s3c2412_nand_calculate_ecc@GOTPAGEOFF]
LBB0_12:
	ldr	x8, [x8]
	str	x8, [x19, #32]
LBB0_13:
	ldr	w0, [x20]
	ldr	w3, [x19]
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_dev_dbg
	ldr	w8, [x19]
	cmp	w8, #11
	b.lt	LBB0_15
; %bb.14:
Lloh33:
	adrp	x8, lCPI0_1@PAGE
Lloh34:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x19, #24]
	b	LBB0_16
LBB0_15:
Lloh35:
	adrp	x8, lCPI0_0@PAGE
Lloh36:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #24]
	mov	x0, x19
	bl	_nand_to_mtd
Lloh37:
	adrp	x1, _s3c2410_ooblayout_ops@GOTPAGE
Lloh38:
	ldr	x1, [x1, _s3c2410_ooblayout_ops@GOTPAGEOFF]
	bl	_mtd_set_ooblayout
LBB0_16:
Lloh39:
	adrp	x1, l_.str.3@PAGE
Lloh40:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_17:
	ldr	w0, [x20]
	bl	_dev_info
	ldr	w8, [x19, #4]
Lloh41:
	adrp	x9, _NAND_BBT_USE_FLASH@GOTPAGE
Lloh42:
	ldr	x9, [x9, _NAND_BBT_USE_FLASH@GOTPAGEOFF]
Lloh43:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_19
; %bb.18:
	mov	w0, #0
Lloh44:
	adrp	x8, _NAND_SKIP_BBTSCAN@GOTPAGE
Lloh45:
	ldr	x8, [x8, _NAND_SKIP_BBTSCAN@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
	str	w8, [x19, #8]
	b	LBB0_20
LBB0_19:
	mov	w0, #0
LBB0_20:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdr	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdr	Lloh35, Lloh36
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ECC disabled\n"

	.comm	_NAND_ECC_HAMMING,4,2           ; @NAND_ECC_HAMMING
l_.str.1:                               ; @.str.1
	.asciz	"soft ECC\n"

	.comm	_s3c2410_nand_calculate_ecc,8,3 ; @s3c2410_nand_calculate_ecc
	.comm	_s3c2410_nand_correct_data,4,2  ; @s3c2410_nand_correct_data
	.comm	_s3c2410_nand_enable_hwecc,4,2  ; @s3c2410_nand_enable_hwecc
	.comm	_s3c2412_nand_enable_hwecc,4,2  ; @s3c2412_nand_enable_hwecc
	.comm	_s3c2412_nand_calculate_ecc,8,3 ; @s3c2412_nand_calculate_ecc
	.comm	_s3c2440_nand_enable_hwecc,4,2  ; @s3c2440_nand_enable_hwecc
	.comm	_s3c2440_nand_calculate_ecc,8,3 ; @s3c2440_nand_calculate_ecc
l_.str.2:                               ; @.str.2
	.asciz	"chip %p => page shift %d\n"

	.comm	_s3c2410_ooblayout_ops,4,2      ; @s3c2410_ooblayout_ops
l_.str.3:                               ; @.str.3
	.asciz	"hardware ECC\n"

l_.str.4:                               ; @.str.4
	.asciz	"invalid ECC mode!\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NAND_BBT_USE_FLASH,4,2         ; @NAND_BBT_USE_FLASH
	.comm	_NAND_SKIP_BBTSCAN,4,2          ; @NAND_SKIP_BBTSCAN
	.no_dead_strip	_s3c2410_nand_attach_chip
.subsections_via_symbols
