	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nfc_write_byte
_mtk_nfc_write_byte:                    ## @mtk_nfc_write_byte
	.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
	movl	%esi, %r14d
	callq	_nand_get_controller_data
	movq	%rax, %rbx
	movq	_NFI_STA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_nfi_readl
	movq	_NFI_FSM_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_NFI_FSM_CUSTDATA@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_2
## %bb.1:
	movq	_NFI_CNFG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_nfi_readw
	movq	_CNFG_BYTE_RW@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%r15), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_nfi_writew
	movq	(%rbx), %rax
	movl	(%rax), %esi
	movq	_CON_SEC_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %esi
	movq	_CON_BWR@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_NFI_CON@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_nfi_writel
	movq	_STAR_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NFI_STRDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_nfi_writew
LBB0_2:
	movq	%rbx, %rdi
	callq	_mtk_nfc_wait_ioready
	movq	_NFI_DATAW@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_nfi_writeb                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_NFI_STA,4,2                    ## @NFI_STA
	.comm	_NFI_FSM_MASK,4,2               ## @NFI_FSM_MASK
	.comm	_NFI_FSM_CUSTDATA,4,2           ## @NFI_FSM_CUSTDATA
	.comm	_NFI_CNFG,4,2                   ## @NFI_CNFG
	.comm	_CNFG_BYTE_RW,4,2               ## @CNFG_BYTE_RW
	.comm	_CON_SEC_SHIFT,4,2              ## @CON_SEC_SHIFT
	.comm	_CON_BWR,4,2                    ## @CON_BWR
	.comm	_NFI_CON,4,2                    ## @NFI_CON
	.comm	_STAR_EN,4,2                    ## @STAR_EN
	.comm	_NFI_STRDATA,4,2                ## @NFI_STRDATA
	.comm	_NFI_DATAW,4,2                  ## @NFI_DATAW
	.no_dead_strip	_mtk_nfc_write_byte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nfc_write_byte
_mtk_nfc_write_byte:                    ; @mtk_nfc_write_byte
	.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	x19, x1
	bl	_nand_get_controller_data
	mov	x20, x0
Lloh0:
	adrp	x8, _NFI_STA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NFI_STA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_nfi_readl
Lloh3:
	adrp	x8, _NFI_FSM_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NFI_FSM_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh6:
	adrp	x9, _NFI_FSM_CUSTDATA@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NFI_FSM_CUSTDATA@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	cmp	w8, w9
	b.eq	LBB0_2
; %bb.1:
Lloh9:
	adrp	x21, _NFI_CNFG@GOTPAGE
Lloh10:
	ldr	x21, [x21, _NFI_CNFG@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_nfi_readw
Lloh11:
	adrp	x8, _CNFG_BYTE_RW@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CNFG_BYTE_RW@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	orr	w1, w8, w0
	ldr	w2, [x21]
	mov	x0, x20
	bl	_nfi_writew
	ldr	x8, [x20]
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _CON_SEC_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CON_SEC_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _CON_BWR@GOTPAGE
Lloh18:
	ldr	x10, [x10, _CON_BWR@GOTPAGEOFF]
	lsl	w8, w8, w9
Lloh19:
	ldr	w9, [x10]
	orr	w1, w8, w9
Lloh20:
	adrp	x8, _NFI_CON@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NFI_CON@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_nfi_writel
Lloh23:
	adrp	x8, _STAR_EN@GOTPAGE
Lloh24:
	ldr	x8, [x8, _STAR_EN@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
Lloh26:
	adrp	x8, _NFI_STRDATA@GOTPAGE
Lloh27:
	ldr	x8, [x8, _NFI_STRDATA@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_nfi_writew
LBB0_2:
	mov	x0, x20
	bl	_mtk_nfc_wait_ioready
Lloh29:
	adrp	x8, _NFI_DATAW@GOTPAGE
Lloh30:
	ldr	x8, [x8, _NFI_DATAW@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	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	_nfi_writeb
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_NFI_STA,4,2                    ; @NFI_STA
	.comm	_NFI_FSM_MASK,4,2               ; @NFI_FSM_MASK
	.comm	_NFI_FSM_CUSTDATA,4,2           ; @NFI_FSM_CUSTDATA
	.comm	_NFI_CNFG,4,2                   ; @NFI_CNFG
	.comm	_CNFG_BYTE_RW,4,2               ; @CNFG_BYTE_RW
	.comm	_CON_SEC_SHIFT,4,2              ; @CON_SEC_SHIFT
	.comm	_CON_BWR,4,2                    ; @CON_BWR
	.comm	_NFI_CON,4,2                    ; @NFI_CON
	.comm	_STAR_EN,4,2                    ; @STAR_EN
	.comm	_NFI_STRDATA,4,2                ; @NFI_STRDATA
	.comm	_NFI_DATAW,4,2                  ; @NFI_DATAW
	.no_dead_strip	_mtk_nfc_write_byte
.subsections_via_symbols
