// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: phonenumber.proto

#include "phonenumber.pb.h"

#include <algorithm>

#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/io/zero_copy_stream_impl_lite.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>

PROTOBUF_PRAGMA_INIT_SEG

namespace _pb = ::PROTOBUF_NAMESPACE_ID;
namespace _pbi = _pb::internal;

namespace i18n {
namespace phonenumbers {
PROTOBUF_CONSTEXPR PhoneNumber::PhoneNumber(
    ::_pbi::ConstantInitialized)
  : extension_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , raw_input_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , preferred_domestic_carrier_code_(&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{})
  , national_number_(uint64_t{0u})
  , country_code_(0)
  , italian_leading_zero_(false)
  , country_code_source_(0)

  , number_of_leading_zeros_(1){}
struct PhoneNumberDefaultTypeInternal {
  PROTOBUF_CONSTEXPR PhoneNumberDefaultTypeInternal()
      : _instance(::_pbi::ConstantInitialized{}) {}
  ~PhoneNumberDefaultTypeInternal() {}
  union {
    PhoneNumber _instance;
  };
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PhoneNumberDefaultTypeInternal _PhoneNumber_default_instance_;
}  // namespace phonenumbers
}  // namespace i18n
namespace i18n {
namespace phonenumbers {
bool PhoneNumber_CountryCodeSource_IsValid(int value) {
  switch (value) {
    case 0:
    case 1:
    case 5:
    case 10:
    case 20:
      return true;
    default:
      return false;
  }
}

static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> PhoneNumber_CountryCodeSource_strings[5] = {};

static const char PhoneNumber_CountryCodeSource_names[] =
  "FROM_DEFAULT_COUNTRY"
  "FROM_NUMBER_WITHOUT_PLUS_SIGN"
  "FROM_NUMBER_WITH_IDD"
  "FROM_NUMBER_WITH_PLUS_SIGN"
  "UNSPECIFIED";

static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry PhoneNumber_CountryCodeSource_entries[] = {
  { {PhoneNumber_CountryCodeSource_names + 0, 20}, 20 },
  { {PhoneNumber_CountryCodeSource_names + 20, 29}, 10 },
  { {PhoneNumber_CountryCodeSource_names + 49, 20}, 5 },
  { {PhoneNumber_CountryCodeSource_names + 69, 26}, 1 },
  { {PhoneNumber_CountryCodeSource_names + 95, 11}, 0 },
};

static const int PhoneNumber_CountryCodeSource_entries_by_number[] = {
  4, // 0 -> UNSPECIFIED
  3, // 1 -> FROM_NUMBER_WITH_PLUS_SIGN
  2, // 5 -> FROM_NUMBER_WITH_IDD
  1, // 10 -> FROM_NUMBER_WITHOUT_PLUS_SIGN
  0, // 20 -> FROM_DEFAULT_COUNTRY
};

const std::string& PhoneNumber_CountryCodeSource_Name(
    PhoneNumber_CountryCodeSource value) {
  static const bool dummy =
      ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
          PhoneNumber_CountryCodeSource_entries,
          PhoneNumber_CountryCodeSource_entries_by_number,
          5, PhoneNumber_CountryCodeSource_strings);
  (void) dummy;
  int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
      PhoneNumber_CountryCodeSource_entries,
      PhoneNumber_CountryCodeSource_entries_by_number,
      5, value);
  return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
                     PhoneNumber_CountryCodeSource_strings[idx].get();
}
bool PhoneNumber_CountryCodeSource_Parse(
    ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PhoneNumber_CountryCodeSource* value) {
  int int_value;
  bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
      PhoneNumber_CountryCodeSource_entries, 5, name, &int_value);
  if (success) {
    *value = static_cast<PhoneNumber_CountryCodeSource>(int_value);
  }
  return success;
}
#if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
constexpr PhoneNumber_CountryCodeSource PhoneNumber::UNSPECIFIED;
constexpr PhoneNumber_CountryCodeSource PhoneNumber::FROM_NUMBER_WITH_PLUS_SIGN;
constexpr PhoneNumber_CountryCodeSource PhoneNumber::FROM_NUMBER_WITH_IDD;
constexpr PhoneNumber_CountryCodeSource PhoneNumber::FROM_NUMBER_WITHOUT_PLUS_SIGN;
constexpr PhoneNumber_CountryCodeSource PhoneNumber::FROM_DEFAULT_COUNTRY;
constexpr PhoneNumber_CountryCodeSource PhoneNumber::CountryCodeSource_MIN;
constexpr PhoneNumber_CountryCodeSource PhoneNumber::CountryCodeSource_MAX;
constexpr int PhoneNumber::CountryCodeSource_ARRAYSIZE;
#endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))

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

