m_gl100d.c

4th part of generated file


static void P_EventRouter_4018 (tSF_P_EventRouter_4018 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	{
	  static BYTE TMP[3] = {86,49,49};
	  FP->VerNoFacit_3635 = TMP;
	}
	{
	  static BYTE TMP[8] = {78,97,109,101,108,101,115,115};
	  FP->TankName_3637 = TMP;
	}
	{
	  static INT TMP[12] = {1,1,1,1,0,0,1,1,1,1,1,0};
	  FP->SubscribedDefault_3640 = (INT*)TMP;
	}
	{
	  static REAL32 TMP[12] = {2.0000001e-003,2.0000001e-003,1.0000000e+001,1.0000000e+000,2.0000001e-003,0.0000000e+000,2.0000001e-003,1.0000000e+000,1.0000000e+000,1.0000000e+000,1.0000000e+000,0.0000000e+000};
	  FP->DeltaDefault_3643 = (REAL32*)TMP;
	}
	{
	  static INT TMP[6] = {120000,120000,4000,120000,0x36EE80,120000};
	  FP->TimeoutDefault_3647 = (INT*)TMP;
	}
	{
	  static BOOL TMP[12] = {false,false,false,false,false,false,true,true,true,true,true,true};
	  FP->IsPolledDefault_3651 = (BOOL*)TMP;
	}
	FP->ChanBundle_3654[0] = FP->Chain->chan230i_3602;
	FP->ChanBundle_3654[1] = FP->Chain->chan220i_3601;
	FP->ChanBundle_3654[2] = FP->Chain->chan210i_3599;
	{
	  static INT TMP[12] = {0,0,1,1,0,-1,0,0,0,0,0,-1};
	  FP->UserOfF32OutDefault_3664 = (INT*)TMP;
	}
	{
	  static INT TMP[8][2] = {{7,1},{1,0},{1,1},{2,0},{2,1},{4,0},{4,1},{7,0}};
	  FP->LEDTestSequence_3717 = (INT*)TMP;
	}
	{
	  INT allDefaults_3831[42];
	  INT status_3832;
	  {
	    BREAKPOINT_F(24); // Init
	    status_3832 = 0; 
	    P_FillAllDefaults_3789(FP,(INT*)allDefaults_3831,&status_3832);
	    P_VerifyAndInit_If_3780(FP,42,(INT*)allDefaults_3831,&status_3832);
	    if ((status_3832 != 0))
	    {
	      SETERR(MSG_STOP);
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	FP->globalTime_ms_3665 = ReadTimer();
	{
	  INT i_3833;
	  for (i_3833 = 0; i_3833 != 0 + 3; i_3833++)
	  {
	    {
	      {
		INT Offset_3834;
		Offset_3834 = (INT)(i_3833 * 4);
		{
		  *((INT*)(((BYTE*)FP->eU16Out_3668)+((Offset_3834 + 0)*sizeof(INT)))) = 70;
		  *((INT*)(((BYTE*)FP->eU16Out_3668)+((Offset_3834 + 1)*sizeof(INT)))) = i_3833;
		  *((INT*)(((BYTE*)FP->eU16Out_3668)+((Offset_3834 + 2)*sizeof(INT)))) = 129;
		  *((INT*)(((BYTE*)FP->eU16Out_3668)+((Offset_3834 + 3)*sizeof(INT)))) = 0;
		}
	      }
	      *((INT*)(((BYTE*)FP->eU16Out_timer_ms_3685)+(i_3833*sizeof(INT)))) = FP->globalTime_ms_3665;
	    }
	  }
	}
	*((INT*)(((BYTE*)FP->stateOfU16Out_3618)+(0*sizeof(INT)))) = 0;
	*((INT*)(((BYTE*)FP->stateOfU16Out_3618)+(1*sizeof(INT)))) = 1;
	*((INT*)(((BYTE*)FP->stateOfU16Out_3618)+(2*sizeof(INT)))) = 0;
	*((INT*)(((BYTE*)FP->userOfU16Out_3661)+(0*sizeof(INT)))) = -2;
	*((INT*)(((BYTE*)FP->userOfU16Out_3661)+(1*sizeof(INT)))) = -2;
	*((INT*)(((BYTE*)FP->userOfU16Out_3661)+(2*sizeof(INT)))) = -2;
	FP->iOf_LEDTestSequence_3718 = 0;
	{
	  INT i_3835;
	  for (i_3835 = 0; i_3835 != 0 + 12; i_3835++)
	  {
	    {
	      {
		INT Offset_3836;
		Offset_3836 = (INT)(i_3835 * 4);
		{
		  *((INT*)(((BYTE*)FP->eF32Out_3669)+((Offset_3836 + 0)*sizeof(INT)))) = 71;
		  *((INT*)(((BYTE*)FP->eF32Out_3669)+((Offset_3836 + 1)*sizeof(INT)))) = i_3835;
		  *((INT*)(((BYTE*)FP->eF32Out_3669)+((Offset_3836 + 2)*sizeof(INT)))) = 0;
		  *((INT*)(((BYTE*)FP->eF32Out_3669)+((Offset_3836 + 3)*sizeof(INT)))) = MOSTNEGINT32;
		}
	      }
	      *((INT*)(((BYTE*)FP->eF32Out_timer_ms_3686)+(i_3835*sizeof(INT)))) = FP->globalTime_ms_3665;
	    }
	  }
	}
	ASSIGN(FP->userOfF32Out_3662,FP->UserOfF32OutDefault_3664,(12*sizeof(INT)));
	FP->iOfFairSendF32Out_3701 = 0;
	{
	  INT i_3837;
	  for (i_3837 = 0; i_3837 != 0 + 12; i_3837++)
	  {
	    {
	      *((REAL32*)(((BYTE*)FP->eF32Out_ValueLastProduced_3680)+(i_3837*sizeof(REAL32)))) = 0.0e+000;
	      *((BOOL*)(((BYTE*)FP->eF32Out_NoValueSent_3682)+(i_3837*sizeof(BOOL)))) = true;
	    }
	  }
	}
	FP->exceptionHandlerBlocked_3684 = false;
	{
	  INT i_3838;
	  for (i_3838 = 0; i_3838 != 0 + 5; i_3838++)
	  {
	    {
	      ASSIGN(((INT*)(((BYTE*)FP->eErrOut_3670)+(i_3838*(3*sizeof(INT))))),FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068,(3*sizeof(INT)));
	      *((INT*)(((BYTE*)FP->stateOfErrOut_3620)+(i_3838*sizeof(INT)))) = 1;
	    }
	  }
	}
	ASSIGN(FP->eErrOut_next_3672,FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068,(3*sizeof(INT)));
	FP->eErrOut_next_i_3674 = 0;
	FP->eErrOut_next_do_3673 = false;
	ASSIGN(FP->eErrOut_last_3675,FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068,(3*sizeof(INT)));
	FP->eErrOut_timer_ms_3688 = FP->globalTime_ms_3665;
	{
	  INT *_V35_3839;
	  {
	    static INT TMP[16] = {76,0,0,0,255,0,0,0,0,0,0,0,0,255,0,0};
	    _V35_3839 = (INT*)TMP;
	  }
	  ASSIGN(FP->eG4AlaOut_3679,_V35_3839,(16*sizeof(INT)));
	}
	FP->eG4AlaOut_timer_ms_3689 = FP->globalTime_ms_3665;
	FP->stateOfG4AlaOut_3622 = 1;
	*((INT*)(((BYTE*)FP->eDim2Out_3671)+(0*sizeof(INT)))) = 75;
	*((INT*)(((BYTE*)FP->eDim2Out_3671)+(1*sizeof(INT)))) = 0;
	FP->stateOfDim2Out_3623 = 1;
	FP->eDim2Out_timer_ms_3698 = FP->globalTime_ms_3665;
	FP->lowPriOut_delayTimer_activeNow_3691 = false;
	P_StartSendHighPriUntilEmpty_3790(FP);
	FP->sendLowPriUntilEmpty_3703 = false;
	FP->globalTime_ms_3665 = (FP->globalTime_ms_3665 + 10000);
	{
	  INT *IndexOfEvent_3841;
	  INT i_3842;
	  {
	    static INT TMP[1] = {0};
	    IndexOfEvent_3841 = (INT*)TMP;
	  }
	  for (i_3842 = 0; i_3842 != 0 + 1; i_3842++)
	  {
	    {
	      {
		INT Offset_3843;
		Offset_3843 = (INT)(i_3842 * 4);
		{
		  *((INT*)(((BYTE*)FP->eU16In_3676)+((Offset_3843 + 0)*sizeof(INT)))) = 80;
		  *((INT*)(((BYTE*)FP->eU16In_3676)+((Offset_3843 + 1)*sizeof(INT)))) = *((INT*)(((BYTE*)IndexOfEvent_3841)+(i_3842*sizeof(INT))));
		  *((INT*)(((BYTE*)FP->eU16In_3676)+((Offset_3843 + 2)*sizeof(INT)))) = 0;
		  *((INT*)(((BYTE*)FP->eU16In_3676)+((Offset_3843 + 3)*sizeof(INT)))) = i_3842;
		}
	      }
	      *((INT*)(((BYTE*)FP->stateOfU16In_3621)+(i_3842*sizeof(INT)))) = 1;
	      *((INT*)(((BYTE*)FP->eU16In_timer_ms_3687)+(i_3842*sizeof(INT)))) = FP->globalTime_ms_3665;
	      *((INT*)(((BYTE*)FP->timeoutOfU16In_ms_3700)+(i_3842*sizeof(INT)))) = 120000;
	      *((BOOL*)(((BYTE*)FP->eU16In_ReceivedOrTimeout_3683)+(i_3842*sizeof(BOOL)))) = false;
	    }
	  }
	}
	{
	  REAL32 *Default_3845;
	  INT *IndexOfEvent_3847;
	  INT i_3848;
	  {
	    static REAL32 TMP[2] = {1.0000000e+000,4.5000000e+000};
	    Default_3845 = (REAL32*)TMP;
	  }
	  {
	    static INT TMP[2] = {0,1};
	    IndexOfEvent_3847 = (INT*)TMP;
	  }
	  for (i_3848 = 0; i_3848 != 0 + 2; i_3848++)
	  {
	    {
	      {
		INT Offset_3849;
		Offset_3849 = (INT)(i_3848 * 4);
		{
		  *((INT*)(((BYTE*)FP->eF32In_3677)+((Offset_3849 + 0)*sizeof(INT)))) = 81;
		  *((INT*)(((BYTE*)FP->eF32In_3677)+((Offset_3849 + 1)*sizeof(INT)))) = *((INT*)(((BYTE*)IndexOfEvent_3847)+(i_3848*sizeof(INT))));
		  *((INT*)(((BYTE*)FP->eF32In_3677)+((Offset_3849 + 2)*sizeof(INT)))) = 0;
		  {
		    REAL32 value_3850;
		    value_3850 = *(REAL32*)((INT*)(((BYTE*)FP->eF32In_3677)+((Offset_3849 + 3)*sizeof(INT))));
		    value_3850 = *((REAL32*)(((BYTE*)Default_3845)+(i_3848*sizeof(REAL32)))); 
		    *(REAL32*)((INT*)(((BYTE*)FP->eF32In_3677)+((Offset_3849 + 3)*sizeof(INT)))) = value_3850;
		  }
		}
	      }
	      *((INT*)(((BYTE*)FP->stateOfF32In_3624)+(i_3848*sizeof(INT)))) = 1;
	    }
	  }
	}
	{
	  INT i_3851;
	  for (i_3851 = 0; i_3851 != 0 + 17; i_3851++)
	  {
	    *((INT*)(((BYTE*)FP->eSeqF32In_3678)+(i_3851*sizeof(INT)))) = 0;
	  }
	}
	*((INT*)(((BYTE*)FP->eSeqF32In_3678)+(0*sizeof(INT)))) = 86;
	{
	  INT i_3852;
	  for (i_3852 = 0; i_3852 != 0 + 4; i_3852++)
	  {
	    *((INT*)(((BYTE*)FP->eSeqF32In_3678)+((5 + (i_3852 * 3))*sizeof(INT)))) = 255;
	  }
	}
	FP->stateOfSeqF32In_3625 = 1;
	GOTO(1);
      CASE(2):  
	{
	  INT iOfFront_3853;
	  INT front_3854[3];
	  {
	    BREAKPOINT_F(24); // Handle classReason
	    FP->now_ms_3666 = ReadTimer();
	    if (FP->eErrOut_next_do_3673)
	    {
	    }
	    else
	    if (FP->exceptionHandlerBlocked_3684)
	    {
	      {
		BREAKPOINT_F(24); // Let pending ExceptionHandler error go through! (1.22)
		FP->eErrOut_next_do_3673 = true;
		FP->eErrOut_next_i_3674 = 0;
		ASSIGN(FP->eErrOut_next_3672,((INT*)(((BYTE*)FP->eErrOut_3670)+(0*(3*sizeof(INT))))),(3*sizeof(INT)));
		FP->eErrOut_timer_ms_3688 = FP->now_ms_3666;
		P_StartSendHighPriUntilEmpty_3790(FP);
	      }
	    }
	    else
	    if (true)
	    {
	      {
		P_GetClassReasonFrontOfQueue_3810(FP,&iOfFront_3853,(INT*)front_3854);
		if ((iOfFront_3853 == -1))
		{
		  {
		    // Nothing new: Nothing to send and
		    // at least one message already sent,
		    // we'll wait until it gets normalized
		    FP->eErrOut_next_i_3674 = -1;
		  }
		}
		else
		if (F_IsEqualTo_3_1487(FP->Chain->Chain->Chain->Chain,(INT*)front_3854,(INT*)FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068))
		{
		  {
		    // NCR.AllOK is ok, but we don't want to make it ready to be sent
		    FP->eErrOut_next_i_3674 = -1;
		    ASSIGN(FP->eErrOut_last_3675,FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068,(3*sizeof(INT)));
		    ASSIGN(FP->eErrOut_next_3672,FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068,(3*sizeof(INT)));
		  }
		}
		else
		if (F_IsEqualTo_3_1487(FP->Chain->Chain->Chain->Chain,(INT*)front_3854,(INT*)FP->eErrOut_last_3675))
		{
		  {
		    // We don't want to repeat last value
		    FP->eErrOut_next_i_3674 = -1;
		  }
		}
		else
		if (true)
		{
		  {
		    BREAKPOINT_F(24); // New error message ready
		    FP->eErrOut_next_do_3673 = true;
		    FP->eErrOut_next_i_3674 = iOfFront_3853;
		    ASSIGN(FP->eErrOut_next_3672,front_3854,(3*sizeof(INT)));
		    FP->eErrOut_timer_ms_3688 = FP->now_ms_3666;
		    P_StartSendHighPriUntilEmpty_3790(FP);
		  }
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	    // Analyze eErrOut and set/clear INTERNAL FAULT LED
	    {
	      INT eErrOutCopy_3855[5][3];
	      {
		ASSIGN(eErrOutCopy_3855,FP->eErrOut_3670,(5*(3*sizeof(INT))));
		{
		  INT i_3856;
		  for (i_3856 = 0; i_3856 != 0 + 5; i_3856++)
		  {
		    {
		      INT *errOut_3857;
		      errOut_3857 = (INT*)((INT*)(((BYTE*)FP->eErrOut_3670)+(i_3856*(3*sizeof(INT)))));
		      if ((*((INT*)(((BYTE*)errOut_3857)+(1*sizeof(INT)))) == 22))
		      {
			ASSIGN(((INT*)(((BYTE*)eErrOutCopy_3855)+(i_3856*(3*sizeof(INT))))),FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068,(3*sizeof(INT)));
		      }
		      else
		      if (true)
		      {
		      }
		      else
		      {
			SETERR(MSG_IF);
		      }
		    }
		  }
		}
		{
		  INT i_3858;
		  for (i_3858 = 0; i_3858 != 0 + 5; i_3858++)
		  {
		    if (( ! F_IsEqualTo_3_1487(FP->Chain->Chain->Chain->Chain,(INT*)((INT*)(((BYTE*)eErrOutCopy_3855)+(i_3858*(3*sizeof(INT))))),(INT*)FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068)))
		    {
		      {
			INT *_V37_3859;
			{
			  static INT TMP[2] = {2,0};
			  _V37_3859 = (INT*)TMP;
			}
			P_PrepareToSendFrontLEDs_If_3830(FP,(INT*)_V37_3859,FP->now_ms_3666);
		      }
		    }
		    else
		    {
		      continue;
		    }
		    break;
		  }
		  if (i_3858 == (0 + 5))
		  if (true)
		  {
		    {
		      INT *_V36_3860;
		      {
			static INT TMP[2] = {2,1};
			_V36_3860 = (INT*)TMP;
		      }
		      P_PrepareToSendFrontLEDs_If_3830(FP,(INT*)_V36_3860,FP->now_ms_3666);
		    }
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		}
	      }
	    }
	  }
	}
	ALT();
	ENBC((FP->exceptionHandlerBlocked_3684 == false),FP->Chain->chan120i_3604);
	ENBC(true,FP->Chain->chan141i_3597);
	ENBC(true,FP->Chain->chan291i_3595);
	ENBC(true,FP->Chain->chan010i_3594);
	ENBT(true,FP->globalTime_ms_3665);
	ENBS(FP->sendHighPriUntilEmpty_3702);
	ENBT(FP->sendLowPriUntilEmpty_3703,FP->lowPriOut_delayTimer_ms_3690);
	ENBT(FP->lowPriOut_delayTimer_activeNow_3691,FP->lowPriOut_delayTimer_ms_3690);
	for (FP->_U90._S94.thisUser_3976 = 0; FP->_U90._S94.thisUser_3976 != 0 + 3; FP->_U90._S94.thisUser_3976++)
	{
	  ENBC(true,*((CHAN**)(((BYTE*)FP->ChanBundle_3654)+(FP->_U90._S94.thisUser_3976*sizeof(CHAN *)))));
	}
	ALTWT(3);
      CASE(3):  
	{
	  BOOL TMP = false;
	  TMP |= DISC(4,(FP->exceptionHandlerBlocked_3684 == false),FP->Chain->chan120i_3604);
	  TMP |= DISC(5,true,FP->Chain->chan141i_3597);
	  TMP |= DISC(6,true,FP->Chain->chan291i_3595);
	  TMP |= DISC(7,true,FP->Chain->chan010i_3594);
	  TMP |= DIST(8,true,FP->globalTime_ms_3665);
	  TMP |= DISS(9,FP->sendHighPriUntilEmpty_3702);
	  TMP |= DIST(10,FP->sendLowPriUntilEmpty_3703,FP->lowPriOut_delayTimer_ms_3690);
	  TMP |= DIST(11,FP->lowPriOut_delayTimer_activeNow_3691,FP->lowPriOut_delayTimer_ms_3690);
	  {
	    BOOL OLDTMP = TMP;
	    for (FP->_U90._S94.thisUser_3976 = 0; FP->_U90._S94.thisUser_3976 != 0 + 3; FP->_U90._S94.thisUser_3976++)
	    {
	      TMP |= DISC(12,true,*((CHAN**)(((BYTE*)FP->ChanBundle_3654)+(FP->_U90._S94.thisUser_3976*sizeof(CHAN *)))));
	      if (TMP && (!OLDTMP))FP->_U90._S94.thisUser_3976_Alt = FP->_U90._S94.thisUser_3976;
	      OLDTMP=TMP;
	    }
	  }
	  FP->_U90._S94.thisUser_3976 = FP->_U90._S94.thisUser_3976_Alt;
	}
	ALTEND();
      CASE(4):  
	INPUT(FP->Chain->chan120i_3604,FP->_U90._S94._U91._S95.nodetypeClassReason_3861,(3*sizeof(INT)),14);
      CASE(14):  
	{
	  BOOL change_notUsed_3862;
	  BOOL change_and_toBeSent_3863;
	  {
	    P_HandleClassReasonChange_3817(FP,0,(INT*)FP->_U90._S94._U91._S95.nodetypeClassReason_3861,&change_notUsed_3862,&change_and_toBeSent_3863);
	    if (change_and_toBeSent_3863)
	    {
	      FP->exceptionHandlerBlocked_3684 = true;
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	GOTO(13);
      CASE(5):  
	INPUT4(FP->Chain->chan141i_3597,&FP->_U90._S94._U91._S96.len_3865,15);
      CASE(15):  
	CHK(FP->_U90._S94._U91._S96.len_3865<=6,MSG_CITL);
	INPUT(FP->Chain->chan141i_3597,FP->_U90._S94._U91._S96.envelope_3864,(FP->_U90._S94._U91._S96.len_3865)*(sizeof(INT)),16);
      CASE(16):  
	BREAKPOINT_F(24); // Receive config data
	FP->_U90._S94._U91._S96.status_3869 = 0;
	ASSIGN(FP->_U90._S94._U91._S96.nodetypeClassReason_3870,FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068,(3*sizeof(INT)));
	FP->_U90._S94._U91._S96.sizeOfFile_3868 = *((INT*)(((BYTE*)FP->_U90._S94._U91._S96.envelope_3864)+(5*sizeof(INT))));
	if ((FP->_U90._S94._U91._S96.sizeOfFile_3868 == 0))
	{
	}
	else
	{
	  if (F_InRange_1472(3,FP->_U90._S94._U91._S96.sizeOfFile_3868,106))
	  {
	    {
	      INT address_3876;
	      INT verNoFacit_3877[3];
	      {
		address_3876 = *((INT*)(((BYTE*)FP->_U90._S94._U91._S96.envelope_3864)+(4*sizeof(INT))));
		ASSIGN (FP->_U90._S94._U91._S96.buffer_3867, ((INT*)address_3876), (3*sizeof(INT)));
		P_FillArrayWithBYTEs_1909(3,(INT*)verNoFacit_3877,3,(BYTE*)FP->VerNoFacit_3635);
		if (F_IsEqualTo_3_1487(FP->Chain->Chain->Chain->Chain,(INT*)((INT*)(((BYTE*)FP->_U90._S94._U91._S96.buffer_3867)+((0)*sizeof(INT)))),(INT*)verNoFacit_3877))
		{
		  if ((FP->_U90._S94._U91._S96.sizeOfFile_3868 != 53))
		  {
		    {
		      ASSIGN(FP->_U90._S94._U91._S96.nodetypeClassReason_3870,FP->Chain->Chain->Chain->Chain->NCR_Events_dat_SizeError_1104,(3*sizeof(INT)));
		      FP->_U90._S94._U91._S96.status_3869 = -1;
		    }
		  }
		  else
		  if (true)
		  {
		    {
		      // --- C embedded in occam, begin ---
		      // ---
		      ASSIGN (FP->_U90._S94._U91._S96.buffer_3867, ((INT*)address_3876), (FP->_U90._S94._U91._S96.sizeOfFile_3868*sizeof(INT)));
		      // ---
		      // --- C embedded in occam, end ---
		      {
			INT *allDefaults_3878;
			allDefaults_3878 = (INT*)((INT*)(((BYTE*)FP->_U90._S94._U91._S96.buffer_3867)+((11)*sizeof(INT))));
			CHK(42 == 42,MSG_AIM);
			{
			  P_VerifyAndInit_If_3780(FP,42,(INT*)allDefaults_3878,&FP->_U90._S94._U91._S96.status_3869);
			  if ((FP->_U90._S94._U91._S96.status_3869 == 0))
			  {
			  }
			  else
			  if ((FP->_U90._S94._U91._S96.status_3869 == 5))
			  {
			    {
			      ASSIGN(FP->_U90._S94._U91._S96.nodetypeClassReason_3870,FP->Chain->Chain->Chain->Chain->NCR_Events_dat_IsPolledError_1138,(3*sizeof(INT)));
			      FP->_U90._S94._U91._S96.status_3869 = -1;
			    }
			  }
			  else
			  if (true)
			  {
			    {
			      ASSIGN(FP->_U90._S94._U91._S96.nodetypeClassReason_3870,FP->Chain->Chain->Chain->Chain->NCR_Events_dat_SubscribedError_1106,(3*sizeof(INT)));
			      *((INT*)(((BYTE*)FP->_U90._S94._U91._S96.nodetypeClassReason_3870)+(2*sizeof(INT)))) = ((*((INT*)(((BYTE*)FP->_U90._S94._U91._S96.nodetypeClassReason_3870)+(2*sizeof(INT)))) - 1) + FP->_U90._S94._U91._S96.status_3869);
			      FP->_U90._S94._U91._S96.status_3869 = -1;
			    }
			  }
			  else
			  {
			    SETERR(MSG_IF);
			  }
			}
		      }
		    }
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		}
		else
		if (true)
		{
		  {
		    ASSIGN(FP->_U90._S94._U91._S96.nodetypeClassReason_3870,FP->Chain->Chain->Chain->Chain->NCR_Events_dat_OnlyVerV11Supported_1086,(3*sizeof(INT)));
		    FP->_U90._S94._U91._S96.status_3869 = -1;
		  }
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	  }
	  else
	  if (true)
	  {
	    {
	      ASSIGN(FP->_U90._S94._U91._S96.nodetypeClassReason_3870,FP->Chain->Chain->Chain->Chain->NCR_Events_dat_SizeError_1104,(3*sizeof(INT)));
	      FP->_U90._S94._U91._S96.status_3869 = -1;
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	P_SetProtocolType_1917(FP->Chain->Chain->Chain->Chain,6,(INT*)FP->_U90._S94._U91._S96.envelope_3864,5);
	if ((FP->_U90._S94._U91._S96.status_3869 == 0))
	{
	  P_SetTheProtocolCmd_1929(FP->Chain->Chain->Chain->Chain,6,(INT*)FP->_U90._S94._U91._S96.envelope_3864,1);
	}
	else
	if (true)
	{
	  P_SetTheProtocolCmd_1929(FP->Chain->Chain->Chain->Chain,6,(INT*)FP->_U90._S94._U91._S96.envelope_3864,2);
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->_Header.Temp.VINT = 3;
	OUTPUT4(FP->Chain->chan140o_3598,&FP->_Header.Temp.VINT,17);
      CASE(17):  
	OUTPUT(FP->Chain->chan140o_3598,FP->_U90._S94._U91._S96.envelope_3864,(3)*(sizeof(INT)),18);
      CASE(18):  
	{
	  /*lint -save -e529  not subsequently referenced */
	  {
	    BOOL change_notUsed_3879;
	    BOOL change_and_toBeSent_3880;
	    P_HandleClassReasonChange_3817(FP,4,(INT*)FP->_U90._S94._U91._S96.nodetypeClassReason_3870,&change_notUsed_3879,&change_and_toBeSent_3880);
	  }
	  /*lint -restore */
	}
	GOTO(13);
      CASE(6):  
	INPUT1(FP->Chain->chan291i_3595,&FP->_Header.Temp.VBYTE,19);
      CASE(19):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 0: GOTO (21);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(21):  
	SETERR(MSG_STOP);
	GOTO(20);
      CASE(20):  
	GOTO(13);
      CASE(7):  
	INPUT4(FP->Chain->chan010i_3594,&FP->_U90._S94._U91._S97.numberOfBytesOfPacket_3881,22);
      CASE(22):  
	INPUT4(FP->Chain->chan010i_3594,&FP->_U90._S94._U91._S97.numberOfInt32OfPacket_3882,23);
      CASE(23):  
	CHK(FP->_U90._S94._U91._S97.numberOfInt32OfPacket_3882<=11,MSG_CITL);
	INPUT(FP->Chain->chan010i_3594,FP->_U90._S94._U91._S97.packet_3884,(FP->_U90._S94._U91._S97.numberOfInt32OfPacket_3882)*(sizeof(INT)),24);
      CASE(24):  
	INPUT4(FP->Chain->chan010i_3594,&FP->_U90._S94._U91._S97.subnetNodeAddress_3883,25);
      CASE(25):  
	BREAKPOINT_F(24); // Input event from Lon
	FP->_U90._S94._U91._S97.ok_3886 = true;
	FP->now_ms_3666 = ReadTimer();
	{
	  INT iOfByteOfPackedAlbum_3892;
	  {
	    iOfByteOfPackedAlbum_3892 = 0; 
	    P_UnpackFromByteArray_1726(FP->Chain->Chain->Chain->Chain,1,11,(INT*)FP->_U90._S94._U91._S97.packet_3884,2,&iOfByteOfPackedAlbum_3892,&FP->_U90._S94._U91._S97.command_3885);
	    if ((FP->_U90._S94._U91._S97.command_3885 == 80))
	    {
	      {
		// Unpack PAlbValueU16EventIn:
		{
		  INT *_V40_3894;
		  {
		    static INT TMP[1] = {8466};
		    _V40_3894 = (INT*)TMP;
		  }
		  P_UnpackAlbumCommand_1779(FP->Chain->Chain->Chain->Chain,11,(INT*)FP->_U90._S94._U91._S97.packet_3884,1,(INT*)_V40_3894,17,(INT*)FP->_U90._S94._U91._S97.unpackedAlbum_3890,&FP->_U90._S94._U91._S97.noOfInt32OfTheProtocol_3891,31,(INT*)FP->_U90._S94._U91._S97.sop_iOfElement_NotUsed_3888,&FP->_U90._S94._U91._S97.sop_sizeOfIOfElement_NotUsed_3889,&FP->_U90._S94._U91._S97.ok_3886);
		}
	      }
	    }
	    else
	    if ((FP->_U90._S94._U91._S97.command_3885 == 81))
	    {
	      {
		// Unpack PAlbValueF32EventIn:
		{
		  INT *_V39_3895;
		  {
		    static INT TMP[1] = {8469};
		    _V39_3895 = (INT*)TMP;
		  }
		  P_UnpackAlbumCommand_1779(FP->Chain->Chain->Chain->Chain,11,(INT*)FP->_U90._S94._U91._S97.packet_3884,1,(INT*)_V39_3895,17,(INT*)FP->_U90._S94._U91._S97.unpackedAlbum_3890,&FP->_U90._S94._U91._S97.noOfInt32OfTheProtocol_3891,31,(INT*)FP->_U90._S94._U91._S97.sop_iOfElement_NotUsed_3888,&FP->_U90._S94._U91._S97.sop_sizeOfIOfElement_NotUsed_3889,&FP->_U90._S94._U91._S97.ok_3886);
		}
	      }
	    }
	    else
	    if ((FP->_U90._S94._U91._S97.command_3885 == 85))
	    {
	      {
		// Unpack PAlbAlaLimF32IndexedEventIn:
		{
		  INT *_V38_3896;
		  {
		    static INT TMP[1] = {135957};
		    _V38_3896 = (INT*)TMP;
		  }
		  P_UnpackAlbumCommand_1779(FP->Chain->Chain->Chain->Chain,11,(INT*)FP->_U90._S94._U91._S97.packet_3884,1,(INT*)_V38_3896,17,(INT*)FP->_U90._S94._U91._S97.unpackedAlbum_3890,&FP->_U90._S94._U91._S97.noOfInt32OfTheProtocol_3891,31,(INT*)FP->_U90._S94._U91._S97.sop_iOfElement_NotUsed_3888,&FP->_U90._S94._U91._S97.sop_sizeOfIOfElement_NotUsed_3889,&FP->_U90._S94._U91._S97.ok_3886);
		}
	      }
	    }
	    else
	    if ((FP->_U90._S94._U91._S97.command_3885 == 86))
	    {
	      {
		// Unpack PAlbValueSeqF32EventIn:
		P_UnpackAlbumCommand_1779(FP->Chain->Chain->Chain->Chain,11,(INT*)FP->_U90._S94._U91._S97.packet_3884,3,(INT*)FP->Chain->Chain->Chain->Chain->AlbumDecodeSeqF32_529,17,(INT*)FP->_U90._S94._U91._S97.unpackedAlbum_3890,&FP->_U90._S94._U91._S97.noOfInt32OfTheProtocol_3891,31,(INT*)FP->_U90._S94._U91._S97.sop_iOfElement_NotUsed_3888,&FP->_U90._S94._U91._S97.sop_sizeOfIOfElement_NotUsed_3889,&FP->_U90._S94._U91._S97.ok_3886);
	      }
	    }
	    else
	    if (true)
	    {
	      FP->_U90._S94._U91._S97.ok_3886 = false;
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	FP->_U90._S94._U91._S97.sendToUllCalc_3887 = false;
	if (!( ! FP->_U90._S94._U91._S97.ok_3886)) GOTO(27);
	GOTO(26);
      CASE(27):  
	if (!(FP->_U90._S94._U91._S97.command_3885 == 80)) GOTO(28);
	{
	  INT IndexOfEvent_3897;
	  INT StatusOfEvent_3898;
	  INT Value_3899;
	  IndexOfEvent_3897 = (INT)*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(1*sizeof(INT))));
	  StatusOfEvent_3898 = (INT)*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(2*sizeof(INT))));
	  Value_3899 = (INT)*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(3*sizeof(INT))));
	  if (((IndexOfEvent_3897 < 0) || (IndexOfEvent_3897 >= 1)))
	  {
	    FP->_U90._S94._U91._S97.ok_3886 = false;
	  }
	  else
	  if (true)
	  {
	    if ((*((INT*)(((BYTE*)FP->stateOfU16In_3621)+(RNGCHK(IndexOfEvent_3897,1)*sizeof(INT)))) != 0))
	    {
	      {
		{
		  INT *event_3900;
		  event_3900 = (INT*)((INT*)(((BYTE*)FP->eU16In_3676)+((RNGCHKUB((IndexOfEvent_3897 * 4),4,4),RNGCHKLB((IndexOfEvent_3897 * 4)))*sizeof(INT))));
		  CHK(4 == 4,MSG_AIM);
		  {
		    *((INT*)(((BYTE*)event_3900)+(0*sizeof(INT)))) = 80; 
		    *((INT*)(((BYTE*)event_3900)+(1*sizeof(INT)))) = IndexOfEvent_3897; 
		    *((INT*)(((BYTE*)event_3900)+(2*sizeof(INT)))) = StatusOfEvent_3898; 
		    *((INT*)(((BYTE*)event_3900)+(3*sizeof(INT)))) = Value_3899; 
		  }
		}
		*((INT*)(((BYTE*)FP->eU16In_timer_ms_3687)+(RNGCHK(IndexOfEvent_3897,1)*sizeof(INT)))) = FP->now_ms_3666;
		*((BOOL*)(((BYTE*)FP->eU16In_ReceivedOrTimeout_3683)+(RNGCHK(IndexOfEvent_3897,1)*sizeof(BOOL)))) = true;
		FP->_U90._S94._U91._S97.sendToUllCalc_3887 = true;
	      }
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	GOTO(26);
      CASE(28):  
	if (!(FP->_U90._S94._U91._S97.command_3885 == 81)) GOTO(29);
	{
	  INT IndexOfEvent_3901;
	  INT StatusOfEvent_3902;
	  INT Value_3903;
	  IndexOfEvent_3901 = (INT)*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(1*sizeof(INT))));
	  StatusOfEvent_3902 = (INT)*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(2*sizeof(INT))));
	  Value_3903 = (INT)*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(3*sizeof(INT))));
	  if (((IndexOfEvent_3901 < 0) || (IndexOfEvent_3901 >= 2)))
	  {
	    FP->_U90._S94._U91._S97.ok_3886 = false;
	  }
	  else
	  if (true)
	  {
	    {
	      INT *event_3904;
	      event_3904 = (INT*)((INT*)(((BYTE*)FP->eF32In_3677)+((RNGCHKUB((IndexOfEvent_3901 * 4),4,8),RNGCHKLB((IndexOfEvent_3901 * 4)))*sizeof(INT))));
	      CHK(4 == 4,MSG_AIM);
	      {
		if ((*((INT*)(((BYTE*)FP->stateOfF32In_3624)+(RNGCHK(IndexOfEvent_3901,2)*sizeof(INT)))) != 0))
		{
		  {
		    *((INT*)(((BYTE*)event_3904)+(0*sizeof(INT)))) = 81; 
		    *((INT*)(((BYTE*)event_3904)+(1*sizeof(INT)))) = IndexOfEvent_3901; 
		    *((INT*)(((BYTE*)event_3904)+(2*sizeof(INT)))) = StatusOfEvent_3902; 
		    *((INT*)(((BYTE*)event_3904)+(3*sizeof(INT)))) = Value_3903; 
		    FP->_U90._S94._U91._S97.sendToUllCalc_3887 = true;
		  }
		}
		else
		if (true)
		{
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	GOTO(26);
      CASE(29):  
	if (!(FP->_U90._S94._U91._S97.command_3885 == 85)) GOTO(30);
	BREAKPOINT_F(24); // Received packet
	if (!(FP->_U90._S94._U91._S97.noOfInt32OfTheProtocol_3891 == 5)) GOTO(32);
	OUTPUT4(FP->Chain->chan211o_3600,&FP->_U90._S94._U91._S97.noOfInt32OfTheProtocol_3891,33);
      CASE(33):  
	OUTPUT(FP->Chain->chan211o_3600,FP->_U90._S94._U91._S97.unpackedAlbum_3890,(FP->_U90._S94._U91._S97.noOfInt32OfTheProtocol_3891)*(sizeof(INT)),34);
      CASE(34):  
	GOTO(31);
      CASE(32):  
	if (!true) GOTO(35);
	FP->_U90._S94._U91._S97.ok_3886 = false;
	GOTO(31);
      CASE(35):  
	SETERR(MSG_IF);
      CASE(31):  
	GOTO(26);
      CASE(30):  
	if (!(FP->_U90._S94._U91._S97.command_3885 == 86)) GOTO(36);
	if ((*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(1*sizeof(INT)))) != 0))
	{
	  FP->_U90._S94._U91._S97.ok_3886 = false;
	}
	else
	if ((*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(2*sizeof(INT)))) != 0))
	{
	  FP->_U90._S94._U91._S97.ok_3886 = false;
	}
	else
	if ((*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(3*sizeof(INT)))) != 0))
	{
	  FP->_U90._S94._U91._S97.ok_3886 = false;
	}
	else
	if ((*((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+(4*sizeof(INT)))) > 4))
	{
	  FP->_U90._S94._U91._S97.ok_3886 = false;
	}
	else
	if ((FP->stateOfSeqF32In_3625 != 0))
	{
	  {
	    CHK(17==17,MSG_ASM);
	    ASSIGN(((INT*)(((BYTE*)FP->eSeqF32In_3678)+((0)*sizeof(INT)))),((INT*)(((BYTE*)FP->_U90._S94._U91._S97.unpackedAlbum_3890)+((0)*sizeof(INT)))),(17*sizeof(INT)));
	    FP->_U90._S94._U91._S97.sendToUllCalc_3887 = true;
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(26);
      CASE(36):  
	if (!true) GOTO(37);
	FP->_U90._S94._U91._S97.ok_3886 = false;
	GOTO(26);
      CASE(37):  
	SETERR(MSG_IF);
      CASE(26):  
	if (!FP->_U90._S94._U91._S97.sendToUllCalc_3887) GOTO(39);
	ASSIGN(((INT*)(((BYTE*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905)+((3)*sizeof(INT)))),FP->eU16In_3676,(4*sizeof(INT)));
	ASSIGN(((INT*)(((BYTE*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905)+((7)*sizeof(INT)))),FP->eF32In_3677,(8*sizeof(INT)));
	ASSIGN(((INT*)(((BYTE*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905)+((15)*sizeof(INT)))),FP->eSeqF32In_3678,(17*sizeof(INT)));
	P_SetProtocolType_1917(FP->Chain->Chain->Chain->Chain,32,(INT*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905,3);
	P_SetTheProtocolCmd_1929(FP->Chain->Chain->Chain->Chain,32,(INT*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905,4);
	P_SetNoOfInt32OfTheProtocol_1923(FP->Chain->Chain->Chain->Chain,32,(INT*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905,30);
	FP->_Header.Temp.VINT = F_EnvelopeLen_1936(FP->Chain->Chain->Chain->Chain,32,(INT*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905);
	OUTPUT4(FP->Chain->chan231o_3603,&FP->_Header.Temp.VINT,40);
      CASE(40):  
	OUTPUT(FP->Chain->chan231o_3603,FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905,(F_EnvelopeLen_1936(FP->Chain->Chain->Chain->Chain,32,(INT*)FP->_U90._S94._U91._S97._U93._S98.envelopeEventsIn_3905))*(sizeof(INT)),41);
      CASE(41):  
	GOTO(38);
      CASE(39):  
	if (!true) GOTO(42);
	GOTO(38);
      CASE(42):  
	SETERR(MSG_IF);
      CASE(38):  
	if (!( ! FP->_U90._S94._U91._S97.ok_3886)) GOTO(44);
	BREAKPOINT_F(24); // NCR.IllegalInputEvent
	// Unpack programming errors will also fall through to this point
	OUTPUT(FP->chan900internal_3608,FP->Chain->Chain->Chain->Chain->NCR_IllegalInputEvent_1076,(3*sizeof(INT)),45);
      CASE(45):  
	GOTO(43);
      CASE(44):  
	if (!true) GOTO(46);
	GOTO(43);
      CASE(46):  
	SETERR(MSG_IF);
      CASE(43):  
	GOTO(13);
      CASE(8):  
	BREAKPOINT_F(24); // timeout?
	FP->now_ms_3666 = ReadTimer();
	if ((FP->stateOfG4AlaOut_3622 != 0))
	{
	  if (((FP->now_ms_3666 - FP->eG4AlaOut_timer_ms_3689) > FP->timeoutOfAlaOut_ms_3695))
	  {
	    {
	      P_StartSendHighPriUntilEmpty_3790(FP);
	      FP->stateOfG4AlaOut_3622 = 2;
	      P_NextTimeoutIsHopefullySharp_3908(FP,FP->timeoutOfAlaOut_ms_3695,&FP->eG4AlaOut_timer_ms_3689);
	      {
		INT statusOfMonitored_3909;
		statusOfMonitored_3909 = *((INT*)(((BYTE*)FP->eG4AlaOut_3679)+(14*sizeof(INT))));
		statusOfMonitored_3909 = F_SetBits_1525(statusOfMonitored_3909,144); 
		*((INT*)(((BYTE*)FP->eG4AlaOut_3679)+(14*sizeof(INT)))) = statusOfMonitored_3909;
	      }
	    }
	  }
	  else
	  if (true)
	  {
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	{
	  INT i_3913;
	  for (i_3913 = 0; i_3913 != 0 + 3; i_3913++)
	  {
	    if ((*((INT*)(((BYTE*)FP->stateOfU16Out_3618)+(i_3913*sizeof(INT)))) != 0))
	    {
	      if (((FP->now_ms_3666 - *((INT*)(((BYTE*)FP->eU16Out_timer_ms_3685)+(i_3913*sizeof(INT))))) > FP->timeoutOfU16Out_ms_3692))
	      {
		{
		  P_StartSendHighPriUntilEmpty_3790(FP);
		  *((INT*)(((BYTE*)FP->stateOfU16Out_3618)+(i_3913*sizeof(INT)))) = 2;
		  P_NextTimeoutIsHopefullySharp_3908(FP,FP->timeoutOfU16Out_ms_3692,((INT*)(((BYTE*)FP->eU16Out_timer_ms_3685)+(i_3913*sizeof(INT)))));
		  BREAKPOINT_F(24); // U16 out again?
		  if (((i_3913 == 1) && false))
		  {
		    {
		      INT leds_3914;
		      {
			leds_3914 = *((INT*)(((BYTE*)FP->eU16Out_3668)+(7*sizeof(INT))));
			P_ModifyFrontLEDs_3821(FP,(INT*)((INT*)(((BYTE*)FP->LEDTestSequence_3717)+(RNGCHK(FP->iOf_LEDTestSequence_3718,8)*(2*sizeof(INT))))),&leds_3914);
			*((INT*)(((BYTE*)FP->eU16Out_3668)+(7*sizeof(INT)))) = leds_3914;
			FP->iOf_LEDTestSequence_3718 = ((FP->iOf_LEDTestSequence_3718 + 1) % 8);
		      }
		    }
		  }
		  else
		  if (true)
		  {
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		}
	      }
	      else
	      if (true)
	      {
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	if (FP->eErrOut_next_do_3673)
	{
	}
	else
	if (((FP->now_ms_3666 - FP->eErrOut_timer_ms_3688) > FP->timeoutOfErrOut_ms_3694))
	{
	  {
	    BREAKPOINT_F(24); // Timeout of error
	    P_NextTimeoutIsHopefullySharp_3908(FP,FP->timeoutOfErrOut_ms_3694,&FP->eErrOut_timer_ms_3688);
	    if (F_IsEqualTo_3_1487(FP->Chain->Chain->Chain->Chain,(INT*)FP->eErrOut_last_3675,(INT*)FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068))
	    {
	    }
	    else
	    if (true)
	    {
	      {
		FP->eErrOut_next_i_3674 = -1;
		FP->eErrOut_next_do_3673 = true;
		ASSIGN(FP->eErrOut_next_3672,FP->eErrOut_last_3675,(3*sizeof(INT)));
		P_StartSendHighPriUntilEmpty_3790(FP);
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (((FP->now_ms_3666 - FP->eDim2Out_timer_ms_3698) > FP->timeoutOfDim2Out_ms_3699))
	{
	  {
	    BREAKPOINT_F(24); // Timeout of Dim2 out
	    P_StartSendHighPriUntilEmpty_3790(FP);
	    FP->stateOfDim2Out_3623 = 2;
	    P_NextTimeoutIsHopefullySharp_3908(FP,FP->timeoutOfDim2Out_ms_3699,&FP->eDim2Out_timer_ms_3698);
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	{
	  INT i_3915;
	  for (i_3915 = 0; i_3915 != 0 + 12; i_3915++)
	  {
	    if ((*((INT*)(((BYTE*)FP->stateOfF32Out_3619)+(i_3915*sizeof(INT)))) != 0))
	    {
	      if (((FP->now_ms_3666 - *((INT*)(((BYTE*)FP->eF32Out_timer_ms_3686)+(i_3915*sizeof(INT))))) > FP->timeoutOfF32Out_ms_3693))
	      {
		{
		  P_StartSendLowPri_3798(FP,FP->now_ms_3666);
		  *((INT*)(((BYTE*)FP->stateOfF32Out_3619)+(i_3915*sizeof(INT)))) = 2;
		  P_NextTimeoutIsHopefullySharp_3908(FP,FP->timeoutOfF32Out_ms_3693,((INT*)(((BYTE*)FP->eF32Out_timer_ms_3686)+(i_3915*sizeof(INT)))));
		  BREAKPOINT_F(24); // F32 out again?
		  {
		    INT Offset_3916;
		    INT stateOfEvent_3917;
		    Offset_3916 = (INT)(i_3915 * 4);
		    stateOfEvent_3917 = *((INT*)(((BYTE*)FP->eF32Out_3669)+((Offset_3916 + 2)*sizeof(INT))));
		    {
		      stateOfEvent_3917 = F_ClearBits_1530(FP->Chain->Chain->Chain->Chain,stateOfEvent_3917,136);
		      stateOfEvent_3917 = F_SetBits_1525(stateOfEvent_3917,144); 
		      {
			INT Value_3921;
			Value_3921 = *(INT*)((REAL32*)(((BYTE*)FP->eF32Out_ValueLastProduced_3680)+(i_3915*sizeof(REAL32))));
			*((INT*)(((BYTE*)FP->eF32Out_3669)+((Offset_3916 + 3)*sizeof(INT)))) = Value_3921;
			*(INT*)((REAL32*)(((BYTE*)FP->eF32Out_ValueLastProduced_3680)+(i_3915*sizeof(REAL32)))) = Value_3921;
		      }
		    }
		    *((INT*)(((BYTE*)FP->eF32Out_3669)+((Offset_3916 + 2)*sizeof(INT)))) = stateOfEvent_3917;
		  }
		}
	      }
	      else
	      if (true)
	      {
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	FP->_U90._S94._U91._S99.i_3922 = 0;
	GOTO(47);
      CASE(48):  
	if (!(*((INT*)(((BYTE*)FP->stateOfU16In_3621)+(FP->_U90._S94._U91._S99.i_3922*sizeof(INT)))) != 0)) GOTO(50);
	FP->_U90._S94._U91._S99.statusOfEvent_3923 = *((INT*)(((BYTE*)FP->eU16In_3676)+(((FP->_U90._S94._U91._S99.i_3922 * 4) + 2)*sizeof(INT))));
	FP->_U90._S94._U91._S99.receivedOrTimeout_3924 = *((BOOL*)(((BYTE*)FP->eU16In_ReceivedOrTimeout_3683)+(FP->_U90._S94._U91._S99.i_3922*sizeof(BOOL))));
	if (!((FP->_U90._S94._U91._S99.receivedOrTimeout_3924 == false) || (FP->_U90._S94._U91._S99.statusOfEvent_3923 != 0))) GOTO(52);
	if (!((FP->now_ms_3666 - *((INT*)(((BYTE*)FP->eU16In_timer_ms_3687)+(FP->_U90._S94._U91._S99.i_3922*sizeof(INT))))) > *((INT*)(((BYTE*)FP->timeoutOfU16In_ms_3700)+(FP->_U90._S94._U91._S99.i_3922*sizeof(INT)))))) GOTO(54);
	FP->_U90._S94._U91._S99.statusOfEvent_3923 = 0;
	{
	  static INT TMP[1][3] = {{4,32,7}};
	  FP->_U90._S94._U91._S99.NCR_Timeout2minOfU16In_3926 = (INT*)TMP;
	}
	OUTPUT(FP->chan900internal_3608,((INT*)(((BYTE*)FP->_U90._S94._U91._S99.NCR_Timeout2minOfU16In_3926)+(FP->_U90._S94._U91._S99.i_3922*(3*sizeof(INT))))),(3*sizeof(INT)),55);
      CASE(55):  
	FP->_U90._S94._U91._S99.receivedOrTimeout_3924 = true;
	GOTO(53);
      CASE(54):  
	if (!true) GOTO(56);
	GOTO(53);
      CASE(56):  
	SETERR(MSG_IF);
      CASE(53):  
	*((BOOL*)(((BYTE*)FP->eU16In_ReceivedOrTimeout_3683)+(FP->_U90._S94._U91._S99.i_3922*sizeof(BOOL)))) = FP->_U90._S94._U91._S99.receivedOrTimeout_3924;
	*((INT*)(((BYTE*)FP->eU16In_3676)+(((FP->_U90._S94._U91._S99.i_3922 * 4) + 2)*sizeof(INT)))) = FP->_U90._S94._U91._S99.statusOfEvent_3923;
	GOTO(51);
      CASE(52):  
	if (!true) GOTO(57);
	GOTO(51);
      CASE(57):  
	SETERR(MSG_IF);
      CASE(51):  
	GOTO(49);
      CASE(50):  
	if (!true) GOTO(58);
	GOTO(49);
      CASE(58):  
	SETERR(MSG_IF);
      CASE(49):  
	FP->_U90._S94._U91._S99.i_3922++;
      CASE(47):  
	if (FP->_U90._S94._U91._S99.i_3922 != (0+1)) GOTO(48);
	FP->globalTime_ms_3665 = (FP->globalTime_ms_3665 + 10000);
	GOTO(13);
      CASE(9):  
	BREAKPOINT_F(24); // Send just one HighPri event
	FP->_U90._S94._U91._S100.sendByteStream_3928 = false;
	FP->now_ms_3666 = ReadTimer();
	FP->_U90._S94._U91._S100.ok_3927 = true;
	if ((FP->stateOfDim2Out_3623 == 2))
	{
	  {
	    {
	      INT *UnpackedAlbum_3931;
	      INT *AlbumDecodeThis_3933;
	      UnpackedAlbum_3931 = (INT*)FP->eDim2Out_3671;
	      {
		static INT TMP[1] = {0x211515};
		AlbumDecodeThis_3933 = (INT*)TMP;
	      }
	      {
		// Make DimOut
		{
		  INT sop_iOfElement_NotUsed_3934[31];
		  INT sop_sizeOfIOfElement_NotUsed_3935;
		  P_PackAlbumReply_1844(FP->Chain->Chain->Chain->Chain,9,(INT*)FP->_U90._S94._U91._S100.packedAlbum_3930,&FP->_U90._S94._U91._S100.noOfBytesOfPackedAlbum_3929,1,(INT*)AlbumDecodeThis_3933,6,(INT*)UnpackedAlbum_3931,31,(INT*)sop_iOfElement_NotUsed_3934,&sop_sizeOfIOfElement_NotUsed_3935,&FP->_U90._S94._U91._S100.ok_3927);
		}
	      }
	    }
	    FP->_U90._S94._U91._S100.sendByteStream_3928 = true;
	    FP->stateOfDim2Out_3623 = 1;
	  }
	}
	else
	if ((FP->stateOfG4AlaOut_3622 == 2))
	{
	  {
	    // Make Alarm status
	    {
	      INT sop_iOfElement_NotUsed_3936[31];
	      INT sop_sizeOfIOfElement_NotUsed_3937;
	      P_PackAlbumReply_1844(FP->Chain->Chain->Chain->Chain,9,(INT*)FP->_U90._S94._U91._S100.packedAlbum_3930,&FP->_U90._S94._U91._S100.noOfBytesOfPackedAlbum_3929,2,(INT*)FP->Chain->Chain->Chain->Chain->AlbumDecodeAlaG4_523,16,(INT*)FP->eG4AlaOut_3679,31,(INT*)sop_iOfElement_NotUsed_3936,&sop_sizeOfIOfElement_NotUsed_3937,&FP->_U90._S94._U91._S100.ok_3927);
	    }
	    FP->_U90._S94._U91._S100.sendByteStream_3928 = true;
	    FP->stateOfG4AlaOut_3622 = 1;
	  }
	}
	else
	{
	  INT i_3938;
	  for (i_3938 = 0; i_3938 != 0 + 3; i_3938++)
	  {
	    if ((*((INT*)(((BYTE*)FP->stateOfU16Out_3618)+(i_3938*sizeof(INT)))) == 2))
	    {
	      {
		BREAKPOINT_F(24); // Send U16Out
		{
		  INT *UnpackedAlbum_3939;
		  UnpackedAlbum_3939 = (INT*)((INT*)(((BYTE*)FP->eU16Out_3668)+(((i_3938 * 4))*sizeof(INT))));
		  CHK(4 == 4,MSG_AIM);
		  {
		    // Make U16
		    {
		      INT sop_iOfElement_NotUsed_3940[31];
		      INT sop_sizeOfIOfElement_NotUsed_3941;
		      INT *_V42_3942;
		      {
			static INT TMP[1] = {8466};
			_V42_3942 = (INT*)TMP;
		      }
		      P_PackAlbumReply_1844(FP->Chain->Chain->Chain->Chain,9,(INT*)FP->_U90._S94._U91._S100.packedAlbum_3930,&FP->_U90._S94._U91._S100.noOfBytesOfPackedAlbum_3929,1,(INT*)_V42_3942,4,(INT*)UnpackedAlbum_3939,31,(INT*)sop_iOfElement_NotUsed_3940,&sop_sizeOfIOfElement_NotUsed_3941,&FP->_U90._S94._U91._S100.ok_3927);
		    }
		  }
		}
		FP->_U90._S94._U91._S100.sendByteStream_3928 = true;
		*((INT*)(((BYTE*)FP->stateOfU16Out_3618)+(i_3938*sizeof(INT)))) = 1;
	      }
	    }
	    else
	    {
	      continue;
	    }
	    break;
	  }
	  if (i_3938 == (0 + 3))
	  if (FP->eErrOut_next_do_3673)
	  {
	    {
	      BREAKPOINT_F(24); // Send error
	      FP->eErrOut_next_do_3673 = false;
	      {
		INT unpackedAlbum_3943[10];
		{
		  *((INT*)(((BYTE*)unpackedAlbum_3943)+(0*sizeof(INT)))) = 72; 
		  *((INT*)(((BYTE*)unpackedAlbum_3943)+(1*sizeof(INT)))) = 0; 
		  ASSIGN(((INT*)(((BYTE*)unpackedAlbum_3943)+((2)*sizeof(INT)))),FP->eErrOut_next_3672,(3*sizeof(INT)));
		  if ((F_GetLEDs_3822(FP) == 0))
		  {
		    {
		      #ifndef NO_BREAKPOINT_C
		      {
			 // Assertion for 34.1 in <a href="Tst01_v124_Acceptance-test.htm#GLKDSP=1034.1">Tst01_v124_Acceptance-test.htm (GLKDSP=1034.1)</a>
			 // GLKDSP=1034.1: Assert no error message if LEDs are off (for Tst01_v124_Acceptance-test.htm chapter 34.1)
			 SETERR (MSG_NULL);
		      }
		      #endif
		    }
		  }
		  else
		  if (true)
		  {
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		  if (F_IsEqualTo_3_1487(FP->Chain->Chain->Chain->Chain,(INT*)FP->eErrOut_next_3672,(INT*)FP->Chain->Chain->Chain->Chain->NCR_AllOK_1068))
		  {
		    {
		      #ifndef NO_BREAKPOINT_C
		      {
			 // Assertion for 34.2 in <a href="Tst01_v124_Acceptance-test.htm#GLKDSP=1034.2">Tst01_v124_Acceptance-test.htm (GLKDSP=1034.2)</a>
			 // GLKDSP=1034.2: Assert [4,20,0] not to be sent (for Tst01_v124_Acceptance-test.htm chapter 34.2)
			 SETERR (MSG_NULL);
		      }
		      #endif
		    }
		  }
		  else
		  if (true)
		  {
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		  *((INT*)(((BYTE*)unpackedAlbum_3943)+(5*sizeof(INT)))) = 0; 
		  {
		    INT *_V41_3945;
		    {
		      static INT TMP[4] = {0,0,0,0};
		      _V41_3945 = (INT*)TMP;
		    }
		    ASSIGN(((INT*)(((BYTE*)unpackedAlbum_3943)+((6)*sizeof(INT)))),_V41_3945,(4*sizeof(INT))); 
		  }
		  {
		    {
		      INT sop_iOfElement_NotUsed_3946[31];
		      INT sop_sizeOfIOfElement_NotUsed_3947;
		      P_PackAlbumReply_1844(FP->Chain->Chain->Chain->Chain,9,(INT*)FP->_U90._S94._U91._S100.packedAlbum_3930,&FP->_U90._S94._U91._S100.noOfBytesOfPackedAlbum_3929,2,(INT*)FP->Chain->Chain->Chain->Chain->AlbumDecodeClassReason_513,10,(INT*)unpackedAlbum_3943,31,(INT*)sop_iOfElement_NotUsed_3946,&sop_sizeOfIOfElement_NotUsed_3947,&FP->_U90._S94._U91._S100.ok_3927);
		    }
		  }
		}
	      }
	      if ((FP->eErrOut_next_i_3674 == 0))
	      {
		FP->exceptionHandlerBlocked_3684 = false;
	      }
	      else
	      if (true)
	      {
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	      if ((FP->eErrOut_next_i_3674 != -1))
	      {
		{
		  *((INT*)(((BYTE*)FP->stateOfErrOut_3620)+(RNGCHK(FP->eErrOut_next_i_3674,5)*sizeof(INT)))) = 1;
		  FP->eErrOut_next_i_3674 = -1;
		}
	      }
	      else
	      if (true)
	      {
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	      BREAKPOINT_F(3); // One error sent out!
	      ASSIGN(FP->eErrOut_last_3675,FP->eErrOut_next_3672,(3*sizeof(INT)));
	      FP->_U90._S94._U91._S100.sendByteStream_3928 = true;
	    }
	  }
	  else
	  if (true)
	  {
	    FP->sendHighPriUntilEmpty_3702 = false;
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	if (!FP->_U90._S94._U91._S100.sendByteStream_3928) GOTO(60);
	OUTPUT4(FP->Chain->chan011o_3605,&FP->_U90._S94._U91._S100.noOfBytesOfPackedAlbum_3929,61);
      CASE(61):  
	FP->_Header.Temp.VINT = F_Int32NeedOfBytes_1452(FP->Chain->Chain->Chain->Chain,FP->_U90._S94._U91._S100.noOfBytesOfPackedAlbum_3929);
	OUTPUT4(FP->Chain->chan011o_3605,&FP->_Header.Temp.VINT,62);
      CASE(62):  
	OUTPUT(FP->Chain->chan011o_3605,FP->_U90._S94._U91._S100.packedAlbum_3930,(F_Int32NeedOfBytes_1452(FP->Chain->Chain->Chain->Chain,FP->_U90._S94._U91._S100.noOfBytesOfPackedAlbum_3929))*(sizeof(INT)),63);
      CASE(63):  
	FP->_Header.Temp.VINT = 0;
	OUTPUT4(FP->Chain->chan011o_3605,&FP->_Header.Temp.VINT,64);
      CASE(64):  
	GOTO(59);
      CASE(60):  
	if (!( ! FP->_U90._S94._U91._S100.ok_3927)) GOTO(65);
	OUTPUT(FP->chan900internal_3608,FP->Chain->Chain->Chain->Chain->NCR_HEventRouter_PackAlbumReply_1214,(3*sizeof(INT)),66);
      CASE(66):  
	GOTO(59);
      CASE(65):  
	if (!( ! FP->sendHighPriUntilEmpty_3702)) GOTO(67);
	if (FP->lowPriOut_delayTimer_activeNow_3691)
	{
	  {
	    FP->lowPriOut_delayTimer_ms_3690 = F_NextLowPriDelayTimer_3793(FP->now_ms_3666,FP->inhibitOfF32Out_ms_3696);
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(59);
      CASE(67):  
	SETERR(MSG_IF);
      CASE(59):  
	GOTO(13);
      CASE(10):  
	BREAKPOINT_F(24); // Send just one LowPri event
	FP->_U90._S94._U91._S101.sendByteStream_3952 = false;
	FP->now_ms_3666 = ReadTimer();
	FP->_U90._S94._U91._S101.ok_3951 = true;
	{
	  INT i_3956;
	  INT i_3956_End;
	  i_3956 = FP->iOfFairSendF32Out_3701;i_3956_End = i_3956 + (12 - FP->iOfFairSendF32Out_3701);
	  for (; i_3956 != i_3956_End; i_3956++)
	  {
	    if ((*((INT*)(((BYTE*)FP->stateOfF32Out_3619)+(RNGCHK(i_3956,12)*sizeof(INT)))) == 2))
	    {
	      {
		{
		  INT *UnpackedAlbum_3957;
		  UnpackedAlbum_3957 = (INT*)((INT*)(((BYTE*)FP->eF32Out_3669)+((RNGCHKUB((i_3956 * 4),4,48),RNGCHKLB((i_3956 * 4)))*sizeof(INT))));
		  CHK(4 == 4,MSG_AIM);
		  {
		    // Make F32
		    {
		      INT sop_iOfElement_NotUsed_3958[31];
		      INT sop_sizeOfIOfElement_NotUsed_3959;
		      INT *_V43_3960;
		      {
			static INT TMP[1] = {8469};
			_V43_3960 = (INT*)TMP;
		      }
		      P_PackAlbumReply_1844(FP->Chain->Chain->Chain->Chain,9,(INT*)FP->_U90._S94._U91._S101.packedAlbum_3954,&FP->_U90._S94._U91._S101.noOfBytesOfPackedAlbum_3953,1,(INT*)_V43_3960,4,(INT*)UnpackedAlbum_3957,31,(INT*)sop_iOfElement_NotUsed_3958,&sop_sizeOfIOfElement_NotUsed_3959,&FP->_U90._S94._U91._S101.ok_3951);
		    }
		  }
		}
		FP->_U90._S94._U91._S101.sendByteStream_3952 = true;
		*((INT*)(((BYTE*)FP->stateOfF32Out_3619)+(RNGCHK(i_3956,12)*sizeof(INT)))) = 1;
		FP->iOfFairSendF32Out_3701 = ((i_3956 + 1) % 12);
		FP->_U90._S94._U91._S101.iOfEvent_3955 = i_3956;
	      }
	    }
	    else
	    {
	      continue;
	    }
	    break;
	  }
	  if (i_3956 == i_3956_End) 
	  if (true)
	  {
	    {
	      FP->sendLowPriUntilEmpty_3703 = false;
	      FP->_U90._S94._U91._S101.iOfEvent_3955 = -1;
	      FP->iOfFairSendF32Out_3701 = 0;
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	if ((FP->_U90._S94._U91._S101.iOfEvent_3955 == -1))
	{
	  FP->_U90._S94._U91._S101._U96._S102.delayTime_ms_3961 = 50;
	}
	else
	if (*((BOOL*)(((BYTE*)FP->IsPolledDefault_3651)+(RNGCHK(FP->_U90._S94._U91._S101.iOfEvent_3955,12)*sizeof(BOOL)))))
	{
	  FP->_U90._S94._U91._S101._U96._S102.delayTime_ms_3961 = 50;
	}
	else
	if (true)
	{
	  FP->_U90._S94._U91._S101._U96._S102.delayTime_ms_3961 = FP->inhibitOfF32Out_ms_3696;
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (!FP->_U90._S94._U91._S101.sendByteStream_3952) GOTO(69);
	OUTPUT4(FP->Chain->chan011o_3605,&FP->_U90._S94._U91._S101.noOfBytesOfPackedAlbum_3953,70);
      CASE(70):  
	FP->_Header.Temp.VINT = F_Int32NeedOfBytes_1452(FP->Chain->Chain->Chain->Chain,FP->_U90._S94._U91._S101.noOfBytesOfPackedAlbum_3953);
	OUTPUT4(FP->Chain->chan011o_3605,&FP->_Header.Temp.VINT,71);
      CASE(71):  
	OUTPUT(FP->Chain->chan011o_3605,FP->_U90._S94._U91._S101.packedAlbum_3954,(F_Int32NeedOfBytes_1452(FP->Chain->Chain->Chain->Chain,FP->_U90._S94._U91._S101.noOfBytesOfPackedAlbum_3953))*(sizeof(INT)),72);
      CASE(72):  
	FP->_Header.Temp.VINT = 0;
	OUTPUT4(FP->Chain->chan011o_3605,&FP->_Header.Temp.VINT,73);
      CASE(73):  
	FP->lowPriOut_delayTimer_ms_3690 = F_NextLowPriDelayTimer_3793(FP->now_ms_3666,FP->_U90._S94._U91._S101._U96._S102.delayTime_ms_3961);
	GOTO(68);
      CASE(69):  
	if (!( ! FP->_U90._S94._U91._S101.ok_3951)) GOTO(74);
	OUTPUT(FP->chan900internal_3608,FP->Chain->Chain->Chain->Chain->NCR_HEventRouter_PackAlbumReply_1214,(3*sizeof(INT)),75);
      CASE(75):  
	GOTO(68);
      CASE(74):  
	if (!( ! FP->sendLowPriUntilEmpty_3703)) GOTO(76);
	{
	  FP->lowPriOut_delayTimer_ms_3690 = F_NextLowPriDelayTimer_3793(FP->now_ms_3666,FP->_U90._S94._U91._S101._U96._S102.delayTime_ms_3961);
	}
	GOTO(68);
      CASE(76):  
	SETERR(MSG_IF);
      CASE(68):  
	GOTO(13);
      CASE(11):  
	{
	  BREAKPOINT_F(24); // Silent again
	  FP->lowPriOut_delayTimer_activeNow_3691 = false;
	}
	GOTO(13);
      CASE(12):  
	INPUT4(*((CHAN**)(((BYTE*)FP->ChanBundle_3654)+(FP->_U90._S94.thisUser_3976*sizeof(CHAN *)))),&FP->_U90._S94._U91._S103.noOfInt32OfEnvelope_3968,77);
      CASE(77):  
	CHK(FP->_U90._S94._U91._S103.noOfInt32OfEnvelope_3968<=59,MSG_CITL);
	INPUT(*((CHAN**)(((BYTE*)FP->ChanBundle_3654)+(FP->_U90._S94.thisUser_3976*sizeof(CHAN *)))),FP->_U90._S94._U91._S103.envelopeEvents_3969,(FP->_U90._S94._U91._S103.noOfInt32OfEnvelope_3968)*(sizeof(INT)),78);
      CASE(78):  
	BREAKPOINT_F(24);
	// Receive output event:
	//  (from Ullcalc      if thisUser = 0)
	//  (from VolumeServer if thisUser = 1)
	//  (from AlarmServer  if thisUser = 2)
	FP->_U90._S94._U91._S103.dontReply_3977 = false;
	FP->now_ms_3666 = ReadTimer();
	P_GetProtocolType_1914(FP->Chain->Chain->Chain->Chain,59,(INT*)FP->_U90._S94._U91._S103.envelopeEvents_3969,&FP->_U90._S94._U91._S103.protType_3978);
	P_GetTheProtocolCmd_1926(FP->Chain->Chain->Chain->Chain,59,(INT*)FP->_U90._S94._U91._S103.envelopeEvents_3969,&FP->_U90._S94._U91._S103.protCmd_3979);
	FP->_U90._S94._U91._S103.error_3980 = false;
	if ((FP->_U90._S94._U91._S103.protType_3978 == 3))
	{
	  if ((FP->_U90._S94._U91._S103.protCmd_3979 == 3))
	  {
	    {
	      // PValEventsOut
	      {
		INT from_3981;
		INT to_3982;
		{
		  from_3981 = 3; 
		  to_3982 = 0; 
		  {
		    INT iOfEventInEnv_3984;
		    for (iOfEventInEnv_3984 = 0; iOfEventInEnv_3984 != 0 + 12; iOfEventInEnv_3984++)
		    {
		      {
			if ((*((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+(RNGCHK((from_3981 + 2),59)*sizeof(INT)))) == 0))
			{
			  {
			    // This user knows that we don't want this data entity
			  }
			}
			else
			if ((*((INT*)(((BYTE*)FP->userOfF32Out_3662)+(iOfEventInEnv_3984*sizeof(INT)))) != FP->_U90._S94.thisUser_3976))
			{
			  {
			    // We know that this user is not supposed to deliver this data entity
			  }
			}
			else
			if ((*((INT*)(((BYTE*)FP->stateOfF32Out_3619)+(iOfEventInEnv_3984*sizeof(INT)))) != 0))
			{
			  {
			    REAL32 lastProduced_3985;
			    REAL32 lastSent_3986;
			    BOOL firstTime_3987;
			    firstTime_3987 = *((BOOL*)(((BYTE*)FP->eF32Out_NoValueSent_3682)+(iOfEventInEnv_3984*sizeof(BOOL))));
			    {
			      // Filter events (to minimize network traffic)
			      {
				REAL32 LastProduced_3988;
				REAL32 LastSent_3989;
				LastProduced_3988 = *(REAL32*)((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+(RNGCHK((from_3981 + 3),59)*sizeof(INT))));
				LastSent_3989 = *(REAL32*)((INT*)(((BYTE*)FP->eF32Out_3669)+(RNGCHK((to_3982 + 3),48)*sizeof(INT))));
				{
				  lastProduced_3985 = LastProduced_3988; 
				  lastSent_3986 = LastSent_3989; 
				}
				*(REAL32*)((INT*)(((BYTE*)FP->eF32Out_3669)+(RNGCHK((to_3982 + 3),48)*sizeof(INT)))) = LastSent_3989;
				*(REAL32*)((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+(RNGCHK((from_3981 + 3),59)*sizeof(INT)))) = LastProduced_3988;
			      }
			      *((REAL32*)(((BYTE*)FP->eF32Out_ValueLastProduced_3680)+(iOfEventInEnv_3984*sizeof(REAL32)))) = lastProduced_3985;
			      {
				REAL32 DeltaPlus_3990;
				REAL32 DeltaMinus_3991;
				DeltaPlus_3990 = (REAL32)(lastSent_3986 + *((REAL32*)(((BYTE*)FP->eF32Out_ValueDeltaRef_3681)+(iOfEventInEnv_3984*sizeof(REAL32)))));
				DeltaMinus_3991 = (REAL32)(lastSent_3986 - *((REAL32*)(((BYTE*)FP->eF32Out_ValueDeltaRef_3681)+(iOfEventInEnv_3984*sizeof(REAL32)))));
				if ((((lastProduced_3985 >= DeltaPlus_3990) || (lastProduced_3985 <= DeltaMinus_3991)) || firstTime_3987))
				{
				  {
				    CHK(4==4,MSG_ASM);
				    ASSIGN(((INT*)(((BYTE*)FP->eF32Out_3669)+((RNGCHKUB(to_3982,4,48),RNGCHKLB(to_3982))*sizeof(INT)))),((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+((RNGCHKUB(from_3981,4,59),RNGCHKLB(from_3981))*sizeof(INT)))),(4*sizeof(INT)));
				    *((INT*)(((BYTE*)FP->eF32Out_3669)+(RNGCHK((to_3982 + 0),48)*sizeof(INT)))) = 71;
				    {
				      INT stateOfEvent_3992;
				      stateOfEvent_3992 = *((INT*)(((BYTE*)FP->eF32Out_3669)+(RNGCHK((to_3982 + 2),48)*sizeof(INT))));
				      {
					stateOfEvent_3992 = F_ClearBits_1530(FP->Chain->Chain->Chain->Chain,stateOfEvent_3992,144);
					if (( ! firstTime_3987))
					{
					  {
					    stateOfEvent_3992 = F_SetBits_1525(stateOfEvent_3992,136); 
					  }
					}
					else
					if (true)
					{
					  {
					    stateOfEvent_3992 = F_SetBits_1525(stateOfEvent_3992,129); 
					  }
					}
					else
					{
					  SETERR(MSG_IF);
					}
				      }
				      *((INT*)(((BYTE*)FP->eF32Out_3669)+(RNGCHK((to_3982 + 2),48)*sizeof(INT)))) = stateOfEvent_3992;
				    }
				    P_StartSendLowPri_3798(FP,FP->now_ms_3666);
				    *((INT*)(((BYTE*)FP->stateOfF32Out_3619)+(iOfEventInEnv_3984*sizeof(INT)))) = 2;
				    firstTime_3987 = false; 
				    *((INT*)(((BYTE*)FP->eF32Out_timer_ms_3686)+(iOfEventInEnv_3984*sizeof(INT)))) = FP->now_ms_3666;
				  }
				}
				else
				if (true)
				{
				}
				else
				{
				  SETERR(MSG_IF);
				}
			      }
			    }
			    *((BOOL*)(((BYTE*)FP->eF32Out_NoValueSent_3682)+(iOfEventInEnv_3984*sizeof(BOOL)))) = firstTime_3987;
			  }
			}
			else
			if (true)
			{
			}
			else
			{
			  SETERR(MSG_IF);
			}
			to_3982 = (to_3982 + 4); 
			from_3981 = (from_3981 + 4); 
		      }
		    }
		  }
		}
	      }
	      {
		INT i_3999;
		{
		  if ((FP->_U90._S94.thisUser_3976 == 0))
		  {
		    i_3999 = 2; 
		  }
		  else
		  if ((FP->_U90._S94.thisUser_3976 == 1))
		  {
		    i_3999 = 3; 
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		  {
		    INT *NodetypeClassReason_4000;
		    BOOL change_4001;
		    BOOL change_and_toBeSent_notUsed_4002;
		    NodetypeClassReason_4000 = (INT*)((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+((51)*sizeof(INT))));
		    CHK(3 == 3,MSG_AIM);
		    {
		      P_HandleClassReasonChange_3817(FP,i_3999,(INT*)NodetypeClassReason_4000,&change_4001,&change_and_toBeSent_notUsed_4002);
		      if (change_4001)
		      {
			if (false)
			{
			  P_StartSendHighPriUntilEmpty_3790(FP);
			}
			else
			if ((*((INT*)(((BYTE*)NodetypeClassReason_4000)+(1*sizeof(INT)))) == 22))
			{
			  {
			    INT *_V47_4003;
			    {
			      static INT TMP[2] = {1,0};
			      _V47_4003 = (INT*)TMP;
			    }
			    P_PrepareToSendFrontLEDs_If_3830(FP,(INT*)_V47_4003,FP->now_ms_3666);
			  }
			}
			else
			if (true)
			{
			  {
			    INT *_V46_4004;
			    {
			      static INT TMP[2] = {1,1};
			      _V46_4004 = (INT*)TMP;
			    }
			    P_PrepareToSendFrontLEDs_If_3830(FP,(INT*)_V46_4004,FP->now_ms_3666);
			  }
			}
			else
			{
			  SETERR(MSG_IF);
			}
		      }
		      else
		      if (true)
		      {
		      }
		      else
		      {
			SETERR(MSG_IF);
		      }
		    }
		  }
		}
	      }
	    }
	  }
	  else
	  if ((FP->_U90._S94._U91._S103.protCmd_3979 == 8))
	  {
	    {
	      // PValAlarmG4Output
	      if ((FP->_U90._S94.thisUser_3976 != 2))
	      {
		SETERR(MSG_STOP);
	      }
	      else
	      if ((FP->_U90._S94.thisUser_3976 == 2))
	      {
		{
		  if ((FP->stateOfG4AlaOut_3622 != 0))
		  {
		    {
		      INT *TheAlarmF32EventOut_4005;
		      TheAlarmF32EventOut_4005 = (INT*)((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+((3)*sizeof(INT))));
		      CHK(16 == 16,MSG_AIM);
		      if ((*((INT*)(((BYTE*)TheAlarmF32EventOut_4005)+(1*sizeof(INT)))) == 1))
		      {
			{
			  {
			    CHK(14==14,MSG_ASM);
			    ASSIGN(((INT*)(((BYTE*)FP->eG4AlaOut_3679)+((2)*sizeof(INT)))),((INT*)(((BYTE*)TheAlarmF32EventOut_4005)+((2)*sizeof(INT)))),(14*sizeof(INT)));
			  }
			  FP->stateOfG4AlaOut_3622 = 2;
			  FP->eG4AlaOut_timer_ms_3689 = FP->now_ms_3666;
			}
		      }
		      else
		      if (true)
		      {
		      }
		      else
		      {
			SETERR(MSG_IF);
		      }
		    }
		  }
		  else
		  if (true)
		  {
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		  {
		    INT *Event_ValueU16EventOut_4010;
		    INT IOfLEDEvent_4011;
		    Event_ValueU16EventOut_4010 = (INT*)((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+((19)*sizeof(INT))));
		    CHK(4 == 4,MSG_AIM);
		    IOfLEDEvent_4011 = (INT)*((INT*)(((BYTE*)Event_ValueU16EventOut_4010)+(1*sizeof(INT))));
		    if ((IOfLEDEvent_4011 != 1))
		    {
		      SETERR(MSG_STOP);
		    }
		    else
		    if (true)
		    {
		      {
			{
			  INT NewLED_4012;
			  NewLED_4012 = (INT)(*((INT*)(((BYTE*)Event_ValueU16EventOut_4010)+(3*sizeof(INT)))) & 4);
			  if (false)
			  {
			  }
			  else
			  if ((NewLED_4012 == 0))
			  {
			    {
			      INT *_V45_4013;
			      {
				static INT TMP[2] = {4,1};
				_V45_4013 = (INT*)TMP;
			      }
			      P_PrepareToSendFrontLEDs_If_3830(FP,(INT*)_V45_4013,FP->now_ms_3666);
			    }
			  }
			  else
			  if ((NewLED_4012 != 0))
			  {
			    {
			      INT *_V44_4014;
			      {
				static INT TMP[2] = {4,0};
				_V44_4014 = (INT*)TMP;
			      }
			      P_PrepareToSendFrontLEDs_If_3830(FP,(INT*)_V44_4014,FP->now_ms_3666);
			    }
			  }
			  else
			  {
			    SETERR(MSG_IF);
			  }
			}
		      }
		    }
		    else
		    {
		      SETERR(MSG_IF);
		    }
		  }
		  P_StartSendHighPriUntilEmpty_3790(FP);
		  /*lint -save -e529  not subsequently referenced */
		  {
		    BOOL change_notUsed_4015;
		    BOOL change_and_toBeSent_notUsed_4016;
		    P_HandleClassReasonChange_3817(FP,1,(INT*)((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+((23)*sizeof(INT)))),&change_notUsed_4015,&change_and_toBeSent_notUsed_4016);
		  }
		  /*lint -restore */
		}
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	  else
	  if ((FP->_U90._S94._U91._S103.protCmd_3979 == 9))
	  {
	    {
	      // PValTankDimsG2Out
	      if ((FP->_U90._S94.thisUser_3976 != 0))
	      {
		SETERR(MSG_STOP);
	      }
	      else
	      if ((FP->stateOfDim2Out_3623 != 0))
	      {
		{
		  {
		    CHK(4==4,MSG_ASM);
		    ASSIGN(((INT*)(((BYTE*)FP->eDim2Out_3671)+((2)*sizeof(INT)))),((INT*)(((BYTE*)FP->_U90._S94._U91._S103.envelopeEvents_3969)+((5)*sizeof(INT)))),(4*sizeof(INT)));
		  }
		  FP->stateOfDim2Out_3623 = 2;
		  P_StartSendHighPriUntilEmpty_3790(FP);
		  FP->_U90._S94._U91._S103.dontReply_3977 = true;
		}
	      }
	      else
	      if (true)
	      {
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	  else
	  if (true)
	  {
	    FP->_U90._S94._U91._S103.error_3980 = true;
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	else
	if (true)
	{
	  FP->_U90._S94._U91._S103.error_3980 = true;
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (!FP->_U90._S94._U91._S103.error_3980) GOTO(80);
	OUTPUT(FP->chan900internal_3608,FP->Chain->Chain->Chain->Chain->NCR_HEventRouter_CmdErr_1230,(3*sizeof(INT)),81);
      CASE(81):  
	GOTO(79);
      CASE(80):  
	if (!true) GOTO(82);
	GOTO(79);
      CASE(82):  
	SETERR(MSG_IF);
      CASE(79):  
	GOTO(13);
      CASE(13):  
      CASE(1):  
	if (true)
	{
	  GOTO(2);
	}
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4021 (tSF_P_4021 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C398.chanIn_1982=FP->Chain->chan900internal_4020;
	FP->_C398.chanOut_1983=FP->Chain->chan900o_3607;
	FP->_C398.Chain = FP->Chain->Chain->Chain->Chain;
	CALL(P_ExceptionBuffer_1985,&FP->_C398,1,"P_ExceptionBuffer_1985");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4022 (tSF_P_4022 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C400.chan900internal_3608=FP->Chain->chan900internal_4020;
	FP->_C400.Chain = FP->Chain;
	CALL(P_EventRouter_4018,&FP->_C400,1,"P_EventRouter_4018");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_EventRouterFather_4023 (tSF_P_EventRouterFather_4023 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->chan900internal_4020 = &FP->chan900internal_4020_CHAN;
	INITCH(FP->chan900internal_4020);
	STARTP(&FP->_T49,P_4021,&FP->_C399,"P_4021",1);
	STARTP(&FP->_T50,P_4022,&FP->_C401,"P_4022",1);
	WAITP(1);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4024 (tSF_P_4024 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C402.chan010i_3594=FP->Chain->Chain->chan010_3154;
	FP->_C402.chan291i_3595=FP->Chain->Chain->chan291_3240;
	FP->_C402.chan290o_3596=FP->Chain->Chain->chan290_3238;
	FP->_C402.chan141i_3597=FP->Chain->Chain->chan141_3190;
	FP->_C402.chan140o_3598=FP->Chain->Chain->chan140_3188;
	FP->_C402.chan210i_3599=FP->Chain->Chain->chan210_3216;
	FP->_C402.chan211o_3600=FP->Chain->Chain->chan211_3218;
	FP->_C402.chan220i_3601=FP->Chain->Chain->chan220_3220;
	FP->_C402.chan230i_3602=FP->Chain->Chain->chan230_3222;
	FP->_C402.chan231o_3603=FP->Chain->Chain->chan231_3224;
	FP->_C402.chan120i_3604=FP->Chain->Chain->chan120_3186;
	FP->_C402.chan011o_3605=FP->Chain->Chain->chan011_3156;
	FP->_C402.chan370o_3606=FP->Chain->Chain->chan370_3256;
	FP->_C402.chan900o_3607=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(5*sizeof(CHAN *))));
	FP->_C402.Chain = FP;
	CALL(P_EventRouterFather_4023,&FP->_C402,1,"P_EventRouterFather_4023");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4027 (tSF_P_4027 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_V49_4025[0] = FP->Chain->Chain->chan201_3214;
	FP->_V49_4025[1] = FP->Chain->Chain->chan191_3210;
	FP->_V49_4025[2] = FP->Chain->Chain->chan181_3206;
	FP->_V48_4026[0] = FP->Chain->Chain->chan200_3212;
	FP->_V48_4026[1] = FP->Chain->Chain->chan190_3208;
	FP->_V48_4026[2] = FP->Chain->Chain->chan180_3204;
	FP->_C404.chan400i_2219=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan400Array_3278)+(0*sizeof(CHAN *))));
	FP->_C404.chan091i_2220=FP->Chain->Chain->chan091_3182;
	FP->_C404.chan090o_2221=FP->Chain->Chain->chan090_3180;
	FP->_C404.toServers_2222_Dim0=3;
	FP->_C404.toServers_2222= (CHAN**)FP->_V49_4025;
	FP->_C404.fromServers_2223_Dim0=3;
	FP->_C404.fromServers_2223= (CHAN**)FP->_V48_4026;
	FP->_C404.chan900o_2224=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(6*sizeof(CHAN *))));
	FP->_C404.Chain = FP->Chain->Chain;
	CALL(P_CurveServer_2281,&FP->_C404,1,"P_CurveServer_2281");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static INT F_Convert_status_4084(tSF_P_FileServer_4586 *PP,INT Status_4080)
{
  INT _Result;
  tSF_F_Convert_status_4084 SF;
  tSF_F_Convert_status_4084 *FP = &SF;
  FP->Chain = PP;
  {
    INT status_4081;
    {
      // (1.24 14Aug98 For lint) SPOC -> warning 644 "may not have been initialized"
      status_4081 = 21; 
      {
	INT i_4082;
	for (i_4082 = 0; i_4082 != 0 + 21; i_4082++)
	{
	  if ((*((INT*)(((BYTE*)FP->Chain->Chain->Chain->Chain->FlashDrvFileDrvStatus_1385)+(i_4082*sizeof(INT)))) == Status_4080))
	  {
	    status_4081 = i_4082; 
	  }
	  else
	  {
	    continue;
	  }
	  break;
	}
	if (i_4082 == (0 + 21))
	if (true)
	{
	  status_4081 = 21; 
	}
	else
	{
	  SETERR(MSG_IF);
	}
      }
    }
    _Result = status_4081;
  }
  return _Result;
}
static void P_WriteToFlash_4099 (tSF_P_WriteToFlash_4099 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	{
	  INT noOfValues_4092;
	  {
	    noOfValues_4092 = (FP->Buffer_4085_Dim0);
	    if ((noOfValues_4092 <= FP->NoOfInt32OfFlashBuffer_4087))
	    {
	      {
		FP->noOfPackets_4089 = 1;
		*((INT*)(((BYTE*)FP->packetSizes_4091)+(0*sizeof(INT)))) = noOfValues_4092;
	      }
	    }
	    else
	    if (true)
	    {
	      {
		INT noOfPacketsM1_4093;
		{
		  noOfPacketsM1_4093 = (noOfValues_4092 / FP->NoOfInt32OfFlashBuffer_4087);
		  {
		    INT i_4094;
		    INT i_4094_End;
		    i_4094 = 0;i_4094_End = i_4094 + noOfPacketsM1_4093;
		    for (; i_4094 != i_4094_End; i_4094++)
		    {
		      *((INT*)(((BYTE*)FP->packetSizes_4091)+(RNGCHK(i_4094,6)*sizeof(INT)))) = FP->NoOfInt32OfFlashBuffer_4087;
		    }
		  }
		  *((INT*)(((BYTE*)FP->packetSizes_4091)+(RNGCHK(noOfPacketsM1_4093,6)*sizeof(INT)))) = (noOfValues_4092 - (noOfPacketsM1_4093 * FP->NoOfInt32OfFlashBuffer_4087));
		  FP->noOfPackets_4089 = (noOfPacketsM1_4093 + 1);
		}
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	FP->flashAbsoluteAddress_4095 = FP->AbsoluteAddressOfFlash_4086;
	FP->iOfBuffer_4096 = 0;
	FP->localStatus_4090 = 0;
	FP->i_4097 = 0;
	FP->i_4097_End = FP->i_4097 + FP->noOfPackets_4089;
	GOTO(1);
      CASE(2):  
	FP->TheSize_4098 = (INT)*((INT*)(((BYTE*)FP->packetSizes_4091)+(RNGCHK(FP->i_4097,6)*sizeof(INT))));
	FP->_Header.Temp.VBYTE = 5;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,3);
      CASE(3):  
	OUTPUT4(FP->Chain->chan241o_4033,&FP->flashAbsoluteAddress_4095,4);
      CASE(4):  
	OUTPUT4(FP->Chain->chan241o_4033,&FP->TheSize_4098,5);
      CASE(5):  
	OUTPUT(FP->Chain->chan241o_4033,((INT*)(((BYTE*)FP->Buffer_4085)+((RNGCHKUB(FP->iOfBuffer_4096,FP->TheSize_4098,FP->Buffer_4085_Dim0),RNGCHKLB(FP->iOfBuffer_4096))*sizeof(INT)))),(FP->TheSize_4098)*(sizeof(INT)),6);
      CASE(6):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,7);
      CASE(7):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 0: GOTO (9);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(9):  
	INPUT4(FP->Chain->chan240i_4032,FP->status_4088,10);
      CASE(10):  
	FP->localStatus_4090 = (FP->localStatus_4090 | *FP->status_4088);
	GOTO(8);
      CASE(8):  
	FP->flashAbsoluteAddress_4095 = (FP->flashAbsoluteAddress_4095 + FP->TheSize_4098);
	FP->iOfBuffer_4096 = (FP->iOfBuffer_4096 + FP->TheSize_4098);
	FP->i_4097++;
      CASE(1):  
	if (FP->i_4097 != FP->i_4097_End) GOTO(2);
	*FP->status_4088 = FP->localStatus_4090;
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_ReadFromFlash_4115 (tSF_P_ReadFromFlash_4115 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	{
	  INT noOfValues_4107;
	  {
	    noOfValues_4107 = (FP->readBuffer_4100_Dim0);
	    if ((noOfValues_4107 <= FP->NoOfInt32OfServerBuffer_4102))
	    {
	      {
		FP->noOfPackets_4104 = 1;
		*((INT*)(((BYTE*)FP->packetSizes_4106)+(0*sizeof(INT)))) = noOfValues_4107;
	      }
	    }
	    else
	    if (true)
	    {
	      {
		INT noOfPacketsM1_4108;
		{
		  noOfPacketsM1_4108 = (noOfValues_4107 / FP->NoOfInt32OfServerBuffer_4102);
		  {
		    INT i_4109;
		    INT i_4109_End;
		    i_4109 = 0;i_4109_End = i_4109 + noOfPacketsM1_4108;
		    for (; i_4109 != i_4109_End; i_4109++)
		    {
		      *((INT*)(((BYTE*)FP->packetSizes_4106)+(RNGCHK(i_4109,6)*sizeof(INT)))) = FP->NoOfInt32OfServerBuffer_4102;
		    }
		  }
		  *((INT*)(((BYTE*)FP->packetSizes_4106)+(RNGCHK(noOfPacketsM1_4108,6)*sizeof(INT)))) = (noOfValues_4107 - (noOfPacketsM1_4108 * FP->NoOfInt32OfServerBuffer_4102));
		  FP->noOfPackets_4104 = (noOfPacketsM1_4108 + 1);
		}
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	FP->flashAbsoluteAddress_4110 = FP->AbsoluteAddressOfFlash_4101;
	FP->iOfBuffer_4111 = 0;
	FP->localStatus_4105 = 0;
	FP->i_4112 = 0;
	FP->i_4112_End = FP->i_4112 + FP->noOfPackets_4104;
	GOTO(1);
      CASE(2):  
	FP->TheSize_4113 = (INT)*((INT*)(((BYTE*)FP->packetSizes_4106)+(RNGCHK(FP->i_4112,6)*sizeof(INT))));
	FP->_Header.Temp.VBYTE = 9;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,3);
      CASE(3):  
	OUTPUT4(FP->Chain->chan241o_4033,&FP->flashAbsoluteAddress_4110,4);
      CASE(4):  
	OUTPUT4(FP->Chain->chan241o_4033,&FP->TheSize_4113,5);
      CASE(5):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,6);
      CASE(6):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 10: GOTO (8);
	  case 0: GOTO (9);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(8):  
	INPUT4(FP->Chain->chan240i_4032,&FP->size_4114,10);
      CASE(10):  
	CHK(FP->size_4114<=((FP->readBuffer_4100_Dim0) - FP->iOfBuffer_4111),MSG_CITL);
	INPUT(FP->Chain->chan240i_4032,((INT*)(((BYTE*)FP->readBuffer_4100)+((RNGCHKUB(FP->iOfBuffer_4111,((FP->readBuffer_4100_Dim0) - FP->iOfBuffer_4111),FP->readBuffer_4100_Dim0),RNGCHKLB(FP->iOfBuffer_4111))*sizeof(INT)))),(FP->size_4114)*(sizeof(INT)),11);
      CASE(11):  
	GOTO(7);
      CASE(9):  
	INPUT4(FP->Chain->chan240i_4032,FP->status_4103,12);
      CASE(12):  
	FP->localStatus_4105 = (FP->localStatus_4105 | *FP->status_4103);
	GOTO(7);
      CASE(7):  
	FP->flashAbsoluteAddress_4110 = (FP->flashAbsoluteAddress_4110 + FP->TheSize_4113);
	FP->iOfBuffer_4111 = (FP->iOfBuffer_4111 + FP->TheSize_4113);
	FP->i_4112++;
      CASE(1):  
	if (FP->i_4112 != FP->i_4112_End) GOTO(2);
	*FP->status_4103 = FP->localStatus_4105;
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_Verify_4118 (tSF_P_Verify_4118 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	if (!(FP->Status_4116 == 0)) GOTO(2);
	GOTO(1);
      CASE(2):  
	if (!true) GOTO(3);
	Breakpoint (0); // NCR.Flash.Errors
	ASSIGN(FP->nodetypeClassReason_4117,FP->Chain->Chain->Chain->Chain->NCR_Flash_Errors_1244,(3*sizeof(INT)));
	*((INT*)(((BYTE*)FP->nodetypeClassReason_4117)+(2*sizeof(INT)))) = F_Convert_status_4084(FP->Chain,FP->Status_4116);
	OUTPUT(FP->Chain->chan900o_4044,FP->nodetypeClassReason_4117,(3*sizeof(INT)),4);
      CASE(4):  
	GOTO(1);
      CASE(3):  
	SETERR(MSG_IF);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_FillFCB_4123 (tSF_P_FileServer_4586 *PP,INT fCBSrc_4119_Dim0,INT *fCBSrc_4119,INT Name_4120_Dim0,BYTE *Name_4120,INT NoOfInt32OfBuffer_4121)
{
  tSF_P_FillFCB_4123 SF;
  tSF_P_FillFCB_4123 *FP = &SF;
  FP->Chain = PP;
  {
    {
      INT i_4122;
      for (i_4122 = 3; i_4122 != 3 + 20; i_4122++)
      {
	*((INT*)(((BYTE*)fCBSrc_4119)+(i_4122*sizeof(INT)))) = 32; 
      }
    }
    P_InsertText_755(20,(INT*)((INT*)(((BYTE*)fCBSrc_4119)+((3)*sizeof(INT)))),Name_4120_Dim0,(BYTE*)Name_4120);
    *((INT*)(((BYTE*)fCBSrc_4119)+(0*sizeof(INT)))) = (fCBSrc_4119_Dim0); 
    *((INT*)(((BYTE*)fCBSrc_4119)+(0*sizeof(INT)))) = 0x76543210; 
    *((INT*)(((BYTE*)fCBSrc_4119)+(1*sizeof(INT)))) = 0; 
    *((INT*)(((BYTE*)fCBSrc_4119)+(2*sizeof(INT)))) = (Name_4120_Dim0); 
    *((INT*)(((BYTE*)fCBSrc_4119)+(23*sizeof(INT)))) = 0; 
    *((INT*)(((BYTE*)fCBSrc_4119)+(24*sizeof(INT)))) = -1; 
    *((INT*)(((BYTE*)fCBSrc_4119)+(25*sizeof(INT)))) = 0; 
    *((INT*)(((BYTE*)fCBSrc_4119)+(26*sizeof(INT)))) = 0; 
    *((INT*)(((BYTE*)fCBSrc_4119)+(27*sizeof(INT)))) = 0; 
    *((INT*)(((BYTE*)fCBSrc_4119)+(29*sizeof(INT)))) = (NoOfInt32OfBuffer_4121 * 4); 
    *((INT*)(((BYTE*)fCBSrc_4119)+(28*sizeof(INT)))) = (NoOfInt32OfBuffer_4121 * 4); 
  }
}
static INT F_GetNoOfElem_4127(tSF_P_FileServer_4586 *PP,INT FCB_4124_Dim0,INT *FCB_4124)
{
  INT _Result;
  tSF_F_GetNoOfElem_4127 SF;
  tSF_F_GetNoOfElem_4127 *FP = &SF;
  FP->Chain = PP;
  {
    INT noOfElem_4125;
    {
      noOfElem_4125 = (FCB_4124_Dim0); 
      noOfElem_4125 = (*((INT*)(((BYTE*)FCB_4124)+(28*sizeof(INT)))) / 4); 
    }
    _Result = noOfElem_4125;
  }
  return _Result;
}
static void P_InsertArrayInFront_4135 (INT Array_4128_Dim0,INT *Array_4128,INT NoOfValidDataInBufferOnEntry_4129,INT buffer_4130_Dim0,INT *buffer_4130,INT *newSizeOfFile_4131)
{
  tSF_P_InsertArrayInFront_4135 SF;
  tSF_P_InsertArrayInFront_4135 *FP = &SF;
  {
    *newSizeOfFile_4131 = ((Array_4128_Dim0) + NoOfValidDataInBufferOnEntry_4129); 
    if ((*newSizeOfFile_4131 > (buffer_4130_Dim0)))
    {
      *newSizeOfFile_4131 = 0; 
    }
    else
    if (true)
    {
      {
	{
	  INT from_4132;
	  INT to_4133;
	  {
	    from_4132 = (NoOfValidDataInBufferOnEntry_4129 - 1); 
	    to_4133 = ((Array_4128_Dim0) + from_4132); 
	    {
	      INT i_4134;
	      INT i_4134_End;
	      i_4134 = 0;i_4134_End = i_4134 + NoOfValidDataInBufferOnEntry_4129;
	      for (; i_4134 != i_4134_End; i_4134++)
	      {
		{
		  *((INT*)(((BYTE*)buffer_4130)+(RNGCHK(to_4133,buffer_4130_Dim0)*sizeof(INT)))) = *((INT*)(((BYTE*)buffer_4130)+(RNGCHK(from_4132,buffer_4130_Dim0)*sizeof(INT)))); 
		  from_4132 = (from_4132 - 1); 
		  to_4133 = (to_4133 - 1); 
		}
	      }
	    }
	  }
	}
	CHK((Array_4128_Dim0)==Array_4128_Dim0,MSG_ASM);
	ASSIGN(((INT*)(((BYTE*)buffer_4130)+((RNGCHKUB(0,(Array_4128_Dim0),buffer_4130_Dim0),0)*sizeof(INT)))),Array_4128,((Array_4128_Dim0)*sizeof(INT))); 
      }
    }
    else
    {
      SETERR(MSG_IF);
    }
  }
}
static void F_CalculateAddressOf_4145(tSF_P_FileServer_4586 *PP,INT Int32AddressOfSector_4136,INT Int32SizeOfSector_4137,INT NoOfFilesPerSector_4138,INT IOfThisFile_4139,INT File_4140_Dim0,INT *File_4140,INT *Param0,INT *Param1)
{
  tSF_F_CalculateAddressOf_4145 SF;
  tSF_F_CalculateAddressOf_4145 *FP = &SF;
  FP->Chain = PP;
  {
    INT int32Address_4141;
    INT status_4142;
    {
      int32Address_4141 = *((INT*)(((BYTE*)File_4140)+(0*sizeof(INT)))); 
      {
	INT Int32MaxSpacePerFlash6File_4143;
	Int32MaxSpacePerFlash6File_4143 = (INT)(Int32SizeOfSector_4137 / NoOfFilesPerSector_4138);
	if (((File_4140_Dim0) == 32798))
	{
	  {
	    status_4142 = 0; 
	    int32Address_4141 = (Int32AddressOfSector_4136 + (Int32MaxSpacePerFlash6File_4143 * IOfThisFile_4139)); 
	  }
	}
	else
	if ((Int32MaxSpacePerFlash6File_4143 >= (File_4140_Dim0)))
	{
	  {
	    status_4142 = 0; 
	    int32Address_4141 = (Int32AddressOfSector_4136 + (Int32MaxSpacePerFlash6File_4143 * IOfThisFile_4139)); 
	  }
	}
	else
	if (true)
	{
	  {
	    status_4142 = 0x800000; 
	    int32Address_4141 = 0; 
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
      }
    }
    *Param0=int32Address_4141;
    *Param1=status_4142;
  }
}
static void P_GetAddressAndSizeOfSectors_4149 (tSF_P_GetAddressAndSizeOfSectors_4149 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	BREAKPOINT_F(18); // Get sectors info (2)
	FP->_Header.Temp.VBYTE = 7;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,1);
      CASE(1):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,2);
      CASE(2):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 8: GOTO (4);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(4):  
	INPUT4(FP->Chain->chan240i_4032,FP->noOfSectors_4146,5);
      CASE(5):  
	CHK(*FP->noOfSectors_4146<=FP->address_4147_Dim0,MSG_CITL);
	INPUT(FP->Chain->chan240i_4032,FP->address_4147,(*FP->noOfSectors_4146)*(sizeof(INT)),6);
      CASE(6):  
	INPUT4(FP->Chain->chan240i_4032,FP->noOfSectors_4146,7);
      CASE(7):  
	CHK(*FP->noOfSectors_4146<=FP->sizeInt32_4148_Dim0,MSG_CITL);
	INPUT(FP->Chain->chan240i_4032,FP->sizeInt32_4148,(*FP->noOfSectors_4146)*(sizeof(INT)),8);
      CASE(8):  
	GOTO(3);
      CASE(3):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_FlashCommandInterpreter_4174 (tSF_P_FlashCommandInterpreter_4174 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	if (!(*FP->status_4154 != 0)) GOTO(2);
	GOTO(1);
      CASE(2):  
	if (!true) GOTO(3);
	// Run flashDriver
	if ((*((INT*)(((BYTE*)FP->CommandSequence_4150)+(0*sizeof(INT)))) == 0))
	{
	  {
	    // --- C embedded in occam, begin ---
	    // ---
	    Set_survivalFromLastRun(-267410086);
	    Set_survivalToDualPort_AndCopy(1);
	    // ---
	    // --- C embedded in occam, end ---
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->iOfSequence_4158 = 1;
	FP->enableDMAIfError_4160 = false;
	// WHILE-loop in FlashCommandInterpreter
	GOTO(4);
      CASE(5):  
	FP->X_4161 = (INT)*((INT*)(((BYTE*)FP->CommandSequence_4150)+(RNGCHK(FP->iOfSequence_4158,FP->CommandSequence_4150_Dim0)*sizeof(INT))));
	if (!(FP->X_4161 == 0)) GOTO(7);
	BREAKPOINT_F(18); // DisableDMA
	if (!FP->Chain->AllowSendOn_chan271o_4039) GOTO(9);
	FP->_Header.Temp.VBYTE = 0;
	OUTPUT1(FP->Chain->chan271o_4041,&FP->_Header.Temp.VBYTE,10);
      CASE(10):  
	INPUT1(FP->Chain->chan270i_4040,&FP->_Header.Temp.VBYTE,11);
      CASE(11):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 1: GOTO (13);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(13):  
	FP->enableDMAIfError_4160 = true;
	GOTO(12);
      CASE(12):  
	GOTO(8);
      CASE(9):  
	if (!true) GOTO(14);
	GOTO(8);
      CASE(14):  
	SETERR(MSG_IF);
      CASE(8):  
	GOTO(6);
      CASE(7):  
	if (!(FP->X_4161 == 1)) GOTO(15);
	if (!FP->Chain->AllowSendOn_chan271o_4039) GOTO(17);
	FP->_Header.Temp.VBYTE = 2;
	OUTPUT1(FP->Chain->chan271o_4041,&FP->_Header.Temp.VBYTE,18);
      CASE(18):  
	GOTO(16);
      CASE(17):  
	if (!true) GOTO(19);
	GOTO(16);
      CASE(19):  
	SETERR(MSG_IF);
      CASE(16):  
	FP->enableDMAIfError_4160 = false;
	BREAKPOINT_F(18); // EnableDMA
	GOTO(6);
      CASE(15):  
	if (!((FP->X_4161 == 2) || (FP->X_4161 == 3))) GOTO(20);
	BREAKPOINT_F(18); // Load flash low-level driver into RAM etc.
	FP->_Header.Temp.VBYTE = 1;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,21);
      CASE(21):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,22);
      CASE(22):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 2: GOTO (24);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(24):  
	INPUT4(FP->Chain->chan240i_4032,&FP->_U98._S104.manufacturerCode_4164,25);
      CASE(25):  
	INPUT4(FP->Chain->chan240i_4032,&FP->_U98._S104.deviceCode_4165,26);
      CASE(26):  
	INPUT4(FP->Chain->chan240i_4032,&FP->_U98._S104.readStatus_4162,27);
      CASE(27):  
	INPUT4(FP->Chain->chan240i_4032,&FP->_U98._S104.writeStatus_4163,28);
      CASE(28):  
	if (!(FP->X_4161 == 3)) GOTO(30);
	*FP->status_4154 = FP->_U98._S104.readStatus_4162;
	FP->_U98._S104._U99._C419.Status_4116=*FP->status_4154;
	FP->_U98._S104._U99._C419.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._S104._U99._C419,31,"P_Verify_4118");
      CASE(31):  
	GOTO(29);
      CASE(30):  
	if (!(FP->X_4161 == 2)) GOTO(32);
	*FP->status_4154 = FP->_U98._S104.writeStatus_4163;
	FP->_U98._S104._U99._C418.Status_4116=*FP->status_4154;
	FP->_U98._S104._U99._C418.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._S104._U99._C418,33,"P_Verify_4118");
      CASE(33):  
	GOTO(29);
      CASE(32):  
	SETERR(MSG_IF);
      CASE(29):  
	GOTO(23);
      CASE(23):  
	GOTO(6);
      CASE(20):  
	if (!(FP->X_4161 == 4)) GOTO(34);
	BREAKPOINT_F(18); // Get sectors info (1)
	FP->_U98._C416.noOfSectors_4146=&FP->noOfSectors_4157;
	FP->_U98._C416.address_4147_Dim0=8;
	FP->_U98._C416.address_4147= (INT*)FP->address_4155;
	FP->_U98._C416.sizeInt32_4148_Dim0=8;
	FP->_U98._C416.sizeInt32_4148= (INT*)FP->sizeInt32_4156;
	FP->_U98._C416.Chain = FP->Chain;
	CALL(P_GetAddressAndSizeOfSectors_4149,&FP->_U98._C416,35,"P_GetAddressAndSizeOfSectors_4149");
      CASE(35):  
	if ((FP->AddressType_4152 == 1))
	{
	  {
	    INT IOfNameOfFile_4166;
	    IOfNameOfFile_4166 = (INT)FP->Address_4153;
	    {
	      F_CalculateAddressOf_4145(FP->Chain,*((INT*)(((BYTE*)FP->address_4155)+(6*sizeof(INT)))),*((INT*)(((BYTE*)FP->sizeInt32_4156)+(6*sizeof(INT)))),10,(IOfNameOfFile_4166 - 1),FP->buffer_4151_Dim0,(INT*)FP->buffer_4151,&FP->fileAddress_4159,FP->status_4154);
	    }
	  }
	}
	else
	if ((FP->AddressType_4152 == 2))
	{
	  {
	    INT IOfSector_4167;
	    IOfSector_4167 = (INT)FP->Address_4153;
	    FP->fileAddress_4159 = *((INT*)(((BYTE*)FP->address_4155)+(RNGCHK(IOfSector_4167,8)*sizeof(INT))));
	  }
	}
	else
	if ((FP->AddressType_4152 == 3))
	{
	  {
	    INT IOfSector_4168;
	    IOfSector_4168 = (INT)FP->Address_4153;
	    FP->fileAddress_4159 = (*((INT*)(((BYTE*)FP->address_4155)+(RNGCHK((IOfSector_4168 + 1),8)*sizeof(INT)))) - 1);
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->_U98._C417.Status_4116=*FP->status_4154;
	FP->_U98._C417.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._C417,36,"P_Verify_4118");
      CASE(36):  
	GOTO(6);
      CASE(34):  
	if (!(FP->X_4161 == 10)) GOTO(37);
	BREAKPOINT_F(18); // Erase file sector
	FP->_Header.Temp.VBYTE = 3;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,38);
      CASE(38):  
	FP->_Header.Temp.VINT = 6;
	OUTPUT4(FP->Chain->chan241o_4033,&FP->_Header.Temp.VINT,39);
      CASE(39):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,40);
      CASE(40):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 0: GOTO (42);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(42):  
	INPUT4(FP->Chain->chan240i_4032,FP->status_4154,43);
      CASE(43):  
	FP->_U98._C415.Status_4116=*FP->status_4154;
	FP->_U98._C415.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._C415,44,"P_Verify_4118");
      CASE(44):  
	GOTO(41);
      CASE(41):  
	GOTO(6);
      CASE(37):  
	if (!(FP->X_4161 == 11)) GOTO(45);
	BREAKPOINT_F(18); // Erase copy sector
	FP->_Header.Temp.VBYTE = 3;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,46);
      CASE(46):  
	FP->_Header.Temp.VINT = 7;
	OUTPUT4(FP->Chain->chan241o_4033,&FP->_Header.Temp.VINT,47);
      CASE(47):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,48);
      CASE(48):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 0: GOTO (50);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(50):  
	INPUT4(FP->Chain->chan240i_4032,FP->status_4154,51);
      CASE(51):  
	FP->_U98._C414.Status_4116=*FP->status_4154;
	FP->_U98._C414.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._C414,52,"P_Verify_4118");
      CASE(52):  
	GOTO(49);
      CASE(49):  
	GOTO(6);
      CASE(45):  
	if (!(FP->X_4161 == 12)) GOTO(53);
	BREAKPOINT_F(18); // Erase a sector
	if (!(FP->AddressType_4152 == 2)) GOTO(55);
	FP->_U98._S105.IOfSector_4169 = (INT)FP->Address_4153;
	if (!( ! F_InRange_1472(0,FP->_U98._S105.IOfSector_4169,3))) GOTO(57);
	{
	  // Programming error (parameter error)
	  SETERR(MSG_STOP);
	}
	GOTO(56);
      CASE(57):  
	if (!true) GOTO(58);
	FP->_Header.Temp.VBYTE = 3;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,59);
      CASE(59):  
	OUTPUT4(FP->Chain->chan241o_4033,&FP->_U98._S105.IOfSector_4169,60);
      CASE(60):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,61);
      CASE(61):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 0: GOTO (63);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(63):  
	INPUT4(FP->Chain->chan240i_4032,FP->status_4154,64);
      CASE(64):  
	FP->_U98._S105._C413.Status_4116=*FP->status_4154;
	FP->_U98._S105._C413.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._S105._C413,65,"P_Verify_4118");
      CASE(65):  
	GOTO(62);
      CASE(62):  
	GOTO(56);
      CASE(58):  
	SETERR(MSG_IF);
      CASE(56):  
	GOTO(54);
      CASE(55):  
	if (!true) GOTO(66);
	{
	  // Programming error (parameter mismatch)
	  SETERR(MSG_STOP);
	}
	GOTO(54);
      CASE(66):  
	SETERR(MSG_IF);
      CASE(54):  
	GOTO(6);
      CASE(53):  
	if (!(FP->X_4161 == 13)) GOTO(67);
	BREAKPOINT_F(18); // Copy from file sector to copy sector
	FP->_Header.Temp.VBYTE = 4;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,68);
      CASE(68):  
	FP->_Header.Temp.VINT = 6;
	OUTPUT4(FP->Chain->chan241o_4033,&FP->_Header.Temp.VINT,69);
      CASE(69):  
	FP->_Header.Temp.VINT = 7;
	OUTPUT4(FP->Chain->chan241o_4033,&FP->_Header.Temp.VINT,70);
      CASE(70):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,71);
      CASE(71):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 0: GOTO (73);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(73):  
	INPUT4(FP->Chain->chan240i_4032,FP->status_4154,74);
      CASE(74):  
	FP->_U98._C412.Status_4116=*FP->status_4154;
	FP->_U98._C412.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._C412,75,"P_Verify_4118");
      CASE(75):  
	GOTO(72);
      CASE(72):  
	GOTO(6);
      CASE(67):  
	if (!(FP->X_4161 == 14)) GOTO(76);
	BREAKPOINT_F(18); // Program file sector - some of it
	FP->_U98._C410.Buffer_4085_Dim0=FP->buffer_4151_Dim0;
	FP->_U98._C410.Buffer_4085= (INT*)FP->buffer_4151;
	FP->_U98._C410.AbsoluteAddressOfFlash_4086=FP->fileAddress_4159;
	FP->_U98._C410.NoOfInt32OfFlashBuffer_4087=256;
	FP->_U98._C410.status_4088=FP->status_4154;
	FP->_U98._C410.Chain = FP->Chain;
	CALL(P_WriteToFlash_4099,&FP->_U98._C410,77,"P_WriteToFlash_4099");
      CASE(77):  
	FP->_U98._C411.Status_4116=*FP->status_4154;
	FP->_U98._C411.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._C411,78,"P_Verify_4118");
      CASE(78):  
	GOTO(6);
      CASE(76):  
	if (!(FP->X_4161 == 15)) GOTO(79);
	BREAKPOINT_F(18); // Read file sector - some of it
	FP->_U98._C408.readBuffer_4100_Dim0=FP->buffer_4151_Dim0;
	FP->_U98._C408.readBuffer_4100= (INT*)FP->buffer_4151;
	FP->_U98._C408.AbsoluteAddressOfFlash_4101=FP->fileAddress_4159;
	FP->_U98._C408.NoOfInt32OfServerBuffer_4102=256;
	FP->_U98._C408.status_4103=FP->status_4154;
	FP->_U98._C408.Chain = FP->Chain;
	CALL(P_ReadFromFlash_4115,&FP->_U98._C408,80,"P_ReadFromFlash_4115");
      CASE(80):  
	FP->_U98._C409.Status_4116=*FP->status_4154;
	FP->_U98._C409.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._C409,81,"P_Verify_4118");
      CASE(81):  
	GOTO(6);
      CASE(79):  
	if (!(FP->X_4161 == 16)) GOTO(82);
	BREAKPOINT_F(18); // Restore from copy sector to file sector
	FP->_Header.Temp.VBYTE = 6;
	OUTPUT1(FP->Chain->chan241o_4033,&FP->_Header.Temp.VBYTE,83);
      CASE(83):  
	INPUT1(FP->Chain->chan240i_4032,&FP->_Header.Temp.VBYTE,84);
      CASE(84):  
	switch(FP->_Header.Temp.VBYTE)
	{
	  case 0: GOTO (86);
	  default: SETERR(MSG_CASEIN);
	}
	break;
      CASE(86):  
	INPUT4(FP->Chain->chan240i_4032,FP->status_4154,87);
      CASE(87):  
	FP->_U98._C407.Status_4116=*FP->status_4154;
	FP->_U98._C407.Chain = FP->Chain;
	CALL(P_Verify_4118,&FP->_U98._C407,88,"P_Verify_4118");
      CASE(88):  
	GOTO(85);
      CASE(85):  
	GOTO(6);
      CASE(82):  
	SETERR(MSG_IF);
      CASE(6):  
	FP->iOfSequence_4158 = (FP->iOfSequence_4158 + 1);
      CASE(4):  
	if (((FP->iOfSequence_4158 < (FP->CommandSequence_4150_Dim0)) && (*FP->status_4154 == 0)))
	{
	  GOTO(5);
	}
	if (!FP->enableDMAIfError_4160) GOTO(90);
	BREAKPOINT_F(18); // EnableDMA because the error preempted it
	if (!FP->Chain->AllowSendOn_chan271o_4039) GOTO(92);
	FP->_Header.Temp.VBYTE = 2;
	OUTPUT1(FP->Chain->chan271o_4041,&FP->_Header.Temp.VBYTE,93);
      CASE(93):  
	GOTO(91);
      CASE(92):  
	if (!true) GOTO(94);
	GOTO(91);
      CASE(94):  
	SETERR(MSG_IF);
      CASE(91):  
	GOTO(89);
      CASE(90):  
	if (!true) GOTO(95);
	GOTO(89);
      CASE(95):  
	SETERR(MSG_IF);
      CASE(89):  
	if ((*((INT*)(((BYTE*)FP->CommandSequence_4150)+(0*sizeof(INT)))) == 0))
	{
	  {
	    // --- C embedded in occam, begin ---
	    // ---
	    Set_survivalFromLastRun(0xFF05AA5);
	    Set_survivalToDualPort_AndCopy(2);
	    // ---
	    // --- C embedded in occam, end ---
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(1);
      CASE(3):  
	SETERR(MSG_IF);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static INT F_Find_SEARCH_ID_4180(tSF_P_FileServer_4586 *PP,INT Buffer_4175_Dim0,INT *Buffer_4175)
{
  INT _Result;
  tSF_F_Find_SEARCH_ID_4180 SF;
  tSF_F_Find_SEARCH_ID_4180 *FP = &SF;
  FP->Chain = PP;
  {
    INT index_4176;
    {
      // (1.24 14Aug98 For lint) SPOC -> warning 644 "may not have been initialized"
      index_4176 = -1; 
      {
	INT Size_4177;
	Size_4177 = (INT)((Buffer_4175_Dim0) - 30);
	if ((Size_4177 <= 0))
	{
	  index_4176 = -1; 
	}
	else
	{
	  INT i_4178;
	  INT i_4178_End;
	  i_4178 = 0;i_4178_End = i_4178 + Size_4177;
	  for (; i_4178 != i_4178_End; i_4178++)
	  {
	    if ((*((INT*)(((BYTE*)Buffer_4175)+(RNGCHK(i_4178,Buffer_4175_Dim0)*sizeof(INT)))) == 0x76543210))
	    {
	      index_4176 = i_4178; 
	    }
	    else
	    {
	      continue;
	    }
	    break;
	  }
	  if (i_4178 == i_4178_End) 
	  if (true)
	  {
	    index_4176 = -1; 
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
      }
    }
    _Result = index_4176;
  }
  return _Result;
}
static void P_ReadFileFromFlash_4201 (tSF_P_ReadFileFromFlash_4201 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	if (!(*FP->status_4184 != 0)) GOTO(2);
	GOTO(1);
      CASE(2):  
	if (!true) GOTO(3);
	FP->iOfFileName_4185 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,FP->RequestedNameOfFile_4181_Dim0,(BYTE*)FP->RequestedNameOfFile_4181,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	if (!(FP->iOfFileName_4185 == -1)) GOTO(5);
	*FP->status_4184 = 131072;
	GOTO(4);
      CASE(5):  
	if (!true) GOTO(6);
	FP->_C420.CommandSequence_4150_Dim0=6;
	FP->_C420.CommandSequence_4150= (INT*)FP->Chain->ReadFlash6Seq_4059;
	FP->_C420.buffer_4151_Dim0=FP->buffer_4182_Dim0;
	FP->_C420.buffer_4151= (INT*)FP->buffer_4182;
	FP->_C420.AddressType_4152=1;
	FP->_C420.Address_4153=FP->iOfFileName_4185;
	FP->_C420.status_4154=FP->status_4184;
	FP->_C420.Chain = FP->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_C420,7,"P_FlashCommandInterpreter_4174");
      CASE(7):  
	FP->index_4186 = F_Find_SEARCH_ID_4180(FP->Chain,FP->buffer_4182_Dim0,(INT*)FP->buffer_4182);
	if ((FP->index_4186 == -1))
	{
	  *FP->status_4184 = 131072;
	}
	else
	if (true)
	{
	  {
	    /*lint -save -e550 For "SoFarFCBAndData Dim0" (1.24 14Aug98 For lint) */
	    {
	      INT SoFarFCBAndData_4187_Dim_437918235;/*SMW*/
	      INT *SoFarFCBAndData_4187;
	      INT SizeOfFileName_4188;
	      INT NoOfDataBytes_4189;
	      SoFarFCBAndData_4187 = (INT*)((INT*)(((BYTE*)FP->buffer_4182)+((RNGCHKUB(FP->index_4186,((FP->buffer_4182_Dim0) - FP->index_4186),FP->buffer_4182_Dim0),RNGCHKLB(FP->index_4186))*sizeof(INT))));
	      SoFarFCBAndData_4187_Dim_437918235 = ((FP->buffer_4182_Dim0) - FP->index_4186);
	      SizeOfFileName_4188 = (INT)*((INT*)(((BYTE*)SoFarFCBAndData_4187)+(2*sizeof(INT))));
	      NoOfDataBytes_4189 = (INT)*((INT*)(((BYTE*)SoFarFCBAndData_4187)+(28*sizeof(INT))));
	      if (( ! F_InRange_1472(0,SizeOfFileName_4188,20)))
	      {
		*FP->status_4184 = 131072;
	      }
	      else
	      if (( ! F_InRange_1472(0,(FP->RequestedNameOfFile_4181_Dim0),20)))
	      {
		*FP->status_4184 = 131072;
	      }
	      else
	      {
		INT NameOfFile_4198_Dim0;
		BYTE *NameOfFile_4198;
		NameOfFile_4198 = (BYTE*)((INT*)(((BYTE*)SoFarFCBAndData_4187)+((RNGCHKUB(3,SizeOfFileName_4188,((FP->buffer_4182_Dim0) - FP->index_4186)),3)*sizeof(INT))));
		NameOfFile_4198_Dim0 = (((SizeOfFileName_4188*sizeof(INT)))/(sizeof(BYTE))) ;
		CHK((NameOfFile_4198_Dim0*sizeof(BYTE)) == (SizeOfFileName_4188*sizeof(INT)),MSG_ARM);
		if (( ! F_AlmostEqualText_798(FP->Chain->Chain->Chain->Chain,NameOfFile_4198_Dim0,(BYTE*)NameOfFile_4198,FP->RequestedNameOfFile_4181_Dim0,(BYTE*)FP->RequestedNameOfFile_4181)))
		{
		  *FP->status_4184 = 131072;
		}
		else
		if ((NoOfDataBytes_4189 < 0))
		{
		  *FP->status_4184 = 0x400000;
		}
		else
		if ((NoOfDataBytes_4189 > 5432))
		{
		  *FP->status_4184 = 0x400000;
		}
		else
		if ((((NoOfDataBytes_4189 + 120) / 4) > (FP->buffer_4182_Dim0)))
		{
		  *FP->status_4184 = 0x200000;
		}
		else
		if (true)
		{
		  *FP->noOfInt32OfFCBAndData_4183 = ((120 + NoOfDataBytes_4189) / 4);
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	    /*lint -restore */
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if ((*FP->status_4184 == 0))
	{
	  {
	    INT y_4199;
	    {
	      y_4199 = 0; 
	      {
		INT i_4200;
		INT i_4200_End;
		i_4200 = FP->index_4186;i_4200_End = i_4200 + *FP->noOfInt32OfFCBAndData_4183;
		for (; i_4200 != i_4200_End; i_4200++)
		{
		  {
		    *((INT*)(((BYTE*)FP->buffer_4182)+(RNGCHK(y_4199,FP->buffer_4182_Dim0)*sizeof(INT)))) = *((INT*)(((BYTE*)FP->buffer_4182)+(RNGCHK(i_4200,FP->buffer_4182_Dim0)*sizeof(INT))));
		    y_4199 = (y_4199 + 1); 
		  }
		}
	      }
	    }
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(4);
      CASE(6):  
	SETERR(MSG_IF);
      CASE(4):  
	GOTO(1);
      CASE(3):  
	SETERR(MSG_IF);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_ReadHatFileFromFlash_4210 (tSF_P_FileServer_4586 *PP,INT RequestedNameOfFile_4202_Dim0,BYTE *RequestedNameOfFile_4202,INT BufferAdr_4203,INT SizeOfBuffer_4204,INT *noOfInt32OfFCBAndData_4205,INT *status_4206)
{
  tSF_P_ReadHatFileFromFlash_4210 SF;
  tSF_P_ReadHatFileFromFlash_4210 *FP = &SF;
  FP->Chain = PP;
  if ((*status_4206 != 0))
  {
  }
  else
  if (true)
  {
    {
      INT iOfFileName_4207;
      {
	{
	  INT dummy_4208;
	  {
	    /*lint -save -esym(550,dummy_4208) "dummy_4208 (line _) not accessed" (1.24 14Aug98 For lint) */
	    dummy_4208 = BufferAdr_4203; 
	    /*lint -restore */
	  }
	}
	iOfFileName_4207 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,RequestedNameOfFile_4202_Dim0,(BYTE*)RequestedNameOfFile_4202,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	if ((iOfFileName_4207 == -1))
	{
	  *status_4206 = 131072; 
	}
	else
	if (true)
	{
	  {
	    INT maxSizeOfFileSrvBuffer_4209;
	    {
	      maxSizeOfFileSrvBuffer_4209 = SizeOfBuffer_4204; 
	      // --- C embedded in occam, begin ---
	      // ---
	      #ifdef HATFILES_C // Defined in "m_Gl100.mak", not in "m_Boot1.mak"
	      {
		 #include "HatFiles.h"
		 *noOfInt32OfFCBAndData_4205 =
		   Get_hatFile_ok (
		      (word32_a)iOfFileName_4207,
		      (word32_a)maxSizeOfFileSrvBuffer_4209,
		      (word32_a *)BufferAdr_4203);
	      }
	      #else
		 *noOfInt32OfFCBAndData_4205 = maxSizeOfFileSrvBuffer_4209; // For lint, to avoid e550 "not accessed" (1.24 14Aug98 For lint)
		 *noOfInt32OfFCBAndData_4205 = (-1);
	      #endif
	      // ---
	      // --- C embedded in occam, end ---
	      if ((*noOfInt32OfFCBAndData_4205 == -1))
	      {
		*status_4206 = 0x4000000; 
	      }
	      else
	      if ((*noOfInt32OfFCBAndData_4205 == 0))
	      {
		*status_4206 = 0x2000000; 
	      }
	      else
	      if (true)
	      {
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
      }
    }
  }
  else
  {
    SETERR(MSG_IF);
  }
}
static BOOL F_IsFile_4215(tSF_P_FileServer_4586 *PP,INT FCBBank_4211_Dim0,INT *FCBBank_4211)
{
  BOOL _Result;
  tSF_F_IsFile_4215 SF;
  tSF_F_IsFile_4215 *FP = &SF;
  FP->Chain = PP;
  {
    BOOL isFile_4212;
    {
      {
	INT size_4213;
	{
	  size_4213 = (FCBBank_4211_Dim0); 
	  size_4213 = (size_4213 + 1); 
	}
      }
      isFile_4212 = (*((INT*)(((BYTE*)FCBBank_4211)+(2*sizeof(INT)))) != 0); 
    }
    _Result = isFile_4212;
  }
  return _Result;
}
static void P_ReplaceDeviceNameWith_4229 (tSF_P_FileServer_4586 *PP,INT NewDeviceTypeStr_4216_Dim0,BYTE *NewDeviceTypeStr_4216,BYTE *nameOfFile_4217,INT *sizeOfFileName_4218)
{
  tSF_P_ReplaceDeviceNameWith_4229 SF;
  tSF_P_ReplaceDeviceNameWith_4229 *FP = &SF;
  FP->Chain = PP;
  {
    BYTE copyOfNameOfFile_4219[20];
    INT newSizeOfFileName_4220;
    {
      newSizeOfFileName_4220 = 0; 
      {
	INT NameOfFile_4221_Dim_437918235;/*SMW*/
	BYTE *NameOfFile_4221;
	NameOfFile_4221 = (BYTE*)((BYTE*)(((BYTE*)nameOfFile_4217)+((RNGCHKUB(0,*sizeOfFileName_4218,20),0)*sizeof(BYTE))));
	NameOfFile_4221_Dim_437918235 = *sizeOfFileName_4218;
	{
	  {
	    INT deviceNameHandle_4222;
	    {
	      {
		BYTE *_V50_4223;
		{
		  static BYTE TMP[2] = {58,92};
		  _V50_4223 = TMP;
		}
		deviceNameHandle_4222 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,*sizeOfFileName_4218,(BYTE*)NameOfFile_4221,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V50_4223,1,8,1);
	      }
	      if ((deviceNameHandle_4222 == -1))
	      {
		{
		  CHK(*sizeOfFileName_4218==NameOfFile_4221_Dim_437918235,MSG_ASM);
		  ASSIGN(((BYTE*)(((BYTE*)copyOfNameOfFile_4219)+((RNGCHKUB(0,*sizeOfFileName_4218,20),0)*sizeof(BYTE)))),NameOfFile_4221,(*sizeOfFileName_4218*sizeof(BYTE))); 
		}
	      }
	      else
	      if (true)
	      {
		{
		  BYTE *Separator_4225;
		  {
		    static BYTE TMP[2] = {58,92};
		    Separator_4225 = TMP;
		  }
		  {
		    CHK((NewDeviceTypeStr_4216_Dim0)==NewDeviceTypeStr_4216_Dim0,MSG_ASM);
		    ASSIGN(((BYTE*)(((BYTE*)copyOfNameOfFile_4219)+((RNGCHKUB(newSizeOfFileName_4220,(NewDeviceTypeStr_4216_Dim0),20),RNGCHKLB(newSizeOfFileName_4220))*sizeof(BYTE)))),NewDeviceTypeStr_4216,((NewDeviceTypeStr_4216_Dim0)*sizeof(BYTE))); 
		    newSizeOfFileName_4220 = (newSizeOfFileName_4220 + (NewDeviceTypeStr_4216_Dim0)); 
		    ASSIGN(((BYTE*)(((BYTE*)copyOfNameOfFile_4219)+((RNGCHKUB(newSizeOfFileName_4220,2,20),RNGCHKLB(newSizeOfFileName_4220))*sizeof(BYTE)))),Separator_4225,(2*sizeof(BYTE))); 
		    newSizeOfFileName_4220 = (newSizeOfFileName_4220 + 2); 
		    {
		      INT sizeOfReplacedDeviceType_4226;
		      INT sizeOfNameOfFile_4227;
		      {
			sizeOfReplacedDeviceType_4226 = F_SizeOfTextNoTrailingSpaces_751(FP->Chain->Chain->Chain->Chain,8,(BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257)+(RNGCHK(deviceNameHandle_4222,4)*(8*sizeof(BYTE))))));
			sizeOfNameOfFile_4227 = F_SizeOfTextNoTrailingSpaces_751(FP->Chain->Chain->Chain->Chain,*sizeOfFileName_4218,(BYTE*)NameOfFile_4221);
			{
			  INT Size_4228;
			  Size_4228 = (INT)((sizeOfNameOfFile_4227 - sizeOfReplacedDeviceType_4226) - 2);
			  {
			    CHK(Size_4228==Size_4228,MSG_ASM);
			    ASSIGN(((BYTE*)(((BYTE*)copyOfNameOfFile_4219)+((RNGCHKUB(newSizeOfFileName_4220,Size_4228,20),RNGCHKLB(newSizeOfFileName_4220))*sizeof(BYTE)))),((BYTE*)(((BYTE*)NameOfFile_4221)+((RNGCHKUB((sizeOfReplacedDeviceType_4226 + 2),Size_4228,*sizeOfFileName_4218),RNGCHKLB((sizeOfReplacedDeviceType_4226 + 2)))*sizeof(BYTE)))),(Size_4228*sizeof(BYTE))); 
			    newSizeOfFileName_4220 = (newSizeOfFileName_4220 + Size_4228); 
			  }
			}
		      }
		    }
		  }
		}
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	}
      }
      CHK(newSizeOfFileName_4220==newSizeOfFileName_4220,MSG_ASM);
      ASSIGN(((BYTE*)(((BYTE*)nameOfFile_4217)+((RNGCHKUB(0,newSizeOfFileName_4220,20),0)*sizeof(BYTE)))),((BYTE*)(((BYTE*)copyOfNameOfFile_4219)+((RNGCHKUB(0,newSizeOfFileName_4220,20),0)*sizeof(BYTE)))),(newSizeOfFileName_4220*sizeof(BYTE))); 
      *sizeOfFileName_4218 = newSizeOfFileName_4220; 
    }
  }
}
static INT F_FindFileInAnFCBBank_4237(tSF_P_FileServer_4586 *PP,INT NameOfFile_4230_Dim0,BYTE *NameOfFile_4230,INT FCBBank_4231_Dim0,INT FCBBank_4231_Dim1,INT *FCBBank_4231)
{
  INT _Result;
  tSF_F_FindFileInAnFCBBank_4237 SF;
  tSF_F_FindFileInAnFCBBank_4237 *FP = &SF;
  FP->Chain = PP;
  {
    INT fileHandle_4232;
    {
      // (1.24 14Aug98 For lint) SPOC -> warning 644 "may not have been initialized"
      fileHandle_4232 = -1; 
      {
	INT i_4233;
	INT i_4233_End;
	i_4233 = 0;i_4233_End = i_4233 + (FCBBank_4231_Dim0);
	for (; i_4233 != i_4233_End; i_4233++)
	{
	  {
	    INT Size_4234;
	    INT NameOfFileInFCB_4235_Dim0;
	    BYTE *NameOfFileInFCB_4235;
	    Size_4234 = (INT)*((INT*)(((BYTE*)FCBBank_4231)+(2*sizeof(INT))+(RNGCHK(i_4233,FCBBank_4231_Dim0)*(FCBBank_4231_Dim1*sizeof(INT)))));
	    NameOfFileInFCB_4235 = (BYTE*)((INT*)(((BYTE*)FCBBank_4231)+((RNGCHKUB(3,Size_4234,FCBBank_4231_Dim1),3)*sizeof(INT))+(RNGCHK(i_4233,FCBBank_4231_Dim0)*(FCBBank_4231_Dim1*sizeof(INT)))));
	    NameOfFileInFCB_4235_Dim0 = (((Size_4234*sizeof(INT)))/(sizeof(BYTE))) ;
	    CHK((NameOfFileInFCB_4235_Dim0*sizeof(BYTE)) == (Size_4234*sizeof(INT)),MSG_ARM);
	    if (F_AlmostEqualText_798(FP->Chain->Chain->Chain->Chain,NameOfFileInFCB_4235_Dim0,(BYTE*)NameOfFileInFCB_4235,NameOfFile_4230_Dim0,(BYTE*)NameOfFile_4230))
	    {
	      fileHandle_4232 = i_4233; 
	    }
	    else
	    {
	      continue;
	    }
	  }
	  break;
	}
	if (i_4233 == i_4233_End) 
	if (true)
	{
	  fileHandle_4232 = -1; 
	}
	else
	{
	  SETERR(MSG_IF);
	}
      }
    }
    _Result = fileHandle_4232;
  }
  return _Result;
}
static INT F_FindExtFileInAnFCBBank_4246(tSF_P_FileServer_4586 *PP,INT NameOfFile_4238_Dim0,BYTE *NameOfFile_4238,BOOL RenameDeviceTypeToFlash6_4239,INT *FCB_4240)
{
  INT _Result;
  tSF_F_FindExtFileInAnFCBBank_4246 SF;
  tSF_F_FindExtFileInAnFCBBank_4246 *FP = &SF;
  FP->Chain = PP;
  {
    INT fileHandle_4241;
    {
      BYTE fileName_4242[20];
      INT lenOfFileName_4243;
      INT fcb_4244[1][30];
      {
	lenOfFileName_4243 = (NameOfFile_4238_Dim0); 
	CHK(lenOfFileName_4243==NameOfFile_4238_Dim0,MSG_ASM);
	ASSIGN(((BYTE*)(((BYTE*)fileName_4242)+((RNGCHKUB(0,lenOfFileName_4243,20),0)*sizeof(BYTE)))),NameOfFile_4238,(lenOfFileName_4243*sizeof(BYTE))); 
	if (RenameDeviceTypeToFlash6_4239)
	{
	  P_ReplaceDeviceNameWith_4229(FP->Chain,6,(BYTE*)FP->Chain->Chain->Chain->Chain->Flash6_1259,(BYTE*)fileName_4242,&lenOfFileName_4243);
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	ASSIGN(((INT*)(((BYTE*)fcb_4244)+(0*(30*sizeof(INT))))),FCB_4240,(30*sizeof(INT))); 
	fileHandle_4241 = F_FindFileInAnFCBBank_4237(FP->Chain,lenOfFileName_4243,(BYTE*)((BYTE*)(((BYTE*)fileName_4242)+((RNGCHKUB(0,lenOfFileName_4243,20),0)*sizeof(BYTE)))),1,30,(INT*)fcb_4244);
      }
    }
    _Result = fileHandle_4241;
  }
  return _Result;
}
static INT F_NoOfFilesInAnFCBBank_4251(tSF_P_FileServer_4586 *PP,INT FCBBank_4247_Dim0,INT FCBBank_4247_Dim1,INT *FCBBank_4247)
{
  INT _Result;
  tSF_F_NoOfFilesInAnFCBBank_4251 SF;
  tSF_F_NoOfFilesInAnFCBBank_4251 *FP = &SF;
  FP->Chain = PP;
  {
    INT noOfFiles_4248;
    {
      noOfFiles_4248 = 0; 
      {
	INT i_4249;
	INT i_4249_End;
	i_4249 = 0;i_4249_End = i_4249 + (FCBBank_4247_Dim0);
	for (; i_4249 != i_4249_End; i_4249++)
	{
	  if (F_IsFile_4215(FP->Chain,FCBBank_4247_Dim1,(INT*)((INT*)(((BYTE*)FCBBank_4247)+(RNGCHK(i_4249,FCBBank_4247_Dim0)*(FCBBank_4247_Dim1*sizeof(INT)))))))
	  {
	    noOfFiles_4248 = (noOfFiles_4248 + 1); 
	  }
	  else
	  if (true)
	  {
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
      }
    }
    _Result = noOfFiles_4248;
  }
  return _Result;
}
static INT F_FindLastFileInAnFCBBank_4257(tSF_P_FileServer_4586 *PP,INT FCBBank_4252_Dim0,INT FCBBank_4252_Dim1,INT *FCBBank_4252)
{
  INT _Result;
  tSF_F_FindLastFileInAnFCBBank_4257 SF;
  tSF_F_FindLastFileInAnFCBBank_4257 *FP = &SF;
  FP->Chain = PP;
  {
    INT iOfLastFile_4253;
    {
      // (1.24 14Aug98 For lint) SPOC -> warning 644 "may not have been initialized"
      iOfLastFile_4253 = -1; 
      {
	INT i_4254;
	INT i_4254_End;
	i_4254 = 0;i_4254_End = i_4254 + (FCBBank_4252_Dim0);
	for (; i_4254 != i_4254_End; i_4254++)
	{
	  {
	    INT I_4255;
	    I_4255 = (INT)(((FCBBank_4252_Dim0) - 1) - i_4254);
	    if (F_IsFile_4215(FP->Chain,FCBBank_4252_Dim1,(INT*)((INT*)(((BYTE*)FCBBank_4252)+(RNGCHK(I_4255,FCBBank_4252_Dim0)*(FCBBank_4252_Dim1*sizeof(INT)))))))
	    {
	      iOfLastFile_4253 = I_4255; 
	    }
	    else
	    {
	      continue;
	    }
	  }
	  break;
	}
	if (i_4254 == i_4254_End) 
	if (true)
	{
	  iOfLastFile_4253 = -1; 
	}
	else
	{
	  SETERR(MSG_IF);
	}
      }
    }
    _Result = iOfLastFile_4253;
  }
  return _Result;
}
static INT F_FindNextFileInAnFCBBank_4267(tSF_P_FileServer_4586 *PP,INT FCBBank_4258_Dim0,INT FCBBank_4258_Dim1,INT *FCBBank_4258,INT NoOfValidFilesToSkip_4259)
{
  INT _Result;
  tSF_F_FindNextFileInAnFCBBank_4267 SF;
  tSF_F_FindNextFileInAnFCBBank_4267 *FP = &SF;
  FP->Chain = PP;
  {
    INT iOfNextFile_4260;
    {
      INT iOfFile_4261;
      BOOL found_4262;
      {
	iOfFile_4261 = 0; 
	iOfNextFile_4260 = 0; 
	found_4262 = false; 
	// Skip first valid files
	{
	  INT noOfFiles_4263;
	  {
	    noOfFiles_4263 = 0; 
	    {
	      INT i_4264;
	      INT i_4264_End;
	      i_4264 = 0;i_4264_End = i_4264 + (FCBBank_4258_Dim0);
	      for (; i_4264 != i_4264_End; i_4264++)
	      {
		if (F_IsFile_4215(FP->Chain,FCBBank_4258_Dim1,(INT*)((INT*)(((BYTE*)FCBBank_4258)+(RNGCHK(i_4264,FCBBank_4258_Dim0)*(FCBBank_4258_Dim1*sizeof(INT)))))))
		{
		  {
		    // This file is valid
		    if ((noOfFiles_4263 == NoOfValidFilesToSkip_4259))
		    {
		      {
			// Found the required files in front
			iOfFile_4261 = i_4264; 
			found_4262 = true; 
		      }
		    }
		    else
		    if (true)
		    {
		      {
			// Not enough valid files yet
		      }
		    }
		    else
		    {
		      SETERR(MSG_IF);
		    }
		    noOfFiles_4263 = (noOfFiles_4263 + 1); 
		  }
		}
		else
		if (true)
		{
		  {
		    // This file is not valid
		  }
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	  }
	}
	// Find next file
	if (( ! found_4262))
	{
	  {
	    // Did not find as many files in front as wanted
	    iOfNextFile_4260 = -1; 
	  }
	}
	else
	if (true)
	{
	  {
	    INT i_4265;
	    INT i_4265_End;
	    i_4265 = iOfFile_4261;i_4265_End = i_4265 + ((FCBBank_4258_Dim0) - iOfFile_4261);
	    for (; i_4265 != i_4265_End; i_4265++)
	    {
	      if (F_IsFile_4215(FP->Chain,FCBBank_4258_Dim1,(INT*)((INT*)(((BYTE*)FCBBank_4258)+(RNGCHK(i_4265,FCBBank_4258_Dim0)*(FCBBank_4258_Dim1*sizeof(INT)))))))
	      {
		{
		  // Found a "next" file
		  iOfNextFile_4260 = i_4265; 
		}
	      }
	      else
	      {
		continue;
	      }
	      break;
	    }
	    if (i_4265 == i_4265_End) 
	    if (true)
	    {
	      {
		// Did not find a "next" file
		iOfNextFile_4260 = -1; 
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
      }
    }
    _Result = iOfNextFile_4260;
  }
  return _Result;
}
static void P_InsertFileNameInAnFCBBank_If_4272 (tSF_P_FileServer_4586 *PP,INT NameOfFile_4268_Dim0,BYTE *NameOfFile_4268,INT FCBBank_4269_Dim0,INT FCBBank_4269_Dim1,INT *FCBBank_4269,INT *fileHandle_4270)
{
  tSF_P_InsertFileNameInAnFCBBank_If_4272 SF;
  tSF_P_InsertFileNameInAnFCBBank_If_4272 *FP = &SF;
  FP->Chain = PP;
  {
    *fileHandle_4270 = F_FindFileInAnFCBBank_4237(FP->Chain,NameOfFile_4268_Dim0,(BYTE*)NameOfFile_4268,FCBBank_4269_Dim0,FCBBank_4269_Dim1,(INT*)FCBBank_4269);
    if ((*fileHandle_4270 != -1))
    {
    }
    else
    {
      INT i_4271;
      INT i_4271_End;
      i_4271 = 0;i_4271_End = i_4271 + (FCBBank_4269_Dim0);
      for (; i_4271 != i_4271_End; i_4271++)
      {
	if ((*((INT*)(((BYTE*)FCBBank_4269)+(2*sizeof(INT))+(RNGCHK(i_4271,FCBBank_4269_Dim0)*(FCBBank_4269_Dim1*sizeof(INT))))) == 0))
	{
	  {
	    *((INT*)(((BYTE*)FCBBank_4269)+(2*sizeof(INT))+(RNGCHK(i_4271,FCBBank_4269_Dim0)*(FCBBank_4269_Dim1*sizeof(INT))))) = (NameOfFile_4268_Dim0); 
	    P_InsertText_755((NameOfFile_4268_Dim0),(INT*)((INT*)(((BYTE*)FCBBank_4269)+((RNGCHKUB(3,(NameOfFile_4268_Dim0),FCBBank_4269_Dim1),3)*sizeof(INT))+(RNGCHK(i_4271,FCBBank_4269_Dim0)*(FCBBank_4269_Dim1*sizeof(INT))))),NameOfFile_4268_Dim0,(BYTE*)NameOfFile_4268);
	    *fileHandle_4270 = i_4271; 
	  }
	}
	else
	{
	  continue;
	}
	break;
      }
      if (i_4271 == i_4271_End) 
      if (true)
      {
	*fileHandle_4270 = -1; 
      }
      else
      {
	SETERR(MSG_IF);
      }
    }
  }
}
static void P_InsertDateEtcInAnFCBBank_4276 (tSF_P_FileServer_4586 *PP,INT FileHandle_4273,INT *DateEtc_4274,INT fCBBank_4275_Dim0,INT fCBBank_4275_Dim1,INT *fCBBank_4275)
{
  tSF_P_InsertDateEtcInAnFCBBank_4276 SF;
  tSF_P_InsertDateEtcInAnFCBBank_4276 *FP = &SF;
  FP->Chain = PP;
  ASSIGN(((INT*)(((BYTE*)fCBBank_4275)+((23)*sizeof(INT))+(RNGCHK(FileHandle_4273,fCBBank_4275_Dim0)*(fCBBank_4275_Dim1*sizeof(INT))))),DateEtc_4274,(6*sizeof(INT))); 
}
static void P_InsertNoOfDataBytesInAnFCBBank_4280 (tSF_P_FileServer_4586 *PP,INT FileHandle_4277,INT NoOfInt32s_4278,INT fCBBank_4279_Dim0,INT fCBBank_4279_Dim1,INT *fCBBank_4279)
{
  tSF_P_InsertNoOfDataBytesInAnFCBBank_4280 SF;
  tSF_P_InsertNoOfDataBytesInAnFCBBank_4280 *FP = &SF;
  FP->Chain = PP;
  *((INT*)(((BYTE*)fCBBank_4279)+(28*sizeof(INT))+(RNGCHK(FileHandle_4277,fCBBank_4279_Dim0)*(fCBBank_4279_Dim1*sizeof(INT))))) = (NoOfInt32s_4278 * 4); 
}
static void P_RemoveFileFromAnFCBBank_4285 (tSF_P_FileServer_4586 *PP,INT NameOfFile_4281_Dim0,BYTE *NameOfFile_4281,INT FCBBank_4282_Dim0,INT FCBBank_4282_Dim1,INT *FCBBank_4282,BOOL *ok_4283)
{
  tSF_P_RemoveFileFromAnFCBBank_4285 SF;
  tSF_P_RemoveFileFromAnFCBBank_4285 *FP = &SF;
  FP->Chain = PP;
  {
    INT fileHandle_4284;
    {
      fileHandle_4284 = F_FindFileInAnFCBBank_4237(FP->Chain,NameOfFile_4281_Dim0,(BYTE*)NameOfFile_4281,FCBBank_4282_Dim0,FCBBank_4282_Dim1,(INT*)FCBBank_4282);
      if ((fileHandle_4284 == -1))
      {
	*ok_4283 = false; 
      }
      else
      if (true)
      {
	{
	  *((INT*)(((BYTE*)FCBBank_4282)+(2*sizeof(INT))+(RNGCHK(fileHandle_4284,FCBBank_4282_Dim0)*(FCBBank_4282_Dim1*sizeof(INT))))) = 0; 
	  *ok_4283 = true; 
	}
      }
      else
      {
	SETERR(MSG_IF);
      }
    }
  }
}
static void P_Report_FileError_4290 (tSF_P_Report_FileError_4290 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	if ((((FP->IOfFile_4288 == -1) || (FP->IOfFile_4288 < 0)) || (FP->IOfFile_4288 > 13)))
	{
	  ASSIGN(FP->ncr_4289,FP->NCR_4287,(3*sizeof(INT)));
	}
	else
	if (true)
	{
	  {
	    ASSIGN(FP->ncr_4289,FP->NCR_4287,(3*sizeof(INT)));
	    *((INT*)(((BYTE*)FP->ncr_4289)+(2*sizeof(INT)))) = (*((INT*)(((BYTE*)FP->ncr_4289)+(2*sizeof(INT)))) + (FP->IOfFile_4288 + 1));
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	OUTPUT(FP->chan900oLocal_4286,FP->ncr_4289,(3*sizeof(INT)),1);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_Send_PFileHereIsFileAddrAckNack_4302 (tSF_P_Send_PFileHereIsFileAddrAckNack_4302 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	*FP->dataInFileApproved_4295 = true;
	BREAKPOINT_F(17); // Send
	P_SetProtocolType_1917(FP->Chain->Chain->Chain->Chain,6,(INT*)FP->envelope_4296,5);
	P_SetTheProtocolCmd_1929(FP->Chain->Chain->Chain->Chain,6,(INT*)FP->envelope_4296,5);
	*((INT*)(((BYTE*)FP->envelope_4296)+(3*sizeof(INT)))) = FP->IndexOfFile_4291;
	*((INT*)(((BYTE*)FP->envelope_4296)+(4*sizeof(INT)))) = FP->AddressOfData_4293;
	*((INT*)(((BYTE*)FP->envelope_4296)+(5*sizeof(INT)))) = FP->NoOfInt32OfData_4294;
	if (!*((BOOL*)(((BYTE*)FP->Chain->AllowSendOn_fileAddressOut_4034)+(RNGCHK(FP->UserOfFile_4292,4)*sizeof(BOOL))))) GOTO(2);
	FP->_Header.Temp.VINT = 6;
	OUTPUT4(*((CHAN**)(((BYTE*)FP->Chain->fileAddressOut_4036)+(RNGCHK(FP->UserOfFile_4292,FP->Chain->fileAddressOut_4036_Dim0)*sizeof(CHAN *)))),&FP->_Header.Temp.VINT,3);
      CASE(3):  
	OUTPUT(*((CHAN**)(((BYTE*)FP->Chain->fileAddressOut_4036)+(RNGCHK(FP->UserOfFile_4292,FP->Chain->fileAddressOut_4036_Dim0)*sizeof(CHAN *)))),FP->envelope_4296,(6)*(sizeof(INT)),4);
      CASE(4):  
	GOTO(1);
      CASE(2):  
	if (!true) GOTO(5);
	GOTO(1);
      CASE(5):  
	SETERR(MSG_IF);
      CASE(1):  
	if (!*((BOOL*)(((BYTE*)FP->Chain->AllowSendOn_fileAddressOut_4034)+(RNGCHK(FP->UserOfFile_4292,4)*sizeof(BOOL))))) GOTO(7);
	FP->_U100._S106.time_4297 = ReadTimer();
	ALT();
	ENBC(true,*((CHAN**)(((BYTE*)FP->Chain->fileAddressAck_4035)+(RNGCHK(FP->UserOfFile_4292,FP->Chain->fileAddressAck_4035_Dim0)*sizeof(CHAN *)))));
	ENBT(true,(FP->_U100._S106.time_4297 + 60000));
	ALTWT(8);
      CASE(8):  
	{
	  BOOL TMP = false;
	  TMP |= DISC(9,true,*((CHAN**)(((BYTE*)FP->Chain->fileAddressAck_4035)+(RNGCHK(FP->UserOfFile_4292,FP->Chain->fileAddressAck_4035_Dim0)*sizeof(CHAN *)))));
	  TMP |= DIST(10,true,(FP->_U100._S106.time_4297 + 60000));
	}
	ALTEND();
      CASE(9):  
	INPUT4(*((CHAN**)(((BYTE*)FP->Chain->fileAddressAck_4035)+(RNGCHK(FP->UserOfFile_4292,FP->Chain->fileAddressAck_4035_Dim0)*sizeof(CHAN *)))),&FP->_U100._S106.noOfInt32OfEnvelope_4299,12);
      CASE(12):  
	CHK(FP->_U100._S106.noOfInt32OfEnvelope_4299<=6,MSG_CITL);
	INPUT(*((CHAN**)(((BYTE*)FP->Chain->fileAddressAck_4035)+(RNGCHK(FP->UserOfFile_4292,FP->Chain->fileAddressAck_4035_Dim0)*sizeof(CHAN *)))),FP->envelope_4296,(FP->_U100._S106.noOfInt32OfEnvelope_4299)*(sizeof(INT)),13);
      CASE(13):  
	BREAKPOINT_F(17); // Ack received
	P_GetProtocolType_1914(FP->Chain->Chain->Chain->Chain,6,(INT*)FP->envelope_4296,&FP->_U100._S106.protType_4300);
	P_GetTheProtocolCmd_1926(FP->Chain->Chain->Chain->Chain,6,(INT*)FP->envelope_4296,&FP->_U100._S106.protCmd_4301);
	if (!(FP->_U100._S106.protType_4300 != 5)) GOTO(15);
	{
	  // Not PFile
	  SETERR(MSG_STOP);
	}
	GOTO(14);
      CASE(15):  
	if (!(FP->_U100._S106.protCmd_4301 == 1)) GOTO(16);
	GOTO(14);
      CASE(16):  
	if (!(FP->_U100._S106.protCmd_4301 == 2)) GOTO(17);
	FP->_U100._S106._U101._C427.chan900oLocal_4286=FP->Chain->chan900o_4044;
	FP->_U100._S106._U101._C427.NCR_4287= (INT*)FP->Chain->Chain->Chain->Chain->NCR_ErrorInDataOfFile_1178;
	FP->_U100._S106._U101._C427.IOfFile_4288=FP->IndexOfFile_4291;
	FP->_U100._S106._U101._C427.Chain = FP->Chain;
	CALL(P_Report_FileError_4290,&FP->_U100._S106._U101._C427,18,"P_Report_FileError_4290");
      CASE(18):  
	*FP->dataInFileApproved_4295 = false;
	GOTO(14);
      CASE(17):  
	if (!true) GOTO(19);
	{
	  // Not PFile nor PFileAckEnd
	  SETERR(MSG_STOP);
	}
	GOTO(14);
      CASE(19):  
	SETERR(MSG_IF);
      CASE(14):  
	GOTO(11);
      CASE(10):  
	OUTPUT(FP->Chain->chan900o_4044,FP->Chain->Chain->Chain->Chain->NCR_FileServerNoReplyFromInternal_1164,(3*sizeof(INT)),20);
      CASE(20):  
	*FP->dataInFileApproved_4295 = false;
	GOTO(11);
      CASE(11):  
	GOTO(6);
      CASE(7):  
	if (!true) GOTO(21);
	GOTO(6);
      CASE(21):  
	SETERR(MSG_IF);
      CASE(6):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_ContinueStartAtToken_4312 (tSF_P_FindFCBOf_512K_CodeAnywhere_4319 *PP,INT NoOfValuesSearched_4311)
{
  tSF_P_ContinueStartAtToken_4312 SF;
  tSF_P_ContinueStartAtToken_4312 *FP = &SF;
  FP->Chain = PP;
  {
    FP->Chain->noOfValuesLeft_4307 = ((FP->Chain->noOfValuesLeft_4307 - NoOfValuesSearched_4311) - 1);
    FP->Chain->startAddress_4308 = ((FP->Chain->startAddress_4308 + NoOfValuesSearched_4311) + 1);
  }
}
static void P_FindFCBOf_512K_CodeAnywhere_4319 (tSF_P_FileServer_4586 *PP,INT IOfFile_4303,INT StartAddress_4304,BOOL *fcbFound_4305,INT *fcb_4306)
{
  tSF_P_FindFCBOf_512K_CodeAnywhere_4319 SF;
  tSF_P_FindFCBOf_512K_CodeAnywhere_4319 *FP = &SF;
  FP->Chain = PP;
  {
    BOOL finished_4309;
    INT local_fcb_4310[30];
    {
      // Insert EFCB (taken from v_gl100.inc or v_boot1.inc)
      ASSIGN(local_fcb_4310,FP->Chain->Chain->Chain->Chain->EFCB_OfProgramCode_1945,(30*sizeof(INT)));
      FP->startAddress_4308 = StartAddress_4304;
      FP->noOfValuesLeft_4307 = 131072;
      finished_4309 = false; 
      *fcbFound_4305 = false; 
      while (((FP->noOfValuesLeft_4307 > 0) && (finished_4309 == false)))
      {
	{
	  INT lenOfStringStartAtToken_4313;
	  INT noOfValuesSearched_4314;
	  BOOL tokenFound_4315;
	  {
	    lenOfStringStartAtToken_4313 = 30; 
	    // --- C embedded in occam, begin ---
	    // ---
	    // In "String1.c"
	    noOfValuesSearched_4314 = GetStartAtToken (
	       (word32_a  )FP->noOfValuesLeft_4307, // LenOfSearchIn
	       (word32_a *)FP->startAddress_4308, // SearchInPtr
	       (word32_a  )0x76543210, // Token
	       (word32_a  )lenOfStringStartAtToken_4313, // lenOfStringStartAtToken
	       (word32_a *)local_fcb_4310, // fcbPtr
	       (bool_a   *)&tokenFound_4315); // tokenFoundPtr
	    // ---
	    // --- C embedded in occam, end ---
	    if (tokenFound_4315)
	    {
	      {
		INT fileNameSize_4316;
		{
		  fileNameSize_4316 = *((INT*)(((BYTE*)local_fcb_4310)+(2*sizeof(INT)))); 
		  if ((fileNameSize_4316 != 20))
		  {
		    P_ContinueStartAtToken_4312(FP,noOfValuesSearched_4314);
		  }
		  else
		  if (true)
		  {
		    {
		      INT fileNameHandle_4317;
		      INT FileName_4318_Dim0;
		      BYTE *FileName_4318;
		      FileName_4318 = (BYTE*)((INT*)(((BYTE*)local_fcb_4310)+((RNGCHKUB(3,fileNameSize_4316,30),3)*sizeof(INT))));
		      FileName_4318_Dim0 = (((fileNameSize_4316*sizeof(INT)))/(sizeof(BYTE))) ;
		      CHK((FileName_4318_Dim0*sizeof(BYTE)) == (fileNameSize_4316*sizeof(INT)),MSG_ARM);
		      {
			fileNameHandle_4317 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,FileName_4318_Dim0,(BYTE*)FileName_4318,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
			if ((fileNameHandle_4317 != IOfFile_4303))
			{
			  {
			    // Not correct file name
			    P_ContinueStartAtToken_4312(FP,noOfValuesSearched_4314);
			  }
			}
			else
			if ((fileNameHandle_4317 == IOfFile_4303))
			{
			  {
			    // FCB found
			    *fcbFound_4305 = true; 
			    finished_4309 = true; 
			    ASSIGN(fcb_4306,local_fcb_4310,(30*sizeof(INT))); 
			  }
			}
			else
			{
			  SETERR(MSG_IF);
			}
		      }
		    }
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		}
	      }
	    }
	    else
	    if (( ! tokenFound_4315))
	    {
	      {
		// Not correct file name
		finished_4309 = true; 
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	    if ((FP->noOfValuesLeft_4307 < 0))
	    {
	      SETERR(MSG_STOP);
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
      }
    }
  }
}
static void P_ResetRdSegmenting_Left_Sent_4336 (tSF_P_FileServer_4586 *PP,INT NoOfElemOfRdFileLeft_4334,INT NoOfElemOfRdFileSent_4335)
{
  tSF_P_ResetRdSegmenting_Left_Sent_4336 SF;
  tSF_P_ResetRdSegmenting_Left_Sent_4336 *FP = &SF;
  FP->Chain = PP;
  {
    FP->Chain->next_iOfRdFile_4324 = 30;
    FP->Chain->noOfElemOfRdFileLeft_4325 = NoOfElemOfRdFileLeft_4334;
    FP->Chain->noOfElemOfRdFileSent_4326 = NoOfElemOfRdFileSent_4335;
  }
}
static void P_ResetWrSegmenting_4337 (tSF_P_FileServer_4586 *PP)
{
  tSF_P_ResetWrSegmenting_4337 SF;
  tSF_P_ResetWrSegmenting_4337 *FP = &SF;
  FP->Chain = PP;
  FP->Chain->next_iOfWrFile_4323 = 30;
}
static void P_ResetReadFileNamesSegmenting_4339 (tSF_P_FileServer_4586 *PP,INT NoOfFilesOfRdFileNames_4338)
{
  tSF_P_ResetReadFileNamesSegmenting_4339 SF;
  tSF_P_ResetReadFileNamesSegmenting_4339 *FP = &SF;
  FP->Chain = PP;
  {
    FP->Chain->noOfFilesOfRdFileNames_4328 = NoOfFilesOfRdFileNames_4338;
    FP->Chain->noOfFilesSentOfRdFileNames_4327 = 0;
  }
}
static void P_ResetAllSegmenting_4340 (tSF_P_FileServer_4586 *PP)
{
  tSF_P_ResetAllSegmenting_4340 SF;
  tSF_P_ResetAllSegmenting_4340 *FP = &SF;
  FP->Chain = PP;
  {
    P_ResetRdSegmenting_Left_Sent_4336(FP->Chain,0,0);
    P_ResetWrSegmenting_4337(FP->Chain);
    P_ResetReadFileNamesSegmenting_4339(FP->Chain,0);
  }
}
static void P_FillFCBAndKnownInto_I_Buffer_dat_4344 (tSF_P_FileServer_4586 *PP)
{
  tSF_P_FillFCBAndKnownInto_I_Buffer_dat_4344 SF;
  tSF_P_FillFCBAndKnownInto_I_Buffer_dat_4344 *FP = &SF;
  FP->Chain = PP;
  {
    INT fileHandle_4341;
    {
      fileHandle_4341 = F_FindFileInAnFCBBank_4237(FP->Chain,20,(BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301)+(0*(20*sizeof(BYTE))))),20,30,(INT*)FP->Chain->fCBBank_4320);
      if ((fileHandle_4341 == -1))
      {
	SETERR(MSG_STOP);
      }
      else
      if (true)
      {
	{
	  ASSIGN(((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(RNGCHK(fileHandle_4341,20)*(30*sizeof(INT))))),(30*sizeof(INT)));
	  {
	    INT byte_4342;
	    {
	      byte_4342 = 0; 
	      {
		INT i_4343;
		for (i_4343 = 30; i_4343 != 30 + 1358; i_4343++)
		{
		  if ((i_4343 < 256))
		  {
		    {
		      *((INT*)(((BYTE*)FP->Chain->buffer_4322)+(i_4343*sizeof(INT)))) = ((LOGSHIFTLEFT(INT,byte_4342,24) | LOGSHIFTLEFT(INT,(byte_4342 + 1),16)) | (LOGSHIFTLEFT(INT,(byte_4342 + 2),8) | (byte_4342 + 3)));
		      byte_4342 = ((byte_4342 + 4) & 255); 
		    }
		  }
		  else
		  if (true)
		  {
		    *((INT*)(((BYTE*)FP->Chain->buffer_4322)+(i_4343*sizeof(INT)))) = (30 + i_4343);
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		}
	      }
	    }
	  }
	}
      }
      else
      {
	SETERR(MSG_IF);
      }
    }
  }
}
static void P_UpdateInitFilesOfClient_4361 (tSF_P_UpdateInitFilesOfClient_4361 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->x_4346 = 0;
	FP->x_4346_End = FP->x_4346 + (FP->Clients_4345_Dim0);
	GOTO(1);
      CASE(2):  
	BREAKPOINT_F(17); // Check and load file at initialization
	FP->noOfFilesForClient_4347 = 0;
	FP->i_4348 = 0;
	GOTO(3);
      CASE(4):  
	// Next init file
	FP->IOfFile_4349 = (INT)*((INT*)(((BYTE*)FP->Chain->Chain->Chain->Chain->ReadAtInitFlash6Files_1305)+(FP->i_4348*sizeof(INT))));
	FP->UserOfFile_4350 = (INT)*((INT*)(((BYTE*)FP->Chain->Chain->Chain->Chain->UsersOfFiles_1310)+(RNGCHK(FP->IOfFile_4349,13)*sizeof(INT))));
	if (!(*((INT*)(((BYTE*)FP->Clients_4345)+(RNGCHK(FP->x_4346,FP->Clients_4345_Dim0)*sizeof(INT)))) == FP->UserOfFile_4350)) GOTO(6);
	// This user must have this file
	FP->status_4351 = 0;
	FP->noOfFilesForClient_4347 = (FP->noOfFilesForClient_4347 + 1);
	FP->_U104._S107.NameOfFile_4354 = (BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301)+(RNGCHK(FP->IOfFile_4349,13)*(20*sizeof(BYTE)))));
	{
	  INT iOfDeviceType_4355;
	  {
	    BREAKPOINT_F(17); // Find iOfDeviceType
	    {
	      BYTE *_V51_4356;
	      {
		static BYTE TMP[2] = {58,92};
		_V51_4356 = TMP;
	      }
	      iOfDeviceType_4355 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,20,(BYTE*)FP->_U104._S107.NameOfFile_4354,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V51_4356,1,8,1);
	    }
	    if ((iOfDeviceType_4355 == -1))
	    {
	      SETERR(MSG_STOP);
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	FP->_U104._S107._U105._C433.RequestedNameOfFile_4181_Dim0=20;
	FP->_U104._S107._U105._C433.RequestedNameOfFile_4181= (BYTE*)FP->_U104._S107.NameOfFile_4354;
	FP->_U104._S107._U105._C433.buffer_4182_Dim0=1388;
	FP->_U104._S107._U105._C433.buffer_4182= (INT*)FP->Chain->buffer_4322;
	FP->_U104._S107._U105._C433.noOfInt32OfFCBAndData_4183=&FP->noOfInt32OfFCBAndData_4352;
	FP->_U104._S107._U105._C433.status_4184=&FP->status_4351;
	FP->_U104._S107._U105._C433.Chain = FP->Chain;
	CALL(P_ReadFileFromFlash_4201,&FP->_U104._S107._U105._C433,7,"P_ReadFileFromFlash_4201");
      CASE(7):  
	if (!(FP->status_4351 != 0)) GOTO(9);
	FP->status_4351 = 1;
	if (!*((BOOL*)(((BYTE*)FP->Chain->AllowSendOn_fileAddressOut_4034)+(RNGCHK(FP->UserOfFile_4350,4)*sizeof(BOOL))))) GOTO(11);
	FP->_U104._S107._U105._C436.chan900oLocal_4286=FP->Chain->chan900o_4044;
	FP->_U104._S107._U105._C436.NCR_4287= (INT*)FP->Chain->Chain->Chain->Chain->NCR_CannotFindFile_1170;
	FP->_U104._S107._U105._C436.IOfFile_4288=FP->IOfFile_4349;
	FP->_U104._S107._U105._C436.Chain = FP->Chain;
	CALL(P_Report_FileError_4290,&FP->_U104._S107._U105._C436,12,"P_Report_FileError_4290");
      CASE(12):  
	GOTO(10);
      CASE(11):  
	if (!true) GOTO(13);
	GOTO(10);
      CASE(13):  
	SETERR(MSG_IF);
      CASE(10):  
	GOTO(8);
      CASE(9):  
	if (!true) GOTO(14);
	P_InsertFileNameInAnFCBBank_If_4272(FP->Chain,20,(BYTE*)FP->_U104._S107.NameOfFile_4354,20,30,(INT*)FP->Chain->fCBBank_4320,&FP->fileHandle_4353);
	if (!(FP->fileHandle_4353 == -1)) GOTO(16);
	FP->status_4351 = 2;
	FP->_U104._S107._U105._C435.chan900oLocal_4286=FP->Chain->chan900o_4044;
	FP->_U104._S107._U105._C435.NCR_4287= (INT*)FP->Chain->Chain->Chain->Chain->NCR_CannotCreateFile_1174;
	FP->_U104._S107._U105._C435.IOfFile_4288=FP->IOfFile_4349;
	FP->_U104._S107._U105._C435.Chain = FP->Chain;
	CALL(P_Report_FileError_4290,&FP->_U104._S107._U105._C435,17,"P_Report_FileError_4290");
      CASE(17):  
	GOTO(15);
      CASE(16):  
	if (!true) GOTO(18);
	CHK(30==30,MSG_ASM);
	ASSIGN(((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(RNGCHK(FP->fileHandle_4353,20)*(30*sizeof(INT))))),((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))),(30*sizeof(INT)));
	GOTO(15);
      CASE(18):  
	SETERR(MSG_IF);
      CASE(15):  
	GOTO(8);
      CASE(14):  
	SETERR(MSG_IF);
      CASE(8):  
	if (!(FP->status_4351 == 0)) GOTO(20);
	FP->_U104._S108.noOfInt32OfData_4357 = (FP->noOfInt32OfFCBAndData_4352 - 30);
	*((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(28*sizeof(INT))+(RNGCHK(FP->fileHandle_4353,20)*(30*sizeof(INT))))) = (FP->_U104._S108.noOfInt32OfData_4357 * 4);
	// --- C embedded in occam, begin ---
	// ---
	// Find address of FP->Chain->buffer_4322[30]:
	FP->_U104._S108.address_4358 = (INT)&FP->Chain->buffer_4322[30];
	// ---
	// --- C embedded in occam, end ---
	FP->_U104._S108._C438.IndexOfFile_4291=FP->IOfFile_4349;
	FP->_U104._S108._C438.UserOfFile_4292=FP->UserOfFile_4350;
	FP->_U104._S108._C438.AddressOfData_4293=FP->_U104._S108.address_4358;
	FP->_U104._S108._C438.NoOfInt32OfData_4294=FP->_U104._S108.noOfInt32OfData_4357;
	FP->_U104._S108._C438.dataInFileApproved_4295=&FP->_U104._S108.dataInFileApproved_4359;
	FP->_U104._S108._C438.Chain = FP->Chain;
	CALL(P_Send_PFileHereIsFileAddrAckNack_4302,&FP->_U104._S108._C438,21,"P_Send_PFileHereIsFileAddrAckNack_4302");
      CASE(21):  
	if ((FP->_U104._S108.dataInFileApproved_4359 == false))
	{
	  {
	    *((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(2*sizeof(INT))+(RNGCHK(FP->fileHandle_4353,20)*(30*sizeof(INT))))) = 0;
	    *((BOOL*)(((BYTE*)FP->Chain->fileDataApproved_byServer_4331)+(RNGCHK(FP->IOfFile_4349,13)*sizeof(BOOL)))) = false;
	  }
	}
	else
	if (true)
	{
	  *((BOOL*)(((BYTE*)FP->Chain->fileDataApproved_byServer_4331)+(RNGCHK(FP->IOfFile_4349,13)*sizeof(BOOL)))) = true;
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(19);
      CASE(20):  
	if (!true) GOTO(22);
	FP->_U104._S109._C437.IndexOfFile_4291=FP->IOfFile_4349;
	FP->_U104._S109._C437.UserOfFile_4292=FP->UserOfFile_4350;
	FP->_U104._S109._C437.AddressOfData_4293=0;
	FP->_U104._S109._C437.NoOfInt32OfData_4294=0;
	FP->_U104._S109._C437.dataInFileApproved_4295=&FP->_U104._S109.dataInFileApproved_4360;
	FP->_U104._S109._C437.Chain = FP->Chain;
	CALL(P_Send_PFileHereIsFileAddrAckNack_4302,&FP->_U104._S109._C437,23,"P_Send_PFileHereIsFileAddrAckNack_4302");
      CASE(23):  
	*((BOOL*)(((BYTE*)FP->Chain->fileDataApproved_byServer_4331)+(RNGCHK(FP->IOfFile_4349,13)*sizeof(BOOL)))) = false;
	GOTO(19);
      CASE(22):  
	SETERR(MSG_IF);
      CASE(19):  
	GOTO(5);
      CASE(6):  
	if (!true) GOTO(24);
	{
	  // This user does NOT want this file
	}
	GOTO(5);
      CASE(24):  
	SETERR(MSG_IF);
      CASE(5):  
	FP->i_4348++;
      CASE(3):  
	if (FP->i_4348 != (0+5)) GOTO(4);
	if ((FP->noOfFilesForClient_4347 == 0))
	{
	  {
	    // The "Clients" parameter includes a user that does not
	    // have any file defined in ReadAtInitFlash6Files
	    SETERR(MSG_STOP);
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->x_4346++;
      CASE(1):  
	if (FP->x_4346 != FP->x_4346_End) GOTO(2);
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_FindFile_512K_CodeAnywhere_4373 (tSF_P_FindFile_512K_CodeAnywhere_4373 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	BREAKPOINT_F(17); // Find "flashx:\prg_0512.bin"
	P_FindFCBOf_512K_CodeAnywhere_4319(FP->Chain,FP->IOfFile_4364,FP->SearchFrom_4365,FP->fcbFound_4367,(INT*)FP->fcb_4368);
	if (!( ! *FP->fcbFound_4367)) GOTO(2);
	FP->_U106._C443.chan900oLocal_4286=FP->Chain->chan900o_4044;
	FP->_U106._C443.NCR_4287= (INT*)FP->Chain->Chain->Chain->Chain->NCR_CannotFindFile_1170;
	FP->_U106._C443.IOfFile_4288=FP->IOfFile_4364;
	FP->_U106._C443.Chain = FP->Chain;
	CALL(P_Report_FileError_4290,&FP->_U106._C443,3,"P_Report_FileError_4290");
      CASE(3):  
	GOTO(1);
      CASE(2):  
	if (!*FP->fcbFound_4367) GOTO(4);
	if (!(FP->VerifyChecksum_I_4366 == false)) GOTO(6);
	GOTO(5);
      CASE(6):  
	if (!(FP->IOfFile_4364 == 11)) GOTO(7);
	FP->_U106._S110.checksumError_4369 = 0;
	P_I01_CodeCksumTst_1949(false,&FP->_U106._S110.checksumError_4369);
	if (!(FP->_U106._S110.checksumError_4369 == 0)) GOTO(9);
	GOTO(8);
      CASE(9):  
	if (!(FP->_U106._S110.checksumError_4369 == 1)) GOTO(10);
	BREAKPOINT_F(17); // "flashx:\prg_0512.bin" checksum error!
	FP->_U106._S110._U107._C441.chan900oLocal_4286=FP->Chain->chan900o_4044;
	FP->_U106._S110._U107._C441.NCR_4287= (INT*)FP->Chain->Chain->Chain->Chain->NCR_I01CodeChecksumError_1120;
	FP->_U106._S110._U107._C441.IOfFile_4288=-1;
	FP->_U106._S110._U107._C441.Chain = FP->Chain;
	CALL(P_Report_FileError_4290,&FP->_U106._S110._U107._C441,11,"P_Report_FileError_4290");
      CASE(11):  
	*FP->fcbFound_4367 = false;
	GOTO(8);
      CASE(10):  
	SETERR(MSG_IF);
      CASE(8):  
	GOTO(5);
      CASE(7):  
	if (!(FP->IOfFile_4364 == 12)) GOTO(12);
	GOTO(5);
      CASE(12):  
	SETERR(MSG_IF);
      CASE(5):  
	if (( ! *FP->fcbFound_4367))
	{
	}
	else
	if (true)
	{
	  {
	    INT fileHandle_4370;
	    INT fileNameSize_4371;
	    {
	      fileNameSize_4371 = 20; 
	      {
		INT FileName_4372_Dim0;
		BYTE *FileName_4372;
		FileName_4372 = (BYTE*)((INT*)(((BYTE*)FP->fcb_4368)+((RNGCHKUB(3,fileNameSize_4371,30),3)*sizeof(INT))));
		FileName_4372_Dim0 = (((fileNameSize_4371*sizeof(INT)))/(sizeof(BYTE))) ;
		CHK((FileName_4372_Dim0*sizeof(BYTE)) == (fileNameSize_4371*sizeof(INT)),MSG_ARM);
		P_InsertFileNameInAnFCBBank_If_4272(FP->Chain,FileName_4372_Dim0,(BYTE*)FileName_4372,20,30,(INT*)FP->Chain->fCBBank_4320,&fileHandle_4370);
	      }
	      if ((fileHandle_4370 == -1))
	      {
		SETERR(MSG_STOP);
	      }
	      else
	      if (true)
	      {
		ASSIGN(((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(RNGCHK(fileHandle_4370,20)*(30*sizeof(INT))))),FP->fcb_4368,(30*sizeof(INT)));
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(1);
      CASE(4):  
	SETERR(MSG_IF);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_VerifyFilesStatus_reportIfAllOk_4375 (tSF_P_VerifyFilesStatus_reportIfAllOk_4375 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->i_4374 = 0;
	GOTO(2);
      CASE(3):  
	if (!(*((BOOL*)(((BYTE*)FP->Chain->fileDataApproved_byServer_4331)+(FP->i_4374*sizeof(BOOL)))) == false)) GOTO(4);
	GOTO(1);
      CASE(4):  
	FP->i_4374++;
      CASE(2):  
	if (FP->i_4374 != (0+13)) GOTO(3);
	if (!true) GOTO(5);
	OUTPUT(FP->Chain->chan900o_4044,FP->Chain->Chain->Chain->Chain->NCR_AllOK_Files_1142,(3*sizeof(INT)),6);
      CASE(6):  
	GOTO(1);
      CASE(5):  
	SETERR(MSG_IF);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_P_RdDeviceTypesReNack_4436 (tSF_P_P_RdDeviceTypesReNack_4436 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->album_4425 = (INT*)((INT*)(((BYTE*)FP->Chain->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
	CHK(289 == 289,MSG_AIM);
	BREAKPOINT_F(17); // PAlbRdDeviceTypesReNack
	{
	  INT iOfNextCharInList_4426;
	  BOOL ok_4427;
	  {
	    P_MakeCommaSeparatedListOf_785(4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,108,(INT*)((INT*)(((BYTE*)FP->album_4425)+((4)*sizeof(INT)))),&iOfNextCharInList_4426,&ok_4427);
	    *((INT*)(((BYTE*)FP->album_4425)+(3*sizeof(INT)))) = iOfNextCharInList_4426;
	  }
	}
	*((INT*)(((BYTE*)FP->album_4425)+(112*sizeof(INT)))) = 120;
	FP->_U108._S111._U109._C471.CommandSequence_4150_Dim0=3;
	FP->_U108._S111._U109._C471.CommandSequence_4150= (INT*)FP->Chain->ReadSectorDataP1Seq_4071;
	FP->_U108._S111._U109._C471.buffer_4151_Dim0=1388;
	FP->_U108._S111._U109._C471.buffer_4151= (INT*)FP->Chain->buffer_4322;
	FP->_U108._S111._U109._C471.AddressType_4152=0;
	FP->_U108._S111._U109._C471.Address_4153=-1;
	FP->_U108._S111._U109._C471.status_4154=&FP->Chain->_U123._S136.status_4424;
	FP->_U108._S111._U109._C471.Chain = FP->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U108._S111._U109._C471,1,"P_FlashCommandInterpreter_4174");
      CASE(1):  
	FP->_U108._S111._U109._C472.noOfSectors_4146=&FP->_U108._S111.noOfSectors_4430;
	FP->_U108._S111._U109._C472.address_4147_Dim0=8;
	FP->_U108._S111._U109._C472.address_4147= (INT*)FP->_U108._S111.address_4428;
	FP->_U108._S111._U109._C472.sizeInt32_4148_Dim0=8;
	FP->_U108._S111._U109._C472.sizeInt32_4148= (INT*)FP->_U108._S111.sizeInt32_4429;
	FP->_U108._S111._U109._C472.Chain = FP->Chain;
	CALL(P_GetAddressAndSizeOfSectors_4149,&FP->_U108._S111._U109._C472,2,"P_GetAddressAndSizeOfSectors_4149");
      CASE(2):  
	FP->_U108._S111._U109._C473.CommandSequence_4150_Dim0=2;
	FP->_U108._S111._U109._C473.CommandSequence_4150= (INT*)FP->Chain->ReadSectorDataP3Seq_4073;
	FP->_U108._S111._U109._C473.buffer_4151_Dim0=1388;
	FP->_U108._S111._U109._C473.buffer_4151= (INT*)FP->Chain->buffer_4322;
	FP->_U108._S111._U109._C473.AddressType_4152=0;
	FP->_U108._S111._U109._C473.Address_4153=-1;
	FP->_U108._S111._U109._C473.status_4154=&FP->Chain->_U123._S136.status_4424;
	FP->_U108._S111._U109._C473.Chain = FP->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U108._S111._U109._C473,3,"P_FlashCommandInterpreter_4174");
      CASE(3):  
	*((INT*)(((BYTE*)FP->album_4425)+(113*sizeof(INT)))) = 4;
	*((INT*)(((BYTE*)FP->album_4425)+(126*sizeof(INT)))) = 4;
	{
	  INT ByteAddress_4432[4];
	  INT NoOfBytes_4434[4];
	  ByteAddress_4432[0] = -1;
	  ByteAddress_4432[1] = -1;
	  ByteAddress_4432[2] = (*((INT*)(((BYTE*)FP->_U108._S111.address_4428)+(6*sizeof(INT)))) * 4);
	  ByteAddress_4432[3] = (*((INT*)(((BYTE*)FP->_U108._S111.address_4428)+(0*sizeof(INT)))) * 4);
	  NoOfBytes_4434[0] = 5432;
	  NoOfBytes_4434[1] = -1;
	  NoOfBytes_4434[2] = (*((INT*)(((BYTE*)FP->_U108._S111.sizeInt32_4429)+(6*sizeof(INT)))) * 4);
	  NoOfBytes_4434[3] = (*((INT*)(((BYTE*)FP->_U108._S111.sizeInt32_4429)+(0*sizeof(INT)))) * 4);
	  {
	    if (false)
	    {
	      SETERR(MSG_STOP);
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	    {
	      INT i_4435;
	      for (i_4435 = 0; i_4435 != 0 + 4; i_4435++)
	      {
		{
		  *((INT*)(((BYTE*)FP->album_4425)+((114 + i_4435)*sizeof(INT)))) = *((INT*)(((BYTE*)ByteAddress_4432)+(i_4435*sizeof(INT))));
		  *((INT*)(((BYTE*)FP->album_4425)+((127 + i_4435)*sizeof(INT)))) = *((INT*)(((BYTE*)NoOfBytes_4434)+(i_4435*sizeof(INT))));
		}
	      }
	    }
	  }
	}
	if ((FP->Chain->_U123._S136.status_4424 == 0))
	{
	  {
	    FP->Chain->_U123._S136.send_4417 = 3;
	    *((INT*)(((BYTE*)FP->album_4425)+(0*sizeof(INT)))) = 161;
	    FP->Chain->_U123._S136.noOfInt32OfTheProtocol_4416 = 139;
	  }
	}
	else
	if ((FP->Chain->_U123._S136.status_4424 != 0))
	{
	  {
	    FP->Chain->_U123._S136.status_4424 = 4096;
	    FP->Chain->_U123._S136.send_4417 = 2;
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_P_RdFileFCBReNack_4446 (tSF_P_FileServer_4586 *PP)
{
  tSF_P_P_RdFileFCBReNack_4446 SF;
  tSF_P_P_RdFileFCBReNack_4446 *FP = &SF;
  FP->Chain = PP;
  {
    INT *album_4437;
    album_4437 = (INT*)((INT*)(((BYTE*)FP->Chain->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
    CHK(289 == 289,MSG_AIM);
    {
      BREAKPOINT_F(17); // PAlbRdFileFCBReNack
      {
	INT fileHandleInFCBBank_4438;
	INT fileHandleInBuffer_flash6_4439;
	INT fileNameHandle_4440;
	INT deviceNameHandle_4441;
	BOOL is_flash6x_4442;
	BOOL is_Boot1_4443;
	{
	  {
	    INT FileName_4444_Dim0;
	    BYTE *FileName_4444;
	    FileName_4444 = (BYTE*)((INT*)(((BYTE*)album_4437)+((RNGCHKUB(4,*((INT*)(((BYTE*)album_4437)+(3*sizeof(INT)))),289),4)*sizeof(INT))));
	    FileName_4444_Dim0 = (((*((INT*)(((BYTE*)album_4437)+(3*sizeof(INT))))*sizeof(INT)))/(sizeof(BYTE))) ;
	    CHK((FileName_4444_Dim0*sizeof(BYTE)) == (*((INT*)(((BYTE*)album_4437)+(3*sizeof(INT))))*sizeof(INT)),MSG_ARM);
	    {
	      fileHandleInFCBBank_4438 = F_FindFileInAnFCBBank_4237(FP->Chain,FileName_4444_Dim0,(BYTE*)FileName_4444,20,30,(INT*)FP->Chain->fCBBank_4320);
	      fileHandleInBuffer_flash6_4439 = F_FindExtFileInAnFCBBank_4246(FP->Chain,FileName_4444_Dim0,(BYTE*)FileName_4444,true,(INT*)((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))));
	      fileNameHandle_4440 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,FileName_4444_Dim0,(BYTE*)FileName_4444,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	      {
		BYTE *_V54_4445;
		{
		  static BYTE TMP[2] = {58,92};
		  _V54_4445 = TMP;
		}
		deviceNameHandle_4441 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,FileName_4444_Dim0,(BYTE*)FileName_4444,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V54_4445,1,8,1);
	      }
	    }
	  }
	  is_Boot1_4443 = ((fileHandleInFCBBank_4438 != -1) && (fileNameHandle_4440 == 12)); 
	  is_flash6x_4442 = ((fileHandleInFCBBank_4438 != -1) && ((deviceNameHandle_4441 == 2) || (deviceNameHandle_4441 == 3))); 
	  if (((fileHandleInFCBBank_4438 == -1) && (fileHandleInBuffer_flash6_4439 == -1)))
	  {
	    {
	      // No file in fCBBank or buffer's FCB
	      FP->Chain->_U123._S136.status_4424 = 8192;
	    }
	  }
	  else
	  if ((deviceNameHandle_4441 == -1))
	  {
	    {
	      // Programming error (device type is part of file name, so it should have been taken above)
	      SETERR(MSG_STOP);
	    }
	  }
	  else
	  if (((deviceNameHandle_4441 == 1) && ( ! is_Boot1_4443)))
	  {
	    {
	      // No read FCB from this device type
	      FP->Chain->_U123._S136.status_4424 = 8193;
	    }
	  }
	  else
	  if (((deviceNameHandle_4441 == 0) && (fileHandleInBuffer_flash6_4439 != -1)))
	  {
	    if ((FP->Chain->_U123._S136.protCmd_4423 == 164))
	    {
	      {
		CHK(6==6,MSG_ASM);
		ASSIGN(((INT*)(((BYTE*)album_4437)+((24)*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->buffer_4322)+((23)*sizeof(INT)))),(6*sizeof(INT)));
		FP->Chain->_U123._S136.send_4417 = 3;
		*((INT*)(((BYTE*)album_4437)+(0*sizeof(INT)))) = 165; 
		FP->Chain->_U123._S136.noOfInt32OfTheProtocol_4416 = 30;
	      }
	    }
	    else
	    if ((FP->Chain->_U123._S136.protCmd_4423 == 166))
	    {
	      {
		CHK(6==6,MSG_ASM);
		ASSIGN(((INT*)(((BYTE*)FP->Chain->buffer_4322)+((23)*sizeof(INT)))),((INT*)(((BYTE*)album_4437)+((24)*sizeof(INT)))),(6*sizeof(INT)));
		FP->Chain->_U123._S136.send_4417 = 1;
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	  else
	  if ((is_flash6x_4442 || is_Boot1_4443))
	  {
	    {
	      CHK(6==6,MSG_ASM);
	      ASSIGN(((INT*)(((BYTE*)album_4437)+((24)*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+((23)*sizeof(INT))+(RNGCHK(fileHandleInFCBBank_4438,20)*(30*sizeof(INT))))),(6*sizeof(INT)));
	      FP->Chain->_U123._S136.send_4417 = 3;
	      *((INT*)(((BYTE*)album_4437)+(0*sizeof(INT)))) = 165; 
	      FP->Chain->_U123._S136.noOfInt32OfTheProtocol_4416 = 30;
	    }
	  }
	  else
	  if (true)
	  {
	    {
	      // File name not known
	      FP->Chain->_U123._S136.status_4424 = 8194;
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
      }
      if ((FP->Chain->_U123._S136.status_4424 == 0))
      {
      }
      else
      if ((FP->Chain->_U123._S136.status_4424 != 0))
      {
	{
	  // Error: send NackEnd
	  FP->Chain->_U123._S136.send_4417 = 2;
	}
      }
      else
      {
	SETERR(MSG_IF);
      }
    }
  }
}
static void P_P_RdFileDataReNack_4465 (tSF_P_P_RdFileDataReNack_4465 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->album_4448 = (INT*)((INT*)(((BYTE*)FP->Chain->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
	CHK(289 == 289,MSG_AIM);
	BREAKPOINT_F(17); // PAlbRdFileDataReNack
	FP->_U110._S112.FileName_4449 = (BYTE*)((INT*)(((BYTE*)FP->album_4448)+((RNGCHKUB(4,*((INT*)(((BYTE*)FP->album_4448)+(3*sizeof(INT)))),289),4)*sizeof(INT))));
	FP->_U110._S112.FileName_4449_Dim0 = (((*((INT*)(((BYTE*)FP->album_4448)+(3*sizeof(INT))))*sizeof(INT)))/(sizeof(BYTE))) ;
	CHK((FP->_U110._S112.FileName_4449_Dim0*sizeof(BYTE)) == (*((INT*)(((BYTE*)FP->album_4448)+(3*sizeof(INT))))*sizeof(INT)),MSG_ARM);
	FP->_U110._S112.fileHandleInFCBBank_4450 = F_FindFileInAnFCBBank_4237(FP->Chain,FP->_U110._S112.FileName_4449_Dim0,(BYTE*)FP->_U110._S112.FileName_4449,20,30,(INT*)FP->Chain->fCBBank_4320);
	FP->_U110._S112.fileHandleInBuffer_4451 = F_FindExtFileInAnFCBBank_4246(FP->Chain,FP->_U110._S112.FileName_4449_Dim0,(BYTE*)FP->_U110._S112.FileName_4449,false,(INT*)((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))));
	FP->_U110._S112.fileHandleInBuffer_flash6_4452 = F_FindExtFileInAnFCBBank_4246(FP->Chain,FP->_U110._S112.FileName_4449_Dim0,(BYTE*)FP->_U110._S112.FileName_4449,true,(INT*)((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))));
	FP->_U110._S112.fileNameHandle_4453 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,FP->_U110._S112.FileName_4449_Dim0,(BYTE*)FP->_U110._S112.FileName_4449,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	{
	  BYTE *_V55_4456;
	  {
	    static BYTE TMP[2] = {58,92};
	    _V55_4456 = TMP;
	  }
	  FP->_U110._S112.deviceNameHandle_4454 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,FP->_U110._S112.FileName_4449_Dim0,(BYTE*)FP->_U110._S112.FileName_4449,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V55_4456,1,8,1);
	}
	FP->_U110._S112.hatFile_4455 = ( ! F_IsNotIn_1493(FP->Chain->Chain->Chain->Chain,5,(INT*)FP->Chain->Chain->Chain->Chain->IOfHatFile_1303,FP->_U110._S112.fileNameHandle_4453));
	if (!((FP->_U110._S112.fileHandleInFCBBank_4450 == -1) && (FP->_U110._S112.fileHandleInBuffer_flash6_4452 == -1))) GOTO(2);
	{
	  // No file in fCBBank or buffer's FCB
	  FP->Chain->_U123._S136.status_4424 = 12288;
	}
	GOTO(1);
      CASE(2):  
	if (!(FP->_U110._S112.fileNameHandle_4453 == -1)) GOTO(3);
	{
	  // File name not known
	  FP->Chain->_U123._S136.status_4424 = 12289;
	}
	GOTO(1);
      CASE(3):  
	if (!(FP->_U110._S112.deviceNameHandle_4454 == -1)) GOTO(4);
	{
	  // Programming error (device type is part of file name, so it should have been taken above)
	  SETERR(MSG_STOP);
	}
	GOTO(1);
      CASE(4):  
	if (!true) GOTO(5);
	// File and device type is known, good
	if (!(FP->_U110._S112.deviceNameHandle_4454 == 0)) GOTO(7);
	if ((FP->_U110._S112.fileHandleInBuffer_flash6_4452 == -1))
	{
	  if (false)
	  {
	    {
	      // For test vectors, fill buffer
	      P_FillFCBAndKnownInto_I_Buffer_dat_4344(FP->Chain);
	      P_ResetRdSegmenting_Left_Sent_4336(FP->Chain,F_GetNoOfElem_4127(FP->Chain,30,(INT*)((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(RNGCHK(FP->_U110._S112.fileHandleInFCBBank_4450,20)*(30*sizeof(INT)))))),0);
	    }
	  }
	  else
	  if (true)
	  {
	    {
	      // Sorry, this file isn't in buffer!
	      FP->Chain->_U123._S136.status_4424 = 12290;
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	else
	if ((FP->_U110._S112.fileNameHandle_4453 == 0))
	{
	  if ((FP->Chain->noOfElemOfRdFileSent_4326 == 0))
	  {
	    {
	      // Starting with I_Buffer.dat
	      P_ResetRdSegmenting_Left_Sent_4336(FP->Chain,F_GetNoOfElem_4127(FP->Chain,30,(INT*)((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(RNGCHK(FP->_U110._S112.fileHandleInFCBBank_4450,20)*(30*sizeof(INT)))))),0);
	    }
	  }
	  else
	  if (true)
	  {
	    {
	      // Segmenting in I_Buffer.dat
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	else
	if (true)
	{
	  {
	    // Only "fserv" file is "I_Buffer.dat " - we shouldn't have found any other!
	    SETERR(MSG_STOP);
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(6);
      CASE(7):  
	if (!(FP->_U110._S112.deviceNameHandle_4454 == 1)) GOTO(8);
	{
	  // No read from this device type
	  FP->Chain->_U123._S136.status_4424 = 12291;
	}
	GOTO(6);
      CASE(8):  
	if (!((FP->_U110._S112.deviceNameHandle_4454 == 3) && ( ! FP->_U110._S112.hatFile_4455))) GOTO(9);
	{
	  // No read from this device type
	  FP->Chain->_U123._S136.status_4424 = 12291;
	}
	GOTO(6);
      CASE(9):  
	if (!((FP->_U110._S112.deviceNameHandle_4454 == 2) || FP->_U110._S112.hatFile_4455)) GOTO(10);
	if (!(FP->Chain->noOfElemOfRdFileLeft_4325 < 0)) GOTO(12);
	{
	  // Programming error
	  SETERR(MSG_STOP);
	}
	GOTO(11);
      CASE(12):  
	if (!(FP->Chain->noOfElemOfRdFileSent_4326 == 0)) GOTO(13);
	// First time, read file from flash
	if (!FP->_U110._S112.hatFile_4455) GOTO(15);
	P_ReadHatFileFromFlash_4210(FP->Chain,FP->_U110._S112.FileName_4449_Dim0,(BYTE*)FP->_U110._S112.FileName_4449,FP->BufferAdr_4447,1388,&FP->_U110._S112._U111._S113.noOfInt32OfFCBAndData_4457,&FP->Chain->_U123._S136.status_4424);
	GOTO(14);
      CASE(15):  
	if (!true) GOTO(16);
	FP->_U110._S112._U111._S113._U112._C474.RequestedNameOfFile_4181_Dim0=FP->_U110._S112.FileName_4449_Dim0;
	FP->_U110._S112._U111._S113._U112._C474.RequestedNameOfFile_4181= (BYTE*)FP->_U110._S112.FileName_4449;
	FP->_U110._S112._U111._S113._U112._C474.buffer_4182_Dim0=1388;
	FP->_U110._S112._U111._S113._U112._C474.buffer_4182= (INT*)FP->Chain->buffer_4322;
	FP->_U110._S112._U111._S113._U112._C474.noOfInt32OfFCBAndData_4183=&FP->_U110._S112._U111._S113.noOfInt32OfFCBAndData_4457;
	FP->_U110._S112._U111._S113._U112._C474.status_4184=&FP->Chain->_U123._S136.status_4424;
	FP->_U110._S112._U111._S113._U112._C474.Chain = FP->Chain;
	CALL(P_ReadFileFromFlash_4201,&FP->_U110._S112._U111._S113._U112._C474,17,"P_ReadFileFromFlash_4201");
      CASE(17):  
	GOTO(14);
      CASE(16):  
	SETERR(MSG_IF);
      CASE(14):  
	if ((FP->Chain->_U123._S136.status_4424 != 0))
	{
	  {
	    {
	      INT i_4458;
	      for (i_4458 = 0; i_4458 != 0 + 30; i_4458++)
	      {
		*((INT*)(((BYTE*)FP->Chain->buffer_4322)+(i_4458*sizeof(INT)))) = 0;
	      }
	    }
	    FP->Chain->_U123._S136.status_4424 = 12292;
	  }
	}
	else
	if ((FP->Chain->_U123._S136.status_4424 == 0))
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	P_ResetRdSegmenting_Left_Sent_4336(FP->Chain,(FP->_U110._S112._U111._S113.noOfInt32OfFCBAndData_4457 - 30),0);
	GOTO(11);
      CASE(13):  
	if (!((FP->_U110._S112.fileHandleInBuffer_flash6_4452 == -1) && ( ! FP->_U110._S112.hatFile_4455))) GOTO(18);
	{
	  // -- Sorry, this file isn't in buffer!
	  FP->Chain->_U123._S136.status_4424 = 12293;
	}
	GOTO(11);
      CASE(18):  
	if (!((FP->_U110._S112.fileHandleInBuffer_4451 == -1) && FP->_U110._S112.hatFile_4455)) GOTO(19);
	{
	  // -- Sorry, this file isn't in buffer!
	  FP->Chain->_U123._S136.status_4424 = 12293;
	}
	GOTO(11);
      CASE(19):  
	if (!true) GOTO(20);
	{
	  // File is already in buffer
	}
	GOTO(11);
      CASE(20):  
	SETERR(MSG_IF);
      CASE(11):  
	GOTO(6);
      CASE(10):  
	SETERR(MSG_IF);
      CASE(6):  
	GOTO(1);
      CASE(5):  
	SETERR(MSG_IF);
      CASE(1):  
	if ((FP->Chain->_U123._S136.status_4424 == 0))
	{
	  {
	    INT noOfElemOfThisSegment_4459;
	    {
	      {
		INT fcb_4460[6];
		INT *FCBEmpty_4462;
		{
		  static INT TMP[6] = {0,0,0,0,0,0};
		  FCBEmpty_4462 = (INT*)TMP;
		}
		{
		  // Fill data
		  if ((FP->Chain->noOfElemOfRdFileLeft_4325 > 256))
		  {
		    {
		      noOfElemOfThisSegment_4459 = 256; 
		      ASSIGN(fcb_4460,FCBEmpty_4462,(6*sizeof(INT))); 
		    }
		  }
		  else
		  if ((FP->Chain->noOfElemOfRdFileLeft_4325 <= 256))
		  {
		    {
		      noOfElemOfThisSegment_4459 = FP->Chain->noOfElemOfRdFileLeft_4325;
		      CHK(6==6,MSG_ASM);
		      ASSIGN(fcb_4460,((INT*)(((BYTE*)FP->Chain->buffer_4322)+((23)*sizeof(INT)))),(6*sizeof(INT)));
		    }
		  }
		  else
		  {
		    SETERR(MSG_IF);
		  }
		  FP->Chain->noOfElemOfRdFileLeft_4325 = (FP->Chain->noOfElemOfRdFileLeft_4325 - noOfElemOfThisSegment_4459);
		  ASSIGN(((INT*)(((BYTE*)FP->album_4448)+((24)*sizeof(INT)))),fcb_4460,(6*sizeof(INT)));
		  *((INT*)(((BYTE*)FP->album_4448)+(30*sizeof(INT)))) = (FP->Chain->noOfElemOfRdFileSent_4326 * 4);
		  *((INT*)(((BYTE*)FP->album_4448)+(31*sizeof(INT)))) = (FP->Chain->noOfElemOfRdFileLeft_4325 * 4);
		  *((INT*)(((BYTE*)FP->album_4448)+(32*sizeof(INT)))) = (noOfElemOfThisSegment_4459 * 4);
		  {
		    INT from_4463_Dim_437918235;/*SMW*/
		    INT *from_4463;
		    INT to_4464_Dim_437918235;/*SMW*/
		    INT *to_4464;
		    from_4463 = (INT*)((INT*)(((BYTE*)FP->Chain->buffer_4322)+((RNGCHKUB(FP->Chain->next_iOfRdFile_4324,noOfElemOfThisSegment_4459,1388),RNGCHKLB(FP->Chain->next_iOfRdFile_4324))*sizeof(INT))));
		    from_4463_Dim_437918235 = noOfElemOfThisSegment_4459;
		    to_4464 = (INT*)((INT*)(((BYTE*)FP->album_4448)+((RNGCHKUB(33,noOfElemOfThisSegment_4459,289),33)*sizeof(INT))));
		    to_4464_Dim_437918235 = noOfElemOfThisSegment_4459;
		    CHK(to_4464_Dim_437918235==from_4463_Dim_437918235,MSG_ASM);
		    ASSIGN(to_4464,from_4463,(to_4464_Dim_437918235*sizeof(INT))); 
		  }
		}
	      }
	      if ((FP->Chain->noOfElemOfRdFileLeft_4325 == 0))
	      {
		P_ResetRdSegmenting_Left_Sent_4336(FP->Chain,0,0);
	      }
	      else
	      if (true)
	      {
		{
		  FP->Chain->next_iOfRdFile_4324 = (FP->Chain->next_iOfRdFile_4324 + noOfElemOfThisSegment_4459);
		  FP->Chain->noOfElemOfRdFileSent_4326 = (FP->Chain->noOfElemOfRdFileSent_4326 + noOfElemOfThisSegment_4459);
		}
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	      FP->Chain->_U123._S136.send_4417 = 3;
	      *((INT*)(((BYTE*)FP->album_4448)+(0*sizeof(INT)))) = 168;
	      FP->Chain->_U123._S136.noOfInt32OfTheProtocol_4416 = 289;
	    }
	  }
	}
	else
	if ((FP->Chain->_U123._S136.status_4424 != 0))
	{
	  {
	    // Error: send NackEnd
	    FP->Chain->_U123._S136.send_4417 = 2;
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static BOOL F_CannotAccept_flashx_4477(tSF_P_P_WrFileDataAckNack_4514 *PP)
{
  BOOL _Result;
  tSF_F_CannotAccept_flashx_4477 SF;
  tSF_F_CannotAccept_flashx_4477 *FP = &SF;
  FP->Chain = PP;
  {
    BOOL cannotAccept_4475;
    if (FP->Chain->_U117._S120.hatFile_4474)
    {
      {
	// Cannot program hat-files
	cannotAccept_4475 = true; 
      }
    }
    else
    if ((FP->Chain->Chain->codeIsRunningInRam_4330 == false))
    {
      {
	// Cannot program itself, code must run in RAM
	cannotAccept_4475 = true; 
      }
    }
    else
    if (true)
    {
      {
	// Requires large buffer
	cannotAccept_4475 = true; 
      }
    }
    else
    if ((FP->Chain->_U117._S120.fileNameHandle_4471 != 11))
    {
      {
	// We require "flashx:\prg_0512.bin" file name
	cannotAccept_4475 = true; 
      }
    }
    else
    if (true)
    {
      cannotAccept_4475 = false; 
    }
    else
    {
      SETERR(MSG_IF);
    }
    _Result = cannotAccept_4475;
  }
  return _Result;
}
static void P_FillBufferAndProgramFile_4506 (tSF_P_FillBufferAndProgramFile_4506 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->program_flashx_now_4485 = false;
	if ((FP->Chain->_U117._S120.nowLoading_flashx_4473 == false))
	{
	  {
	    // Standard: fill buffer with segments of a file (that cannot be larger than buffer)
	    CHK(FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484==FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484,MSG_ASM);
	    ASSIGN(((INT*)(((BYTE*)FP->Chain->Chain->buffer_4322)+((RNGCHKUB(FP->Chain->Chain->next_iOfWrFile_4323,FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484,1388),RNGCHKLB(FP->Chain->Chain->next_iOfWrFile_4323))*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->album_4466)+((RNGCHKUB(33,FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484,289),33)*sizeof(INT)))),(FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484*sizeof(INT)));
	    FP->Chain->Chain->next_iOfWrFile_4323 = (FP->Chain->Chain->next_iOfWrFile_4323 + FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484);
	  }
	}
	else
	if ((FP->Chain->_U117._S120.nowLoading_flashx_4473 == true))
	{
	  {
	    {
	      INT iOf_flashx_buffer_first_4489;
	      INT flashx_buffer_FOR_4490;
	      INT offsetInFile_linear_now_4491;
	      {
		// flashx: Fill buffer with file segment, but do it "modulo-buffer" wise
		offsetInFile_linear_now_4491 = (FP->Chain->Chain->next_iOfWrFile_4323 - 30);
		FP->nume_flashx_buffer_now_4486 = (offsetInFile_linear_now_4491 % 1358);
		FP->iOf_flashx_4487 = (offsetInFile_linear_now_4491 / 1358);
		iOf_flashx_buffer_first_4489 = (30 + FP->nume_flashx_buffer_now_4486);
		flashx_buffer_FOR_4490 = FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484;
		if (((iOf_flashx_buffer_first_4489 + FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484) > 1388))
		{
		  {
		    // Overflow of this flash sector!
		    FP->Chain->Chain->_U123._S136.status_4424 = 16384;
		  }
		}
		else
		if (true)
		{
		  {
		    if ((FP->Chain->_U117._S120.NoOfElemLeft_4483 == 0))
		    {
		      {
			flashx_buffer_FOR_4490 = (flashx_buffer_FOR_4490 - 1); 
			*((INT*)(((BYTE*)FP->checksum_4488)+(0*sizeof(INT)))) = *((INT*)(((BYTE*)FP->Chain->album_4466)+(RNGCHK((33 + flashx_buffer_FOR_4490),289)*sizeof(INT))));
		      }
		    }
		    else
		    if (true)
		    {
		    }
		    else
		    {
		      SETERR(MSG_IF);
		    }
		    CHK(flashx_buffer_FOR_4490==flashx_buffer_FOR_4490,MSG_ASM);
		    ASSIGN(((INT*)(((BYTE*)FP->Chain->Chain->buffer_4322)+((RNGCHKUB(iOf_flashx_buffer_first_4489,flashx_buffer_FOR_4490,1388),RNGCHKLB(iOf_flashx_buffer_first_4489))*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->album_4466)+((RNGCHKUB(33,flashx_buffer_FOR_4490,289),33)*sizeof(INT)))),(flashx_buffer_FOR_4490*sizeof(INT)));
		    FP->Chain->Chain->next_iOfWrFile_4323 = (FP->Chain->Chain->next_iOfWrFile_4323 + FP->Chain->_U117._S120.NoOfElemOfThisSegment_4484);
		    FP->nume_flashx_buffer_now_4486 = (FP->nume_flashx_buffer_now_4486 + flashx_buffer_FOR_4490);
		  }
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	    {
	      INT offsetInFile_linear_next_4492;
	      INT offsetInFile_wrapAround_next_4493;
	      {
		// flashx: Find out if we shall program flash sector now
		offsetInFile_linear_next_4492 = (FP->Chain->Chain->next_iOfWrFile_4323 - 30);
		offsetInFile_wrapAround_next_4493 = (offsetInFile_linear_next_4492 % 1358); 
		if ((FP->Chain->_U117._S120.NoOfElemLeft_4483 == 0))
		{
		  FP->program_flashx_now_4485 = true;
		}
		else
		if ((offsetInFile_linear_next_4492 == 0))
		{
		}
		else
		if ((offsetInFile_wrapAround_next_4493 == 0))
		{
		  FP->program_flashx_now_4485 = true;
		}
		else
		if (true)
		{
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if ((FP->Chain->Chain->_U123._S136.status_4424 != 0))
	{
	}
	else
	if ((FP->Chain->_U117._S120.NoOfElemSent_4482 == 0))
	{
	  {
	    // First segment: fill FCB into buffer (so that we can test on it afterwards)
	    if ((FP->Chain->_U117._S120.fileHandleInFCBBank_4468 == -1))
	    {
	      {
		// File name is acceptable, put it into fCBBank if it ain't there beforehand
		P_InsertFileNameInAnFCBBank_If_4272(FP->Chain->Chain,FP->Chain->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->Chain->_U117._S120.FileName_4467,20,30,(INT*)FP->Chain->Chain->fCBBank_4320,&FP->Chain->_U117._S120.fileHandleInFCBBank_4468);
		if ((FP->Chain->_U117._S120.fileHandleInFCBBank_4468 == -1))
		{
		}
		else
		if (true)
		{
		  *((INT*)(((BYTE*)FP->Chain->Chain->fCBBank_4320)+(28*sizeof(INT))+(RNGCHK(FP->Chain->_U117._S120.fileHandleInFCBBank_4468,20)*(30*sizeof(INT))))) = 5432;
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	    else
	    if (true)
	    {
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	    if ((FP->Chain->_U117._S120.fileHandleInFCBBank_4468 == -1))
	    {
	      {
		// No room in fCBBank, this is serious!
		FP->Chain->Chain->_U123._S136.status_4424 = 16385;
	      }
	    }
	    else
	    if (true)
	    {
	      {
		// First segment: fill FCB into buffer (so that we can test on it afterwards)
		ASSIGN(((INT*)(((BYTE*)FP->Chain->Chain->buffer_4322)+((0)*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->Chain->fCBBank_4320)+(RNGCHK(FP->Chain->_U117._S120.fileHandleInFCBBank_4468,20)*(30*sizeof(INT))))),(30*sizeof(INT)));
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (!(FP->Chain->Chain->_U123._S136.status_4424 != 0)) GOTO(2);
	GOTO(1);
      CASE(2):  
	if (!FP->program_flashx_now_4485) GOTO(3);
	// Last segment: make a "real" FCB and program file
	P_InsertDateEtcInAnFCBBank_4276(FP->Chain->Chain,FP->Chain->_U117._S120.fileHandleInFCBBank_4468,(INT*)((INT*)(((BYTE*)FP->Chain->album_4466)+((24)*sizeof(INT)))),20,30,(INT*)FP->Chain->Chain->fCBBank_4320);
	P_InsertNoOfDataBytesInAnFCBBank_4280(FP->Chain->Chain,FP->Chain->_U117._S120.fileHandleInFCBBank_4468,(FP->Chain->Chain->next_iOfWrFile_4323 - 30),20,30,(INT*)FP->Chain->Chain->fCBBank_4320);
	ASSIGN(((INT*)(((BYTE*)FP->Chain->Chain->buffer_4322)+((0)*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->Chain->fCBBank_4320)+(RNGCHK(FP->Chain->_U117._S120.fileHandleInFCBBank_4468,20)*(30*sizeof(INT))))),(30*sizeof(INT)));
	BREAKPOINT_F(17); // Program it in flash
	FP->_U113._S114.convertedStatus_4495 = 0;
	// Erase "this" sector
	FP->_U113._S114.phaseForErrorReporting_4494 = 256;
	FP->_U113._S114._U114._S115._C489.CommandSequence_4150_Dim0=6;
	FP->_U113._S114._U114._S115._C489.CommandSequence_4150= (INT*)FP->Chain->Chain->EraseFlashxSeq_4063;
	FP->_U113._S114._U114._S115._C489.buffer_4151_Dim0=1;
	FP->_U113._S114._U114._S115._C489.buffer_4151= (INT*)FP->_U113._S114._U114._S115.buffer_notUsed_4496;
	FP->_U113._S114._U114._S115._C489.AddressType_4152=2;
	FP->_U113._S114._U114._S115._C489.Address_4153=FP->iOf_flashx_4487;
	FP->_U113._S114._U114._S115._C489.status_4154=&FP->Chain->Chain->_U123._S136.status_4424;
	FP->_U113._S114._U114._S115._C489.Chain = FP->Chain->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U113._S114._U114._S115._C489,4,"P_FlashCommandInterpreter_4174");
      CASE(4):  
	if ((FP->Chain->Chain->_U123._S136.status_4424 != 0))
	{
	  FP->_U113._S114.convertedStatus_4495 = F_Convert_status_4084(FP->Chain->Chain,FP->Chain->Chain->_U123._S136.status_4424);
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	// Program "this" sector
	if ((FP->Chain->Chain->_U123._S136.status_4424 == 0))
	{
	  FP->_U113._S114.phaseForErrorReporting_4494 = 512;
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	// Full sector to be programmed:
	// Checksum has not been filled, so it won't be programmed either!
	FP->_U113._S114._U114._C490.CommandSequence_4150_Dim0=7;
	FP->_U113._S114._U114._C490.CommandSequence_4150= (INT*)FP->Chain->Chain->ProgramFlashxSeq_4067;
	FP->_U113._S114._U114._C490.buffer_4151_Dim0=FP->nume_flashx_buffer_now_4486;
	FP->_U113._S114._U114._C490.buffer_4151= (INT*)((INT*)(((BYTE*)FP->Chain->Chain->buffer_4322)+((RNGCHKUB(30,FP->nume_flashx_buffer_now_4486,1388),30)*sizeof(INT))));
	FP->_U113._S114._U114._C490.AddressType_4152=2;
	FP->_U113._S114._U114._C490.Address_4153=FP->iOf_flashx_4487;
	FP->_U113._S114._U114._C490.status_4154=&FP->Chain->Chain->_U123._S136.status_4424;
	FP->_U113._S114._U114._C490.Chain = FP->Chain->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U113._S114._U114._C490,5,"P_FlashCommandInterpreter_4174");
      CASE(5):  
	if ((FP->Chain->Chain->_U123._S136.status_4424 != 0))
	{
	  FP->_U113._S114.convertedStatus_4495 = F_Convert_status_4084(FP->Chain->Chain,FP->Chain->Chain->_U123._S136.status_4424);
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (!(FP->Chain->_U117._S120.NoOfElemLeft_4483 == 0)) GOTO(7);
	FP->_U113._S114._U114._S116.i_4497 = FP->iOf_flashx_4487;
	FP->_U113._S114._U114._S116.i_4497_End = FP->_U113._S114._U114._S116.i_4497 + (3 - FP->iOf_flashx_4487);
	GOTO(8);
      CASE(9):  
	FP->_U113._S114._U114._S116.IOfSector_4498 = (INT)(FP->_U113._S114._U114._S116.i_4497 + 1);
	if ((FP->Chain->Chain->_U123._S136.status_4424 == 0))
	{
	  FP->_U113._S114.phaseForErrorReporting_4494 = (512 + (FP->_U113._S114._U114._S116.IOfSector_4498 * 256));
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	// Erase sector FP->_U113._S114._U114._S116.IOfSector_4498
	FP->_U113._S114._U114._S116._C491.CommandSequence_4150_Dim0=6;
	FP->_U113._S114._U114._S116._C491.CommandSequence_4150= (INT*)FP->Chain->Chain->EraseFlashxSeq_4063;
	FP->_U113._S114._U114._S116._C491.buffer_4151_Dim0=1;
	FP->_U113._S114._U114._S116._C491.buffer_4151= (INT*)FP->_U113._S114._U114._S116.buffer_notUsed_4499;
	FP->_U113._S114._U114._S116._C491.AddressType_4152=2;
	FP->_U113._S114._U114._S116._C491.Address_4153=FP->_U113._S114._U114._S116.IOfSector_4498;
	FP->_U113._S114._U114._S116._C491.status_4154=&FP->Chain->Chain->_U123._S136.status_4424;
	FP->_U113._S114._U114._S116._C491.Chain = FP->Chain->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U113._S114._U114._S116._C491,10,"P_FlashCommandInterpreter_4174");
      CASE(10):  
	if ((FP->Chain->Chain->_U123._S136.status_4424 != 0))
	{
	  FP->_U113._S114.convertedStatus_4495 = F_Convert_status_4084(FP->Chain->Chain,FP->Chain->Chain->_U123._S136.status_4424);
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->_U113._S114._U114._S116.i_4497++;
      CASE(8):  
	if (FP->_U113._S114._U114._S116.i_4497 != FP->_U113._S114._U114._S116.i_4497_End) GOTO(9);
	if ((FP->Chain->Chain->_U123._S136.status_4424 == 0))
	{
	  FP->_U113._S114.phaseForErrorReporting_4494 = 1536;
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	// Program checksum in last address of last sector
	FP->_U113._S114._U114._C492.CommandSequence_4150_Dim0=6;
	FP->_U113._S114._U114._C492.CommandSequence_4150= (INT*)FP->Chain->Chain->PatchFlashxSeq_4069;
	FP->_U113._S114._U114._C492.buffer_4151_Dim0=1;
	FP->_U113._S114._U114._C492.buffer_4151= (INT*)FP->checksum_4488;
	FP->_U113._S114._U114._C492.AddressType_4152=3;
	FP->_U113._S114._U114._C492.Address_4153=3;
	FP->_U113._S114._U114._C492.status_4154=&FP->Chain->Chain->_U123._S136.status_4424;
	FP->_U113._S114._U114._C492.Chain = FP->Chain->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U113._S114._U114._C492,11,"P_FlashCommandInterpreter_4174");
      CASE(11):  
	if ((FP->Chain->Chain->_U123._S136.status_4424 != 0))
	{
	  FP->_U113._S114.convertedStatus_4495 = F_Convert_status_4084(FP->Chain->Chain,FP->Chain->Chain->_U123._S136.status_4424);
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->_U113._S114._U114._S117.error_4500 = 0;
	P_I01_CodeCksumTst_1949(false,&FP->_U113._S114._U114._S117.error_4500);
	if (!(FP->_U113._S114._U114._S117.error_4500 == 1)) GOTO(13);
	OUTPUT(FP->Chain->Chain->chan900o_4044,FP->Chain->Chain->Chain->Chain->Chain->NCR_CodePrgChecksumError_1122,(3*sizeof(INT)),14);
      CASE(14):  
	FP->_U113._S114.phaseForErrorReporting_4494 = 1792;
	FP->_U113._S114.convertedStatus_4495 = F_Convert_status_4084(FP->Chain->Chain,0x8000000);
	FP->Chain->Chain->_U123._S136.status_4424 = -1;
	GOTO(12);
      CASE(13):  
	if (!true) GOTO(15);
	GOTO(12);
      CASE(15):  
	SETERR(MSG_IF);
      CASE(12):  
	P_ResetWrSegmenting_4337(FP->Chain->Chain);
	GOTO(6);
      CASE(7):  
	if (!true) GOTO(16);
	GOTO(6);
      CASE(16):  
	SETERR(MSG_IF);
      CASE(6):  
	if (!(FP->Chain->Chain->_U123._S136.status_4424 != 0)) GOTO(18);
	{
	  BOOL ok_4501;
	  {
	    // Flash error or protection on
	    P_RemoveFileFromAnFCBBank_4285(FP->Chain->Chain,FP->Chain->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->Chain->_U117._S120.FileName_4467,20,30,(INT*)FP->Chain->Chain->fCBBank_4320,&ok_4501);
	    if (ok_4501)
	    {
	      {
		// Flash error or protection on
		FP->Chain->Chain->_U123._S136.status_4424 = (20480 + (FP->_U113._S114.phaseForErrorReporting_4494 + FP->_U113._S114.convertedStatus_4495));
	      }
	    }
	    else
	    if (true)
	    {
	      {
		// Flash error or protection on (Programming error, we have just inserted it!)
		FP->Chain->Chain->_U123._S136.status_4424 = 22528;
	      }
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	GOTO(17);
      CASE(18):  
	if (!(FP->Chain->_U117._S120.NoOfElemLeft_4483 == 0)) GOTO(19);
	P_RemoveFileFromAnFCBBank_4285(FP->Chain->Chain,FP->Chain->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->Chain->_U117._S120.FileName_4467,20,30,(INT*)FP->Chain->Chain->fCBBank_4320,&FP->_U113._S114._U114._S118.ok_4502);
	FP->_U113._S114._U114._S118._U115._C496.IOfFile_4364=11;
	FP->_U113._S114._U114._S118._U115._C496.SearchFrom_4365=0;
	FP->_U113._S114._U114._S118._U115._C496.VerifyChecksum_I_4366=false;
	FP->_U113._S114._U114._S118._U115._C496.fcbFound_4367=&FP->_U113._S114._U114._S118.fcbFound_4503;
	FP->_U113._S114._U114._S118._U115._C496.Chain = FP->Chain->Chain;
	CALL(P_FindFile_512K_CodeAnywhere_4373,&FP->_U113._S114._U114._S118._U115._C496,20,"P_FindFile_512K_CodeAnywhere_4373");
      CASE(20):  
	if (( ! FP->_U113._S114._U114._S118.ok_4502))
	{
	  {
	    // Programming error, we have just inserted it!
	    FP->Chain->Chain->_U123._S136.status_4424 = 22528;
	  }
	}
	else
	if (( ! FP->_U113._S114._U114._S118.fcbFound_4503))
	{
	  {
	    // Cannot find FCB of programmed "prg_0512.bin"
	    FP->Chain->Chain->_U123._S136.status_4424 = 22784;
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(17);
      CASE(19):  
	if (!true) GOTO(21);
	GOTO(17);
      CASE(21):  
	SETERR(MSG_IF);
      CASE(17):  
	GOTO(1);
      CASE(3):  
	if (!(FP->Chain->_U117._S120.NoOfElemLeft_4483 == 0)) GOTO(22);
	// Last segment: make a "real" FCB and program file
	FP->_U113._S119.newInFCBBank_4504 = (*((INT*)(((BYTE*)FP->Chain->Chain->fCBBank_4320)+(24*sizeof(INT))+(RNGCHK(FP->Chain->_U117._S120.fileHandleInFCBBank_4468,20)*(30*sizeof(INT))))) == -1);
	P_InsertDateEtcInAnFCBBank_4276(FP->Chain->Chain,FP->Chain->_U117._S120.fileHandleInFCBBank_4468,(INT*)((INT*)(((BYTE*)FP->Chain->album_4466)+((24)*sizeof(INT)))),20,30,(INT*)FP->Chain->Chain->fCBBank_4320);
	P_InsertNoOfDataBytesInAnFCBBank_4280(FP->Chain->Chain,FP->Chain->_U117._S120.fileHandleInFCBBank_4468,(FP->Chain->Chain->next_iOfWrFile_4323 - 30),20,30,(INT*)FP->Chain->Chain->fCBBank_4320);
	ASSIGN(((INT*)(((BYTE*)FP->Chain->Chain->buffer_4322)+((0)*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->Chain->fCBBank_4320)+(RNGCHK(FP->Chain->_U117._S120.fileHandleInFCBBank_4468,20)*(30*sizeof(INT))))),(30*sizeof(INT)));
	if (!(FP->Chain->_U117._S120.deviceNameHandle_4472 == 1)) GOTO(24);
	SETERR(MSG_STOP);
	GOTO(23);
      CASE(24):  
	if (!(FP->Chain->_U117._S120.deviceNameHandle_4472 == 0)) GOTO(25);
	{
	  // fserv data finished!
	}
	GOTO(23);
      CASE(25):  
	if (!(FP->Chain->_U117._S120.deviceNameHandle_4472 == 2)) GOTO(26);
	BREAKPOINT_F(17); // Program it in flash
	FP->_U113._S119._U116._C484.CommandSequence_4150_Dim0=10;
	FP->_U113._S119._U116._C484.CommandSequence_4150= (INT*)FP->Chain->Chain->ProgramFlash6Seq_4065;
	FP->_U113._S119._U116._C484.buffer_4151_Dim0=FP->Chain->Chain->next_iOfWrFile_4323;
	FP->_U113._S119._U116._C484.buffer_4151= (INT*)((INT*)(((BYTE*)FP->Chain->Chain->buffer_4322)+((RNGCHKUB(0,FP->Chain->Chain->next_iOfWrFile_4323,1388),0)*sizeof(INT))));
	FP->_U113._S119._U116._C484.AddressType_4152=1;
	FP->_U113._S119._U116._C484.Address_4153=FP->Chain->_U117._S120.fileNameHandle_4471;
	FP->_U113._S119._U116._C484.status_4154=&FP->Chain->Chain->_U123._S136.status_4424;
	FP->_U113._S119._U116._C484.Chain = FP->Chain->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U113._S119._U116._C484,27,"P_FlashCommandInterpreter_4174");
      CASE(27):  
	if (((FP->Chain->Chain->_U123._S136.status_4424 == 128) && (FP->_U113._S119.newInFCBBank_4504 == false)))
	{
	  FP->Chain->Chain->_U123._S136.status_4424 = 16418;
	}
	else
	if ((FP->Chain->Chain->_U123._S136.status_4424 != 0))
	{
	  {
	    BOOL ok_4505;
	    {
	      // Flash error or protection on
	      P_RemoveFileFromAnFCBBank_4285(FP->Chain->Chain,FP->Chain->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->Chain->_U117._S120.FileName_4467,20,30,(INT*)FP->Chain->Chain->fCBBank_4320,&ok_4505);
	      if (ok_4505)
	      {
		{
		  // Flash error or protection on
		  FP->Chain->Chain->_U123._S136.status_4424 = 16386;
		}
	      }
	      else
	      if (true)
	      {
		{
		  // Flash error or protection on (Programming error, we have just inserted it!)
		  FP->Chain->Chain->_U123._S136.status_4424 = 16387;
		}
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(23);
      CASE(26):  
	SETERR(MSG_IF);
      CASE(23):  
	P_ResetWrSegmenting_4337(FP->Chain->Chain);
	GOTO(1);
      CASE(22):  
	if (!true) GOTO(28);
	GOTO(1);
      CASE(28):  
	SETERR(MSG_IF);
      CASE(1):  
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_P_WrFileDataAckNack_4514 (tSF_P_P_WrFileDataAckNack_4514 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->album_4466 = (INT*)((INT*)(((BYTE*)FP->Chain->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
	CHK(289 == 289,MSG_AIM);
	BREAKPOINT_F(17); // PAlbWrFileDataAckNack
	FP->_U117._S120.FileName_4467 = (BYTE*)((INT*)(((BYTE*)FP->album_4466)+((RNGCHKUB(4,*((INT*)(((BYTE*)FP->album_4466)+(3*sizeof(INT)))),289),4)*sizeof(INT))));
	FP->_U117._S120.FileName_4467_Dim0 = (((*((INT*)(((BYTE*)FP->album_4466)+(3*sizeof(INT))))*sizeof(INT)))/(sizeof(BYTE))) ;
	CHK((FP->_U117._S120.FileName_4467_Dim0*sizeof(BYTE)) == (*((INT*)(((BYTE*)FP->album_4466)+(3*sizeof(INT))))*sizeof(INT)),MSG_ARM);
	FP->_U117._S120.fileHandleInFCBBank_4468 = F_FindFileInAnFCBBank_4237(FP->Chain,FP->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->_U117._S120.FileName_4467,20,30,(INT*)FP->Chain->fCBBank_4320);
	FP->_U117._S120.fileHandleInBuffer_flash6_4469 = F_FindExtFileInAnFCBBank_4246(FP->Chain,FP->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->_U117._S120.FileName_4467,true,(INT*)((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))));
	FP->_U117._S120.fileHandleInBuffer_4470 = F_FindExtFileInAnFCBBank_4246(FP->Chain,FP->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->_U117._S120.FileName_4467,false,(INT*)((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))));
	FP->_U117._S120.fileNameHandle_4471 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,FP->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->_U117._S120.FileName_4467,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	{
	  BYTE *_V56_4478;
	  {
	    static BYTE TMP[2] = {58,92};
	    _V56_4478 = TMP;
	  }
	  FP->_U117._S120.deviceNameHandle_4472 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,FP->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->_U117._S120.FileName_4467,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V56_4478,1,8,1);
	}
	FP->_U117._S120.hatFile_4474 = ( ! F_IsNotIn_1493(FP->Chain->Chain->Chain->Chain,5,(INT*)FP->Chain->Chain->Chain->Chain->IOfHatFile_1303,FP->_U117._S120.fileNameHandle_4471));
	if (((FP->_U117._S120.deviceNameHandle_4472 == 3) && (F_CannotAccept_flashx_4477(FP) == false)))
	{
	  FP->_U117._S120.nowLoading_flashx_4473 = true;
	}
	else
	if (true)
	{
	  FP->_U117._S120.nowLoading_flashx_4473 = false;
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->_U117._S120.NoOfBytesSent_4479 = (INT)*((INT*)(((BYTE*)FP->album_4466)+(30*sizeof(INT))));
	FP->_U117._S120.NoOfBytesLeft_4480 = (INT)*((INT*)(((BYTE*)FP->album_4466)+(31*sizeof(INT))));
	FP->_U117._S120.NoOfBytesOfThisSegment_4481 = (INT)*((INT*)(((BYTE*)FP->album_4466)+(32*sizeof(INT))));
	FP->_U117._S120.NoOfElemSent_4482 = (INT)(FP->_U117._S120.NoOfBytesSent_4479 / 4);
	FP->_U117._S120.NoOfElemLeft_4483 = (INT)(FP->_U117._S120.NoOfBytesLeft_4480 / 4);
	FP->_U117._S120.NoOfElemOfThisSegment_4484 = (INT)(FP->_U117._S120.NoOfBytesOfThisSegment_4481 / 4);
	if ((FP->_U117._S120.NoOfElemSent_4482 == 0))
	{
	  P_ResetWrSegmenting_4337(FP->Chain);
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (!(FP->_U117._S120.fileNameHandle_4471 == -1)) GOTO(2);
	{
	  // File name not known
	  FP->Chain->_U123._S136.status_4424 = 16388;
	}
	GOTO(1);
      CASE(2):  
	if (!(FP->_U117._S120.deviceNameHandle_4472 == -1)) GOTO(3);
	{
	  // Programming error (device type is part of file name, so it should have been taken above)
	  SETERR(MSG_STOP);
	}
	GOTO(1);
      CASE(3):  
	if (!(FP->_U117._S120.deviceNameHandle_4472 == 1)) GOTO(4);
	{
	  // No write to this device type
	  FP->Chain->_U123._S136.status_4424 = 16389;
	}
	GOTO(1);
      CASE(4):  
	if (!((FP->_U117._S120.deviceNameHandle_4472 == 3) && (F_CannotAccept_flashx_4477(FP) == true))) GOTO(5);
	{
	  // No write to this device type now
	  FP->Chain->_U123._S136.status_4424 = 16390;
	}
	GOTO(1);
      CASE(5):  
	if (!((F_IsNotModulo4_1454(FP->_U117._S120.NoOfBytesSent_4479) || F_IsNotModulo4_1454(FP->_U117._S120.NoOfBytesLeft_4480)) || F_IsNotModulo4_1454(FP->_U117._S120.NoOfBytesOfThisSegment_4481))) GOTO(6);
	{
	  // We allow only modulo-4 number of anything!
	  // So file sizes have to be padded!
	  FP->Chain->_U123._S136.status_4424 = 16391;
	}
	GOTO(1);
      CASE(6):  
	if (!((FP->_U117._S120.nowLoading_flashx_4473 == false) && (((FP->_U117._S120.NoOfElemSent_4482 + FP->_U117._S120.NoOfElemLeft_4483) + FP->_U117._S120.NoOfElemOfThisSegment_4484) > 1358))) GOTO(7);
	{
	  // Too large file
	  FP->Chain->_U123._S136.status_4424 = 16392;
	}
	GOTO(1);
      CASE(7):  
	if (!((FP->_U117._S120.nowLoading_flashx_4473 == true) && (((FP->_U117._S120.NoOfElemSent_4482 + FP->_U117._S120.NoOfElemLeft_4483) + FP->_U117._S120.NoOfElemOfThisSegment_4484) > 131072))) GOTO(8);
	{
	  // Too large file (code)
	  FP->Chain->_U123._S136.status_4424 = 16393;
	}
	GOTO(1);
      CASE(8):  
	if (!(FP->_U117._S120.NoOfElemSent_4482 != (FP->Chain->next_iOfWrFile_4323 - 30))) GOTO(9);
	{
	  // Out of sequence
	  FP->Chain->_U123._S136.status_4424 = 16394;
	}
	GOTO(1);
      CASE(9):  
	if (!((FP->_U117._S120.nowLoading_flashx_4473 == false) && ((FP->Chain->next_iOfWrFile_4323 + FP->_U117._S120.NoOfElemOfThisSegment_4484) > 1388))) GOTO(10);
	{
	  // Overflow
	  FP->Chain->_U123._S136.status_4424 = 16395;
	}
	GOTO(1);
      CASE(10):  
	if (!(((FP->_U117._S120.nowLoading_flashx_4473 == false) && (FP->_U117._S120.NoOfElemSent_4482 != 0)) && (FP->_U117._S120.fileHandleInBuffer_flash6_4469 == -1))) GOTO(11);
	{
	  // Couldn't find file name in the FCB part of buffer, it must have changed
	  FP->Chain->_U123._S136.status_4424 = 16396;
	}
	GOTO(1);
      CASE(11):  
	if (!(((FP->_U117._S120.nowLoading_flashx_4473 == true) && (FP->_U117._S120.NoOfElemSent_4482 != 0)) && (FP->_U117._S120.fileHandleInBuffer_4470 == -1))) GOTO(12);
	{
	  // Couldn't find file name in the FCB part of buffer, it must have changed
	  FP->Chain->_U123._S136.status_4424 = 16396;
	}
	GOTO(1);
      CASE(12):  
	if (!true) GOTO(13);
	FP->_U117._S120._U118._C499.Chain = FP;
	CALL(P_FillBufferAndProgramFile_4506,&FP->_U117._S120._U118._C499,14,"P_FillBufferAndProgramFile_4506");
      CASE(14):  
	GOTO(1);
      CASE(13):  
	SETERR(MSG_IF);
      CASE(1):  
	if ((FP->Chain->_U123._S136.status_4424 == 0))
	{
	}
	else
	if ((FP->Chain->_U123._S136.status_4424 != 0))
	{
	  {
	    BOOL wasInBank_notUsed_4513;
	    P_RemoveFileFromAnFCBBank_4285(FP->Chain,FP->_U117._S120.FileName_4467_Dim0,(BYTE*)FP->_U117._S120.FileName_4467,20,30,(INT*)FP->Chain->fCBBank_4320,&wasInBank_notUsed_4513);
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if ((FP->Chain->_U123._S136.status_4424 == 0))
	{
	  FP->Chain->_U123._S136.send_4417 = 1;
	}
	else
	if ((FP->Chain->_U123._S136.status_4424 != 0))
	{
	  {
	    P_ResetWrSegmenting_4337(FP->Chain);
	    // Error: send NackEnd
	    FP->Chain->_U123._S136.send_4417 = 2;
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_P_RdFileNamesReNack_4529 (tSF_P_FileServer_4586 *PP)
{
  tSF_P_P_RdFileNamesReNack_4529 SF;
  tSF_P_P_RdFileNamesReNack_4529 *FP = &SF;
  FP->Chain = PP;
  {
    INT *album_4515;
    album_4515 = (INT*)((INT*)(((BYTE*)FP->Chain->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
    CHK(289 == 289,MSG_AIM);
    {
      BREAKPOINT_F(17); // PAlbRdFileNamesReNack
      {
	INT noOfValidFilesNow_4516;
	{
	  if ((*((INT*)(((BYTE*)album_4515)+(3*sizeof(INT)))) == 1))
	  {
	    P_ResetReadFileNamesSegmenting_4339(FP->Chain,F_NoOfFilesInAnFCBBank_4251(FP->Chain,20,30,(INT*)FP->Chain->fCBBank_4320));
	  }
	  else
	  if (true)
	  {
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	  noOfValidFilesNow_4516 = 0; 
	  {
	    INT iOfNextCharInList_4517;
	    INT handleOfLastFile_4518;
	    {
	      iOfNextCharInList_4517 = 0; 
	      handleOfLastFile_4518 = F_FindLastFileInAnFCBBank_4257(FP->Chain,20,30,(INT*)FP->Chain->fCBBank_4320);
	      if ((handleOfLastFile_4518 == -1))
	      {
		{
		  // No files
		}
	      }
	      else
	      if (true)
	      {
		{
		  INT *list_4519;
		  BOOL finished_4520;
		  INT For_4521;
		  list_4519 = (INT*)((INT*)(((BYTE*)album_4515)+((4)*sizeof(INT))));
		  CHK(84 == 84,MSG_AIM);
		  For_4521 = (INT)(FP->Chain->noOfFilesOfRdFileNames_4328 - FP->Chain->noOfFilesSentOfRdFileNames_4327);
		  {
		    // Fill file names
		    finished_4520 = false; 
		    {
		      INT i_4522;
		      INT i_4522_End;
		      i_4522 = FP->Chain->noOfFilesSentOfRdFileNames_4327;i_4522_End = i_4522 + For_4521;
		      for (; i_4522 != i_4522_End; i_4522++)
		      {
			if (finished_4520)
			{
			  {
			    // Rotate to end
			  }
			}
			else
			if (true)
			{
			  {
			    {
			      INT handleOfFile_4523;
			      {
				handleOfFile_4523 = F_FindNextFileInAnFCBBank_4267(FP->Chain,20,30,(INT*)FP->Chain->fCBBank_4320,i_4522);
				if ((handleOfFile_4523 == -1))
				{
				  {
				    // No more files, loop until end in any case
				    finished_4520 = true; 
				  }
				}
				else
				if (true)
				{
				  {
				    {
				      INT *FCB_4524;
				      INT Size_4525;
				      INT FileName_4526_Dim0;
				      BYTE *FileName_4526;
				      BOOL commaOK_4527;
				      BOOL textOK_4528;
				      FCB_4524 = (INT*)((INT*)(((BYTE*)FP->Chain->fCBBank_4320)+(RNGCHK(handleOfFile_4523,20)*(30*sizeof(INT)))));
				      Size_4525 = (INT)*((INT*)(((BYTE*)FCB_4524)+(2*sizeof(INT))));
				      FileName_4526 = (BYTE*)((INT*)(((BYTE*)FCB_4524)+((RNGCHKUB(3,Size_4525,30),3)*sizeof(INT))));
				      FileName_4526_Dim0 = (((Size_4525*sizeof(INT)))/(sizeof(BYTE))) ;
				      CHK((FileName_4526_Dim0*sizeof(BYTE)) == (Size_4525*sizeof(INT)),MSG_ARM);
				      {
					// Insert text
					P_InsertTextIntoCommaSeparatedList_776(84,(INT*)list_4519,&iOfNextCharInList_4517,FileName_4526_Dim0,(BYTE*)FileName_4526,&commaOK_4527,&textOK_4528);
					if (((commaOK_4527 == true) && (textOK_4528 == true)))
					{
					  noOfValidFilesNow_4516 = (noOfValidFilesNow_4516 + 1); 
					}
					else
					if (((commaOK_4527 == true) && (textOK_4528 == false)))
					{
					  finished_4520 = true; 
					}
					else
					if (((commaOK_4527 == false) && (textOK_4528 == true)))
					{
					  SETERR(MSG_STOP);
					}
					else
					if (((commaOK_4527 == false) && (textOK_4528 == false)))
					{
					  finished_4520 = false; 
					}
					else
					{
					  SETERR(MSG_IF);
					}
				      }
				    }
				  }
				}
				else
				{
				  SETERR(MSG_IF);
				}
			      }
			    }
			  }
			}
			else
			{
			  SETERR(MSG_IF);
			}
		      }
		    }
		  }
		}
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	      *((INT*)(((BYTE*)album_4515)+(3*sizeof(INT)))) = iOfNextCharInList_4517; 
	    }
	  }
	  FP->Chain->noOfFilesSentOfRdFileNames_4327 = (FP->Chain->noOfFilesSentOfRdFileNames_4327 + noOfValidFilesNow_4516);
	}
      }
      FP->Chain->_U123._S136.send_4417 = 3;
      *((INT*)(((BYTE*)album_4515)+(0*sizeof(INT)))) = 163; 
      FP->Chain->_U123._S136.noOfInt32OfTheProtocol_4416 = 88;
    }
  }
}
static void P_P_CloneOrWrFileAckNack_4560 (tSF_P_P_CloneOrWrFileAckNack_4560 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->album_4537 = (INT*)((INT*)(((BYTE*)FP->Chain->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
	CHK(289 == 289,MSG_AIM);
	BREAKPOINT_F(17); // CloneOrWrFileAckNack
	FP->lenOfFileName_from_4532 = *((INT*)(((BYTE*)FP->album_4537)+(3*sizeof(INT))));
	FP->lenOfFileName_to_4534 = *((INT*)(((BYTE*)FP->album_4537)+(24*sizeof(INT))));
	{
	  INT lenOfFileName_from_copy_4538;
	  INT lenOfFileName_to_copy_4539;
	  {
	    lenOfFileName_from_copy_4538 = FP->lenOfFileName_from_4532;
	    lenOfFileName_to_copy_4539 = FP->lenOfFileName_to_4534;
	    {
	      INT FileName_from_4540_Dim0;
	      BYTE *FileName_from_4540;
	      INT FileName_to_4541_Dim0;
	      BYTE *FileName_to_4541;
	      FileName_from_4540 = (BYTE*)((INT*)(((BYTE*)FP->album_4537)+((RNGCHKUB(4,FP->lenOfFileName_from_4532,289),4)*sizeof(INT))));
	      FileName_from_4540_Dim0 = (((FP->lenOfFileName_from_4532*sizeof(INT)))/(sizeof(BYTE))) ;
	      CHK((FileName_from_4540_Dim0*sizeof(BYTE)) == (FP->lenOfFileName_from_4532*sizeof(INT)),MSG_ARM);
	      FileName_to_4541 = (BYTE*)((INT*)(((BYTE*)FP->album_4537)+((RNGCHKUB(25,FP->lenOfFileName_to_4534,289),25)*sizeof(INT))));
	      FileName_to_4541_Dim0 = (((FP->lenOfFileName_to_4534*sizeof(INT)))/(sizeof(BYTE))) ;
	      CHK((FileName_to_4541_Dim0*sizeof(BYTE)) == (FP->lenOfFileName_to_4534*sizeof(INT)),MSG_ARM);
	      {
		{
		  BYTE *_V57_4542;
		  {
		    static BYTE TMP[2] = {58,92};
		    _V57_4542 = TMP;
		  }
		  FP->deviceNameHandleOrig_from_4533 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,FileName_from_4540_Dim0,(BYTE*)FileName_from_4540,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V57_4542,1,8,1);
		}
		{
		  BYTE *_V58_4543;
		  {
		    static BYTE TMP[2] = {58,92};
		    _V58_4543 = TMP;
		  }
		  FP->deviceNameHandleOrig_to_4535 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,FileName_to_4541_Dim0,(BYTE*)FileName_to_4541,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V58_4543,1,8,1);
		}
		{
		  INT _V59_4544[2];
		  _V59_4544[0] = FP->deviceNameHandleOrig_from_4533;
		  _V59_4544[1] = FP->deviceNameHandleOrig_to_4535;
		  FP->iOfDirection_4536 = F_IOfEqualTo_1499(FP->Chain->Chain->Chain->Chain,3,2,(INT*)FP->Chain->Chain->Chain->Chain->MoveBetween_1267,2,(INT*)_V59_4544);
		}
		CHK(FP->lenOfFileName_from_4532==FP->lenOfFileName_from_4532,MSG_ASM);
		ASSIGN(((BYTE*)(((BYTE*)FP->fileName_from_4530)+((RNGCHKUB(0,FP->lenOfFileName_from_4532,20),0)*sizeof(BYTE)))),((BYTE*)(((BYTE*)FileName_from_4540)+((RNGCHKUB(0,FP->lenOfFileName_from_4532,FileName_from_4540_Dim0),0)*sizeof(BYTE)))),(FP->lenOfFileName_from_4532*sizeof(BYTE)));
		CHK(FP->lenOfFileName_to_4534==FP->lenOfFileName_to_4534,MSG_ASM);
		ASSIGN(((BYTE*)(((BYTE*)FP->fileName_to_4531)+((RNGCHKUB(0,FP->lenOfFileName_to_4534,20),0)*sizeof(BYTE)))),((BYTE*)(((BYTE*)FileName_to_4541)+((RNGCHKUB(0,FP->lenOfFileName_to_4534,FileName_to_4541_Dim0),0)*sizeof(BYTE)))),(FP->lenOfFileName_to_4534*sizeof(BYTE)));
		if ((FP->deviceNameHandleOrig_from_4533 == 0))
		{
		  P_ReplaceDeviceNameWith_4229(FP->Chain,6,(BYTE*)FP->Chain->Chain->Chain->Chain->Flash6_1259,(BYTE*)FP->fileName_from_4530,&lenOfFileName_from_copy_4538);
		}
		else
		if ((FP->deviceNameHandleOrig_to_4535 == 0))
		{
		  P_ReplaceDeviceNameWith_4229(FP->Chain,6,(BYTE*)FP->Chain->Chain->Chain->Chain->Flash6_1259,(BYTE*)FP->fileName_to_4531,&lenOfFileName_to_copy_4539);
		}
		else
		if (true)
		{
		}
		else
		{
		  SETERR(MSG_IF);
		}
		if ((FP->deviceNameHandleOrig_to_4535 == 1))
		{
		  P_ReplaceDeviceNameWith_4229(FP->Chain,6,(BYTE*)FP->Chain->Chain->Chain->Chain->Flash6_1259,(BYTE*)FP->fileName_to_4531,&lenOfFileName_to_copy_4539);
		}
		else
		if ((FP->deviceNameHandleOrig_from_4533 == 1))
		{
		}
		else
		if (true)
		{
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	    FP->lenOfFileName_from_4532 = lenOfFileName_from_copy_4538;
	    FP->lenOfFileName_to_4534 = lenOfFileName_to_copy_4539;
	  }
	}
	FP->_U120._S121.FileNameMod_from_4545 = (BYTE*)((BYTE*)(((BYTE*)FP->fileName_from_4530)+((RNGCHKUB(0,FP->lenOfFileName_from_4532,20),0)*sizeof(BYTE))));
	FP->_U120._S121.FileNameMod_from_4545_Dim_437918235 = FP->lenOfFileName_from_4532;
	FP->_U120._S121.FileNameMod_to_4546 = (BYTE*)((BYTE*)(((BYTE*)FP->fileName_to_4531)+((RNGCHKUB(0,FP->lenOfFileName_to_4534,20),0)*sizeof(BYTE))));
	FP->_U120._S121.FileNameMod_to_4546_Dim_437918235 = FP->lenOfFileName_to_4534;
	{
	  INT fCBInBuffer_4553[1][30];
	  {
	    CHK(30==30,MSG_ASM);
	    ASSIGN(((INT*)(((BYTE*)fCBInBuffer_4553)+(0*(30*sizeof(INT))))),((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))),(30*sizeof(INT)));
	    FP->_U120._S121.fileHandleInBuffer_flash6Mod_from_4549 = F_FindFileInAnFCBBank_4237(FP->Chain,FP->lenOfFileName_from_4532,(BYTE*)FP->_U120._S121.FileNameMod_from_4545,1,30,(INT*)fCBInBuffer_4553);
	    FP->_U120._S121.fileHandleInBuffer_flash6Mod_to_4552 = F_FindFileInAnFCBBank_4237(FP->Chain,FP->lenOfFileName_to_4534,(BYTE*)FP->_U120._S121.FileNameMod_to_4546,1,30,(INT*)fCBInBuffer_4553);
	  }
	}
	FP->_U120._S121.fileHandleInFCBBankMod_from_4547 = F_FindFileInAnFCBBank_4237(FP->Chain,FP->lenOfFileName_from_4532,(BYTE*)FP->_U120._S121.FileNameMod_from_4545,20,30,(INT*)FP->Chain->fCBBank_4320);
	FP->_U120._S121.fileHandleInFCBBankMod_to_4550 = F_FindFileInAnFCBBank_4237(FP->Chain,FP->lenOfFileName_to_4534,(BYTE*)FP->_U120._S121.FileNameMod_to_4546,20,30,(INT*)FP->Chain->fCBBank_4320);
	FP->_U120._S121.fileNameHandleMod_from_4548 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,FP->lenOfFileName_from_4532,(BYTE*)FP->_U120._S121.FileNameMod_from_4545,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	FP->_U120._S121.fileNameHandleMod_to_4551 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,FP->lenOfFileName_to_4534,(BYTE*)FP->_U120._S121.FileNameMod_to_4546,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	if (!(FP->_U120._S121.fileNameHandleMod_from_4548 == -1)) GOTO(2);
	FP->Chain->_U123._S136.status_4424 = 28672;
	GOTO(1);
      CASE(2):  
	if (!(FP->_U120._S121.fileNameHandleMod_to_4551 == -1)) GOTO(3);
	FP->Chain->_U123._S136.status_4424 = 28673;
	GOTO(1);
      CASE(3):  
	if (!(FP->_U120._S121.fileHandleInFCBBankMod_from_4547 == -1)) GOTO(4);
	FP->Chain->_U123._S136.status_4424 = 28674;
	GOTO(1);
      CASE(4):  
	if (!(FP->_U120._S121.fileHandleInFCBBankMod_to_4550 == -1)) GOTO(5);
	FP->Chain->_U123._S136.status_4424 = 28675;
	GOTO(1);
      CASE(5):  
	if (!(FP->iOfDirection_4536 == -1)) GOTO(6);
	FP->Chain->_U123._S136.status_4424 = 28676;
	GOTO(1);
      CASE(6):  
	if (!(FP->iOfDirection_4536 == 2)) GOTO(7);
	if (!(FP->_U120._S121.fileHandleInBuffer_flash6Mod_from_4549 == -1)) GOTO(9);
	FP->Chain->_U123._S136.status_4424 = 28677;
	GOTO(8);
      CASE(9):  
	if (!F_IsNotIn_1493(FP->Chain->Chain->Chain->Chain,5,(INT*)FP->Chain->Chain->Chain->Chain->ReadAtInitFlash6Files_1305,FP->_U120._S121.fileNameHandleMod_to_4551)) GOTO(10);
	FP->Chain->_U123._S136.status_4424 = 28678;
	GOTO(8);
      CASE(10):  
	if (!true) GOTO(11);
	BREAKPOINT_F(17); // send on
	CHK(30==30,MSG_ASM);
	ASSIGN(FP->_U120._S121._U121._S122.fCBInBuffer_4556,((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))),(30*sizeof(INT)));
	FP->_U120._S121._U121._S122.noOfInt32OfData_4554 = (*((INT*)(((BYTE*)FP->_U120._S121._U121._S122.fCBInBuffer_4556)+(28*sizeof(INT)))) / 4);
	// --- C embedded in occam, begin ---
	// ---
	// Find address of FP->Chain->buffer_4322[30]:
	FP->_U120._S121._U121._S122.address_4555 = (INT)&FP->Chain->buffer_4322[30];
	// ---
	// --- C embedded in occam, end ---
	FP->_U120._S121._U121._S122._U122._C509.IndexOfFile_4291=FP->_U120._S121.fileNameHandleMod_to_4551;
	FP->_U120._S121._U121._S122._U122._C509.UserOfFile_4292=*((INT*)(((BYTE*)FP->Chain->Chain->Chain->Chain->UsersOfFiles_1310)+(RNGCHK(FP->_U120._S121.fileNameHandleMod_to_4551,13)*sizeof(INT))));
	FP->_U120._S121._U121._S122._U122._C509.AddressOfData_4293=FP->_U120._S121._U121._S122.address_4555;
	FP->_U120._S121._U121._S122._U122._C509.NoOfInt32OfData_4294=FP->_U120._S121._U121._S122.noOfInt32OfData_4554;
	FP->_U120._S121._U121._S122._U122._C509.dataInFileApproved_4295=&FP->_U120._S121._U121._S122.dataInFileApproved_4557;
	FP->_U120._S121._U121._S122._U122._C509.Chain = FP->Chain;
	CALL(P_Send_PFileHereIsFileAddrAckNack_4302,&FP->_U120._S121._U121._S122._U122._C509,12,"P_Send_PFileHereIsFileAddrAckNack_4302");
      CASE(12):  
	if (!( ! FP->_U120._S121._U121._S122.dataInFileApproved_4557)) GOTO(14);
	FP->Chain->_U123._S136.status_4424 = 28684;
	*((BOOL*)(((BYTE*)FP->Chain->fileDataApproved_byServer_4331)+(RNGCHK(FP->_U120._S121.fileNameHandleMod_to_4551,13)*sizeof(BOOL)))) = false;
	FP->_U120._S121._U121._S122._U122._C511.Chain = FP->Chain;
	CALL(P_VerifyFilesStatus_reportIfAllOk_4375,&FP->_U120._S121._U121._S122._U122._C511,15,"P_VerifyFilesStatus_reportIfAllOk_4375");
      CASE(15):  
	GOTO(13);
      CASE(14):  
	if (!true) GOTO(16);
	*((BOOL*)(((BYTE*)FP->Chain->fileDataApproved_byServer_4331)+(RNGCHK(FP->_U120._S121.fileNameHandleMod_to_4551,13)*sizeof(BOOL)))) = true;
	FP->_U120._S121._U121._S122._U122._C510.Chain = FP->Chain;
	CALL(P_VerifyFilesStatus_reportIfAllOk_4375,&FP->_U120._S121._U121._S122._U122._C510,17,"P_VerifyFilesStatus_reportIfAllOk_4375");
      CASE(17):  
	GOTO(13);
      CASE(16):  
	SETERR(MSG_IF);
      CASE(13):  
	GOTO(8);
      CASE(11):  
	SETERR(MSG_IF);
      CASE(8):  
	GOTO(1);
      CASE(7):  
	if (!(FP->iOfDirection_4536 == 0)) GOTO(18);
	FP->_U120._S121._U121._S123._C508.RequestedNameOfFile_4181_Dim0=FP->lenOfFileName_from_4532;
	FP->_U120._S121._U121._S123._C508.RequestedNameOfFile_4181= (BYTE*)FP->_U120._S121.FileNameMod_from_4545;
	FP->_U120._S121._U121._S123._C508.buffer_4182_Dim0=1388;
	FP->_U120._S121._U121._S123._C508.buffer_4182= (INT*)FP->Chain->buffer_4322;
	FP->_U120._S121._U121._S123._C508.noOfInt32OfFCBAndData_4183=&FP->_U120._S121._U121._S123.noOfInt32OfFCBAndData_4558;
	FP->_U120._S121._U121._S123._C508.status_4184=&FP->Chain->_U123._S136.status_4424;
	FP->_U120._S121._U121._S123._C508.Chain = FP->Chain;
	CALL(P_ReadFileFromFlash_4201,&FP->_U120._S121._U121._S123._C508,19,"P_ReadFileFromFlash_4201");
      CASE(19):  
	if ((FP->Chain->_U123._S136.status_4424 != 0))
	{
	  FP->Chain->_U123._S136.status_4424 = 28679;
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(1);
      CASE(18):  
	if (!(FP->iOfDirection_4536 == 1)) GOTO(20);
	FP->_U120._S121._U121._S124.size_4559 = (30 + (*((INT*)(((BYTE*)FP->Chain->buffer_4322)+(28*sizeof(INT)))) / 4));
	if (!(FP->_U120._S121._U121._S124.size_4559 < 30)) GOTO(22);
	FP->Chain->_U123._S136.status_4424 = 28680;
	GOTO(21);
      CASE(22):  
	if (!(FP->_U120._S121._U121._S124.size_4559 > 1388)) GOTO(23);
	FP->Chain->_U123._S136.status_4424 = 28681;
	GOTO(21);
      CASE(23):  
	if (!true) GOTO(24);
	FP->_U120._S121._U121._S124._C507.CommandSequence_4150_Dim0=10;
	FP->_U120._S121._U121._S124._C507.CommandSequence_4150= (INT*)FP->Chain->ProgramFlash6Seq_4065;
	FP->_U120._S121._U121._S124._C507.buffer_4151_Dim0=FP->_U120._S121._U121._S124.size_4559;
	FP->_U120._S121._U121._S124._C507.buffer_4151= (INT*)((INT*)(((BYTE*)FP->Chain->buffer_4322)+((RNGCHKUB(0,FP->_U120._S121._U121._S124.size_4559,1388),0)*sizeof(INT))));
	FP->_U120._S121._U121._S124._C507.AddressType_4152=1;
	FP->_U120._S121._U121._S124._C507.Address_4153=FP->_U120._S121.fileNameHandleMod_to_4551;
	FP->_U120._S121._U121._S124._C507.status_4154=&FP->Chain->_U123._S136.status_4424;
	FP->_U120._S121._U121._S124._C507.Chain = FP->Chain;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U120._S121._U121._S124._C507,25,"P_FlashCommandInterpreter_4174");
      CASE(25):  
	if ((FP->Chain->_U123._S136.status_4424 != 0))
	{
	  FP->Chain->_U123._S136.status_4424 = 28682;
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	GOTO(21);
      CASE(24):  
	SETERR(MSG_IF);
      CASE(21):  
	GOTO(1);
      CASE(20):  
	if (!true) GOTO(26);
	FP->Chain->_U123._S136.status_4424 = 28683;
	GOTO(1);
      CASE(26):  
	SETERR(MSG_IF);
      CASE(1):  
	if ((FP->Chain->_U123._S136.status_4424 == 0))
	{
	  FP->Chain->_U123._S136.send_4417 = 1;
	}
	else
	if (true)
	{
	  {
	    // Error: send NackEnd
	    FP->Chain->_U123._S136.send_4417 = 2;
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_P_Wr_RdDataOfStructReNack_4581 (tSF_P_FileServer_4586 *PP)
{
  tSF_P_P_Wr_RdDataOfStructReNack_4581 SF;
  tSF_P_P_Wr_RdDataOfStructReNack_4581 *FP = &SF;
  FP->Chain = PP;
  {
    INT *album_4561;
    BYTE fileName_4562[20];
    INT lenOfFileName_4563;
    INT deviceNameHandleOrig_4564;
    album_4561 = (INT*)((INT*)(((BYTE*)FP->Chain->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
    CHK(289 == 289,MSG_AIM);
    {
      BREAKPOINT_F(17); // PAlbRdDataOfStructReNack or PAlbWrDataOfStructAckNack
      {
	INT lenOfFileName_copy_4565;
	{
	  lenOfFileName_4563 = *((INT*)(((BYTE*)album_4561)+(3*sizeof(INT)))); 
	  lenOfFileName_copy_4565 = lenOfFileName_4563; 
	  {
	    INT OrigFileName_4566_Dim0;
	    BYTE *OrigFileName_4566;
	    OrigFileName_4566 = (BYTE*)((INT*)(((BYTE*)album_4561)+((RNGCHKUB(4,lenOfFileName_4563,289),4)*sizeof(INT))));
	    OrigFileName_4566_Dim0 = (((lenOfFileName_4563*sizeof(INT)))/(sizeof(BYTE))) ;
	    CHK((OrigFileName_4566_Dim0*sizeof(BYTE)) == (lenOfFileName_4563*sizeof(INT)),MSG_ARM);
	    {
	      CHK(lenOfFileName_4563==lenOfFileName_4563,MSG_ASM);
	      ASSIGN(((BYTE*)(((BYTE*)fileName_4562)+((RNGCHKUB(0,lenOfFileName_4563,20),0)*sizeof(BYTE)))),((BYTE*)(((BYTE*)OrigFileName_4566)+((RNGCHKUB(0,lenOfFileName_4563,OrigFileName_4566_Dim0),0)*sizeof(BYTE)))),(lenOfFileName_4563*sizeof(BYTE))); 
	      {
		BYTE *_V60_4567;
		{
		  static BYTE TMP[2] = {58,92};
		  _V60_4567 = TMP;
		}
		deviceNameHandleOrig_4564 = F_FindTextBeforeToken_809(FP->Chain->Chain->Chain->Chain,OrigFileName_4566_Dim0,(BYTE*)OrigFileName_4566,4,8,(BYTE*)FP->Chain->Chain->Chain->Chain->NamesOfDeviceTypes_1257,2,(BYTE*)_V60_4567,1,8,1);
	      }
	      if ((deviceNameHandleOrig_4564 == 0))
	      {
		P_ReplaceDeviceNameWith_4229(FP->Chain,6,(BYTE*)FP->Chain->Chain->Chain->Chain->Flash6_1259,(BYTE*)fileName_4562,&lenOfFileName_copy_4565);
	      }
	      else
	      if (true)
	      {
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	  lenOfFileName_4563 = lenOfFileName_copy_4565; 
	}
      }
      {
	INT FileNameMod_4568_Dim_437918235;/*SMW*/
	BYTE *FileNameMod_4568;
	INT fileHandleInBuffer_flash6Mod_4569;
	INT fileHandleInFCBBankMod_4570;
	INT fileNameHandleMod_4571;
	FileNameMod_4568 = (BYTE*)((BYTE*)(((BYTE*)fileName_4562)+((RNGCHKUB(0,lenOfFileName_4563,20),0)*sizeof(BYTE))));
	FileNameMod_4568_Dim_437918235 = lenOfFileName_4563;
	{
	  {
	    INT fCBInBuffer_4572[1][30];
	    {
	      CHK(30==30,MSG_ASM);
	      ASSIGN(((INT*)(((BYTE*)fCBInBuffer_4572)+(0*(30*sizeof(INT))))),((INT*)(((BYTE*)FP->Chain->buffer_4322)+((0)*sizeof(INT)))),(30*sizeof(INT)));
	      fileHandleInBuffer_flash6Mod_4569 = F_FindFileInAnFCBBank_4237(FP->Chain,lenOfFileName_4563,(BYTE*)FileNameMod_4568,1,30,(INT*)fCBInBuffer_4572);
	    }
	  }
	  fileHandleInFCBBankMod_4570 = (FileNameMod_4568_Dim_437918235); 
	  fileHandleInFCBBankMod_4570 = F_FindFileInAnFCBBank_4237(FP->Chain,lenOfFileName_4563,(BYTE*)FileNameMod_4568,20,30,(INT*)FP->Chain->fCBBank_4320);
	  fileNameHandleMod_4571 = F_FindTextFromArray_815(FP->Chain->Chain->Chain->Chain,lenOfFileName_4563,(BYTE*)FileNameMod_4568,13,20,(BYTE*)FP->Chain->Chain->Chain->Chain->NameOfFiles_1301);
	  if ((deviceNameHandleOrig_4564 != 0))
	  {
	    FP->Chain->_U123._S136.status_4424 = 32768;
	  }
	  else
	  if ((fileHandleInBuffer_flash6Mod_4569 == -1))
	  {
	    FP->Chain->_U123._S136.status_4424 = 32769;
	  }
	  else
	  if ((fileNameHandleMod_4571 == -1))
	  {
	    FP->Chain->_U123._S136.status_4424 = 32770;
	  }
	  else
	  if ((fileHandleInFCBBankMod_4570 == -1))
	  {
	    FP->Chain->_U123._S136.status_4424 = 32771;
	  }
	  else
	  if (F_IsNotModulo4_1454(*((INT*)(((BYTE*)album_4561)+(25*sizeof(INT))))))
	  {
	    FP->Chain->_U123._S136.status_4424 = 32772;
	  }
	  else
	  if (true)
	  {
	    {
	      INT noOfElemOfData_4575;
	      INT indexOfData_4576;
	      INT noOfElemInFile_4577;
	      INT fromInBuffer_4578;
	      INT endInBuffer_4579;
	      INT endInFile_4580;
	      {
		noOfElemOfData_4575 = (*((INT*)(((BYTE*)album_4561)+(25*sizeof(INT)))) / 4); 
		indexOfData_4576 = (*((INT*)(((BYTE*)album_4561)+(24*sizeof(INT)))) / 4); 
		noOfElemInFile_4577 = (*((INT*)(((BYTE*)FP->Chain->buffer_4322)+(28*sizeof(INT)))) / 4);
		fromInBuffer_4578 = (30 + indexOfData_4576); 
		endInFile_4580 = (indexOfData_4576 + noOfElemOfData_4575); 
		endInBuffer_4579 = (30 + (indexOfData_4576 + noOfElemOfData_4575)); 
		if ((endInFile_4580 > noOfElemInFile_4577))
		{
		  FP->Chain->_U123._S136.status_4424 = 32773;
		}
		else
		if ((endInBuffer_4579 > 1388))
		{
		  FP->Chain->_U123._S136.status_4424 = 32774;
		}
		else
		if ((FP->Chain->_U123._S136.protCmd_4423 == 120))
		{
		  {
		    CHK(noOfElemOfData_4575==noOfElemOfData_4575,MSG_ASM);
		    ASSIGN(((INT*)(((BYTE*)album_4561)+((RNGCHKUB(26,noOfElemOfData_4575,289),26)*sizeof(INT)))),((INT*)(((BYTE*)FP->Chain->buffer_4322)+((RNGCHKUB(fromInBuffer_4578,noOfElemOfData_4575,1388),RNGCHKLB(fromInBuffer_4578))*sizeof(INT)))),(noOfElemOfData_4575*sizeof(INT)));
		    FP->Chain->_U123._S136.send_4417 = 3;
		    *((INT*)(((BYTE*)album_4561)+(0*sizeof(INT)))) = 121; 
		    FP->Chain->_U123._S136.noOfInt32OfTheProtocol_4416 = 282;
		  }
		}
		else
		if ((FP->Chain->_U123._S136.protCmd_4423 == 122))
		{
		  {
		    CHK(noOfElemOfData_4575==noOfElemOfData_4575,MSG_ASM);
		    ASSIGN(((INT*)(((BYTE*)FP->Chain->buffer_4322)+((RNGCHKUB(fromInBuffer_4578,noOfElemOfData_4575,1388),RNGCHKLB(fromInBuffer_4578))*sizeof(INT)))),((INT*)(((BYTE*)album_4561)+((RNGCHKUB(26,noOfElemOfData_4575,289),26)*sizeof(INT)))),(noOfElemOfData_4575*sizeof(INT)));
		    FP->Chain->_U123._S136.send_4417 = 1;
		  }
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
      }
      if ((FP->Chain->_U123._S136.send_4417 == 3))
      {
      }
      else
      if ((FP->Chain->_U123._S136.send_4417 == 1))
      {
      }
      else
      if ((FP->Chain->_U123._S136.status_4424 != 0))
      {
	{
	  // Error: send NackEnd
	  FP->Chain->_U123._S136.send_4417 = 2;
	}
      }
      else
      if (true)
      {
      }
      else
      {
	SETERR(MSG_IF);
      }
    }
  }
}
static void P_FileServer_4586 (tSF_P_FileServer_4586 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	{
	  static INT TMP[6] = {-1,0,3,4,15,1};
	  FP->ReadFlash6Seq_4059 = (INT*)TMP;
	}
	{
	  static INT TMP[6] = {0,0,2,4,10,1};
	  FP->EraseFlash6Seq_4061 = (INT*)TMP;
	}
	{
	  static INT TMP[6] = {0,0,2,4,12,1};
	  FP->EraseFlashxSeq_4063 = (INT*)TMP;
	}
	{
	  static INT TMP[10] = {0,0,2,4,11,13,10,14,16,1};
	  FP->ProgramFlash6Seq_4065 = (INT*)TMP;
	}
	{
	  static INT TMP[7] = {0,0,2,4,12,14,1};
	  FP->ProgramFlashxSeq_4067 = (INT*)TMP;
	}
	{
	  static INT TMP[6] = {0,0,2,4,14,1};
	  FP->PatchFlashxSeq_4069 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {-1,0,3};
	  FP->ReadSectorDataP1Seq_4071 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {-1,1};
	  FP->ReadSectorDataP3Seq_4073 = (INT*)TMP;
	}
	BREAKPOINT_F(17); // Init
	{
	  INT isIt_4376;
	  {
	    // --- C embedded in occam, begin ---
	    // ---
	    isIt_4376 = CodeIsRunningInRam();
	    // ---
	    // --- C embedded in occam, end ---
	    FP->codeIsRunningInRam_4330 = BOOLINT(isIt_4376);
	  }
	}
	// --- C embedded in occam, begin ---
	// ---
	FP->_U123._S125.survivalFromLastRun_4377 = Get_survivalFromLastRun();
	// ---
	// --- C embedded in occam, end ---
	if (!(FP->_U123._S125.survivalFromLastRun_4377 == -267410086)) GOTO(2);
	OUTPUT(FP->chan900o_4044,FP->Chain->Chain->Chain->NCR_RestartedInFlashCriticalPhase_1114,(3*sizeof(INT)),3);
      CASE(3):  
	FP->_U123._S125._C444.DelayFor_ms_1432=10000;
	FP->_U123._S125._C444.Chain = FP->Chain->Chain->Chain;
	CALL(P_Delay_ms_1435,&FP->_U123._S125._C444,4,"P_Delay_ms_1435");
      CASE(4):  
	GOTO(1);
      CASE(2):  
	if (!true) GOTO(5);
	GOTO(1);
      CASE(5):  
	SETERR(MSG_IF);
      CASE(1):  
	P_ResetAllSegmenting_4340(FP);
	{
	  INT i_4378;
	  for (i_4378 = 0; i_4378 != 0 + 20; i_4378++)
	  {
	    {
	      BYTE *_V52_4379;
	      _V52_4379 = NULL;
	      P_FillFCB_4123(FP,30,(INT*)((INT*)(((BYTE*)FP->fCBBank_4320)+(i_4378*(30*sizeof(INT))))),0,(BYTE*)_V52_4379,0);
	    }
	  }
	}
	{
	  INT i_4380;
	  for (i_4380 = 0; i_4380 != 0 + 20; i_4380++)
	  {
	    *((INT*)(((BYTE*)FP->addressOfFileInFlash_4321)+(i_4380*sizeof(INT)))) = -1;
	  }
	}
	if (false)
	{
	  {
	    // (C160.IOf.eFCB.maxNoOfDataBytes + 1) <> C160.LENI32.EFCB
	    SETERR(MSG_STOP);
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	FP->_U123._S126._U124._C447.IOfFile_4364=11;
	FP->_U123._S126._U124._C447.SearchFrom_4365=0;
	FP->_U123._S126._U124._C447.VerifyChecksum_I_4366=true;
	FP->_U123._S126._U124._C447.fcbFound_4367=&FP->_U123._S126.fcbFound_4381;
	FP->_U123._S126._U124._C447.Chain = FP;
	CALL(P_FindFile_512K_CodeAnywhere_4373,&FP->_U123._S126._U124._C447,6,"P_FindFile_512K_CodeAnywhere_4373");
      CASE(6):  
	if (!(FP->codeIsRunningInRam_4330 == true)) GOTO(8);
	FP->_U123._S126._U124._C448.IOfFile_4364=12;
	FP->_U123._S126._U124._C448.SearchFrom_4365=0x900000;
	FP->_U123._S126._U124._C448.VerifyChecksum_I_4366=false;
	FP->_U123._S126._U124._C448.fcbFound_4367=&FP->_U123._S126.fcbFound_4381;
	FP->_U123._S126._U124._C448.Chain = FP;
	CALL(P_FindFile_512K_CodeAnywhere_4373,&FP->_U123._S126._U124._C448,9,"P_FindFile_512K_CodeAnywhere_4373");
      CASE(9):  
	GOTO(7);
      CASE(8):  
	if (!true) GOTO(10);
	GOTO(7);
      CASE(10):  
	SETERR(MSG_IF);
      CASE(7):  
	{
	  INT fileHandle_4382;
	  {
	    P_InsertFileNameInAnFCBBank_If_4272(FP,20,(BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->NameOfFiles_1301)+(0*(20*sizeof(BYTE))))),20,30,(INT*)FP->fCBBank_4320,&fileHandle_4382);
	    if ((fileHandle_4382 == -1))
	    {
	      SETERR(MSG_STOP);
	    }
	    else
	    if (true)
	    {
	      *((INT*)(((BYTE*)FP->fCBBank_4320)+(28*sizeof(INT))+(RNGCHK(fileHandle_4382,20)*(30*sizeof(INT))))) = 5432;
	    }
	    else
	    {
	      SETERR(MSG_IF);
	    }
	  }
	}
	FP->_U123._S127.i_4383 = 0;
	GOTO(11);
      CASE(12):  
	FP->_U123._S127.FileName_4386 = (BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->NameOfFiles_1301)+(RNGCHK(*((INT*)(((BYTE*)FP->Chain->Chain->Chain->IOfHatFile_1303)+(FP->_U123._S127.i_4383*sizeof(INT)))),13)*(20*sizeof(BYTE)))));
	FP->_U123._S127.status_4385 = 0;
	{
	  INT bufferAdr_4387;
	  {
	    // --- C embedded in occam, begin ---
	    // ---
	    bufferAdr_4387 = (INT)FP->buffer_4322;
	    // ---
	    // --- C embedded in occam, end ---
	    P_ReadHatFileFromFlash_4210(FP,20,(BYTE*)FP->_U123._S127.FileName_4386,bufferAdr_4387,1388,&FP->_U123._S127.noOfInt32OfFCBAndData_4384,&FP->_U123._S127.status_4385);
	  }
	}
	if ((FP->_U123._S127.status_4385 != 0))
	{
	}
	else
	if (true)
	{
	  {
	    INT fileHandleInBuffer_4388;
	    INT thisFCB_4389[1][30];
	    {
	      CHK(30==30,MSG_ASM);
	      ASSIGN(((INT*)(((BYTE*)thisFCB_4389)+(0*(30*sizeof(INT))))),((INT*)(((BYTE*)FP->buffer_4322)+((0)*sizeof(INT)))),(30*sizeof(INT)));
	      fileHandleInBuffer_4388 = F_FindFileInAnFCBBank_4237(FP,20,(BYTE*)FP->_U123._S127.FileName_4386,1,30,(INT*)thisFCB_4389);
	      if ((fileHandleInBuffer_4388 == -1))
	      {
		FP->_U123._S127.status_4385 = 0x2000000;
	      }
	      else
	      if (true)
	      {
		{
		  INT fileHandle_4390;
		  {
		    P_InsertFileNameInAnFCBBank_If_4272(FP,20,(BYTE*)FP->_U123._S127.FileName_4386,20,30,(INT*)FP->fCBBank_4320,&fileHandle_4390);
		    if ((fileHandle_4390 == -1))
		    {
		      SETERR(MSG_STOP);
		    }
		    else
		    if (true)
		    {
		      ASSIGN(((INT*)(((BYTE*)FP->fCBBank_4320)+(RNGCHK(fileHandle_4390,20)*(30*sizeof(INT))))),((INT*)(((BYTE*)thisFCB_4389)+(0*(30*sizeof(INT))))),(30*sizeof(INT)));
		    }
		    else
		    {
		      SETERR(MSG_IF);
		    }
		  }
		}
	      }
	      else
	      {
		SETERR(MSG_IF);
	      }
	    }
	  }
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (!(FP->_U123._S127.status_4385 == 0x4000000)) GOTO(14);
	GOTO(13);
      CASE(14):  
	if (!(FP->_U123._S127.status_4385 != 0)) GOTO(15);
	FP->_U123._S127._U125._C452.chan900oLocal_4286=FP->chan900o_4044;
	FP->_U123._S127._U125._C452.NCR_4287= (INT*)FP->Chain->Chain->Chain->NCR_CannotFindFile_1170;
	FP->_U123._S127._U125._C452.IOfFile_4288=*((INT*)(((BYTE*)FP->Chain->Chain->Chain->IOfHatFile_1303)+(FP->_U123._S127.i_4383*sizeof(INT))));
	FP->_U123._S127._U125._C452.Chain = FP;
	CALL(P_Report_FileError_4290,&FP->_U123._S127._U125._C452,16,"P_Report_FileError_4290");
      CASE(16):  
	GOTO(13);
      CASE(15):  
	if (!true) GOTO(17);
	GOTO(13);
      CASE(17):  
	SETERR(MSG_IF);
      CASE(13):  
	FP->_U123._S127.i_4383++;
      CASE(11):  
	if (FP->_U123._S127.i_4383 != (0+5)) GOTO(12);
	{
	  INT i_4391;
	  for (i_4391 = 0; i_4391 != 0 + 13; i_4391++)
	  {
	    *((BOOL*)(((BYTE*)FP->fileDataApproved_byServer_4331)+(i_4391*sizeof(BOOL)))) = true;
	  }
	}
	FP->_U123._C453.Clients_4345_Dim0=FP->ServeTheseClientsAtInit_4030_Dim0;
	FP->_U123._C453.Clients_4345= (INT*)FP->ServeTheseClientsAtInit_4030;
	FP->_U123._C453.Chain = FP;
	CALL(P_UpdateInitFilesOfClient_4361,&FP->_U123._C453,18,"P_UpdateInitFilesOfClient_4361");
      CASE(18):  
	FP->_U123._C454.Chain = FP;
	CALL(P_VerifyFilesStatus_reportIfAllOk_4375,&FP->_U123._C454,19,"P_VerifyFilesStatus_reportIfAllOk_4375");
      CASE(19):  
	{
	  if (false)
	  {
	    {
	      BOOL ok_4393;
	      {
		ok_4393 = true; 
		P_RemoveFileFromAnFCBBank_4285(FP,20,(BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->NameOfFiles_1301)+(3*(20*sizeof(BYTE))))),20,30,(INT*)FP->fCBBank_4320,&ok_4393);
		if (ok_4393)
		{
		}
		else
		if (true)
		{
		  SETERR(MSG_STOP);
		}
		else
		{
		  SETERR(MSG_IF);
		}
	      }
	    }
	  }
	  else
	  if (true)
	  {
	  }
	  else
	  {
	    SETERR(MSG_IF);
	  }
	}
	P_FillFCBAndKnownInto_I_Buffer_dat_4344(FP);
	FP->sendInternalLogOff_4329 = false;
	GOTO(20);
      CASE(21):  
	ALT();
	ENBC(true,FP->chan400i_4031);
	ENBS(FP->sendInternalLogOff_4329);
	ENBC(true,FP->chan380i_4042);
	ENBC(true,FP->chan081i_4037);
	ALTWT(22);
      CASE(22):  
	{
	  BOOL TMP = false;
	  TMP |= DISC(23,true,FP->chan400i_4031);
	  TMP |= DISS(24,FP->sendInternalLogOff_4329);
	  TMP |= DISC(25,true,FP->chan380i_4042);
	  TMP |= DISC(26,true,FP->chan081i_4037);
	}
	ALTEND();
      CASE(23):  
	INPUT1(FP->chan400i_4031,&FP->_U123._S128.somebodyIsLoggingOn_4394,28);
      CASE(28):  
	{
	  BREAKPOINT_F(17); // Input on chan400i
	  P_FillFCBAndKnownInto_I_Buffer_dat_4344(FP);
	  P_ResetAllSegmenting_4340(FP);
	}
	GOTO(27);
      CASE(24):  
	FP->_Header.Temp.VBOOL = true;
	OUTPUT1(FP->chan100o_4043,&FP->_Header.Temp.VBOOL,29);
      CASE(29):  
	FP->sendInternalLogOff_4329 = false;
	GOTO(27);
      CASE(25):  
	INPUT4(FP->chan380i_4042,&FP->_U123._S129.noOfInt32OfEnvelope_4396,30);
      CASE(30):  
	CHK(FP->_U123._S129.noOfInt32OfEnvelope_4396<=1363,MSG_CITL);
	INPUT(FP->chan380i_4042,FP->_U123._S129.envelope_4395,(FP->_U123._S129.noOfInt32OfEnvelope_4396)*(sizeof(INT)),31);
      CASE(31):  
	BREAKPOINT_F(17); // Input on chan380i
	P_GetProtocolType_1914(FP->Chain->Chain->Chain,1363,(INT*)FP->_U123._S129.envelope_4395,&FP->_U123._S129.protType_4397);
	P_GetTheProtocolCmd_1926(FP->Chain->Chain->Chain,1363,(INT*)FP->_U123._S129.envelope_4395,&FP->_U123._S129.protCmd_4398);
	if (!(FP->_U123._S129.protType_4397 != 5)) GOTO(33);
	{
	  // Not PFile
	  SETERR(MSG_STOP);
	}
	GOTO(32);
      CASE(33):  
	if (!(FP->_U123._S129.protCmd_4398 == 3)) GOTO(34);
	BREAKPOINT_F(17); // PFileWrThisPacketAsFile.NoReply
	FP->_U123._S129._U127._S130.status_4400 = 0;
	{
	  BYTE *FileName_4402;
	  FileName_4402 = (BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->NameOfFiles_1301)+(RNGCHK(*((INT*)(((BYTE*)FP->_U123._S129.envelope_4395)+(3*sizeof(INT)))),13)*(20*sizeof(BYTE)))));
	  {
	    FP->_U123._S129._U127._S130.fileHandle_4399 = F_FindFileInAnFCBBank_4237(FP,20,(BYTE*)FileName_4402,20,30,(INT*)FP->fCBBank_4320);
	    FP->_U123._S129._U127._S130.iOfFileName_4401 = F_FindTextFromArray_815(FP->Chain->Chain->Chain,20,(BYTE*)FileName_4402,13,20,(BYTE*)FP->Chain->Chain->Chain->NameOfFiles_1301);
	  }
	}
	if (!(FP->_U123._S129._U127._S130.fileHandle_4399 == -1)) GOTO(36);
	{
	  // No file in fCBBank
	  FP->_U123._S129._U127._S130.status_4400 = 256;
	}
	GOTO(35);
      CASE(36):  
	if (!(FP->_U123._S129._U127._S130.iOfFileName_4401 == -1)) GOTO(37);
	{
	  // File name not known
	  FP->_U123._S129._U127._S130.status_4400 = 257;
	}
	GOTO(35);
      CASE(37):  
	if (!true) GOTO(38);
	FP->_U123._S129._U127._S130._U128._S131.len_4404 = *((INT*)(((BYTE*)FP->_U123._S129.envelope_4395)+(4*sizeof(INT))));
	CHK(FP->_U123._S129._U127._S130._U128._S131.len_4404==FP->_U123._S129._U127._S130._U128._S131.len_4404,MSG_ASM);
	ASSIGN(((INT*)(((BYTE*)FP->buffer_4322)+((RNGCHKUB(0,FP->_U123._S129._U127._S130._U128._S131.len_4404,1388),0)*sizeof(INT)))),((INT*)(((BYTE*)FP->_U123._S129.envelope_4395)+((RNGCHKUB(5,FP->_U123._S129._U127._S130._U128._S131.len_4404,1363),5)*sizeof(INT)))),(FP->_U123._S129._U127._S130._U128._S131.len_4404*sizeof(INT)));
	*((INT*)(((BYTE*)FP->fCBBank_4320)+(28*sizeof(INT))+(RNGCHK(FP->_U123._S129._U127._S130.fileHandle_4399,20)*(30*sizeof(INT))))) = (FP->_U123._S129._U127._S130._U128._S131.len_4404 * 4);
	P_InsertArrayInFront_4135(30,(INT*)((INT*)(((BYTE*)FP->fCBBank_4320)+(RNGCHK(FP->_U123._S129._U127._S130.fileHandle_4399,20)*(30*sizeof(INT))))),FP->_U123._S129._U127._S130._U128._S131.len_4404,1388,(INT*)FP->buffer_4322,&FP->_U123._S129._U127._S130._U128._S131.noOfInt32OfFileNow_4403);
	if (!(FP->_U123._S129._U127._S130._U128._S131.noOfInt32OfFileNow_4403 == 0)) GOTO(40);
	{
	  // Buffer seems to be too small
	  FP->_U123._S129._U127._S130.status_4400 = 258;
	}
	GOTO(39);
      CASE(40):  
	if (!true) GOTO(41);
	FP->_U123._S129._U127._S130.status_4400 = 0;
	{
	  INT *timeSince1601_4406;
	  timeSince1601_4406 = (INT*)((INT*)(((BYTE*)FP->buffer_4322)+((26)*sizeof(INT))));
	  CHK(2 == 2,MSG_AIM);
	  {
	    ASSIGN(FP->_U123._S129._U127._S130._U128._S131._U129._S132.oldTimeSince1601_4405,timeSince1601_4406,(2*sizeof(INT)));
	    {
	      BOOL noOverflow_4407;
	      P_Add64To64_1447(FP->Chain->Chain->Chain,(INT*)FP->Chain->Chain->Chain->T1601_1Sec_100ns_1440,(INT*)timeSince1601_4406,&noOverflow_4407);
	    }
	    ASSIGN(((INT*)(((BYTE*)FP->fCBBank_4320)+((26)*sizeof(INT))+(RNGCHK(FP->_U123._S129._U127._S130.fileHandle_4399,20)*(30*sizeof(INT))))),timeSince1601_4406,(2*sizeof(INT)));
	  }
	}
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.CommandSequence_4150_Dim0=10;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.CommandSequence_4150= (INT*)FP->ProgramFlash6Seq_4065;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.buffer_4151_Dim0=FP->_U123._S129._U127._S130._U128._S131.noOfInt32OfFileNow_4403;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.buffer_4151= (INT*)((INT*)(((BYTE*)FP->buffer_4322)+((RNGCHKUB(0,FP->_U123._S129._U127._S130._U128._S131.noOfInt32OfFileNow_4403,1388),0)*sizeof(INT))));
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.AddressType_4152=1;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.Address_4153=FP->_U123._S129._U127._S130.iOfFileName_4401;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.status_4154=&FP->_U123._S129._U127._S130.status_4400;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465.Chain = FP;
	CALL(P_FlashCommandInterpreter_4174,&FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._C465,42,"P_FlashCommandInterpreter_4174");
      CASE(42):  
	if (!(FP->_U123._S129._U127._S130.status_4400 != 0)) GOTO(44);
	// Flash error or protection on
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133.FileName_4410 = (BYTE*)((BYTE*)(((BYTE*)FP->Chain->Chain->Chain->NameOfFiles_1301)+(RNGCHK(*((INT*)(((BYTE*)FP->_U123._S129.envelope_4395)+(3*sizeof(INT)))),13)*(20*sizeof(BYTE)))));
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133.readStatus_4409 = 0;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466.RequestedNameOfFile_4181_Dim0=20;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466.RequestedNameOfFile_4181= (BYTE*)FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133.FileName_4410;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466.buffer_4182_Dim0=1388;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466.buffer_4182= (INT*)FP->buffer_4322;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466.noOfInt32OfFCBAndData_4183=&FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133.noOfInt32OfFCBAndData_4408;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466.status_4184=&FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133.readStatus_4409;
	FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466.Chain = FP;
	CALL(P_ReadFileFromFlash_4201,&FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133._C466,45,"P_ReadFileFromFlash_4201");
      CASE(45):  
	if ((FP->_U123._S129._U127._S130._U128._S131._U129._S132._U130._S133.readStatus_4409 != 0))
	{
	  FP->_U123._S129._U127._S130.status_4400 = 259;
	}
	else
	if (true)
	{
	  FP->_U123._S129._U127._S130.status_4400 = 260;
	}
	else
	{
	  SETERR(MSG_IF);
	}
	{
	  INT *timeSince1601_4411;
	  timeSince1601_4411 = (INT*)((INT*)(((BYTE*)FP->buffer_4322)+((26)*sizeof(INT))));
	  CHK(2 == 2,MSG_AIM);
	  {
	    ASSIGN(timeSince1601_4411,FP->_U123._S129._U127._S130._U128._S131._U129._S132.oldTimeSince1601_4405,(2*sizeof(INT)));
	    ASSIGN(((INT*)(((BYTE*)FP->fCBBank_4320)+((26)*sizeof(INT))+(RNGCHK(FP->_U123._S129._U127._S130.fileHandle_4399,20)*(30*sizeof(INT))))),timeSince1601_4411,(2*sizeof(INT)));
	  }
	}
	GOTO(43);
      CASE(44):  
	if (!true) GOTO(46);
	GOTO(43);
      CASE(46):  
	SETERR(MSG_IF);
      CASE(43):  
	GOTO(39);
      CASE(41):  
	SETERR(MSG_IF);
      CASE(39):  
	GOTO(35);
      CASE(38):  
	SETERR(MSG_IF);
      CASE(35):  
	if (!(FP->_U123._S129._U127._S130.status_4400 != 0)) GOTO(48);
	FP->_U123._S129._U127._S130._U128._C469.chan900oLocal_4286=FP->chan900o_4044;
	FP->_U123._S129._U127._S130._U128._C469.NCR_4287= (INT*)FP->Chain->Chain->Chain->NCR_CannotModifyFile_1176;
	FP->_U123._S129._U127._S130._U128._C469.IOfFile_4288=FP->_U123._S129._U127._S130.iOfFileName_4401;
	FP->_U123._S129._U127._S130._U128._C469.Chain = FP;
	CALL(P_Report_FileError_4290,&FP->_U123._S129._U127._S130._U128._C469,49,"P_Report_FileError_4290");
      CASE(49):  
	GOTO(47);
      CASE(48):  
	if (!(FP->_U123._S129._U127._S130.iOfFileName_4401 != -1)) GOTO(50);
	BREAKPOINT_F(17);
	// Now "UpdateInitFilesOfClient" implicitly:
	*((INT*)(((BYTE*)FP->_U123._S129._U127._S130._U128._S134.iOfUser_4412)+(0*sizeof(INT)))) = *((INT*)(((BYTE*)FP->Chain->Chain->Chain->UsersOfFiles_1310)+(RNGCHK(FP->_U123._S129._U127._S130.iOfFileName_4401,13)*sizeof(INT))));
	FP->_U123._S129._U127._S130._U128._S134._U131._C467.Clients_4345_Dim0=1;
	FP->_U123._S129._U127._S130._U128._S134._U131._C467.Clients_4345= (INT*)FP->_U123._S129._U127._S130._U128._S134.iOfUser_4412;
	FP->_U123._S129._U127._S130._U128._S134._U131._C467.Chain = FP;
	CALL(P_UpdateInitFilesOfClient_4361,&FP->_U123._S129._U127._S130._U128._S134._U131._C467,51,"P_UpdateInitFilesOfClient_4361");
      CASE(51):  
	FP->_U123._S129._U127._S130._U128._S134._U131._C468.Chain = FP;
	CALL(P_VerifyFilesStatus_reportIfAllOk_4375,&FP->_U123._S129._U127._S130._U128._S134._U131._C468,52,"P_VerifyFilesStatus_reportIfAllOk_4375");
      CASE(52):  
	GOTO(47);
      CASE(50):  
	if (!true) GOTO(53);
	GOTO(47);
      CASE(53):  
	SETERR(MSG_IF);
      CASE(47):  
	GOTO(32);
      CASE(34):  
	if (!(FP->_U123._S129.protCmd_4398 == 4)) GOTO(54);
	BREAKPOINT_F(17); // PFileUpdateMeWithMyFiles.NoReply
	FP->_U123._S129._U127._S135._V53_4413[0] = *((INT*)(((BYTE*)FP->_U123._S129.envelope_4395)+(3*sizeof(INT))));
	FP->_U123._S129._U127._S135._C461.Clients_4345_Dim0=1;
	FP->_U123._S129._U127._S135._C461.Clients_4345= (INT*)FP->_U123._S129._U127._S135._V53_4413;
	FP->_U123._S129._U127._S135._C461.Chain = FP;
	CALL(P_UpdateInitFilesOfClient_4361,&FP->_U123._S129._U127._S135._C461,55,"P_UpdateInitFilesOfClient_4361");
      CASE(55):  
	FP->_U123._S129._U127._C462.Chain = FP;
	CALL(P_VerifyFilesStatus_reportIfAllOk_4375,&FP->_U123._S129._U127._C462,56,"P_VerifyFilesStatus_reportIfAllOk_4375");
      CASE(56):  
	GOTO(32);
      CASE(54):  
	if (!true) GOTO(57);
	{
	  // Not PFile nor PFileWrThisPacketAsFile.NoReply
	  SETERR(MSG_STOP);
	}
	GOTO(32);
      CASE(57):  
	SETERR(MSG_IF);
      CASE(32):  
	FP->sendInternalLogOff_4329 = true;
	GOTO(27);
      CASE(26):  
	INPUT4(FP->chan081i_4037,&FP->_U123._S136.noOfInt32OfEnvelope_4415,58);
      CASE(58):  
	CHK(FP->_U123._S136.noOfInt32OfEnvelope_4415<=291,MSG_CITL);
	INPUT(FP->chan081i_4037,FP->_U123._S136.envelope_4414,(FP->_U123._S136.noOfInt32OfEnvelope_4415)*(sizeof(INT)),59);
      CASE(59):  
	BREAKPOINT_F(17); // From MessageRouter
	P_GetProtocolType_1914(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,&FP->_U123._S136.protType_4422);
	P_GetTheProtocolCmd_1926(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,&FP->_U123._S136.protCmd_4423);
	FP->_U123._S136.status_4424 = 0;
	FP->_U123._S136.send_4417 = 0;
	if (!(FP->_U123._S136.protType_4422 != 2)) GOTO(61);
	FP->_U123._S136._U132._C522.chan900o_1516=FP->chan900o_4044;
	FP->_U123._S136._U132._C522.NodetypeClassReason_1517= (INT*)FP->Chain->Chain->Chain->NCR_HFileServer_NotAlbum_1232;
	FP->_U123._S136._U132._C522.Chain = FP->Chain->Chain->Chain;
	CALL(P_ErrorNoReturn_1522,&FP->_U123._S136._U132._C522,62,"P_ErrorNoReturn_1522");
      CASE(62):  
	GOTO(60);
      CASE(61):  
	if (!(FP->_U123._S136.protCmd_4423 == 160)) GOTO(63);
	FP->_U123._S136._U132._C521.Chain = FP;
	CALL(P_P_RdDeviceTypesReNack_4436,&FP->_U123._S136._U132._C521,64,"P_P_RdDeviceTypesReNack_4436");
      CASE(64):  
	GOTO(60);
      CASE(63):  
	if (!((FP->_U123._S136.protCmd_4423 == 164) || (FP->_U123._S136.protCmd_4423 == 166))) GOTO(65);
	P_P_RdFileFCBReNack_4446(FP);
	GOTO(60);
      CASE(65):  
	if (!(FP->_U123._S136.protCmd_4423 == 167)) GOTO(66);
	// --- C embedded in occam, begin ---
	// ---
	FP->_U123._S136._U132._S137.bufferAdr_4582 = (INT)FP->buffer_4322;
	// ---
	// --- C embedded in occam, end ---
	FP->_U123._S136._U132._S137._C519.BufferAdr_4447=FP->_U123._S136._U132._S137.bufferAdr_4582;
	FP->_U123._S136._U132._S137._C519.Chain = FP;
	CALL(P_P_RdFileDataReNack_4465,&FP->_U123._S136._U132._S137._C519,67,"P_P_RdFileDataReNack_4465");
      CASE(67):  
	GOTO(60);
      CASE(66):  
	if (!(FP->_U123._S136.protCmd_4423 == 169)) GOTO(68);
	FP->_U123._S136._U132._C518.Chain = FP;
	CALL(P_P_WrFileDataAckNack_4514,&FP->_U123._S136._U132._C518,69,"P_P_WrFileDataAckNack_4514");
      CASE(69):  
	GOTO(60);
      CASE(68):  
	if (!(FP->_U123._S136.protCmd_4423 == 162)) GOTO(70);
	P_P_RdFileNamesReNack_4529(FP);
	GOTO(60);
      CASE(70):  
	if (!(FP->_U123._S136.protCmd_4423 == 170)) GOTO(71);
	FP->_U123._S136._U132._C516.Chain = FP;
	CALL(P_P_CloneOrWrFileAckNack_4560,&FP->_U123._S136._U132._C516,72,"P_P_CloneOrWrFileAckNack_4560");
      CASE(72):  
	GOTO(60);
      CASE(71):  
	if (!((FP->_U123._S136.protCmd_4423 == 120) || (FP->_U123._S136.protCmd_4423 == 122))) GOTO(73);
	P_P_Wr_RdDataOfStructReNack_4581(FP);
	GOTO(60);
      CASE(73):  
	if (!true) GOTO(74);
	FP->_U123._S136.send_4417 = 2;
	GOTO(60);
      CASE(74):  
	SETERR(MSG_IF);
      CASE(60):  
	if ((FP->_U123._S136.send_4417 == 3))
	{
	  {
	    P_SetProtocolType_1917(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,2);
	    P_SetNoOfInt32OfTheProtocol_1923(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,FP->_U123._S136.noOfInt32OfTheProtocol_4416);
	  }
	}
	else
	if ((FP->_U123._S136.send_4417 == 2))
	{
	  {
	    {
	      INT *cmdInReplyOut_4583;
	      BYTE *_V61_4584;
	      cmdInReplyOut_4583 = (INT*)((INT*)(((BYTE*)FP->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
	      CHK(289 == 289,MSG_AIM);
	      _V61_4584 = NULL;
	      P_InsertNackEndUnpacked_1884(FP->Chain->Chain->Chain,(INT*)FP->Chain->Chain->Chain->NCR_FileServerNackEnd_1078,0,(BYTE*)_V61_4584,FP->_U123._S136.status_4424,289,(INT*)cmdInReplyOut_4583,&FP->_U123._S136.noOfInt32OfTheProtocol_4416);
	    }
	    P_SetProtocolType_1917(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,2);
	    P_SetNoOfInt32OfTheProtocol_1923(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,FP->_U123._S136.noOfInt32OfTheProtocol_4416);
	    P_ResetAllSegmenting_4340(FP);
	  }
	}
	else
	if ((FP->_U123._S136.send_4417 == 1))
	{
	  {
	    {
	      INT *cmdInReplyOut_4585;
	      cmdInReplyOut_4585 = (INT*)((INT*)(((BYTE*)FP->_U123._S136.envelope_4414)+((2)*sizeof(INT))));
	      CHK(289 == 289,MSG_AIM);
	      P_InsertAckEndUnpacked_1888(FP->Chain->Chain->Chain,289,(INT*)cmdInReplyOut_4585,&FP->_U123._S136.noOfInt32OfTheProtocol_4416);
	    }
	    P_SetProtocolType_1917(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,2);
	    P_SetNoOfInt32OfTheProtocol_1923(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414,FP->_U123._S136.noOfInt32OfTheProtocol_4416);
	  }
	}
	else
	if (true)
	{
	}
	else
	{
	  SETERR(MSG_IF);
	}
	if (!(FP->_U123._S136.send_4417 == 0)) GOTO(76);
	{
	  // Programming error, "send" value is illegal
	  SETERR(MSG_STOP);
	}
	GOTO(75);
      CASE(76):  
	if (!(FP->_U123._S136.send_4417 != 0)) GOTO(77);
	FP->_Header.Temp.VINT = F_EnvelopeLen_1936(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414);
	OUTPUT4(FP->chan080o_4038,&FP->_Header.Temp.VINT,78);
      CASE(78):  
	OUTPUT(FP->chan080o_4038,FP->_U123._S136.envelope_4414,(F_EnvelopeLen_1936(FP->Chain->Chain->Chain,291,(INT*)FP->_U123._S136.envelope_4414))*(sizeof(INT)),79);
      CASE(79):  
	GOTO(75);
      CASE(77):  
	SETERR(MSG_IF);
      CASE(75):  
	GOTO(27);
      CASE(27):  
      CASE(20):  
	if (true)
	{
	  GOTO(21);
	}
	RETURN();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4589 (tSF_P_4589 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	{
	  static BOOL TMP[4] = {true,true,true,true};
	  FP->AllowFileAddressSentTo_4029 = (BOOL*)TMP;
	}
	FP->_V63_4587[0] = FP->Chain->Chain->chan150_3192;
	FP->_V63_4587[1] = FP->Chain->Chain->chan160_3196;
	FP->_V63_4587[2] = FP->Chain->Chain->chan170_3200;
	FP->_V63_4587[3] = FP->Chain->Chain->chan140_3188;
	FP->_V62_4588[0] = FP->Chain->Chain->chan151_3194;
	FP->_V62_4588[1] = FP->Chain->Chain->chan161_3198;
	FP->_V62_4588[2] = FP->Chain->Chain->chan171_3202;
	FP->_V62_4588[3] = FP->Chain->Chain->chan141_3190;
	FP->_C532.ServeTheseClientsAtInit_4030_Dim0=4;
	FP->_C532.ServeTheseClientsAtInit_4030= (INT*)FP->Chain->Chain->ServeTheseClientsAtInit_m_gl100_1307;
	FP->_C532.chan400i_4031=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan400Array_3278)+(1*sizeof(CHAN *))));
	FP->_C532.chan240i_4032=FP->Chain->Chain->chan240_3226;
	FP->_C532.chan241o_4033=FP->Chain->Chain->chan241_3228;
	FP->_C532.AllowSendOn_fileAddressOut_4034= (BOOL*)FP->AllowFileAddressSentTo_4029;
	FP->_C532.fileAddressAck_4035_Dim0=4;
	FP->_C532.fileAddressAck_4035= (CHAN**)FP->_V63_4587;
	FP->_C532.fileAddressOut_4036_Dim0=4;
	FP->_C532.fileAddressOut_4036= (CHAN**)FP->_V62_4588;
	FP->_C532.chan081i_4037=FP->Chain->Chain->chan081_3178;
	FP->_C532.chan080o_4038=FP->Chain->Chain->chan080_3176;
	FP->_C532.AllowSendOn_chan271o_4039=true;
	FP->_C532.chan270i_4040=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan270Array_3274)+(1*sizeof(CHAN *))));
	FP->_C532.chan271o_4041=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan271Array_3276)+(1*sizeof(CHAN *))));
	FP->_C532.chan380i_4042=FP->Chain->Chain->chan380_3258;
	FP->_C532.chan100o_4043=FP->Chain->Chain->chan100_3184;
	FP->_C532.chan900o_4044=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(7*sizeof(CHAN *))));
	FP->_C532.Chain = FP;
	CALL(P_FileServer_4586,&FP->_C532,1,"P_FileServer_4586");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4591 (tSF_P_4591 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_V64_4590[0] = FP->Chain->Chain->chan340_3250;
	FP->_V64_4590[1] = FP->Chain->Chain->chan350_3252;
	FP->_V64_4590[2] = FP->Chain->Chain->chan360_3254;
	FP->_V64_4590[3] = FP->Chain->Chain->chan370_3256;
	FP->_C534.inputs_2309= (CHAN**)FP->_V64_4590;
	FP->_C534.output_2310=FP->Chain->Chain->chan380_3258;
	FP->_C534.chan261i_2311=FP->Chain->Chain->chan261_3236;
	FP->_C534.chan260o_2312=FP->Chain->Chain->chan260_3234;
	FP->_C534.Chain = FP->Chain->Chain;
	CALL(P_OverWrBuff_FileServer_2339,&FP->_C534,1,"P_OverWrBuff_FileServer_2339");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4592 (tSF_P_4592 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C536.chan151i_2482=FP->Chain->Chain->chan151_3194;
	FP->_C536.chan150o_2483=FP->Chain->Chain->chan150_3192;
	FP->_C536.chan211i_2484=FP->Chain->Chain->chan211_3218;
	FP->_C536.chan210o_2485=FP->Chain->Chain->chan210_3216;
	FP->_C536.chan181i_2486=FP->Chain->Chain->chan181_3206;
	FP->_C536.chan180o_2487=FP->Chain->Chain->chan180_3204;
	FP->_C536.chan320i_2488=FP->Chain->Chain->chan320_3246;
	FP->_C536.chan340o_2489=FP->Chain->Chain->chan340_3250;
	FP->_C536.chan900oFather_2490=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(9*sizeof(CHAN *))));
	FP->_C536.Chain = FP->Chain->Chain;
	CALL(P_AlarmServerFather_2532,&FP->_C536,1,"P_AlarmServerFather_2532");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4593 (tSF_P_4593 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C538.chan161i_2533=FP->Chain->Chain->chan161_3198;
	FP->_C538.chan160o_2534=FP->Chain->Chain->chan160_3196;
	FP->_C538.chan220o_2535=FP->Chain->Chain->chan220_3220;
	FP->_C538.chan191i_2536=FP->Chain->Chain->chan191_3210;
	FP->_C538.chan190o_2537=FP->Chain->Chain->chan190_3208;
	FP->_C538.chan330i_2538=FP->Chain->Chain->chan330_3248;
	FP->_C538.chan350o_2539=FP->Chain->Chain->chan350_3252;
	FP->_C538.chan900o_2540=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(10*sizeof(CHAN *))));
	FP->_C538.Chain = FP->Chain->Chain;
	CALL(P_VolumeServer_2569,&FP->_C538,1,"P_VolumeServer_2569");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4594 (tSF_P_4594 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C540.AllowBoot1_2702=false;
	FP->_C540.chan051i_2703=FP->Chain->Chain->chan051_3166;
	FP->_C540.chan050o_2704=FP->Chain->Chain->chan050_3164;
	FP->_C540.chan241i_2705=FP->Chain->Chain->chan241_3228;
	FP->_C540.chan240o_2706=FP->Chain->Chain->chan240_3226;
	FP->_C540.chan900o_2707=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(11*sizeof(CHAN *))));
	FP->_C540.Chain = FP->Chain->Chain;
	CALL(P_FlashDriverFather_3016,&FP->_C540,1,"P_FlashDriverFather_3016");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4595 (tSF_P_4595 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C542.chan900Arrayo_3139=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(13*sizeof(CHAN *))));
	FP->_C542.Chain = FP->Chain->Chain;
	CALL(P_TestOccamVsCInconcistency_3146,&FP->_C542,1,"P_TestOccamVsCInconcistency_3146");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4596 (tSF_P_4596 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C544.CrashIfError_1950=false;
	FP->_C544.chan900o_1951=*((CHAN**)(((BYTE*)FP->Chain->Chain->chan900Array_3280)+(14*sizeof(CHAN *))));
	FP->_C544.Chain = FP->Chain->Chain;
	CALL(P_CodeCksumTst_1953,&FP->_C544,1,"P_CodeCksumTst_1953");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4597 (tSF_P_4597 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C546.chanIn_1986_Dim0=16;
	FP->_C546.chanIn_1986= (CHAN**)FP->Chain->Chain->chan900Array_3280;
	FP->_C546.chanOut_1987=FP->Chain->Chain->chan910_3266;
	FP->_C546.Chain = FP->Chain->Chain;
	CALL(P_ExceptionDemux_1990,&FP->_C546,1,"P_ExceptionDemux_1990");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4600 (tSF_P_4600 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C548.bufferIn_2282_Dim0=3;
	FP->_C548.bufferIn_2282= (INT*)FP->bufferIn_4598;
	FP->_C548.bufferOut_2283_Dim0=3;
	FP->_C548.bufferOut_2283= (INT*)FP->bufferOut_4599;
	FP->_C548.in_2284=FP->Chain->Chain->chan910_3266;
	FP->_C548.out_2285=FP->Chain->Chain->chan920_3268;
	FP->_C548.Chain = FP->Chain->Chain;
	CALL(P_OverWrBuff_ExceptionHandler_2308,&FP->_C548,1,"P_OverWrBuff_ExceptionHandler_2308");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4601 (tSF_P_4601 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C550.chan300i_1962_Dim0=5;
	FP->_C550.chan300i_1962= (CHAN**)FP->Chain->Chain->Chain->chan300Array_3272;
	FP->_C550.Chain = FP->Chain->Chain->Chain;
	CALL(P_ExceptionBlinker_1981,&FP->_C550,1,"P_ExceptionBlinker_1981");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4602 (tSF_P_4602 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_Header.Temp.VBYTE = 8;
	OUTPUT1(*((CHAN**)(((BYTE*)FP->Chain->Chain->Chain->chan300Array_3272)+(0*sizeof(CHAN *)))),&FP->_Header.Temp.VBYTE,1);
      CASE(1):  
	FP->_C552.chanExceptionIn_1991=FP->Chain->Chain->Chain->chan920_3268;
	FP->_C552.chanExceptionReportOut_1992=FP->Chain->Chain->Chain->chan120_3186;
	FP->_C552.chan050i_1993=FP->Chain->Chain->Chain->chan050_3164;
	FP->_C552.chan051o_1994=FP->Chain->Chain->Chain->chan051_3166;
	FP->_C552.AllowSendOn_chan271o_1995=true;
	FP->_C552.chan270Arrayi_1996=*((CHAN**)(((BYTE*)FP->Chain->Chain->Chain->chan270Array_3274)+(0*sizeof(CHAN *))));
	FP->_C552.chan271Arrayo_1997=*((CHAN**)(((BYTE*)FP->Chain->Chain->Chain->chan271Array_3276)+(0*sizeof(CHAN *))));
	FP->_C552.chan300o_1998=*((CHAN**)(((BYTE*)FP->Chain->Chain->Chain->chan300Array_3272)+(0*sizeof(CHAN *))));
	FP->_C552.chan400i_1999=*((CHAN**)(((BYTE*)FP->Chain->Chain->Chain->chan400Array_3278)+(2*sizeof(CHAN *))));
	FP->_C552.Chain = FP->Chain->Chain->Chain;
	CALL(P_ExceptionHandler_2010,&FP->_C552,2,"P_ExceptionHandler_2010");
      CASE(2):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4603 (tSF_P_4603 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	STARTP(&FP->_T62,P_4601,&FP->_C551,"P_4601",1);
	STARTP(&FP->_T63,P_4602,&FP->_C553,"P_4602",1);
	WAITP(1);
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4604 (tSF_P_4604 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C555.in_2386=FP->Chain->Chain->chan310_3242;
	FP->_C555.out_2387=FP->Chain->Chain->chan310Local_3244;
	FP->_C555.Chain = FP->Chain->Chain;
	CALL(P_OverWrBuff_INT_2407,&FP->_C555,1,"P_OverWrBuff_INT_2407");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4605 (tSF_P_4605 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	STARTP(&FP->_T47,P_3592,&FP->_C338,"P_3592",1);
	STARTP(&FP->_T48,P_3593,&FP->_C340,"P_3593",1);
	STARTP(&FP->_T51,P_4024,&FP->_C403,"P_4024",1);
	STARTP(&FP->_T52,P_4027,&FP->_C405,"P_4027",1);
	STARTP(&FP->_T53,P_4589,&FP->_C533,"P_4589",1);
	STARTP(&FP->_T54,P_4591,&FP->_C535,"P_4591",1);
	STARTP(&FP->_T55,P_4592,&FP->_C537,"P_4592",1);
	STARTP(&FP->_T56,P_4593,&FP->_C539,"P_4593",1);
	STARTP(&FP->_T57,P_4594,&FP->_C541,"P_4594",1);
	STARTP(&FP->_T58,P_4595,&FP->_C543,"P_4595",1);
	STARTP(&FP->_T59,P_4596,&FP->_C545,"P_4596",1);
	STARTP(&FP->_T60,P_4597,&FP->_C547,"P_4597",1);
	STARTP(&FP->_T61,P_4600,&FP->_C549,"P_4600",1);
	STARTP(&FP->_T64,P_4603,&FP->_C554,"P_4603",1);
	STARTP(&FP->_T65,P_4604,&FP->_C556,"P_4604",1);
	WAITP(1);
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
static void P_4606 (tSF_P_4606 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	FP->_C558.chan171i_2570=FP->Chain->chan171_3202;
	FP->_C558.chan170o_2571=FP->Chain->chan170_3200;
	FP->_C558.chan250i_2572=FP->Chain->chan250_3230;
	FP->_C558.chan251o_2573=FP->Chain->chan251_3232;
	FP->_C558.chan231i_2574=FP->Chain->chan231_3224;
	FP->_C558.chan230o_2575=FP->Chain->chan230_3222;
	FP->_C558.chan201i_2576=FP->Chain->chan201_3214;
	FP->_C558.chan200o_2577=FP->Chain->chan200_3212;
	FP->_C558.chan310i_2578=FP->Chain->chan310Local_3244;
	FP->_C558.chan320o_2579=FP->Chain->chan320_3246;
	FP->_C558.chan330o_2580=FP->Chain->chan330_3248;
	FP->_C558.chan360o_2581=FP->Chain->chan360_3254;
	FP->_C558.chan900o_2582=*((CHAN**)(((BYTE*)FP->Chain->chan900Array_3280)+(14*sizeof(CHAN *))));
	FP->_C558.Chain = FP->Chain;
	CALL(P_UllCalcFather_2701,&FP->_C558,1,"P_UllCalcFather_2701");
      CASE(1):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
void P_M_GL100_m_gl100 (tSF_P_M_GL100_m_gl100 *FP)
{
  while(true)
  {
    switch(FP->_Header.IP)
    {
      CASE(0):  
	{
	  static INT TMP[5][7] = {{0x29F010,257,8224,8,16,14,0},{0x29F040,257,42148,8,64,16,1},{0x29F040,1028,42148,8,
	     64,16,1},{0x29F040,260,42148,8,64,16,1},{0x29F040,1025,42148,8,64,16,1}};
	  FP->FlashType_70 = (INT*)TMP;
	}
	{
	  static BYTE TMP[4] = {78,111,110,101};
	  FP->C33_NONE_LOGGED_ON_STR_162 = TMP;
	}
	{
	  static INT TMP[2] = {135441,0x1A100004};
	  FP->AlbumDecodeClassReason_513 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {0x21151515,21};
	  FP->AlbumDecodeG4F32_518 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {0x21111151,0x51515115};
	  FP->AlbumDecodeAlaG4_523 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {0x21111115,0x11511511,5};
	  FP->AlbumDecodeSeqF32_529 = (INT*)TMP;
	}
	{
	  static INT TMP[5] = {1,4,3,5,10};
	  FP->IsAlbumInput_541 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {20,30};
	  FP->IsAlbumOutput_543 = (INT*)TMP;
	}
	{
	  static INT TMP[193] = {-1,20,8466,-2,20,0x2112111,0x1A100014,-10,4,0x214454,-11,20,0x214454,-30,4,33,0xA100010,-31,20,529,
	     -32,3,33,-33,20,33,0x1A100001,0x2A100010,-34,5,529,-40,4,529,-41,20,529,0x1A100016,0x2A200064,0x2A100064,
	     -70,30,8466,-71,30,8469,-72,30,135441,0x1A100004,-73,30,0x21111155,-74,30,0x21151515,21,-75,30,0x211515,
	     -76,30,0x21111151,0x51515115,-80,10,8466,-81,10,8469,-85,10,135957,-86,10,0x21111115,0x11511511,5,-110,4,
	     529,-111,20,529,0x2A1000C8,0x2A1000C8,0x2A1000C8,-112,4,135441,-113,20,135441,0x1A100014,85,0x1A100014,0x1A1000DC,0x1A100014,0x1A100014,0x1A500014,
	     34,0x2A500100,-114,4,135441,-115,20,135441,0x1A100014,85,0x1A100014,0x1A1000DC,0x1A100014,0x1A100014,0x1A500014,34,0x2A500998,-120,4,529,
	     0x1A100014,66,-121,20,529,0x1A100014,4,0x2A600100,-122,5,529,0x1A100014,4,0x2A600100,-160,4,529,-161,3,529,
	     0x1A10006C,2,0x1A40000C,0x1A40000C,-162,4,8467,-163,3,529,0x1A100054,-164,4,529,0x1A100014,-165,3,529,0x1A100014,0x244444,
	     -166,5,529,0x1A100014,0x244444,-167,4,529,0x1A100014,-168,3,529,0x1A100014,0x244444,68,0x4A600100,-169,5,529,0x1A100014,
	     0x244444,68,0x4A600100,-170,5,529,0x1A100014,0x1A100014,-171,5,529,0x1A100014,MOSTNEGINT32};
	  FP->AlbumDecode_546 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,20,0};
	  FP->NCR_AllOK_20_1066 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,20,0};
	  FP->NCR_AllOK_1068 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,1};
	  FP->NCR_YouAreNotLoggedOn_1070 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,3};
	  FP->NCR_RdXYF32CrvReNack_SeqStopped_1072 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,4};
	  FP->NCR_UllCalcIsOffended_1074 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,5};
	  FP->NCR_IllegalInputEvent_1076 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,8};
	  FP->NCR_FileServerNackEnd_1078 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,9};
	  FP->NCR_SubnetNodeBreakinNotAllowed_1080 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,11};
	  FP->NCR_CurveBreakpointRemoved_1082 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,13};
	  FP->NCR_Events_dat_OnlyVerV10Supported_1084 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,14};
	  FP->NCR_Events_dat_OnlyVerV11Supported_1086 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,15};
	  FP->NCR_Events_dat_OnlyVerV12Supported_1088 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,16};
	  FP->NCR_Events_dat_OnlyVerV13Supported_1090 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,17};
	  FP->NCR_Events_dat_OnlyVerV14Supported_1092 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,18};
	  FP->NCR_Events_dat_OnlyVerV15Supported_1094 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,19};
	  FP->NCR_Events_dat_OnlyVerV16Supported_1096 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,20};
	  FP->NCR_Events_dat_OnlyVerV17Supported_1098 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,21};
	  FP->NCR_Events_dat_OnlyVerV18Supported_1100 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,22};
	  FP->NCR_Events_dat_OnlyVerV19Supported_1102 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,23};
	  FP->NCR_Events_dat_SizeError_1104 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,24};
	  FP->NCR_Events_dat_SubscribedError_1106 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,25};
	  FP->NCR_Events_dat_DeltaError_1108 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,26};
	  FP->NCR_Events_dat_TimeoutNotInRangeError_1110 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,27};
	  FP->NCR_Events_dat_TimeoutNotSecondsError_1112 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,28};
	  FP->NCR_RestartedInFlashCriticalPhase_1114 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,29};
	  FP->NCR_I0CodeChecksumError_1116 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,30};
	  FP->NCR_I1CodeChecksumError_1118 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,31};
	  FP->NCR_I01CodeChecksumError_1120 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,32};
	  FP->NCR_CodePrgChecksumError_1122 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,33};
	  FP->NCR_AlbumInputLost1_1124 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,34};
	  FP->NCR_AlbumInputLostMore_1126 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,35};
	  FP->NCR_AlbumInputForwarded_1128 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,37};
	  FP->NCR_flash6_UsingRestored_1130 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,38};
	  FP->NCR_flash6_RestoredFrom_flash7_1132 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,39};
	  FP->NCR_flash6_Restore_error_1134 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,40};
	  FP->NCR_flash6_ChecksumError_1136 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,30,41};
	  FP->NCR_Events_dat_IsPolledError_1138 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,31,1};
	  FP->NCR_DualPortSyncError_1140 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,0};
	  FP->NCR_AllOK_Files_1142 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,1};
	  FP->NCR_HOutSplitToPackets_NotSentAll_1144 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,2};
	  FP->NCR_HMessageRouter_AlbCmdNotImpl_1146 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,3};
	  FP->NCR_ExceptionHandler_Overflow_1148 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,4};
	  FP->NCR_FlashDriver_FlashUnknown_1150 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,6};
	  FP->NCR_AlarmLimitInputEventError_1152 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,7};
	  FP->NCR_AntennaTempMissing_1154 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,8};
	  FP->NCR_AlarmLimitCannotModifyFile_1156 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,9};
	  FP->NCR_FlashDefaultingTo_AMD29F040_1158 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,10};
	  FP->NCR_FlashDefaultingError_1160 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,11};
	  FP->NCR_LogOnOffCrvServerFailed_1162 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,12};
	  FP->NCR_FileServerNoReplyFromInternal_1164 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,13};
	  FP->NCR_FlashTypeNotEstabished_1166 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,14};
	  FP->NCR_CrvServerWaiting_1168 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,50};
	  FP->NCR_CannotFindFile_1170 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,63};
	  FP->NCR_CannotFindFile_Boot1db_bin_1172 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,70};
	  FP->NCR_CannotCreateFile_1174 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,90};
	  FP->NCR_CannotModifyFile_1176 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,32,110};
	  FP->NCR_ErrorInDataOfFile_1178 = (INT*)TMP;
	}
	{
	  static INT TMP[20] = {52,53,54,55,56,72,73,74,74,76,92,93,94,95,96,112,113,114,115,116};
	  FP->R_FileErrorList_1182 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,1};
	  FP->NCR_ADConverterOrDMAError_1184 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,2};
	  FP->NCR_StatBufferLonWrError_1186 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,3};
	  FP->NCR_StatBufferDSPWrError_1188 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,4};
	  FP->NCR_StatBufferWrComAlignmentError_1190 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,5};
	  FP->NCR_StatBufferRdComAlignmentError_1192 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,6};
	  FP->NCR_StatBufferWrEventAlignmentError_1194 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,7};
	  FP->NCR_StatBufferRdEventAlignmentError_1196 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,8};
	  FP->NCR_CannotWriteCom_1198 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,9};
	  FP->NCR_CannotWriteEvent_1200 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,10};
	  FP->NCR_AlbumDecodeError_1202 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,11};
	  FP->NCR_AlbumDecodeError_2_1204 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,12};
	  FP->NCR_HInMergePackets_ParserError_1206 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,13};
	  FP->NCR_HMessageRouter_UnpackAlbumCmd_1208 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,14};
	  FP->NCR_HMessageRouter_PackAlbumReply_1210 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,15};
	  FP->NCR_HMessageRouter_LogOnTable_1212 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,16};
	  FP->NCR_HEventRouter_PackAlbumReply_1214 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,17};
	  FP->NCR_HCurveServer_NotAlbum_1216 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,18};
	  FP->NCR_HCurveServer_CmdErr_1218 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,19};
	  FP->NCR_OccamVsCInconcistency_1220 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,20};
	  FP->NCR_HOutSplitToPackets_Internal_1222 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,21};
	  FP->NCR_UllCalcError_1224 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,22};
	  FP->NCR_HRawDriver_1226 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,23};
	  FP->NCR_HUllCalc_1228 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,24};
	  FP->NCR_HEventRouter_CmdErr_1230 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,25};
	  FP->NCR_HFileServer_NotAlbum_1232 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,26};
	  FP->NCR_DualPort_AcquireAccessAtInit_1234 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,27};
	  FP->NCR_FileServer_1236 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,28};
	  FP->NCR_VolSrvError_1238 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,29};
	  FP->NCR_BroadcastLogOnOffError_1240 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,33,30};
	  FP->NCR_AlaSrvError_1242 = (INT*)TMP;
	}
	{
	  static INT TMP[3] = {4,34,0};
	  FP->NCR_Flash_Errors_1244 = (INT*)TMP;
	}
	{
	  static BYTE TMP[8] = {102,115,101,114,118,32,32,32};
	  FP->_V4_1252 = TMP;
	}
	{
	  static BYTE TMP[8] = {114,117,110,116,109,32,32,32};
	  FP->_V3_1253 = TMP;
	}
	{
	  static BYTE TMP[8] = {102,108,97,115,104,54,32,32};
	  FP->_V2_1254 = TMP;
	}
	{
	  static BYTE TMP[8] = {102,108,97,115,104,120,32,32};
	  FP->_V1_1255 = TMP;
	}
	{
	  static BYTE TMP[4][8] = {{102,115,101,114,118,32,32,32},{114,117,110,116,109,32,32,32},{102,108,
	     97,115,104,54,32,32},{102,108,97,115,104,120,32,32}};
	  FP->NamesOfDeviceTypes_1257 = (BYTE*)TMP;
	}
	{
	  static BYTE TMP[6] = {102,108,97,115,104,54};
	  FP->Flash6_1259 = TMP;
	}
	{
	  static INT TMP[3][2] = {{2,0},{0,2},{0,1}};
	  FP->MoveBetween_1267 = (INT*)TMP;
	}
	{
	  static BYTE TMP[20] = {102,115,101,114,118,58,92,73,95,66,117,102,102,101,114,46,100,97,116,32};
	  FP->_V17_1287 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,54,58,92,65,108,97,114,109,115,46,100,97,116,32,32};
	  FP->_V16_1288 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,54,58,92,84,97,110,107,46,100,97,116,32,32,32,32};
	  FP->_V15_1289 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,54,58,92,83,101,110,115,111,114,46,100,97,116,32,32};
	  FP->_V14_1290 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,54,58,92,86,111,108,117,109,101,46,100,97,116,32,32};
	  FP->_V13_1291 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,54,58,92,69,118,101,110,116,115,46,100,97,116,32,32};
	  FP->_V12_1292 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,120,58,92,65,108,97,114,109,115,46,104,97,116,32,32};
	  FP->_V11_1293 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,120,58,92,84,97,110,107,46,104,97,116,32,32,32,32};
	  FP->_V10_1294 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,120,58,92,83,101,110,115,111,114,46,104,97,116,32,32};
	  FP->_V9_1295 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,120,58,92,86,111,108,117,109,101,46,104,97,116,32,32};
	  FP->_V8_1296 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,120,58,92,69,118,101,110,116,115,46,104,97,116,32,32};
	  FP->_V7_1297 = TMP;
	}
	{
	  static BYTE TMP[20] = {102,108,97,115,104,120,58,92,112,114,103,95,48,53,49,50,46,98,105,110};
	  FP->_V6_1298 = TMP;
	}
	{
	  static BYTE TMP[20] = {114,117,110,116,109,58,92,66,111,111,116,49,100,98,95,46,98,105,110,32};
	  FP->_V5_1299 = TMP;
	}
	{
	  static BYTE TMP[13][20] = {{102,115,101,114,118,58,92,73,95,66,117,102,102,101,114,46,100,97,116,32},{102,108,97,115,104,54,58,92,65,108,97,114,109,115,46,100,97,116,32,32},{102,108,97,115,104,54,58,92,84,97,110,107,46,100,97,116,32,32,32,32},{102,108,97,115,104,54,58,92,83,101,110,115,111,114,46,100,97,116,32,32},{102,108,97,115,104,54,58,92,86,111,108,117,109,101,46,100,97,116,32,32},{102,108,97,115,104,54,58,92,69,118,101,110,116,115,46,100,97,116,32,32},{102,108,97,115,104,120,58,92,65,108,9
,114,109,115,46,104,97,116,32,32},{102,108,97,115,104,120,58,92,84,97,110,107,46,104,97,116,32,32,32,32},{102,108,97,115,104,120,58,92,83,101,110,115,111,114,46,104,97,116,32,32},{102,108,97,115,104,120,58,92,86,111,108,117,109,101,46,104,97,116,32,32},{102,108,97,115,104,120,58,92,69,118,101,110,116,115,46,104,97,116,32,32},{102,108,97,115,104,120,58,92,112,114,103,95,48,53,49,50,46,98,105,110},{114,117,110,116,109,58,92,66,111,111,116,49,100,98,95,46,98,105,110,32}};
	  FP->NameOfFiles_1301 = (BYTE*)TMP;
	}
	{
	  static INT TMP[5] = {6,7,8,9,10};
	  FP->IOfHatFile_1303 = (INT*)TMP;
	}
	{
	  static INT TMP[5] = {1,2,3,4,5};
	  FP->ReadAtInitFlash6Files_1305 = (INT*)TMP;
	}
	{
	  static INT TMP[4] = {0,2,1,3};
	  FP->ServeTheseClientsAtInit_m_gl100_1307 = (INT*)TMP;
	}
	{
	  static INT TMP[4] = {0,2,1,3};
	  FP->ServeTheseClientsAtInit_m_boot1_1308 = (INT*)TMP;
	}
	{
	  static INT TMP[13] = {-1,0,2,2,1,3,0,2,2,1,3,-1,-1};
	  FP->UsersOfFiles_1310 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {0xA0A0A00,0xA0A0A00};
	  FP->BlinkStartup_DualPortError_1324 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {0xF0F0F00,0xA0A0A00};
	  FP->BlinkStartup_ADError_1326 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {-89458006,-89458006};
	  FP->BlinkRuntime_ExceptionHandler_1328 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {0xA0A0A00,0xA0A0A00};
	  FP->BlinkStartup_DualPortError_1330 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {0xF0F0F00,0xA0A0A00};
	  FP->BlinkStartup_ADError_1332 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {-89458006,-89458006};
	  FP->BlinkRuntime_ExceptionHandler_1334 = (INT*)TMP;
	}
	{
	  static INT TMP[21] = {0,1,2,4,8,16,32,64,128,65536,131072,262144,524288,0x100000,0x200000,0x400000,0x800000,0x1000000,0x2000000,0x4000000,
	     0x8000000};
	  FP->FlashDrvFileDrvStatus_1385 = (INT*)TMP;
	}
	{
	  static INT TMP[2] = {0,0x989680};
	  FP->T1601_1Sec_100ns_1440 = (INT*)TMP;
	}
	{
	  static INT TMP[4][4] = {{0,1,0,1},{0,1,0,1},{2,0,2,0},{2,0,2,0}};
	  FP->FragmentStatus_1610 = (INT*)TMP;
	}
	{
	  static INT TMP[4] = {0x20000000,0x20000001,0x20000002,0x20000003};
	  FP->ResultFragmentStatus_1612 = (INT*)TMP;
	}
	{
	  static BYTE TMP[22] = {71,76,49,48,48,32,49,46,50,52,32,50,46,77,97,114,46,49,57,57,
	     57,32};
	  FP->VerOfProductStr_1942 = TMP;
	}
	{
	  static INT TMP[30] = {0x76543210,0,20,102,108,97,115,104,120,58,92,112,114,103,95,48,53,49,50,46,
	     98,105,110,0,0x1BE6486,-1463415136,0x1BE6486,-1463415136,524288,524288};
	  FP->EFCB_OfProgramCode_1945 = (INT*)TMP;
	}
	FP->chan000_3148 = &FP->chan000_3148_CHAN;
	INITCH(FP->chan000_3148);
	FP->chan000Local_3150 = &FP->chan000Local_3150_CHAN;
	INITCH(FP->chan000Local_3150);
	FP->chan001_3152 = &FP->chan001_3152_CHAN;
	INITCH(FP->chan001_3152);
	FP->chan010_3154 = &FP->chan010_3154_CHAN;
	INITCH(FP->chan010_3154);
	FP->chan011_3156 = &FP->chan011_3156_CHAN;
	INITCH(FP->chan011_3156);
	FP->chan020_3158 = &FP->chan020_3158_CHAN;
	INITCH(FP->chan020_3158);
	FP->chan030_3160 = &FP->chan030_3160_CHAN;
	INITCH(FP->chan030_3160);
	FP->chan040_3162 = &FP->chan040_3162_CHAN;
	INITCH(FP->chan040_3162);
	FP->chan050_3164 = &FP->chan050_3164_CHAN;
	INITCH(FP->chan050_3164);
	FP->chan051_3166 = &FP->chan051_3166_CHAN;
	INITCH(FP->chan051_3166);
	FP->chan060_3168 = &FP->chan060_3168_CHAN;
	INITCH(FP->chan060_3168);
	FP->chan061_3170 = &FP->chan061_3170_CHAN;
	INITCH(FP->chan061_3170);
	FP->chan070_3172 = &FP->chan070_3172_CHAN;
	INITCH(FP->chan070_3172);
	FP->chan071_3174 = &FP->chan071_3174_CHAN;
	INITCH(FP->chan071_3174);
	FP->chan080_3176 = &FP->chan080_3176_CHAN;
	INITCH(FP->chan080_3176);
	FP->chan081_3178 = &FP->chan081_3178_CHAN;
	INITCH(FP->chan081_3178);
	FP->chan090_3180 = &FP->chan090_3180_CHAN;
	INITCH(FP->chan090_3180);
	FP->chan091_3182 = &FP->chan091_3182_CHAN;
	INITCH(FP->chan091_3182);
	FP->chan100_3184 = &FP->chan100_3184_CHAN;
	INITCH(FP->chan100_3184);
	FP->chan120_3186 = &FP->chan120_3186_CHAN;
	INITCH(FP->chan120_3186);
	FP->chan140_3188 = &FP->chan140_3188_CHAN;
	INITCH(FP->chan140_3188);
	FP->chan141_3190 = &FP->chan141_3190_CHAN;
	INITCH(FP->chan141_3190);
	FP->chan150_3192 = &FP->chan150_3192_CHAN;
	INITCH(FP->chan150_3192);
	FP->chan151_3194 = &FP->chan151_3194_CHAN;
	INITCH(FP->chan151_3194);
	FP->chan160_3196 = &FP->chan160_3196_CHAN;
	INITCH(FP->chan160_3196);
	FP->chan161_3198 = &FP->chan161_3198_CHAN;
	INITCH(FP->chan161_3198);
	FP->chan170_3200 = &FP->chan170_3200_CHAN;
	INITCH(FP->chan170_3200);
	FP->chan171_3202 = &FP->chan171_3202_CHAN;
	INITCH(FP->chan171_3202);
	FP->chan180_3204 = &FP->chan180_3204_CHAN;
	INITCH(FP->chan180_3204);
	FP->chan181_3206 = &FP->chan181_3206_CHAN;
	INITCH(FP->chan181_3206);
	FP->chan190_3208 = &FP->chan190_3208_CHAN;
	INITCH(FP->chan190_3208);
	FP->chan191_3210 = &FP->chan191_3210_CHAN;
	INITCH(FP->chan191_3210);
	FP->chan200_3212 = &FP->chan200_3212_CHAN;
	INITCH(FP->chan200_3212);
	FP->chan201_3214 = &FP->chan201_3214_CHAN;
	INITCH(FP->chan201_3214);
	FP->chan210_3216 = &FP->chan210_3216_CHAN;
	INITCH(FP->chan210_3216);
	FP->chan211_3218 = &FP->chan211_3218_CHAN;
	INITCH(FP->chan211_3218);
	FP->chan220_3220 = &FP->chan220_3220_CHAN;
	INITCH(FP->chan220_3220);
	FP->chan230_3222 = &FP->chan230_3222_CHAN;
	INITCH(FP->chan230_3222);
	FP->chan231_3224 = &FP->chan231_3224_CHAN;
	INITCH(FP->chan231_3224);
	FP->chan240_3226 = &FP->chan240_3226_CHAN;
	INITCH(FP->chan240_3226);
	FP->chan241_3228 = &FP->chan241_3228_CHAN;
	INITCH(FP->chan241_3228);
	FP->chan250_3230 = &FP->chan250_3230_CHAN;
	INITCH(FP->chan250_3230);
	FP->chan251_3232 = &FP->chan251_3232_CHAN;
	INITCH(FP->chan251_3232);
	FP->chan260_3234 = &FP->chan260_3234_CHAN;
	INITCH(FP->chan260_3234);
	FP->chan261_3236 = &FP->chan261_3236_CHAN;
	INITCH(FP->chan261_3236);
	FP->chan290_3238 = &FP->chan290_3238_CHAN;
	INITCH(FP->chan290_3238);
	FP->chan291_3240 = &FP->chan291_3240_CHAN;
	INITCH(FP->chan291_3240);
	FP->chan310_3242 = &FP->chan310_3242_CHAN;
	INITCH(FP->chan310_3242);
	FP->chan310Local_3244 = &FP->chan310Local_3244_CHAN;
	INITCH(FP->chan310Local_3244);
	FP->chan320_3246 = &FP->chan320_3246_CHAN;
	INITCH(FP->chan320_3246);
	FP->chan330_3248 = &FP->chan330_3248_CHAN;
	INITCH(FP->chan330_3248);
	FP->chan340_3250 = &FP->chan340_3250_CHAN;
	INITCH(FP->chan340_3250);
	FP->chan350_3252 = &FP->chan350_3252_CHAN;
	INITCH(FP->chan350_3252);
	FP->chan360_3254 = &FP->chan360_3254_CHAN;
	INITCH(FP->chan360_3254);
	FP->chan370_3256 = &FP->chan370_3256_CHAN;
	INITCH(FP->chan370_3256);
	FP->chan380_3258 = &FP->chan380_3258_CHAN;
	INITCH(FP->chan380_3258);
	FP->chan390_3260 = &FP->chan390_3260_CHAN;
	INITCH(FP->chan390_3260);
	FP->chan391_3262 = &FP->chan391_3262_CHAN;
	INITCH(FP->chan391_3262);
	FP->chan800_3264 = &FP->chan800_3264_CHAN;
	INITCH(FP->chan800_3264);
	FP->chan910_3266 = &FP->chan910_3266_CHAN;
	INITCH(FP->chan910_3266);
	FP->chan920_3268 = &FP->chan920_3268_CHAN;
	INITCH(FP->chan920_3268);
	FP->chan1000_3270 = &FP->chan1000_3270_CHAN;
	INITCH(FP->chan1000_3270);
	{
	  int TMP0;
	  for (TMP0=0;TMP0<5;TMP0++)
	  {
	    FP->chan300Array_3272[TMP0] = &FP->chan300Array_3272_CHAN[TMP0];
	    INITCH(FP->chan300Array_3272[TMP0]);
	  }
	}
	{
	  int TMP0;
	  for (TMP0=0;TMP0<2;TMP0++)
	  {
	    FP->chan270Array_3274[TMP0] = &FP->chan270Array_3274_CHAN[TMP0];
	    INITCH(FP->chan270Array_3274[TMP0]);
	  }
	}
	{
	  int TMP0;
	  for (TMP0=0;TMP0<2;TMP0++)
	  {
	    FP->chan271Array_3276[TMP0] = &FP->chan271Array_3276_CHAN[TMP0];
	    INITCH(FP->chan271Array_3276[TMP0]);
	  }
	}
	{
	  int TMP0;
	  for (TMP0=0;TMP0<3;TMP0++)
	  {
	    FP->chan400Array_3278[TMP0] = &FP->chan400Array_3278_CHAN[TMP0];
	    INITCH(FP->chan400Array_3278[TMP0]);
	  }
	}
	{
	  int TMP0;
	  for (TMP0=0;TMP0<16;TMP0++)
	  {
	    FP->chan900Array_3280[TMP0] = &FP->chan900Array_3280_CHAN[TMP0];
	    INITCH(FP->chan900Array_3280[TMP0]);
	  }
	}
	BREAKPOINT_F(5); // Start tests
	FP->_U133._C258.Chain = FP;
	CALL(P_VerifyAlbum_3287,&FP->_U133._C258,1,"P_VerifyAlbum_3287");
      CASE(1):  
	STARTP(&FP->_U133._S138._T35,P_3288,&FP->_U133._S138._C260,"P_3288",1);
	STARTP(&FP->_U133._S138._T36,P_3295,&FP->_U133._S138._C263,"P_3295",1);
	WAITP(2);
      CASE(2):  
	{
	  INT error_3296;
	  {
	    error_3296 = 0; 
	    BREAKPOINT_F(25);
	    P_I01_CodeCksumTst_1949(false,&error_3296);
	  }
	}
	BREAKPOINT_F(5); // Tests finished, start main tasks
	{
	  INT idle_Max_UpToNow_ms_3297;
	  {
	    // --- C embedded in occam, begin ---
	    // ---
	    idle_Max_UpToNow_ms_3297 = (INT) Reset_idle_max_ms();
	    // ---
	    // --- C embedded in occam, end ---
	    idle_Max_UpToNow_ms_3297 = idle_Max_UpToNow_ms_3297; 
	  }
	}
	STARTP(&FP->_U133._S139._T37,P_3298,&FP->_U133._S139._C266,"P_3298",0);
	STARTP(&FP->_U133._S139._T66,P_4605,&FP->_U133._S139._C557,"P_4605",1);
	STARTP(&FP->_U133._S139._T67,P_4606,&FP->_U133._S139._C559,"P_4606",1);
	WAITP(3);
      CASE(3):  
	ENDP();
      default: SETERR(MSG_IP);
    }
  }
}
/*}}}  */
#endif
#include "OCCAM2C.LNT" // To catch restore's