	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vf610_nfc_read_page
_vf610_nfc_read_page:                   ## @vf610_nfc_read_page
	.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
	movl	%ecx, %r15d
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	callq	_chip_to_nfc
	movq	%rax, %r13
	movq	%r14, %rdi
	callq	_nand_to_mtd
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movl	4(%rax), %ecx
	addl	(%rax), %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	$0, -48(%rbp)
	movl	8(%r14), %esi
	movq	%r14, %rdi
	callq	_vf610_nfc_select_target
	movq	_NAND_CMD_READ0@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_CMD_BYTE1_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_COMMAND_CMD_BYTE1@GOTPCREL(%rip), %rax
	movq	_COMMAND_CAR_BYTE1@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_COMMAND_CAR_BYTE2@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, -44(%rbp)
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	movq	%r14, %rdi
	movl	%r15d, -60(%rbp)                ## 4-byte Spill
	movl	%r15d, %esi
	callq	_vf610_nfc_fill_row
	movq	_NAND_CMD_READSTART@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_CMD_BYTE2_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r15d
	movq	_COMMAND_CMD_BYTE2@GOTPCREL(%rip), %rax
	movq	_COMMAND_RB_HANDSHAKE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r12d
	orl	(%rax), %r12d
	movq	_COMMAND_READ_DATA@GOTPCREL(%rip), %rax
	orl	(%rax), %r12d
	orl	-44(%rbp), %r12d
	movl	%r12d, -44(%rbp)
	movq	_CMD_CODE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r12d
	orl	%ebx, %r12d
	movl	8(%r13), %esi
	movq	%r13, %rdi
	callq	_vf610_nfc_ecc_mode
	movl	-48(%rbp), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	%r15d, %ecx
	movl	%r12d, %r8d
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	callq	_vf610_nfc_run
	movq	_ECC_BYPASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_vf610_nfc_ecc_mode
	movq	(%r13), %rbx
	xorl	%edi, %edi
	callq	_NFC_MAIN_AREA
	addq	%rax, %rbx
	movl	(%r12), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	xorl	%ecx, %ecx
	callq	_vf610_nfc_rd_from_sram
	cmpl	$0, -56(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_2
## %bb.1:
	movq	(%r14), %r15
	movq	(%r13), %rbx
	xorl	%edi, %edi
	callq	_NFC_MAIN_AREA
	addq	%rax, %rbx
	movslq	(%r12), %rsi
	addq	%rbx, %rsi
	movl	4(%r12), %edx
	movq	%r15, %rdi
	xorl	%ecx, %ecx
	callq	_vf610_nfc_rd_from_sram
LBB0_2:
	movq	(%r14), %rdx
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	callq	_vf610_nfc_correct_data
	movl	%eax, %ecx
	shrl	$31, %ecx
	testl	%eax, %eax
	movl	$1, %edx
	cmovnsl	%eax, %edx
	movl	$0, %esi
	cmovlel	%esi, %eax
	addl	%edx, 8(%r12,%rcx,4)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NAND_CMD_READ0,4,2             ## @NAND_CMD_READ0
	.comm	_CMD_BYTE1_SHIFT,4,2            ## @CMD_BYTE1_SHIFT
	.comm	_COMMAND_CMD_BYTE1,4,2          ## @COMMAND_CMD_BYTE1
	.comm	_COMMAND_CAR_BYTE1,4,2          ## @COMMAND_CAR_BYTE1
	.comm	_COMMAND_CAR_BYTE2,4,2          ## @COMMAND_CAR_BYTE2
	.comm	_NAND_CMD_READSTART,4,2         ## @NAND_CMD_READSTART
	.comm	_CMD_BYTE2_SHIFT,4,2            ## @CMD_BYTE2_SHIFT
	.comm	_COMMAND_CMD_BYTE2,4,2          ## @COMMAND_CMD_BYTE2
	.comm	_COMMAND_RB_HANDSHAKE,4,2       ## @COMMAND_RB_HANDSHAKE
	.comm	_COMMAND_READ_DATA,4,2          ## @COMMAND_READ_DATA
	.comm	_CMD_CODE_SHIFT,4,2             ## @CMD_CODE_SHIFT
	.comm	_ECC_BYPASS,4,2                 ## @ECC_BYPASS
	.no_dead_strip	_vf610_nfc_read_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vf610_nfc_read_page
_vf610_nfc_read_page:                   ; @vf610_nfc_read_page
	.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
	mov	x20, x3
	mov	x23, x2
	mov	x21, x1
	mov	x22, x0
	bl	_chip_to_nfc
	mov	x24, x0
	mov	x0, x22
	bl	_nand_to_mtd
	mov	x19, x0
	ldp	w8, w9, [x0]
	add	w25, w9, w8
	str	wzr, [sp, #12]
	ldr	w1, [x22, #8]
	mov	x0, x22
	bl	_vf610_nfc_select_target
Lloh0:
	adrp	x8, _NAND_CMD_READ0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NAND_CMD_READ0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _CMD_BYTE1_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CMD_BYTE1_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w27, w8, w9
Lloh6:
	adrp	x8, _COMMAND_CMD_BYTE1@GOTPAGE
Lloh7:
	ldr	x8, [x8, _COMMAND_CMD_BYTE1@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _COMMAND_CAR_BYTE1@GOTPAGE
Lloh10:
	ldr	x9, [x9, _COMMAND_CAR_BYTE1@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _COMMAND_CAR_BYTE2@GOTPAGE
Lloh13:
	ldr	x9, [x9, _COMMAND_CAR_BYTE2@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
	str	w8, [sp, #8]
	add	x2, sp, #8
	add	x3, sp, #12
	mov	x0, x22
	mov	x1, x20
	bl	_vf610_nfc_fill_row
Lloh15:
	adrp	x8, _NAND_CMD_READSTART@GOTPAGE
Lloh16:
	ldr	x8, [x8, _NAND_CMD_READSTART@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _CMD_BYTE2_SHIFT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CMD_BYTE2_SHIFT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	lsl	w26, w8, w9
Lloh21:
	adrp	x8, _COMMAND_CMD_BYTE2@GOTPAGE
Lloh22:
	ldr	x8, [x8, _COMMAND_CMD_BYTE2@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _COMMAND_RB_HANDSHAKE@GOTPAGE
Lloh25:
	ldr	x9, [x9, _COMMAND_RB_HANDSHAKE@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
Lloh27:
	adrp	x10, _COMMAND_READ_DATA@GOTPAGE
Lloh28:
	ldr	x10, [x10, _COMMAND_READ_DATA@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh29:
	ldr	w9, [x10]
	orr	w8, w8, w9
	ldr	w9, [sp, #8]
	orr	w8, w8, w9
	str	w8, [sp, #8]
Lloh30:
	adrp	x9, _CMD_CODE_SHIFT@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CMD_CODE_SHIFT@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	orr	w27, w8, w27
	ldr	w1, [x24, #8]
	mov	x0, x24
	bl	_vf610_nfc_ecc_mode
	ldr	w2, [sp, #12]
	mov	x0, x24
	mov	w1, #0
	mov	x3, x26
	mov	x4, x27
	mov	x5, x25
	bl	_vf610_nfc_run
Lloh33:
	adrp	x8, _ECC_BYPASS@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ECC_BYPASS@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x24
	bl	_vf610_nfc_ecc_mode
	ldr	x25, [x24]
	mov	w0, #0
	bl	_NFC_MAIN_AREA
	add	x1, x0, x25
	ldr	w2, [x19]
	mov	x0, x21
	mov	w3, #0
	bl	_vf610_nfc_rd_from_sram
	cbz	w23, LBB0_2
; %bb.1:
	ldr	x23, [x22]
	ldr	x24, [x24]
	mov	w0, #0
	bl	_NFC_MAIN_AREA
	ldp	w8, w2, [x19]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x9, x0, x24
	add	x1, x9, x8
	mov	x0, x23
	mov	w3, #0
	bl	_vf610_nfc_rd_from_sram
LBB0_2:
	ldr	x2, [x22]
	mov	x0, x22
	mov	x1, x21
	mov	x3, x20
	bl	_vf610_nfc_correct_data
	mov	w9, #8
	mov	w10, #12
	cmp	w0, #0
	csel	w8, w0, wzr, gt
	csel	x9, x10, x9, lt
	csinc	w10, w0, wzr, ge
	ldr	w11, [x19, x9]
	add	w10, w11, w10
	str	w10, [x19, x9]
	mov	x0, x8
	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 AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.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	_NAND_CMD_READ0,4,2             ; @NAND_CMD_READ0
	.comm	_CMD_BYTE1_SHIFT,4,2            ; @CMD_BYTE1_SHIFT
	.comm	_COMMAND_CMD_BYTE1,4,2          ; @COMMAND_CMD_BYTE1
	.comm	_COMMAND_CAR_BYTE1,4,2          ; @COMMAND_CAR_BYTE1
	.comm	_COMMAND_CAR_BYTE2,4,2          ; @COMMAND_CAR_BYTE2
	.comm	_NAND_CMD_READSTART,4,2         ; @NAND_CMD_READSTART
	.comm	_CMD_BYTE2_SHIFT,4,2            ; @CMD_BYTE2_SHIFT
	.comm	_COMMAND_CMD_BYTE2,4,2          ; @COMMAND_CMD_BYTE2
	.comm	_COMMAND_RB_HANDSHAKE,4,2       ; @COMMAND_RB_HANDSHAKE
	.comm	_COMMAND_READ_DATA,4,2          ; @COMMAND_READ_DATA
	.comm	_CMD_CODE_SHIFT,4,2             ; @CMD_CODE_SHIFT
	.comm	_ECC_BYPASS,4,2                 ; @ECC_BYPASS
	.no_dead_strip	_vf610_nfc_read_page
.subsections_via_symbols
