	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fun_chip_init
_fun_chip_init:                         ## @fun_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %rbx
	leaq	16(%rdi), %r15
	movq	%r15, %rdi
	callq	_nand_to_mtd
	movq	%rax, %r14
	movl	68(%rbx), %eax
	movl	%eax, 48(%rbx)
	movl	%eax, 44(%rbx)
	movq	_fun_cmd_ctrl@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movl	(%rbx), %eax
	movl	64(%rbx), %ecx
	movl	%ecx, 36(%rbx)
	movq	_fun_read_byte@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 32(%rbx)
	movq	_fun_read_buf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 28(%rbx)
	movq	_fun_write_buf@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 24(%rbx)
	movq	_NAND_ECC_SOFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 56(%rbx)
	movq	_NAND_ECC_HAMMING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 52(%rbx)
	cmpl	$2, %eax
	jl	LBB0_2
## %bb.1:
	movq	_fun_select_chip@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
LBB0_2:
	movq	8(%rbx), %rax
	cmpq	$0, (%rax)
	js	LBB0_4
## %bb.3:
	movq	_fun_chip_ready@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r15)
LBB0_4:
	movl	60(%rbx), %eax
	movl	%eax, 4(%r14)
	xorl	%r12d, %r12d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_of_get_next_child
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r13
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_nand_set_flash_node
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rcx
	callq	_kasprintf
	movl	%eax, (%r14)
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_nand_scan
	testl	%eax, %eax
	je	LBB0_11
## %bb.9:
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_of_node_put
	jmp	LBB0_10
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_14
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_12
LBB0_11:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
	movl	%eax, %r12d
LBB0_12:
	movq	%r13, %rdi
	callq	_of_node_put
	testl	%r12d, %r12d
	je	LBB0_13
LBB0_10:
	movl	(%r14), %edi
	callq	_kfree
	jmp	LBB0_14
LBB0_13:
	xorl	%r12d, %r12d
LBB0_14:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fun_cmd_ctrl,4,2               ## @fun_cmd_ctrl
	.comm	_fun_read_byte,4,2              ## @fun_read_byte
	.comm	_fun_read_buf,4,2               ## @fun_read_buf
	.comm	_fun_write_buf,4,2              ## @fun_write_buf
	.comm	_NAND_ECC_SOFT,4,2              ## @NAND_ECC_SOFT
	.comm	_NAND_ECC_HAMMING,4,2           ## @NAND_ECC_HAMMING
	.comm	_fun_select_chip,4,2            ## @fun_select_chip
	.comm	_fun_chip_ready,4,2             ## @fun_chip_ready
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"0x%llx.%pOFn"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_fun_chip_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fun_chip_init
_fun_chip_init:                         ; @fun_chip_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x22, x2
	mov	x23, x1
	mov	x21, x0
	add	x20, x0, #16
	mov	x0, x20
	bl	_nand_to_mtd
	mov	x19, x0
Lloh0:
	adrp	x8, _fun_cmd_ctrl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fun_cmd_ctrl@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldp	w10, w9, [x21, #64]
	stp	w8, w9, [x21, #40]
Lloh3:
	adrp	x8, _fun_read_byte@GOTPAGE
Lloh4:
	ldr	x8, [x8, _fun_read_byte@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x11, _fun_read_buf@GOTPAGE
Lloh7:
	ldr	x11, [x11, _fun_read_buf@GOTPAGEOFF]
	stp	w8, w10, [x21, #32]
Lloh8:
	ldr	w8, [x11]
Lloh9:
	adrp	x10, _fun_write_buf@GOTPAGE
Lloh10:
	ldr	x10, [x10, _fun_write_buf@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	stp	w10, w8, [x21, #24]
Lloh12:
	adrp	x8, _NAND_ECC_SOFT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NAND_ECC_SOFT@GOTPAGEOFF]
Lloh14:
	ldr	w11, [x8]
Lloh15:
	adrp	x10, _NAND_ECC_HAMMING@GOTPAGE
Lloh16:
	ldr	x10, [x10, _NAND_ECC_HAMMING@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x10]
	str	w9, [x21, #48]
	stp	w8, w11, [x21, #52]
	ldr	w8, [x21]
	cmp	w8, #2
	b.lt	LBB0_2
; %bb.1:
Lloh18:
	adrp	x8, _fun_select_chip@GOTPAGE
Lloh19:
	ldr	x8, [x8, _fun_select_chip@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	str	w8, [x21, #20]
LBB0_2:
	ldr	x8, [x21, #8]
	ldr	x8, [x8]
	tbnz	x8, #63, LBB0_4
; %bb.3:
Lloh21:
	adrp	x8, _fun_chip_ready@GOTPAGE
Lloh22:
	ldr	x8, [x8, _fun_chip_ready@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_4:
	ldr	w8, [x21, #60]
	str	w8, [x19, #4]
	mov	x0, x23
	mov	x1, #0
	bl	_of_get_next_child
	cbz	x0, LBB0_8
; %bb.5:
	mov	x23, x0
	mov	x0, x20
	mov	x1, x23
	bl	_nand_set_flash_node
Lloh24:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	w2, [x22]
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, x23
	bl	_kasprintf
	str	w0, [x19]
	cbz	w0, LBB0_9
; %bb.6:
	ldr	w1, [x21]
	mov	x0, x20
	bl	_nand_scan
	cbz	w0, LBB0_10
; %bb.7:
	mov	x20, x0
	mov	x0, x23
	bl	_of_node_put
	b	LBB0_12
LBB0_8:
Lloh29:
	adrp	x8, _ENODEV@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_9:
Lloh32:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh33:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_10:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
	mov	x20, x0
LBB0_11:
	mov	x0, x23
	bl	_of_node_put
	cbz	w20, LBB0_13
LBB0_12:
	ldr	w0, [x19]
	bl	_kfree
LBB0_13:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_fun_cmd_ctrl,4,2               ; @fun_cmd_ctrl
	.comm	_fun_read_byte,4,2              ; @fun_read_byte
	.comm	_fun_read_buf,4,2               ; @fun_read_buf
	.comm	_fun_write_buf,4,2              ; @fun_write_buf
	.comm	_NAND_ECC_SOFT,4,2              ; @NAND_ECC_SOFT
	.comm	_NAND_ECC_HAMMING,4,2           ; @NAND_ECC_HAMMING
	.comm	_fun_select_chip,4,2            ; @fun_select_chip
	.comm	_fun_chip_ready,4,2             ; @fun_chip_ready
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"0x%llx.%pOFn"

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