	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mtk_nfc_write_fdm
_mtk_nfc_write_fdm:                     ## @mtk_nfc_write_fdm
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	callq	_nand_get_controller_data
	movq	%rax, %r14
	movq	%r12, %rdi
	callq	_to_mtk_nand
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	cmpl	$0, (%r12)
	jle	LBB0_18
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_oob_ptr
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %ecx
	testl	%ecx, %ecx
	jle	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rax), %esi
	cmpl	$1, %ecx
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%rax), %edx
	shll	$8, %edx
	orl	%esi, %edx
	cmpl	$2, %ecx
	jbe	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%rax), %esi
	shll	$16, %esi
	orl	%edx, %esi
	cmpl	$3, %ecx
	je	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	12(%rax), %r13d
	shll	$24, %r13d
	orl	%esi, %r13d
	movl	$255, %edx
	cmpl	$5, %ecx
	jb	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%rax), %edx
	je	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	20(%rax), %esi
	shll	$8, %esi
	orl	%edx, %esi
	cmpl	$6, %ecx
	jbe	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	24(%rax), %edx
	shll	$16, %edx
	orl	%esi, %edx
	movl	$255, %r15d
	cmpl	$7, %ecx
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	28(%rax), %r15d
	jmp	LBB0_17
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$255, %esi
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	orl	$65280, %esi                    ## imm = 0xFF00
	movl	%esi, %edx
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	orl	$16711680, %edx                 ## imm = 0xFF0000
	movl	%edx, %esi
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	orl	$-16777216, %esi                ## imm = 0xFF000000
	movl	$255, %edx
	movl	%esi, %r13d
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	orl	$65280, %edx                    ## imm = 0xFF00
	movl	%edx, %esi
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	orl	$16711680, %esi                 ## imm = 0xFF0000
	movl	$255, %r15d
	movl	%esi, %edx
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	shll	$24, %r15d
	orl	%edx, %r15d
	movl	%ebx, %edi
	callq	_NFI_FDML
	movq	%r14, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_nfi_writel
	movl	%ebx, %edi
	callq	_NFI_FDMM
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%eax, %edx
	callq	_nfi_writel
	incl	%ebx
	cmpl	(%r12), %ebx
	jl	LBB0_2
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_mtk_nfc_write_fdm
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mtk_nfc_write_fdm
_mtk_nfc_write_fdm:                     ; @mtk_nfc_write_fdm
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	bl	_nand_get_controller_data
	mov	x20, x0
	mov	x0, x19
	bl	_to_mtk_nand
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_20
; %bb.1:
	mov	x21, x0
	mov	w22, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_oob_ptr
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x0]
	b.eq	LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w10, [x0, #4]
	orr	w9, w9, w10, lsl #8
	cmp	w8, #2
	b.ls	LBB0_13
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w10, [x0, #8]
	orr	w9, w9, w10, lsl #16
	cmp	w8, #3
	b.eq	LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w10, [x0, #12]
	orr	w23, w9, w10, lsl #24
	cmp	w8, #5
	b.lo	LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w9, [x0, #16]
	b.eq	LBB0_16
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w10, [x0, #20]
	orr	w9, w9, w10, lsl #8
	cmp	w8, #6
	b.ls	LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w10, [x0, #24]
	orr	w9, w9, w10, lsl #16
	cmp	w8, #7
	b.eq	LBB0_18
; %bb.10:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x0, #28]
	b	LBB0_19
LBB0_11:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w9, #255
LBB0_12:                                ;   in Loop: Header=BB0_2 Depth=1
	orr	w9, w9, #0xff00
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	orr	w9, w9, #0xff0000
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	orr	w23, w9, #0xff000000
LBB0_15:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w9, #255
LBB0_16:                                ;   in Loop: Header=BB0_2 Depth=1
	orr	w9, w9, #0xff00
LBB0_17:                                ;   in Loop: Header=BB0_2 Depth=1
	orr	w9, w9, #0xff0000
LBB0_18:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w8, #255
LBB0_19:                                ;   in Loop: Header=BB0_2 Depth=1
	orr	w24, w9, w8, lsl #24
	mov	x0, x22
	bl	_NFI_FDML
	mov	x2, x0
	mov	x0, x20
	mov	x1, x23
	bl	_nfi_writel
	mov	x0, x22
	bl	_NFI_FDMM
	mov	x2, x0
	mov	x0, x20
	mov	x1, x24
	bl	_nfi_writel
	add	w22, w22, #1
	ldr	w8, [x19]
	cmp	w22, w8
	b.lt	LBB0_2
LBB0_20:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_mtk_nfc_write_fdm
.subsections_via_symbols
