text: // This file is generated by FBC.
  
  #include "RequestResolver.h"
  #include <string.h>
  #include <stdio.h>
  
  /* Function block initialization function */
  void RequestResolverinit(RequestResolver* me)
  {
      me->_input.events = 0;
      me->_output.events = 0;
      PendingRequestGeneratorinit(&me->PendingRequestGenerator);
      HighestRequestProducerinit(&me->HighestRequestProducer);
      RequestConsumerinit(&me->RequestConsumer);
  }
  
  /* Function block execution function */
  void RequestResolverrun(RequestResolver* me)
  {
      me->PendingRequestGenerator._input.event.DownCall = me->_input.event.DownCall;
      me->PendingRequestGenerator._input.event.CabinCall = me->_input.event.CabinCall;
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->PendingRequestGenerator._UpCallValue[i] = me->_UpCallValue[i];
          }
      }
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->PendingRequestGenerator._CabinCallValue[i] = me->_CabinCallValue[i];
          }
      }
      me->PendingRequestGenerator._input.event.MotorDirectionDown = me->_input.event.MotorDirectionDown;
      me->PendingRequestGenerator._input.event.StoppedAtFloor = me->_input.event.StoppedAtFloor;
      me->PendingRequestGenerator._input.event.MotorDirectionUp = me->_input.event.MotorDirectionUp;
      me->PendingRequestGenerator._StoppedAtFloorValue = me->_StoppedAtFloorValue;
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->PendingRequestGenerator._DownCallValue[i] = me->_DownCallValue[i];
          }
      }
      me->PendingRequestGenerator._input.event.UpCall = me->_input.event.UpCall;
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->HighestRequestProducer._PendingReqValue[i] = me->PendingRequestGenerator._PendingReqValue[i];
          }
      }
      me->HighestRequestProducer._input.event.MotorDirectionUp = me->_input.event.MotorDirectionUp;
      me->HighestRequestProducer._FloorSensorValue = me->_FloorSensorValue;
      me->HighestRequestProducer._input.event.MotorDirectionIdle = me->_input.event.MotorDirectionIdle;
      me->HighestRequestProducer._input.event.PendingReq = me->PendingRequestGenerator._output.event.PendingReq;
      me->HighestRequestProducer._input.event.MotorDirectionDown = me->_input.event.MotorDirectionDown;
      me->HighestRequestProducer._input.event.FloorSensor = me->_input.event.FloorSensor;
      me->RequestConsumer._input.event.StoppedAtFloor = me->_input.event.StoppedAtFloor;
      me->RequestConsumer._CurrentPriorityValue = me->HighestRequestProducer._CurrentPriorityValue;
      me->RequestConsumer._StoppedAtFloorValue = me->_StoppedAtFloorValue;
      me->RequestConsumer._input.event.CurrentPriority = me->HighestRequestProducer._output.event.CurrentPriority;
      
      PendingRequestGeneratorrun(&me->PendingRequestGenerator);
      HighestRequestProducerrun(&me->HighestRequestProducer);
      RequestConsumerrun(&me->RequestConsumer);
      
      me->_output.event.PendingDownCall = me->PendingRequestGenerator._output.event.PendingDownCall;
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->_PendingUpCallValue[i] = me->PendingRequestGenerator._PendingUpCallValue[i];
          }
      }
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->_PendingReqValue[i] = me->PendingRequestGenerator._PendingReqValue[i];
          }
      }
      me->_output.event.PendingReq = me->PendingRequestGenerator._output.event.PendingReq;
      me->_output.event.PendingCabinCall = me->PendingRequestGenerator._output.event.PendingCabinCall;
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->_PendingCallValue[i] = me->PendingRequestGenerator._PendingCallValue[i];
          }
      }
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->_PendingDownCallValue[i] = me->PendingRequestGenerator._PendingDownCallValue[i];
          }
      }
      me->_output.event.CurrentPriority = me->HighestRequestProducer._output.event.CurrentPriority;
      me->_output.event.request = me->RequestConsumer._output.event.request;
      {
          int i;
          for (i = 0; i < 4; i++) {
              me->_PendingCabinCallValue[i] = me->PendingRequestGenerator._PendingCabinCallValue[i];
          }
      }
      me->_requestValue = me->RequestConsumer._requestValue;
      me->_output.event.PendingCall = me->PendingRequestGenerator._output.event.PendingCall;
      me->_CurrentPriorityValue = me->HighestRequestProducer._CurrentPriorityValue;
      me->_output.event.PendingUpCall = me->PendingRequestGenerator._output.event.PendingUpCall;
  }
  