	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tegra_nand_chips_init
_tegra_nand_chips_init:                 ## @tegra_nand_chips_init
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_of_get_child_count
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.1:
	xorl	%r13d, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_of_get_next_child
	movq	%rax, %r12
	leaq	L_.str.1(%rip), %rsi
	movq	%rax, %rdi
	movl	$4, %edx
	callq	_of_property_count_elems_of_size
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_of_property_read_u32
	testl	%eax, %eax
	je	LBB0_11
## %bb.3:
	movl	%eax, %r13d
	leaq	L_.str.3(%rip), %rsi
LBB0_4:
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_10
LBB0_6:
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
LBB0_8:
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %r13d
LBB0_10:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	$40, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	%rax, %rbx
	movl	-44(%rbp), %eax
	movq	32(%rbx), %rcx
	movl	%eax, (%rcx)
	movq	_GPIOD_OUT_LOW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	callq	_devm_gpiod_get_optional
	movl	%eax, 24(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movl	24(%rbx), %edi
	callq	_PTR_ERR
	movl	%eax, %r13d
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_4
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_9
LBB0_15:
	movq	%rbx, %r13
	addq	$8, %r13
	leaq	8(%r14), %rax
	movq	%rax, 16(%rbx)
	movq	%r13, %rdi
	callq	_nand_to_mtd
	movq	%r15, 16(%rax)
	movq	_THIS_MODULE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax)
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rax, %r12
	callq	_nand_set_flash_node
	cmpq	$0, (%r12)
	jne	LBB0_17
## %bb.16:
	leaq	L_.str.6(%rip), %rax
	movq	%rax, (%r12)
LBB0_17:
	movq	_NAND_NO_SUBPAGE_WRITE@GOTPCREL(%rip), %rax
	movq	_NAND_USE_BOUNCE_BUFFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, (%r13)
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_nand_scan
	movq	%r13, %rcx
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_10
## %bb.18:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_mtd_ooblayout_ecc
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
	testl	%eax, %eax
	je	LBB0_20
## %bb.19:
	movl	%eax, %r12d
	leaq	L_.str.7(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_nand_cleanup
	movl	%r12d, %r13d
	jmp	LBB0_10
LBB0_20:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r14)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Currently only one NAND chip supported\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"reg"

L_.str.2:                               ## @.str.2
	.asciz	"Missing/invalid reg property\n"

L_.str.3:                               ## @.str.3
	.asciz	"could not retrieve reg property: %d\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.4:                               ## @.str.4
	.asciz	"wp"

	.comm	_GPIOD_OUT_LOW,4,2              ## @GPIOD_OUT_LOW
L_.str.5:                               ## @.str.5
	.asciz	"Failed to request WP GPIO: %d\n"

	.comm	_THIS_MODULE,4,2                ## @THIS_MODULE
L_.str.6:                               ## @.str.6
	.asciz	"tegra_nand"

	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ## @NAND_NO_SUBPAGE_WRITE
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ## @NAND_USE_BOUNCE_BUFFER
L_.str.7:                               ## @.str.7
	.asciz	"Failed to register mtd device: %d\n"

	.no_dead_strip	_tegra_nand_chips_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tegra_nand_chips_init
_tegra_nand_chips_init:                 ; @tegra_nand_chips_init
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x0]
	mov	x0, x21
	bl	_of_get_child_count
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.1:
	mov	x0, x21
	mov	x1, #0
	bl	_of_get_next_child
	mov	x21, x0
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #4
	bl	_of_property_count_elems_of_size
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.2:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #12
	mov	x0, x21
	bl	_of_property_read_u32
	cbz	w0, LBB0_9
; %bb.3:
	mov	x25, x0
	str	x25, [sp]
Lloh4:
	adrp	x1, l_.str.3@PAGE
Lloh5:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_8
LBB0_4:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_8:
	mov	x0, x25
	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_9:
Lloh12:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #40
	bl	_devm_kzalloc
	cbz	x0, LBB0_12
; %bb.10:
	mov	x22, x0
	ldr	w8, [sp, #12]
	ldr	x9, [x0, #32]
	str	w8, [x9]
Lloh15:
	adrp	x8, _GPIOD_OUT_LOW@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GPIOD_OUT_LOW@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x1, l_.str.4@PAGE
Lloh19:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_devm_gpiod_get_optional
	str	w0, [x22, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_13
; %bb.11:
	ldr	w0, [x22, #24]
	bl	_PTR_ERR
	mov	x25, x0
	str	x25, [sp]
Lloh20:
	adrp	x1, l_.str.5@PAGE
Lloh21:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_dev_err
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	b	LBB0_8
LBB0_12:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_7
LBB0_13:
	add	x23, x22, #8
	add	x8, x20, #8
	str	x8, [x22, #16]
	mov	x0, x23
	bl	_nand_to_mtd
	mov	x24, x0
	str	x19, [x0, #16]
Lloh24:
	adrp	x8, _THIS_MODULE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _THIS_MODULE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	mov	x0, x23
	mov	x1, x21
	bl	_nand_set_flash_node
	ldr	x8, [x24]
	cbnz	x8, LBB0_15
; %bb.14:
Lloh27:
	adrp	x8, l_.str.6@PAGE
Lloh28:
	add	x8, x8, l_.str.6@PAGEOFF
	str	x8, [x24]
LBB0_15:
Lloh29:
	adrp	x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _NAND_NO_SUBPAGE_WRITE@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _NAND_USE_BOUNCE_BUFFER@GOTPAGE
Lloh33:
	ldr	x9, [x9, _NAND_USE_BOUNCE_BUFFER@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x23]
	mov	x0, x23
	mov	w1, #1
	bl	_nand_scan
	mov	x25, x0
	cbnz	w0, LBB0_8
; %bb.16:
	mov	x0, x24
	mov	w1, #0
	mov	x2, x22
	bl	_mtd_ooblayout_ecc
	mov	x0, x24
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
	mov	x25, x0
	cbz	w0, LBB0_18
; %bb.17:
	str	x25, [sp]
Lloh35:
	adrp	x1, l_.str.7@PAGE
Lloh36:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	mov	x0, x23
	bl	_nand_cleanup
                                        ; kill: def $w25 killed $w25 killed $x25 def $x25
	b	LBB0_8
LBB0_18:
	str	x23, [x20]
	b	LBB0_8
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Currently only one NAND chip supported\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"reg"

l_.str.2:                               ; @.str.2
	.asciz	"Missing/invalid reg property\n"

l_.str.3:                               ; @.str.3
	.asciz	"could not retrieve reg property: %d\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.4:                               ; @.str.4
	.asciz	"wp"

	.comm	_GPIOD_OUT_LOW,4,2              ; @GPIOD_OUT_LOW
l_.str.5:                               ; @.str.5
	.asciz	"Failed to request WP GPIO: %d\n"

	.comm	_THIS_MODULE,4,2                ; @THIS_MODULE
l_.str.6:                               ; @.str.6
	.asciz	"tegra_nand"

	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ; @NAND_NO_SUBPAGE_WRITE
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ; @NAND_USE_BOUNCE_BUFFER
l_.str.7:                               ; @.str.7
	.asciz	"Failed to register mtd device: %d\n"

	.no_dead_strip	_tegra_nand_chips_init
.subsections_via_symbols
