	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function chip_init
_chip_init:                             ## @chip_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, %r13
	movq	%rdi, %rbx
	callq	_dev_get_drvdata
	movq	%rax, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$104, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_of_property_count_u32_elems
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_13
## %bb.4:
	cmpl	$1, %r15d
	jne	LBB0_5
## %bb.6:
	leaq	L_.str(%rip), %rsi
	leaq	-44(%rbp), %rcx
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_of_property_read_u32_index
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:
	movl	-44(%rbp), %eax
	movq	_MAX_CS@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jge	LBB0_8
## %bb.9:
	movq	%r12, %r15
	addq	$40, %r15
	movq	%r15, %rdi
	callq	_nand_to_mtd
	movq	_tango_read_byte@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 76(%r12)
	movq	_tango_write_buf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 72(%r12)
	movq	_tango_read_buf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 68(%r12)
	movq	_tango_select_chip@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 64(%r12)
	movq	_tango_cmd_ctrl@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 60(%r12)
	movq	_tango_dev_ready@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 56(%r12)
	movq	_NAND_USE_BOUNCE_BUFFER@GOTPCREL(%rip), %rcx
	movq	_NAND_NO_SUBPAGE_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_NAND_WAIT_TCCS@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movl	%edx, 40(%r12)
	movq	%r14, %rax
	addq	$16, %rax
	movq	%rax, 48(%r12)
	movslq	-44(%rbp), %rax
	shlq	$8, %rax
	addq	8(%r14), %rax
	movq	%rax, 32(%r12)
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r15, %r13
	callq	_nand_set_flash_node
	movq	_tango_nand_ooblayout_ops@GOTPCREL(%rip), %rsi
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	callq	_mtd_set_ooblayout
	movq	%rbx, 8(%r15)
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_nand_scan
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.10:
	movl	-44(%rbp), %edi
	movl	96(%r12), %edx
	movq	_METADATA_SIZE@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rcx
	movl	$1, %esi
	callq	_XFER_CFG
	movl	%eax, 24(%r12)
	movq	(%rbx), %rdi
	addq	88(%r12), %rdi
	movl	80(%r12), %esi
	callq	_PKT_CFG
	movq	%rax, 16(%r12)
	movq	88(%r12), %rdi
	movl	80(%r12), %esi
	callq	_PKT_CFG
	movq	%rax, 8(%r12)
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	movq	_BBM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_BB_CFG
	movl	%eax, (%r12)
	xorl	%r15d, %r15d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_nand_cleanup
	movl	%ebx, %r15d
	jmp	LBB0_13
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	_ENOTSUPP@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_13:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_12:
	movq	(%r14), %rax
	movslq	-44(%rbp), %rcx
	movq	%r12, (%rax,%rcx,8)
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"reg"

	.comm	_ENOTSUPP,4,2                   ## @ENOTSUPP
	.comm	_MAX_CS,4,2                     ## @MAX_CS
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_tango_read_byte,4,2            ## @tango_read_byte
	.comm	_tango_write_buf,4,2            ## @tango_write_buf
	.comm	_tango_read_buf,4,2             ## @tango_read_buf
	.comm	_tango_select_chip,4,2          ## @tango_select_chip
	.comm	_tango_cmd_ctrl,4,2             ## @tango_cmd_ctrl
	.comm	_tango_dev_ready,4,2            ## @tango_dev_ready
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ## @NAND_USE_BOUNCE_BUFFER
	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ## @NAND_NO_SUBPAGE_WRITE
	.comm	_NAND_WAIT_TCCS,4,2             ## @NAND_WAIT_TCCS
	.comm	_tango_nand_ooblayout_ops,4,2   ## @tango_nand_ooblayout_ops
	.comm	_METADATA_SIZE,8,3              ## @METADATA_SIZE
	.comm	_BBM_SIZE,4,2                   ## @BBM_SIZE
	.no_dead_strip	_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function chip_init
_chip_init:                             ; @chip_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	x24, x1
	mov	x22, x0
	bl	_dev_get_drvdata
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #104
	bl	_devm_kzalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	bl	_of_property_count_u32_elems
	mov	x25, x0
	tbnz	w0, #31, LBB0_11
; %bb.2:
	cmp	w25, #1
	b.ne	LBB0_9
; %bb.3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	add	x3, sp, #12
	mov	x0, x24
	mov	w2, #0
	bl	_of_property_read_u32_index
	mov	x25, x0
	cbnz	w0, LBB0_11
