	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nfc_cmd_ctrl
_mtk_nfc_cmd_ctrl:                      ## @mtk_nfc_cmd_ctrl
	.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	%edx, %ebx
	movl	%esi, %r14d
	callq	_nand_get_controller_data
	movq	%rax, %r15
	movq	_NAND_ALE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_1
## %bb.3:
	movq	%r15, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_nfc_send_address           ## TAILCALL
LBB0_1:
	movq	_NAND_CLE@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_2
## %bb.4:
	movq	%r15, %rdi
	callq	_mtk_nfc_hw_reset
	movq	_CNFG_OP_CUST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NFI_CNFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_nfi_writew
	movq	%r15, %rdi
	movl	%r14d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mtk_nfc_send_command           ## TAILCALL
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_ALE,4,2                   ## @NAND_ALE
	.comm	_NAND_CLE,4,2                   ## @NAND_CLE
	.comm	_CNFG_OP_CUST,4,2               ## @CNFG_OP_CUST
	.comm	_NFI_CNFG,4,2                   ## @NFI_CNFG
	.no_dead_strip	_mtk_nfc_cmd_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nfc_cmd_ctrl
_mtk_nfc_cmd_ctrl:                      ; @mtk_nfc_cmd_ctrl
	.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	x21, x2
	mov	x19, x1
	bl	_nand_get_controller_data
	mov	x20, x0
Lloh0:
	adrp	x8, _NAND_ALE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_ALE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_2
; %bb.1:
	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	_mtk_nfc_send_address
LBB0_2:
Lloh3:
	adrp	x8, _NAND_CLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NAND_CLE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_mtk_nfc_hw_reset
Lloh6:
	adrp	x8, _CNFG_OP_CUST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CNFG_OP_CUST@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _NFI_CNFG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NFI_CNFG@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_nfi_writew
	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	_mtk_nfc_send_command
LBB0_4:
	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 AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_NAND_ALE,4,2                   ; @NAND_ALE
	.comm	_NAND_CLE,4,2                   ; @NAND_CLE
	.comm	_CNFG_OP_CUST,4,2               ; @CNFG_OP_CUST
	.comm	_NFI_CNFG,4,2                   ; @NFI_CNFG
	.no_dead_strip	_mtk_nfc_cmd_ctrl
.subsections_via_symbols
