	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nfc_read_page_raw
_mtk_nfc_read_page_raw:                 ## @mtk_nfc_read_page_raw
	.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, -44(%rbp)                 ## 4-byte Spill
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_nand_to_mtd
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_to_mtk_nand
	movq	%rax, %r12
	movq	%r14, %rdi
	callq	_nand_get_controller_data
	movq	%rax, %r13
	movl	(%rax), %edi
	movq	8(%r15), %rdx
	addq	(%r15), %rdx
	movl	$255, %esi
	callq	_memset
	movq	(%r15), %rcx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	(%r13), %r8d
	movl	$1, (%rsp)
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movq	%r14, %rsi
	xorl	%edx, %edx
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	callq	_mtk_nfc_read_subpage
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	js	LBB0_8
## %bb.1:
	cmpl	$0, (%r14)
	jle	LBB0_8
## %bb.2:
	xorl	%r13d, %r13d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%r13d
	cmpl	(%r14), %r13d
	jge	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_oob_ptr
	movl	%eax, %r15d
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_mtk_oob_ptr
	movl	16(%r12), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_memcpy
	cmpl	(%r12), %r13d
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %edx
	callq	*8(%r12)
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	testq	%rbx, %rbx
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	%r13d, %edx
	callq	_data_ptr
	movq	%rbx, %r15
	movl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r13d, %esi
	callq	_mtk_data_ptr
	movl	4(%r14), %edx
	movl	%ebx, %edi
	movq	%r15, %rbx
	movl	%eax, %esi
	callq	_memcpy
	jmp	LBB0_7
LBB0_8:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mtk_nfc_read_page_raw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nfc_read_page_raw
_mtk_nfc_read_page_raw:                 ; @mtk_nfc_read_page_raw
	.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	x24, x3
	mov	x19, x1
	mov	x20, x0
	bl	_nand_to_mtd
	mov	x21, x0
	mov	x0, x20
	bl	_to_mtk_nand
	mov	x22, x0
	mov	x0, x20
	bl	_nand_get_controller_data
	mov	x23, x0
	ldr	w0, [x0]
	ldp	x8, x9, [x21]
	add	x2, x9, x8
	mov	w1, #255
	bl	_memset
	ldr	x3, [x21]
	ldr	w4, [x23]
	mov	x0, x21
	mov	x1, x20
	mov	w2, #0
	mov	x5, x24
	mov	w6, #1
	bl	_mtk_nfc_read_subpage
	mov	x24, x0
	tbnz	w0, #31, LBB0_8
; %bb.1:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.2:
	mov	w25, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w25, w25, #1
	ldr	w8, [x20]
	cmp	w25, w8
	b.ge	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x25
	bl	_oob_ptr
	mov	x26, x0
	mov	x0, x20
	mov	x1, x25
	bl	_mtk_oob_ptr
	mov	x1, x0
	ldr	w2, [x22, #16]
	mov	x0, x26
	bl	_memcpy
	ldr	w8, [x22]
	cmp	w25, w8
	b.ne	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x22, #8]
	ldr	w1, [x23]
	mov	x0, x21
	mov	w2, #1
	blr	x8
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	cbz	x19, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	mov	x1, x19
	mov	x2, x25
	bl	_data_ptr
	mov	x26, x0
	mov	x0, x20
	mov	x1, x25
	bl	_mtk_data_ptr
	mov	x1, x0
	ldr	w2, [x20, #4]
	mov	x0, x26
	bl	_memcpy
	b	LBB0_3
LBB0_8:
	mov	x0, x24
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_mtk_nfc_read_page_raw
.subsections_via_symbols
