	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function marvell_nfc_prepare_cmd
_marvell_nfc_prepare_cmd:               ## @marvell_nfc_prepare_cmd
	.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
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_to_marvell_nfc
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_marvell_nfc_wait_ndrun
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_5
LBB0_2:
	movq	_NDCR@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	(%r14), %rdi
	callq	_readl_relaxed
	movl	%eax, %ebx
	movq	_NDSR@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	callq	_readl
	movq	(%r15), %rsi
	addq	(%r14), %rsi
	movl	%eax, %edi
	callq	_writel_relaxed
	movq	_NDCR_ND_RUN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	(%r12), %rsi
	addq	(%r14), %rsi
	movl	%ebx, %edi
	callq	_writel_relaxed
	movq	(%r15), %rdi
	addq	(%r14), %rdi
	movq	_POLL_PERIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_POLL_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	callq	_readl_relaxed_poll_timeout
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	8(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_5
LBB0_4:
	movq	_NDSR_WRCMDREQ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rsi
	addq	(%r14), %rsi
	callq	_writel_relaxed
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Last operation did not succeed\n"

	.comm	_NDCR,8,3                       ## @NDCR
	.comm	_NDSR,8,3                       ## @NDSR
	.comm	_NDCR_ND_RUN,4,2                ## @NDCR_ND_RUN
	.comm	_NDSR_WRCMDREQ,4,2              ## @NDSR_WRCMDREQ
	.comm	_POLL_PERIOD,4,2                ## @POLL_PERIOD
	.comm	_POLL_TIMEOUT,4,2               ## @POLL_TIMEOUT
L_.str.1:                               ## @.str.1
	.asciz	"Timeout on WRCMDRE\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_marvell_nfc_prepare_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function marvell_nfc_prepare_cmd
_marvell_nfc_prepare_cmd:               ; @marvell_nfc_prepare_cmd
	.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, x0
	ldr	w0, [x0]
	bl	_to_marvell_nfc
	mov	x19, x0
	mov	x0, x20
	bl	_marvell_nfc_wait_ndrun
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	w0, [x19, #8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_5
LBB0_2:
	ldr	x8, [x19]
Lloh2:
	adrp	x22, _NDCR@GOTPAGE
Lloh3:
	ldr	x22, [x22, _NDCR@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl_relaxed
	mov	x20, x0
	ldr	x8, [x19]
Lloh4:
	adrp	x21, _NDSR@GOTPAGE
Lloh5:
	ldr	x21, [x21, _NDSR@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x0, x9, x8
	bl	_readl
	ldr	x8, [x19]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel_relaxed
Lloh6:
	adrp	x8, _NDCR_ND_RUN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NDCR_ND_RUN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	orr	w0, w8, w20
	ldr	x8, [x19]
	ldr	x9, [x22]
	add	x1, x9, x8
	bl	_writel_relaxed
	ldr	x8, [x19]
	ldr	x9, [x21]
	add	x0, x9, x8
Lloh9:
	adrp	x8, _POLL_PERIOD@GOTPAGE
Lloh10:
	ldr	x8, [x8, _POLL_PERIOD@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
Lloh12:
	adrp	x8, _POLL_TIMEOUT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _POLL_TIMEOUT@GOTPAGEOFF]
Lloh14:
	ldr	w4, [x8]
	mov	w2, #0
	bl	_readl_relaxed_poll_timeout
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x19, #8]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh17:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_4:
Lloh20:
	adrp	x8, _NDSR_WRCMDREQ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _NDSR_WRCMDREQ@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	ldr	x8, [x19]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_writel_relaxed
	mov	w20, #0
LBB0_5:
	mov	x0, 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
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Last operation did not succeed\n"

	.comm	_NDCR,8,3                       ; @NDCR
	.comm	_NDSR,8,3                       ; @NDSR
	.comm	_NDCR_ND_RUN,4,2                ; @NDCR_ND_RUN
	.comm	_NDSR_WRCMDREQ,4,2              ; @NDSR_WRCMDREQ
	.comm	_POLL_PERIOD,4,2                ; @POLL_PERIOD
	.comm	_POLL_TIMEOUT,4,2               ; @POLL_TIMEOUT
l_.str.1:                               ; @.str.1
	.asciz	"Timeout on WRCMDRE\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_marvell_nfc_prepare_cmd
.subsections_via_symbols
