text:
namespace protobuf_unittest {

namespace {

const ::google::protobuf::Descriptor* TestMessageWithCustomOptions_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  TestMessageWithCustomOptions_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* TestMessageWithCustomOptions_AnEnum_descriptor_ = NULL;
const ::google::protobuf::Descriptor* CustomOptionFooRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CustomOptionFooRequest_reflection_ = NULL;
const ::google::protobuf::Descriptor* CustomOptionFooResponse_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CustomOptionFooResponse_reflection_ = NULL;
const ::google::protobuf::Descriptor* CustomOptionFooClientMessage_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CustomOptionFooClientMessage_reflection_ = NULL;
const ::google::protobuf::Descriptor* CustomOptionFooServerMessage_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CustomOptionFooServerMessage_reflection_ = NULL;
const ::google::protobuf::Descriptor* DummyMessageContainingEnum_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  DummyMessageContainingEnum_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* DummyMessageContainingEnum_TestEnumType_descriptor_ = NULL;
const ::google::protobuf::Descriptor* DummyMessageInvalidAsOptionType_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  DummyMessageInvalidAsOptionType_reflection_ = NULL;
const ::google::protobuf::Descriptor* CustomOptionMinIntegerValues_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CustomOptionMinIntegerValues_reflection_ = NULL;
const ::google::protobuf::Descriptor* CustomOptionMaxIntegerValues_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CustomOptionMaxIntegerValues_reflection_ = NULL;
const ::google::protobuf::Descriptor* CustomOptionOtherValues_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  CustomOptionOtherValues_reflection_ = NULL;
const ::google::protobuf::Descriptor* SettingRealsFromPositiveInts_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  SettingRealsFromPositiveInts_reflection_ = NULL;
const ::google::protobuf::Descriptor* SettingRealsFromNegativeInts_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  SettingRealsFromNegativeInts_reflection_ = NULL;
const ::google::protobuf::Descriptor* ComplexOptionType1_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ComplexOptionType1_reflection_ = NULL;
const ::google::protobuf::Descriptor* ComplexOptionType2_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ComplexOptionType2_reflection_ = NULL;
const ::google::protobuf::Descriptor* ComplexOptionType2_ComplexOptionType4_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ComplexOptionType2_ComplexOptionType4_reflection_ = NULL;
const ::google::protobuf::Descriptor* ComplexOptionType3_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ComplexOptionType3_reflection_ = NULL;
const ::google::protobuf::Descriptor* ComplexOptionType3_ComplexOptionType5_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ComplexOptionType3_ComplexOptionType5_reflection_ = NULL;
const ::google::protobuf::Descriptor* ComplexOpt6_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ComplexOpt6_reflection_ = NULL;
const ::google::protobuf::Descriptor* VariousComplexOptions_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  VariousComplexOptions_reflection_ = NULL;
const ::google::protobuf::Descriptor* AggregateMessageSet_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AggregateMessageSet_reflection_ = NULL;
const ::google::protobuf::Descriptor* AggregateMessageSetElement_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AggregateMessageSetElement_reflection_ = NULL;
const ::google::protobuf::Descriptor* Aggregate_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  Aggregate_reflection_ = NULL;
const ::google::protobuf::Descriptor* AggregateMessage_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AggregateMessage_reflection_ = NULL;
const ::google::protobuf::Descriptor* NestedOptionType_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  NestedOptionType_reflection_ = NULL;
const ::google::protobuf::Descriptor* NestedOptionType_NestedMessage_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  NestedOptionType_NestedMessage_reflection_ = NULL;
const ::google::protobuf::EnumDescriptor* NestedOptionType_NestedEnum_descriptor_ = NULL;
const ::google::protobuf::EnumDescriptor* MethodOpt1_descriptor_ = NULL;
const ::google::protobuf::EnumDescriptor* AggregateEnum_descriptor_ = NULL;
const ::google::protobuf::ServiceDescriptor* TestServiceWithCustomOptions_descriptor_ = NULL;
const ::google::protobuf::ServiceDescriptor* AggregateService_descriptor_ = NULL;

}  // namespace

void protobuf_AssignDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto() {
  protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "google/protobuf/unittest_custom_options.proto");
  GOOGLE_CHECK(file != NULL);
  TestMessageWithCustomOptions_descriptor_ = file->message_type(0);
  static const int TestMessageWithCustomOptions_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestMessageWithCustomOptions, field1_),
  };
  TestMessageWithCustomOptions_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      TestMessageWithCustomOptions_descriptor_,
      TestMessageWithCustomOptions::default_instance_,
      TestMessageWithCustomOptions_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestMessageWithCustomOptions, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(TestMessageWithCustomOptions, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(TestMessageWithCustomOptions));
  TestMessageWithCustomOptions_AnEnum_descriptor_ = TestMessageWithCustomOptions_descriptor_->enum_type(0);
  CustomOptionFooRequest_descriptor_ = file->message_type(1);
  static const int CustomOptionFooRequest_offsets_[1] = {
  };
  CustomOptionFooRequest_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      CustomOptionFooRequest_descriptor_,
      CustomOptionFooRequest::default_instance_,
      CustomOptionFooRequest_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooRequest, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooRequest, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(CustomOptionFooRequest));
  CustomOptionFooResponse_descriptor_ = file->message_type(2);
  static const int CustomOptionFooResponse_offsets_[1] = {
  };
  CustomOptionFooResponse_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      CustomOptionFooResponse_descriptor_,
      CustomOptionFooResponse::default_instance_,
      CustomOptionFooResponse_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooResponse, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooResponse, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(CustomOptionFooResponse));
  CustomOptionFooClientMessage_descriptor_ = file->message_type(3);
  static const int CustomOptionFooClientMessage_offsets_[1] = {
  };
  CustomOptionFooClientMessage_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      CustomOptionFooClientMessage_descriptor_,
      CustomOptionFooClientMessage::default_instance_,
      CustomOptionFooClientMessage_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooClientMessage, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooClientMessage, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(CustomOptionFooClientMessage));
  CustomOptionFooServerMessage_descriptor_ = file->message_type(4);
  static const int CustomOptionFooServerMessage_offsets_[1] = {
  };
  CustomOptionFooServerMessage_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      CustomOptionFooServerMessage_descriptor_,
      CustomOptionFooServerMessage::default_instance_,
      CustomOptionFooServerMessage_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooServerMessage, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionFooServerMessage, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(CustomOptionFooServerMessage));
  DummyMessageContainingEnum_descriptor_ = file->message_type(5);
  static const int DummyMessageContainingEnum_offsets_[1] = {
  };
  DummyMessageContainingEnum_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      DummyMessageContainingEnum_descriptor_,
      DummyMessageContainingEnum::default_instance_,
      DummyMessageContainingEnum_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyMessageContainingEnum, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyMessageContainingEnum, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(DummyMessageContainingEnum));
  DummyMessageContainingEnum_TestEnumType_descriptor_ = DummyMessageContainingEnum_descriptor_->enum_type(0);
  DummyMessageInvalidAsOptionType_descriptor_ = file->message_type(6);
  static const int DummyMessageInvalidAsOptionType_offsets_[1] = {
  };
  DummyMessageInvalidAsOptionType_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      DummyMessageInvalidAsOptionType_descriptor_,
      DummyMessageInvalidAsOptionType::default_instance_,
      DummyMessageInvalidAsOptionType_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyMessageInvalidAsOptionType, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(DummyMessageInvalidAsOptionType, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(DummyMessageInvalidAsOptionType));
  CustomOptionMinIntegerValues_descriptor_ = file->message_type(7);
  static const int CustomOptionMinIntegerValues_offsets_[1] = {
  };
  CustomOptionMinIntegerValues_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      CustomOptionMinIntegerValues_descriptor_,
      CustomOptionMinIntegerValues::default_instance_,
      CustomOptionMinIntegerValues_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionMinIntegerValues, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionMinIntegerValues, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(CustomOptionMinIntegerValues));
  CustomOptionMaxIntegerValues_descriptor_ = file->message_type(8);
  static const int CustomOptionMaxIntegerValues_offsets_[1] = {
  };
  CustomOptionMaxIntegerValues_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      CustomOptionMaxIntegerValues_descriptor_,
      CustomOptionMaxIntegerValues::default_instance_,
      CustomOptionMaxIntegerValues_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionMaxIntegerValues, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionMaxIntegerValues, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(CustomOptionMaxIntegerValues));
  CustomOptionOtherValues_descriptor_ = file->message_type(9);
  static const int CustomOptionOtherValues_offsets_[1] = {
  };
  CustomOptionOtherValues_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      CustomOptionOtherValues_descriptor_,
      CustomOptionOtherValues::default_instance_,
      CustomOptionOtherValues_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionOtherValues, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(CustomOptionOtherValues, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(CustomOptionOtherValues));
  SettingRealsFromPositiveInts_descriptor_ = file->message_type(10);
  static const int SettingRealsFromPositiveInts_offsets_[1] = {
  };
  SettingRealsFromPositiveInts_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      SettingRealsFromPositiveInts_descriptor_,
      SettingRealsFromPositiveInts::default_instance_,
      SettingRealsFromPositiveInts_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SettingRealsFromPositiveInts, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SettingRealsFromPositiveInts, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(SettingRealsFromPositiveInts));
  SettingRealsFromNegativeInts_descriptor_ = file->message_type(11);
  static const int SettingRealsFromNegativeInts_offsets_[1] = {
  };
  SettingRealsFromNegativeInts_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      SettingRealsFromNegativeInts_descriptor_,
      SettingRealsFromNegativeInts::default_instance_,
      SettingRealsFromNegativeInts_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SettingRealsFromNegativeInts, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SettingRealsFromNegativeInts, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(SettingRealsFromNegativeInts));
  ComplexOptionType1_descriptor_ = file->message_type(12);
  static const int ComplexOptionType1_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType1, foo_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType1, foo2_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType1, foo3_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType1, foo4_),
  };
  ComplexOptionType1_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ComplexOptionType1_descriptor_,
      ComplexOptionType1::default_instance_,
      ComplexOptionType1_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType1, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType1, _unknown_fields_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType1, _extensions_),
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ComplexOptionType1));
  ComplexOptionType2_descriptor_ = file->message_type(13);
  static const int ComplexOptionType2_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2, bar_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2, baz_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2, fred_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2, barney_),
  };
  ComplexOptionType2_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ComplexOptionType2_descriptor_,
      ComplexOptionType2::default_instance_,
      ComplexOptionType2_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2, _unknown_fields_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2, _extensions_),
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ComplexOptionType2));
  ComplexOptionType2_ComplexOptionType4_descriptor_ = ComplexOptionType2_descriptor_->nested_type(0);
  static const int ComplexOptionType2_ComplexOptionType4_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2_ComplexOptionType4, waldo_),
  };
  ComplexOptionType2_ComplexOptionType4_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ComplexOptionType2_ComplexOptionType4_descriptor_,
      ComplexOptionType2_ComplexOptionType4::default_instance_,
      ComplexOptionType2_ComplexOptionType4_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2_ComplexOptionType4, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType2_ComplexOptionType4, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ComplexOptionType2_ComplexOptionType4));
  ComplexOptionType3_descriptor_ = file->message_type(14);
  static const int ComplexOptionType3_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType3, qux_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType3, complexoptiontype5_),
  };
  ComplexOptionType3_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ComplexOptionType3_descriptor_,
      ComplexOptionType3::default_instance_,
      ComplexOptionType3_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType3, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType3, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ComplexOptionType3));
  ComplexOptionType3_ComplexOptionType5_descriptor_ = ComplexOptionType3_descriptor_->nested_type(0);
  static const int ComplexOptionType3_ComplexOptionType5_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType3_ComplexOptionType5, plugh_),
  };
  ComplexOptionType3_ComplexOptionType5_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ComplexOptionType3_ComplexOptionType5_descriptor_,
      ComplexOptionType3_ComplexOptionType5::default_instance_,
      ComplexOptionType3_ComplexOptionType5_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType3_ComplexOptionType5, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOptionType3_ComplexOptionType5, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ComplexOptionType3_ComplexOptionType5));
  ComplexOpt6_descriptor_ = file->message_type(15);
  static const int ComplexOpt6_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOpt6, xyzzy_),
  };
  ComplexOpt6_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ComplexOpt6_descriptor_,
      ComplexOpt6::default_instance_,
      ComplexOpt6_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOpt6, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ComplexOpt6, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ComplexOpt6));
  VariousComplexOptions_descriptor_ = file->message_type(16);
  static const int VariousComplexOptions_offsets_[1] = {
  };
  VariousComplexOptions_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      VariousComplexOptions_descriptor_,
      VariousComplexOptions::default_instance_,
      VariousComplexOptions_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(VariousComplexOptions, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(VariousComplexOptions, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(VariousComplexOptions));
  AggregateMessageSet_descriptor_ = file->message_type(17);
  static const int AggregateMessageSet_offsets_[1] = {
  };
  AggregateMessageSet_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      AggregateMessageSet_descriptor_,
      AggregateMessageSet::default_instance_,
      AggregateMessageSet_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessageSet, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessageSet, _unknown_fields_),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessageSet, _extensions_),
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(AggregateMessageSet));
  AggregateMessageSetElement_descriptor_ = file->message_type(18);
  static const int AggregateMessageSetElement_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessageSetElement, s_),
  };
  AggregateMessageSetElement_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      AggregateMessageSetElement_descriptor_,
      AggregateMessageSetElement::default_instance_,
      AggregateMessageSetElement_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessageSetElement, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessageSetElement, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(AggregateMessageSetElement));
  Aggregate_descriptor_ = file->message_type(19);
  static const int Aggregate_offsets_[5] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Aggregate, i_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Aggregate, s_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Aggregate, sub_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Aggregate, file_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Aggregate, mset_),
  };
  Aggregate_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      Aggregate_descriptor_,
      Aggregate::default_instance_,
      Aggregate_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Aggregate, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(Aggregate, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(Aggregate));
  AggregateMessage_descriptor_ = file->message_type(20);
  static const int AggregateMessage_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessage, fieldname_),
  };
  AggregateMessage_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      AggregateMessage_descriptor_,
      AggregateMessage::default_instance_,
      AggregateMessage_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessage, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AggregateMessage, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(AggregateMessage));
  NestedOptionType_descriptor_ = file->message_type(21);
  static const int NestedOptionType_offsets_[1] = {
  };
  NestedOptionType_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      NestedOptionType_descriptor_,
      NestedOptionType::default_instance_,
      NestedOptionType_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NestedOptionType, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NestedOptionType, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(NestedOptionType));
  NestedOptionType_NestedMessage_descriptor_ = NestedOptionType_descriptor_->nested_type(0);
  static const int NestedOptionType_NestedMessage_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NestedOptionType_NestedMessage, nested_field_),
  };
  NestedOptionType_NestedMessage_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      NestedOptionType_NestedMessage_descriptor_,
      NestedOptionType_NestedMessage::default_instance_,
      NestedOptionType_NestedMessage_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NestedOptionType_NestedMessage, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(NestedOptionType_NestedMessage, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(NestedOptionType_NestedMessage));
  NestedOptionType_NestedEnum_descriptor_ = NestedOptionType_descriptor_->enum_type(0);
  MethodOpt1_descriptor_ = file->enum_type(0);
  AggregateEnum_descriptor_ = file->enum_type(1);
  TestServiceWithCustomOptions_descriptor_ = file->service(0);
  AggregateService_descriptor_ = file->service(1);
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    TestMessageWithCustomOptions_descriptor_, &TestMessageWithCustomOptions::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    CustomOptionFooRequest_descriptor_, &CustomOptionFooRequest::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    CustomOptionFooResponse_descriptor_, &CustomOptionFooResponse::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    CustomOptionFooClientMessage_descriptor_, &CustomOptionFooClientMessage::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    CustomOptionFooServerMessage_descriptor_, &CustomOptionFooServerMessage::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    DummyMessageContainingEnum_descriptor_, &DummyMessageContainingEnum::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    DummyMessageInvalidAsOptionType_descriptor_, &DummyMessageInvalidAsOptionType::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    CustomOptionMinIntegerValues_descriptor_, &CustomOptionMinIntegerValues::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    CustomOptionMaxIntegerValues_descriptor_, &CustomOptionMaxIntegerValues::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    CustomOptionOtherValues_descriptor_, &CustomOptionOtherValues::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    SettingRealsFromPositiveInts_descriptor_, &SettingRealsFromPositiveInts::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    SettingRealsFromNegativeInts_descriptor_, &SettingRealsFromNegativeInts::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ComplexOptionType1_descriptor_, &ComplexOptionType1::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ComplexOptionType2_descriptor_, &ComplexOptionType2::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ComplexOptionType2_ComplexOptionType4_descriptor_, &ComplexOptionType2_ComplexOptionType4::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ComplexOptionType3_descriptor_, &ComplexOptionType3::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ComplexOptionType3_ComplexOptionType5_descriptor_, &ComplexOptionType3_ComplexOptionType5::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ComplexOpt6_descriptor_, &ComplexOpt6::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    VariousComplexOptions_descriptor_, &VariousComplexOptions::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    AggregateMessageSet_descriptor_, &AggregateMessageSet::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    AggregateMessageSetElement_descriptor_, &AggregateMessageSetElement::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    Aggregate_descriptor_, &Aggregate::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    AggregateMessage_descriptor_, &AggregateMessage::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    NestedOptionType_descriptor_, &NestedOptionType::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    NestedOptionType_NestedMessage_descriptor_, &NestedOptionType_NestedMessage::default_instance());
}

}  // namespace

