	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nor_read_reg
_mtk_nor_read_reg:                      ## @mtk_nor_read_reg
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movq	%rdx, %r14
	movq	(%rdi), %rbx
	cmpl	$128, %esi
	jne	LBB0_4
## %bb.1:
	movq	_MTK_NOR_RDSR_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_mtk_nor_execute_cmd
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	cmpl	$1, %r12d
	jne	LBB0_5
## %bb.3:
	movq	_MTK_NOR_RDSR_REG@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readb
	movl	%eax, (%r14)
	jmp	LBB0_6
LBB0_4:
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r14, %r8
	movl	%r12d, %r9d
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_nor_do_tx_rx               ## TAILCALL
LBB0_5:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_6:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MTK_NOR_RDSR_CMD,4,2           ## @MTK_NOR_RDSR_CMD
	.comm	_MTK_NOR_RDSR_REG,8,3           ## @MTK_NOR_RDSR_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"len should be 1 for read status!\n"

	.no_dead_strip	_mtk_nor_read_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nor_read_reg
_mtk_nor_read_reg:                      ; @mtk_nor_read_reg
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x3
	mov	x19, x2
	ldr	x22, [x0]
	cmp	w1, #128
	b.ne	LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _MTK_NOR_RDSR_CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTK_NOR_RDSR_CMD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_mtk_nor_execute_cmd
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.2:
	cmp	w20, #1
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x22, #8]
Lloh3:
	adrp	x9, _MTK_NOR_RDSR_REG@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MTK_NOR_RDSR_REG@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readb
	str	w0, [x19]
	b	LBB0_6
LBB0_4:
	mov	x0, x22
	mov	x2, #0
	mov	w3, #0
	mov	x4, x19
	mov	x5, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_mtk_nor_do_tx_rx
LBB0_5:
	ldr	w0, [x22]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MTK_NOR_RDSR_CMD,4,2           ; @MTK_NOR_RDSR_CMD
	.comm	_MTK_NOR_RDSR_REG,8,3           ; @MTK_NOR_RDSR_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"len should be 1 for read status!\n"

	.no_dead_strip	_mtk_nor_read_reg
.subsections_via_symbols
