	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nor_init
_mtk_nor_init:                          ## @mtk_nor_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SNOR_HWCAPS_READ@GOTPCREL(%rip), %rax
	movq	_SNOR_HWCAPS_READ_FAST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_SNOR_HWCAPS_READ_1_1_2@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_SNOR_HWCAPS_PP@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	%ecx, -32(%rbp)
	movq	_MTK_NOR_ENABLE_SF_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MTK_NOR_WRPROT_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	48(%rbx), %rsi
	callq	_writel
	leaq	8(%rbx), %r14
	movl	(%rbx), %eax
	movl	%eax, 40(%rbx)
	movq	%rbx, 32(%rbx)
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_spi_nor_set_flash_node
	movq	_mtk_nor_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%rbx)
	movq	_mtk_nor_read_reg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	_mtk_nor_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rbx)
	movq	_mtk_nor_write_reg@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
	leaq	L_.str(%rip), %rax
	movq	%rax, 8(%rbx)
	leaq	-32(%rbp), %rdx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_spi_nor_scan
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_mtd_device_register
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SNOR_HWCAPS_READ,4,2           ## @SNOR_HWCAPS_READ
	.comm	_SNOR_HWCAPS_READ_FAST,4,2      ## @SNOR_HWCAPS_READ_FAST
	.comm	_SNOR_HWCAPS_READ_1_1_2,4,2     ## @SNOR_HWCAPS_READ_1_1_2
	.comm	_SNOR_HWCAPS_PP,4,2             ## @SNOR_HWCAPS_PP
	.comm	_MTK_NOR_ENABLE_SF_CMD,4,2      ## @MTK_NOR_ENABLE_SF_CMD
	.comm	_MTK_NOR_WRPROT_REG,8,3         ## @MTK_NOR_WRPROT_REG
	.comm	_mtk_nor_read,4,2               ## @mtk_nor_read
	.comm	_mtk_nor_read_reg,4,2           ## @mtk_nor_read_reg
	.comm	_mtk_nor_write,4,2              ## @mtk_nor_write
	.comm	_mtk_nor_write_reg,4,2          ## @mtk_nor_write_reg
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mtk_nor"

	.no_dead_strip	_mtk_nor_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nor_init
_mtk_nor_init:                          ; @mtk_nor_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _SNOR_HWCAPS_READ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SNOR_HWCAPS_READ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _SNOR_HWCAPS_READ_FAST@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SNOR_HWCAPS_READ_FAST@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _SNOR_HWCAPS_READ_1_1_2@GOTPAGE
Lloh7:
	ldr	x9, [x9, _SNOR_HWCAPS_READ_1_1_2@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _SNOR_HWCAPS_PP@GOTPAGE
Lloh10:
	ldr	x10, [x10, _SNOR_HWCAPS_PP@GOTPAGEOFF]
	orr	w8, w8, w9
Lloh11:
	ldr	w9, [x10]
	orr	w8, w8, w9
	str	w8, [sp, #8]
Lloh12:
	adrp	x8, _MTK_NOR_ENABLE_SF_CMD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MTK_NOR_ENABLE_SF_CMD@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	x8, [x21, #48]
Lloh15:
	adrp	x9, _MTK_NOR_WRPROT_REG@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MTK_NOR_WRPROT_REG@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	add	x19, x21, #8
	ldr	w8, [x21]
	str	w8, [x21, #40]
	str	x21, [x21, #32]
	mov	x0, x19
	mov	x1, x20
	bl	_spi_nor_set_flash_node
Lloh18:
	adrp	x8, _mtk_nor_read@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mtk_nor_read@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _mtk_nor_read_reg@GOTPAGE
Lloh22:
	ldr	x9, [x9, _mtk_nor_read_reg@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #24]
Lloh24:
	adrp	x8, _mtk_nor_write@GOTPAGE
Lloh25:
	ldr	x8, [x8, _mtk_nor_write@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _mtk_nor_write_reg@GOTPAGE
Lloh28:
	ldr	x9, [x9, _mtk_nor_write_reg@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #16]
Lloh30:
	adrp	x8, l_.str@PAGE
Lloh31:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x21, #8]
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, #0
	bl	_spi_nor_scan
	cbnz	w0, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, #0
	mov	w2, #0
	bl	_mtd_device_register
LBB0_2:
	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
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_SNOR_HWCAPS_READ,4,2           ; @SNOR_HWCAPS_READ
	.comm	_SNOR_HWCAPS_READ_FAST,4,2      ; @SNOR_HWCAPS_READ_FAST
	.comm	_SNOR_HWCAPS_READ_1_1_2,4,2     ; @SNOR_HWCAPS_READ_1_1_2
	.comm	_SNOR_HWCAPS_PP,4,2             ; @SNOR_HWCAPS_PP
	.comm	_MTK_NOR_ENABLE_SF_CMD,4,2      ; @MTK_NOR_ENABLE_SF_CMD
	.comm	_MTK_NOR_WRPROT_REG,8,3         ; @MTK_NOR_WRPROT_REG
	.comm	_mtk_nor_read,4,2               ; @mtk_nor_read
	.comm	_mtk_nor_read_reg,4,2           ; @mtk_nor_read_reg
	.comm	_mtk_nor_write,4,2              ; @mtk_nor_write
	.comm	_mtk_nor_write_reg,4,2          ; @mtk_nor_write_reg
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mtk_nor"

	.no_dead_strip	_mtk_nor_init
.subsections_via_symbols