void protobuf_ShutdownFile_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto() {
  delete TestMessageWithCustomOptions::default_instance_;
  delete TestMessageWithCustomOptions_reflection_;
  delete CustomOptionFooRequest::default_instance_;
  delete CustomOptionFooRequest_reflection_;
  delete CustomOptionFooResponse::default_instance_;
  delete CustomOptionFooResponse_reflection_;
  delete CustomOptionFooClientMessage::default_instance_;
  delete CustomOptionFooClientMessage_reflection_;
  delete CustomOptionFooServerMessage::default_instance_;
  delete CustomOptionFooServerMessage_reflection_;
  delete DummyMessageContainingEnum::default_instance_;
  delete DummyMessageContainingEnum_reflection_;
  delete DummyMessageInvalidAsOptionType::default_instance_;
  delete DummyMessageInvalidAsOptionType_reflection_;
  delete CustomOptionMinIntegerValues::default_instance_;
  delete CustomOptionMinIntegerValues_reflection_;
  delete CustomOptionMaxIntegerValues::default_instance_;
  delete CustomOptionMaxIntegerValues_reflection_;
  delete CustomOptionOtherValues::default_instance_;
  delete CustomOptionOtherValues_reflection_;
  delete SettingRealsFromPositiveInts::default_instance_;
  delete SettingRealsFromPositiveInts_reflection_;
  delete SettingRealsFromNegativeInts::default_instance_;
  delete SettingRealsFromNegativeInts_reflection_;
  delete ComplexOptionType1::default_instance_;
  delete ComplexOptionType1_reflection_;
  delete ComplexOptionType2::default_instance_;
  delete ComplexOptionType2_reflection_;
  delete ComplexOptionType2_ComplexOptionType4::default_instance_;
  delete ComplexOptionType2_ComplexOptionType4_reflection_;
  delete ComplexOptionType3::default_instance_;
  delete ComplexOptionType3_reflection_;
  delete ComplexOptionType3_ComplexOptionType5::default_instance_;
  delete ComplexOptionType3_ComplexOptionType5_reflection_;
  delete ComplexOpt6::default_instance_;
  delete ComplexOpt6_reflection_;
  delete VariousComplexOptions::default_instance_;
  delete VariousComplexOptions_reflection_;
  delete AggregateMessageSet::default_instance_;
  delete AggregateMessageSet_reflection_;
  delete AggregateMessageSetElement::default_instance_;
  delete AggregateMessageSetElement_reflection_;
  delete Aggregate::default_instance_;
  delete Aggregate_reflection_;
  delete AggregateMessage::default_instance_;
  delete AggregateMessage_reflection_;
  delete NestedOptionType::default_instance_;
  delete NestedOptionType_reflection_;
  delete NestedOptionType_NestedMessage::default_instance_;
  delete NestedOptionType_NestedMessage_reflection_;
}

void protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n-google/protobuf/unittest_custom_option"
    "s.proto\022\021protobuf_unittest\032 google/proto"
    "buf/descriptor.proto\"\215\001\n\034TestMessageWith"
    "CustomOptions\022\036\n\006field1\030\001 \001(\tB\016\010\001\301\340\303\035-\341u"
    "\n\002\000\000\000\";\n\006AnEnum\022\017\n\013ANENUM_VAL1\020\001\022\026\n\013ANEN"
    "UM_VAL2\020\002\032\005\260\206\372\005{\032\010\305\366\311\035\353\374\377\377:\020\010\000\340\351\302\035\310\377\377\377\377\377"
    "\377\377\377\001\"\030\n\026CustomOptionFooRequest\"\031\n\027Custom"
    "OptionFooResponse\"\036\n\034CustomOptionFooClie"
    "ntMessage\"\036\n\034CustomOptionFooServerMessag"
    "e\"m\n\032DummyMessageContainingEnum\"O\n\014TestE"
    "numType\022\032\n\026TEST_OPTION_ENUM_TYPE1\020\026\022#\n\026T"
    "EST_OPTION_ENUM_TYPE2\020\351\377\377\377\377\377\377\377\377\001\"!\n\037Dumm"
    "yMessageInvalidAsOptionType\"\212\001\n\034CustomOp"
    "tionMinIntegerValues:j\320\336\262\035\000\350\306\262\035\200\200\200\200\370\377\377\377\377"
    "\001\260\274\262\035\200\200\200\200\200\200\200\200\200\001\200\223\262\035\000\370\365\260\035\000\200\304\260\035\377\377\377\377\017\370\227\260\035\377\377"
    "\377\377\377\377\377\377\377\001\235\365\257\035\000\000\000\000\221\356\257\035\000\000\000\000\000\000\000\000\255\215\257\035\000\000\000\200\231\326\250\035"
    "\000\000\000\000\000\000\000\200\"\221\001\n\034CustomOptionMaxIntegerValue"
    "s:q\320\336\262\035\001\350\306\262\035\377\377\377\377\007\260\274\262\035\377\377\377\377\377\377\377\377\177\200\223\262\035\377\377\377\377\017\370"
    "\365\260\035\377\377\377\377\377\377\377\377\377\001\200\304\260\035\376\377\377\377\017\370\227\260\035\376\377\377\377\377\377\377\377\377\001\235\365\257\035"
    "\377\377\377\377\221\356\257\035\377\377\377\377\377\377\377\377\255\215\257\035\377\377\377\177\231\326\250\035\377\377\377\377\377\377\377\177\"n\n\027"
    "CustomOptionOtherValues:S\350\306\262\035\234\377\377\377\377\377\377\377\377\001\365"
    "\337\243\035\347\207EA\351\334\242\035\373Y\214B\312\300\363\?\252\334\242\035\016Hello, \"World\"\262\331"
    "\242\035\013Hello\000World\210\331\242\035\351\377\377\377\377\377\377\377\377\001\"4\n\034SettingR"
    "ealsFromPositiveInts:\024\365\337\243\035\000\000@A\351\334\242\035\000\000\000\000\000@"
    "c@\"4\n\034SettingRealsFromNegativeInts:\024\365\337\243\035"
    "\000\000@\301\351\334\242\035\000\000\000\000\000@c\300\"U\n\022ComplexOptionType1\022\013"
    "\n\003foo\030\001 \001(\005\022\014\n\004foo2\030\002 \001(\005\022\014\n\004foo3\030\003 \001(\005\022"
    "\014\n\004foo4\030\004 \003(\005*\010\010d\020\200\200\200\200\002\"\213\003\n\022ComplexOptio"
    "nType2\0222\n\003bar\030\001 \001(\0132%.protobuf_unittest."
    "ComplexOptionType1\022\013\n\003baz\030\002 \001(\005\022F\n\004fred\030"
    "\003 \001(\01328.protobuf_unittest.ComplexOptionT"
    "ype2.ComplexOptionType4\022H\n\006barney\030\004 \003(\0132"
    "8.protobuf_unittest.ComplexOptionType2.C"
    "omplexOptionType4\032\227\001\n\022ComplexOptionType4"
    "\022\r\n\005waldo\030\001 \001(\0052r\n\014complex_opt4\022\037.google"
    ".protobuf.MessageOptions\030\212\365\321\003 \001(\01328.prot"
    "obuf_unittest.ComplexOptionType2.Complex"
    "OptionType4*\010\010d\020\200\200\200\200\002\"\234\001\n\022ComplexOptionT"
    "ype3\022\013\n\003qux\030\001 \001(\005\022T\n\022complexoptiontype5\030"
    "\002 \001(\n28.protobuf_unittest.ComplexOptionT"
    "ype3.ComplexOptionType5\032#\n\022ComplexOption"
    "Type5\022\r\n\005plugh\030\003 \001(\005\"\037\n\013ComplexOpt6\022\020\n\005x"
    "yzzy\030\337\277\317\003 \001(\005\"\361\001\n\025VariousComplexOptions:"
    "\327\001\242\342\225\035\002\010*\242\342\225\035\006\330\205\236\035\304\002\242\342\225\035\010\222\365\235\035\003\010\354\006\242\342\225\035\002 c"
    "\242\342\225\035\002 X\252\375\220\035\003\020\333\007\252\375\220\035\006\370\346\227\035\216\005\252\375\220\035\005\n\003\010\347\005\252\375\220\035"
    "\010\n\006\330\205\236\035\317\017\252\375\220\035\n\n\010\222\365\235\035\003\010\330\017\252\375\220\035\010\302\254\227\035\003\010\345\005\252\375\220"
    "\035\013\302\254\227\035\006\330\205\236\035\316\017\252\375\220\035\r\302\254\227\035\010\222\365\235\035\003\010\311\020\322\250\217\035\003\010\263\017\252"
    "\375\220\035\005\032\003\010\301\002\252\375\220\035\004\"\002\010e\252\375\220\035\005\"\003\010\324\001\372\336\220\035\002\010\t\372\336\220\035\004"
    "\023\030\026\024\343\334\374\034\370\375\373\034\030\344\334\374\034\"#\n\023AggregateMessageSet"
    "*\010\010\004\020\377\377\377\377\007:\002\010\001\"\240\001\n\032AggregateMessageSetEl"
    "ement\022\t\n\001s\030\001 \001(\t2w\n\025message_set_extensio"
    "n\022&.protobuf_unittest.AggregateMessageSe"
    "t\030\366\353\256\007 \001(\0132-.protobuf_unittest.Aggregate"
    "MessageSetElement\"\375\001\n\tAggregate\022\t\n\001i\030\001 \001"
    "(\005\022\t\n\001s\030\002 \001(\t\022)\n\003sub\030\003 \001(\0132\034.protobuf_un"
    "ittest.Aggregate\022*\n\004file\030\004 \001(\0132\034.google."
    "protobuf.FileOptions\0224\n\004mset\030\005 \001(\0132&.pro"
    "tobuf_unittest.AggregateMessageSet2M\n\006ne"
    "sted\022\034.google.protobuf.FileOptions\030\247\321\260\007 "
    "\001(\0132\034.protobuf_unittest.Aggregate\"Y\n\020Agg"
    "regateMessage\022)\n\tfieldname\030\001 \001(\005B\026\362\241\207;\021\022"
    "\017FieldAnnotation:\032\302\321\206;\025\010e\022\021MessageAnnota"
    "tion\"\311\001\n\020NestedOptionType\032;\n\rNestedMessa"
    "ge\022\"\n\014nested_field\030\001 \001(\005B\014\301\340\303\035\352\003\000\000\000\000\000\000:\006"
    "\340\351\302\035\351\007\"5\n\nNestedEnum\022\035\n\021NESTED_ENUM_VALU"
    "E\020\001\032\006\260\206\372\005\354\007\032\010\305\366\311\035\353\003\000\0002A\n\020nested_extensio"
    "n\022\034.google.protobuf.FileOptions\030\375\370\342\003 \001(\005"
    "B\006\310\213\312\035\355\007*6\n\nMethodOpt1\022\023\n\017METHODOPT1_VAL"
    "1\020\001\022\023\n\017METHODOPT1_VAL2\020\002*M\n\rAggregateEnu"
    "m\022%\n\005VALUE\020\001\032\032\312\374\211;\025\022\023EnumValueAnnotation"
    "\032\025\222\225\210;\020\022\016EnumAnnotation2\216\001\n\034TestServiceW"
    "ithCustomOptions\022c\n\003Foo\022).protobuf_unitt"
    "est.CustomOptionFooRequest\032*.protobuf_un"
    "ittest.CustomOptionFooResponse\"\005\340\372\214\036\002\032\t\220"
    "\262\213\036\323\333\200\313I2\231\001\n\020AggregateService\022k\n\006Method\022"
    "#.protobuf_unittest.AggregateMessage\032#.p"
    "rotobuf_unittest.AggregateMessage\"\027\312\310\226;\022"
    "\022\020MethodAnnotation\032\030\312\373\216;\023\022\021ServiceAnnota"
    "tion:2\n\tfile_opt1\022\034.google.protobuf.File"
    "Options\030\216\235\330\003 \001(\004:8\n\014message_opt1\022\037.googl"
    "e.protobuf.MessageOptions\030\234\255\330\003 \001(\005:4\n\nfi"
    "eld_opt1\022\035.google.protobuf.FieldOptions\030"
    "\210\274\330\003 \001(\006:8\n\nfield_opt2\022\035.google.protobuf"
    ".FieldOptions\030\271\241\331\003 \001(\005:\00242:2\n\tenum_opt1\022"
    "\034.google.protobuf.EnumOptions\030\350\236\331\003 \001(\017:<"
    "\n\017enum_value_opt1\022!.google.protobuf.Enum"
    "ValueOptions\030\346\240_ \001(\005:8\n\014service_opt1\022\037.g"
    "oogle.protobuf.ServiceOptions\030\242\266\341\003 \001(\022:U"
    "\n\013method_opt1\022\036.google.protobuf.MethodOp"
    "tions\030\254\317\341\003 \001(\0162\035.protobuf_unittest.Metho"
    "dOpt1:4\n\010bool_opt\022\037.google.protobuf.Mess"
    "ageOptions\030\352\253\326\003 \001(\010:5\n\tint32_opt\022\037.googl"
    "e.protobuf.MessageOptions\030\355\250\326\003 \001(\005:5\n\tin"
    "t64_opt\022\037.google.protobuf.MessageOptions"
    "\030\306\247\326\003 \001(\003:6\n\nuint32_opt\022\037.google.protobu"
    "f.MessageOptions\030\260\242\326\003 \001(\r:6\n\nuint64_opt\022"
    "\037.google.protobuf.MessageOptions\030\337\216\326\003 \001("
    "\004:6\n\nsint32_opt\022\037.google.protobuf.Messag"
    "eOptions\030\300\210\326\003 \001(\021:6\n\nsint64_opt\022\037.google"
    ".protobuf.MessageOptions\030\377\202\326\003 \001(\022:7\n\013fix"
    "ed32_opt\022\037.google.protobuf.MessageOption"
    "s\030\323\376\325\003 \001(\007:7\n\013fixed64_opt\022\037.google.proto"
    "buf.MessageOptions\030\342\375\325\003 \001(\006:8\n\014sfixed32_"
    "opt\022\037.google.protobuf.MessageOptions\030\325\361\325"
    "\003 \001(\017:8\n\014sfixed64_opt\022\037.google.protobuf."
    "MessageOptions\030\343\212\325\003 \001(\020:5\n\tfloat_opt\022\037.g"
    "oogle.protobuf.MessageOptions\030\376\273\324\003 \001(\002:6"
    "\n\ndouble_opt\022\037.google.protobuf.MessageOp"
    "tions\030\315\253\324\003 \001(\001:6\n\nstring_opt\022\037.google.pr"
    "otobuf.MessageOptions\030\305\253\324\003 \001(\t:5\n\tbytes_"
    "opt\022\037.google.protobuf.MessageOptions\030\226\253\324"
    "\003 \001(\014:p\n\010enum_opt\022\037.google.protobuf.Mess"
    "ageOptions\030\221\253\324\003 \001(\0162:.protobuf_unittest."
    "DummyMessageContainingEnum.TestEnumType:"
    "p\n\020message_type_opt\022\037.google.protobuf.Me"
    "ssageOptions\030\257\362\323\003 \001(\01322.protobuf_unittes"
    "t.DummyMessageInvalidAsOptionType:6\n\004quu"
    "x\022%.protobuf_unittest.ComplexOptionType1"
    "\030\333\340\323\003 \001(\005:^\n\005corge\022%.protobuf_unittest.C"
    "omplexOptionType1\030\322\336\323\003 \001(\0132%.protobuf_un"
    "ittest.ComplexOptionType3:8\n\006grault\022%.pr"
    "otobuf_unittest.ComplexOptionType2\030\357\374\322\003 "
    "\001(\005:_\n\006garply\022%.protobuf_unittest.Comple"
    "xOptionType2\030\310\365\322\003 \001(\0132%.protobuf_unittes"
    "t.ComplexOptionType1:_\n\014complex_opt1\022\037.g"
    "oogle.protobuf.MessageOptions\030\244\334\322\003 \001(\0132%"
    ".protobuf_unittest.ComplexOptionType1:_\n"
    "\014complex_opt2\022\037.google.protobuf.MessageO"
    "ptions\030\325\217\322\003 \001(\0132%.protobuf_unittest.Comp"
    "lexOptionType2:_\n\014complex_opt3\022\037.google."
    "protobuf.MessageOptions\030\357\213\322\003 \001(\0132%.proto"
    "buf_unittest.ComplexOptionType3:W\n\013compl"
    "exopt6\022\037.google.protobuf.MessageOptions\030"
    "\314\313\317\003 \001(\n2\036.protobuf_unittest.ComplexOpt6"
    ":N\n\007fileopt\022\034.google.protobuf.FileOption"
    "s\030\317\335\260\007 \001(\0132\034.protobuf_unittest.Aggregate"
    ":P\n\006msgopt\022\037.google.protobuf.MessageOpti"
    "ons\030\230\352\260\007 \001(\0132\034.protobuf_unittest.Aggrega"
    "te:P\n\010fieldopt\022\035.google.protobuf.FieldOp"
    "tions\030\236\364\260\007 \001(\0132\034.protobuf_unittest.Aggre"
    "gate:N\n\007enumopt\022\034.google.protobuf.EnumOp"
    "tions\030\322\202\261\007 \001(\0132\034.protobuf_unittest.Aggre"
    "gate:V\n\nenumvalopt\022!.google.protobuf.Enu"
    "mValueOptions\030\311\237\261\007 \001(\0132\034.protobuf_unitte"
    "st.Aggregate:T\n\nserviceopt\022\037.google.prot"
    "obuf.ServiceOptions\030\271\357\261\007 \001(\0132\034.protobuf_"
    "unittest.Aggregate:R\n\tmethodopt\022\036.google"
    ".protobuf.MethodOptions\030\211\351\262\007 \001(\0132\034.proto"
    "buf_unittest.AggregateB\207\001\200\001\001\210\001\001\220\001\001\360\350\301\035\352\255"
    "\300\345$\372\354\205;p\010d\022\016FileAnnotation\032\026\022\024NestedFile"
    "Annotation\"\036\372\354\205;\031\022\027FileExtensionAnnotati"
    "on*$\013\020\366\353\256\007\032\033\n\031EmbeddedMessageSetElement\014", 6080);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "google/protobuf/unittest_custom_options.proto", &protobuf_RegisterTypes);
  TestMessageWithCustomOptions::default_instance_ = new TestMessageWithCustomOptions();
  CustomOptionFooRequest::default_instance_ = new CustomOptionFooRequest();
  CustomOptionFooResponse::default_instance_ = new CustomOptionFooResponse();
  CustomOptionFooClientMessage::default_instance_ = new CustomOptionFooClientMessage();
  CustomOptionFooServerMessage::default_instance_ = new CustomOptionFooServerMessage();
  DummyMessageContainingEnum::default_instance_ = new DummyMessageContainingEnum();
  DummyMessageInvalidAsOptionType::default_instance_ = new DummyMessageInvalidAsOptionType();
  CustomOptionMinIntegerValues::default_instance_ = new CustomOptionMinIntegerValues();
  CustomOptionMaxIntegerValues::default_instance_ = new CustomOptionMaxIntegerValues();
  CustomOptionOtherValues::default_instance_ = new CustomOptionOtherValues();
  SettingRealsFromPositiveInts::default_instance_ = new SettingRealsFromPositiveInts();
  SettingRealsFromNegativeInts::default_instance_ = new SettingRealsFromNegativeInts();
  ComplexOptionType1::default_instance_ = new ComplexOptionType1();
  ComplexOptionType2::default_instance_ = new ComplexOptionType2();
  ComplexOptionType2_ComplexOptionType4::default_instance_ = new ComplexOptionType2_ComplexOptionType4();
  ComplexOptionType3::default_instance_ = new ComplexOptionType3();
  ComplexOptionType3_ComplexOptionType5::default_instance_ = new ComplexOptionType3_ComplexOptionType5();
  ComplexOpt6::default_instance_ = new ComplexOpt6();
  VariousComplexOptions::default_instance_ = new VariousComplexOptions();
  AggregateMessageSet::default_instance_ = new AggregateMessageSet();
  AggregateMessageSetElement::default_instance_ = new AggregateMessageSetElement();
  Aggregate::default_instance_ = new Aggregate();
  AggregateMessage::default_instance_ = new AggregateMessage();
  NestedOptionType::default_instance_ = new NestedOptionType();
  NestedOptionType_NestedMessage::default_instance_ = new NestedOptionType_NestedMessage();
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::FileOptions::default_instance(),
    7736974, 4, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7739036, 5, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::FieldOptions::default_instance(),
    7740936, 6, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::FieldOptions::default_instance(),
    7753913, 5, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::EnumOptions::default_instance(),
    7753576, 15, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::EnumValueOptions::default_instance(),
    1560678, 5, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::ServiceOptions::default_instance(),
    7887650, 18, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterEnumExtension(
    &::google::protobuf::MethodOptions::default_instance(),
    7890860, 14, false, false,
    &::protobuf_unittest::MethodOpt1_IsValid);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7706090, 8, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7705709, 5, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7705542, 3, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7704880, 13, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7702367, 4, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7701568, 17, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7700863, 18, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7700307, 7, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7700194, 6, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7698645, 15, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7685475, 16, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7675390, 2, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7673293, 1, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7673285, 9, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7673238, 12, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterEnumExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7673233, 14, false, false,
    &::protobuf_unittest::DummyMessageContainingEnum_TestEnumType_IsValid);
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7665967, 11, false, false,
    &::protobuf_unittest::DummyMessageInvalidAsOptionType::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::protobuf_unittest::ComplexOptionType1::default_instance(),
    7663707, 5, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::protobuf_unittest::ComplexOptionType1::default_instance(),
    7663442, 11, false, false,
    &::protobuf_unittest::ComplexOptionType3::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::protobuf_unittest::ComplexOptionType2::default_instance(),
    7650927, 5, false, false);
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::protobuf_unittest::ComplexOptionType2::default_instance(),
    7649992, 11, false, false,
    &::protobuf_unittest::ComplexOptionType1::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7646756, 11, false, false,
    &::protobuf_unittest::ComplexOptionType1::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7636949, 11, false, false,
    &::protobuf_unittest::ComplexOptionType2::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7636463, 11, false, false,
    &::protobuf_unittest::ComplexOptionType3::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7595468, 10, false, false,
    &::protobuf_unittest::ComplexOpt6::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::FileOptions::default_instance(),
    15478479, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    15480088, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::FieldOptions::default_instance(),
    15481374, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::EnumOptions::default_instance(),
    15483218, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::EnumValueOptions::default_instance(),
    15486921, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::ServiceOptions::default_instance(),
    15497145, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MethodOptions::default_instance(),
    15512713, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  TestMessageWithCustomOptions::default_instance_->InitAsDefaultInstance();
  CustomOptionFooRequest::default_instance_->InitAsDefaultInstance();
  CustomOptionFooResponse::default_instance_->InitAsDefaultInstance();
  CustomOptionFooClientMessage::default_instance_->InitAsDefaultInstance();
  CustomOptionFooServerMessage::default_instance_->InitAsDefaultInstance();
  DummyMessageContainingEnum::default_instance_->InitAsDefaultInstance();
  DummyMessageInvalidAsOptionType::default_instance_->InitAsDefaultInstance();
  CustomOptionMinIntegerValues::default_instance_->InitAsDefaultInstance();
  CustomOptionMaxIntegerValues::default_instance_->InitAsDefaultInstance();
  CustomOptionOtherValues::default_instance_->InitAsDefaultInstance();
  SettingRealsFromPositiveInts::default_instance_->InitAsDefaultInstance();
  SettingRealsFromNegativeInts::default_instance_->InitAsDefaultInstance();
  ComplexOptionType1::default_instance_->InitAsDefaultInstance();
  ComplexOptionType2::default_instance_->InitAsDefaultInstance();
  ComplexOptionType2_ComplexOptionType4::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::MessageOptions::default_instance(),
    7633546, 11, false, false,
    &::protobuf_unittest::ComplexOptionType2_ComplexOptionType4::default_instance());
  ComplexOptionType3::default_instance_->InitAsDefaultInstance();
  ComplexOptionType3_ComplexOptionType5::default_instance_->InitAsDefaultInstance();
  ComplexOpt6::default_instance_->InitAsDefaultInstance();
  VariousComplexOptions::default_instance_->InitAsDefaultInstance();
  AggregateMessageSet::default_instance_->InitAsDefaultInstance();
  AggregateMessageSetElement::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::protobuf_unittest::AggregateMessageSet::default_instance(),
    15447542, 11, false, false,
    &::protobuf_unittest::AggregateMessageSetElement::default_instance());
  Aggregate::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::ExtensionSet::RegisterMessageExtension(
    &::google::protobuf::FileOptions::default_instance(),
    15476903, 11, false, false,
    &::protobuf_unittest::Aggregate::default_instance());
  AggregateMessage::default_instance_->InitAsDefaultInstance();
  NestedOptionType::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::ExtensionSet::RegisterExtension(
    &::google::protobuf::FileOptions::default_instance(),
    7912573, 5, false, false);
  NestedOptionType_NestedMessage::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto {
  StaticDescriptorInitializer_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto() {
    protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  }
} static_descriptor_initializer_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto_;
const ::google::protobuf::EnumDescriptor* MethodOpt1_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return MethodOpt1_descriptor_;
}
bool MethodOpt1_IsValid(int value) {
  switch(value) {
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

const ::google::protobuf::EnumDescriptor* AggregateEnum_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AggregateEnum_descriptor_;
}
bool AggregateEnum_IsValid(int value) {
  switch(value) {
    case 1:
      return true;
    default:
      return false;
  }
}

// ===================================================================

const ::google::protobuf::EnumDescriptor* TestMessageWithCustomOptions_AnEnum_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return TestMessageWithCustomOptions_AnEnum_descriptor_;
}
bool TestMessageWithCustomOptions_AnEnum_IsValid(int value) {
  switch(value) {
    case 1:
    case 2:
      return true;
    default:
      return false;
  }
}

