	.section .text.m0, "ax"
	.file	"channelEstAsm.m0.asm"
	// DO NOT MODIFY THE CONTENT ABOVE

	.global channelEstAsm
	channelEstAsm:

	R1:M[0]->BIU1.T0;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	BIU1:Load(T0)(A++) -> M[0](Mode0)|| SHU0:VImm(0) -> SHU0.T4(Mode0);//ShiftMode0
	BIU1:Load(T0)(A++) -> M[1](Mode0);//InputA
	BIU1:Load(T0)(A++) -> M[2](Mode0);//InputB
	BIU1:Load(T0)(A++) -> M[3](Mode0);//Output
	BIU1:Load(T0)(A++) -> M[63](Mode0);//ki
	BIU1:Load(T0)(A++) -> M[4](Mode0);//ShiftMode1
	BIU1:Load(T0)(A++) -> SHU0.T0(Mode0);//Index
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	R0:M[0] -> IMA0.T0(Mode0)||R1:M[4] -> IMA0.T1(Mode0);
	R0:M[0] -> IMA1.T0(Mode0)||R1:M[4] -> IMA1.T1(Mode0);
	R2:M[0] -> IMA2.T0(Mode0)||R3:M[4] -> IMA2.T1(Mode0);
	R3:M[0] -> IMA3.T0(Mode0)||R2:M[4] -> IMA3.T1(Mode0);
	R0:M[1] -> BIU0.T0(Mode0);
	R3:M[2] -> BIU3.T0(Mode0);
	R2:M[3] -> BIU2.T0(Mode0);//output1
	NOP;
	IMA0:SetShiftMode(T0) -> SHIFTMODE0(Mode0)||IMA1:SetShiftMode(T0) -> SHIFTMODE0(Mode0)||IMA2:SetShiftMode(T0) -> SHIFTMODE0(Mode0)||IMA3:SetShiftMode(T0) -> SHIFTMODE0(Mode0);
	R5:PreConfig(M[63])(Mode0);
	R5:WriteConf(Mfetch)->KI[0-3](Mode0);
	R5:WriteConf(Mfetch)->KI[4-7](Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
MFetch:LPTO %Double @(KI1 - 0);
	IMA0:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA0.MR(Mode0);
	IMA1:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA1.MR(Mode0);
	IMA2:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA2.MR(Mode0);
	IMA3:0+0*0(ShiftMode0)(C)(B)(SSS)(T) -> IMA3.MR(Mode0);
MFetch:LPTO %ComplexMult_Loop @(KI0 - 0);
	BIU0:Load(T0)(A++)-> SHU0.T1(Mode0)||BIU3:Load(T0)(A++)-> IMA0.T2(Mode0);
	BIU0:Load(T0)(A++)-> SHU0.T2(Mode0)||BIU3:Load(T0)(A++)-> IMA1.T2(Mode0);
	/*BIU0:Load(T0)(A++)-> IMA2.T1(Mode0)||BIU3:Load(T0)(A++)-> IMA2.T2(Mode0);
	BIU0:Load(T0)(A++)-> IMA3.T1(Mode0)||BIU3:Load(T0)(A++)-> IMA3.T2(Mode0);*/
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	NOP;
	SHU0:Index(T4,T1,T0) -> IMA0.T1(Mode0);
	SHU0:Index(T4,T2,T0) -> IMA1.T1(Mode0);
	NOP;
	NOP;
	IMA0:MR+T1*T2(ShiftMode0)(C)(S)(SSS)(T) -> IMA0.MR(Mode0);
	IMA1:MR+T1*T2(ShiftMode0)(C)(S)(SSS)(T) -> IMA1.MR(Mode0);
	/*IMA2:MR+T1*T2(ShiftMode0)(C)(S)(SSS)(T) -> IMA2.MR(Mode0);
	IMA3:MR+T1*T2(ShiftMode0)(C)(S)(SSS)(T) -> IMA3.MR(Mode0);*/
ComplexMult_Loop:
	NOP;
	NOP;
	NOP;
	IMA0:MR+0*0(ShiftMode0)(C)(S)(SSS)(T) -> BIU2.T1(Mode0);
	IMA1:MR+0*0(ShiftMode0)(C)(S)(SSS)(T) -> BIU2.T2(Mode0);
	NOP;
	NOP;
	NOP;
	NOP;
	BIU2:Store(T1,T0)(Mode0)(A++);
	BIU2:Store(T2,T0)(Mode0)(A++);
	NOP;
	NOP;
	NOP;
Double:
	MFetch:Repeat @(10);
	MFetch:MPU.STOP;
