	.file	"extr_mt312.c_mt312_initfe.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	mt312_initfe, @function
mt312_initfe:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	xor	edx, edx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	sub	rsp, 56
	.cfi_def_cfa_offset 80
	mov	rbp, QWORD PTR [rdi]
	mov	esi, DWORD PTR CONFIG[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	cmp	DWORD PTR 0[rbp], 6
	mov	rdi, rbp
	setne	dl
	lea	edx, 136[0+rdx*4]
	call	mt312_writereg@PLT
	test	eax, eax
	js	.L1
	mov	edi, 150
	call	udelay@PLT
	mov	esi, 1
	mov	rdi, rbp
	call	mt312_reset@PLT
	test	eax, eax
	js	.L1
	movabs	rax, 77309411348
	mov	r12, rsp
	mov	ecx, 32
	mov	rdi, rbp
	mov	esi, DWORD PTR VIT_SETUP[rip]
	mov	QWORD PTR [rsp], rax
	mov	rdx, r12
	movabs	rax, 8589934595
	mov	QWORD PTR 8[rsp], rax
	mov	QWORD PTR 16[rsp], 1
	mov	QWORD PTR 24[rsp], 0
	call	mt312_write@PLT
	test	eax, eax
	js	.L1
	cmp	DWORD PTR 4[rbp], 128
	je	.L5
.L7:
	mov	edi, DWORD PTR 8[rbp]
	imul	edi, DWORD PTR 0[rbp]
	mov	esi, 1000000
	add	edi, edi
	call	mt312_div@PLT
	mov	esi, 88000
	mov	DWORD PTR [rsp], eax
	mov	edi, DWORD PTR 8[rbp]
	call	mt312_div@PLT
	mov	ecx, 8
	mov	rdx, r12
	mov	rdi, rbp
	mov	esi, DWORD PTR SYS_CLK[rip]
	mov	DWORD PTR 4[rsp], eax
	call	mt312_write@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR SNR_THS_HIGH[rip]
	mov	edx, 50
	mov	rdi, rbp
	call	mt312_writereg@PLT
	test	eax, eax
	js	.L1
	cmp	DWORD PTR 4[rbp], 128
	mov	edx, 51
	mov	eax, 83
	mov	rdi, rbp
	cmovne	edx, eax
	mov	esi, DWORD PTR OP_CTRL[rip]
	mov	DWORD PTR [rsp], edx
	call	mt312_writereg@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR TS_SW_LIM_L[rip]
	mov	ecx, 8
	mov	rdx, r12
	mov	rdi, rbp
	movabs	rax, 652835029132
	mov	QWORD PTR [rsp], rax
	call	mt312_write@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR CS_SW_LIM[rip]
	mov	edx, 105
	mov	rdi, rbp
	call	mt312_writereg@PLT
	mov	edx, 0
	test	eax, eax
	cmovg	eax, edx
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rcx, QWORD PTR 40[rsp]
	xor	rcx, QWORD PTR fs:40
	jne	.L15
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	mov	esi, DWORD PTR GPP_CTRL[rip]
	mov	edx, 128
	mov	rdi, rbp
	call	mt312_writereg@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR HW_CTRL[rip]
	mov	ecx, 2
	mov	rdx, r12
	mov	rdi, rbp
	movabs	rax, 755914244224
	mov	QWORD PTR [rsp], rax
	call	mt312_write@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR HW_CTRL[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	mt312_writereg@PLT
	test	eax, eax
	js	.L1
	mov	esi, DWORD PTR MPEG_CTRL[rip]
	xor	edx, edx
	mov	rdi, rbp
	call	mt312_writereg@PLT
	test	eax, eax
	jns	.L7
	jmp	.L1
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	mt312_initfe, .-mt312_initfe
	.comm	VIT_SETUP,4,4
	.comm	TS_SW_LIM_L,4,4
	.comm	SYS_CLK,4,4
	.comm	SNR_THS_HIGH,4,4
	.comm	OP_CTRL,4,4
	.comm	MPEG_CTRL,4,4
	.comm	HW_CTRL,4,4
	.comm	GPP_CTRL,4,4
	.comm	CS_SW_LIM,4,4
	.comm	CONFIG,4,4
	.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_mt312.c_mt312_initfe.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	mt312_initfe, %function
mt312_initfe:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r4, [r0]
	ldr	r3, .L16
	ldr	r2, [r4]
	ldr	r1, [r3]
	cmp	r2, #6
	ldr	r3, .L16+4
	moveq	r2, #136
	movne	r2, #140
	sub	sp, sp, #40
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [sp, #36]
	mov	r3,#0
	bl	mt312_writereg
	cmp	r0, #0
	blt	.L1
	mov	r0, #150
	bl	udelay
	mov	r1, #1
	mov	r0, r4
	bl	mt312_reset
	cmp	r0, #0
	blt	.L1
	ldr	lr, .L16+8
	add	ip, sp, #4
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1, r2, r3}
	ldr	lr, .L16+12
	stm	ip, {r0, r1, r2, r3}
	mov	r3, #32
	mov	r0, r4
	ldr	r1, [lr]
	add	r2, sp, #4
	bl	mt312_write
	cmp	r0, #0
	blt	.L1
	ldr	r5, [r4, #4]
	cmp	r5, #128
	beq	.L5
.L7:
	ldr	r3, [r4]
	ldr	r0, [r4, #8]
	ldr	r1, .L16+16
	mul	r0, r3, r0
	lsl	r0, r0, #1
	bl	mt312_div
	str	r0, [sp, #4]
	ldr	r1, .L16+20
	ldr	r0, [r4, #8]
	bl	mt312_div
	mov	ip, r0
	ldr	r2, .L16+24
	mov	r3, #8
	ldr	r1, [r2]
	mov	r0, r4
	add	r2, sp, #4
	str	ip, [sp, #8]
	bl	mt312_write
	cmp	r0, #0
	blt	.L1
	ldr	r3, .L16+28
	mov	r2, #50
	mov	r0, r4
	ldr	r1, [r3]
	bl	mt312_writereg
	cmp	r0, #0
	blt	.L1
	ldr	r2, [r4, #4]
	ldr	r3, .L16+32
	cmp	r2, #128
	moveq	r2, #51
	movne	r2, #83
	mov	r0, r4
	ldr	r1, [r3]
	str	r2, [sp, #4]
	bl	mt312_writereg
	cmp	r0, #0
	blt	.L1
	mov	r0, #140
	mov	ip, #152
	ldr	r3, .L16+36
	str	r0, [sp, #4]
	ldr	r1, [r3]
	mov	r0, r4
	mov	r3, #8
	add	r2, sp, #4
	str	ip, [sp, #8]
	bl	mt312_write
	cmp	r0, #0
	blt	.L1
	ldr	r3, .L16+40
	mov	r0, r4
	mov	r2, #105
	ldr	r1, [r3]
	bl	mt312_writereg
	and	r0, r0, r0, asr #31
.L1:
	ldr	r3, .L16+4
	ldr	r2, [r3]
	ldr	r3, [sp, #36]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L15
	add	sp, sp, #40
	@ sp needed
	pop	{r4, r5, r6, pc}
.L5:
	ldr	r3, .L16+44
	mov	r2, r5
	mov	r0, r4
	ldr	r1, [r3]
	bl	mt312_writereg
	cmp	r0, #0
	blt	.L1
	mov	ip, #176
	ldr	r6, .L16+48
	mov	r3, #2
	mov	r0, r4
	ldr	r1, [r6]
	add	r2, sp, #4
	str	r5, [sp, #4]
	str	ip, [sp, #8]
	bl	mt312_write
	cmp	r0, #0
	blt	.L1
	mov	r2, #0
	mov	r0, r4
	ldr	r1, [r6]
	bl	mt312_writereg
	cmp	r0, #0
	blt	.L1
	ldr	r3, .L16+52
	mov	r2, #0
	mov	r0, r4
	ldr	r1, [r3]
	bl	mt312_writereg
	cmp	r0, #0
	bge	.L7
	b	.L1
.L15:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	CONFIG
	.word	.LC1
	.word	.LANCHOR0
	.word	VIT_SETUP
	.word	1000000
	.word	88000
	.word	SYS_CLK
	.word	SNR_THS_HIGH
	.word	OP_CTRL
	.word	TS_SW_LIM_L
	.word	CS_SW_LIM
	.word	GPP_CTRL
	.word	HW_CTRL
	.word	MPEG_CTRL
	.size	mt312_initfe, .-mt312_initfe
	.comm	VIT_SETUP,4,4
	.comm	TS_SW_LIM_L,4,4
	.comm	SYS_CLK,4,4
	.comm	SNR_THS_HIGH,4,4
	.comm	OP_CTRL,4,4
	.comm	MPEG_CTRL,4,4
	.comm	HW_CTRL,4,4
	.comm	GPP_CTRL,4,4
	.comm	CS_SW_LIM,4,4
	.comm	CONFIG,4,4
	.section	.rodata
	.align	2
	.set	.LANCHOR0,. + 0
.LC0:
	.word	20
	.word	18
	.word	3
	.word	2
	.word	1
	.word	0
	.word	0
	.word	0
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