#ifndef _MSC_VER
const TestMessageWithCustomOptions_AnEnum TestMessageWithCustomOptions::ANENUM_VAL1;
const TestMessageWithCustomOptions_AnEnum TestMessageWithCustomOptions::ANENUM_VAL2;
const TestMessageWithCustomOptions_AnEnum TestMessageWithCustomOptions::AnEnum_MIN;
const TestMessageWithCustomOptions_AnEnum TestMessageWithCustomOptions::AnEnum_MAX;
const int TestMessageWithCustomOptions::AnEnum_ARRAYSIZE;
#endif  // _MSC_VER
#ifndef _MSC_VER
const int TestMessageWithCustomOptions::kField1FieldNumber;
#endif  // !_MSC_VER

TestMessageWithCustomOptions::TestMessageWithCustomOptions()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.TestMessageWithCustomOptions)
}

void TestMessageWithCustomOptions::InitAsDefaultInstance() {
}

TestMessageWithCustomOptions::TestMessageWithCustomOptions(const TestMessageWithCustomOptions& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.TestMessageWithCustomOptions)
}

void TestMessageWithCustomOptions::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  field1_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

TestMessageWithCustomOptions::~TestMessageWithCustomOptions() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.TestMessageWithCustomOptions)
  SharedDtor();
}

void TestMessageWithCustomOptions::SharedDtor() {
  if (field1_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
    delete field1_;
  }
  if (this != default_instance_) {
  }
}

void TestMessageWithCustomOptions::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* TestMessageWithCustomOptions::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return TestMessageWithCustomOptions_descriptor_;
}

const TestMessageWithCustomOptions& TestMessageWithCustomOptions::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

TestMessageWithCustomOptions* TestMessageWithCustomOptions::default_instance_ = NULL;

TestMessageWithCustomOptions* TestMessageWithCustomOptions::New() const {
  return new TestMessageWithCustomOptions;
}

void TestMessageWithCustomOptions::Clear() {
  if (has_field1()) {
    if (field1_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      field1_->clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool TestMessageWithCustomOptions::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.TestMessageWithCustomOptions)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string field1 = 1 [ctype = CORD];
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_field1()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->field1().data(), this->field1().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "field1");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.TestMessageWithCustomOptions)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.TestMessageWithCustomOptions)
  return false;
#undef DO_
}

void TestMessageWithCustomOptions::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.TestMessageWithCustomOptions)
  // optional string field1 = 1 [ctype = CORD];
  if (has_field1()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->field1().data(), this->field1().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "field1");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->field1(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.TestMessageWithCustomOptions)
}

::google::protobuf::uint8* TestMessageWithCustomOptions::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.TestMessageWithCustomOptions)
  // optional string field1 = 1 [ctype = CORD];
  if (has_field1()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->field1().data(), this->field1().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "field1");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->field1(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.TestMessageWithCustomOptions)
  return target;
}

int TestMessageWithCustomOptions::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional string field1 = 1 [ctype = CORD];
    if (has_field1()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->field1());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void TestMessageWithCustomOptions::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const TestMessageWithCustomOptions* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const TestMessageWithCustomOptions*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void TestMessageWithCustomOptions::MergeFrom(const TestMessageWithCustomOptions& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_field1()) {
      set_field1(from.field1());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void TestMessageWithCustomOptions::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void TestMessageWithCustomOptions::CopyFrom(const TestMessageWithCustomOptions& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool TestMessageWithCustomOptions::IsInitialized() const {

  return true;
}

void TestMessageWithCustomOptions::Swap(TestMessageWithCustomOptions* other) {
  if (other != this) {
    std::swap(field1_, other->field1_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata TestMessageWithCustomOptions::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = TestMessageWithCustomOptions_descriptor_;
  metadata.reflection = TestMessageWithCustomOptions_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

CustomOptionFooRequest::CustomOptionFooRequest()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.CustomOptionFooRequest)
}

void CustomOptionFooRequest::InitAsDefaultInstance() {
}

CustomOptionFooRequest::CustomOptionFooRequest(const CustomOptionFooRequest& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.CustomOptionFooRequest)
}

void CustomOptionFooRequest::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CustomOptionFooRequest::~CustomOptionFooRequest() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.CustomOptionFooRequest)
  SharedDtor();
}

void CustomOptionFooRequest::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CustomOptionFooRequest::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CustomOptionFooRequest::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CustomOptionFooRequest_descriptor_;
}

const CustomOptionFooRequest& CustomOptionFooRequest::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

CustomOptionFooRequest* CustomOptionFooRequest::default_instance_ = NULL;

CustomOptionFooRequest* CustomOptionFooRequest::New() const {
  return new CustomOptionFooRequest;
}

void CustomOptionFooRequest::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CustomOptionFooRequest::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.CustomOptionFooRequest)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.CustomOptionFooRequest)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.CustomOptionFooRequest)
  return false;
#undef DO_
}

void CustomOptionFooRequest::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.CustomOptionFooRequest)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.CustomOptionFooRequest)
}

::google::protobuf::uint8* CustomOptionFooRequest::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.CustomOptionFooRequest)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.CustomOptionFooRequest)
  return target;
}

int CustomOptionFooRequest::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void CustomOptionFooRequest::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const CustomOptionFooRequest* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const CustomOptionFooRequest*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void CustomOptionFooRequest::MergeFrom(const CustomOptionFooRequest& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void CustomOptionFooRequest::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CustomOptionFooRequest::CopyFrom(const CustomOptionFooRequest& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CustomOptionFooRequest::IsInitialized() const {

  return true;
}

void CustomOptionFooRequest::Swap(CustomOptionFooRequest* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata CustomOptionFooRequest::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CustomOptionFooRequest_descriptor_;
  metadata.reflection = CustomOptionFooRequest_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

CustomOptionFooResponse::CustomOptionFooResponse()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.CustomOptionFooResponse)
}

void CustomOptionFooResponse::InitAsDefaultInstance() {
}

CustomOptionFooResponse::CustomOptionFooResponse(const CustomOptionFooResponse& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.CustomOptionFooResponse)
}

void CustomOptionFooResponse::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CustomOptionFooResponse::~CustomOptionFooResponse() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.CustomOptionFooResponse)
  SharedDtor();
}

