/* InfraLib::Balise_Group_Init */
void Balise_Group_Init_InfraLib(
  /* InfraLib::Balise_Group_Init::TrainPos */kcg_real TrainPos,
  /* InfraLib::Balise_Group_Init::Engineering_Data */BaliseGroupData_TM *Engineering_Data,
  outC_Balise_Group_Init_InfraLib *outC)
{
  outC->_L31 = kcg_false;
  outC->_L30 = TrainPos;
  kcg_copy_BaliseGroupData_TM(&outC->_L2, Engineering_Data);
  outC->_L29 = outC->_L2.Pos;
  kcg_copy_CompressedPackets_T_Common_Types_Pkg(
    &outC->_L28,
    (CompressedPackets_T_Common_Types_Pkg *) &DEFAULT_Packets_TM);
  kcg_copy_BaliseTelegramHeader_int_T_TM(
    &outC->_L27,
    (BaliseTelegramHeader_int_T_TM *) &DEFAULT_TM_BaliseHeaderInt_TM);
  outC->_L14 = 0;
  kcg_copy_BaliseTelegramHeader_int_T_TM(&outC->_L26.header, &outC->_L27);
  kcg_copy_CompressedPackets_T_Common_Types_Pkg(
    &outC->_L26.packets,
    &outC->_L28);
  outC->_L26.engineering_BG_location = outC->_L29;
  outC->_L26.TrainPos = outC->_L30;
  outC->_L26.pig_nom_0 = outC->_L14;
  outC->_L26.balise_passed = outC->_L31;
  kcg_copy_B_data_internal_T_InfraLib(&outC->BG_internal_out, &outC->_L26);
}
/* AmsterdamUtrechtL2::Sheet15_MaarssenUtrechtCS_Balises::Balise_Group_439 */
void Balise_Group_439_AmsterdamUtrechtL2_Sheet15_MaarssenUtrechtCS_Balises(
  /* AmsterdamUtrechtL2::Sheet15_MaarssenUtrechtCS_Balises::Balise_Group_439::BG_message_in */CompressedBaliseMessage_TM *BG_message_in,
  /* AmsterdamUtrechtL2::Sheet15_MaarssenUtrechtCS_Balises::Balise_Group_439::TrainPos */kcg_real _1_TrainPos,
  /* AmsterdamUtrechtL2::Sheet15_MaarssenUtrechtCS_Balises::Balise_Group_439::Engineering_Data */BaliseGroupData_TM *Engineering_Data,
  outC_Balise_Group_439_AmsterdamUtrechtL2_Sheet15_MaarssenUtrechtCS_Balises *outC)
{
  static kcg_bool noname;
  
  kcg_copy_CompressedBaliseMessage_TM(&outC->_L29, BG_message_in);
  outC->_L28 = _1_TrainPos;
  kcg_copy_BaliseGroupData_TM(&outC->_L19, Engineering_Data);
  /* 1 */ Balise_Group_Init_InfraLib(outC->_L28, &outC->_L19, &outC->Context_1);
  kcg_copy_B_data_internal_T_InfraLib(
    &outC->_L11,
    &outC->Context_1.BG_internal_out);
  kcg_copy_B_data_internal_T_InfraLib(&outC->BaliseDataIn, &outC->_L11);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L9, &outC->BaliseDataIn);
  outC->_L20 = 0;
  /* 1 */
  Balise_439_1_AmsterdamUtrechtL2_Sheet15_MaarssenUtrechtCS_Balises(
    &outC->_L9,
    (BaliseTelegramHeader_int_T_TM *) &BG439_header_B1_Balises426,
    outC->_L20,
    &outC->_1_Context_1);
  kcg_copy_B_data_internal_T_InfraLib(
    &outC->_L8,
    &outC->_1_Context_1.B_data_out);
  outC->_L21 = 1;
  /* 1 */
  Balise_439_0_AmsterdamUtrechtL2_Sheet15_MaarssenUtrechtCS_Balises(
    &outC->_L8,
    (BaliseTelegramHeader_int_T_TM *) &BG439_header_B0_Balises426,
    outC->_L21,
    &outC->_2_Context_1);
  kcg_copy_B_data_internal_T_InfraLib(
    &outC->_L7,
    &outC->_2_Context_1.B_data_out);
  kcg_copy_B_data_internal_T_InfraLib(&outC->BaliseDataOut, &outC->_L7);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L16, &outC->BaliseDataOut);
  /* 1 */
  Balise_Group_Close_InfraLib(&outC->_L16, &outC->_L29, &outC->_3_Context_1);
  outC->_L14 = outC->_3_Context_1.Error_out;
  kcg_copy_CompressedBaliseMessage_TM(
    &outC->_L13,
    &outC->_3_Context_1.BG_message_out);
  noname = outC->_L14;
  kcg_copy_CompressedBaliseMessage_TM(&outC->BG_message_out, &outC->_L13);
}
/* AmsterdamUtrechtL2::Sheet14_Maarssen_Balises::Balise_Group_435 */
void Balise_Group_435_AmsterdamUtrechtL2_Sheet14_Maarssen_Balises(
  /* AmsterdamUtrechtL2::Sheet14_Maarssen_Balises::Balise_Group_435::BG_message_in */CompressedBaliseMessage_TM *BG_message_in,
  /* AmsterdamUtrechtL2::Sheet14_Maarssen_Balises::Balise_Group_435::TrainPos */kcg_real _7_TrainPos,
  /* AmsterdamUtrechtL2::Sheet14_Maarssen_Balises::Balise_Group_435::Engineering_Data */BaliseGroupData_TM *Engineering_Data,
  outC_Balise_Group_435_AmsterdamUtrechtL2_Sheet14_Maarssen_Balises *outC)
{
  static kcg_int _6_noname_6;
  static BaliseTelegramHeader_int_T_TM noname_6;
  static kcg_int _5_noname_5;
  static BaliseTelegramHeader_int_T_TM noname_5;
  static kcg_int _4_noname_4;
  static BaliseTelegramHeader_int_T_TM noname_4;
  static kcg_int _3_noname_3;
  static BaliseTelegramHeader_int_T_TM noname_3;
  static kcg_int _2_noname_2;
  static BaliseTelegramHeader_int_T_TM noname_2;
  static kcg_int _1_noname_1;
  static BaliseTelegramHeader_int_T_TM noname_1;
  static kcg_bool noname;
  
  outC->_L27 = 7;
  outC->PIG_nom_6 = outC->_L27;
  kcg_copy_BaliseTelegramHeader_int_T_TM(
    &outC->Header_6,
    (BaliseTelegramHeader_int_T_TM *) &DEFAULT_BaliseTelegramHd_InfraLib);
  outC->_L26 = 6;
  outC->PIG_nom_5 = outC->_L26;
  kcg_copy_BaliseTelegramHeader_int_T_TM(
    &outC->Header_5,
    (BaliseTelegramHeader_int_T_TM *) &DEFAULT_BaliseTelegramHd_InfraLib);
  outC->_L25 = 5;
  outC->PIG_nom_4 = outC->_L25;
  kcg_copy_BaliseTelegramHeader_int_T_TM(
    &outC->Header_4,
    (BaliseTelegramHeader_int_T_TM *) &DEFAULT_BaliseTelegramHd_InfraLib);
  outC->_L24 = 4;
  outC->PIG_nom_3 = outC->_L24;
  kcg_copy_BaliseTelegramHeader_int_T_TM(
    &outC->Header_3,
    (BaliseTelegramHeader_int_T_TM *) &DEFAULT_BaliseTelegramHd_InfraLib);
  outC->_L23 = 3;
  outC->PIG_nom_2 = outC->_L23;
  kcg_copy_BaliseTelegramHeader_int_T_TM(
    &outC->Header_2,
    (BaliseTelegramHeader_int_T_TM *) &DEFAULT_BaliseTelegramHd_InfraLib);
  outC->_L22 = 2;
  outC->PIG_nom_1 = outC->_L22;
  kcg_copy_BaliseTelegramHeader_int_T_TM(
    &outC->Header_1,
    (BaliseTelegramHeader_int_T_TM *) &DEFAULT_BaliseTelegramHd_InfraLib);
  kcg_copy_CompressedBaliseMessage_TM(&outC->_L29, BG_message_in);
  outC->_L28 = _7_TrainPos;
  kcg_copy_BaliseGroupData_TM(&outC->_L19, Engineering_Data);
  /* 1 */ Balise_Group_Init_InfraLib(outC->_L28, &outC->_L19, &outC->Context_1);
  kcg_copy_B_data_internal_T_InfraLib(
    &outC->_L11,
    &outC->Context_1.BG_internal_out);
  kcg_copy_B_data_internal_T_InfraLib(&outC->BaliseDataIn, &outC->_L11);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L9, &outC->BaliseDataIn);
  outC->_L20 = 0;
  /* 1 */
  Balise_435_0_AmsterdamUtrechtL2_Sheet14_Maarssen_Balises(
    &outC->_L9,
    (BaliseTelegramHeader_int_T_TM *) &BG435_header_B0_Balises426,
    outC->_L20,
    &outC->_1_Context_1);
  kcg_copy_B_data_internal_T_InfraLib(
    &outC->_L8,
    &outC->_1_Context_1.B_data_out);
  outC->_L21 = 1;
  /* 1 */
  Balise_435_1_AmsterdamUtrechtL2_Sheet14_Maarssen_Balises(
    &outC->_L8,
    (BaliseTelegramHeader_int_T_TM *) &BG435_header_B1_Balises426,
    outC->_L21,
    &outC->_2_Context_1);
  kcg_copy_B_data_internal_T_InfraLib(
    &outC->_L7,
    &outC->_2_Context_1.B_data_out);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_in_1, &outC->_L7);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L1_1, &outC->B_data_in_1);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_out_1, &outC->_L1_1);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L6, &outC->B_data_out_1);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_in_2, &outC->_L6);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L1_2, &outC->B_data_in_2);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_out_2, &outC->_L1_2);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L5, &outC->B_data_out_2);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_in_3, &outC->_L5);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L1_3, &outC->B_data_in_3);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_out_3, &outC->_L1_3);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L4, &outC->B_data_out_3);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_in_4, &outC->_L4);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L1_4, &outC->B_data_in_4);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_out_4, &outC->_L1_4);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L3, &outC->B_data_out_4);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_in_5, &outC->_L3);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L1_5, &outC->B_data_in_5);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_out_5, &outC->_L1_5);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L2, &outC->B_data_out_5);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_in_6, &outC->_L2);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L1_6, &outC->B_data_in_6);
  kcg_copy_B_data_internal_T_InfraLib(&outC->B_data_out_6, &outC->_L1_6);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L1, &outC->B_data_out_6);
  kcg_copy_B_data_internal_T_InfraLib(&outC->BaliseDataOut, &outC->_L1);
  kcg_copy_B_data_internal_T_InfraLib(&outC->_L16, &outC->BaliseDataOut);
  /* 1 */
  Balise_Group_Close_InfraLib(&outC->_L16, &outC->_L29, &outC->_3_Context_1);
  outC->_L14 = outC->_3_Context_1.Error_out;
  kcg_copy_CompressedBaliseMessage_TM(
    &outC->_L13,
    &outC->_3_Context_1.BG_message_out);
  noname = outC->_L14;
  kcg_copy_CompressedBaliseMessage_TM(&outC->BG_message_out, &outC->_L13);
  kcg_copy_BaliseTelegramHeader_int_T_TM(&outC->_L3_1, &outC->Header_1);
  kcg_copy_BaliseTelegramHeader_int_T_TM(&noname_1, &outC->_L3_1);
  outC->_L2_1 = outC->PIG_nom_1;
  _1_noname_1 = outC->_L2_1;
  kcg_copy_BaliseTelegramHeader_int_T_TM(&outC->_L3_2, &outC->Header_2);
  kcg_copy_BaliseTelegramHeader_int_T_TM(&noname_2, &outC->_L3_2);
  outC->_L2_2 = outC->PIG_nom_2;
  _2_noname_2 = outC->_L2_2;
  kcg_copy_BaliseTelegramHeader_int_T_TM(&outC->_L3_3, &outC->Header_3);
  kcg_copy_BaliseTelegramHeader_int_T_TM(&noname_3, &outC->_L3_3);
  outC->_L2_3 = outC->PIG_nom_3;
  _3_noname_3 = outC->_L2_3;
  kcg_copy_BaliseTelegramHeader_int_T_TM(&outC->_L3_4, &outC->Header_4);
  kcg_copy_BaliseTelegramHeader_int_T_TM(&noname_4, &outC->_L3_4);
  outC->_L2_4 = outC->PIG_nom_4;
  _4_noname_4 = outC->_L2_4;
  kcg_copy_BaliseTelegramHeader_int_T_TM(&outC->_L3_5, &outC->Header_5);
  kcg_copy_BaliseTelegramHeader_int_T_TM(&noname_5, &outC->_L3_5);
  outC->_L2_5 = outC->PIG_nom_5;
  _5_noname_5 = outC->_L2_5;
  kcg_copy_BaliseTelegramHeader_int_T_TM(&outC->_L3_6, &outC->Header_6);
  kcg_copy_BaliseTelegramHeader_int_T_TM(&noname_6, &outC->_L3_6);
  outC->_L2_6 = outC->PIG_nom_6;
  _6_noname_6 = outC->_L2_6;
}
/* UNISIG_Validation_Scenarios::Test_Track_Elements::Test_Balises::Test_BG022_200_8BT */
void Test_BG022_200_8BT_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises(
    /* UNISIG_Validation_Scenarios::Test_Track_Elements::Test_Balises::Test_BG022_200_8BT::BG_message_in */ CompressedBaliseMessage_TM *BG_message_in,
    /* UNISIG_Validation_Scenarios::Test_Track_Elements::Test_Balises::Test_BG022_200_8BT::TrainPos */ kcg_real TrainPos,
    /* UNISIG_Validation_Scenarios::Test_Track_Elements::Test_Balises::Test_BG022_200_8BT::Engineering_Data */ BaliseGroupData_TM *Engineering_Data,
    outC_Test_BG022_200_8BT_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises *outC)
{
    kcg_bool noname;

    outC->_L28 = TrainPos;
    kcg_copy_BaliseGroupData_TM(&outC->_L19, Engineering_Data);
    /* 1 */
    Balise_Group_Init_UNISIG_Validation_Scenarios_test_InfraLibInt(
        outC->_L28,
        &outC->_L19,
        &outC->Context_1);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L11,
        &outC->Context_1.BG_internal_out);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->BaliseDataIn,
        &outC->_L11);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L9,
        &outC->BaliseDataIn);
    outC->_L20 = 0;
    /* 2 */
    Test_Balise_Sent_P072_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises(
        &outC->_L9,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B7of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L20,
        &outC->Context_2);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L8,
        &outC->Context_2.B_data_out);
    outC->_L21 = 1;
    /* 5 */
    TEMPLATE_Balise_modified_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L8,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B6of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L21,
        &outC->Context_5);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L7,
        &outC->Context_5.B_data_out);
    outC->_L22 = 2;
    /* 6 */
    TEMPLATE_Balise_modified_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L7,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B5of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L22,
        &outC->Context_6);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L6,
        &outC->Context_6.B_data_out);
    outC->_L23 = 3;
    /* 1 */
    TEMPLATE_Balise_modified_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L6,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B4of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L23,
        &outC->_1_Context_1);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L5,
        &outC->_1_Context_1.B_data_out);
    outC->_L24 = 4;
    /* 7 */
    TEMPLATE_Balise_modified_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L5,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B3of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L24,
        &outC->Context_7);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L4,
        &outC->Context_7.B_data_out);
    outC->_L25 = 5;
    /* 2 */
    TEMPLATE_Balise_modified_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L4,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B2of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L25,
        &outC->_2_Context_2);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L3,
        &outC->_2_Context_2.B_data_out);
    outC->_L26 = 6;
    /* 3 */
    TEMPLATE_Balise_modified_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L3,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B1of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L26,
        &outC->Context_3);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L2,
        &outC->Context_3.B_data_out);
    outC->_L27 = 7;
    /* 8 */
    TEMPLATE_Balise_modified_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L2,
        (BaliseTelegramHeader_int_T_TM *)
        &test_BG022_header_B0of7_nlink_UNISIG_Validation_Scenarios_Test_Track_Elements_Test_Balises,
        outC->_L27,
        &outC->Context_8);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L1,
        &outC->Context_8.B_data_out);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->BaliseDataOut,
        &outC->_L1);
    kcg_copy_B_data_internal_T_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L16,
        &outC->BaliseDataOut);
    kcg_copy_CompressedBaliseMessage_TM(&outC->_L29, BG_message_in);
    /* 1 */
    Balise_Group_Close_UNISIG_Validation_Scenarios_test_InfraLibInt(
        &outC->_L16,
        &outC->_L29,
        &outC->_3_Context_1);
    outC->_L14 = outC->_3_Context_1.Error_out;
    kcg_copy_CompressedBaliseMessage_TM(
        &outC->_L13,
        &outC->_3_Context_1.BG_message_out);
    kcg_copy_CompressedBaliseMessage_TM(&outC->BG_message_out, &outC->_L13);
    noname = outC->_L14;
}