	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function marvell_nfc_hw_ecc_bch_write_page
_marvell_nfc_hw_ecc_bch_write_page:     ## @marvell_nfc_hw_ecc_bch_write_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	movl	%edx, %r14d
	movq	%rsi, %r13
	movq	%rdi, %r15
	callq	_nand_to_mtd
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_to_marvell_nand
	movq	(%rax), %rbx
	movq	8(%r15), %r12
	movl	(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	4(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	16(%r15), %esi
	movq	%r15, %rdi
	callq	_marvell_nfc_select_target
	testl	%r14d, %r14d
	jne	LBB0_2
## %bb.1:
	movq	8(%r15), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movl	$255, %esi
	callq	_memset
LBB0_2:
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	callq	_marvell_nfc_enable_hw_ecc
	cmpl	$0, 8(%rbx)
	jle	LBB0_7
## %bb.3:
	xorl	%r15d, %r15d
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movl	%r15d, %esi
	movq	%r13, %rdx
	movq	%r13, -56(%rbp)                 ## 8-byte Spill
	movl	-48(%rbp), %r13d                ## 4-byte Reload
	movl	%r13d, %ecx
	movq	%r12, %r8
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %r9d
	callq	_marvell_nfc_hw_ecc_bch_write_chunk
	movslq	%r13d, %rax
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	leaq	(%r13,%rax,4), %r13
	movslq	%ebx, %rax
	leaq	(%r12,%rax,4), %r12
	movq	%r14, %rdi
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	callq	_marvell_nfc_wait_ndrun
	incl	%r15d
	cmpl	8(%rbx), %r15d
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	12(%rbx), %r15d
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	16(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	20(%rbx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	jmp	LBB0_6
LBB0_7:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_PSEC_TO_MSEC
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_marvell_nfc_wait_op
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_marvell_nfc_disable_hw_ecc
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_marvell_nfc_hw_ecc_bch_write_page
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function marvell_nfc_hw_ecc_bch_write_page
_marvell_nfc_hw_ecc_bch_write_page:     ; @marvell_nfc_hw_ecc_bch_write_page
	.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	x20, x3
	mov	x26, x2
	mov	x21, x1
	mov	x19, x0
	bl	_nand_to_mtd
	mov	x25, x0
	mov	x0, x19
	bl	_to_marvell_nand
	ldr	x27, [x0]
	ldr	x22, [x19, #8]
	ldp	w23, w24, [x27]
	ldr	w1, [x19, #16]
	mov	x0, x19
	bl	_marvell_nfc_select_target
	cbnz	w26, LBB0_2
; %bb.1:
	ldr	x0, [x19, #8]
	ldr	w2, [x25]
	mov	w1, #255
	bl	_memset
LBB0_2:
	mov	x0, x19
	bl	_marvell_nfc_enable_hw_ecc
	ldr	w8, [x27, #8]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.3:
	mov	w25, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x25
	mov	x2, x21
	mov	x3, x23
	mov	x4, x22
	mov	x5, x24
	mov	x6, x20
	bl	_marvell_nfc_hw_ecc_bch_write_chunk
	add	x21, x21, w23, sxtw #2
	add	x22, x22, w24, sxtw #2
	mov	x0, x19
	bl	_marvell_nfc_wait_ndrun
	add	w25, w25, #1
	ldr	w8, [x27, #8]
	cmp	w25, w8
	b.ge	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x27, #12]
	cmp	w25, w8
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldp	w23, w24, [x27, #16]
	b	LBB0_4
LBB0_7:
	ldr	w0, [x19]
	bl	_PSEC_TO_MSEC
	mov	x1, x0
	mov	x0, x19
	bl	_marvell_nfc_wait_op
	mov	x20, x0
	mov	x0, x19
	bl	_marvell_nfc_disable_hw_ecc
	mov	x0, x20
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_marvell_nfc_hw_ecc_bch_write_page
.subsections_via_symbols