class PhoneNumber::_Internal {
 public:
  using HasBits = decltype(std::declval<PhoneNumber>()._has_bits_);
  static void set_has_country_code(HasBits* has_bits) {
    (*has_bits)[0] |= 16u;
  }
  static void set_has_national_number(HasBits* has_bits) {
    (*has_bits)[0] |= 8u;
  }
  static void set_has_extension(HasBits* has_bits) {
    (*has_bits)[0] |= 1u;
  }
  static void set_has_italian_leading_zero(HasBits* has_bits) {
    (*has_bits)[0] |= 32u;
  }
  static void set_has_number_of_leading_zeros(HasBits* has_bits) {
    (*has_bits)[0] |= 128u;
  }
  static void set_has_raw_input(HasBits* has_bits) {
    (*has_bits)[0] |= 2u;
  }
  static void set_has_country_code_source(HasBits* has_bits) {
    (*has_bits)[0] |= 64u;
  }
  static void set_has_preferred_domestic_carrier_code(HasBits* has_bits) {
    (*has_bits)[0] |= 4u;
  }
  static bool MissingRequiredFields(const HasBits& has_bits) {
    return ((has_bits[0] & 0x00000018) ^ 0x00000018) != 0;
  }
};

PhoneNumber::PhoneNumber(::PROTOBUF_NAMESPACE_ID::Arena* arena,
                         bool is_message_owned)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
  SharedCtor();
  // @@protoc_insertion_point(arena_constructor:i18n.phonenumbers.PhoneNumber)
}
PhoneNumber::PhoneNumber(const PhoneNumber& from)
  : ::PROTOBUF_NAMESPACE_ID::MessageLite(),
      _has_bits_(from._has_bits_) {
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
  extension_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    extension_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_extension()) {
    extension_.Set(from._internal_extension(), 
      GetArenaForAllocation());
  }
  raw_input_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    raw_input_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_raw_input()) {
    raw_input_.Set(from._internal_raw_input(), 
      GetArenaForAllocation());
  }
  preferred_domestic_carrier_code_.InitDefault();
  #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
    preferred_domestic_carrier_code_.Set("", GetArenaForAllocation());
  #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
  if (from._internal_has_preferred_domestic_carrier_code()) {
    preferred_domestic_carrier_code_.Set(from._internal_preferred_domestic_carrier_code(), 
      GetArenaForAllocation());
  }
  ::memcpy(&national_number_, &from.national_number_,
    static_cast<size_t>(reinterpret_cast<char*>(&number_of_leading_zeros_) -
    reinterpret_cast<char*>(&national_number_)) + sizeof(number_of_leading_zeros_));
  // @@protoc_insertion_point(copy_constructor:i18n.phonenumbers.PhoneNumber)
}

