	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sunxi_nfc_hw_ecc_write_chunk
_sunxi_nfc_hw_ecc_write_chunk:          ## @sunxi_nfc_hw_ecc_write_chunk
	.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, %rbx
	movl	%r8d, %r12d
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	8(%rdi), %edi
	callq	_to_sunxi_nfc
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	cmpl	%r13d, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_change_write_column_op
LBB0_2:
	movl	(%r15), %edx
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	movl	24(%rbp), %r8d
	callq	_sunxi_nfc_randomizer_write_buf
	addl	(%r15), %r13d
	movq	%r12, %r14
	cmpl	%r14d, %r13d
	je	LBB0_4
## %bb.3:
	movq	%r15, %rdi
	movl	%r14d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_nand_change_write_column_op
LBB0_4:
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_sunxi_nfc_wait_cmd_fifo_empty
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movl	16(%rbp), %ebx
	movq	%r15, %rdi
	callq	_sunxi_nfc_randomizer_enable
	movq	%r15, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	movl	%ebx, %ecx
	movl	24(%rbp), %r8d
	callq	_sunxi_nfc_hw_ecc_set_prot_oob_bytes
	movq	_NFC_DATA_TRANS@GOTPCREL(%rip), %rax
	movq	_NFC_DATA_SWAP_METHOD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movq	_NFC_ACCESS_DIR@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_NFC_ECC_OP@GOTPCREL(%rip), %rax
	orl	(%rax), %edi
	movq	_NFC_REG_CMD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r12), %rsi
	callq	_writel
	movq	_NFC_CMD_INT_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_sunxi_nfc_wait_events
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_sunxi_nfc_randomizer_disable
	testl	%ebx, %ebx
	jne	LBB0_7
## %bb.6:
	movl	4(%r15), %eax
	addl	%r14d, %eax
	addl	$4, %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NFC_DATA_TRANS,4,2             ## @NFC_DATA_TRANS
	.comm	_NFC_DATA_SWAP_METHOD,4,2       ## @NFC_DATA_SWAP_METHOD
	.comm	_NFC_ACCESS_DIR,4,2             ## @NFC_ACCESS_DIR
	.comm	_NFC_ECC_OP,4,2                 ## @NFC_ECC_OP
	.comm	_NFC_REG_CMD,8,3                ## @NFC_REG_CMD
	.comm	_NFC_CMD_INT_FLAG,4,2           ## @NFC_CMD_INT_FLAG
	.no_dead_strip	_sunxi_nfc_hw_ecc_write_chunk
.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_write_chunk
_sunxi_nfc_hw_ecc_write_chunk:          ; @sunxi_nfc_hw_ecc_write_chunk
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x23, x7
	mov	x24, x6
	mov	x19, x5
	mov	x20, x4
	mov	x25, x3
	mov	x26, x2
	mov	x27, x1
	mov	x21, x0
	ldr	w0, [x0, #8]
	bl	_to_sunxi_nfc
	mov	x22, x0
	ldr	w8, [x19]
	cmp	w8, w26
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x21
	mov	x1, x26
	mov	x2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_nand_change_write_column_op
LBB0_2:
	ldr	w2, [x21]
	mov	x0, x21
	mov	x1, x27
	mov	w3, #0
	mov	x4, x23
	bl	_sunxi_nfc_randomizer_write_buf
	ldr	w8, [x21]
	add	w8, w8, w26
	cmp	w8, w20
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x21
	mov	x1, x20
	mov	x2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_nand_change_write_column_op
LBB0_4:
	mov	x0, x22
	bl	_sunxi_nfc_wait_cmd_fifo_empty
	mov	x26, x0
	cbnz	w0, LBB0_7
; %bb.5:
	mov	x0, x21
	bl	_sunxi_nfc_randomizer_enable
	mov	x0, x21
	mov	x1, x25
	mov	w2, #0
	mov	x3, x24
	mov	x4, x23
	bl	_sunxi_nfc_hw_ecc_set_prot_oob_bytes
Lloh0:
	adrp	x8, _NFC_DATA_TRANS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NFC_DATA_TRANS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _NFC_DATA_SWAP_METHOD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _NFC_DATA_SWAP_METHOD@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _NFC_ACCESS_DIR@GOTPAGE
Lloh7:
	ldr	x10, [x10, _NFC_ACCESS_DIR@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh8:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh9:
	adrp	x9, _NFC_ECC_OP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _NFC_ECC_OP@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x22]
Lloh12:
	adrp	x9, _NFC_REG_CMD@GOTPAGE
Lloh13:
	ldr	x9, [x9, _NFC_REG_CMD@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
Lloh15:
	adrp	x8, _NFC_CMD_INT_FLAG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NFC_CMD_INT_FLAG@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x22
	mov	w2, #0
	mov	w3, #0
	bl	_sunxi_nfc_wait_events
	mov	x26, x0
	mov	x0, x21
	bl	_sunxi_nfc_randomizer_disable
	cbnz	w26, LBB0_7
; %bb.6:
	ldr	w8, [x21, #4]
	add	w8, w20, w8
	add	w8, w8, #4
	str	w8, [x19]
LBB0_7:
	mov	x0, x26
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NFC_DATA_TRANS,4,2             ; @NFC_DATA_TRANS
	.comm	_NFC_DATA_SWAP_METHOD,4,2       ; @NFC_DATA_SWAP_METHOD
	.comm	_NFC_ACCESS_DIR,4,2             ; @NFC_ACCESS_DIR
	.comm	_NFC_ECC_OP,4,2                 ; @NFC_ECC_OP
	.comm	_NFC_REG_CMD,8,3                ; @NFC_REG_CMD
	.comm	_NFC_CMD_INT_FLAG,4,2           ; @NFC_CMD_INT_FLAG
	.no_dead_strip	_sunxi_nfc_hw_ecc_write_chunk
.subsections_via_symbols
