	.file	"extr_mtk_ecc.c_mtk_ecc_config.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"invalid ecc strength %d\n"
	.text
	.p2align 4
	.type	mtk_ecc_config, @function
mtk_ecc_config:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	rsi, QWORD PTR 16[rdi]
	mov	edx, DWORD PTR [rbx]
	mov	rax, QWORD PTR [rsi]
	test	rax, rax
	je	.L2
	mov	rcx, QWORD PTR 8[rsi]
	xor	edi, edi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L19:
	add	rdi, 1
	cmp	rax, rdi
	je	.L2
.L4:
	cmp	DWORD PTR [rcx+rdi*4], edx
	jne	.L19
	mov	rcx, QWORD PTR 16[rsi]
	mov	eax, DWORD PTR 16[rbx]
	mov	r9, QWORD PTR 24[rbx]
	mov	r8, QWORD PTR 8[rbp]
	mov	r10, QWORD PTR ECC_ENCODE[rip]
	sal	eax, 3
	sal	r9, cl
	mov	rcx, QWORD PTR ECC_MS_SHIFT[rip]
	cmp	QWORD PTR 8[rbx], r10
	je	.L20
	imul	edx, DWORD PTR 24[rsi]
	add	r8, QWORD PTR ECC_DECCNFG[rip]
	mov	rsi, r8
	add	eax, edx
	mov	rdx, QWORD PTR DEC_CNFG_CORRECT[rip]
	or	rdx, QWORD PTR DEC_EMPTY_EN[rip]
	cdqe
	or	r9, rdx
	sal	rax, cl
	or	rax, r9
	or	rdi, rax
	call	writel@PLT
	mov	ecx, DWORD PTR 32[rbx]
	test	ecx, ecx
	jne	.L21
.L17:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	sub	ecx, 1
	mov	eax, 1
	sal	eax, cl
	mov	DWORD PTR 0[rbp], eax
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L20:
	cdqe
	mov	rsi, QWORD PTR ECC_ENCCNFG[rip]
	sal	rax, cl
	or	rax, r9
	add	rsi, r8
	or	rdi, rax
	call	writel@PLT
	mov	rax, QWORD PTR ECC_NFI_MODE[rip]
	cmp	QWORD PTR 24[rbx], rax
	je	.L17
	mov	edi, DWORD PTR 36[rbx]
	mov	rax, QWORD PTR ECC_ENCDIADDR[rip]
	add	rax, QWORD PTR 8[rbp]
	mov	rbp, rax
	call	lower_32_bits@PLT
	mov	rsi, rbp
	mov	rdi, rax
	call	writel@PLT
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	edi, DWORD PTR 24[rbp]
	lea	rsi, .LC0[rip]
	call	dev_err@PLT
	mov	eax, DWORD PTR EINVAL[rip]
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	neg	eax
	ret
	.cfi_endproc
.LFE0:
	.size	mtk_ecc_config, .-mtk_ecc_config
	.comm	EINVAL,4,4
	.comm	ECC_NFI_MODE,8,8
	.comm	ECC_MS_SHIFT,8,8
	.comm	ECC_ENCODE,8,8
	.comm	ECC_ENCDIADDR,8,8
	.comm	ECC_ENCCNFG,8,8
	.comm	ECC_DECCNFG,8,8
	.comm	DEC_EMPTY_EN,8,8
	.comm	DEC_CNFG_CORRECT,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_mtk_ecc.c_mtk_ecc_config.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"invalid ecc strength %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mtk_ecc_config, %function
mtk_ecc_config:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, [r0, #8]
	mov	r6, r0
	ldr	r4, [r7]
	ldr	r2, [r1]
	cmp	r4, #0
	beq	.L2
	ldr	ip, [r7, #4]
	mov	r5, r1
	mov	r3, #0
	sub	ip, ip, #4
	b	.L4
.L19:
	add	r3, r3, #1
	cmp	r4, r3
	beq	.L2
.L4:
	ldr	lr, [ip, #4]!
	cmp	lr, r2
	bne	.L19
	ldr	r1, .L21
	ldr	r4, [r5, #4]
	ldr	r1, [r1]
	ldr	ip, [r5, #8]
	cmp	r4, r1
	ldr	r0, [r5, #12]
	ldr	r1, .L21+4
	ldr	lr, [r7, #8]
	ldr	r4, [r1]
	lsl	ip, ip, #3
	ldr	r1, [r6, #4]
	lsl	lr, r0, lr
	beq	.L20
	ldr	r0, [r7, #12]
	ldr	r7, .L21+8
	mla	r2, r0, r2, ip
	ldr	ip, .L21+12
	ldr	r0, [r7]
	ldr	r7, [ip]
	ldr	ip, .L21+16
	orr	r0, r0, r7
	ldr	ip, [ip]
	orr	r0, r0, lr
	orr	r0, r0, r2, lsl r4
	orr	r0, r0, r3
	add	r1, r1, ip
	bl	writel
	ldr	r3, [r5, #16]
	cmp	r3, #0
	beq	.L17
	mov	r2, #1
	sub	r3, r3, #1
	lsl	r3, r2, r3
	mov	r0, #0
	str	r3, [r6]
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	ldr	r2, .L21+20
	orr	r0, lr, ip, lsl r4
	ldr	r7, [r2]
	orr	r0, r0, r3
	add	r1, r1, r7
	bl	writel
	ldr	r3, .L21+24
	ldr	r2, [r5, #12]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L17
	ldr	r0, [r5, #20]
	bl	lower_32_bits
	ldr	r3, .L21+28
	ldr	r1, [r6, #4]
	ldr	r3, [r3]
	add	r1, r1, r3
	bl	writel
.L17:
	mov	r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	ldr	r0, [r6, #12]
	ldr	r1, .L21+32
	bl	dev_err
	ldr	r3, .L21+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	.align	2
.L21:
	.word	ECC_ENCODE
	.word	ECC_MS_SHIFT
	.word	DEC_CNFG_CORRECT
	.word	DEC_EMPTY_EN
	.word	ECC_DECCNFG
	.word	ECC_ENCCNFG
	.word	ECC_NFI_MODE
	.word	ECC_ENCDIADDR
	.word	.LC0
	.word	EINVAL
	.size	mtk_ecc_config, .-mtk_ecc_config
	.comm	EINVAL,4,4
	.comm	ECC_NFI_MODE,4,4
	.comm	ECC_MS_SHIFT,4,4
	.comm	ECC_ENCODE,4,4
	.comm	ECC_ENCDIADDR,4,4
	.comm	ECC_ENCCNFG,4,4
	.comm	ECC_DECCNFG,4,4
	.comm	DEC_EMPTY_EN,4,4
	.comm	DEC_CNFG_CORRECT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