; %bb.4:
	ldr	w8, [sp, #12]
Lloh7:
	adrp	x9, _MAX_CS@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MAX_CS@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_12
; %bb.5:
	add	x21, x20, #40
	mov	x0, x21
	bl	_nand_to_mtd
	mov	x23, x0
Lloh10:
	adrp	x8, _tango_read_byte@GOTPAGE
Lloh11:
	ldr	x8, [x8, _tango_read_byte@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _tango_write_buf@GOTPAGE
Lloh14:
	ldr	x9, [x9, _tango_write_buf@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #72]
Lloh16:
	adrp	x8, _tango_read_buf@GOTPAGE
Lloh17:
	ldr	x8, [x8, _tango_read_buf@GOTPAGEOFF]
Lloh18:
	adrp	x9, _tango_select_chip@GOTPAGE
Lloh19:
	ldr	x9, [x9, _tango_select_chip@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #64]
Lloh22:
	adrp	x8, _tango_cmd_ctrl@GOTPAGE
Lloh23:
	ldr	x8, [x8, _tango_cmd_ctrl@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _tango_dev_ready@GOTPAGE
Lloh26:
	ldr	x9, [x9, _tango_dev_ready@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	stp	w9, w8, [x20, #56]
Lloh28:
	adrp	x8, _NAND_USE_BOUNCE_BUFFER@GOTPAGE
Lloh29:
	ldr	x8, [x8, _NAND_USE_BOUNCE_BUFFER@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	adrp	x9, _NAND_NO_SUBPAGE_WRITE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _NAND_NO_SUBPAGE_WRITE@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh34:
	adrp	x9, _NAND_WAIT_TCCS@GOTPAGE
Lloh35:
	ldr	x9, [x9, _NAND_WAIT_TCCS@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [x20, #40]
	add	x8, x19, #16
	str	x8, [x20, #48]
	ldr	x8, [x19, #8]
	ldrsw	x9, [sp, #12]
	add	x8, x8, x9, lsl #8
	str	x8, [x20, #32]
	mov	x0, x21
	mov	x1, x24
	bl	_nand_set_flash_node
Lloh37:
	adrp	x1, _tango_nand_ooblayout_ops@GOTPAGE
Lloh38:
	ldr	x1, [x1, _tango_nand_ooblayout_ops@GOTPAGEOFF]
	mov	x0, x23
	bl	_mtd_set_ooblayout
	str	x22, [x23, #8]
	mov	x0, x21
	mov	w1, #1
	bl	_nand_scan
	mov	x25, x0
	cbnz	w0, LBB0_11
; %bb.6:
	ldr	w0, [sp, #12]
	ldr	w2, [x20, #96]
Lloh39:
	adrp	x22, _METADATA_SIZE@GOTPAGE
Lloh40:
	ldr	x22, [x22, _METADATA_SIZE@GOTPAGEOFF]
	ldr	x3, [x22]
	mov	w1, #1
	bl	_XFER_CFG
	str	w0, [x20, #24]
	ldr	x8, [x20, #88]
	ldr	x9, [x22]
	add	x0, x9, x8
	ldr	w1, [x20, #80]
	bl	_PKT_CFG
	str	x0, [x20, #16]
	ldr	x0, [x20, #88]
	ldr	w1, [x20, #80]
	bl	_PKT_CFG
	str	x0, [x20, #8]
	ldr	w0, [x23]
Lloh41:
	adrp	x8, _BBM_SIZE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _BBM_SIZE@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	bl	_BB_CFG
	str	w0, [x20]
	mov	x0, x23
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
	mov	x25, x0
	cbz	w0, LBB0_13
; %bb.7:
	mov	x0, x21
	bl	_nand_cleanup
	b	LBB0_11
LBB0_8:
Lloh44:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh45:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:
Lloh46:
	adrp	x8, _ENOTSUPP@GOTPAGE
Lloh47:
	ldr	x8, [x8, _ENOTSUPP@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_11:
	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_12:
Lloh48:
	adrp	x8, _EINVAL@GOTPAGE
Lloh49:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_10
LBB0_13:
	ldr	x8, [x19]
	ldrsw	x9, [sp, #12]
	str	x20, [x8, x9, lsl #3]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"reg"

	.comm	_ENOTSUPP,4,2                   ; @ENOTSUPP
	.comm	_MAX_CS,4,2                     ; @MAX_CS
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_tango_read_byte,4,2            ; @tango_read_byte
	.comm	_tango_write_buf,4,2            ; @tango_write_buf
	.comm	_tango_read_buf,4,2             ; @tango_read_buf
	.comm	_tango_select_chip,4,2          ; @tango_select_chip
	.comm	_tango_cmd_ctrl,4,2             ; @tango_cmd_ctrl
	.comm	_tango_dev_ready,4,2            ; @tango_dev_ready
	.comm	_NAND_USE_BOUNCE_BUFFER,4,2     ; @NAND_USE_BOUNCE_BUFFER
	.comm	_NAND_NO_SUBPAGE_WRITE,4,2      ; @NAND_NO_SUBPAGE_WRITE
	.comm	_NAND_WAIT_TCCS,4,2             ; @NAND_WAIT_TCCS
	.comm	_tango_nand_ooblayout_ops,4,2   ; @tango_nand_ooblayout_ops
	.comm	_METADATA_SIZE,8,3              ; @METADATA_SIZE
	.comm	_BBM_SIZE,4,2                   ; @BBM_SIZE
	.no_dead_strip	_chip_init
.subsections_via_symbols