void CustomOptionFooResponse::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CustomOptionFooResponse::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CustomOptionFooResponse::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CustomOptionFooResponse_descriptor_;
}

const CustomOptionFooResponse& CustomOptionFooResponse::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

CustomOptionFooResponse* CustomOptionFooResponse::default_instance_ = NULL;

CustomOptionFooResponse* CustomOptionFooResponse::New() const {
  return new CustomOptionFooResponse;
}

void CustomOptionFooResponse::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CustomOptionFooResponse::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.CustomOptionFooResponse)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.CustomOptionFooResponse)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.CustomOptionFooResponse)
  return false;
#undef DO_
}

void CustomOptionFooResponse::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.CustomOptionFooResponse)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.CustomOptionFooResponse)
}

::google::protobuf::uint8* CustomOptionFooResponse::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.CustomOptionFooResponse)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.CustomOptionFooResponse)
  return target;
}

int CustomOptionFooResponse::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void CustomOptionFooResponse::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const CustomOptionFooResponse* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const CustomOptionFooResponse*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void CustomOptionFooResponse::MergeFrom(const CustomOptionFooResponse& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void CustomOptionFooResponse::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CustomOptionFooResponse::CopyFrom(const CustomOptionFooResponse& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CustomOptionFooResponse::IsInitialized() const {

  return true;
}

void CustomOptionFooResponse::Swap(CustomOptionFooResponse* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata CustomOptionFooResponse::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CustomOptionFooResponse_descriptor_;
  metadata.reflection = CustomOptionFooResponse_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

CustomOptionFooClientMessage::CustomOptionFooClientMessage()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.CustomOptionFooClientMessage)
}

void CustomOptionFooClientMessage::InitAsDefaultInstance() {
}

CustomOptionFooClientMessage::CustomOptionFooClientMessage(const CustomOptionFooClientMessage& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.CustomOptionFooClientMessage)
}

void CustomOptionFooClientMessage::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CustomOptionFooClientMessage::~CustomOptionFooClientMessage() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.CustomOptionFooClientMessage)
  SharedDtor();
}

void CustomOptionFooClientMessage::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CustomOptionFooClientMessage::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CustomOptionFooClientMessage::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CustomOptionFooClientMessage_descriptor_;
}

const CustomOptionFooClientMessage& CustomOptionFooClientMessage::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

CustomOptionFooClientMessage* CustomOptionFooClientMessage::default_instance_ = NULL;

CustomOptionFooClientMessage* CustomOptionFooClientMessage::New() const {
  return new CustomOptionFooClientMessage;
}

void CustomOptionFooClientMessage::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CustomOptionFooClientMessage::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.CustomOptionFooClientMessage)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.CustomOptionFooClientMessage)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.CustomOptionFooClientMessage)
  return false;
#undef DO_
}

void CustomOptionFooClientMessage::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.CustomOptionFooClientMessage)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.CustomOptionFooClientMessage)
}

::google::protobuf::uint8* CustomOptionFooClientMessage::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.CustomOptionFooClientMessage)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.CustomOptionFooClientMessage)
  return target;
}

int CustomOptionFooClientMessage::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void CustomOptionFooClientMessage::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const CustomOptionFooClientMessage* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const CustomOptionFooClientMessage*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void CustomOptionFooClientMessage::MergeFrom(const CustomOptionFooClientMessage& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void CustomOptionFooClientMessage::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CustomOptionFooClientMessage::CopyFrom(const CustomOptionFooClientMessage& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CustomOptionFooClientMessage::IsInitialized() const {

  return true;
}

void CustomOptionFooClientMessage::Swap(CustomOptionFooClientMessage* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata CustomOptionFooClientMessage::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CustomOptionFooClientMessage_descriptor_;
  metadata.reflection = CustomOptionFooClientMessage_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

CustomOptionFooServerMessage::CustomOptionFooServerMessage()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.CustomOptionFooServerMessage)
}

void CustomOptionFooServerMessage::InitAsDefaultInstance() {
}

CustomOptionFooServerMessage::CustomOptionFooServerMessage(const CustomOptionFooServerMessage& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.CustomOptionFooServerMessage)
}

void CustomOptionFooServerMessage::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CustomOptionFooServerMessage::~CustomOptionFooServerMessage() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.CustomOptionFooServerMessage)
  SharedDtor();
}

void CustomOptionFooServerMessage::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CustomOptionFooServerMessage::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CustomOptionFooServerMessage::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CustomOptionFooServerMessage_descriptor_;
}

const CustomOptionFooServerMessage& CustomOptionFooServerMessage::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

CustomOptionFooServerMessage* CustomOptionFooServerMessage::default_instance_ = NULL;

CustomOptionFooServerMessage* CustomOptionFooServerMessage::New() const {
  return new CustomOptionFooServerMessage;
}

void CustomOptionFooServerMessage::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CustomOptionFooServerMessage::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.CustomOptionFooServerMessage)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.CustomOptionFooServerMessage)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.CustomOptionFooServerMessage)
  return false;
#undef DO_
}

void CustomOptionFooServerMessage::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.CustomOptionFooServerMessage)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.CustomOptionFooServerMessage)
}

::google::protobuf::uint8* CustomOptionFooServerMessage::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.CustomOptionFooServerMessage)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.CustomOptionFooServerMessage)
  return target;
}

int CustomOptionFooServerMessage::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void CustomOptionFooServerMessage::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const CustomOptionFooServerMessage* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const CustomOptionFooServerMessage*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void CustomOptionFooServerMessage::MergeFrom(const CustomOptionFooServerMessage& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void CustomOptionFooServerMessage::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CustomOptionFooServerMessage::CopyFrom(const CustomOptionFooServerMessage& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CustomOptionFooServerMessage::IsInitialized() const {

  return true;
}

void CustomOptionFooServerMessage::Swap(CustomOptionFooServerMessage* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata CustomOptionFooServerMessage::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CustomOptionFooServerMessage_descriptor_;
  metadata.reflection = CustomOptionFooServerMessage_reflection_;
  return metadata;
}

// ===================================================================

const ::google::protobuf::EnumDescriptor* DummyMessageContainingEnum_TestEnumType_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return DummyMessageContainingEnum_TestEnumType_descriptor_;
}
bool DummyMessageContainingEnum_TestEnumType_IsValid(int value) {
  switch(value) {
    case -23:
    case 22:
      return true;
    default:
      return false;
  }
}

#ifndef _MSC_VER
const DummyMessageContainingEnum_TestEnumType DummyMessageContainingEnum::TEST_OPTION_ENUM_TYPE1;
const DummyMessageContainingEnum_TestEnumType DummyMessageContainingEnum::TEST_OPTION_ENUM_TYPE2;
const DummyMessageContainingEnum_TestEnumType DummyMessageContainingEnum::TestEnumType_MIN;
const DummyMessageContainingEnum_TestEnumType DummyMessageContainingEnum::TestEnumType_MAX;
const int DummyMessageContainingEnum::TestEnumType_ARRAYSIZE;
#endif  // _MSC_VER
#ifndef _MSC_VER
#endif  // !_MSC_VER

DummyMessageContainingEnum::DummyMessageContainingEnum()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.DummyMessageContainingEnum)
}

void DummyMessageContainingEnum::InitAsDefaultInstance() {
}

DummyMessageContainingEnum::DummyMessageContainingEnum(const DummyMessageContainingEnum& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.DummyMessageContainingEnum)
}

void DummyMessageContainingEnum::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

DummyMessageContainingEnum::~DummyMessageContainingEnum() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.DummyMessageContainingEnum)
  SharedDtor();
}

void DummyMessageContainingEnum::SharedDtor() {
  if (this != default_instance_) {
  }
}

void DummyMessageContainingEnum::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* DummyMessageContainingEnum::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return DummyMessageContainingEnum_descriptor_;
}

const DummyMessageContainingEnum& DummyMessageContainingEnum::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

DummyMessageContainingEnum* DummyMessageContainingEnum::default_instance_ = NULL;

DummyMessageContainingEnum* DummyMessageContainingEnum::New() const {
  return new DummyMessageContainingEnum;
}

void DummyMessageContainingEnum::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool DummyMessageContainingEnum::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.DummyMessageContainingEnum)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.DummyMessageContainingEnum)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.DummyMessageContainingEnum)
  return false;
#undef DO_
}

void DummyMessageContainingEnum::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.DummyMessageContainingEnum)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.DummyMessageContainingEnum)
}

::google::protobuf::uint8* DummyMessageContainingEnum::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.DummyMessageContainingEnum)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.DummyMessageContainingEnum)
  return target;
}

int DummyMessageContainingEnum::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void DummyMessageContainingEnum::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const DummyMessageContainingEnum* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const DummyMessageContainingEnum*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void DummyMessageContainingEnum::MergeFrom(const DummyMessageContainingEnum& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void DummyMessageContainingEnum::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void DummyMessageContainingEnum::CopyFrom(const DummyMessageContainingEnum& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DummyMessageContainingEnum::IsInitialized() const {

  return true;
}

void DummyMessageContainingEnum::Swap(DummyMessageContainingEnum* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata DummyMessageContainingEnum::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = DummyMessageContainingEnum_descriptor_;
  metadata.reflection = DummyMessageContainingEnum_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

DummyMessageInvalidAsOptionType::DummyMessageInvalidAsOptionType()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.DummyMessageInvalidAsOptionType)
}

void DummyMessageInvalidAsOptionType::InitAsDefaultInstance() {
}

DummyMessageInvalidAsOptionType::DummyMessageInvalidAsOptionType(const DummyMessageInvalidAsOptionType& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.DummyMessageInvalidAsOptionType)
}

void DummyMessageInvalidAsOptionType::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

DummyMessageInvalidAsOptionType::~DummyMessageInvalidAsOptionType() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.DummyMessageInvalidAsOptionType)
  SharedDtor();
}

void DummyMessageInvalidAsOptionType::SharedDtor() {
  if (this != default_instance_) {
  }
}

void DummyMessageInvalidAsOptionType::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* DummyMessageInvalidAsOptionType::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return DummyMessageInvalidAsOptionType_descriptor_;
}

const DummyMessageInvalidAsOptionType& DummyMessageInvalidAsOptionType::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

DummyMessageInvalidAsOptionType* DummyMessageInvalidAsOptionType::default_instance_ = NULL;

DummyMessageInvalidAsOptionType* DummyMessageInvalidAsOptionType::New() const {
  return new DummyMessageInvalidAsOptionType;
}

void DummyMessageInvalidAsOptionType::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool DummyMessageInvalidAsOptionType::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.DummyMessageInvalidAsOptionType)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.DummyMessageInvalidAsOptionType)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.DummyMessageInvalidAsOptionType)
  return false;
#undef DO_
}

void DummyMessageInvalidAsOptionType::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.DummyMessageInvalidAsOptionType)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.DummyMessageInvalidAsOptionType)
}

::google::protobuf::uint8* DummyMessageInvalidAsOptionType::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.DummyMessageInvalidAsOptionType)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.DummyMessageInvalidAsOptionType)
  return target;
}

int DummyMessageInvalidAsOptionType::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void DummyMessageInvalidAsOptionType::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const DummyMessageInvalidAsOptionType* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const DummyMessageInvalidAsOptionType*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void DummyMessageInvalidAsOptionType::MergeFrom(const DummyMessageInvalidAsOptionType& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void DummyMessageInvalidAsOptionType::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void DummyMessageInvalidAsOptionType::CopyFrom(const DummyMessageInvalidAsOptionType& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool DummyMessageInvalidAsOptionType::IsInitialized() const {

  return true;
}

void DummyMessageInvalidAsOptionType::Swap(DummyMessageInvalidAsOptionType* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata DummyMessageInvalidAsOptionType::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = DummyMessageInvalidAsOptionType_descriptor_;
  metadata.reflection = DummyMessageInvalidAsOptionType_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

CustomOptionMinIntegerValues::CustomOptionMinIntegerValues()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.CustomOptionMinIntegerValues)
}

void CustomOptionMinIntegerValues::InitAsDefaultInstance() {
}

CustomOptionMinIntegerValues::CustomOptionMinIntegerValues(const CustomOptionMinIntegerValues& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.CustomOptionMinIntegerValues)
}

void CustomOptionMinIntegerValues::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CustomOptionMinIntegerValues::~CustomOptionMinIntegerValues() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.CustomOptionMinIntegerValues)
  SharedDtor();
}

void CustomOptionMinIntegerValues::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CustomOptionMinIntegerValues::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CustomOptionMinIntegerValues::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CustomOptionMinIntegerValues_descriptor_;
}

const CustomOptionMinIntegerValues& CustomOptionMinIntegerValues::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

CustomOptionMinIntegerValues* CustomOptionMinIntegerValues::default_instance_ = NULL;

CustomOptionMinIntegerValues* CustomOptionMinIntegerValues::New() const {
  return new CustomOptionMinIntegerValues;
}

void CustomOptionMinIntegerValues::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CustomOptionMinIntegerValues::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.CustomOptionMinIntegerValues)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.CustomOptionMinIntegerValues)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.CustomOptionMinIntegerValues)
  return false;
#undef DO_
}

void CustomOptionMinIntegerValues::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.CustomOptionMinIntegerValues)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.CustomOptionMinIntegerValues)
}

::google::protobuf::uint8* CustomOptionMinIntegerValues::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.CustomOptionMinIntegerValues)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.CustomOptionMinIntegerValues)
  return target;
}

int CustomOptionMinIntegerValues::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void CustomOptionMinIntegerValues::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const CustomOptionMinIntegerValues* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const CustomOptionMinIntegerValues*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void CustomOptionMinIntegerValues::MergeFrom(const CustomOptionMinIntegerValues& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void CustomOptionMinIntegerValues::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CustomOptionMinIntegerValues::CopyFrom(const CustomOptionMinIntegerValues& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CustomOptionMinIntegerValues::IsInitialized() const {

  return true;
}

void CustomOptionMinIntegerValues::Swap(CustomOptionMinIntegerValues* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata CustomOptionMinIntegerValues::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CustomOptionMinIntegerValues_descriptor_;
  metadata.reflection = CustomOptionMinIntegerValues_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

CustomOptionMaxIntegerValues::CustomOptionMaxIntegerValues()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.CustomOptionMaxIntegerValues)
}

void CustomOptionMaxIntegerValues::InitAsDefaultInstance() {
}

CustomOptionMaxIntegerValues::CustomOptionMaxIntegerValues(const CustomOptionMaxIntegerValues& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.CustomOptionMaxIntegerValues)
}

void CustomOptionMaxIntegerValues::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CustomOptionMaxIntegerValues::~CustomOptionMaxIntegerValues() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.CustomOptionMaxIntegerValues)
  SharedDtor();
}

void CustomOptionMaxIntegerValues::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CustomOptionMaxIntegerValues::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CustomOptionMaxIntegerValues::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CustomOptionMaxIntegerValues_descriptor_;
}

const CustomOptionMaxIntegerValues& CustomOptionMaxIntegerValues::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

CustomOptionMaxIntegerValues* CustomOptionMaxIntegerValues::default_instance_ = NULL;

CustomOptionMaxIntegerValues* CustomOptionMaxIntegerValues::New() const {
  return new CustomOptionMaxIntegerValues;
}

void CustomOptionMaxIntegerValues::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CustomOptionMaxIntegerValues::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.CustomOptionMaxIntegerValues)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.CustomOptionMaxIntegerValues)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.CustomOptionMaxIntegerValues)
  return false;
#undef DO_
}

void CustomOptionMaxIntegerValues::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.CustomOptionMaxIntegerValues)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.CustomOptionMaxIntegerValues)
}

::google::protobuf::uint8* CustomOptionMaxIntegerValues::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.CustomOptionMaxIntegerValues)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.CustomOptionMaxIntegerValues)
  return target;
}

int CustomOptionMaxIntegerValues::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void CustomOptionMaxIntegerValues::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const CustomOptionMaxIntegerValues* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const CustomOptionMaxIntegerValues*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void CustomOptionMaxIntegerValues::MergeFrom(const CustomOptionMaxIntegerValues& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void CustomOptionMaxIntegerValues::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CustomOptionMaxIntegerValues::CopyFrom(const CustomOptionMaxIntegerValues& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CustomOptionMaxIntegerValues::IsInitialized() const {

  return true;
}

void CustomOptionMaxIntegerValues::Swap(CustomOptionMaxIntegerValues* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata CustomOptionMaxIntegerValues::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CustomOptionMaxIntegerValues_descriptor_;
  metadata.reflection = CustomOptionMaxIntegerValues_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

CustomOptionOtherValues::CustomOptionOtherValues()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.CustomOptionOtherValues)
}

void CustomOptionOtherValues::InitAsDefaultInstance() {
}

CustomOptionOtherValues::CustomOptionOtherValues(const CustomOptionOtherValues& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.CustomOptionOtherValues)
}

