	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5pcxx_nand_calculate_ecc
_s5pcxx_nand_calculate_ecc:             ## @s5pcxx_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, %r14
	movq	(%rdi), %r15
	movq	8(%r15), %rbx
	movq	_S5P_NFCONT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rbx), %rdi
	movq	_S5P_NFCONT_MECCLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_rwl
	testq	%r14, %r14
	je	LBB0_1
## %bb.3:
	movq	_S5P_NFECCSTAT@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	addq	(%rbx), %rdi
	callq	_readl
	testl	$33554432, %eax                 ## imm = 0x2000000
	je	LBB0_4
## %bb.5:
	movq	_S5P_NFECCPRGECC@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%rbx), %rdi
	movl	(%r15), %edx
	movq	%r14, %rsi
	callq	_readecc
	jmp	LBB0_6
LBB0_1:
	movq	_S5P_NFECCSTAT@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	addq	(%rbx), %rdi
	callq	_readl
	testl	$16777216, %eax                 ## imm = 0x1000000
	je	LBB0_2
LBB0_6:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S5P_NFCONT,8,3                 ## @S5P_NFCONT
	.comm	_S5P_NFCONT_MECCLOCK,4,2        ## @S5P_NFCONT_MECCLOCK
	.comm	_S5P_NFECCSTAT,8,3              ## @S5P_NFECCSTAT
	.comm	_S5P_NFECCPRGECC,8,3            ## @S5P_NFECCPRGECC
	.no_dead_strip	_s5pcxx_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 s5pcxx_nand_calculate_ecc
_s5pcxx_nand_calculate_ecc:             ; @s5pcxx_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
	ldr	x21, [x0]
	ldr	x20, [x21, #8]
Lloh0:
	adrp	x8, _S5P_NFCONT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S5P_NFCONT@GOTPAGEOFF]
	ldr	x9, [x20, #8]
Lloh2:
	ldr	x8, [x8]
	add	x0, x8, x9
Lloh3:
	adrp	x8, _S5P_NFCONT_MECCLOCK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _S5P_NFCONT_MECCLOCK@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_rwl
	cbz	x19, LBB0_4
; %bb.1:
Lloh6:
	adrp	x22, _S5P_NFECCSTAT@GOTPAGE
Lloh7:
	ldr	x22, [x22, _S5P_NFECCSTAT@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x9, [x22]
	add	x0, x9, x8
	bl	_readl
	tbz	w0, #25, LBB0_2
; %bb.3:
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _S5P_NFECCPRGECC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _S5P_NFECCPRGECC@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w2, [x21]
	mov	x1, x19
	bl	_readecc
	b	LBB0_6
LBB0_4:
Lloh11:
	adrp	x19, _S5P_NFECCSTAT@GOTPAGE
Lloh12:
	ldr	x19, [x19, _S5P_NFECCSTAT@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x9, [x19]
	add	x0, x9, x8
	bl	_readl
	tbz	w0, #24, LBB0_5
LBB0_6:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_S5P_NFCONT,8,3                 ; @S5P_NFCONT
	.comm	_S5P_NFCONT_MECCLOCK,4,2        ; @S5P_NFCONT_MECCLOCK
	.comm	_S5P_NFECCSTAT,8,3              ; @S5P_NFECCSTAT
	.comm	_S5P_NFECCPRGECC,8,3            ; @S5P_NFECCPRGECC
	.no_dead_strip	_s5pcxx_nand_calculate_ecc
.subsections_via_symbols
