	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_ecc_disable                ## -- Begin function mtk_ecc_disable
	.p2align	4, 0x90
_mtk_ecc_disable:                       ## @mtk_ecc_disable
	.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	%rdi, %r15
	movq	_ECC_ENCODE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	8(%rdi), %rbx
	movl	%r14d, %edi
	callq	_ECC_CTL_REG
	addq	%rax, %rbx
	movq	%rbx, %rdi
	callq	_readw
	movq	_ECC_OP_ENABLE@GOTPCREL(%rip), %rcx
	movq	_ECC_DECODE@GOTPCREL(%rip), %rbx
	cmpq	(%rcx), %rax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %r14d
LBB0_2:
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_mtk_ecc_wait_idle
	movq	8(%r15), %rsi
	movq	16(%r15), %rax
	movq	(%rax), %rax
	cmpl	(%rbx), %r14d
	jne	LBB0_3
## %bb.4:
	movq	_ECC_DECDONE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	addq	(%rax,%rcx,8), %rsi
	movq	%rsi, %rdi
	callq	_readw
	movq	8(%r15), %rsi
	movq	16(%r15), %rax
	movq	(%rax), %rax
	movq	_ECC_DECIRQ_EN@GOTPCREL(%rip), %rcx
	jmp	LBB0_5
LBB0_3:
	movq	_ECC_ENCIRQ_EN@GOTPCREL(%rip), %rcx
LBB0_5:
	movq	(%rcx), %rcx
	addq	(%rax,%rcx,8), %rsi
	xorl	%edi, %edi
	callq	_writew
	movq	_ECC_OP_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	8(%r15), %rbx
	movl	%r14d, %edi
	callq	_ECC_CTL_REG
	addq	%rax, %rbx
	movl	%r12d, %edi
	movq	%rbx, %rsi
	callq	_writew
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ECC_ENCODE,4,2                 ## @ECC_ENCODE
	.comm	_ECC_OP_ENABLE,8,3              ## @ECC_OP_ENABLE
	.comm	_ECC_DECODE,4,2                 ## @ECC_DECODE
	.comm	_ECC_DECDONE,8,3                ## @ECC_DECDONE
	.comm	_ECC_DECIRQ_EN,8,3              ## @ECC_DECIRQ_EN
	.comm	_ECC_ENCIRQ_EN,8,3              ## @ECC_ENCIRQ_EN
	.comm	_ECC_OP_DISABLE,4,2             ## @ECC_OP_DISABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mtk_ecc_disable                ; -- Begin function mtk_ecc_disable
	.p2align	2
_mtk_ecc_disable:                       ; @mtk_ecc_disable
	.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, x0
Lloh0:
	adrp	x8, _ECC_ENCODE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ECC_ENCODE@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	x21, [x0, #8]
	mov	x0, x20
	bl	_ECC_CTL_REG
	add	x0, x0, x21
	bl	_readw
Lloh3:
	adrp	x8, _ECC_OP_ENABLE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ECC_OP_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x21, _ECC_DECODE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _ECC_DECODE@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	x0, x8
	csel	w20, w20, w9, eq
	mov	x0, x19
	mov	x1, x20
	bl	_mtk_ecc_wait_idle
	ldr	w10, [x21]
	ldp	x8, x9, [x19, #8]
	ldr	x9, [x9]
	cmp	w20, w10
	b.ne	LBB0_2
; %bb.1:
Lloh8:
	adrp	x10, _ECC_DECDONE@GOTPAGE
Lloh9:
	ldr	x10, [x10, _ECC_DECDONE@GOTPAGEOFF]
Lloh10:
	ldr	x10, [x10]
	ldr	x9, [x9, x10, lsl #3]
	add	x0, x9, x8
	bl	_readw
	ldp	x8, x9, [x19, #8]
	ldr	x9, [x9]
Lloh11:
	adrp	x10, _ECC_DECIRQ_EN@GOTPAGE
Lloh12:
	ldr	x10, [x10, _ECC_DECIRQ_EN@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:
Lloh13:
	adrp	x10, _ECC_ENCIRQ_EN@GOTPAGE
Lloh14:
	ldr	x10, [x10, _ECC_ENCIRQ_EN@GOTPAGEOFF]
LBB0_3:
	ldr	x10, [x10]
	ldr	x9, [x9, x10, lsl #3]
	add	x1, x9, x8
	mov	w0, #0
	bl	_writew
Lloh15:
	adrp	x8, _ECC_OP_DISABLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ECC_OP_DISABLE@GOTPAGEOFF]
Lloh17:
	ldr	w21, [x8]
	ldr	x22, [x19, #8]
	mov	x0, x20
	bl	_ECC_CTL_REG
	add	x1, x0, x22
	mov	x0, x21
	bl	_writew
	mov	x0, x19
	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
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_ECC_ENCODE,4,2                 ; @ECC_ENCODE
	.comm	_ECC_OP_ENABLE,8,3              ; @ECC_OP_ENABLE
	.comm	_ECC_DECODE,4,2                 ; @ECC_DECODE
	.comm	_ECC_DECDONE,8,3                ; @ECC_DECDONE
	.comm	_ECC_DECIRQ_EN,8,3              ; @ECC_DECIRQ_EN
	.comm	_ECC_ENCIRQ_EN,8,3              ; @ECC_ENCIRQ_EN
	.comm	_ECC_OP_DISABLE,4,2             ; @ECC_OP_DISABLE
.subsections_via_symbols