void CustomOptionOtherValues::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

CustomOptionOtherValues::~CustomOptionOtherValues() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.CustomOptionOtherValues)
  SharedDtor();
}

void CustomOptionOtherValues::SharedDtor() {
  if (this != default_instance_) {
  }
}

void CustomOptionOtherValues::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* CustomOptionOtherValues::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return CustomOptionOtherValues_descriptor_;
}

const CustomOptionOtherValues& CustomOptionOtherValues::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

CustomOptionOtherValues* CustomOptionOtherValues::default_instance_ = NULL;

CustomOptionOtherValues* CustomOptionOtherValues::New() const {
  return new CustomOptionOtherValues;
}

void CustomOptionOtherValues::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool CustomOptionOtherValues::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.CustomOptionOtherValues)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.CustomOptionOtherValues)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.CustomOptionOtherValues)
  return false;
#undef DO_
}

void CustomOptionOtherValues::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.CustomOptionOtherValues)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.CustomOptionOtherValues)
}

::google::protobuf::uint8* CustomOptionOtherValues::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.CustomOptionOtherValues)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.CustomOptionOtherValues)
  return target;
}

int CustomOptionOtherValues::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void CustomOptionOtherValues::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const CustomOptionOtherValues* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const CustomOptionOtherValues*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void CustomOptionOtherValues::MergeFrom(const CustomOptionOtherValues& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void CustomOptionOtherValues::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void CustomOptionOtherValues::CopyFrom(const CustomOptionOtherValues& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool CustomOptionOtherValues::IsInitialized() const {

  return true;
}

void CustomOptionOtherValues::Swap(CustomOptionOtherValues* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata CustomOptionOtherValues::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = CustomOptionOtherValues_descriptor_;
  metadata.reflection = CustomOptionOtherValues_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

SettingRealsFromPositiveInts::SettingRealsFromPositiveInts()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.SettingRealsFromPositiveInts)
}

void SettingRealsFromPositiveInts::InitAsDefaultInstance() {
}

SettingRealsFromPositiveInts::SettingRealsFromPositiveInts(const SettingRealsFromPositiveInts& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.SettingRealsFromPositiveInts)
}

void SettingRealsFromPositiveInts::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

SettingRealsFromPositiveInts::~SettingRealsFromPositiveInts() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.SettingRealsFromPositiveInts)
  SharedDtor();
}

void SettingRealsFromPositiveInts::SharedDtor() {
  if (this != default_instance_) {
  }
}

void SettingRealsFromPositiveInts::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SettingRealsFromPositiveInts::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return SettingRealsFromPositiveInts_descriptor_;
}

const SettingRealsFromPositiveInts& SettingRealsFromPositiveInts::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

SettingRealsFromPositiveInts* SettingRealsFromPositiveInts::default_instance_ = NULL;

SettingRealsFromPositiveInts* SettingRealsFromPositiveInts::New() const {
  return new SettingRealsFromPositiveInts;
}

void SettingRealsFromPositiveInts::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool SettingRealsFromPositiveInts::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.SettingRealsFromPositiveInts)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.SettingRealsFromPositiveInts)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.SettingRealsFromPositiveInts)
  return false;
#undef DO_
}

void SettingRealsFromPositiveInts::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.SettingRealsFromPositiveInts)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.SettingRealsFromPositiveInts)
}

::google::protobuf::uint8* SettingRealsFromPositiveInts::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.SettingRealsFromPositiveInts)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.SettingRealsFromPositiveInts)
  return target;
}

int SettingRealsFromPositiveInts::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void SettingRealsFromPositiveInts::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const SettingRealsFromPositiveInts* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const SettingRealsFromPositiveInts*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void SettingRealsFromPositiveInts::MergeFrom(const SettingRealsFromPositiveInts& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void SettingRealsFromPositiveInts::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void SettingRealsFromPositiveInts::CopyFrom(const SettingRealsFromPositiveInts& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SettingRealsFromPositiveInts::IsInitialized() const {

  return true;
}

void SettingRealsFromPositiveInts::Swap(SettingRealsFromPositiveInts* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata SettingRealsFromPositiveInts::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = SettingRealsFromPositiveInts_descriptor_;
  metadata.reflection = SettingRealsFromPositiveInts_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

SettingRealsFromNegativeInts::SettingRealsFromNegativeInts()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.SettingRealsFromNegativeInts)
}

void SettingRealsFromNegativeInts::InitAsDefaultInstance() {
}

SettingRealsFromNegativeInts::SettingRealsFromNegativeInts(const SettingRealsFromNegativeInts& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.SettingRealsFromNegativeInts)
}

void SettingRealsFromNegativeInts::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

SettingRealsFromNegativeInts::~SettingRealsFromNegativeInts() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.SettingRealsFromNegativeInts)
  SharedDtor();
}

void SettingRealsFromNegativeInts::SharedDtor() {
  if (this != default_instance_) {
  }
}

void SettingRealsFromNegativeInts::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SettingRealsFromNegativeInts::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return SettingRealsFromNegativeInts_descriptor_;
}

const SettingRealsFromNegativeInts& SettingRealsFromNegativeInts::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

SettingRealsFromNegativeInts* SettingRealsFromNegativeInts::default_instance_ = NULL;

SettingRealsFromNegativeInts* SettingRealsFromNegativeInts::New() const {
  return new SettingRealsFromNegativeInts;
}

void SettingRealsFromNegativeInts::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool SettingRealsFromNegativeInts::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.SettingRealsFromNegativeInts)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.SettingRealsFromNegativeInts)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.SettingRealsFromNegativeInts)
  return false;
#undef DO_
}

void SettingRealsFromNegativeInts::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.SettingRealsFromNegativeInts)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.SettingRealsFromNegativeInts)
}

::google::protobuf::uint8* SettingRealsFromNegativeInts::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.SettingRealsFromNegativeInts)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.SettingRealsFromNegativeInts)
  return target;
}

int SettingRealsFromNegativeInts::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void SettingRealsFromNegativeInts::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const SettingRealsFromNegativeInts* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const SettingRealsFromNegativeInts*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void SettingRealsFromNegativeInts::MergeFrom(const SettingRealsFromNegativeInts& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void SettingRealsFromNegativeInts::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void SettingRealsFromNegativeInts::CopyFrom(const SettingRealsFromNegativeInts& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SettingRealsFromNegativeInts::IsInitialized() const {

  return true;
}

void SettingRealsFromNegativeInts::Swap(SettingRealsFromNegativeInts* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata SettingRealsFromNegativeInts::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = SettingRealsFromNegativeInts_descriptor_;
  metadata.reflection = SettingRealsFromNegativeInts_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int ComplexOptionType1::kFooFieldNumber;
const int ComplexOptionType1::kFoo2FieldNumber;
const int ComplexOptionType1::kFoo3FieldNumber;
const int ComplexOptionType1::kFoo4FieldNumber;
#endif  // !_MSC_VER

ComplexOptionType1::ComplexOptionType1()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.ComplexOptionType1)
}

void ComplexOptionType1::InitAsDefaultInstance() {
}

ComplexOptionType1::ComplexOptionType1(const ComplexOptionType1& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.ComplexOptionType1)
}

void ComplexOptionType1::SharedCtor() {
  _cached_size_ = 0;
  foo_ = 0;
  foo2_ = 0;
  foo3_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ComplexOptionType1::~ComplexOptionType1() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.ComplexOptionType1)
  SharedDtor();
}

void ComplexOptionType1::SharedDtor() {
  if (this != default_instance_) {
  }
}

void ComplexOptionType1::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ComplexOptionType1::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ComplexOptionType1_descriptor_;
}

const ComplexOptionType1& ComplexOptionType1::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

ComplexOptionType1* ComplexOptionType1::default_instance_ = NULL;

ComplexOptionType1* ComplexOptionType1::New() const {
  return new ComplexOptionType1;
}

void ComplexOptionType1::Clear() {
  _extensions_.Clear();
#define OFFSET_OF_FIELD_(f) (reinterpret_cast<char*>(      \
  &reinterpret_cast<ComplexOptionType1*>(16)->f) - \
   reinterpret_cast<char*>(16))

#define ZR_(first, last) do {                              \
    size_t f = OFFSET_OF_FIELD_(first);                    \
    size_t n = OFFSET_OF_FIELD_(last) - f + sizeof(last);  \
    ::memset(&first, 0, n);                                \
  } while (0)

  if (_has_bits_[0 / 32] & 7) {
    ZR_(foo_, foo2_);
    foo3_ = 0;
  }

#undef OFFSET_OF_FIELD_
#undef ZR_

  foo4_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool ComplexOptionType1::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.ComplexOptionType1)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 foo = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &foo_)));
          set_has_foo();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(16)) goto parse_foo2;
        break;
      }

      // optional int32 foo2 = 2;
      case 2: {
        if (tag == 16) {
         parse_foo2:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &foo2_)));
          set_has_foo2();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_foo3;
        break;
      }

      // optional int32 foo3 = 3;
      case 3: {
        if (tag == 24) {
         parse_foo3:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &foo3_)));
          set_has_foo3();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(32)) goto parse_foo4;
        break;
      }

      // repeated int32 foo4 = 4;
      case 4: {
        if (tag == 32) {
         parse_foo4:
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 1, 32, input, this->mutable_foo4())));
        } else if (tag == 34) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, this->mutable_foo4())));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(32)) goto parse_foo4;
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        if ((800u <= tag)) {
          DO_(_extensions_.ParseField(tag, input, default_instance_,
                                      mutable_unknown_fields()));
          continue;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.ComplexOptionType1)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.ComplexOptionType1)
  return false;
#undef DO_
}

void ComplexOptionType1::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.ComplexOptionType1)
  // optional int32 foo = 1;
  if (has_foo()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->foo(), output);
  }

  // optional int32 foo2 = 2;
  if (has_foo2()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->foo2(), output);
  }

  // optional int32 foo3 = 3;
  if (has_foo3()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->foo3(), output);
  }

  // repeated int32 foo4 = 4;
  for (int i = 0; i < this->foo4_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(
      4, this->foo4(i), output);
  }

  // Extension range [100, 536870912)
  _extensions_.SerializeWithCachedSizes(
      100, 536870912, output);

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.ComplexOptionType1)
}

::google::protobuf::uint8* ComplexOptionType1::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.ComplexOptionType1)
  // optional int32 foo = 1;
  if (has_foo()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->foo(), target);
  }

  // optional int32 foo2 = 2;
  if (has_foo2()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->foo2(), target);
  }

  // optional int32 foo3 = 3;
  if (has_foo3()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->foo3(), target);
  }

  // repeated int32 foo4 = 4;
  for (int i = 0; i < this->foo4_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteInt32ToArray(4, this->foo4(i), target);
  }

  // Extension range [100, 536870912)
  target = _extensions_.SerializeWithCachedSizesToArray(
      100, 536870912, target);

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.ComplexOptionType1)
  return target;
}

int ComplexOptionType1::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 foo = 1;
    if (has_foo()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->foo());
    }

    // optional int32 foo2 = 2;
    if (has_foo2()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->foo2());
    }

    // optional int32 foo3 = 3;
    if (has_foo3()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->foo3());
    }

  }
  // repeated int32 foo4 = 4;
  {
    int data_size = 0;
    for (int i = 0; i < this->foo4_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        Int32Size(this->foo4(i));
    }
    total_size += 1 * this->foo4_size() + data_size;
  }

  total_size += _extensions_.ByteSize();

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ComplexOptionType1::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const ComplexOptionType1* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const ComplexOptionType1*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void ComplexOptionType1::MergeFrom(const ComplexOptionType1& from) {
  GOOGLE_CHECK_NE(&from, this);
  foo4_.MergeFrom(from.foo4_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_foo()) {
      set_foo(from.foo());
    }
    if (from.has_foo2()) {
      set_foo2(from.foo2());
    }
    if (from.has_foo3()) {
      set_foo3(from.foo3());
    }
  }
  _extensions_.MergeFrom(from._extensions_);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void ComplexOptionType1::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ComplexOptionType1::CopyFrom(const ComplexOptionType1& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ComplexOptionType1::IsInitialized() const {

  if (!_extensions_.IsInitialized()) return false;  return true;
}

void ComplexOptionType1::Swap(ComplexOptionType1* other) {
  if (other != this) {
    std::swap(foo_, other->foo_);
    std::swap(foo2_, other->foo2_);
    std::swap(foo3_, other->foo3_);
    foo4_.Swap(&other->foo4_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
    _extensions_.Swap(&other->_extensions_);
  }
}

::google::protobuf::Metadata ComplexOptionType1::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ComplexOptionType1_descriptor_;
  metadata.reflection = ComplexOptionType1_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int ComplexOptionType2_ComplexOptionType4::kWaldoFieldNumber;
#endif  // !_MSC_VER

#ifndef _MSC_VER
const int ComplexOptionType2_ComplexOptionType4::kComplexOpt4FieldNumber;
#endif
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ComplexOptionType2_ComplexOptionType4 >, 11, false >
  ComplexOptionType2_ComplexOptionType4::complex_opt4(kComplexOpt4FieldNumber, ::protobuf_unittest::ComplexOptionType2_ComplexOptionType4::default_instance());
ComplexOptionType2_ComplexOptionType4::ComplexOptionType2_ComplexOptionType4()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
}

void ComplexOptionType2_ComplexOptionType4::InitAsDefaultInstance() {
}

ComplexOptionType2_ComplexOptionType4::ComplexOptionType2_ComplexOptionType4(const ComplexOptionType2_ComplexOptionType4& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
}

void ComplexOptionType2_ComplexOptionType4::SharedCtor() {
  _cached_size_ = 0;
  waldo_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ComplexOptionType2_ComplexOptionType4::~ComplexOptionType2_ComplexOptionType4() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
  SharedDtor();
}

void ComplexOptionType2_ComplexOptionType4::SharedDtor() {
  if (this != default_instance_) {
  }
}

void ComplexOptionType2_ComplexOptionType4::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ComplexOptionType2_ComplexOptionType4::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ComplexOptionType2_ComplexOptionType4_descriptor_;
}

const ComplexOptionType2_ComplexOptionType4& ComplexOptionType2_ComplexOptionType4::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

ComplexOptionType2_ComplexOptionType4* ComplexOptionType2_ComplexOptionType4::default_instance_ = NULL;

ComplexOptionType2_ComplexOptionType4* ComplexOptionType2_ComplexOptionType4::New() const {
  return new ComplexOptionType2_ComplexOptionType4;
}

void ComplexOptionType2_ComplexOptionType4::Clear() {
  waldo_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool ComplexOptionType2_ComplexOptionType4::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 waldo = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &waldo_)));
          set_has_waldo();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
  return false;
#undef DO_
}

void ComplexOptionType2_ComplexOptionType4::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
  // optional int32 waldo = 1;
  if (has_waldo()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->waldo(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
}

::google::protobuf::uint8* ComplexOptionType2_ComplexOptionType4::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
  // optional int32 waldo = 1;
  if (has_waldo()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->waldo(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.ComplexOptionType2.ComplexOptionType4)
  return target;
}

int ComplexOptionType2_ComplexOptionType4::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 waldo = 1;
    if (has_waldo()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->waldo());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ComplexOptionType2_ComplexOptionType4::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const ComplexOptionType2_ComplexOptionType4* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const ComplexOptionType2_ComplexOptionType4*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void ComplexOptionType2_ComplexOptionType4::MergeFrom(const ComplexOptionType2_ComplexOptionType4& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_waldo()) {
      set_waldo(from.waldo());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void ComplexOptionType2_ComplexOptionType4::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ComplexOptionType2_ComplexOptionType4::CopyFrom(const ComplexOptionType2_ComplexOptionType4& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ComplexOptionType2_ComplexOptionType4::IsInitialized() const {

  return true;
}

void ComplexOptionType2_ComplexOptionType4::Swap(ComplexOptionType2_ComplexOptionType4* other) {
  if (other != this) {
    std::swap(waldo_, other->waldo_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata ComplexOptionType2_ComplexOptionType4::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ComplexOptionType2_ComplexOptionType4_descriptor_;
  metadata.reflection = ComplexOptionType2_ComplexOptionType4_reflection_;
  return metadata;
}

// -------------------------------------------------------------------

#ifndef _MSC_VER
const int ComplexOptionType2::kBarFieldNumber;
const int ComplexOptionType2::kBazFieldNumber;
const int ComplexOptionType2::kFredFieldNumber;
const int ComplexOptionType2::kBarneyFieldNumber;
#endif  // !_MSC_VER

ComplexOptionType2::ComplexOptionType2()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.ComplexOptionType2)
}

void ComplexOptionType2::InitAsDefaultInstance() {
  bar_ = const_cast< ::protobuf_unittest::ComplexOptionType1*>(&::protobuf_unittest::ComplexOptionType1::default_instance());
  fred_ = const_cast< ::protobuf_unittest::ComplexOptionType2_ComplexOptionType4*>(&::protobuf_unittest::ComplexOptionType2_ComplexOptionType4::default_instance());
}

ComplexOptionType2::ComplexOptionType2(const ComplexOptionType2& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.ComplexOptionType2)
}

void ComplexOptionType2::SharedCtor() {
  _cached_size_ = 0;
  bar_ = NULL;
  baz_ = 0;
  fred_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ComplexOptionType2::~ComplexOptionType2() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.ComplexOptionType2)
  SharedDtor();
}

void ComplexOptionType2::SharedDtor() {
  if (this != default_instance_) {
    delete bar_;
    delete fred_;
  }
}

void ComplexOptionType2::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ComplexOptionType2::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ComplexOptionType2_descriptor_;
}

