	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_nfc_hw_ecc_correct
_sunxi_nfc_hw_ecc_correct:              ## @sunxi_nfc_hw_ecc_correct
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%r8d, %r14d
	movl	%ecx, %ebx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %r13
	movl	16(%rdi), %edi
	callq	_to_sunxi_nfc
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	$0, (%r15)
	movl	%ebx, %edi
	callq	_NFC_ECC_ERR
	testl	%r14d, %eax
	je	LBB0_2
## %bb.1:
	movq	_EBADMSG@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	callq	_NFC_ECC_PAT_FOUND
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %r15
	testl	%r14d, %eax
	je	LBB0_10
## %bb.3:
	movq	_NFC_REG_PAT_ID@GOTPCREL(%rip), %rax
	addq	(%rax), %r15
	movq	%r15, %rdi
	callq	_readl
	notl	%eax
	andl	$1, %eax
	movl	%eax, %edi
	callq	_unlikely
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	movl	$255, %r14d
LBB0_5:
	testq	%r12, %r12
	je	LBB0_7
## %bb.6:
	movq	8(%r13), %rdx
	movq	%r12, %rdi
	movl	%r14d, %esi
	callq	_memset
LBB0_7:
	xorl	%ebx, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	movq	(%r13), %rdx
	addq	$4, %rdx
	movl	%r14d, %esi
	callq	_memset
	jmp	LBB0_9
LBB0_10:
	movl	%ebx, %edi
	callq	_NFC_REG_ECC_ERR_CNT
	addq	%rax, %r15
	movq	%r15, %rdi
	callq	_readl
	movl	%ebx, %edi
	movl	%eax, %esi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_NFC_ECC_ERR_CNT                ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EBADMSG,4,2                    ## @EBADMSG
	.comm	_NFC_REG_PAT_ID,8,3             ## @NFC_REG_PAT_ID
	.no_dead_strip	_sunxi_nfc_hw_ecc_correct
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sunxi_nfc_hw_ecc_correct
_sunxi_nfc_hw_ecc_correct:              ; @sunxi_nfc_hw_ecc_correct
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x5
	mov	x24, x4
	mov	x23, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	w0, [x0, #16]
	bl	_to_sunxi_nfc
	mov	x25, x0
	str	wzr, [x22]
	mov	x0, x23
	bl	_NFC_ECC_ERR
	tst	w0, w24
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBADMSG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBADMSG@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_9
LBB0_2:
	mov	x0, x23
	bl	_NFC_ECC_PAT_FOUND
	ldr	x25, [x25]
	tst	w0, w24
	b.eq	LBB0_10
; %bb.3:
Lloh3:
	adrp	x8, _NFC_REG_PAT_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NFC_REG_PAT_ID@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	add	x0, x8, x25
	bl	_readl
	mvn	w8, w0
	and	w0, w8, #0x1
	bl	_unlikely
	cbz	x0, LBB0_11
; %bb.4:
	mov	w22, #0
	cbz	x21, LBB0_6
LBB0_5:
	ldr	x2, [x20, #8]
	mov	x0, x21
	mov	x1, x22
	bl	_memset
LBB0_6:
	cbz	x19, LBB0_8
; %bb.7:
	ldr	x8, [x20]
	add	x2, x8, #4
	mov	x0, x19
	mov	x1, x22
	bl	_memset
LBB0_8:
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	x0, x23
	bl	_NFC_REG_ECC_ERR_CNT
	add	x0, x0, x25
	bl	_readl
	mov	x1, x0
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_NFC_ECC_ERR_CNT
LBB0_11:
	mov	w8, #1
	str	w8, [x22]
	mov	w22, #255
	cbnz	x21, LBB0_5
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EBADMSG,4,2                    ; @EBADMSG
	.comm	_NFC_REG_PAT_ID,8,3             ; @NFC_REG_PAT_ID
	.no_dead_strip	_sunxi_nfc_hw_ecc_correct
.subsections_via_symbols
