Relentless - 2017-04-08

I am trying to understand the packing (unpacking) logic implemented by OpenLTE. Why is "optional indicator" set before the "dedicated info type" in ULInformationTransfer message? The ULInformationTransfer message structure (in ASN.1 format) and the corresponding packing code is given below:

ULInformationTransfer ::= SEQUENCE {
   criticalExtensions CHOICE {
      c1 CHOICE {
         ulInformationTransfer-r8 ULInformationTransfer-r8-IEs,
         spare3 NULL, spare2 NULL, spare1 NULL
         },
      criticalExtensionsFuture SEQUENCE {}
      }
}

ULInformationTransfer-r8-IEs ::= SEQUENCE {
   dedicatedInfoType CHOICE {
      dedicatedInfoNAS DedicatedInfoNAS,
      dedicatedInfoCDMA2000-1XRTT DedicatedInfoCDMA2000,
      dedicatedInfoCDMA2000-HRPD DedicatedInfoCDMA2000
      },
   nonCriticalExtension ULInformationTransfer-v8a0-IEs OPTIONAL
}
LIBLTE_ERROR_ENUM liblte_rrc_pack_ul_information_transfer_msg(LIBLTE_RRC_UL_INFORMATION_TRANSFER_STRUCT *ul_info_transfer,
                                                              LIBLTE_BIT_MSG_STRUCT                     *msg)
{
    LIBLTE_ERROR_ENUM  err     = LIBLTE_ERROR_INVALID_INPUTS;
    uint8             *msg_ptr = msg->msg;

    if(ul_info_transfer != NULL &&
       msg              != NULL)
    {
        // Extension choice
        liblte_value_2_bits(0, &msg_ptr, 1);

        // C1 choice
        liblte_value_2_bits(0, &msg_ptr, 2);

        // Optional indicator
        liblte_value_2_bits(0, &msg_ptr, 1);

        // Dedicated info type choice
        liblte_value_2_bits(ul_info_transfer->dedicated_info_type, &msg_ptr, 2);

        if(LIBLTE_RRC_UL_INFORMATION_TRANSFER_TYPE_NAS == ul_info_transfer->dedicated_info_type)
        {
            liblte_rrc_pack_dedicated_info_nas_ie(&ul_info_transfer->dedicated_info,
                                                  &msg_ptr);
        }else{
            liblte_rrc_pack_dedicated_info_cdma2000_ie(&ul_info_transfer->dedicated_info,
                                                       &msg_ptr);
        }

        // Fill in the number of bits used
        msg->N_bits = msg_ptr - msg->msg;

        err = LIBLTE_SUCCESS;
    }

    return(err);
}

Also, for other messages (e.g., SystemInformationBlockType1) the fields are not set in same order as they are shown in the ASN.1 format. Would anyone please enlighten me about it?

Thank you.