const ComplexOptionType2& ComplexOptionType2::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

ComplexOptionType2* ComplexOptionType2::default_instance_ = NULL;

ComplexOptionType2* ComplexOptionType2::New() const {
  return new ComplexOptionType2;
}

void ComplexOptionType2::Clear() {
  _extensions_.Clear();
  if (_has_bits_[0 / 32] & 7) {
    if (has_bar()) {
      if (bar_ != NULL) bar_->::protobuf_unittest::ComplexOptionType1::Clear();
    }
    baz_ = 0;
    if (has_fred()) {
      if (fred_ != NULL) fred_->::protobuf_unittest::ComplexOptionType2_ComplexOptionType4::Clear();
    }
  }
  barney_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool ComplexOptionType2::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.ComplexOptionType2)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional .protobuf_unittest.ComplexOptionType1 bar = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_bar()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(16)) goto parse_baz;
        break;
      }

      // optional int32 baz = 2;
      case 2: {
        if (tag == 16) {
         parse_baz:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &baz_)));
          set_has_baz();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_fred;
        break;
      }

      // optional .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 fred = 3;
      case 3: {
        if (tag == 26) {
         parse_fred:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_fred()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_barney;
        break;
      }

      // repeated .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 barney = 4;
      case 4: {
        if (tag == 34) {
         parse_barney:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
                input, add_barney()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_barney;
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        if ((800u <= tag)) {
          DO_(_extensions_.ParseField(tag, input, default_instance_,
                                      mutable_unknown_fields()));
          continue;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.ComplexOptionType2)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.ComplexOptionType2)
  return false;
#undef DO_
}

void ComplexOptionType2::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.ComplexOptionType2)
  // optional .protobuf_unittest.ComplexOptionType1 bar = 1;
  if (has_bar()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->bar(), output);
  }

  // optional int32 baz = 2;
  if (has_baz()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->baz(), output);
  }

  // optional .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 fred = 3;
  if (has_fred()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->fred(), output);
  }

  // repeated .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 barney = 4;
  for (int i = 0; i < this->barney_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->barney(i), output);
  }

  // Extension range [100, 536870912)
  _extensions_.SerializeWithCachedSizes(
      100, 536870912, output);

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.ComplexOptionType2)
}

::google::protobuf::uint8* ComplexOptionType2::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.ComplexOptionType2)
  // optional .protobuf_unittest.ComplexOptionType1 bar = 1;
  if (has_bar()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        1, this->bar(), target);
  }

  // optional int32 baz = 2;
  if (has_baz()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->baz(), target);
  }

  // optional .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 fred = 3;
  if (has_fred()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        3, this->fred(), target);
  }

  // repeated .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 barney = 4;
  for (int i = 0; i < this->barney_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        4, this->barney(i), target);
  }

  // Extension range [100, 536870912)
  target = _extensions_.SerializeWithCachedSizesToArray(
      100, 536870912, target);

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.ComplexOptionType2)
  return target;
}

int ComplexOptionType2::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional .protobuf_unittest.ComplexOptionType1 bar = 1;
    if (has_bar()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->bar());
    }

    // optional int32 baz = 2;
    if (has_baz()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->baz());
    }

    // optional .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 fred = 3;
    if (has_fred()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->fred());
    }

  }
  // repeated .protobuf_unittest.ComplexOptionType2.ComplexOptionType4 barney = 4;
  total_size += 1 * this->barney_size();
  for (int i = 0; i < this->barney_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->barney(i));
  }

  total_size += _extensions_.ByteSize();

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ComplexOptionType2::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const ComplexOptionType2* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const ComplexOptionType2*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void ComplexOptionType2::MergeFrom(const ComplexOptionType2& from) {
  GOOGLE_CHECK_NE(&from, this);
  barney_.MergeFrom(from.barney_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_bar()) {
      mutable_bar()->::protobuf_unittest::ComplexOptionType1::MergeFrom(from.bar());
    }
    if (from.has_baz()) {
      set_baz(from.baz());
    }
    if (from.has_fred()) {
      mutable_fred()->::protobuf_unittest::ComplexOptionType2_ComplexOptionType4::MergeFrom(from.fred());
    }
  }
  _extensions_.MergeFrom(from._extensions_);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void ComplexOptionType2::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ComplexOptionType2::CopyFrom(const ComplexOptionType2& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ComplexOptionType2::IsInitialized() const {

  if (has_bar()) {
    if (!this->bar().IsInitialized()) return false;
  }

  if (!_extensions_.IsInitialized()) return false;  return true;
}

void ComplexOptionType2::Swap(ComplexOptionType2* other) {
  if (other != this) {
    std::swap(bar_, other->bar_);
    std::swap(baz_, other->baz_);
    std::swap(fred_, other->fred_);
    barney_.Swap(&other->barney_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
    _extensions_.Swap(&other->_extensions_);
  }
}

::google::protobuf::Metadata ComplexOptionType2::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ComplexOptionType2_descriptor_;
  metadata.reflection = ComplexOptionType2_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int ComplexOptionType3_ComplexOptionType5::kPlughFieldNumber;
#endif  // !_MSC_VER

ComplexOptionType3_ComplexOptionType5::ComplexOptionType3_ComplexOptionType5()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
}

void ComplexOptionType3_ComplexOptionType5::InitAsDefaultInstance() {
}

ComplexOptionType3_ComplexOptionType5::ComplexOptionType3_ComplexOptionType5(const ComplexOptionType3_ComplexOptionType5& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
}

void ComplexOptionType3_ComplexOptionType5::SharedCtor() {
  _cached_size_ = 0;
  plugh_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ComplexOptionType3_ComplexOptionType5::~ComplexOptionType3_ComplexOptionType5() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
  SharedDtor();
}

void ComplexOptionType3_ComplexOptionType5::SharedDtor() {
  if (this != default_instance_) {
  }
}

void ComplexOptionType3_ComplexOptionType5::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ComplexOptionType3_ComplexOptionType5::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ComplexOptionType3_ComplexOptionType5_descriptor_;
}

const ComplexOptionType3_ComplexOptionType5& ComplexOptionType3_ComplexOptionType5::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

ComplexOptionType3_ComplexOptionType5* ComplexOptionType3_ComplexOptionType5::default_instance_ = NULL;

ComplexOptionType3_ComplexOptionType5* ComplexOptionType3_ComplexOptionType5::New() const {
  return new ComplexOptionType3_ComplexOptionType5;
}

void ComplexOptionType3_ComplexOptionType5::Clear() {
  plugh_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool ComplexOptionType3_ComplexOptionType5::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 plugh = 3;
      case 3: {
        if (tag == 24) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &plugh_)));
          set_has_plugh();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
  return false;
#undef DO_
}

void ComplexOptionType3_ComplexOptionType5::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
  // optional int32 plugh = 3;
  if (has_plugh()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->plugh(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
}

::google::protobuf::uint8* ComplexOptionType3_ComplexOptionType5::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
  // optional int32 plugh = 3;
  if (has_plugh()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->plugh(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.ComplexOptionType3.ComplexOptionType5)
  return target;
}

int ComplexOptionType3_ComplexOptionType5::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 plugh = 3;
    if (has_plugh()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->plugh());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ComplexOptionType3_ComplexOptionType5::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const ComplexOptionType3_ComplexOptionType5* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const ComplexOptionType3_ComplexOptionType5*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void ComplexOptionType3_ComplexOptionType5::MergeFrom(const ComplexOptionType3_ComplexOptionType5& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_plugh()) {
      set_plugh(from.plugh());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void ComplexOptionType3_ComplexOptionType5::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ComplexOptionType3_ComplexOptionType5::CopyFrom(const ComplexOptionType3_ComplexOptionType5& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ComplexOptionType3_ComplexOptionType5::IsInitialized() const {

  return true;
}

void ComplexOptionType3_ComplexOptionType5::Swap(ComplexOptionType3_ComplexOptionType5* other) {
  if (other != this) {
    std::swap(plugh_, other->plugh_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata ComplexOptionType3_ComplexOptionType5::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ComplexOptionType3_ComplexOptionType5_descriptor_;
  metadata.reflection = ComplexOptionType3_ComplexOptionType5_reflection_;
  return metadata;
}

// -------------------------------------------------------------------

#ifndef _MSC_VER
const int ComplexOptionType3::kQuxFieldNumber;
const int ComplexOptionType3::kComplexoptiontype5FieldNumber;
#endif  // !_MSC_VER

ComplexOptionType3::ComplexOptionType3()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.ComplexOptionType3)
}

void ComplexOptionType3::InitAsDefaultInstance() {
  complexoptiontype5_ = const_cast< ::protobuf_unittest::ComplexOptionType3_ComplexOptionType5*>(&::protobuf_unittest::ComplexOptionType3_ComplexOptionType5::default_instance());
}

ComplexOptionType3::ComplexOptionType3(const ComplexOptionType3& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.ComplexOptionType3)
}

void ComplexOptionType3::SharedCtor() {
  _cached_size_ = 0;
  qux_ = 0;
  complexoptiontype5_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ComplexOptionType3::~ComplexOptionType3() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.ComplexOptionType3)
  SharedDtor();
}

void ComplexOptionType3::SharedDtor() {
  if (this != default_instance_) {
    delete complexoptiontype5_;
  }
}

void ComplexOptionType3::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ComplexOptionType3::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ComplexOptionType3_descriptor_;
}

const ComplexOptionType3& ComplexOptionType3::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

ComplexOptionType3* ComplexOptionType3::default_instance_ = NULL;

ComplexOptionType3* ComplexOptionType3::New() const {
  return new ComplexOptionType3;
}

void ComplexOptionType3::Clear() {
  if (_has_bits_[0 / 32] & 3) {
    qux_ = 0;
    if (has_complexoptiontype5()) {
      if (complexoptiontype5_ != NULL) complexoptiontype5_->::protobuf_unittest::ComplexOptionType3_ComplexOptionType5::Clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool ComplexOptionType3::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.ComplexOptionType3)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 qux = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &qux_)));
          set_has_qux();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(19)) goto parse_complexoptiontype5;
        break;
      }

      // optional group ComplexOptionType5 = 2 {
      case 2: {
        if (tag == 19) {
         parse_complexoptiontype5:
          DO_(::google::protobuf::internal::WireFormatLite::ReadGroupNoVirtual(
                2, input, mutable_complexoptiontype5()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.ComplexOptionType3)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.ComplexOptionType3)
  return false;
#undef DO_
}

void ComplexOptionType3::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.ComplexOptionType3)
  // optional int32 qux = 1;
  if (has_qux()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->qux(), output);
  }

  // optional group ComplexOptionType5 = 2 {
  if (has_complexoptiontype5()) {
    ::google::protobuf::internal::WireFormatLite::WriteGroupMaybeToArray(
      2, this->complexoptiontype5(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.ComplexOptionType3)
}

::google::protobuf::uint8* ComplexOptionType3::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.ComplexOptionType3)
  // optional int32 qux = 1;
  if (has_qux()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->qux(), target);
  }

  // optional group ComplexOptionType5 = 2 {
  if (has_complexoptiontype5()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteGroupNoVirtualToArray(
        2, this->complexoptiontype5(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.ComplexOptionType3)
  return target;
}

int ComplexOptionType3::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 qux = 1;
    if (has_qux()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->qux());
    }

    // optional group ComplexOptionType5 = 2 {
    if (has_complexoptiontype5()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::GroupSizeNoVirtual(
          this->complexoptiontype5());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ComplexOptionType3::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const ComplexOptionType3* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const ComplexOptionType3*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void ComplexOptionType3::MergeFrom(const ComplexOptionType3& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_qux()) {
      set_qux(from.qux());
    }
    if (from.has_complexoptiontype5()) {
      mutable_complexoptiontype5()->::protobuf_unittest::ComplexOptionType3_ComplexOptionType5::MergeFrom(from.complexoptiontype5());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void ComplexOptionType3::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ComplexOptionType3::CopyFrom(const ComplexOptionType3& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ComplexOptionType3::IsInitialized() const {

  return true;
}

void ComplexOptionType3::Swap(ComplexOptionType3* other) {
  if (other != this) {
    std::swap(qux_, other->qux_);
    std::swap(complexoptiontype5_, other->complexoptiontype5_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata ComplexOptionType3::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ComplexOptionType3_descriptor_;
  metadata.reflection = ComplexOptionType3_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int ComplexOpt6::kXyzzyFieldNumber;
#endif  // !_MSC_VER

ComplexOpt6::ComplexOpt6()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.ComplexOpt6)
}

void ComplexOpt6::InitAsDefaultInstance() {
}

ComplexOpt6::ComplexOpt6(const ComplexOpt6& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.ComplexOpt6)
}

void ComplexOpt6::SharedCtor() {
  _cached_size_ = 0;
  xyzzy_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ComplexOpt6::~ComplexOpt6() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.ComplexOpt6)
  SharedDtor();
}

void ComplexOpt6::SharedDtor() {
  if (this != default_instance_) {
  }
}

void ComplexOpt6::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ComplexOpt6::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ComplexOpt6_descriptor_;
}

const ComplexOpt6& ComplexOpt6::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

ComplexOpt6* ComplexOpt6::default_instance_ = NULL;

ComplexOpt6* ComplexOpt6::New() const {
  return new ComplexOpt6;
}

void ComplexOpt6::Clear() {
  xyzzy_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool ComplexOpt6::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.ComplexOpt6)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(60751608);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 xyzzy = 7593951;
      case 7593951: {
        if (tag == 60751608) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &xyzzy_)));
          set_has_xyzzy();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.ComplexOpt6)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.ComplexOpt6)
  return false;
#undef DO_
}

void ComplexOpt6::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.ComplexOpt6)
  // optional int32 xyzzy = 7593951;
  if (has_xyzzy()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(7593951, this->xyzzy(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.ComplexOpt6)
}

::google::protobuf::uint8* ComplexOpt6::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.ComplexOpt6)
  // optional int32 xyzzy = 7593951;
  if (has_xyzzy()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(7593951, this->xyzzy(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.ComplexOpt6)
  return target;
}

int ComplexOpt6::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 xyzzy = 7593951;
    if (has_xyzzy()) {
      total_size += 4 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->xyzzy());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ComplexOpt6::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const ComplexOpt6* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const ComplexOpt6*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void ComplexOpt6::MergeFrom(const ComplexOpt6& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_xyzzy()) {
      set_xyzzy(from.xyzzy());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void ComplexOpt6::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ComplexOpt6::CopyFrom(const ComplexOpt6& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ComplexOpt6::IsInitialized() const {

  return true;
}

void ComplexOpt6::Swap(ComplexOpt6* other) {
  if (other != this) {
    std::swap(xyzzy_, other->xyzzy_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata ComplexOpt6::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ComplexOpt6_descriptor_;
  metadata.reflection = ComplexOpt6_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

VariousComplexOptions::VariousComplexOptions()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.VariousComplexOptions)
}

void VariousComplexOptions::InitAsDefaultInstance() {
}

VariousComplexOptions::VariousComplexOptions(const VariousComplexOptions& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.VariousComplexOptions)
}

void VariousComplexOptions::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

VariousComplexOptions::~VariousComplexOptions() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.VariousComplexOptions)
  SharedDtor();
}

void VariousComplexOptions::SharedDtor() {
  if (this != default_instance_) {
  }
}

void VariousComplexOptions::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* VariousComplexOptions::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return VariousComplexOptions_descriptor_;
}

const VariousComplexOptions& VariousComplexOptions::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

VariousComplexOptions* VariousComplexOptions::default_instance_ = NULL;