inline void PhoneNumber::SharedCtor() {
extension_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  extension_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
raw_input_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  raw_input_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
preferred_domestic_carrier_code_.InitDefault();
#ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
  preferred_domestic_carrier_code_.Set("", GetArenaForAllocation());
#endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
::memset(reinterpret_cast<char*>(this) + static_cast<size_t>(
    reinterpret_cast<char*>(&national_number_) - reinterpret_cast<char*>(this)),
    0, static_cast<size_t>(reinterpret_cast<char*>(&country_code_source_) -
    reinterpret_cast<char*>(&national_number_)) + sizeof(country_code_source_));
number_of_leading_zeros_ = 1;
}

PhoneNumber::~PhoneNumber() {
  // @@protoc_insertion_point(destructor:i18n.phonenumbers.PhoneNumber)
  if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
  (void)arena;
    return;
  }
  SharedDtor();
}

inline void PhoneNumber::SharedDtor() {
  GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
  extension_.Destroy();
  raw_input_.Destroy();
  preferred_domestic_carrier_code_.Destroy();
}

void PhoneNumber::SetCachedSize(int size) const {
  _cached_size_.Set(size);
}

void PhoneNumber::Clear() {
// @@protoc_insertion_point(message_clear_start:i18n.phonenumbers.PhoneNumber)
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    if (cached_has_bits & 0x00000001u) {
      extension_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000002u) {
      raw_input_.ClearNonDefaultToEmpty();
    }
    if (cached_has_bits & 0x00000004u) {
      preferred_domestic_carrier_code_.ClearNonDefaultToEmpty();
    }
  }
  if (cached_has_bits & 0x000000f8u) {
    ::memset(&national_number_, 0, static_cast<size_t>(
        reinterpret_cast<char*>(&country_code_source_) -
        reinterpret_cast<char*>(&national_number_)) + sizeof(country_code_source_));
    number_of_leading_zeros_ = 1;
  }
  _has_bits_.Clear();
  _internal_metadata_.Clear<std::string>();
}

const char* PhoneNumber::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
  _Internal::HasBits has_bits{};
  while (!ctx->Done(&ptr)) {
    uint32_t tag;
    ptr = ::_pbi::ReadTag(ptr, &tag);
    switch (tag >> 3) {
      // required int32 country_code = 1;
      case 1:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
          _Internal::set_has_country_code(&has_bits);
          country_code_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // required uint64 national_number = 2;
      case 2:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
          _Internal::set_has_national_number(&has_bits);
          national_number_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string extension = 3;
      case 3:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 26)) {
          auto str = _internal_mutable_extension();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional bool italian_leading_zero = 4;
      case 4:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 32)) {
          _Internal::set_has_italian_leading_zero(&has_bits);
          italian_leading_zero_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional string raw_input = 5;
      case 5:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 42)) {
          auto str = _internal_mutable_raw_input();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional .i18n.phonenumbers.PhoneNumber.CountryCodeSource country_code_source = 6;
      case 6:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
          uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
          CHK_(ptr);
          if (PROTOBUF_PREDICT_TRUE(::i18n::phonenumbers::PhoneNumber_CountryCodeSource_IsValid(val))) {
            _internal_set_country_code_source(static_cast<::i18n::phonenumbers::PhoneNumber_CountryCodeSource>(val));
          } else {
            ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
          }
        } else
          goto handle_unusual;
        continue;
      // optional string preferred_domestic_carrier_code = 7;
      case 7:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 58)) {
          auto str = _internal_mutable_preferred_domestic_carrier_code();
          ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      // optional int32 number_of_leading_zeros = 8 [default = 1];
      case 8:
        if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
          _Internal::set_has_number_of_leading_zeros(&has_bits);
          number_of_leading_zeros_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
          CHK_(ptr);
        } else
          goto handle_unusual;
        continue;
      default:
        goto handle_unusual;
    }  // switch
  handle_unusual:
    if ((tag == 0) || ((tag & 7) == 4)) {
      CHK_(ptr);
      ctx->SetLastTag(tag);
      goto message_done;
    }
    ptr = UnknownFieldParse(
        tag,
        _internal_metadata_.mutable_unknown_fields<std::string>(),
        ptr, ctx);
    CHK_(ptr != nullptr);
  }  // while
