	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mxic_nfc_data_xfer
_mxic_nfc_data_xfer:                    ## @mxic_nfc_data_xfer
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	je	LBB0_12
## %bb.1:
	movl	%ecx, %r12d
	movq	%rsi, %r15
	xorl	%r14d, %r14d
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	addl	%r13d, %r14d
	cmpl	%r12d, %r14d
	jae	LBB0_12
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r12d, %r13d
	subl	%r14d, %r13d
	cmpl	$4, %r13d
	movl	$4, %eax
	cmovael	%eax, %r13d
	movl	$-1, -44(%rbp)
	movl	%r14d, %ebx
	testq	%r15, %r15
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	(%r15,%rbx), %rsi
	leaq	-44(%rbp), %rdi
	movl	%r13d, %edx
	callq	_memcpy
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	_INT_STS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	addq	8(%rbx), %rdi
	movq	_USEC_PER_SEC@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_readl_poll_timeout
	testl	%eax, %eax
	jne	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-44(%rbp), %r15d
	movq	8(%rbx), %r12
	movl	%r13d, %edi
	andl	$3, %edi
	callq	_TXD
	addq	%rax, %r12
	movl	%r15d, %edi
	movq	%r12, %rsi
	callq	_writel
	movq	_INT_STS@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	movq	_USEC_PER_SEC@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_readl_poll_timeout
	testl	%eax, %eax
	jne	LBB0_13
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	movl	(%r12), %r8d
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_readl_poll_timeout
	testl	%eax, %eax
	jne	LBB0_13
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_RXD@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movl	%eax, -44(%rbp)
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	testq	%r12, %r12
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	(,%r13,8), %ecx
	negb	%cl
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %eax
	movl	%eax, -44(%rbp)
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	addq	%r12, %rdi
	leaq	-44(%rbp), %rsi
	movl	%r13d, %edx
	callq	_memcpy
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rdi
	addq	8(%rbx), %rdi
	callq	_readl
	movq	_INT_RX_NOT_EMPTY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	jmp	LBB0_11
LBB0_12:
	xorl	%eax, %eax
LBB0_13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_STS,8,3                    ## @INT_STS
	.comm	_INT_TX_EMPTY,4,2               ## @INT_TX_EMPTY
	.comm	_USEC_PER_SEC,4,2               ## @USEC_PER_SEC
	.comm	_INT_RX_NOT_EMPTY,4,2           ## @INT_RX_NOT_EMPTY
	.comm	_RXD,8,3                        ## @RXD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"RX FIFO not empty\n"

	.no_dead_strip	_mxic_nfc_data_xfer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mxic_nfc_data_xfer
_mxic_nfc_data_xfer:                    ; @mxic_nfc_data_xfer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	w3, LBB0_12
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
	mov	w26, #0
Lloh0:
	adrp	x23, _INT_STS@GOTPAGE
Lloh1:
	ldr	x23, [x23, _INT_STS@GOTPAGEOFF]
Lloh2:
	adrp	x27, _USEC_PER_SEC@GOTPAGE
Lloh3:
	ldr	x27, [x27, _USEC_PER_SEC@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w26, w24, w26
	cmp	w26, w19
	b.hs	LBB0_12
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w19, w26
	mov	w9, #-1
	str	w9, [sp, #12]
	cmp	w8, #4
	mov	w9, #4
	csel	w24, w8, w9, lo
	cbz	x21, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x1, x21, w26, uxtw
	add	x0, sp, #12
	mov	x2, x24
	bl	_memcpy
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	ldr	w4, [x27]
	mov	w2, #0
	mov	w3, #0
	bl	_readl_poll_timeout
	cbnz	w0, LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w25, [sp, #12]
	ldr	x28, [x22, #8]
	and	w0, w24, #0x3
	bl	_TXD
	add	x1, x0, x28
	mov	x0, x25
	bl	_writel
	ldr	x8, [x22, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	ldr	w4, [x27]
	mov	w2, #0
	mov	w3, #0
	bl	_readl_poll_timeout
	cbnz	w0, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	ldr	w4, [x27]
	mov	w2, #0
	mov	w3, #0
	bl	_readl_poll_timeout
	cbnz	w0, LBB0_13
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22, #8]
Lloh4:
	adrp	x9, _RXD@GOTPAGE
Lloh5:
	ldr	x9, [x9, _RXD@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl
	str	w0, [sp, #12]
	cbz	x20, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_3 Depth=1
	lsl	w8, w24, #3
	neg	w8, w8
	asr	w8, w0, w8
	str	w8, [sp, #12]
	add	x0, x20, w26, uxtw
	add	x1, sp, #12
	mov	x2, x24
	bl	_memcpy
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22, #8]
	ldr	x9, [x23]
	add	x0, x9, x8
	bl	_readl
Lloh7:
	adrp	x8, _INT_RX_NOT_EMPTY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _INT_RX_NOT_EMPTY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.11:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x22]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
	b	LBB0_2
LBB0_12:
	mov	w0, #0
LBB0_13:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_STS,8,3                    ; @INT_STS
	.comm	_INT_TX_EMPTY,4,2               ; @INT_TX_EMPTY
	.comm	_USEC_PER_SEC,4,2               ; @USEC_PER_SEC
	.comm	_INT_RX_NOT_EMPTY,4,2           ; @INT_RX_NOT_EMPTY
	.comm	_RXD,8,3                        ; @RXD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"RX FIFO not empty\n"

	.no_dead_strip	_mxic_nfc_data_xfer
.subsections_via_symbols