VariousComplexOptions* VariousComplexOptions::New() const {
  return new VariousComplexOptions;
}

void VariousComplexOptions::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool VariousComplexOptions::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.VariousComplexOptions)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.VariousComplexOptions)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.VariousComplexOptions)
  return false;
#undef DO_
}

void VariousComplexOptions::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.VariousComplexOptions)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.VariousComplexOptions)
}

::google::protobuf::uint8* VariousComplexOptions::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.VariousComplexOptions)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.VariousComplexOptions)
  return target;
}

int VariousComplexOptions::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void VariousComplexOptions::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const VariousComplexOptions* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const VariousComplexOptions*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void VariousComplexOptions::MergeFrom(const VariousComplexOptions& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void VariousComplexOptions::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void VariousComplexOptions::CopyFrom(const VariousComplexOptions& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool VariousComplexOptions::IsInitialized() const {

  return true;
}

void VariousComplexOptions::Swap(VariousComplexOptions* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata VariousComplexOptions::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = VariousComplexOptions_descriptor_;
  metadata.reflection = VariousComplexOptions_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
#endif  // !_MSC_VER

AggregateMessageSet::AggregateMessageSet()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.AggregateMessageSet)
}

void AggregateMessageSet::InitAsDefaultInstance() {
}

AggregateMessageSet::AggregateMessageSet(const AggregateMessageSet& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.AggregateMessageSet)
}

void AggregateMessageSet::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AggregateMessageSet::~AggregateMessageSet() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.AggregateMessageSet)
  SharedDtor();
}

void AggregateMessageSet::SharedDtor() {
  if (this != default_instance_) {
  }
}

void AggregateMessageSet::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AggregateMessageSet::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AggregateMessageSet_descriptor_;
}

const AggregateMessageSet& AggregateMessageSet::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

AggregateMessageSet* AggregateMessageSet::default_instance_ = NULL;

AggregateMessageSet* AggregateMessageSet::New() const {
  return new AggregateMessageSet;
}

void AggregateMessageSet::Clear() {
  _extensions_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool AggregateMessageSet::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
  return _extensions_.ParseMessageSet(input, default_instance_,
                                      mutable_unknown_fields());
}

void AggregateMessageSet::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  _extensions_.SerializeMessageSetWithCachedSizes(output);
  ::google::protobuf::internal::WireFormat::SerializeUnknownMessageSetItems(
      unknown_fields(), output);
}

::google::protobuf::uint8* AggregateMessageSet::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  target =
      _extensions_.SerializeMessageSetWithCachedSizesToArray(target);
  target = ::google::protobuf::internal::WireFormat::
             SerializeUnknownMessageSetItemsToArray(
               unknown_fields(), target);
  return target;
}

int AggregateMessageSet::ByteSize() const {
  int total_size = _extensions_.MessageSetByteSize();
  total_size += ::google::protobuf::internal::WireFormat::
      ComputeUnknownMessageSetItemsSize(unknown_fields());
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AggregateMessageSet::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const AggregateMessageSet* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const AggregateMessageSet*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void AggregateMessageSet::MergeFrom(const AggregateMessageSet& from) {
  GOOGLE_CHECK_NE(&from, this);
  _extensions_.MergeFrom(from._extensions_);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void AggregateMessageSet::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AggregateMessageSet::CopyFrom(const AggregateMessageSet& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AggregateMessageSet::IsInitialized() const {

  if (!_extensions_.IsInitialized()) return false;  return true;
}

void AggregateMessageSet::Swap(AggregateMessageSet* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
    _extensions_.Swap(&other->_extensions_);
  }
}

::google::protobuf::Metadata AggregateMessageSet::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AggregateMessageSet_descriptor_;
  metadata.reflection = AggregateMessageSet_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int AggregateMessageSetElement::kSFieldNumber;
#endif  // !_MSC_VER

#ifndef _MSC_VER
const int AggregateMessageSetElement::kMessageSetExtensionFieldNumber;
#endif
::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::AggregateMessageSet,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::AggregateMessageSetElement >, 11, false >
  AggregateMessageSetElement::message_set_extension(kMessageSetExtensionFieldNumber, ::protobuf_unittest::AggregateMessageSetElement::default_instance());
AggregateMessageSetElement::AggregateMessageSetElement()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.AggregateMessageSetElement)
}

void AggregateMessageSetElement::InitAsDefaultInstance() {
}

AggregateMessageSetElement::AggregateMessageSetElement(const AggregateMessageSetElement& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.AggregateMessageSetElement)
}

void AggregateMessageSetElement::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  s_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AggregateMessageSetElement::~AggregateMessageSetElement() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.AggregateMessageSetElement)
  SharedDtor();
}

void AggregateMessageSetElement::SharedDtor() {
  if (s_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
    delete s_;
  }
  if (this != default_instance_) {
  }
}

void AggregateMessageSetElement::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AggregateMessageSetElement::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AggregateMessageSetElement_descriptor_;
}

const AggregateMessageSetElement& AggregateMessageSetElement::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

AggregateMessageSetElement* AggregateMessageSetElement::default_instance_ = NULL;

AggregateMessageSetElement* AggregateMessageSetElement::New() const {
  return new AggregateMessageSetElement;
}

void AggregateMessageSetElement::Clear() {
  if (has_s()) {
    if (s_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
      s_->clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool AggregateMessageSetElement::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.AggregateMessageSetElement)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string s = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_s()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->s().data(), this->s().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "s");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.AggregateMessageSetElement)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.AggregateMessageSetElement)
  return false;
#undef DO_
}

void AggregateMessageSetElement::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.AggregateMessageSetElement)
  // optional string s = 1;
  if (has_s()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->s().data(), this->s().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "s");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->s(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.AggregateMessageSetElement)
}

::google::protobuf::uint8* AggregateMessageSetElement::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.AggregateMessageSetElement)
  // optional string s = 1;
  if (has_s()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->s().data(), this->s().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "s");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->s(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.AggregateMessageSetElement)
  return target;
}

int AggregateMessageSetElement::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional string s = 1;
    if (has_s()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->s());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AggregateMessageSetElement::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const AggregateMessageSetElement* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const AggregateMessageSetElement*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void AggregateMessageSetElement::MergeFrom(const AggregateMessageSetElement& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_s()) {
      set_s(from.s());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void AggregateMessageSetElement::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AggregateMessageSetElement::CopyFrom(const AggregateMessageSetElement& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AggregateMessageSetElement::IsInitialized() const {

  return true;
}

void AggregateMessageSetElement::Swap(AggregateMessageSetElement* other) {
  if (other != this) {
    std::swap(s_, other->s_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata AggregateMessageSetElement::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AggregateMessageSetElement_descriptor_;
  metadata.reflection = AggregateMessageSetElement_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int Aggregate::kIFieldNumber;
const int Aggregate::kSFieldNumber;
const int Aggregate::kSubFieldNumber;
const int Aggregate::kFileFieldNumber;
const int Aggregate::kMsetFieldNumber;
#endif  // !_MSC_VER

#ifndef _MSC_VER
const int Aggregate::kNestedFieldNumber;
#endif
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FileOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  Aggregate::nested(kNestedFieldNumber, ::protobuf_unittest::Aggregate::default_instance());
Aggregate::Aggregate()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.Aggregate)
}

void Aggregate::InitAsDefaultInstance() {
  sub_ = const_cast< ::protobuf_unittest::Aggregate*>(&::protobuf_unittest::Aggregate::default_instance());
  file_ = const_cast< ::google::protobuf::FileOptions*>(&::google::protobuf::FileOptions::default_instance());
  mset_ = const_cast< ::protobuf_unittest::AggregateMessageSet*>(&::protobuf_unittest::AggregateMessageSet::default_instance());
}

Aggregate::Aggregate(const Aggregate& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.Aggregate)
}

void Aggregate::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  i_ = 0;
  s_ = const_cast< ::std::string*>(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  sub_ = NULL;
  file_ = NULL;
  mset_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

Aggregate::~Aggregate() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.Aggregate)
  SharedDtor();
}

void Aggregate::SharedDtor() {
  if (s_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
    delete s_;
  }
  if (this != default_instance_) {
    delete sub_;
    delete file_;
    delete mset_;
  }
}

void Aggregate::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* Aggregate::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return Aggregate_descriptor_;
}

const Aggregate& Aggregate::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

Aggregate* Aggregate::default_instance_ = NULL;

Aggregate* Aggregate::New() const {
  return new Aggregate;
}

void Aggregate::Clear() {
  if (_has_bits_[0 / 32] & 31) {
    i_ = 0;
    if (has_s()) {
      if (s_ != &::google::protobuf::internal::GetEmptyStringAlreadyInited()) {
        s_->clear();
      }
    }
    if (has_sub()) {
      if (sub_ != NULL) sub_->::protobuf_unittest::Aggregate::Clear();
    }
    if (has_file()) {
      if (file_ != NULL) file_->::google::protobuf::FileOptions::Clear();
    }
    if (has_mset()) {
      if (mset_ != NULL) mset_->::protobuf_unittest::AggregateMessageSet::Clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool Aggregate::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.Aggregate)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 i = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &i_)));
          set_has_i();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_s;
        break;
      }

      // optional string s = 2;
      case 2: {
        if (tag == 18) {
         parse_s:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_s()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->s().data(), this->s().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "s");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_sub;
        break;
      }

      // optional .protobuf_unittest.Aggregate sub = 3;
      case 3: {
        if (tag == 26) {
         parse_sub:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_sub()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_file;
        break;
      }

      // optional .google.protobuf.FileOptions file = 4;
      case 4: {
        if (tag == 34) {
         parse_file:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_file()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(42)) goto parse_mset;
        break;
      }

      // optional .protobuf_unittest.AggregateMessageSet mset = 5;
      case 5: {
        if (tag == 42) {
         parse_mset:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_mset()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.Aggregate)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.Aggregate)
  return false;
#undef DO_
}

void Aggregate::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.Aggregate)
  // optional int32 i = 1;
  if (has_i()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->i(), output);
  }

  // optional string s = 2;
  if (has_s()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->s().data(), this->s().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "s");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->s(), output);
  }

  // optional .protobuf_unittest.Aggregate sub = 3;
  if (has_sub()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      3, this->sub(), output);
  }

  // optional .google.protobuf.FileOptions file = 4;
  if (has_file()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->file(), output);
  }

  // optional .protobuf_unittest.AggregateMessageSet mset = 5;
  if (has_mset()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      5, this->mset(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.Aggregate)
}

::google::protobuf::uint8* Aggregate::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.Aggregate)
  // optional int32 i = 1;
  if (has_i()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->i(), target);
  }

  // optional string s = 2;
  if (has_s()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->s().data(), this->s().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "s");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->s(), target);
  }

  // optional .protobuf_unittest.Aggregate sub = 3;
  if (has_sub()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        3, this->sub(), target);
  }

  // optional .google.protobuf.FileOptions file = 4;
  if (has_file()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        4, this->file(), target);
  }

  // optional .protobuf_unittest.AggregateMessageSet mset = 5;
  if (has_mset()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        5, this->mset(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.Aggregate)
  return target;
}

int Aggregate::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 i = 1;
    if (has_i()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->i());
    }

    // optional string s = 2;
    if (has_s()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->s());
    }

    // optional .protobuf_unittest.Aggregate sub = 3;
    if (has_sub()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->sub());
    }

    // optional .google.protobuf.FileOptions file = 4;
    if (has_file()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->file());
    }

    // optional .protobuf_unittest.AggregateMessageSet mset = 5;
    if (has_mset()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->mset());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void Aggregate::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const Aggregate* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const Aggregate*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void Aggregate::MergeFrom(const Aggregate& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_i()) {
      set_i(from.i());
    }
    if (from.has_s()) {
      set_s(from.s());
    }
    if (from.has_sub()) {
      mutable_sub()->::protobuf_unittest::Aggregate::MergeFrom(from.sub());
    }
    if (from.has_file()) {
      mutable_file()->::google::protobuf::FileOptions::MergeFrom(from.file());
    }
    if (from.has_mset()) {
      mutable_mset()->::protobuf_unittest::AggregateMessageSet::MergeFrom(from.mset());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void Aggregate::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void Aggregate::CopyFrom(const Aggregate& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool Aggregate::IsInitialized() const {

  if (has_sub()) {
    if (!this->sub().IsInitialized()) return false;
  }
  if (has_file()) {
    if (!this->file().IsInitialized()) return false;
  }
  if (has_mset()) {
    if (!this->mset().IsInitialized()) return false;
  }
  return true;
}

void Aggregate::Swap(Aggregate* other) {
  if (other != this) {
    std::swap(i_, other->i_);
    std::swap(s_, other->s_);
    std::swap(sub_, other->sub_);
    std::swap(file_, other->file_);
    std::swap(mset_, other->mset_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata Aggregate::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = Aggregate_descriptor_;
  metadata.reflection = Aggregate_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int AggregateMessage::kFieldnameFieldNumber;
#endif  // !_MSC_VER

AggregateMessage::AggregateMessage()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.AggregateMessage)
}

void AggregateMessage::InitAsDefaultInstance() {
}

AggregateMessage::AggregateMessage(const AggregateMessage& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.AggregateMessage)
}

void AggregateMessage::SharedCtor() {
  _cached_size_ = 0;
  fieldname_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AggregateMessage::~AggregateMessage() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.AggregateMessage)
  SharedDtor();
}

void AggregateMessage::SharedDtor() {
  if (this != default_instance_) {
  }
}

void AggregateMessage::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AggregateMessage::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AggregateMessage_descriptor_;
}

const AggregateMessage& AggregateMessage::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

AggregateMessage* AggregateMessage::default_instance_ = NULL;

AggregateMessage* AggregateMessage::New() const {
  return new AggregateMessage;
}

void AggregateMessage::Clear() {
  fieldname_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool AggregateMessage::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.AggregateMessage)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 fieldname = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &fieldname_)));
          set_has_fieldname();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.AggregateMessage)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.AggregateMessage)
  return false;
#undef DO_
}

void AggregateMessage::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.AggregateMessage)
  // optional int32 fieldname = 1;
  if (has_fieldname()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->fieldname(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.AggregateMessage)
}

::google::protobuf::uint8* AggregateMessage::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.AggregateMessage)
  // optional int32 fieldname = 1;
  if (has_fieldname()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->fieldname(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.AggregateMessage)
  return target;
}

int AggregateMessage::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 fieldname = 1;
    if (has_fieldname()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->fieldname());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AggregateMessage::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const AggregateMessage* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const AggregateMessage*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void AggregateMessage::MergeFrom(const AggregateMessage& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_fieldname()) {
      set_fieldname(from.fieldname());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void AggregateMessage::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AggregateMessage::CopyFrom(const AggregateMessage& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AggregateMessage::IsInitialized() const {

  return true;
}

void AggregateMessage::Swap(AggregateMessage* other) {
  if (other != this) {
    std::swap(fieldname_, other->fieldname_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata AggregateMessage::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AggregateMessage_descriptor_;
  metadata.reflection = AggregateMessage_reflection_;
  return metadata;
}

// ===================================================================

const ::google::protobuf::EnumDescriptor* NestedOptionType_NestedEnum_descriptor() {
  protobuf_AssignDescriptorsOnce();
  return NestedOptionType_NestedEnum_descriptor_;
}
bool NestedOptionType_NestedEnum_IsValid(int value) {
  switch(value) {
    case 1:
      return true;
    default:
      return false;
  }
}

#ifndef _MSC_VER
const NestedOptionType_NestedEnum NestedOptionType::NESTED_ENUM_VALUE;
const NestedOptionType_NestedEnum NestedOptionType::NestedEnum_MIN;
const NestedOptionType_NestedEnum NestedOptionType::NestedEnum_MAX;
const int NestedOptionType::NestedEnum_ARRAYSIZE;
#endif  // _MSC_VER
#ifndef _MSC_VER
const int NestedOptionType_NestedMessage::kNestedFieldFieldNumber;
#endif  // !_MSC_VER

NestedOptionType_NestedMessage::NestedOptionType_NestedMessage()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.NestedOptionType.NestedMessage)
}

void NestedOptionType_NestedMessage::InitAsDefaultInstance() {
}

NestedOptionType_NestedMessage::NestedOptionType_NestedMessage(const NestedOptionType_NestedMessage& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.NestedOptionType.NestedMessage)
}

void NestedOptionType_NestedMessage::SharedCtor() {
  _cached_size_ = 0;
  nested_field_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

NestedOptionType_NestedMessage::~NestedOptionType_NestedMessage() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.NestedOptionType.NestedMessage)
  SharedDtor();
}