message_done:
  _has_bits_.Or(has_bits);
  return ptr;
failure:
  ptr = nullptr;
  goto message_done;
#undef CHK_
}

uint8_t* PhoneNumber::_InternalSerialize(
    uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
  // @@protoc_insertion_point(serialize_to_array_start:i18n.phonenumbers.PhoneNumber)
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  // required int32 country_code = 1;
  if (cached_has_bits & 0x00000010u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_country_code(), target);
  }

  // required uint64 national_number = 2;
  if (cached_has_bits & 0x00000008u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_national_number(), target);
  }

  // optional string extension = 3;
  if (cached_has_bits & 0x00000001u) {
    target = stream->WriteStringMaybeAliased(
        3, this->_internal_extension(), target);
  }

  // optional bool italian_leading_zero = 4;
  if (cached_has_bits & 0x00000020u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteBoolToArray(4, this->_internal_italian_leading_zero(), target);
  }

  // optional string raw_input = 5;
  if (cached_has_bits & 0x00000002u) {
    target = stream->WriteStringMaybeAliased(
        5, this->_internal_raw_input(), target);
  }

  // optional .i18n.phonenumbers.PhoneNumber.CountryCodeSource country_code_source = 6;
  if (cached_has_bits & 0x00000040u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteEnumToArray(
      6, this->_internal_country_code_source(), target);
  }

  // optional string preferred_domestic_carrier_code = 7;
  if (cached_has_bits & 0x00000004u) {
    target = stream->WriteStringMaybeAliased(
        7, this->_internal_preferred_domestic_carrier_code(), target);
  }

  // optional int32 number_of_leading_zeros = 8 [default = 1];
  if (cached_has_bits & 0x00000080u) {
    target = stream->EnsureSpace(target);
    target = ::_pbi::WireFormatLite::WriteInt32ToArray(8, this->_internal_number_of_leading_zeros(), target);
  }

  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
        static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:i18n.phonenumbers.PhoneNumber)
  return target;
}

size_t PhoneNumber::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:i18n.phonenumbers.PhoneNumber)
  size_t total_size = 0;

  if (_internal_has_national_number()) {
    // required uint64 national_number = 2;
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_national_number());
  }

  if (_internal_has_country_code()) {
    // required int32 country_code = 1;
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_country_code());
  }

  return total_size;
}
size_t PhoneNumber::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:i18n.phonenumbers.PhoneNumber)
  size_t total_size = 0;

  if (((_has_bits_[0] & 0x00000018) ^ 0x00000018) == 0) {  // All required fields are present.
    // required uint64 national_number = 2;
    total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_national_number());

    // required int32 country_code = 1;
    total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_country_code());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  uint32_t cached_has_bits = 0;
  // Prevent compiler warnings about cached_has_bits being unused
  (void) cached_has_bits;

  cached_has_bits = _has_bits_[0];
  if (cached_has_bits & 0x00000007u) {
    // optional string extension = 3;
    if (cached_has_bits & 0x00000001u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_extension());
    }

    // optional string raw_input = 5;
    if (cached_has_bits & 0x00000002u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_raw_input());
    }

    // optional string preferred_domestic_carrier_code = 7;
    if (cached_has_bits & 0x00000004u) {
      total_size += 1 +
        ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
          this->_internal_preferred_domestic_carrier_code());
    }

  }
  if (cached_has_bits & 0x000000e0u) {
    // optional bool italian_leading_zero = 4;
    if (cached_has_bits & 0x00000020u) {
      total_size += 1 + 1;
    }

    // optional .i18n.phonenumbers.PhoneNumber.CountryCodeSource country_code_source = 6;
    if (cached_has_bits & 0x00000040u) {
      total_size += 1 +
        ::_pbi::WireFormatLite::EnumSize(this->_internal_country_code_source());
    }

    // optional int32 number_of_leading_zeros = 8 [default = 1];
    if (cached_has_bits & 0x00000080u) {
      total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_number_of_leading_zeros());
    }

  }
  if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
    total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
  }
  int cached_size = ::_pbi::ToCachedSize(total_size);
  SetCachedSize(cached_size);
  return total_size;
}

