	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nfc_send_command
_mtk_nfc_send_command:                  ## @mtk_nfc_send_command
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	8(%rdi), %r14
	movq	_NFI_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_nfi_writel
	movq	_NFI_STA@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	movq	_MTK_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	$1, %edx
	movl	$10, %ecx
	callq	_readl_poll_timeout_atomic
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	callq	_dev_warn
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_3
LBB0_1:
	xorl	%eax, %eax
LBB0_3:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NFI_CMD,4,2                    ## @NFI_CMD
	.comm	_NFI_STA,8,3                    ## @NFI_STA
	.comm	_STA_CMD,4,2                    ## @STA_CMD
	.comm	_MTK_TIMEOUT,4,2                ## @MTK_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nfi core timed out entering command mode\n"

	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_mtk_nfc_send_command
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nfc_send_command
_mtk_nfc_send_command:                  ; @mtk_nfc_send_command
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	ldr	x19, [x0, #8]
Lloh0:
	adrp	x8, _NFI_CMD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NFI_CMD@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	bl	_nfi_writel
Lloh3:
	adrp	x8, _NFI_STA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NFI_STA@GOTPAGEOFF]
	ldr	x9, [x20]
Lloh5:
	ldr	x8, [x8]
	add	x0, x8, x9
Lloh6:
	adrp	x8, _MTK_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MTK_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	w2, #1
	mov	w3, #10
	bl	_readl_poll_timeout_atomic
	cbz	w0, LBB0_2
; %bb.1:
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_NFI_CMD,4,2                    ; @NFI_CMD
	.comm	_NFI_STA,8,3                    ; @NFI_STA
	.comm	_STA_CMD,4,2                    ; @STA_CMD
	.comm	_MTK_TIMEOUT,4,2                ; @MTK_TIMEOUT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nfi core timed out entering command mode\n"

	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_mtk_nfc_send_command
.subsections_via_symbols