void NestedOptionType_NestedMessage::SharedDtor() {
  if (this != default_instance_) {
  }
}

void NestedOptionType_NestedMessage::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* NestedOptionType_NestedMessage::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return NestedOptionType_NestedMessage_descriptor_;
}

const NestedOptionType_NestedMessage& NestedOptionType_NestedMessage::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

NestedOptionType_NestedMessage* NestedOptionType_NestedMessage::default_instance_ = NULL;

NestedOptionType_NestedMessage* NestedOptionType_NestedMessage::New() const {
  return new NestedOptionType_NestedMessage;
}

void NestedOptionType_NestedMessage::Clear() {
  nested_field_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool NestedOptionType_NestedMessage::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.NestedOptionType.NestedMessage)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional int32 nested_field = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &nested_field_)));
          set_has_nested_field();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.NestedOptionType.NestedMessage)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.NestedOptionType.NestedMessage)
  return false;
#undef DO_
}

void NestedOptionType_NestedMessage::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.NestedOptionType.NestedMessage)
  // optional int32 nested_field = 1;
  if (has_nested_field()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(1, this->nested_field(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.NestedOptionType.NestedMessage)
}

::google::protobuf::uint8* NestedOptionType_NestedMessage::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.NestedOptionType.NestedMessage)
  // optional int32 nested_field = 1;
  if (has_nested_field()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(1, this->nested_field(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.NestedOptionType.NestedMessage)
  return target;
}

int NestedOptionType_NestedMessage::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional int32 nested_field = 1;
    if (has_nested_field()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->nested_field());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void NestedOptionType_NestedMessage::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const NestedOptionType_NestedMessage* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const NestedOptionType_NestedMessage*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void NestedOptionType_NestedMessage::MergeFrom(const NestedOptionType_NestedMessage& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_nested_field()) {
      set_nested_field(from.nested_field());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void NestedOptionType_NestedMessage::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void NestedOptionType_NestedMessage::CopyFrom(const NestedOptionType_NestedMessage& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool NestedOptionType_NestedMessage::IsInitialized() const {

  return true;
}

void NestedOptionType_NestedMessage::Swap(NestedOptionType_NestedMessage* other) {
  if (other != this) {
    std::swap(nested_field_, other->nested_field_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata NestedOptionType_NestedMessage::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = NestedOptionType_NestedMessage_descriptor_;
  metadata.reflection = NestedOptionType_NestedMessage_reflection_;
  return metadata;
}

// -------------------------------------------------------------------

#ifndef _MSC_VER
#endif  // !_MSC_VER

#ifndef _MSC_VER
const int NestedOptionType::kNestedExtensionFieldNumber;
#endif
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FileOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  NestedOptionType::nested_extension(kNestedExtensionFieldNumber, 0);
NestedOptionType::NestedOptionType()
  : ::google::protobuf::Message() {
  SharedCtor();
  // @@protoc_insertion_point(constructor:protobuf_unittest.NestedOptionType)
}

void NestedOptionType::InitAsDefaultInstance() {
}

NestedOptionType::NestedOptionType(const NestedOptionType& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:protobuf_unittest.NestedOptionType)
}

void NestedOptionType::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

NestedOptionType::~NestedOptionType() {
  // @@protoc_insertion_point(destructor:protobuf_unittest.NestedOptionType)
  SharedDtor();
}

void NestedOptionType::SharedDtor() {
  if (this != default_instance_) {
  }
}

void NestedOptionType::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* NestedOptionType::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return NestedOptionType_descriptor_;
}

const NestedOptionType& NestedOptionType::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_google_2fprotobuf_2funittest_5fcustom_5foptions_2eproto();
  return *default_instance_;
}

NestedOptionType* NestedOptionType::default_instance_ = NULL;

NestedOptionType* NestedOptionType::New() const {
  return new NestedOptionType;
}

void NestedOptionType::Clear() {
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool NestedOptionType::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:protobuf_unittest.NestedOptionType)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
  handle_unusual:
    if (tag == 0 ||
        ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
        ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
      goto success;
    }
    DO_(::google::protobuf::internal::WireFormat::SkipField(
          input, tag, mutable_unknown_fields()));
  }
success:
  // @@protoc_insertion_point(parse_success:protobuf_unittest.NestedOptionType)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:protobuf_unittest.NestedOptionType)
  return false;
#undef DO_
}

void NestedOptionType::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:protobuf_unittest.NestedOptionType)
  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:protobuf_unittest.NestedOptionType)
}

::google::protobuf::uint8* NestedOptionType::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:protobuf_unittest.NestedOptionType)
  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:protobuf_unittest.NestedOptionType)
  return target;
}

int NestedOptionType::ByteSize() const {
  int total_size = 0;

  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void NestedOptionType::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const NestedOptionType* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const NestedOptionType*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void NestedOptionType::MergeFrom(const NestedOptionType& from) {
  GOOGLE_CHECK_NE(&from, this);
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void NestedOptionType::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void NestedOptionType::CopyFrom(const NestedOptionType& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool NestedOptionType::IsInitialized() const {

  return true;
}

void NestedOptionType::Swap(NestedOptionType* other) {
  if (other != this) {
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata NestedOptionType::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = NestedOptionType_descriptor_;
  metadata.reflection = NestedOptionType_reflection_;
  return metadata;
}

// ===================================================================

TestServiceWithCustomOptions::~TestServiceWithCustomOptions() {}

const ::google::protobuf::ServiceDescriptor* TestServiceWithCustomOptions::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return TestServiceWithCustomOptions_descriptor_;
}

const ::google::protobuf::ServiceDescriptor* TestServiceWithCustomOptions::GetDescriptor() {
  protobuf_AssignDescriptorsOnce();
  return TestServiceWithCustomOptions_descriptor_;
}

void TestServiceWithCustomOptions::Foo(::google::protobuf::RpcController* controller,
                         const ::protobuf_unittest::CustomOptionFooRequest*,
                         ::protobuf_unittest::CustomOptionFooResponse*,
                         ::google::protobuf::Closure* done) {
  controller->SetFailed("Method Foo() not implemented.");
  done->Run();
}

void TestServiceWithCustomOptions::CallMethod(const ::google::protobuf::MethodDescriptor* method,
                             ::google::protobuf::RpcController* controller,
                             const ::google::protobuf::Message* request,
                             ::google::protobuf::Message* response,
                             ::google::protobuf::Closure* done) {
  GOOGLE_DCHECK_EQ(method->service(), TestServiceWithCustomOptions_descriptor_);
  switch(method->index()) {
    case 0:
      Foo(controller,
             ::google::protobuf::down_cast<const ::protobuf_unittest::CustomOptionFooRequest*>(request),
             ::google::protobuf::down_cast< ::protobuf_unittest::CustomOptionFooResponse*>(response),
             done);
      break;
    default:
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
      break;
  }
}

const ::google::protobuf::Message& TestServiceWithCustomOptions::GetRequestPrototype(
    const ::google::protobuf::MethodDescriptor* method) const {
  GOOGLE_DCHECK_EQ(method->service(), descriptor());
  switch(method->index()) {
    case 0:
      return ::protobuf_unittest::CustomOptionFooRequest::default_instance();
    default:
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
      return *reinterpret_cast< ::google::protobuf::Message*>(NULL);
  }
}

const ::google::protobuf::Message& TestServiceWithCustomOptions::GetResponsePrototype(
    const ::google::protobuf::MethodDescriptor* method) const {
  GOOGLE_DCHECK_EQ(method->service(), descriptor());
  switch(method->index()) {
    case 0:
      return ::protobuf_unittest::CustomOptionFooResponse::default_instance();
    default:
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
      return *reinterpret_cast< ::google::protobuf::Message*>(NULL);
  }
}

TestServiceWithCustomOptions_Stub::TestServiceWithCustomOptions_Stub(::google::protobuf::RpcChannel* channel)
  : channel_(channel), owns_channel_(false) {}
TestServiceWithCustomOptions_Stub::TestServiceWithCustomOptions_Stub(
    ::google::protobuf::RpcChannel* channel,
    ::google::protobuf::Service::ChannelOwnership ownership)
  : channel_(channel),
    owns_channel_(ownership == ::google::protobuf::Service::STUB_OWNS_CHANNEL) {}
TestServiceWithCustomOptions_Stub::~TestServiceWithCustomOptions_Stub() {
  if (owns_channel_) delete channel_;
}

void TestServiceWithCustomOptions_Stub::Foo(::google::protobuf::RpcController* controller,
                              const ::protobuf_unittest::CustomOptionFooRequest* request,
                              ::protobuf_unittest::CustomOptionFooResponse* response,
                              ::google::protobuf::Closure* done) {
  channel_->CallMethod(descriptor()->method(0),
                       controller, request, response, done);
}
// ===================================================================

AggregateService::~AggregateService() {}

const ::google::protobuf::ServiceDescriptor* AggregateService::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AggregateService_descriptor_;
}

const ::google::protobuf::ServiceDescriptor* AggregateService::GetDescriptor() {
  protobuf_AssignDescriptorsOnce();
  return AggregateService_descriptor_;
}

void AggregateService::Method(::google::protobuf::RpcController* controller,
                         const ::protobuf_unittest::AggregateMessage*,
                         ::protobuf_unittest::AggregateMessage*,
                         ::google::protobuf::Closure* done) {
  controller->SetFailed("Method Method() not implemented.");
  done->Run();
}

void AggregateService::CallMethod(const ::google::protobuf::MethodDescriptor* method,
                             ::google::protobuf::RpcController* controller,
                             const ::google::protobuf::Message* request,
                             ::google::protobuf::Message* response,
                             ::google::protobuf::Closure* done) {
  GOOGLE_DCHECK_EQ(method->service(), AggregateService_descriptor_);
  switch(method->index()) {
    case 0:
      Method(controller,
             ::google::protobuf::down_cast<const ::protobuf_unittest::AggregateMessage*>(request),
             ::google::protobuf::down_cast< ::protobuf_unittest::AggregateMessage*>(response),
             done);
      break;
    default:
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
      break;
  }
}

const ::google::protobuf::Message& AggregateService::GetRequestPrototype(
    const ::google::protobuf::MethodDescriptor* method) const {
  GOOGLE_DCHECK_EQ(method->service(), descriptor());
  switch(method->index()) {
    case 0:
      return ::protobuf_unittest::AggregateMessage::default_instance();
    default:
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
      return *reinterpret_cast< ::google::protobuf::Message*>(NULL);
  }
}

const ::google::protobuf::Message& AggregateService::GetResponsePrototype(
    const ::google::protobuf::MethodDescriptor* method) const {
  GOOGLE_DCHECK_EQ(method->service(), descriptor());
  switch(method->index()) {
    case 0:
      return ::protobuf_unittest::AggregateMessage::default_instance();
    default:
      GOOGLE_LOG(FATAL) << "Bad method index; this should never happen.";
      return *reinterpret_cast< ::google::protobuf::Message*>(NULL);
  }
}

AggregateService_Stub::AggregateService_Stub(::google::protobuf::RpcChannel* channel)
  : channel_(channel), owns_channel_(false) {}
AggregateService_Stub::AggregateService_Stub(
    ::google::protobuf::RpcChannel* channel,
    ::google::protobuf::Service::ChannelOwnership ownership)
  : channel_(channel),
    owns_channel_(ownership == ::google::protobuf::Service::STUB_OWNS_CHANNEL) {}
AggregateService_Stub::~AggregateService_Stub() {
  if (owns_channel_) delete channel_;
}

void AggregateService_Stub::Method(::google::protobuf::RpcController* controller,
                              const ::protobuf_unittest::AggregateMessage* request,
                              ::protobuf_unittest::AggregateMessage* response,
                              ::google::protobuf::Closure* done) {
  channel_->CallMethod(descriptor()->method(0),
                       controller, request, response, done);
}
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FileOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 4, false >
  file_opt1(kFileOpt1FieldNumber, GOOGLE_ULONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  message_opt1(kMessageOpt1FieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FieldOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 6, false >
  field_opt1(kFieldOpt1FieldNumber, GOOGLE_ULONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FieldOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  field_opt2(kFieldOpt2FieldNumber, 42);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::EnumOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 15, false >
  enum_opt1(kEnumOpt1FieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::EnumValueOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  enum_value_opt1(kEnumValueOpt1FieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 18, false >
  service_opt1(kServiceOpt1FieldNumber, GOOGLE_LONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
    ::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest::MethodOpt1, ::protobuf_unittest::MethodOpt1_IsValid>, 14, false >
  method_opt1(kMethodOpt1FieldNumber, static_cast< ::protobuf_unittest::MethodOpt1 >(1));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< bool >, 8, false >
  bool_opt(kBoolOptFieldNumber, false);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  int32_opt(kInt32OptFieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 3, false >
  int64_opt(kInt64OptFieldNumber, GOOGLE_LONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 13, false >
  uint32_opt(kUint32OptFieldNumber, 0u);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 4, false >
  uint64_opt(kUint64OptFieldNumber, GOOGLE_ULONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 17, false >
  sint32_opt(kSint32OptFieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 18, false >
  sint64_opt(kSint64OptFieldNumber, GOOGLE_LONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
  fixed32_opt(kFixed32OptFieldNumber, 0u);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint64 >, 6, false >
  fixed64_opt(kFixed64OptFieldNumber, GOOGLE_ULONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 15, false >
  sfixed32_opt(kSfixed32OptFieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int64 >, 16, false >
  sfixed64_opt(kSfixed64OptFieldNumber, GOOGLE_LONGLONG(0));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< float >, 2, false >
  float_opt(kFloatOptFieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::PrimitiveTypeTraits< double >, 1, false >
  double_opt(kDoubleOptFieldNumber, 0);
const ::std::string string_opt_default("");
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::StringTypeTraits, 9, false >
  string_opt(kStringOptFieldNumber, string_opt_default);
const ::std::string bytes_opt_default("");
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::StringTypeTraits, 12, false >
  bytes_opt(kBytesOptFieldNumber, bytes_opt_default);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::EnumTypeTraits< ::protobuf_unittest::DummyMessageContainingEnum_TestEnumType, ::protobuf_unittest::DummyMessageContainingEnum_TestEnumType_IsValid>, 14, false >
  enum_opt(kEnumOptFieldNumber, static_cast< ::protobuf_unittest::DummyMessageContainingEnum_TestEnumType >(22));
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::DummyMessageInvalidAsOptionType >, 11, false >
  message_type_opt(kMessageTypeOptFieldNumber, ::protobuf_unittest::DummyMessageInvalidAsOptionType::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::ComplexOptionType1,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  quux(kQuuxFieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::ComplexOptionType1,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ComplexOptionType3 >, 11, false >
  corge(kCorgeFieldNumber, ::protobuf_unittest::ComplexOptionType3::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::ComplexOptionType2,
    ::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::int32 >, 5, false >
  grault(kGraultFieldNumber, 0);
::google::protobuf::internal::ExtensionIdentifier< ::protobuf_unittest::ComplexOptionType2,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ComplexOptionType1 >, 11, false >
  garply(kGarplyFieldNumber, ::protobuf_unittest::ComplexOptionType1::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ComplexOptionType1 >, 11, false >
  complex_opt1(kComplexOpt1FieldNumber, ::protobuf_unittest::ComplexOptionType1::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ComplexOptionType2 >, 11, false >
  complex_opt2(kComplexOpt2FieldNumber, ::protobuf_unittest::ComplexOptionType2::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ComplexOptionType3 >, 11, false >
  complex_opt3(kComplexOpt3FieldNumber, ::protobuf_unittest::ComplexOptionType3::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::ComplexOpt6 >, 10, false >
  complexopt6(kComplexopt6FieldNumber, ::protobuf_unittest::ComplexOpt6::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FileOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  fileopt(kFileoptFieldNumber, ::protobuf_unittest::Aggregate::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  msgopt(kMsgoptFieldNumber, ::protobuf_unittest::Aggregate::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FieldOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  fieldopt(kFieldoptFieldNumber, ::protobuf_unittest::Aggregate::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::EnumOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  enumopt(kEnumoptFieldNumber, ::protobuf_unittest::Aggregate::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::EnumValueOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  enumvalopt(kEnumvaloptFieldNumber, ::protobuf_unittest::Aggregate::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  serviceopt(kServiceoptFieldNumber, ::protobuf_unittest::Aggregate::default_instance());
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
    ::google::protobuf::internal::MessageTypeTraits< ::protobuf_unittest::Aggregate >, 11, false >
  methodopt(kMethodoptFieldNumber, ::protobuf_unittest::Aggregate::default_instance());

// @@protoc_insertion_point(namespace_scope)

}  // namespace protobuf_unittest

// @@protoc_insertion_point(global_scope)