void PhoneNumber::CheckTypeAndMergeFrom(
    const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
  MergeFrom(*::_pbi::DownCast<const PhoneNumber*>(
      &from));
}

void PhoneNumber::MergeFrom(const PhoneNumber& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:i18n.phonenumbers.PhoneNumber)
  GOOGLE_DCHECK_NE(&from, this);
  uint32_t cached_has_bits = 0;
  (void) cached_has_bits;

  cached_has_bits = from._has_bits_[0];
  if (cached_has_bits & 0x000000ffu) {
    if (cached_has_bits & 0x00000001u) {
      _internal_set_extension(from._internal_extension());
    }
    if (cached_has_bits & 0x00000002u) {
      _internal_set_raw_input(from._internal_raw_input());
    }
    if (cached_has_bits & 0x00000004u) {
      _internal_set_preferred_domestic_carrier_code(from._internal_preferred_domestic_carrier_code());
    }
    if (cached_has_bits & 0x00000008u) {
      national_number_ = from.national_number_;
    }
    if (cached_has_bits & 0x00000010u) {
      country_code_ = from.country_code_;
    }
    if (cached_has_bits & 0x00000020u) {
      italian_leading_zero_ = from.italian_leading_zero_;
    }
    if (cached_has_bits & 0x00000040u) {
      country_code_source_ = from.country_code_source_;
    }
    if (cached_has_bits & 0x00000080u) {
      number_of_leading_zeros_ = from.number_of_leading_zeros_;
    }
    _has_bits_[0] |= cached_has_bits;
  }
  _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
}

void PhoneNumber::CopyFrom(const PhoneNumber& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:i18n.phonenumbers.PhoneNumber)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool PhoneNumber::IsInitialized() const {
  if (_Internal::MissingRequiredFields(_has_bits_)) return false;
  return true;
}

void PhoneNumber::InternalSwap(PhoneNumber* other) {
  using std::swap;
  auto* lhs_arena = GetArenaForAllocation();
  auto* rhs_arena = other->GetArenaForAllocation();
  _internal_metadata_.InternalSwap(&other->_internal_metadata_);
  swap(_has_bits_[0], other->_has_bits_[0]);
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &extension_, lhs_arena,
      &other->extension_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &raw_input_, lhs_arena,
      &other->raw_input_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
      &preferred_domestic_carrier_code_, lhs_arena,
      &other->preferred_domestic_carrier_code_, rhs_arena
  );
  ::PROTOBUF_NAMESPACE_ID::internal::memswap<
      PROTOBUF_FIELD_OFFSET(PhoneNumber, country_code_source_)
      + sizeof(PhoneNumber::country_code_source_)
      - PROTOBUF_FIELD_OFFSET(PhoneNumber, national_number_)>(
          reinterpret_cast<char*>(&national_number_),
          reinterpret_cast<char*>(&other->national_number_));
  swap(number_of_leading_zeros_, other->number_of_leading_zeros_);
}

std::string PhoneNumber::GetTypeName() const {
  return "i18n.phonenumbers.PhoneNumber";
}


// @@protoc_insertion_point(namespace_scope)
}  // namespace phonenumbers
}  // namespace i18n
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::i18n::phonenumbers::PhoneNumber*
Arena::CreateMaybeMessage< ::i18n::phonenumbers::PhoneNumber >(Arena* arena) {
  return Arena::CreateMessageInternal< ::i18n::phonenumbers::PhoneNumber >(arena);
}
PROTOBUF_NAMESPACE_CLOSE

// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
