	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nfc_format_page
_mtk_nfc_format_page:                   ## @mtk_nfc_format_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_mtd_to_nand
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_to_mtk_nand
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_nand_get_controller_data
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	(%rax), %edi
	movq	(%r14), %rdx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	addq	8(%r14), %rdx
	movl	$255, %esi
	callq	_memset
	cmpq	$0, (%r15)
	jle	LBB0_7
## %bb.1:
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mtk_oob_ptr
	movl	%eax, %ebx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_oob_ptr
	movl	16(%r12), %edx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_memcpy
	incq	%r13
	cmpq	(%r15), %r13
	movq	%r14, %rbx
	jge	LBB0_7
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_mtk_data_ptr
	movl	%eax, %r14d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r13, %rdx
	callq	_data_ptr
	movl	8(%r15), %edx
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_memcpy
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %r14
	cmpq	(%r12), %r13
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %edx
	callq	*8(%r12)
	jmp	LBB0_6
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mtk_nfc_format_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nfc_format_page
_mtk_nfc_format_page:                   ; @mtk_nfc_format_page
	.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	x19, x1
	mov	x20, x0
	bl	_mtd_to_nand
	mov	x21, x0
	bl	_to_mtk_nand
	mov	x22, x0
	mov	x0, x21
	bl	_nand_get_controller_data
	mov	x23, x0
	ldr	w0, [x0]
	ldp	x9, x8, [x20]
	add	x2, x9, x8
	mov	w1, #255
	bl	_memset
	ldr	x8, [x21]
	cmp	x8, #1
	b.lt	LBB0_7
; %bb.1:
	mov	x24, #0
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x24
	bl	_mtk_oob_ptr
	mov	x25, x0
	mov	x0, x21
	mov	x1, x24
	bl	_oob_ptr
	mov	x1, x0
	ldr	w2, [x22, #16]
	mov	x0, x25
	bl	_memcpy
	add	x24, x24, #1
	ldr	x8, [x21]
	cmp	x24, x8
	b.ge	LBB0_7
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x19, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x24
	bl	_mtk_data_ptr
	mov	x25, x0
	mov	x0, x21
	mov	x1, x19
	mov	x2, x24
	bl	_data_ptr
	mov	x1, x0
	ldr	w2, [x21, #8]
	mov	x0, x25
	bl	_memcpy
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22]
	cmp	x24, x8
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x22, #8]
	ldr	w1, [x23]
	mov	x0, x20
	mov	w2, #1
	blr	x8
	b	LBB0_2
LBB0_7:
	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_format_page
.subsections_via_symbols
