	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmio_nand_calculate_ecc
_tmio_nand_calculate_ecc:               ## @tmio_nand_calculate_ecc
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	callq	_mtd_to_tmio
	movq	%rax, %r14
	movq	_FCR_MODE_HWECC_RESULT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_FCR_MODE@GOTPCREL(%rip), %r15
	movq	(%r15), %rsi
	addq	(%r14), %rsi
	callq	_tmio_iowrite8
	movq	_FCR_DATA@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	addq	(%r14), %rdi
	callq	_tmio_ioread16
	movl	%eax, 4(%rbx)
	shrl	$8, %eax
	movl	%eax, (%rbx)
	movq	(%r12), %rdi
	addq	(%r14), %rdi
	callq	_tmio_ioread16
	movl	%eax, 8(%rbx)
	shrl	$8, %eax
	movl	%eax, 16(%rbx)
	movq	(%r12), %rdi
	addq	(%r14), %rdi
	callq	_tmio_ioread16
	movl	%eax, 12(%rbx)
	shrl	$8, %eax
	movl	%eax, 20(%rbx)
	movq	_FCR_MODE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rsi
	addq	(%r14), %rsi
	callq	_tmio_iowrite8
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FCR_MODE_HWECC_RESULT,4,2      ## @FCR_MODE_HWECC_RESULT
	.comm	_FCR_MODE,8,3                   ## @FCR_MODE
	.comm	_FCR_DATA,8,3                   ## @FCR_DATA
	.comm	_FCR_MODE_DATA,4,2              ## @FCR_MODE_DATA
	.no_dead_strip	_tmio_nand_calculate_ecc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmio_nand_calculate_ecc
_tmio_nand_calculate_ecc:               ; @tmio_nand_calculate_ecc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	bl	_mtd_to_tmio
	mov	x20, x0
Lloh0:
	adrp	x8, _FCR_MODE_HWECC_RESULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FCR_MODE_HWECC_RESULT@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	x8, [x20]
Lloh3:
	adrp	x21, _FCR_MODE@GOTPAGE
Lloh4:
	ldr	x21, [x21, _FCR_MODE@GOTPAGEOFF]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_tmio_iowrite8
	ldr	x8, [x20]
Lloh5:
	adrp	x22, _FCR_DATA@GOTPAGE
Lloh6:
	ldr	x22, [x22, _FCR_DATA@GOTPAGEOFF]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_tmio_ioread16
	lsr	w8, w0, #8
	stp	w8, w0, [x19]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_tmio_ioread16
	str	w0, [x19, #8]
	lsr	w8, w0, #8
	str	w8, [x19, #16]
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_tmio_ioread16
	str	w0, [x19, #12]
	lsr	w8, w0, #8
	str	w8, [x19, #20]
Lloh7:
	adrp	x8, _FCR_MODE_DATA@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FCR_MODE_DATA@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldr	x8, [x20]
	ldr	x9, [x21]
	add	x1, x9, x8
	bl	_tmio_iowrite8
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_FCR_MODE_HWECC_RESULT,4,2      ; @FCR_MODE_HWECC_RESULT
	.comm	_FCR_MODE,8,3                   ; @FCR_MODE
	.comm	_FCR_DATA,8,3                   ; @FCR_DATA
	.comm	_FCR_MODE_DATA,4,2              ; @FCR_MODE_DATA
	.no_dead_strip	_tmio_nand_calculate_ecc
.subsections_via_symbols
